@pg-boss/dashboard 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/bin/cli.js +2 -2
- package/build/client/assets/MenuTrigger-CkqlwCsV.js +1 -0
- package/build/client/assets/_index-CNX0dPQi.js +1 -0
- package/build/client/assets/badge-DFReduIj.js +1 -0
- package/build/client/assets/button-CafwM-5D.js +1 -0
- package/build/client/assets/check-BePyOaOM.js +1 -0
- package/build/client/assets/chevron-down-C8oENez_.js +1 -0
- package/build/client/assets/chevron-right-B0sTJmdc.js +1 -0
- package/build/client/assets/createLucideIcon-oZ0wXCaF.js +1 -0
- package/build/client/assets/db-link-DISwKBYZ.js +1 -0
- package/build/client/assets/dialog-IBPuwpas.js +1 -0
- package/build/client/assets/entry.client-6KjasuHH.js +9 -0
- package/build/client/assets/error-card-2aexlkmv.js +1 -0
- package/build/client/assets/filter-select-Dln9CAM3.js +1 -0
- package/build/client/assets/jobs-BjoGjnb0.js +1 -0
- package/build/client/assets/jsx-runtime-DcdjQ3vN.js +26 -0
- package/build/client/assets/manifest-e6a94de0.js +1 -0
- package/build/client/assets/pagination-5gEldBFM.js +1 -0
- package/build/client/assets/queues._index-BM3eKnSr.js +1 -0
- package/build/client/assets/queues._name-DSOGXBen.js +1 -0
- package/build/client/assets/queues._name.jobs._jobId-DKGu8NkE.js +1 -0
- package/build/client/assets/queues.create-BVR72i85.js +1 -0
- package/build/client/assets/react-dom-DQHA9Ik4.js +1 -0
- package/build/client/assets/root-Cvarn0sH.js +40 -0
- package/build/client/assets/root-D24FtLBP.css +2 -0
- package/build/client/assets/schedules-CE-hWC9e.js +1 -0
- package/build/client/assets/schedules._name._key-DT8Kg4jU.js +1 -0
- package/build/client/assets/schedules.new-bKRusXXO.js +1 -0
- package/build/client/assets/send-BaWw8x7J.js +1 -0
- package/build/client/assets/stat-card-y2feeHt0.js +1 -0
- package/build/client/assets/table-B5BEGV9S.js +1 -0
- package/build/client/assets/useOpenInteractionType-BGObzouY.js +1 -0
- package/build/client/assets/warnings-lzi34PdC.js +1 -0
- package/build/client/assets/x-EA6eZ1AP.js +1 -0
- package/build/server/index.js +10402 -28
- package/build/server.js +127 -0
- package/package.json +26 -26
- package/build/client/assets/MenuTrigger-CoRd-BqL.js +0 -1
- package/build/client/assets/_index-BTx7NRR8.js +0 -1
- package/build/client/assets/badge-DBD4CzAv.js +0 -1
- package/build/client/assets/button-Ba8FWhqs.js +0 -1
- package/build/client/assets/chevron-down-CYa4FYmp.js +0 -1
- package/build/client/assets/chunk-UVKPFVEO-YfSfkVr_.js +0 -26
- package/build/client/assets/createLucideIcon-Bt-yXILq.js +0 -1
- package/build/client/assets/db-link-CU7IJqbq.js +0 -1
- package/build/client/assets/dialog-Dkx42Rkd.js +0 -1
- package/build/client/assets/entry.client-DXZUROTm.js +0 -13
- package/build/client/assets/error-card-D-uZRy_l.js +0 -1
- package/build/client/assets/filter-select-Tk_CBvrn.js +0 -1
- package/build/client/assets/index-DuhoQwUK.js +0 -1
- package/build/client/assets/jobs-ouYjIGAi.js +0 -1
- package/build/client/assets/manifest-72f6b3e9.js +0 -1
- package/build/client/assets/pagination-BItl293Q.js +0 -1
- package/build/client/assets/queues._index-_ID9kaow.js +0 -1
- package/build/client/assets/queues._name-DwdbQND-.js +0 -1
- package/build/client/assets/queues._name.jobs._jobId-DrgG3VBb.js +0 -1
- package/build/client/assets/queues.create-CmVW5UVm.js +0 -1
- package/build/client/assets/root-Bpb4WtY4.css +0 -1
- package/build/client/assets/root-DDqOT0vL.js +0 -35
- package/build/client/assets/schedules-B6ixYsvz.js +0 -1
- package/build/client/assets/schedules._name._key-CXTVKoOc.js +0 -1
- package/build/client/assets/schedules.new-Dmasri9v.js +0 -1
- package/build/client/assets/send-CqR34Z50.js +0 -1
- package/build/client/assets/table-Au2E5mnP.js +0 -1
- package/build/client/assets/useOpenInteractionType-mgYMZAa8.js +0 -12
- package/build/client/assets/warnings-Dj3qacgN.js +0 -1
- package/build/server/assets/auth.server-DgTIakNo.js +0 -17
- package/build/server/assets/config.server-CARiqCUE.js +0 -54
- package/build/server/assets/node-DzjK5u9i.js +0 -176
- package/build/server/assets/server-build.js +0 -10022
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(ee(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ne={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),u=o(((e,t)=>{t.exports=l()})),d=c(u(),1),f=`modulepreload`,p=function(e){return`/`+e},m={},h=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=p(t,n),t in m)return;m[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:f,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},g=e=>{throw TypeError(e)},_=(e,t,n)=>t.has(e)||g(`Cannot `+n),v=(e,t,n)=>(_(e,t,`read from private field`),n?n.call(e):t.get(e)),y=(e,t,n)=>t.has(e)?g(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),b=(e,t,n,r)=>(_(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),x=`popstate`;function S(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function C(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return O(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:k(t)}return j(t,n,null,e)}function w(e,t){if(e===!1||e==null)throw Error(t)}function T(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function E(){return Math.random().toString(36).substring(2,10)}function D(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function O(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?A(t):t,state:n,key:t&&t.key||r||E(),mask:i}}function k({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function A(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function j(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=S(e)?e:O(h.location,e,t);n&&n(r,e),l=u()+1;let d=D(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=S(e)?e:O(h.location,e,t);n&&n(r,e),l=u();let i=D(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ee(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(x,d),c=e,()=>{i.removeEventListener(x,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ee(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),w(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:k(t);return i=i.replace(/ $/,`%20`),!n&&i.startsWith(`//`)&&(i=r+i),new URL(i,r)}function M(e){return{defaultValue:e}}var N,te=class{constructor(e){if(y(this,N,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(v(this,N).has(e))return v(this,N).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){v(this,N).set(e,t)}};N=new WeakMap;var P=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function ne(e){return P.has(e)}var re=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function ie(e){return re.has(e)}function ae(e){return e.index===!0}function oe(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(w(e.index!==!0||!e.children,`Cannot specify children on an index route`),w(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),ae(e)){let n={...e,id:s};return r[s]=F(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=F(n,t(n)),e.children&&(n.children=oe(e.children,t,o,r,i)),n}})}function F(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function se(e,t,n=`/`){return I(e,t,n,!1)}function I(e,t,n,r,i){let a=H((typeof t==`string`?A(t):t).pathname||`/`,n);if(a==null)return null;let o=i??le(e),s=null,c=be(a);for(let e=0;s==null&&e<o.length;++e)s=_e(o[e],c,r);return s}function ce(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function le(e){let t=ue(e);return de(t),t}function ue(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;w(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=W([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(w(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ue(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ge(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of L(e.path))a(e,t,!0,n)}),t}function L(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=L(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function de(e){e.sort((e,t)=>e.score===t.score?V(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var R=/^:[\w-]+$/,z=3,B=2,fe=1,pe=10,me=-2,he=e=>e===`*`;function ge(e,t){let n=e.split(`/`),r=n.length;return n.some(he)&&(r+=me),t&&(r+=B),n.filter(e=>!he(e)).reduce((e,t)=>e+(R.test(t)?z:t===``?fe:pe),r)}function V(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function _e(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=ve({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=ve({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:W([a,u.pathname]),pathnameBase:je(W([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=W([a,u.pathnameBase]))}return o}function ve(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ye(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ye(e,t=!1,n=!0){T(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 r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function be(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return T(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function H(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function xe({basename:e,pathname:t}){return t===`/`?e:W([e,t])}var Se=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ce=e=>Se.test(e);function we(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?A(e):e,a;return n?(n=ke(n),a=n.startsWith(`/`)?Te(n.substring(1),`/`):Te(n,t)):a=t,{pathname:a,search:Me(r),hash:Ne(i)}}function Te(e,t){let n=Ae(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ee(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function De(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Oe(e){let t=De(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function U(e,t,n,r=!1){let i;typeof e==`string`?i=A(e):(i={...e},w(!i.pathname||!i.pathname.includes(`?`),Ee(`?`,`pathname`,`search`,i)),w(!i.pathname||!i.pathname.includes(`#`),Ee(`#`,`pathname`,`hash`,i)),w(!i.search||!i.search.includes(`#`),Ee(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=we(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var ke=e=>e.replace(/\/\/+/g,`/`),W=e=>ke(e.join(`/`)),Ae=e=>e.replace(/\/+$/,``),je=e=>Ae(e).replace(/^\/*/,`/`),Me=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ne=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Pe=class{constructor(e,t){this.type=`DataWithResponseInit`,this.data=e,this.init=t||null}};function Fe(e,t){return new Pe(e,typeof t==`number`?{status:t}:t)}var Ie=(e,t=302)=>{let n=t;typeof n==`number`?n={status:n}:n.status===void 0&&(n.status=302);let r=new Headers(n.headers);return r.set(`Location`,e),new Response(null,{...n,headers:r})},G=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Le(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Re(e){return W(e.map(e=>e.route.path).filter(Boolean))||`/`}var ze=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Be(e,t){let n=e;if(typeof n!=`string`||!Se.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ze)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=H(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{T(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Ve=Symbol(`Uninstrumented`);function He(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=We(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=We(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[Ve]??i,a=We(n[e],t,(...e)=>Ke(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Ve]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Ve]??e,r=We(n.middleware,t,(...e)=>Ke(e[0]));return r?(r[Ve]=t,r):e})),r}function Ue(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[Ve]??e.navigate,r=We(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?k(n):`.`,...qe(e,r??{})}});r&&(r[Ve]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Ve]??e.fetch,r=We(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...qe(e,i??{})}});r&&(r[Ve]=t,e.fetch=r)}return e}function We(e,t,n){return e.length===0?null:async(...r)=>{let i=await Ge(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Ge(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=Ge(e,t,n,r-1),a=await o,w(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function Ke(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:Je(t),params:{...r},pattern:i,context:Ye(n)}}function qe(e,t){return{currentUrl:k(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Je(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Ye(e){if(Ze(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Xe=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Ze(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Xe}var Qe=[`POST`,`PUT`,`PATCH`,`DELETE`],$e=new Set(Qe),et=[`GET`,...Qe],tt=new Set(et),nt=new Set([301,302,303,307,308]),rt=new Set([307,308]),it={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},at={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ot={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},st=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),ct=`remix-router-transitions`,lt=Symbol(`ResetLoaderData`),ut,dt,ft,pt,mt=class{constructor(e){y(this,ut),y(this,dt),y(this,ft),y(this,pt),b(this,ut,e),b(this,dt,le(e))}get stableRoutes(){return v(this,ut)}get activeRoutes(){return v(this,ft)??v(this,ut)}get branches(){return v(this,pt)??v(this,dt)}get hasHMRRoutes(){return v(this,ft)!=null}setRoutes(e){b(this,ut,e),b(this,dt,le(e))}setHmrRoutes(e){b(this,ft,e),b(this,pt,le(e))}commitHmrRoutes(){v(this,ft)&&(b(this,ut,v(this,ft)),b(this,dt,v(this,pt)),b(this,ft,void 0),b(this,pt,void 0))}};ut=new WeakMap,dt=new WeakMap,ft=new WeakMap,pt=new WeakMap;function ht(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;w(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||st,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...He(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new mt(oe(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Mt,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=I(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=K(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=tn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Qe(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Qe(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>bt(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=xt(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,E={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:it,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},D=`POP`,k=null,j=!1,M,N=!1,P=new Map,ne=null,re=!1,ie=!1,ae=new Set,F=new Map,se=0,le=-1,ue=new Map,L=new Set,de=new Map,R=new Map,z=new Set,B=new Map,fe,pe=null;function me(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(fe){fe(),fe=void 0;return}T(B.size===0||r!=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 i=Ke({currentLocation:E.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{fe=e});e.history.go(r*-1),Ge(i,{state:`blocked`,location:n,proceed(){Ge(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(E.blockers);e.set(i,ot),V({blockers:e})}}),k?.resolve(),k=null;return}return be(t,n)}),n){Cn(t,P);let e=()=>wn(t,P);t.addEventListener(`pagehide`,e),ne=()=>t.removeEventListener(`pagehide`,e)}return E.initialized||be(`POP`,E.location,{initialHydration:!0}),C}function he(){d&&d(),ne&&ne(),f.clear(),M&&M.abort(),E.fetchers.forEach((e,t)=>Fe(E.fetchers,t)),E.blockers.forEach((e,t)=>We(t))}function ge(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(E,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function V(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),E={...E,...e};let n=[],r=[];E.fetchers.forEach((e,t)=>{e.state===`idle`&&(z.has(t)?n.push(t):r.push(t))}),z.forEach(e=>{!E.fetchers.has(e)&&!F.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(E,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Fe(E.fetchers,e)),r.forEach(e=>E.fetchers.delete(e))}function _e(t,n,{flushSync:r}={}){let i=E.actionData!=null&&E.navigation.formMethod!=null&&J(E.navigation.formMethod)&&E.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?E.actionData:null;let o=n.loaderData?Qt(E.loaderData,n.loaderData,n.matches||[],n.errors):E.loaderData,c=E.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,ot)));let l=re?!1:Ze(t,n.matches||E.matches),u=j===!0||E.navigation.formMethod!=null&&J(E.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),re||D===`POP`||(D===`PUSH`?e.history.push(t,t.state):D===`REPLACE`&&e.history.replace(t,t.state));let d;if(D===`POP`){let e=P.get(E.location.pathname);e&&e.has(t.pathname)?d={currentLocation:E.location,nextLocation:t}:P.has(t.pathname)&&(d={currentLocation:t,nextLocation:E.location})}else if(N){let e=P.get(E.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),P.set(E.location.pathname,e)),d={currentLocation:E.location,nextLocation:t}}V({...n,actionData:a,loaderData:o,historyAction:D,location:t,initialized:!0,renderFallback:!1,navigation:it,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),D=`POP`,j=!1,N=!1,re=!1,ie=!1,k?.resolve(),k=null,pe?.resolve(),pe=null}async function ve(t,n){if(k?.resolve(),k=null,typeof t==`number`){k||=Tn();let n=k.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=vt(!1,_t(E.location,E.matches,c,t,n?.fromRouteId,n?.relative),n),o;n?.mask&&(o={pathname:``,search:``,hash:``,...typeof n.mask==`string`?A(n.mask):{...E.location.mask,...n.mask}});let s=E.location,l=O(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&J(i.formMethod)&&i.formAction===E.location.pathname+E.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=Ke({currentLocation:s,nextLocation:l,historyAction:d});if(m){Ge(m,{state:`blocked`,location:l,proceed(){Ge(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),ve(t,n)},reset(){let e=new Map(E.blockers);e.set(m,ot),V({blockers:e})}});return}await be(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function ye(){pe||=Tn(),Ae(),V({revalidation:`loading`});let e=pe.promise;return E.navigation.state===`submitting`?e:E.navigation.state===`idle`?(be(E.historyAction,E.location,{startUninterruptedRevalidation:!0}),e):(be(D||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:N===!0}),e)}async function be(t,n,r){M&&M.abort(),M=null,D=t,re=(r&&r.startUninterruptedRevalidation)===!0,Xe(E.location,E.matches),j=(r&&r.preventScrollReset)===!0,N=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&E.matches&&E.matches.length>0&&!y?E.matches:I(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&E.initialized&&!ie&&an(E.location,n)&&!(r&&r.submission&&J(r.submission.formMethod))){_e(n,{matches:a},{flushSync:o});return}let l=Qe(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=qe(n.pathname);_e(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;M=new AbortController;let d=Kt(e.history,n,M.signal,r&&r.submission),f=e.getContext?await e.getContext():new te,p;if(r&&r.pendingError)p=[en(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&J(r.submission.formMethod)){let i=await xe(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(q(t)&&Le(t.error)&&t.error.status===404){M=null,_e(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=yn(n,a,t,r.submission),o=!1,l.active=!1,d=Kt(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await Se(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(M=null,_e(n,{matches:h||a,...$t(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function xe(t,n,i,l,u,d,f,p,m={}){if(Ae(),V({navigation:bn(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await $e(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=tn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=en(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=qe(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=_n(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:K(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await ke(t,n,Rt(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(un(h)){let n;return n=m&&m.replace!=null?m.replace:Gt(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===E.location.pathname+E.location.search,await U(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(q(h)){let e=en(l,g.route.id);return(m&&m.replace)!==!0&&(D=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function Se(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||yn(n,i,l,p),x=p||m||vn(b),S=!re&&!g;if(d){if(S){let e=we(v);V({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await $e(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=tn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=en(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=qe(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=yt(t,u,a,o,e.history,E,i,x,n,g?[]:r,g===!0,ie,ae,z,de,L,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(le=++se,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=new Map(E.fetchers),t=ze(e);return _e(n,{matches:i,loaderData:{},errors:v&&q(v[1])?{[v[0]]:v[1].error}:null,...$t(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=we(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Te(T)),V(e,{flushSync:_})}T.forEach(e=>{G(e.key),e.controller&&F.set(e.key,e.controller)});let D=()=>T.forEach(e=>G(e.key));M&&M.signal.addEventListener(`abort`,D);let{loaderResults:O,fetcherResults:k}=await W(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};M&&M.signal.removeEventListener(`abort`,D),T.forEach(e=>F.delete(e.key));let A=nn(O);if(A)return await U(t,A.result,!0,{replace:h}),{shortCircuited:!0};if(A=nn(k),A)return L.add(A.key),await U(t,A.result,!0,{replace:h}),{shortCircuited:!0};let j=new Map(E.fetchers),{loaderData:ee,errors:N}=Zt(E,i,O,v,T,k,j);g&&E.errors&&(N={...E.errors,...N});let te=ze(j),P=Be(le,j),ne=te||P||T.length>0;return{matches:i,loaderData:ee,errors:N,...ne?{workingFetchers:j}:{}}}function we(e){if(e&&!q(e[1]))return{[e[0]]:e[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function Te(e){let t=new Map(E.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=xn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ee(t,n,r,i){G(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=_t(E.location,E.matches,c,r,n,i?.relative),u=I(o,l,c,!1,s.branches),d=Qe(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){Me(t,n,K(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=vt(!0,l,i);if(m){Me(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new te,g=(i&&i.preventScrollReset)===!0;if(p&&J(p.formMethod)){await De(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}de.set(t,{routeId:n,path:f}),await Oe(t,n,f,u,h,d.active,a,g,p)}async function De(t,n,i,l,u,d,f,p,m,h){Ae(),de.delete(t),je(t,Sn(m,E.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=Kt(e.history,i,g.signal,m);if(d){let e=await $e(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Me(t,n,e.error,{flushSync:f});return}else if(e.matches)l=e.matches;else{Me(t,n,K(404,{pathname:i}),{flushSync:f});return}}let v=_n(l,i);if(!v.route.action&&!v.route.lazy){Me(t,n,K(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}F.set(t,g);let y=se,b=Rt(a,o,_,i,l,v,r,u),x=await ke(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){F.get(t)===g&&F.delete(t);return}if(z.has(t)){if(un(S)||q(S)){je(t,Y(void 0));return}}else{if(un(S))if(F.delete(t),le>y){je(t,Y(void 0));return}else return L.add(t),je(t,xn(m)),U(_,S,!1,{fetcherSubmission:m,preventScrollReset:p});if(q(S)){Me(t,n,S.error);return}}let C=E.navigation.location||E.location,T=Kt(e.history,C,g.signal),O=s.activeRoutes,k=E.navigation.state===`idle`?E.matches:I(O,E.navigation.location,c,!1,s.branches);w(k,`Didn't find any matches after fetcher action`);let A=++se;ue.set(t,A);let{dsMatches:j,revalidatingFetchers:ee}=yt(T,u,a,o,e.history,E,k,m,C,r,!1,ie,ae,z,de,L,O,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),N=xn(m,S.data),te=new Map(E.fetchers);te.set(t,N),ee.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=te.get(t),r=xn(void 0,n?n.data:void 0);te.set(t,r),G(t),e.controller&&F.set(t,e.controller)}),V({fetchers:te});let P=()=>ee.forEach(e=>G(e.key));g.signal.addEventListener(`abort`,P);let{loaderResults:ne,fetcherResults:re}=await W(j,ee,T,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,P),ue.delete(t),F.delete(t),ee.forEach(e=>F.delete(e.key));let oe=E.fetchers.has(t),ce=e=>{if(!oe)return e;let n=new Map(e.fetchers);return n.set(t,Y(S.data)),{...e,fetchers:n}},R=nn(ne);if(R)return E=ce(E),U(T,R.result,!1,{preventScrollReset:p});if(R=nn(re),R)return L.add(R.key),E=ce(E),U(T,R.result,!1,{preventScrollReset:p});let B=new Map(E.fetchers);oe&&B.set(t,Y(S.data));let{loaderData:fe,errors:pe}=Zt(E,k,ne,void 0,ee,re,B);Be(A,B),E.navigation.state===`loading`&&A>le?(w(D,`Expected pending action`),M&&M.abort(),_e(E.navigation.location,{matches:k,loaderData:fe,errors:pe,fetchers:B})):(V({errors:pe,loaderData:Qt(E.loaderData,fe,k,pe),fetchers:B}),ie=!1)}async function Oe(t,n,i,s,c,l,u,d,f){let p=E.fetchers.get(t);je(t,xn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Kt(e.history,i,m.signal);if(l){let e=await $e(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Me(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{Me(t,n,K(404,{pathname:i}),{flushSync:u});return}}let g=_n(s,i);F.set(t,m);let _=se,v=await ke(h,i,Rt(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(F.get(t)===m&&F.delete(t),!h.signal.aborted){if(z.has(t)){je(t,Y(void 0));return}if(un(y))if(le>_){je(t,Y(void 0));return}else{L.add(t),await U(h,y,!1,{preventScrollReset:d});return}if(q(y)){Me(t,n,y.error);return}je(t,Y(y.data))}}async function U(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(k?.resolve(),k=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ie=!0);let d=i.response.headers.get(`Location`);w(d,`Expected a Location header on the redirect Response`),d=Gt(d,new URL(r.url),c,e.history);let f=O(E.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Ce(d)){let n=ee(t,d,!0);e=n.origin!==t.location.origin||H(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}M=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:h,formEncType:g}=E.navigation;!o&&!s&&m&&h&&g&&(o=vn(E.navigation));let _=o||s;rt.has(i.response.status)&&_&&J(_.formMethod)?await be(p,f,{submission:{..._,formAction:d},preventScrollReset:l||j,enableViewTransition:a?N:void 0}):await be(p,f,{overrideNavigation:yn(f,[],p,o),fetcherSubmission:s,preventScrollReset:l||j,enableViewTransition:a?N:void 0})}async function ke(e,t,n,r,i){let a,o={};try{a=await zt(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!J(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!E.loaderData.hasOwnProperty(e.route.id)&&(!E.errors||!E.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(ln(r)){let i=r.result;o[t]={type:`redirect`,response:Ut(i,e,t,n,c)}}else o[t]=await Ht(r);return o}async function W(e,t,n,r,i){let a=ke(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ke(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}else return Promise.resolve({[e.key]:{type:`error`,error:K(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Ae(){ie=!0,de.forEach((e,t)=>{F.has(t)&&ae.add(t),G(t)})}function je(e,t,n={}){let r=new Map(E.fetchers);r.set(e,t),V({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Me(e,t,n,r={}){let i=en(E.matches,t),a=new Map(E.fetchers);Fe(a,e),V({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Ne(e){return R.set(e,(R.get(e)||0)+1),z.has(e)&&z.delete(e),E.fetchers.get(e)||at}function Pe(e,t){G(e,t?.reason),je(e,Y(null))}function Fe(e,t){let n=E.fetchers.get(t);F.has(t)&&!(n&&n.state===`loading`&&ue.has(t))&&G(t),de.delete(t),ue.delete(t),L.delete(t),z.delete(t),ae.delete(t),e.delete(t)}function Ie(e){let t=(R.get(e)||0)-1;t<=0?(R.delete(e),z.add(e)):R.set(e,t),V({fetchers:new Map(E.fetchers)})}function G(e,t){let n=F.get(e);n&&(n.abort(t),F.delete(e))}function Re(e,t){for(let n of e){let e=t.get(n);w(e,`Expected fetcher: ${n}`);let r=Y(e.data);t.set(n,r)}}function ze(e){let t=[],n=!1;for(let r of L){let i=e.get(r);w(i,`Expected fetcher: ${r}`),i.state===`loading`&&(L.delete(r),t.push(r),n=!0)}return Re(t,e),n}function Be(e,t){let n=[];for(let[r,i]of ue)if(i<e){let e=t.get(r);w(e,`Expected fetcher: ${r}`),e.state===`loading`&&(G(r),ue.delete(r),n.push(r))}return Re(n,t),n.length>0}function Ve(e,t){let n=E.blockers.get(e)||ot;return B.get(e)!==t&&B.set(e,t),n}function We(e){E.blockers.delete(e),B.delete(e)}function Ge(e,t){let n=E.blockers.get(e)||ot;w(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(E.blockers);r.set(e,t),V({blockers:r})}function Ke({currentLocation:e,nextLocation:t,historyAction:n}){if(B.size===0)return;B.size>1&&T(!1,`A router only supports one blocker at a time`);let r=Array.from(B.entries()),[i,a]=r[r.length-1],o=E.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function qe(e){let t=K(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=tn(n);return{notFoundMatches:r,route:i,error:t}}function Je(e,t,n){if(m=e,g=t,h=n||null,!_&&E.navigation===it){_=!0;let e=Ze(E.location,E.matches);e!=null&&V({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function Ye(e,t){return h&&h(e,t.map(e=>ce(e,E.loaderData)))||e.key}function Xe(e,t){if(m&&g){let n=Ye(e,t);m[n]=g()}}function Ze(e,t){if(m){let n=Ye(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Qe(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:I(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:I(n,r,c,!0,e)}}return{active:!1,matches:null}}async function $e(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||Tt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=I(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=I(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&et(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=I(s.activeRoutes,n,c,!0,u),!f||et(l,f))return{type:`success`,matches:null};l=f}}function et(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function tt(e){o={},s.setHmrRoutes(oe(e,a,void 0,o))}function nt(e,t,n=!1){Tt(e,t,s,o,a,n),s.hasHMRRoutes||V({})}return C={get basename(){return c},get future(){return u},get state(){return E},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:me,subscribe:ge,enableScrollRestoration:Je,navigate:ve,fetch:Ee,revalidate:ye,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ne,resetFetcher:Pe,deleteFetcher:Ie,dispose:he,getBlocker:Ve,deleteBlocker:We,patchRoutes:nt,_internalFetchControllers:F,_internalSetRoutes:tt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){V(e)}},e.instrumentations&&(C=Ue(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function gt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function _t(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=U(r||`.`,Oe(o),H(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=gn(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=xe({basename:n,pathname:c.pathname})),k(c)}function vt(e,t,n){if(!n||!gt(n))return{path:t};if(n.formMethod&&!hn(n.formMethod))return{path:t,error:K(405,{method:n.formMethod})};let r=()=>({path:t,error:K(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=rn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!J(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
|
|
2
|
+
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!J(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}w(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Jt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Jt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Yt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Yt(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(J(c.formMethod))return{path:t,submission:c};let l=A(t);return e&&l.search&&gn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:k(l),submission:c}}function yt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?q(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&q(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=Re(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!bt(s))f=!1;else if(u){let{shouldLoad:e}=xt(s,a.loaderData,a.errors);f=e}else St(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Lt(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?Ct(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p};return Lt(n,r,e,c,k,i,l,t,wt(i,m),m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=I(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=_n(b,e.path),C=new AbortController,w=Kt(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Rt(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Rt(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:D?!1:d;let a={...O,defaultShouldRevalidate:i};wt(S,a)&&(T=Rt(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function bt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function xt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!bt(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function St(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Ct(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function wt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Tt(e,t,n,r,i,a){let o;if(e){let t=r[e];w(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Et(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=oe(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=oe([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function Et(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((e,n)=>t.children?.some(t=>Et(e,t)))??!1:!1}var Dt=new WeakMap,Ot=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(w(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Dt.get(i);o||(o={},Dt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=ne(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)T(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)T(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},kt=new WeakMap;function At(e,t,n,r,i){let a=n[e.id];if(w(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=kt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{w(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=ie(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?T(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?T(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return kt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=Ot({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function jt(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Mt(e){return e.matches.some(e=>e.route.middleware)?Nt(e,()=>jt(e)):jt(e)}function Nt(e,t){return Pt(e,t,e=>{if(mn(e))throw e;return e},sn,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=en(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Pt(e,t,n,r,i){let{matches:a,...o}=e;return await Ft(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Ft(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Ft(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function It(e,t,n,r,i){let a=Ot({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=At(r.route,J(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Lt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=It(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?wt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?wt(a,{...l,defaultShouldRevalidate:e}):wt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!J(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(J(n.method)||!p)?Bt({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Rt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Lt(e,t,n,r,Re(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:It(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function zt(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:qt(t,n),pattern:Re(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Nt(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Bt({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=J(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:qt(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw K(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw K(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Vt(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Ht(e){let{result:t,type:n}=e;if(fn(t)){let e;try{e=await Vt(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new G(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?dn(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:on(t),statusCode:Le(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Le(t)?t.status:void 0}:dn(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 Ut(e,t,n,r,i){let a=e.headers.get(`Location`);if(w(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Ce(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=_t(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Wt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Gt(e,t,n,r){if(Ce(e)){let r=e,i=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(Wt.includes(i.protocol))throw Error(`Invalid redirect location`);let a=H(i.pathname,n)!=null;if(i.origin===t.origin&&a)return ke(i.pathname)+i.search+i.hash}try{let t=r.createURL(e);if(Wt.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function Kt(e,t,n,r){let i=e.createURL(rn(t)).toString(),a={signal:n};if(r&&J(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=Jt(r.formData):a.body=r.formData}return new Request(i,a)}function qt(e,t){let n=new URL(e.url),r=typeof t==`string`?A(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function Jt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Yt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Xt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&q(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(w(!un(f),`Cannot handle redirect results in processLoaderData`),q(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=en(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=lt),c||(c=!0,s=Le(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Zt(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Xt(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(w(s,`Did not find corresponding fetcher result`),q(s)){let t=en(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(un(s))w(!1,`Unhandled fetcher revalidation redirect`);else{let e=Y(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Qt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==lt).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function $t(e){return e?q(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function en(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function tn(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function K(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new G(e||500,o,Error(s),!0)}function nn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(un(r))return{key:n,result:r}}}function rn(e){return k({...typeof e==`string`?A(e):e,hash:``})}function an(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function on(e){return new G(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function sn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&cn(t))}function cn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function ln(e){return fn(e.result)&&nt.has(e.result.status)}function q(e){return e.type===`error`}function un(e){return(e&&e.type)===`redirect`}function dn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function fn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function pn(e){return nt.has(e)}function mn(e){return fn(e)&&pn(e.status)&&e.headers.has(`Location`)}function hn(e){return tt.has(e.toUpperCase())}function J(e){return $e.has(e.toUpperCase())}function gn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function _n(e,t){let n=typeof t==`string`?A(t).search:t.search;if(e[e.length-1].route.index&&gn(n||``))return e[e.length-1];let r=De(e);return r[r.length-1]}function vn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function yn(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function bn(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function xn(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 Sn(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 Y(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 Cn(e,t){try{let n=e.sessionStorage.getItem(ct);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function wn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(ct,JSON.stringify(n))}catch(e){T(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Tn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var En=d.createContext(null);En.displayName=`DataRouter`;var Dn=d.createContext(null);Dn.displayName=`DataRouterState`;var On=d.createContext(!1);function kn(){return d.useContext(On)}var An=d.createContext({isTransitioning:!1});An.displayName=`ViewTransition`;var jn=d.createContext(new Map);jn.displayName=`Fetchers`;var Mn=d.createContext(null);Mn.displayName=`Await`;var X=d.createContext(null);X.displayName=`Navigation`;var Nn=d.createContext(null);Nn.displayName=`Location`;var Z=d.createContext({outlet:null,matches:[],isDataRoute:!1});Z.displayName=`Route`;var Pn=d.createContext(null);Pn.displayName=`RouteError`;var Fn=`REACT_ROUTER_ERROR`,In=`REDIRECT`,Ln=`ROUTE_ERROR_RESPONSE`;function Rn(e){if(e.startsWith(`${Fn}:${In}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function zn(e){if(e.startsWith(`${Fn}:${Ln}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new G(t.status,t.statusText,t.data)}catch{}}function Bn(e,{relative:t}={}){w(Vn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=d.useContext(X),{hash:i,pathname:a,search:o}=Yn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:W([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Vn(){return d.useContext(Nn)!=null}function Q(){return w(Vn(),`useLocation() may be used only in the context of a <Router> component.`),d.useContext(Nn).location}var Hn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Un(e){d.useContext(X).static||d.useLayoutEffect(e)}function Wn(){let{isDataRoute:e}=d.useContext(Z);return e?vr():Gn()}function Gn(){w(Vn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=d.useContext(En),{basename:t,navigator:n}=d.useContext(X),{matches:r}=d.useContext(Z),{pathname:i}=Q(),a=JSON.stringify(Oe(r)),o=d.useRef(!1);return Un(()=>{o.current=!0}),d.useCallback((r,s={})=>{if(T(o.current,Hn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=U(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:W([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Kn=d.createContext(null);function qn(e){let t=d.useContext(Z).outlet;return d.useMemo(()=>t&&d.createElement(Kn.Provider,{value:e},t),[t,e])}function Jn(){let{matches:e}=d.useContext(Z);return e[e.length-1]?.params??{}}function Yn(e,{relative:t}={}){let{matches:n}=d.useContext(Z),{pathname:r}=Q(),i=JSON.stringify(Oe(n));return d.useMemo(()=>U(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Xn(e,t,n){w(Vn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=d.useContext(X),{matches:i}=d.useContext(Z),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;br(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (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.
|
|
3
|
+
|
|
4
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Q(),f;if(t){let e=typeof t==`string`?A(t):t;w(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=u;let p=f.pathname||`/`,m=p;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):se(e,{pathname:m});T(l||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),T(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=rr(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:W([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:W([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?d.createElement(Nn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},g):g}function Zn(){let e=hr(),t=Le(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=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:a},`ErrorBoundary`),` or`,` `,d.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),d.createElement(d.Fragment,null,d.createElement(`h2`,null,`Unexpected Application Error!`),d.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?d.createElement(`pre`,{style:i},n):null,o)}var Qn=d.createElement(Zn,null),$n=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?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=zn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:d.createElement(Z.Provider,{value:this.props.routeContext},d.createElement(Pn.Provider,{value:e,children:this.props.component}));return this.context?d.createElement(tr,{error:e},t):t}};$n.contextType=On;var er=new WeakMap;function tr({children:e,error:t}){let{basename:n}=d.useContext(X);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Rn(t.digest);if(e){let r=er.get(t);if(r)throw r;let i=Be(e.location,n);if(ze&&!er.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw er.set(t,n),n}return d.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function nr({routeContext:e,match:t,children:n}){let r=d.useContext(En);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(Z.Provider,{value:e},n)}function rr(e,t=[],n){let r=n?.state;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 i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);w(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Re(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,f=!1,p=null,m=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||Qn,o&&(s<0&&c===0?(br(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):s===c&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?p:f?m:n.route.Component?d.createElement(n.route.Component,null):n.route.element?n.route.element:e,d.createElement(nr,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?d.createElement($n,{location:r.location,revalidation:r.revalidation,component:p,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function ir(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ar(e){let t=d.useContext(En);return w(t,ir(e)),t}function or(e){let t=d.useContext(Dn);return w(t,ir(e)),t}function sr(e){let t=d.useContext(Z);return w(t,ir(e)),t}function cr(e){let t=sr(e),n=t.matches[t.matches.length-1];return w(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function lr(){return cr(`useRouteId`)}function ur(){let e=or(`useNavigation`);return d.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function dr(){let{matches:e,loaderData:t}=or(`useMatches`);return d.useMemo(()=>e.map(e=>ce(e,t)),[e,t])}function fr(){let e=or(`useLoaderData`),t=cr(`useLoaderData`);return e.loaderData[t]}function pr(e){return or(`useRouteLoaderData`).loaderData[e]}function mr(){let e=or(`useActionData`),t=cr(`useLoaderData`);return e.actionData?e.actionData[t]:void 0}function hr(){let e=d.useContext(Pn),t=or(`useRouteError`),n=cr(`useRouteError`);return e===void 0?t.errors?.[n]:e}var gr=0;function _r(e){let{router:t,basename:n}=ar(`useBlocker`),r=or(`useBlocker`),[i,a]=d.useState(``),o=d.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:H(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:H(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return d.useEffect(()=>{let e=String(++gr);return a(e),()=>t.deleteBlocker(e)},[t]),d.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):ot}function vr(){let{router:e}=ar(`useNavigate`),t=cr(`useNavigate`),n=d.useRef(!1);return Un(()=>{n.current=!0}),d.useCallback(async(r,i={})=>{T(n.current,Hn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var yr={};function br(e,t,n){!t&&!yr[e]&&(yr[e]=!0,T(!1,n))}var xr={};function Sr(e,t){!e&&!xr[t]&&(xr[t]=!0,console.warn(t))}var Cr=d.useOptimistic,wr=()=>void 0;function Tr(e){return Cr?Cr(e):[e,wr]}function Er(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&T(!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&&T(!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&&T(!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 Dr=[`HydrateFallback`,`hydrateFallbackElement`],Or=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function kr({router:e,flushSync:t,onError:n,useTransitions:r}){r=kn()||r;let[i,a]=d.useState(e.state),[o,s]=Tr(i),[c,l]=d.useState(),[u,f]=d.useState({isTransitioning:!1}),[p,m]=d.useState(),[h,g]=d.useState(),[_,v]=d.useState(),y=d.useRef(new Map),b=d.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:_})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:Re(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),Sr(u===!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 b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(Sr(_==null||b,"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."),!_||!b){t&&u?t(()=>a(i)):r===!1?a(i):d.startTransition(()=>{r===!0&&s(e=>Ar(e,i)),a(i)});return}if(t&&u){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),l(void 0),f({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:i,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(l(i),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,r,s,n]);d.useLayoutEffect(()=>e.subscribe(b),[e,b]),d.useEffect(()=>{u.isTransitioning&&!u.flushSync&&m(new Or)},[u]),d.useEffect(()=>{if(p&&c&&e.window){let t=c,n=p.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):d.startTransition(()=>{r===!0&&s(e=>Ar(e,t)),a(t)}),await n});i.finished.finally(()=>{m(void 0),g(void 0),l(void 0),f({isTransitioning:!1})}),g(i)}},[c,p,e.window,r,s]),d.useEffect(()=>{p&&c&&o.location.key===c.location.key&&p.resolve()},[p,h,o.location,c]),d.useEffect(()=>{!u.isTransitioning&&_&&(l(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[u.isTransitioning,_]);let x=d.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=d.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return d.createElement(d.Fragment,null,d.createElement(En.Provider,{value:C},d.createElement(Dn.Provider,{value:o},d.createElement(jn.Provider,{value:y.current},d.createElement(An.Provider,{value:u},d.createElement(Pr,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},d.createElement(jr,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Ar(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var jr=d.memo(Mr);function Mr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Xn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Nr(e){return qn(e.context)}function Pr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){w(!Vn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=d.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=A(n));let{pathname:l=`/`,search:u=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=n,g=d.useMemo(()=>{let e=H(l,s);return e==null?null:{location:{pathname:e,search:u,hash:f,state:p,key:m,mask:h},navigationType:r}},[s,l,u,f,p,m,r,h]);return T(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:d.createElement(X.Provider,{value:c},d.createElement(Nn.Provider,{children:t,value:g}))}d.Component;function Fr(){return{params:Jn(),loaderData:fr(),actionData:mr(),matches:dr()}}function Ir(e){return function(){let t=Fr();return d.createElement(e,t)}}function Lr(){return{params:Jn(),loaderData:fr(),actionData:mr(),error:hr()}}function Rr(e){return function(){let t=Lr();return d.createElement(e,t)}}var zr=`get`,Br=`application/x-www-form-urlencoded`;function Vr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Hr(e){return Vr(e)&&e.tagName.toLowerCase()===`button`}function Ur(e){return Vr(e)&&e.tagName.toLowerCase()===`form`}function Wr(e){return Vr(e)&&e.tagName.toLowerCase()===`input`}function Gr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kr(e,t){return e.button===0&&(!t||t===`_self`)&&!Gr(e)}function qr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Jr(e,t){let n=qr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Yr=null;function Xr(){if(Yr===null)try{new FormData(document.createElement(`form`),0),Yr=!1}catch{Yr=!0}return Yr}var Zr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Qr(e){return e!=null&&!Zr.has(e)?(T(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Br}"`),null):e}function $r(e,t){let n,r,i,a,o;if(Ur(e)){let o=e.getAttribute(`action`);r=o?H(o,t):null,n=e.getAttribute(`method`)||zr,i=Qr(e.getAttribute(`enctype`))||Br,a=new FormData(e)}else if(Hr(e)||Wr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?H(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||zr,i=Qr(e.getAttribute(`formenctype`))||Qr(o.getAttribute(`enctype`))||Br,a=new FormData(o,e),!Xr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Vr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=zr,r=null,i=Br,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var ei=-1,ti=-2,ni=-3,ri=-4,ii=-5,ai=-6,oi=-7,si=`B`,ci=`D`,li=`E`,ui=`M`,di=`N`,fi=`P`,pi=`R`,mi=`S`,hi=`Y`,gi=`U`,_i=`Z`,vi=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],yi=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function bi(){let e=new TextDecoder,t=``;return new TransformStream({transform(n,r){let i=e.decode(n,{stream:!0}),a=(t+i).split(`
|
|
5
|
+
`);t=a.pop()||``;for(let e of a)r.enqueue(e)},flush(e){t&&e.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var xi=typeof window<`u`?window:typeof globalThis<`u`?globalThis:void 0;function Si(e){let{hydrated:t,values:n}=this;if(typeof e==`number`)return Ci.call(this,e);if(!Array.isArray(e)||!e.length)throw SyntaxError();let r=n.length;for(let t of e)n.push(t);return t.length=n.length,Ci.call(this,r)}function Ci(e){let{hydrated:t,values:n,deferred:r,plugins:i}=this,a,o=[[e,e=>{a=e}]],s=[];for(;o.length>0;){let[e,a]=o.pop();switch(e){case oi:a(void 0);continue;case ii:a(null);continue;case ti:a(NaN);continue;case ai:a(1/0);continue;case ni:a(-1/0);continue;case ri:a(-0);continue}if(t[e]){a(t[e]);continue}let c=n[e];if(!c||typeof c!=`object`){t[e]=c,a(c);continue}if(Array.isArray(c))if(typeof c[0]==`string`){let[n,l,u]=c;switch(n){case ci:a(t[e]=new Date(l));continue;case gi:a(t[e]=new URL(l));continue;case si:a(t[e]=BigInt(l));continue;case pi:a(t[e]=new RegExp(l,u));continue;case hi:a(t[e]=Symbol.for(l));continue;case mi:let n=new Set;t[e]=n;for(let e=c.length-1;e>0;e--)o.push([c[e],e=>{n.add(e)}]);a(n);continue;case ui:let d=new Map;t[e]=d;for(let e=c.length-2;e>0;e-=2){let t=[];o.push([c[e+1],e=>{t[1]=e}]),o.push([c[e],e=>{t[0]=e}]),s.push(()=>{d.set(t[0],t[1])})}a(d);continue;case di:let f=Object.create(null);t[e]=f;for(let e of Object.keys(l).reverse()){let t=[];o.push([l[e],e=>{t[1]=e}]),o.push([Number(e.slice(1)),e=>{t[0]=e}]),s.push(()=>{f[t[0]]=t[1]})}a(f);continue;case fi:if(t[l])a(t[e]=t[l]);else{let n=new yi;r[l]=n,a(t[e]=n.promise)}continue;case li:let[,p,m]=c,h=m&&xi&&vi.includes(m)&&m in xi&&typeof xi[m]==`function`?new xi[m](p):Error(p);t[e]=h,a(h);continue;case _i:a(t[e]=t[l]);continue;default:if(Array.isArray(i)){let n=[],r=c.slice(1);for(let e=0;e<r.length;e++){let t=r[e];o.push([t,t=>{n[e]=t}])}s.push(()=>{for(let r of i){let i=r(c[0],...n);if(i){a(t[e]=i.value);return}}throw SyntaxError()});continue}throw SyntaxError()}}else{let n=[];t[e]=n;for(let e=0;e<c.length;e++){let t=c[e];t!==ei&&o.push([t,t=>{n[e]=t}])}a(n);continue}else{let n={};t[e]=n;for(let e of Object.keys(c).reverse()){let t=[];o.push([c[e],e=>{t[1]=e}]),o.push([Number(e.slice(1)),e=>{t[0]=e}]),s.push(()=>{n[t[0]]=t[1]})}a(n);continue}}for(;s.length>0;)s.pop()();return a}async function wi(e,t){let{plugins:n}=t??{},r=new yi,i=e.pipeThrough(bi()).getReader(),a={values:[],hydrated:[],deferred:{},plugins:n},o=await Ti.call(a,i),s=r.promise;return o.done?r.resolve():s=Ei.call(a,i).then(r.resolve).catch(e=>{for(let t of Object.values(a.deferred))t.reject(e);r.reject(e)}),{done:s.then(()=>i.closed),value:o.value}}async function Ti(e){let t=await e.read();if(!t.value)throw SyntaxError();let n;try{n=JSON.parse(t.value)}catch{throw SyntaxError()}return{done:t.done,value:Si.call(this,n)}}async function Ei(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;let n=t.value;switch(n[0]){case fi:{let e=n.indexOf(`:`),t=Number(n.slice(1,e)),r=this.deferred[t];if(!r)throw Error(`Deferred ID ${t} not found in stream`);let i=n.slice(e+1),a;try{a=JSON.parse(i)}catch{throw SyntaxError()}let o=Si.call(this,a);r.resolve(o);break}case li:{let e=n.indexOf(`:`),t=Number(n.slice(1,e)),r=this.deferred[t];if(!r)throw Error(`Deferred ID ${t} not found in stream`);let i=n.slice(e+1),a;try{a=JSON.parse(i)}catch{throw SyntaxError()}let o=Si.call(this,a);r.reject(o);break}default:throw SyntaxError()}t=await e.read()}}async function Di(e){let t={signal:e.signal};if(e.method!==`GET`){t.method=e.method;let n=e.headers.get(`Content-Type`);n&&/\bapplication\/json\b/.test(n)?(t.headers={"Content-Type":n},t.body=JSON.stringify(await e.json())):n&&/\btext\/plain\b/.test(n)?(t.headers={"Content-Type":n},t.body=await e.text()):n&&/\bapplication\/x-www-form-urlencoded\b/.test(n)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}var Oi={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},ki=/[&><\u2028\u2029]/g;function Ai(e){return e.replace(ki,e=>Oi[e])}function $(e,t){if(e===!1||e==null)throw Error(t)}var ji=Symbol(`SingleFetchRedirect`),Mi=class extends Error{},Ni=new Set([100,101,204,205]);function Pi(e,t,n,r,i,a){let o=Fi(e,e=>{let n=t.routes[e.route.id];return $(n,`Route not found in manifest`),{hasLoader:n.hasLoader,hasClientLoader:n.hasClientLoader}},Ui,r,i,a);return async e=>e.runClientMiddleware(o)}function Fi(e,t,n,r,i,a,o=()=>!0){return async s=>{let{request:c,matches:l,fetcherKey:u}=s,d=e();if(c.method!==`GET`)return Ii(s,n,i,a);let f=l.some(e=>{let{hasLoader:n,hasClientLoader:r}=t(e);return e.shouldCallHandler()&&n&&!r});return!r&&!f?Li(s,t,n,i,a):u?Bi(s,n,i,a):Ri(s,d,t,n,r,i,a,o)}}async function Ii(e,t,n,r){let i=e.matches.find(e=>e.shouldCallHandler());$(i,`No action match found`);let a,o=await i.resolve(async o=>await o(async()=>{let{data:o,status:s}=await t(e,n,r,[i.route.id]);return a=s,Gi(o,i.route.id)}));return fn(o.result)||Le(o.result)||dn(o.result)?{[i.route.id]:o}:{[i.route.id]:{type:o.type,result:Fe(o.result,a)}}}async function Li(e,t,n,r,i){let a=e.matches.filter(e=>e.shouldCallHandler()),o={};return await Promise.all(a.map(a=>a.resolve(async s=>{try{let{hasClientLoader:c}=t(a),l=a.route.id,u=c?await s(async()=>{let{data:t}=await n(e,r,i,[l]);return Gi(t,l)}):await s();o[a.route.id]={type:`data`,result:u}}catch(e){o[a.route.id]={type:`error`,result:e}}}))),o}async function Ri(e,t,n,r,i,a,o,s=()=>!0){let c=new Set,l=!1,u=e.matches.map(()=>Ki()),d=Ki(),f={},p=Promise.all(e.matches.map(async(t,i)=>t.resolve(async p=>{u[i].resolve();let m=t.route.id,{hasLoader:h,hasClientLoader:g}=n(t),_=!t.shouldRevalidateArgs||t.shouldRevalidateArgs.actionStatus==null||t.shouldRevalidateArgs.actionStatus<400;if(!t.shouldCallHandler(_)){l||=t.shouldRevalidateArgs!=null&&h;return}if(s(t)&&g){h&&(l=!0);try{f[m]={type:`data`,result:await p(async()=>{let{data:t}=await r(e,a,o,[m]);return Gi(t,m)})}}catch(e){f[m]={type:`error`,result:e}}return}h&&c.add(m);try{f[m]={type:`data`,result:await p(async()=>Gi(await d.promise,m))}}catch(e){f[m]={type:`error`,result:e}}})));if(await Promise.all(u.map(e=>e.promise)),(!t.state.initialized&&t.state.navigation.state===`idle`||c.size===0)&&!window.__reactRouterHdrActive)d.resolve({routes:{}});else{let t=i&&l&&c.size>0?[...c.keys()]:void 0;try{let n=await r(e,a,o,t);d.resolve(n.data)}catch(e){d.reject(e)}}return await p,await zi(d.promise,e.matches,c,f),f}async function zi(e,t,n,r){try{let i,a=await e;if(`routes`in a){for(let e of t)if(e.route.id in a.routes){let t=a.routes[e.route.id];if(`error`in t){i=t.error,r[e.route.id]?.result??(r[e.route.id]={type:`error`,result:i});break}}}i!==void 0&&Array.from(n.values()).forEach(e=>{r[e].result instanceof Mi&&(r[e].result=i)})}catch{}}async function Bi(e,t,n,r){let i=e.matches.find(e=>e.shouldCallHandler());$(i,`No fetcher match found`);let a=i.route.id,o=await i.resolve(async i=>i(async()=>{let{data:i}=await t(e,n,r,[a]);return Gi(i,a)}));return{[i.route.id]:o}}function Vi(e){let t=e.searchParams.getAll(`index`);e.searchParams.delete(`index`);let n=[];for(let e of t)e&&n.push(e);for(let t of n)e.searchParams.append(`index`,t);return e}function Hi(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&H(i.pathname,t)===`/`?i.pathname=`${Ae(t)}/_root.${r}`:i.pathname=`${Ae(i.pathname)}.${r}`,i}async function Ui(e,t,n,r){let{request:i}=e,a=Hi(i.url,t,n,`data`);i.method===`GET`&&(a=Vi(a),r&&a.searchParams.set(`_routes`,r.join(`,`)));let o=await fetch(a,await Di(i));if(o.status>=400&&!o.headers.has(`X-Remix-Response`))throw new G(o.status,o.statusText,await o.text());if(o.status===204&&o.headers.has(`X-Remix-Redirect`))return{status:202,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(Ni.has(o.status)){let e={};return r&&i.method!==`GET`&&(e[r[0]]={data:void 0}),{status:o.status,data:{routes:e}}}$(o.body,`No response body to decode`);try{let e=await Wi(o.body,window),t;if(i.method===`GET`){let n=e.value;t=ji in n?{redirect:n[ji]}:{routes:n}}else{let n=e.value,i=r?.[0];$(i,`No routeId found for single fetch call decoding`),t=`redirect`in n?{redirect:n}:{routes:{[i]:n}}}return{status:o.status,data:t}}catch{throw Error(`Unable to decode turbo-stream response`)}}function Wi(e,t){return wi(e,{plugins:[(e,...n)=>{if(e===`SanitizedError`){let[e,r,i]=n,a=Error;e&&vi.includes(e)&&e in t&&typeof t[e]==`function`&&(a=t[e]);let o=new a(r);return o.stack=i,{value:o}}if(e===`ErrorResponse`){let[e,t,r]=n;return{value:new G(t,r,e)}}if(e===`SingleFetchRedirect`)return{value:{[ji]:n[0]}};if(e===`SingleFetchClassInstance`)return{value:n[0]};if(e===`SingleFetchFallback`)return{value:void 0}}]})}function Gi(e,t){if(`redirect`in e){let{redirect:t,revalidate:n,reload:r,replace:i,status:a}=e.redirect;throw Ie(t,{status:a,headers:{...n?{"X-Remix-Revalidate":`yes`}:null,...r?{"X-Remix-Reload-Document":`yes`}:null,...i?{"X-Remix-Replace":`yes`}:null}})}let n=e.routes[t];if(n==null)throw new Mi(`No result found for routeId "${t}"`);if(`error`in n)throw n.error;if(`data`in n)return n.data;throw Error(`Invalid response found for routeId "${t}"`)}function Ki(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}async function qi(e,t){if(e.id in t)return t[e.id];try{let n=await h(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ji(e,t,n){return oa(e.map(e=>{let r=t[e.route.id],i=n.routes[e.route.id];return[i&&i.css?i.css.map(e=>({rel:`stylesheet`,href:e})):[],r?.links?.()||[]]}).flat(2),ra(e,n))}function Yi(e){return e.css?e.css.map(e=>({rel:`stylesheet`,href:e})):[]}async function Xi(e){if(!e.css)return;let t=Yi(e);await Promise.all(t.map(Qi))}async function Zi(e,t){if(!e.css&&!t.links||!ca())return;let n=[];if(e.css&&n.push(...Yi(e)),t.links&&n.push(...t.links()),n.length===0)return;let r=[];for(let e of n)!$i(e)&&e.rel===`stylesheet`&&r.push({...e,rel:`preload`,as:`style`});await Promise.all(r.map(Qi))}async function Qi(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let n=document.createElement(`link`);Object.assign(n,e);function r(){document.head.contains(n)&&document.head.removeChild(n)}n.onload=()=>{r(),t()},n.onerror=()=>{r(),t()},document.head.appendChild(n)})}function $i(e){return e!=null&&typeof e.page==`string`}function ea(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 ta(e,t,n){return oa((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await qi(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ea).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function na(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function ra(e,t,{includeHydrateFallback:n}={}){return ia(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function ia(e){return[...new Set(e)]}function aa(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function oa(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!$i(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(aa(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var sa;function ca(){if(sa!==void 0)return sa;let e=document.createElement(`link`);return sa=e.relList.supports(`preload`),e=null,sa}function la(){return d.createElement(eo,{title:`Loading...`,renderScripts:!0},d.createElement(`script`,{dangerouslySetInnerHTML:{__html:`
|
|
6
|
+
console.log(
|
|
7
|
+
"💿 Hey developer 👋. You can provide a way better UX than this " +
|
|
8
|
+
"when your app is loading JS modules and/or running \`clientLoader\` " +
|
|
9
|
+
"functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
|
|
10
|
+
"for more information."
|
|
11
|
+
);
|
|
12
|
+
`}}))}function ua(e){let t={};return Object.values(e).forEach(e=>{if(e){let n=e.parentId||``;t[n]||(t[n]=[]),t[n].push(e)}}),t}function da(e,t,n){let r=ya(t),i=t.HydrateFallback&&(!n||e.id===`root`)?t.HydrateFallback:e.id===`root`?la:void 0,a=t.ErrorBoundary?t.ErrorBoundary:e.id===`root`?()=>d.createElement($a,{error:hr()}):void 0;return e.id===`root`&&t.Layout?{...r?{element:d.createElement(t.Layout,null,d.createElement(r,null))}:{Component:r},...a?{errorElement:d.createElement(t.Layout,null,d.createElement(a,null))}:{ErrorBoundary:a},...i?{hydrateFallbackElement:d.createElement(t.Layout,null,d.createElement(i,null))}:{HydrateFallback:i}}:{Component:r,ErrorBoundary:a,HydrateFallback:i}}function fa(e,t,n,r,i,a){return ha(t,n,r,i,a,``,ua(t),e)}function pa(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 G(400,`Bad Request`,Error(n),!0)}}function ma(e,t){let n=e===`clientAction`?`a`:`an`,r=`Route "${t}" does not have ${n} ${e}, but you are trying to submit to it. To fix this, please add ${n} \`${e}\` function to the route`;throw console.error(r),new G(405,`Method Not Allowed`,Error(r),!0)}function ha(e,t,n,r,i,a=``,o=ua(e),s){return(o[a]||[]).map(a=>{let c=t[a.id];function l(e){return $(typeof e==`function`,`No single fetch function available for route handler`),e()}function u(e){return a.hasLoader?l(e):Promise.resolve(null)}function d(e){if(!a.hasAction)throw ma(`action`,a.id);return l(e)}function f(e){h(()=>import(e),[])}function p(e){e.clientActionModule&&f(e.clientActionModule),e.clientLoaderModule&&f(e.clientLoaderModule)}async function m(e){let n=t[a.id],r=n?Zi(a,n):Promise.resolve();try{return e()}finally{await r}}let g={id:a.id,index:a.index,path:a.path};if(c){Object.assign(g,{...g,...da(a,c,i),middleware:c.clientMiddleware,handle:c.handle,shouldRevalidate:ga(g.path,c,a,r,s)});let e=n&&n.loaderData&&a.id in n.loaderData,t=e?n?.loaderData?.[a.id]:void 0,o=n&&n.errors&&a.id in n.errors,l=o?n?.errors?.[a.id]:void 0,f=s==null&&(c.clientLoader?.hydrate===!0||!a.hasLoader);g.loader=async({request:n,params:r,context:i,pattern:s,url:d},p)=>{let h=f;return f=!1,await m(async()=>($(c,"No `routeModule` available for critical-route loader"),c.clientLoader?c.clientLoader({request:n,params:r,context:i,pattern:s,url:d,async serverLoader(){if(pa(`loader`,a),h){if(e)return t;if(o)throw l}return u(p)}}):u(p)))},g.loader.hydrate=ba(a.id,c.clientLoader,a.hasLoader,i),g.action=({request:e,params:t,context:n,pattern:r,url:o},s)=>m(async()=>{if($(c,"No `routeModule` available for critical-route action"),!c.clientAction){if(i)throw ma(`clientAction`,a.id);return d(s)}return c.clientAction({request:e,params:t,context:n,pattern:r,url:o,async serverAction(){return pa(`action`,a),d(s)}})})}else{a.hasClientLoader||(g.loader=(e,t)=>m(()=>u(t))),a.hasClientAction||(g.action=(e,t)=>m(()=>{if(i)throw ma(`clientAction`,a.id);return d(t)}));let e;async function n(){return e||=(async()=>{(a.clientLoaderModule||a.clientActionModule)&&await new Promise(e=>setTimeout(e,0));let e=va(a,t);return p(a),await e})(),await e}g.lazy={loader:a.hasClientLoader?async()=>{let{clientLoader:e}=a.clientLoaderModule?await h(()=>import(a.clientLoaderModule),[]):await n();return $(e,"No `clientLoader` export found"),(t,n)=>e({...t,async serverLoader(){return pa(`loader`,a),u(n)}})}:void 0,action:a.hasClientAction?async()=>{let e=a.clientActionModule?h(()=>import(a.clientActionModule),[]):n();p(a);let{clientAction:t}=await e;return $(t,"No `clientAction` export found"),(e,n)=>t({...e,async serverAction(){return pa(`action`,a),d(n)}})}:void 0,middleware:a.hasClientMiddleware?async()=>{let{clientMiddleware:e}=a.clientMiddlewareModule?await h(()=>import(a.clientMiddlewareModule),[]):await n();return $(e,"No `clientMiddleware` export found"),e}:void 0,shouldRevalidate:async()=>{let e=await n();return ga(g.path,e,a,r,s)},handle:async()=>(await n()).handle,Component:async()=>(await n()).Component,ErrorBoundary:a.hasErrorBoundary?async()=>(await n()).ErrorBoundary:void 0}}let _=ha(e,t,n,r,i,a.id,o,s);return _.length>0&&(g.children=_),g})}function ga(e,t,n,r,i){if(i)return _a(n.id,t.shouldRevalidate,i);if(!r&&n.hasLoader&&!n.hasClientLoader){let n=e?ye(e)[1].map(e=>e.paramName):[],r=e=>n.some(t=>e.currentParams[t]!==e.nextParams[t]);if(t.shouldRevalidate){let e=t.shouldRevalidate;return t=>e({...t,defaultShouldRevalidate:r(t)})}else return e=>r(e)}return t.shouldRevalidate}function _a(e,t,n){let r=!1;return i=>r?t?t(i):i.defaultShouldRevalidate:(r=!0,n.has(e))}async function va(e,t){let n=qi(e,t),r=Xi(e),i=await n;return await Promise.all([r,Zi(e,i)]),{Component:ya(i),ErrorBoundary:i.ErrorBoundary,clientMiddleware:i.clientMiddleware,clientAction:i.clientAction,clientLoader:i.clientLoader,handle:i.handle,links:i.links,meta:i.meta,shouldRevalidate:i.shouldRevalidate}}function ya(e){if(e.default!=null&&!(typeof e.default==`object`&&Object.keys(e.default).length===0))return e.default}function ba(e,t,n,r){return r&&e!==`root`||t!=null&&(t.hydrate===!0||n!==!0)}var xa=new Set,Sa=1e3,Ca=new Set;function wa(e,t){return e.mode===`lazy`&&t===!0}function Ta({sri:e,...t},n){let r=new Set(n.state.matches.map(e=>e.route.id)),i=n.state.location.pathname.split(`/`).filter(Boolean),a=[`/`];for(i.pop();i.length>0;)a.push(`/${i.join(`/`)}`),i.pop();a.forEach(e=>{let t=I(n.routes,e,n.basename||`/`,!1,n.branches);t&&t.forEach(e=>r.add(e.route.id))});let o=[...r].reduce((e,n)=>Object.assign(e,{[n]:t.routes[n]}),{});return{...t,routes:o,sri:e?!0:void 0}}function Ea(e,t,n,r,i,a,o){if(wa(i,r))return async({path:s,patch:c,signal:l,fetcherKey:u})=>{if(Ca.has(s))return;let{state:d}=e();await Aa([s],u?window.location.href:k(d.navigation.location||d.location),t,n,r,a,o,i.manifestPath,c,l)}}function Da(e,t,n,r,i,a){d.useEffect(()=>{if(!wa(i,r)||window.navigator?.connection?.saveData===!0)return;function o(e){let t=e.tagName===`FORM`?e.getAttribute(`action`):e.getAttribute(`href`);if(!t)return;let n=e.tagName===`A`?e.pathname:new URL(t,window.location.origin).pathname;Ca.has(n)||xa.add(n)}async function s(){document.querySelectorAll(`a[data-discover], form[data-discover]`).forEach(o);let s=Array.from(xa.keys()).filter(e=>Ca.has(e)?(xa.delete(e),!1):!0);if(s.length!==0)try{await Aa(s,null,t,n,r,a,e.basename,i.manifestPath,e.patchRoutes)}catch(e){console.error(`Failed to fetch manifest patches`,e)}}let c=Ma(s,100);s();let l=new MutationObserver(()=>c());return l.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-discover`,`href`,`action`]}),()=>l.disconnect()},[r,a,t,n,e,i])}function Oa(e,t){let n=e||`/__manifest`;return t==null?n:W([t,n])}var ka=`react-router-manifest-version`;async function Aa(e,t,n,r,i,a,o,s,c,l){let u=new URLSearchParams;u.set(`paths`,e.sort().join(`,`)),u.set(`version`,n.version);let d=new URL(Oa(s,o),window.location.origin);if(d.search=u.toString(),d.toString().length>7680){xa.clear();return}let f;try{let e=await fetch(d,{signal:l});if(!e.ok)throw Error(`${e.status} ${e.statusText}`);if(e.status===204&&e.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}try{if(sessionStorage.getItem(ka)===n.version){console.error(`Unable to discover routes due to manifest version mismatch.`);return}sessionStorage.setItem(ka,n.version)}catch{}window.location.href=t,console.warn(`Detected manifest version mismatch, reloading...`),await new Promise(()=>{})}else if(e.status>=400)throw Error(await e.text());try{sessionStorage.removeItem(ka)}catch{}f=await e.json()}catch(e){if(l?.aborted)return;throw e}let p=new Set(Object.keys(n.routes)),m=Object.values(f).reduce((e,t)=>(t&&!p.has(t.id)&&(e[t.id]=t),e),{});Object.assign(n.routes,m),e.forEach(e=>ja(e,Ca));let h=new Set;Object.values(m).forEach(e=>{e&&(!e.parentId||!m[e.parentId])&&h.add(e.parentId)}),h.forEach(e=>c(e||null,ha(m,r,null,i,a,e)))}function ja(e,t){if(t.size>=Sa){let e=t.values().next().value;t.delete(e)}t.add(e)}function Ma(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function Na(){let e=d.useContext(En);return $(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Pa(){let e=d.useContext(Dn);return $(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Fa=d.createContext(void 0);Fa.displayName=`FrameworkContext`;function Ia(){let e=d.useContext(Fa);return $(e,`You must render this element inside a <HydratedRouter> element`),e}function La(e,t){let n=d.useContext(Fa),[r,i]=d.useState(!1),[a,o]=d.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:f}=t,p=d.useRef(null);d.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),d.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:Ra(s,m),onBlur:Ra(c,h),onMouseEnter:Ra(l,m),onMouseLeave:Ra(u,h),onTouchStart:Ra(f,m)}]:[a,p,{}]:[!1,p,{}]}function Ra(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function za(e,t,n){if(n&&!Ja)return[e[0]];if(t){let n=e.findIndex(e=>t[e.route.id]!==void 0);return e.slice(0,n+1)}return e}var Ba=`data-react-router-critical-css`;function Va({nonce:e,crossOrigin:t}){let{isSpaMode:n,manifest:r,routeModules:i,criticalCss:a}=Ia(),{errors:o,matches:s}=Pa(),c=za(s,o,n),l=d.useMemo(()=>Ji(c,i,r),[c,i,r]);return d.createElement(d.Fragment,null,typeof a==`string`?d.createElement(`style`,{[Ba]:``,nonce:e,dangerouslySetInnerHTML:{__html:a}}):null,typeof a==`object`?d.createElement(`link`,{[Ba]:``,rel:`stylesheet`,href:a.href,nonce:e,crossOrigin:t}):null,l.map(({key:n,link:r})=>$i(r)?d.createElement(Ha,{key:n,nonce:e,...r,crossOrigin:r.crossOrigin??t}):d.createElement(`link`,{key:n,nonce:e,...r,crossOrigin:r.crossOrigin??t})))}function Ha({page:e,...t}){let n=kn(),{router:r}=Na(),i=d.useMemo(()=>se(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?d.createElement(Wa,{page:e,matches:i,...t}):d.createElement(Ga,{page:e,matches:i,...t}):null}function Ua(e){let{manifest:t,routeModules:n}=Ia(),[r,i]=d.useState([]);return d.useEffect(()=>{let r=!1;return ta(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Wa({page:e,matches:t,...n}){let r=Q(),{future:i}=Ia(),{basename:a}=Na(),o=d.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Hi(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return d.createElement(d.Fragment,null,o.map(e=>d.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Ga({page:e,matches:t,...n}){let r=Q(),{future:i,manifest:a,routeModules:o}=Ia(),{basename:s}=Na(),{loaderData:c,matches:l}=Pa(),u=d.useMemo(()=>na(e,t,l,a,r,`data`),[e,t,l,a,r]),f=d.useMemo(()=>na(e,t,l,a,r,`assets`),[e,t,l,a,r]),p=d.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Hi(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),m=d.useMemo(()=>ra(f,a),[f,a]),h=Ua(f);return d.createElement(d.Fragment,null,p.map(e=>d.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>d.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>d.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ka(){let{isSpaMode:e,routeModules:t}=Ia(),{errors:n,matches:r,loaderData:i}=Pa(),a=Q(),o=za(r,n,e),s=null;n&&(s=n[o[o.length-1].route.id]);let c=[],l=null,u=[];for(let e=0;e<o.length;e++){let n=o[e],r=n.route.id,d=i[r],f=n.params,p=t[r],m=[],h={id:r,data:d,loaderData:d,meta:[],params:n.params,pathname:n.pathname,handle:n.route.handle,error:s};if(u[e]=h,p?.meta?m=typeof p.meta==`function`?p.meta({data:d,loaderData:d,params:f,location:a,matches:u,error:s}):Array.isArray(p.meta)?[...p.meta]:p.meta:l&&(m=[...l]),m||=[],!Array.isArray(m))throw Error(`The route at `+n.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.
|
|
13
|
+
|
|
14
|
+
To reference the meta function API, see https://reactrouter.com/start/framework/route-module#meta`);h.meta=m,u[e]=h,c=[...m],l=c}return d.createElement(d.Fragment,null,c.flat().map(e=>{if(!e)return null;if(`tagName`in e){let{tagName:t,...n}=e;if(!qa(t))return console.warn(`A meta object uses an invalid tagName: ${t}. Expected either 'link' or 'meta'`),null;let r=t;return d.createElement(r,{key:JSON.stringify(n),...n})}if(`title`in e)return d.createElement(`title`,{key:`title`},String(e.title));if(`charset`in e&&(e.charSet??=e.charset,delete e.charset),`charSet`in e&&e.charSet!=null)return typeof e.charSet==`string`?d.createElement(`meta`,{key:`charSet`,charSet:e.charSet}):null;if(`script:ld+json`in e)try{let t=JSON.stringify(e[`script:ld+json`]);return d.createElement(`script`,{key:`script:ld+json:${t}`,type:`application/ld+json`,dangerouslySetInnerHTML:{__html:Ai(t)}})}catch{return null}return d.createElement(`meta`,{key:JSON.stringify(e),...e})}))}function qa(e){return typeof e==`string`&&/^(meta|link)$/.test(e)}var Ja=!1;function Ya(){Ja=!0}function Xa(e){let{manifest:t,serverHandoffString:n,isSpaMode:r,renderMeta:i,routeDiscovery:a,ssr:o}=Ia(),{router:s,static:c,staticContext:l}=Na(),{matches:u}=Pa(),f=kn(),p=wa(a,o);i&&(i.didRenderScripts=!0);let m=za(u,null,r);d.useEffect(()=>{Ya()},[]);let h=d.useMemo(()=>{if(f)return null;let r=l?`window.__reactRouterContext = ${n};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:` `,i=c?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:``}${p?``:`import ${JSON.stringify(t.url)}`};
|
|
15
|
+
${m.map((e,n)=>{let r=`route${n}`,i=t.routes[e.route.id];$(i,`Route ${e.route.id} not found in manifest`);let{clientActionModule:a,clientLoaderModule:o,clientMiddlewareModule:s,hydrateFallbackModule:c,module:l}=i,u=[...a?[{module:a,varName:`${r}_clientAction`}]:[],...o?[{module:o,varName:`${r}_clientLoader`}]:[],...s?[{module:s,varName:`${r}_clientMiddleware`}]:[],...c?[{module:c,varName:`${r}_HydrateFallback`}]:[],{module:l,varName:`${r}_main`}];return u.length===1?`import * as ${r} from ${JSON.stringify(l)};`:[u.map(e=>`import * as ${e.varName} from "${e.module}";`).join(`
|
|
16
|
+
`),`const ${r} = {${u.map(e=>`...${e.varName}`).join(`,`)}};`].join(`
|
|
17
|
+
`)}).join(`
|
|
18
|
+
`)}
|
|
19
|
+
${p?`window.__reactRouterManifest = ${JSON.stringify(Ta(t,s),null,2)};`:``}
|
|
20
|
+
window.__reactRouterRouteModules = {${m.map((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`).join(`,`)}};
|
|
21
|
+
|
|
22
|
+
import(${JSON.stringify(t.entry.module)});`:` `;return d.createElement(d.Fragment,null,d.createElement(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:r},type:void 0}),d.createElement(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:i},type:`module`,async:!0}))},[]),g=Ja||f?[]:[...new Set(t.entry.imports.concat(ra(m,t,{includeHydrateFallback:!0})))],_=typeof t.sri==`object`?t.sri:{};return Sr(!f,`The <Scripts /> element is a no-op when using RSC and can be safely removed.`),Ja||f?null:d.createElement(d.Fragment,null,typeof t.sri==`object`?d.createElement(`script`,{...e,"rr-importmap":``,type:`importmap`,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:_})}}):null,p?null:d.createElement(`link`,{rel:`modulepreload`,href:t.url,crossOrigin:e.crossOrigin,integrity:_[t.url],nonce:e.nonce,suppressHydrationWarning:!0}),d.createElement(`link`,{rel:`modulepreload`,href:t.entry.module,crossOrigin:e.crossOrigin,integrity:_[t.entry.module],nonce:e.nonce,suppressHydrationWarning:!0}),g.map(t=>d.createElement(`link`,{key:t,rel:`modulepreload`,href:t,crossOrigin:e.crossOrigin,integrity:_[t],nonce:e.nonce,suppressHydrationWarning:!0})),h)}function Za(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Qa=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||t.error,location:t.location}:{error:e.error||null,location:e.location}}render(){return this.state.error?d.createElement($a,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function $a({error:e,isOutsideRemixApp:t}){console.error(e);let n=d.createElement(`script`,{dangerouslySetInnerHTML:{__html:`
|
|
23
|
+
console.log(
|
|
24
|
+
"💿 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."
|
|
25
|
+
);
|
|
26
|
+
`}});if(Le(e))return d.createElement(eo,{title:`Unhandled Thrown Response!`},d.createElement(`h1`,{style:{fontSize:`24px`}},e.status,` `,e.statusText),n);let r;if(e instanceof Error)r=e;else{let t=e==null?`Unknown Error`:typeof e==`object`&&`toString`in e?e.toString():JSON.stringify(e);r=Error(t)}return d.createElement(eo,{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`}},r.stack),n)}function eo({title:e,renderScripts:t,isOutsideRemixApp:n,children:r}){let{routeModules:i}=Ia();return i.root?.Layout&&!n?r: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`}},r,t?d.createElement(Xa,null):null)))}var to=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{to&&(window.__reactRouterVersion=`7.17.0`)}catch{}function no({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=d.useState({action:n.action,location:n.location}),o=d.useCallback(e=>{r===!1?a(e):d.startTransition(()=>a(e))},[r]);return d.useLayoutEffect(()=>n.listen(o),[n,o]),d.createElement(Pr,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}no.displayName=`unstable_HistoryRouter`;var ro=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,io=d.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=d.useContext(X),y=typeof l==`string`&&ro.test(l),b=Be(l,g);l=b.to;let x=Bn(l,{relative:r}),S=Q(),C=null;if(o){let e=U(o,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:W([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=La(n,m),D=fo(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=d.createElement(`a`,{...m,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Za(h,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?d.createElement(d.Fragment,null,A,d.createElement(Ha,{page:x})):A});io.displayName=`Link`;var ao=d.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Yn(a,{relative:c.relative}),f=Q(),p=d.useContext(Dn),{navigator:m,basename:h}=d.useContext(X),g=p!=null&&wo(u)&&o===!0,_=m.encodeLocation?m.encodeLocation(u).pathname:u.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=H(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return d.createElement(io,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});ao.displayName=`NavLink`;var oo=d.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=zr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=d.useContext(X),_=go(),v=_o(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&ro.test(s);return d.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?d.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});oo.displayName=`Form`;function so({getKey:e,storageKey:t,...n}){let r=d.useContext(Fa),{basename:i}=d.useContext(X),a=Q(),o=dr();So({getKey:e,storageKey:t});let s=d.useMemo(()=>{if(!r||!e)return null;let t=xo(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return d.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Ai(JSON.stringify(t||yo))}, ${Ai(JSON.stringify(s))})`}})}so.displayName=`ScrollRestoration`;function co(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lo(e){let t=d.useContext(En);return w(t,co(e)),t}function uo(e){let t=d.useContext(Dn);return w(t,co(e)),t}function fo(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Wn(),f=Q(),p=Yn(e,{relative:o});return d.useCallback(m=>{if(Kr(m,t)){m.preventDefault();let t=n===void 0?k(f)===k(p):n,h=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?d.startTransition(()=>h()):h()}},[f,u,p,n,r,i,t,e,a,o,s,c,l])}function po(e){T(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=d.useRef(qr(e)),n=d.useRef(!1),r=Q(),i=d.useMemo(()=>Jr(r.search,n.current?null:t.current),[r.search]),a=Wn();return[i,d.useCallback((e,t)=>{let r=qr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var mo=0,ho=()=>`__${String(++mo)}__`;function go(){let{router:e}=lo(`useSubmit`),{basename:t}=d.useContext(X),n=lr(),r=e.fetch,i=e.navigate;return d.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=$r(e,t);a.navigate===!1?await r(a.fetcherKey||ho(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function _o(e,{relative:t}={}){let{basename:n}=d.useContext(X),r=d.useContext(Z);w(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Yn(e||`.`,{relative:t})},o=Q();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:W([n,a.pathname])),k(a)}function vo({key:e}={}){let{router:t}=lo(`useFetcher`),n=uo(`useFetcher`),r=d.useContext(jn),i=d.useContext(Z),a=i.matches[i.matches.length-1]?.route.id;w(r,`useFetcher must be used inside a FetchersContext`),w(i,`useFetcher must be used inside a RouteContext`),w(a!=null,`useFetcher can only be used on routes that contain a unique "id"`);let o=d.useId(),[s,c]=d.useState(e||o);e&&e!==s&&c(e);let{deleteFetcher:l,getFetcher:u,resetFetcher:f,fetch:p}=t;d.useEffect(()=>(u(s),()=>l(s)),[l,u,s]);let m=d.useCallback(async(e,t)=>{w(a,`No routeId available for fetcher.load()`),await p(s,a,e,t)},[s,a,p]),h=go(),g=d.useCallback(async(e,t)=>{await h(e,{...t,navigate:!1,fetcherKey:s})},[s,h]),_=d.useCallback(e=>f(s,e),[f,s]),v=d.useMemo(()=>{let e=d.forwardRef((e,t)=>d.createElement(oo,{...e,navigate:!1,fetcherKey:s,ref:t}));return e.displayName=`fetcher.Form`,e},[s]),y=n.fetchers.get(s)||at,b=r.get(s);return d.useMemo(()=>({Form:v,submit:g,load:m,reset:_,...y,data:b}),[v,g,m,_,y,b])}var yo=`react-router-scroll-positions`,bo={};function xo(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:H(e.pathname,n)||e.pathname},t)),i??=e.key,i}function So({getKey:e,storageKey:t}={}){let{router:n}=lo(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=uo(`useScrollRestoration`),{basename:a}=d.useContext(X),o=Q(),s=dr(),c=ur();d.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Co(d.useCallback(()=>{if(c.state===`idle`){let t=xo(o,s,a,e);bo[t]=window.scrollY}try{sessionStorage.setItem(t||yo,JSON.stringify(bo))}catch(e){T(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(d.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||yo);e&&(bo=JSON.parse(e))}catch{}},[t]),d.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(bo,()=>window.scrollY,e?(t,n)=>xo(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),d.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{T(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Co(e,t){let{capture:n}=t||{};d.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function wo(e,{relative:t}={}){let n=d.useContext(An);w(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=lo(`useViewTransitionState`),i=Yn(e,{relative:t});if(!n.isTransitioning)return!1;let a=H(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=H(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ve(i.pathname,o)!=null||ve(i.pathname,a)!=null}var To=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Eo=o(((e,t)=>{t.exports=To()}));export{vo as A,u as B,w as C,ba as D,se as E,ur as F,c as H,pr as I,po as L,Q as M,dr as N,mr as O,Wn as P,Ir as R,Dr as S,Er as T,o as V,M as _,Va as a,Ea as b,ao as c,kr as d,Xa as f,fa as g,ha as h,io as i,Da as j,_r as k,Nr as l,C as m,G as n,Ka as o,so as p,Fa as r,Ni as s,Eo as t,Qa as u,ht as v,Le as w,Pi as x,Wi as y,Rr as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-6KjasuHH.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/react-dom-DQHA9Ik4.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/root-Cvarn0sH.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/react-dom-DQHA9Ik4.js","/assets/db-link-DISwKBYZ.js","/assets/MenuTrigger-CkqlwCsV.js","/assets/createLucideIcon-oZ0wXCaF.js","/assets/useOpenInteractionType-BGObzouY.js"],"css":["/assets/root-D24FtLBP.css"]},"routes/_index":{"id":"routes/_index","parentId":"root","index":true,"hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/_index-CNX0dPQi.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/db-link-DISwKBYZ.js","/assets/error-card-2aexlkmv.js","/assets/badge-DFReduIj.js","/assets/button-CafwM-5D.js","/assets/stat-card-y2feeHt0.js","/assets/table-B5BEGV9S.js"],"css":[]},"routes/jobs":{"id":"routes/jobs","parentId":"root","path":"jobs","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/jobs-BjoGjnb0.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/db-link-DISwKBYZ.js","/assets/error-card-2aexlkmv.js","/assets/badge-DFReduIj.js","/assets/button-CafwM-5D.js","/assets/filter-select-Dln9CAM3.js","/assets/pagination-5gEldBFM.js","/assets/table-B5BEGV9S.js","/assets/MenuTrigger-CkqlwCsV.js","/assets/useOpenInteractionType-BGObzouY.js","/assets/createLucideIcon-oZ0wXCaF.js","/assets/check-BePyOaOM.js","/assets/chevron-down-C8oENez_.js","/assets/chevron-right-B0sTJmdc.js","/assets/x-EA6eZ1AP.js","/assets/react-dom-DQHA9Ik4.js"],"css":[]},"routes/queues._index":{"id":"routes/queues._index","parentId":"root","path":"queues","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/queues._index-BM3eKnSr.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/db-link-DISwKBYZ.js","/assets/badge-DFReduIj.js","/assets/button-CafwM-5D.js","/assets/filter-select-Dln9CAM3.js","/assets/table-B5BEGV9S.js"],"css":[]},"routes/queues.create":{"id":"routes/queues.create","parentId":"root","path":"queues/create","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/queues.create-BVR72i85.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/db-link-DISwKBYZ.js","/assets/error-card-2aexlkmv.js","/assets/button-CafwM-5D.js","/assets/chevron-down-C8oENez_.js","/assets/createLucideIcon-oZ0wXCaF.js"],"css":[]},"routes/queues.$name":{"id":"routes/queues.$name","parentId":"root","path":"queues/:name","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/queues._name-DSOGXBen.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/db-link-DISwKBYZ.js","/assets/error-card-2aexlkmv.js","/assets/badge-DFReduIj.js","/assets/button-CafwM-5D.js","/assets/dialog-IBPuwpas.js","/assets/filter-select-Dln9CAM3.js","/assets/pagination-5gEldBFM.js","/assets/stat-card-y2feeHt0.js","/assets/table-B5BEGV9S.js","/assets/MenuTrigger-CkqlwCsV.js","/assets/createLucideIcon-oZ0wXCaF.js","/assets/chevron-down-C8oENez_.js","/assets/chevron-right-B0sTJmdc.js","/assets/useOpenInteractionType-BGObzouY.js","/assets/x-EA6eZ1AP.js","/assets/react-dom-DQHA9Ik4.js"],"css":[]},"routes/queues.$name.jobs.$jobId":{"id":"routes/queues.$name.jobs.$jobId","parentId":"root","path":"queues/:name/jobs/:jobId","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/queues._name.jobs._jobId-DKGu8NkE.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/db-link-DISwKBYZ.js","/assets/error-card-2aexlkmv.js","/assets/badge-DFReduIj.js","/assets/button-CafwM-5D.js","/assets/dialog-IBPuwpas.js","/assets/createLucideIcon-oZ0wXCaF.js","/assets/check-BePyOaOM.js","/assets/useOpenInteractionType-BGObzouY.js","/assets/x-EA6eZ1AP.js","/assets/react-dom-DQHA9Ik4.js"],"css":[]},"routes/schedules":{"id":"routes/schedules","parentId":"root","path":"schedules","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/schedules-CE-hWC9e.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/db-link-DISwKBYZ.js","/assets/error-card-2aexlkmv.js","/assets/badge-DFReduIj.js","/assets/button-CafwM-5D.js","/assets/pagination-5gEldBFM.js","/assets/table-B5BEGV9S.js"],"css":[]},"routes/schedules.$name.$key":{"id":"routes/schedules.$name.$key","parentId":"root","path":"schedules/:name/:key","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/schedules._name._key-DT8Kg4jU.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/db-link-DISwKBYZ.js","/assets/error-card-2aexlkmv.js","/assets/button-CafwM-5D.js","/assets/dialog-IBPuwpas.js","/assets/useOpenInteractionType-BGObzouY.js","/assets/x-EA6eZ1AP.js","/assets/react-dom-DQHA9Ik4.js","/assets/createLucideIcon-oZ0wXCaF.js"],"css":[]},"routes/schedules.new":{"id":"routes/schedules.new","parentId":"root","path":"schedules/new","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/schedules.new-bKRusXXO.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/db-link-DISwKBYZ.js","/assets/error-card-2aexlkmv.js","/assets/button-CafwM-5D.js"],"css":[]},"routes/send":{"id":"routes/send","parentId":"root","path":"send","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/send-BaWw8x7J.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/db-link-DISwKBYZ.js","/assets/error-card-2aexlkmv.js","/assets/button-CafwM-5D.js"],"css":[]},"routes/warnings":{"id":"routes/warnings","parentId":"root","path":"warnings","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/warnings-lzi34PdC.js","imports":["/assets/jsx-runtime-DcdjQ3vN.js","/assets/db-link-DISwKBYZ.js","/assets/error-card-2aexlkmv.js","/assets/badge-DFReduIj.js","/assets/button-CafwM-5D.js","/assets/filter-select-Dln9CAM3.js","/assets/pagination-5gEldBFM.js","/assets/table-B5BEGV9S.js"],"css":[]}},"url":"/assets/manifest-e6a94de0.js","version":"e6a94de0"};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./jsx-runtime-DcdjQ3vN.js";import{u as t}from"./db-link-DISwKBYZ.js";import{t as n}from"./button-CafwM-5D.js";var r=e();function i({page:e,totalPages:i,hasNextPage:a,hasPrevPage:o,onPageChange:s}){return!o&&!a?null:(0,r.jsxs)(`div`,{className:t(`flex items-center justify-between px-6 py-4 border-t`,`border-gray-200 dark:border-gray-800`),children:[(0,r.jsxs)(`div`,{className:`text-sm text-gray-500 dark:text-gray-400`,children:[`Page `,e,i!=null&&` of ${i}`]}),(0,r.jsxs)(`div`,{className:`flex gap-2`,children:[(0,r.jsx)(n,{variant:`outline`,size:`sm`,onClick:()=>s(e-1),disabled:!o,children:`Previous`}),(0,r.jsx)(n,{variant:`outline`,size:`sm`,onClick:()=>s(e+1),disabled:!a,children:`Next`})]})]})}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e,H as t,L as n,R as r,t as i,z as a}from"./jsx-runtime-DcdjQ3vN.js";import{t as o,u as s}from"./db-link-DISwKBYZ.js";import{n as c,r as l,t as u}from"./button-CafwM-5D.js";import{n as d,t as f}from"./badge-DFReduIj.js";import{a as p,i as m,n as h,o as g,r as _,t as v}from"./table-B5BEGV9S.js";import{t as y}from"./filter-select-Dln9CAM3.js";var b=t(e(),1),x=i(),S=a(function(){return(0,x.jsx)(`div`,{className:`p-6`,children:(0,x.jsx)(c,{children:(0,x.jsxs)(l,{className:`py-8 text-center`,children:[(0,x.jsx)(`p`,{className:`text-red-600 dark:text-red-400 font-medium`,children:`Failed to load queues`}),(0,x.jsx)(`p`,{className:`text-gray-500 dark:text-gray-400 text-sm mt-1`,children:`Please check your database connection and try again.`}),(0,x.jsx)(o,{to:`/`,className:`inline-block mt-4 text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300`,children:`Back to Dashboard`})]})})})}),C=r(function({loaderData:e}){let{queues:t,totalCount:r,page:i,totalPages:a,hasNextPage:S,hasPrevPage:C,filter:E,search:D}=e,[O,k]=n(),[A,j]=(0,b.useState)(D);(0,b.useEffect)(()=>{j(D)},[D]);let M=e=>{let t=new URLSearchParams(O);t.set(`page`,e.toString()),k(t)},N=e=>{let t=new URLSearchParams(O);e.trim()?t.set(`search`,e.trim()):t.delete(`search`),t.delete(`page`),k(t)},P=e=>{let t=new URLSearchParams(O);e===`all`?t.delete(`filter`):t.set(`filter`,e),t.delete(`page`),k(t)},F=()=>{k({}),j(``)},I=E!==`all`||D;return(0,x.jsxs)(`div`,{className:`space-y-4`,children:[(0,x.jsx)(d,{title:`Queues`,subtitle:`${r.toLocaleString()} queue${r===1?``:`s`} ${I?`found`:`configured`}`,action:(0,x.jsx)(o,{to:`/queues/create`,children:(0,x.jsx)(u,{variant:`primary`,size:`md`,children:`Create Queue`})})}),(0,x.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3`,children:[(0,x.jsx)(`div`,{className:`flex-1`,children:(0,x.jsxs)(`div`,{className:`relative`,children:[(0,x.jsx)(`input`,{type:`text`,placeholder:`Search queues by name...`,value:A,onChange:e=>j(e.target.value),onKeyDown:e=>{e.key===`Enter`&&N(A)},className:s(`w-full h-[38px] px-3 py-2 pl-10 rounded-lg border shadow-sm text-sm`,`bg-[var(--surface-card)] border-[var(--border-strong)] text-[var(--text-primary)] placeholder-[var(--text-tertiary)]`,`focus:outline-none focus:border-[var(--border-focus)] focus:shadow-[var(--shadow-focus)]`)}),(0,x.jsx)(w,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-[18px] w-[18px] text-[var(--text-tertiary)]`}),A&&(0,x.jsx)(`button`,{onClick:()=>{j(``),N(``)},className:`absolute right-3 top-1/2 -translate-y-1/2 text-[var(--text-tertiary)] hover:text-[var(--text-secondary)] cursor-pointer`,children:(0,x.jsx)(T,{className:`h-[18px] w-[18px]`})})]})}),(0,x.jsx)(y,{value:E,options:[{value:`all`,label:`All Queues`},{value:`attention`,label:`Needing Attention`},{value:`partitioned`,label:`Partitioned`}],onChange:e=>P(e)})]}),I&&(0,x.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,x.jsx)(`span`,{className:`text-sm text-gray-500 dark:text-gray-400`,children:`Active filters:`}),E!==`all`&&(0,x.jsxs)(f,{variant:`primary`,size:`sm`,children:[{all:`All Queues`,attention:`Needing Attention`,partitioned:`Partitioned`}[E],(0,x.jsx)(`button`,{onClick:()=>P(`all`),className:`ml-1 hover:text-primary-700 cursor-pointer`,children:`×`})]}),D&&(0,x.jsxs)(f,{variant:`primary`,size:`sm`,children:[`Search: `,D,(0,x.jsx)(`button`,{onClick:()=>N(``),className:`ml-1 hover:text-primary-700 cursor-pointer`,children:`×`})]}),(0,x.jsx)(`button`,{onClick:F,className:`text-sm text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300 cursor-pointer`,children:`Clear all`})]}),(0,x.jsxs)(c,{children:[(0,x.jsx)(l,{className:`p-0`,children:(0,x.jsxs)(v,{children:[(0,x.jsx)(p,{children:(0,x.jsxs)(g,{children:[(0,x.jsx)(m,{children:`Name`}),(0,x.jsx)(m,{children:`Policy`}),(0,x.jsx)(m,{children:`Storage`}),(0,x.jsx)(m,{className:`text-right`,children:`Queued`}),(0,x.jsx)(m,{className:`text-right`,children:`Active`}),(0,x.jsx)(m,{className:`text-right`,children:`Deferred`}),(0,x.jsx)(m,{className:`text-right`,children:`Total`}),(0,x.jsx)(m,{children:`Dead Letter`}),(0,x.jsx)(m,{children:`Status`})]})}),(0,x.jsx)(h,{children:t.length===0?(0,x.jsx)(g,{children:(0,x.jsx)(_,{className:`text-center text-[var(--text-tertiary)] py-8`,colSpan:9,children:`No queues found`})}):t.map(e=>{let t=(e.warningQueueSize??0)>0&&e.queuedCount>(e.warningQueueSize??0);return(0,x.jsxs)(g,{children:[(0,x.jsx)(_,{children:(0,x.jsx)(o,{to:`/queues/${encodeURIComponent(e.name)}`,className:`font-medium text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300`,children:e.name})}),(0,x.jsx)(_,{children:(0,x.jsx)(f,{variant:`gray`,size:`sm`,children:e.policy})}),(0,x.jsx)(_,{className:`text-[var(--text-secondary)]`,children:e.partition?`Partitioned`:`Shared`}),(0,x.jsx)(_,{className:`text-right pgb-num text-[var(--text-primary)]`,children:e.queuedCount.toLocaleString()}),(0,x.jsx)(_,{className:`text-right pgb-num text-[var(--text-primary)]`,children:e.activeCount.toLocaleString()}),(0,x.jsx)(_,{className:`text-right pgb-num text-[var(--text-primary)]`,children:e.deferredCount.toLocaleString()}),(0,x.jsx)(_,{className:`text-right pgb-num text-[var(--text-primary)]`,children:e.totalCount.toLocaleString()}),(0,x.jsx)(_,{children:e.deadLetter?(0,x.jsx)(o,{to:`/queues/${encodeURIComponent(e.deadLetter)}`,className:`font-mono text-xs text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300`,children:e.deadLetter}):(0,x.jsx)(`span`,{className:`text-[var(--border-strong)]`,children:`—`})}),(0,x.jsx)(_,{children:t?(0,x.jsx)(f,{variant:`error`,size:`sm`,dot:!0,children:`Backlogged`}):e.activeCount>0?(0,x.jsx)(f,{variant:`success`,size:`sm`,dot:!0,children:`Processing`}):(0,x.jsx)(f,{variant:`gray`,size:`sm`,dot:!0,children:`Idle`})})]},e.name)})})]})}),a>1&&(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-3 border-t border-[var(--border-subtle)]`,children:[(0,x.jsxs)(`div`,{className:`text-sm text-[var(--text-tertiary)]`,children:[`Page `,(0,x.jsx)(`b`,{className:`pgb-num text-[var(--text-secondary)] font-medium`,children:i}),` of `,(0,x.jsx)(`b`,{className:`pgb-num text-[var(--text-secondary)] font-medium`,children:a})]}),(0,x.jsxs)(`div`,{className:`flex gap-2`,children:[(0,x.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>M(i-1),disabled:!C,children:`Previous`}),(0,x.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>M(i+1),disabled:!S,children:`Next`})]})]})]})]})});function w({className:e}){return(0,x.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,children:(0,x.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z`})})}function T({className:e}){return(0,x.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,children:(0,x.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 18 18 6M6 6l12 12`})})}export{S as ErrorBoundary,C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,B as t,H as n,L as r,R as i,t as a,z as o}from"./jsx-runtime-DcdjQ3vN.js";import{t as s}from"./createLucideIcon-oZ0wXCaF.js";import{t as c}from"./chevron-down-C8oENez_.js";import{t as l}from"./chevron-right-B0sTJmdc.js";import{a as u,d,o as f,t as p,u as m}from"./db-link-DISwKBYZ.js";import{a as h,i as g,l as _,n as v,o as y,t as b}from"./MenuTrigger-CkqlwCsV.js";import{a as x,i as S,n as C,o as w,r as T,t as E}from"./dialog-IBPuwpas.js";import{t as D}from"./stat-card-y2feeHt0.js";import{a as O,i as k,n as A,r as j,t as M}from"./button-CafwM-5D.js";import{n as N,t as P}from"./badge-DFReduIj.js";import{a as F,i as I,n as L,o as R,r as z,t as B}from"./table-B5BEGV9S.js";import{t as V}from"./error-card-2aexlkmv.js";import{t as H}from"./pagination-5gEldBFM.js";import{t as U}from"./filter-select-Dln9CAM3.js";var W=s(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),G=n(t(),1),K=a(),q=o(function(){return(0,K.jsx)(V,{title:`Failed to load queue`,backTo:{href:`/queues`,label:`Back to Queues`}})}),J=i(function({loaderData:e}){let{queue:t,jobs:n,totalCount:i,page:a,totalPages:o,stateFilter:s,hasNextPage:f,hasPrevPage:h}=e,[g,_]=r(),[v,y]=(0,G.useState)(!1),b=(e,t)=>{let n=new URLSearchParams(g);t?n.set(e,t):n.delete(e),n.delete(`page`),_(n)},x=e=>{let t=new URLSearchParams(g);t.set(`page`,e.toString()),_(t)},S=(t.warningQueueSize??0)>0&&t.queuedCount>(t.warningQueueSize??0);return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(N,{title:t.name,subtitle:`${t.partition?`Partitioned`:`Shared`} storage`,action:(0,K.jsx)(p,{to:`/send?queue=${encodeURIComponent(t.name)}`,children:(0,K.jsx)(M,{variant:`primary`,size:`md`,children:`Send Job`})})}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 -mt-2`,children:[(0,K.jsxs)(P,{variant:`primary`,children:[t.policy,` policy`]}),t.deadLetter&&(0,K.jsxs)(P,{variant:`gray`,children:[`dead letter → `,t.deadLetter]}),(t.retryLimit??0)>0&&(0,K.jsxs)(P,{variant:`gray`,children:[`retry limit `,t.retryLimit]})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-4`,children:[(0,K.jsx)(D,{label:`Queued`,value:t.queuedCount.toLocaleString(),accent:S?`error`:`neutral`,hint:S?`over threshold`:`within threshold`}),(0,K.jsx)(D,{label:`Active`,value:t.activeCount.toLocaleString(),accent:`primary`}),(0,K.jsx)(D,{label:`Deferred`,value:t.deferredCount.toLocaleString()}),(0,K.jsx)(D,{label:`Total`,value:t.totalCount.toLocaleString()})]}),(0,K.jsxs)(A,{children:[(0,K.jsxs)(`button`,{onClick:()=>y(!v),className:m(`w-full flex items-center justify-between px-5 py-4`,`text-left hover:bg-[var(--surface-hover)]`,`transition-colors cursor-pointer`),children:[(0,K.jsx)(`h3`,{className:`text-base font-semibold tracking-[-0.01em] text-[var(--text-primary)]`,children:`Configuration`}),v?(0,K.jsx)(c,{className:`h-5 w-5 text-[var(--text-tertiary)]`}):(0,K.jsx)(l,{className:`h-5 w-5 text-[var(--text-tertiary)]`})]}),v&&(0,K.jsx)(j,{className:`border-t border-[var(--border-subtle)]`,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-4`,children:[(0,K.jsx)(Z,{label:`Policy`,value:t.policy||`—`}),(0,K.jsx)(Z,{label:`Storage`,value:t.partition?`Partitioned`:`Shared`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{className:`pgb-eyebrow`,children:`Dead Letter`}),(0,K.jsx)(`dd`,{className:`mt-1 text-sm text-[var(--text-primary)]`,children:t.deadLetter?(0,K.jsx)(p,{to:`/queues/${t.deadLetter}`,className:`font-mono text-xs text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300`,children:t.deadLetter}):`—`})]}),(0,K.jsx)(Z,{label:`Warning Threshold`,value:t.warningQueueSize||`—`})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-4`,children:[(0,K.jsx)(Z,{label:`Retry Limit`,value:t.retryLimit??0}),(0,K.jsx)(Z,{label:`Retry Delay`,value:t.retryDelay?`${t.retryDelay}ms`:`—`}),(0,K.jsx)(Z,{label:`Retry Delay Max`,value:t.retryDelayMax?`${t.retryDelayMax}ms`:`—`}),(0,K.jsx)(Z,{label:`Retry Backoff`,value:t.retryBackoff?`Enabled`:`Disabled`})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-4`,children:[(0,K.jsx)(Z,{label:`Expiration`,value:Q(t.expireInSeconds)}),(0,K.jsx)(Z,{label:`Retention`,value:Q(t.retentionSeconds)}),(0,K.jsx)(Z,{label:`Deletion`,value:Q(t.deleteAfterSeconds)})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-4`,children:[(0,K.jsx)(Z,{label:`Created`,value:t.createdOn?d(new Date(t.createdOn)):`—`}),(0,K.jsx)(Z,{label:`Last monitored`,value:t.monitorOn?d(new Date(t.monitorOn)):`—`}),(0,K.jsx)(Z,{label:`Last maintained`,value:t.maintainOn?d(new Date(t.maintainOn)):`—`})]})]})})]}),(0,K.jsxs)(A,{children:[(0,K.jsxs)(k,{className:`flex flex-row items-center justify-between`,children:[(0,K.jsxs)(O,{children:[`Jobs`,i!==null&&` (${i.toLocaleString()})`]}),(0,K.jsx)(U,{value:s,options:u,onChange:e=>b(`state`,e)})]}),(0,K.jsx)(j,{className:`p-0`,children:(0,K.jsxs)(B,{children:[(0,K.jsx)(F,{children:(0,K.jsxs)(R,{children:[(0,K.jsx)(I,{children:`ID`}),(0,K.jsx)(I,{children:`State`}),(0,K.jsx)(I,{children:`Priority`}),(0,K.jsx)(I,{children:`Retries`}),(0,K.jsx)(I,{children:`Created`}),(0,K.jsx)(I,{children:`Actions`})]})}),(0,K.jsx)(L,{children:n.length===0?(0,K.jsx)(R,{children:(0,K.jsx)(z,{className:`text-center text-[var(--text-tertiary)] py-8`,colSpan:6,children:`No jobs found`})}):n.map(e=>(0,K.jsx)(Y,{job:e,queueName:t.name},e.id))})]})}),(0,K.jsx)(H,{page:a,totalPages:o,hasNextPage:f,hasPrevPage:h,onPageChange:x})]})]})});function Y({job:t,queueName:n}){let r=e(),i=r.state!==`idle`,[a,o]=(0,G.useState)(null),s=r.data,c=s&&!s.success&&s.affected===0,l=e=>{r.submit({jobId:t.id,intent:e},{method:`post`})},u=(e,t,n,r)=>{o({open:!0,title:t,description:n,confirmLabel:r,intent:e})},f=()=>{a&&(l(a.intent),o(null))},D=t.state===`created`||t.state===`retry`||t.state===`active`,O=t.state===`failed`,k=t.state===`cancelled`,A=t.state!==`active`,j=m(`flex w-full items-center px-3 py-2 text-sm cursor-pointer`,`outline-none transition-colors rounded-sm`,`text-gray-700 data-highlighted:bg-gray-100 data-highlighted:text-gray-900`,`dark:text-gray-300 dark:data-highlighted:bg-gray-800 dark:data-highlighted:text-gray-100`),N=m(`flex w-full items-center px-3 py-2 text-sm cursor-pointer`,`outline-none transition-colors rounded-sm`,`text-red-600 data-highlighted:bg-red-50 data-highlighted:text-red-700`,`dark:text-red-400 dark:data-highlighted:bg-red-950 dark:data-highlighted:text-red-300`);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(R,{children:[(0,K.jsx)(z,{children:(0,K.jsxs)(p,{to:`/queues/${n}/jobs/${t.id}`,className:`font-mono text-xs text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300`,children:[t.id.slice(0,8),`...`]})}),(0,K.jsx)(z,{children:(0,K.jsx)(X,{state:t.state})}),(0,K.jsx)(z,{className:`pgb-num text-[var(--text-primary)]`,children:t.priority}),(0,K.jsxs)(z,{className:`pgb-num text-[var(--text-primary)]`,children:[t.retryCount,` / `,t.retryLimit]}),(0,K.jsx)(z,{className:`pgb-num text-[var(--text-tertiary)]`,children:d(new Date(t.createdOn))}),(0,K.jsx)(z,{children:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c&&(0,K.jsx)(`span`,{className:`text-xs text-amber-600 dark:text-amber-400`,title:s.message,children:`Failed`}),(0,K.jsxs)(v,{children:[(0,K.jsx)(b,{className:m(`inline-flex items-center justify-center rounded-md p-1.5`,`text-gray-500 hover:text-gray-900 hover:bg-gray-100`,`dark:text-gray-400 dark:hover:text-gray-100 dark:hover:bg-gray-800`,`focus:outline-none focus:ring-2 focus:ring-primary-500`,`transition-colors disabled:opacity-50`),disabled:i,"aria-label":`Job actions`,children:(0,K.jsx)(W,{className:`h-4 w-4`})}),(0,K.jsx)(h,{children:(0,K.jsx)(g,{children:(0,K.jsxs)(y,{className:m(`min-w-[10rem] rounded-md border p-1 shadow-md z-50`,`bg-white border-gray-200`,`dark:bg-gray-900 dark:border-gray-800`,`animate-in fade-in-0 zoom-in-95`),children:[O&&(0,K.jsx)(_,{className:j,onClick:()=>l(`retry`),children:`Retry`}),k&&(0,K.jsx)(_,{className:j,onClick:()=>l(`resume`),children:`Resume`}),D&&(0,K.jsx)(_,{className:N,onClick:()=>u(`cancel`,`Cancel Job`,`Are you sure you want to cancel job ${t.id.slice(0,8)}...? This will stop the job from being processed.`,`Cancel Job`),children:`Cancel`}),A&&(0,K.jsx)(_,{className:N,onClick:()=>u(`delete`,`Delete Job`,`Are you sure you want to delete job ${t.id.slice(0,8)}...? This action cannot be undone.`,`Delete`),children:`Delete`})]})})})]})]})})]}),(0,K.jsx)(x,{open:a?.open??!1,onOpenChange:e=>!e&&o(null),children:(0,K.jsxs)(E,{hideCloseButton:!0,className:`w-[28rem] max-w-[calc(100vw-2rem)]`,children:[(0,K.jsxs)(S,{children:[(0,K.jsx)(w,{children:a?.title}),(0,K.jsx)(C,{className:`mt-2`,children:a?.description})]}),(0,K.jsxs)(T,{className:`mt-6 flex justify-end gap-3`,children:[(0,K.jsx)(M,{variant:`outline`,size:`sm`,className:`cursor-pointer`,onClick:()=>o(null),children:`Cancel`}),(0,K.jsx)(M,{variant:`danger`,size:`sm`,className:`cursor-pointer`,onClick:f,children:a?.confirmLabel})]})]})})]})}function X({state:e}){return(0,K.jsx)(P,{variant:f[e],size:`sm`,dot:!0,children:e})}function Z({label:e,value:t}){return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{className:`pgb-eyebrow`,children:e}),(0,K.jsx)(`dd`,{className:`mt-1 text-sm text-[var(--text-primary)]`,children:t?.toString()||`—`})]})}function Q(e){if(!e)return`—`;if(e<60)return`${e} seconds`;if(e<3600){let t=Math.floor(e/60);return`${t} ${t===1?`minute`:`minutes`}`}if(e<86400){let t=Math.floor(e/3600),n=Math.floor(e%3600/60);return n===0?`${t} ${t===1?`hour`:`hours`}`:`${t} ${t===1?`hour`:`hours`} ${n} ${n===1?`minute`:`minutes`}`}let t=Math.floor(e/86400),n=Math.floor(e%86400/3600);return n===0?`${t} ${t===1?`day`:`days`}`:`${t} ${t===1?`day`:`days`} ${n} ${n===1?`hour`:`hours`}`}export{q as ErrorBoundary,J as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,B as t,H as n,R as r,t as i,z as a}from"./jsx-runtime-DcdjQ3vN.js";import{t as o}from"./createLucideIcon-oZ0wXCaF.js";import{t as s}from"./check-BePyOaOM.js";import{d as c,o as l,t as u,u as d}from"./db-link-DISwKBYZ.js";import{a as f,i as p,n as m,o as h,r as g,t as _}from"./dialog-IBPuwpas.js";import{a as v,i as y,n as b,r as x,t as S}from"./button-CafwM-5D.js";import{n as C,t as w}from"./badge-DFReduIj.js";import{t as T}from"./error-card-2aexlkmv.js";var E=o(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),D=n(t(),1),O=i();function k({title:e,description:t,confirmLabel:n,confirmVariant:r=`primary`,triggerVariant:i=`ghost`,trigger:a,onConfirm:o,disabled:s}){let[c,l]=(0,D.useState)(!1);return(0,O.jsxs)(f,{open:c,onOpenChange:l,children:[(0,O.jsx)(S,{variant:i,size:`sm`,disabled:s,onClick:()=>l(!0),className:`cursor-pointer`,children:a}),(0,O.jsxs)(_,{hideCloseButton:!0,className:`w-[28rem] max-w-[calc(100vw-2rem)]`,children:[(0,O.jsxs)(p,{children:[(0,O.jsx)(h,{children:e}),(0,O.jsx)(m,{className:`mt-2`,children:t})]}),(0,O.jsxs)(g,{className:`mt-6 flex justify-end gap-3`,children:[(0,O.jsx)(S,{variant:`outline`,size:`sm`,className:`cursor-pointer`,onClick:()=>l(!1),children:`Cancel`}),(0,O.jsx)(S,{variant:r===`danger`?`danger`:`primary`,size:`sm`,className:`cursor-pointer`,onClick:()=>{o(),l(!1)},children:n})]})]})]})}var A=a(function(){return(0,O.jsx)(T,{title:`Failed to load job`,backTo:{href:`/queues`,label:`Back to Queues`}})}),j=r(function({loaderData:t}){let{job:n,queueName:r}=t,i=e(),a=i.state!==`idle`,[o,f]=(0,D.useState)(!1),p=i.data,m=p&&!p.success&&p.affected===0,h=e=>{i.submit({intent:e},{method:`post`})},g=async()=>{await navigator.clipboard.writeText(n.id),f(!0),setTimeout(()=>f(!1),2e3)},_=n.state===`failed`;return(0,O.jsxs)(`div`,{className:`space-y-4`,children:[(0,O.jsx)(C,{title:(0,O.jsxs)(`span`,{className:`inline-flex items-center gap-3`,children:[`Job detail`,(0,O.jsx)(w,{variant:l[n.state],size:`lg`,dot:!0,children:n.state})]}),action:(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m&&(0,O.jsx)(`span`,{className:`text-xs text-[var(--warning-600)]`,title:p.message,children:`Action failed`}),n.state===`failed`&&(0,O.jsx)(S,{variant:`outline`,size:`sm`,disabled:a,onClick:()=>h(`retry`),children:`Retry`}),n.state===`cancelled`&&(0,O.jsx)(S,{variant:`outline`,size:`sm`,disabled:a,onClick:()=>h(`resume`),children:`Resume`}),(n.state===`created`||n.state===`retry`||n.state===`active`)&&(0,O.jsx)(k,{title:`Cancel Job`,description:`Are you sure you want to cancel job ${n.id.slice(0,8)}...? This will prevent the job from being processed.`,confirmLabel:`Cancel Job`,confirmVariant:`danger`,triggerVariant:`outline`,trigger:`Cancel`,onConfirm:()=>h(`cancel`),disabled:a}),n.state!==`active`&&(0,O.jsx)(k,{title:`Delete Job`,description:`Are you sure you want to delete job ${n.id.slice(0,8)}...? This action cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`danger`,triggerVariant:`danger`,trigger:`Delete`,onConfirm:()=>h(`delete`),disabled:a})]})}),(0,O.jsxs)(b,{children:[(0,O.jsxs)(y,{children:[(0,O.jsx)(v,{children:`Details`}),(0,O.jsxs)(`span`,{className:`text-xs text-[var(--text-tertiary)]`,children:[`in queue`,` `,(0,O.jsx)(u,{to:`/queues/${encodeURIComponent(r)}`,className:`font-mono text-xs text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300`,children:r})]})]}),(0,O.jsxs)(x,{className:`space-y-6`,children:[(0,O.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-[2fr_1fr_1fr] gap-6`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`pgb-eyebrow mb-1`,children:`Job ID`}),(0,O.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,O.jsx)(`code`,{className:`text-sm font-mono break-all text-[var(--text-primary)]`,children:n.id}),(0,O.jsx)(`button`,{onClick:g,className:d(`p-1 rounded-md transition-colors cursor-pointer flex-shrink-0`,`text-[var(--text-tertiary)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-hover)]`),title:o?`Copied!`:`Copy to clipboard`,children:o?(0,O.jsx)(s,{className:`h-4 w-4 text-[var(--success-600)]`}):(0,O.jsx)(E,{className:`h-4 w-4`})})]})]}),(0,O.jsx)(M,{label:`Policy`,value:n.policy||`—`}),(0,O.jsx)(M,{label:`Priority`,value:n.priority,mono:!0})]}),(0,O.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`pgb-eyebrow mb-1.5`,children:`Data`}),(0,O.jsx)(`pre`,{className:`text-xs px-3.5 py-3 rounded-lg border border-[var(--border-default)] bg-[var(--surface-sunken)] font-mono leading-relaxed text-[var(--text-primary)] overflow-auto max-h-40`,children:n.data?JSON.stringify(n.data,null,2):`null`})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`pgb-eyebrow mb-1.5`,children:`Output`}),(0,O.jsx)(`pre`,{className:d(`text-xs px-3.5 py-3 rounded-lg border font-mono leading-relaxed text-[var(--text-primary)] overflow-auto max-h-40`,_?`border-[var(--error-100)] bg-[var(--error-50)]`:`border-[var(--border-default)] bg-[var(--surface-sunken)]`),children:n.output!==void 0&&n.output!==null?JSON.stringify(n.output,null,2):`—`})]})]}),(0,O.jsx)(`div`,{children:(0,O.jsxs)(`div`,{className:`space-y-6`,children:[(0,O.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-4`,children:(0,O.jsx)(M,{label:`Priority`,value:n.priority})}),(0,O.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-4`,children:[(0,O.jsx)(M,{label:`Retry Count`,value:n.retryCount,mono:!0}),(0,O.jsx)(M,{label:`Retry Limit`,value:n.retryLimit,mono:!0}),(0,O.jsx)(M,{label:`Retry Delay`,value:n.retryDelay?`${n.retryDelay}ms`:`—`,mono:!0}),(0,O.jsx)(M,{label:`Retry Backoff`,value:n.retryBackoff?`Enabled`:`Disabled`})]}),(n.singletonKey||n.groupId||n.groupTier||n.deadLetter)&&(0,O.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-4`,children:[n.singletonKey&&(0,O.jsx)(M,{label:`Singleton Key`,value:n.singletonKey,mono:!0}),n.groupId&&(0,O.jsx)(M,{label:`Group ID`,value:n.groupId,mono:!0}),n.groupTier&&(0,O.jsx)(M,{label:`Group Tier`,value:n.groupTier,mono:!0}),n.deadLetter&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{className:`pgb-eyebrow`,children:`Dead Letter`}),(0,O.jsx)(`dd`,{className:`mt-1 text-sm text-[var(--text-primary)]`,children:(0,O.jsx)(u,{to:`/queues/${n.deadLetter}`,className:`font-mono text-xs text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300`,children:n.deadLetter})})]})]}),(0,O.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-x-6 gap-y-4`,children:[(0,O.jsx)(M,{label:`Created`,value:c(new Date(n.createdOn)),mono:!0}),(0,O.jsx)(M,{label:`Start After`,value:n.startAfter?c(new Date(n.startAfter)):`—`,mono:!0}),(0,O.jsx)(M,{label:`Started`,value:n.startedOn?c(new Date(n.startedOn)):`—`,mono:!0}),(0,O.jsx)(M,{label:`Completed`,value:n.completedOn?c(new Date(n.completedOn)):`—`,mono:!0}),(0,O.jsx)(M,{label:`Keep Until`,value:n.keepUntil?c(new Date(n.keepUntil)):`—`,mono:!0})]})]})})]})]})]})});function M({label:e,value:t,mono:n=!1}){return(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`dt`,{className:`pgb-eyebrow`,children:e}),(0,O.jsx)(`dd`,{className:d(`mt-1 text-sm text-[var(--text-primary)]`,n&&`pgb-num`),children:t?.toString()||`—`})]})}export{A as ErrorBoundary,j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e,F as t,H as n,O as r,R as i,k as a,t as o,z as s}from"./jsx-runtime-DcdjQ3vN.js";import{t as c}from"./chevron-down-C8oENez_.js";import{t as l,u}from"./db-link-DISwKBYZ.js";import{a as d,i as f,n as p,r as m,t as h}from"./button-CafwM-5D.js";import{t as g}from"./error-card-2aexlkmv.js";var _=n(e(),1),v=o(),y=(0,_.forwardRef)(({className:e,label:t,id:n,...r},i)=>{let a=n||`checkbox-${Math.random().toString(36).substr(2,9)}`;return(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`input`,{type:`checkbox`,id:a,ref:i,className:u(`h-4 w-4 rounded border-gray-300 text-primary-600`,`focus:ring-2 focus:ring-primary-600 focus:ring-offset-0`,`dark:border-gray-700 dark:bg-gray-900`,`dark:checked:bg-primary-600 dark:checked:border-primary-600`,`cursor-pointer disabled:cursor-not-allowed disabled:opacity-50`,e),...r}),t&&(0,v.jsx)(`label`,{htmlFor:a,className:`text-sm text-gray-700 dark:text-gray-300 cursor-pointer select-none`,children:t})]})});y.displayName=`Checkbox`;function b({value:e,onValueChange:t,children:n,className:r}){let[i,a]=(0,_.useState)(!1),o=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=e=>{o.current&&!o.current.contains(e.target)&&a(!1)};return i&&document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[i]);let s=[],l=e=>{if(Array.isArray(e))e.forEach(l);else if(e&&typeof e==`object`&&`props`in e){let t=e;t.type===x?s.push({value:t.props.value,label:t.props.children}):t.props?.children&&l(t.props.children)}};l(n);let d=s.find(t=>t.value===e);return(0,v.jsxs)(`div`,{ref:o,className:u(`relative`,r),children:[(0,v.jsxs)(`button`,{type:`button`,onClick:()=>a(!i),className:u(`flex items-center justify-between w-full px-3 py-2 text-sm rounded-lg shadow-sm`,`bg-white border border-gray-300 text-gray-900`,`dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100`,`hover:bg-gray-50 dark:hover:bg-gray-800`,`focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent`,`cursor-pointer`),children:[(0,v.jsx)(`span`,{className:`truncate text-left`,children:d?.label||`Select...`}),(0,v.jsx)(c,{className:`h-4 w-4 opacity-50 ml-2 shrink-0`})]}),i&&s.length>0&&(0,v.jsx)(`div`,{className:`absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto`,children:s.map(n=>(0,v.jsx)(`button`,{type:`button`,onClick:()=>{t(n.value),a(!1)},className:u(`w-full text-left px-3 py-2 text-sm`,`hover:bg-gray-100 dark:hover:bg-gray-800`,`text-gray-900 dark:text-gray-100`,`cursor-pointer`,n.value===e&&`bg-gray-50 dark:bg-gray-800`),children:n.label},n.value))})]})}function x({value:e,children:t}){return null}var S=({children:e})=>null,C=({children:e}={})=>null,w=({children:e})=>(0,v.jsx)(v.Fragment,{children:e}),T=s(function(){return(0,v.jsx)(g,{title:`Failed to load queue creation page`,backTo:{href:`/queues`,label:`Back to Queues`}})}),E=i(function({loaderData:e}){let{queues:n}=e,i=r(),o=t().state===`submitting`,[s,c]=(0,_.useState)(!1),[g,T]=(0,_.useState)(`standard`),[E,D]=(0,_.useState)(`shared`),[O,k]=(0,_.useState)(!1),[A,j]=(0,_.useState)(``),[M,N]=(0,_.useState)(``),[P,F]=(0,_.useState)(!1),I=n.filter(e=>e.name.toLowerCase().includes(A.toLowerCase())),L=e=>{N(e),j(e),F(!1),c(!0)},R=a(({currentLocation:e,nextLocation:t})=>s&&!o&&e.pathname!==t.pathname);return(0,_.useEffect)(()=>{let e=e=>{s&&!o&&(e.preventDefault(),e.returnValue=``)};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[s,o]),(0,v.jsxs)(`div`,{className:`space-y-6`,children:[R.state===`blocked`&&(0,v.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,children:(0,v.jsxs)(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 max-w-md mx-4`,children:[(0,v.jsx)(`h2`,{className:`text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2`,children:`Unsaved Changes`}),(0,v.jsx)(`p`,{className:`text-sm text-gray-600 dark:text-gray-400 mb-6`,children:`You have unsaved changes. Are you sure you want to leave this page?`}),(0,v.jsxs)(`div`,{className:`flex gap-3 justify-end`,children:[(0,v.jsx)(h,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>R.reset(),children:`Stay`}),(0,v.jsx)(h,{type:`button`,variant:`danger`,size:`sm`,onClick:()=>R.proceed(),children:`Leave`})]})]})}),(0,v.jsx)(`h1`,{className:`text-2xl font-bold text-gray-900 dark:text-gray-100`,children:`Create Queue`}),(0,v.jsxs)(p,{children:[(0,v.jsx)(f,{children:(0,v.jsx)(d,{children:`Queue Configuration`})}),(0,v.jsx)(m,{children:(0,v.jsxs)(`form`,{method:`post`,className:`space-y-5`,onChange:()=>c(!0),onSubmit:()=>c(!1),children:[i&&`error`in i&&(0,v.jsx)(`div`,{className:u(`rounded-lg border px-4 py-3 text-sm`,`bg-red-50 border-red-200 text-red-700`,`dark:bg-red-950 dark:border-red-800 dark:text-red-400`),children:i.error}),(0,v.jsxs)(`div`,{children:[(0,v.jsxs)(`label`,{htmlFor:`queueName`,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:[`Queue Name `,(0,v.jsx)(`span`,{className:`text-red-500`,children:`*`})]}),(0,v.jsx)(`input`,{type:`text`,id:`queueName`,name:`queueName`,required:!0,placeholder:`my-queue`,className:u(`w-full rounded-lg border px-3 py-2 text-sm`,`bg-white border-gray-300 text-gray-900 placeholder-gray-400`,`dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500`,`focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent`)})]}),(0,v.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{htmlFor:`policy`,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:`Policy`}),(0,v.jsxs)(b,{value:g,onValueChange:e=>{T(e),c(!0)},children:[(0,v.jsx)(S,{children:(0,v.jsx)(C,{})}),(0,v.jsxs)(w,{children:[(0,v.jsx)(x,{value:`standard`,children:`Standard`}),(0,v.jsx)(x,{value:`short`,children:`Short`}),(0,v.jsx)(x,{value:`singleton`,children:`Singleton`}),(0,v.jsx)(x,{value:`stately`,children:`Stately`}),(0,v.jsx)(x,{value:`exclusive`,children:`Exclusive`}),(0,v.jsx)(x,{value:`key_strict_fifo`,children:`Key Strict FIFO`})]})]}),(0,v.jsx)(`input`,{type:`hidden`,name:`policy`,value:g}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-gray-500 dark:text-gray-400`,children:`Standard supports all features. Other policies restrict job queuing behavior.`})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{htmlFor:`storage`,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:`Storage`}),(0,v.jsxs)(b,{value:E,onValueChange:e=>{D(e),c(!0)},children:[(0,v.jsx)(S,{children:(0,v.jsx)(C,{})}),(0,v.jsxs)(w,{children:[(0,v.jsx)(x,{value:`shared`,children:`Shared`}),(0,v.jsx)(x,{value:`partitioned`,children:`Partitioned`})]})]}),(0,v.jsx)(`input`,{type:`hidden`,name:`partition`,value:E===`partitioned`?`true`:`false`}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-gray-500 dark:text-gray-400`,children:`Partitioned creates a dedicated table for this queue`})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{htmlFor:`deadLetterSearch`,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:`Dead Letter Queue`}),(0,v.jsxs)(`div`,{className:`relative`,children:[(0,v.jsx)(`input`,{type:`text`,id:`deadLetterSearch`,value:A,onChange:e=>{j(e.target.value),F(!0)},onFocus:()=>F(!0),onBlur:()=>setTimeout(()=>F(!1),200),placeholder:`Search for a queue...`,autoComplete:`off`,className:u(`w-full rounded-lg border px-3 py-2 text-sm`,`bg-white border-gray-300 text-gray-900 placeholder-gray-400`,`dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500`,`focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent`)}),(0,v.jsx)(`input`,{type:`hidden`,name:`deadLetter`,value:M}),P&&I.length>0&&(0,v.jsx)(`div`,{className:`absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto`,children:I.map(e=>(0,v.jsx)(`button`,{type:`button`,onClick:()=>L(e.name),className:`w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-gray-100 cursor-pointer text-sm`,children:e.name},e.name))})]}),M&&(0,v.jsxs)(`p`,{className:`mt-1 text-xs text-green-600 dark:text-green-400`,children:[`Selected: `,M]}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-gray-500 dark:text-gray-400`,children:`Failed jobs will be moved to this queue after all retries`})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{htmlFor:`warningQueueSize`,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:`Warning Queue Size`}),(0,v.jsx)(`input`,{type:`number`,id:`warningQueueSize`,name:`warningQueueSize`,min:`1`,placeholder:`Optional`,className:u(`w-full rounded-lg border px-3 py-2 text-sm`,`bg-white border-gray-300 text-gray-900 placeholder-gray-400`,`dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500`,`focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent`)}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-gray-500 dark:text-gray-400`,children:`Emit warning when queue size exceeds this value`})]})]}),(0,v.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{htmlFor:`retryLimit`,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:`Retry Limit`}),(0,v.jsx)(`input`,{type:`number`,id:`retryLimit`,name:`retryLimit`,min:`0`,placeholder:`2`,className:u(`w-full rounded-lg border px-3 py-2 text-sm`,`bg-white border-gray-300 text-gray-900 placeholder-gray-400`,`dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500`,`focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent`)})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{htmlFor:`retryDelay`,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:`Retry Delay (seconds)`}),(0,v.jsx)(`input`,{type:`number`,id:`retryDelay`,name:`retryDelay`,min:`0`,placeholder:`0`,className:u(`w-full rounded-lg border px-3 py-2 text-sm`,`bg-white border-gray-300 text-gray-900 placeholder-gray-400`,`dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500`,`focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent`)})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:`Retry Backoff`}),(0,v.jsx)(`div`,{className:`py-2 pb-6`,children:(0,v.jsx)(y,{id:`retryBackoff`,name:`retryBackoff`,value:`true`,checked:O,onChange:e=>{k(e.target.checked),c(!0)},label:`Enable Exponential Backoff`})})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{htmlFor:`retryDelayMax`,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:`Max Retry Delay (seconds)`}),(0,v.jsx)(`input`,{type:`number`,id:`retryDelayMax`,name:`retryDelayMax`,min:`1`,placeholder:`No limit`,disabled:!O,className:u(`w-full rounded-lg border px-3 py-2 text-sm`,`bg-white border-gray-300 text-gray-900 placeholder-gray-400`,`dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500`,`focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent`,`disabled:opacity-50 disabled:cursor-not-allowed`)}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-gray-500 dark:text-gray-400`,children:`Only used with exponential backoff`})]})]}),(0,v.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{htmlFor:`expireInSeconds`,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:`Expire In Seconds`}),(0,v.jsx)(`input`,{type:`number`,id:`expireInSeconds`,name:`expireInSeconds`,min:`1`,placeholder:`900`,className:u(`w-full rounded-lg border px-3 py-2 text-sm`,`bg-white border-gray-300 text-gray-900 placeholder-gray-400`,`dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500`,`focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent`)}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-gray-500 dark:text-gray-400`,children:`Default: 15 minutes (900 seconds)`})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{htmlFor:`retentionSeconds`,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:`Retention Seconds`}),(0,v.jsx)(`input`,{type:`number`,id:`retentionSeconds`,name:`retentionSeconds`,min:`1`,placeholder:`1209600`,className:u(`w-full rounded-lg border px-3 py-2 text-sm`,`bg-white border-gray-300 text-gray-900 placeholder-gray-400`,`dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500`,`focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent`)}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-gray-500 dark:text-gray-400`,children:`Default: 14 days (1209600 seconds)`})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{htmlFor:`deleteAfterSeconds`,className:`block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1`,children:`Delete After Seconds`}),(0,v.jsx)(`input`,{type:`number`,id:`deleteAfterSeconds`,name:`deleteAfterSeconds`,min:`0`,placeholder:`604800`,className:u(`w-full rounded-lg border px-3 py-2 text-sm`,`bg-white border-gray-300 text-gray-900 placeholder-gray-400`,`dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500`,`focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent`)}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-gray-500 dark:text-gray-400`,children:`Default: 7 days (604800 seconds). Set to 0 to never delete.`})]})]}),(0,v.jsxs)(`div`,{className:`flex items-center gap-3 pt-2`,children:[(0,v.jsx)(h,{type:`submit`,disabled:o,children:o?`Creating...`:`Create Queue`}),(0,v.jsx)(l,{to:`/queues`,className:`text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300`,children:`Cancel`})]})]})})]})]})});export{T as ErrorBoundary,E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e,V as t}from"./jsx-runtime-DcdjQ3vN.js";var n=t((t=>{var n=e();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},t.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},t.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},t.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},t.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},t.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},t.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},t.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},t.useFormStatus=function(){return c.H.useHostTransitionStatus()},t.version=`19.2.7`})),r=t(((e,t)=>{function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),t.exports=n()}));export{r as t};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import{B as e,F as t,H as n,I as r,L as i,M as a,N as o,P as s,R as c,a as l,c as u,f as d,l as f,o as p,p as m,t as h,w as g,z as _}from"./jsx-runtime-DcdjQ3vN.js";import{t as v}from"./react-dom-DQHA9Ik4.js";import{t as y}from"./createLucideIcon-oZ0wXCaF.js";import{_ as b,n as x,r as ee,t as te,u as S}from"./db-link-DISwKBYZ.js";import{a as C,i as w,l as T,n as E,o as D,t as O}from"./MenuTrigger-CkqlwCsV.js";var ne=y(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),k=y(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),re=y(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),A=y(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),ie=n(v(),1),j=n(e(),1),M=h(),N=[`cobalt`,`emerald`,`teal`,`cyan`,`sky`,`blue`,`indigo`,`violet`,`purple`],ae={cobalt:`#284fe0`,emerald:`#059669`,teal:`#0d9488`,cyan:`#0891b2`,sky:`#0284c7`,blue:`#2563eb`,indigo:`#4f46e5`,violet:`#7c3aed`,purple:`#9333ea`},P=(0,j.createContext)(void 0),F=`pg-boss-theme`,I=`pg-boss-color-theme`;function L(){return typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function R(){if(typeof window>`u`)return`system`;let e=localStorage.getItem(F);return e===`light`||e===`dark`||e===`system`?e:`system`}function oe(){if(typeof window>`u`)return`violet`;let e=localStorage.getItem(I);return e&&N.includes(e)?e:`cobalt`}function se({children:e}){let[t,n]=(0,j.useState)(R),[r,i]=(0,j.useState)(()=>{let e=R();return e===`system`?L():e}),[a,o]=(0,j.useState)(oe);return(0,j.useEffect)(()=>{let e=t===`system`?L():t;i(e);let n=document.documentElement;n.classList.remove(`light`,`dark`),n.classList.add(e),n.dataset.themeMode=t},[t]),(0,j.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{if(t===`system`){let e=L();i(e),document.documentElement.classList.remove(`light`,`dark`),document.documentElement.classList.add(e)}};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[t]),(0,j.useEffect)(()=>{document.documentElement.dataset.colorTheme=a;let e=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="6" fill="${ae[a]}"/><text x="16" y="22" text-anchor="middle" font-family="system-ui,sans-serif" font-size="14" font-weight="bold" fill="white">PG</text></svg>`,t=encodeURIComponent(e),n=document.querySelector(`link[rel="icon"]`);n?n.href=`data:image/svg+xml,${t}`:(n=document.createElement(`link`),n.rel=`icon`,n.type=`image/svg+xml`,n.href=`data:image/svg+xml,${t}`,document.head.appendChild(n))},[a]),(0,M.jsx)(P.Provider,{value:{theme:t,setTheme:e=>{n(e),localStorage.setItem(F,e)},resolvedTheme:r,colorTheme:a,setColorTheme:e=>{o(e),localStorage.setItem(I,e)}},children:e})}function z(){let e=(0,j.useContext)(P);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e}function ce(){let{theme:e,setTheme:t}=z();return(0,M.jsxs)(E,{children:[(0,M.jsxs)(O,{className:S(`flex items-center gap-2 rounded-md p-2 w-full cursor-pointer`,`text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent`,`focus:outline-none`,`transition-colors`),"aria-label":`Toggle theme`,children:[(0,M.jsx)(A,{className:`h-5 w-5 shrink-0 dark:hidden`}),(0,M.jsx)(k,{className:`hidden h-5 w-5 shrink-0 dark:block`}),(0,M.jsx)(`span`,{className:`theme-mode-label text-sm group-data-[state=collapsed]:hidden`})]}),(0,M.jsx)(C,{container:typeof document<`u`?document.body:void 0,children:(0,M.jsx)(w,{className:`z-[100]`,children:(0,M.jsxs)(D,{className:S(`min-w-[8rem] rounded-md border p-1 shadow-md z-[100]`,`bg-white border-gray-200`,`dark:bg-gray-900 dark:border-gray-800`,`animate-in fade-in-0 zoom-in-95`),children:[(0,M.jsxs)(T,{className:S(`flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer`,`outline-none transition-colors`,`text-gray-700 data-highlighted:bg-gray-100`,`dark:text-gray-300 dark:data-highlighted:bg-gray-800`,e===`light`&&`bg-gray-100 dark:bg-gray-800`),onClick:()=>t(`light`),children:[(0,M.jsx)(A,{className:`h-4 w-4`}),`Light`]}),(0,M.jsxs)(T,{className:S(`flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer`,`outline-none transition-colors`,`text-gray-700 data-highlighted:bg-gray-100`,`dark:text-gray-300 dark:data-highlighted:bg-gray-800`,e===`dark`&&`bg-gray-100 dark:bg-gray-800`),onClick:()=>t(`dark`),children:[(0,M.jsx)(k,{className:`h-4 w-4`}),`Dark`]}),(0,M.jsxs)(T,{className:S(`flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer`,`outline-none transition-colors`,`text-gray-700 data-highlighted:bg-gray-100`,`dark:text-gray-300 dark:data-highlighted:bg-gray-800`,e===`system`&&`bg-gray-100 dark:bg-gray-800`),onClick:()=>t(`system`),children:[(0,M.jsx)(ne,{className:`h-4 w-4`}),`System`]})]})})})]})}var le={cobalt:`bg-[#3b66f5]`,emerald:`bg-emerald-500`,teal:`bg-teal-500`,cyan:`bg-cyan-500`,sky:`bg-sky-500`,blue:`bg-blue-500`,indigo:`bg-indigo-500`,violet:`bg-violet-500`,purple:`bg-purple-500`},ue={cobalt:`Cobalt`,emerald:`Emerald`,teal:`Teal`,cyan:`Cyan`,sky:`Sky`,blue:`Blue`,indigo:`Indigo`,violet:`Violet`,purple:`Purple`};function de(){let{colorTheme:e,setColorTheme:t}=z();return(0,M.jsxs)(E,{children:[(0,M.jsxs)(O,{className:S(`flex items-center gap-2 rounded-md p-2 w-full cursor-pointer`,`text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent`,`focus:outline-none`,`transition-colors`),"aria-label":`Change color theme`,children:[(0,M.jsx)(`span`,{className:`h-5 w-5 rounded-full shrink-0 bg-primary-500`}),(0,M.jsx)(`span`,{className:`color-theme-label text-sm group-data-[state=collapsed]:hidden`})]}),(0,M.jsx)(C,{container:typeof document<`u`?document.body:void 0,children:(0,M.jsx)(w,{className:`z-[100]`,children:(0,M.jsx)(D,{className:S(`rounded-md border p-2 shadow-md z-[100]`,`bg-white border-gray-200`,`dark:bg-gray-900 dark:border-gray-800`,`animate-in fade-in-0 zoom-in-95`),children:(0,M.jsx)(`div`,{className:`grid grid-cols-4 gap-1.5`,children:N.map(n=>(0,M.jsx)(T,{className:S(`w-7 h-7 rounded-full cursor-pointer transition-all`,`outline-none`,`hover:scale-110`,le[n],e===n&&`ring-2 ring-offset-2 ring-gray-900 dark:ring-white dark:ring-offset-gray-900`),onClick:()=>t(n),"aria-label":n,title:ue[n]},n))})})})})]})}function fe({content:e,children:t,side:n=`right`,align:r=`center`}){let[i,a]=j.useState(!1),[o,s]=j.useState({top:0,left:0}),c=j.useRef(null),l=j.useRef(null),u=j.useCallback(()=>{if(!c.current||!l.current)return;let e=c.current.getBoundingClientRect(),t=l.current.getBoundingClientRect(),i=0,a=0;switch(n){case`top`:i=e.top-t.height-8,a=e.left+(e.width-t.width)/2;break;case`right`:i=e.top+(e.height-t.height)/2,a=e.right+8;break;case`bottom`:i=e.bottom+8,a=e.left+(e.width-t.width)/2;break;case`left`:i=e.top+(e.height-t.height)/2,a=e.left-t.width-8;break}n===`top`||n===`bottom`?r===`start`?a=e.left:r===`end`&&(a=e.right-t.width):r===`start`?i=e.top:r===`end`&&(i=e.bottom-t.height),s({top:i,left:a})},[n,r]);j.useEffect(()=>{if(i)return u(),window.addEventListener(`scroll`,u,!0),window.addEventListener(`resize`,u),()=>{window.removeEventListener(`scroll`,u,!0),window.removeEventListener(`resize`,u)}},[i,u]);let d=()=>{a(!0)},f=()=>{a(!1)},p=j.Children.only(t);return(0,M.jsxs)(M.Fragment,{children:[j.cloneElement(p,{ref:e=>{e&&(c.current=e);let t=p.ref;typeof t==`function`?t(e):t&&(t.current=e)},onMouseEnter:e=>{d(),p.props?.onMouseEnter?.(e)},onMouseLeave:e=>{f(),p.props?.onMouseLeave?.(e)}}),i&&(0,M.jsx)(`div`,{ref:l,role:`tooltip`,style:{position:`fixed`,top:o.top,left:o.left,zIndex:9999},className:S(`px-3 py-1.5 text-sm font-medium text-white bg-gray-900 dark:bg-gray-700 rounded-md shadow-lg`,`pointer-events-none animate-in fade-in-0 zoom-in-95`,`whitespace-nowrap`),children:e})]})}var pe=`sidebar:state`,me=3600*24*7,he=`11rem`,ge=`3.75rem`,_e=`b`,B=j.createContext(null);function V(){let e=j.useContext(B);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}var H=j.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o},s)=>{let[c,l]=j.useState(!1),[u,d]=j.useState(e),f=t??u,p=j.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${pe}=${t}; path=/; max-age=${me}`},[n,f]),m=j.useCallback(()=>p(e=>!e),[p]),[h,g]=j.useState(!1);j.useEffect(()=>{let e=window.matchMedia(`(max-width: 768px)`),t=()=>g(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),j.useEffect(()=>{let e=e=>{e.key===_e&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let _=f?`expanded`:`collapsed`,v=j.useMemo(()=>({state:_,open:f,setOpen:p,isMobile:h,openMobile:c,setOpenMobile:l,toggleSidebar:m}),[_,f,p,h,c,l,m]);return(0,M.jsx)(B.Provider,{value:v,children:(0,M.jsx)(`div`,{style:{"--sidebar-width":he,"--sidebar-width-icon":ge,...i},className:S(`group/sidebar-wrapper flex min-h-screen w-full has-[[data-variant=inset]]:bg-sidebar`,r),ref:s,...o,children:a})})});H.displayName=`SidebarProvider`;var U=j.forwardRef(({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a},o)=>{let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=V();return n===`none`?(0,M.jsx)(`div`,{className:S(`flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground`,r),ref:o,...a,children:i}):s?(0,M.jsxs)(M.Fragment,{children:[l&&(0,M.jsx)(`div`,{className:`fixed inset-0 z-50 bg-black/50`,onClick:()=>u(!1)}),(0,M.jsx)(`div`,{ref:o,style:{background:`var(--sidebar-bg)`},className:S(`fixed inset-y-0 z-50 flex h-full w-[--sidebar-width-mobile] flex-col border-r border-sidebar-border text-sidebar-foreground transition-transform duration-200 ease-in-out`,e===`left`?`left-0`:`right-0`,l?`translate-x-0`:e===`left`?`-translate-x-full`:`translate-x-full`,r),...a,children:i})]}):(0,M.jsx)(`div`,{ref:o,"data-state":c,style:{background:`var(--sidebar-bg)`},className:S(`group peer hidden md:flex fixed inset-y-0 left-0 z-30 flex-col border-r border-sidebar-border text-sidebar-foreground overflow-y-auto overflow-x-hidden`,`transition-[width] duration-150 ease-linear`,c===`expanded`?`w-[var(--sidebar-width)]`:`w-[var(--sidebar-width-icon)]`,r),...a,children:i})});U.displayName=`Sidebar`;var W=j.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i,isMobile:a,openMobile:o,setOpenMobile:s}=V();return(0,M.jsxs)(`button`,{ref:r,onClick:e=>{t?.(e),a?s(!o):i()},className:S(`inline-flex items-center justify-center rounded-md p-2 cursor-pointer`,`text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...n,children:[(0,M.jsx)(re,{className:`h-5 w-5`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})});W.displayName=`SidebarTrigger`;var G=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:S(`flex flex-col gap-2 p-2 overflow-hidden`,e),...t}));G.displayName=`SidebarHeader`;var K=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:S(`flex flex-col gap-2 p-2 overflow-hidden`,e),...t}));K.displayName=`SidebarFooter`;var q=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:S(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto`,e),...t}));q.displayName=`SidebarContent`;var J=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:S(`relative flex w-full min-w-0 flex-col p-2`,e),...t}));J.displayName=`SidebarGroup`;var ve=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:S(`px-2 text-xs font-medium text-sidebar-foreground/70`,e),...t}));ve.displayName=`SidebarGroupLabel`;var Y=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`div`,{ref:n,className:S(`w-full text-sm`,e),...t}));Y.displayName=`SidebarGroupContent`;var X=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`ul`,{ref:n,className:S(`flex w-full min-w-0 flex-col gap-1`,e),...t}));X.displayName=`SidebarMenu`;var Z=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`li`,{ref:n,className:S(`group/menu-item relative`,e),...t}));Z.displayName=`SidebarMenuItem`;var ye=ee(`peer/menu-button flex w-full items-center gap-2.5 overflow-hidden rounded-md px-3 py-2 text-left text-sm outline-none 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 cursor-pointer group-has-[[data-sidebar=menu-action]]/menu-item:pr-8`,{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-[state=collapsed]:!h-8`}},defaultVariants:{variant:`default`,size:`default`}}),Q=j.forwardRef(({render:e,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o},s)=>{let{state:c}=V(),l=x({defaultTagName:`button`,render:e,props:b({"data-sidebar":`menu-button`,"data-active":t,style:t?{background:`var(--sidebar-active-bg)`,boxShadow:`var(--sidebar-active-shadow)`}:void 0,className:S(ye({variant:n,size:r}),t&&`relative font-medium text-[var(--sidebar-active-text)] before:absolute before:left-0 before:top-2 before:bottom-2 before:w-[3px] before:rounded-full before:bg-primary-500 before:content-[''] group-data-[state=collapsed]:before:hidden`,a)},o),ref:s});return c===`collapsed`&&i&&typeof i==`string`?(0,M.jsx)(fe,{content:i,children:l}):l});Q.displayName=`SidebarMenuButton`;var be=j.forwardRef(({className:e,render:t,showOnHover:n=!1,...r},i)=>x({defaultTagName:`button`,render:t,props:b({"data-sidebar":`menu-action`,className:S(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`peer-hover/menu-button:text-sidebar-accent-foreground`,n&&`peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0`,e)},r),ref:i}));be.displayName=`SidebarMenuAction`;var xe=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:S(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,e),...t}));xe.displayName=`SidebarMenuSub`;var Se=j.forwardRef(({...e},t)=>(0,M.jsx)(`li`,{ref:t,...e}));Se.displayName=`SidebarMenuSubItem`;var Ce=j.forwardRef(({render:e,size:t=`md`,isActive:n,className:r,...i},a)=>x({defaultTagName:`a`,render:e,props:b({"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:S(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,r)},i),ref:a}));Ce.displayName=`SidebarMenuSubButton`;var we=[{name:`Overview`,href:`/`,icon:Te},{name:`Jobs`,href:`/jobs`,icon:Ee},{name:`Queues`,href:`/queues`,icon:De},{name:`Schedules`,href:`/schedules`,icon:Oe},{name:`Warnings`,href:`/warnings`,icon:ke}];function Te({className:e}){return(0,M.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,children:(0,M.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25`})})}function Ee({className:e}){return(0,M.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,children:(0,M.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z`})})}function De({className:e}){return(0,M.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,children:(0,M.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75Z`})})}function Oe({className:e}){return(0,M.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,children:(0,M.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})})}function ke({className:e}){return(0,M.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,children:(0,M.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z`})})}function $({className:e}){return(0,M.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,children:(0,M.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125`})})}function Ae({className:e}){return(0,M.jsx)(`svg`,{className:e,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,children:(0,M.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m19.5 8.25-7.5 7.5-7.5-7.5`})})}function je({databases:e,currentDb:t,onSelect:n}){let[r,i]=(0,j.useState)(!1),a=(0,j.useRef)(null),[o,s]=(0,j.useState)(null),c=(0,j.useCallback)(()=>{let e=a.current?.getBoundingClientRect();e&&s({top:e.bottom+4,left:e.left,width:Math.max(e.width,256)})},[]);if((0,j.useEffect)(()=>{if(r)return window.addEventListener(`scroll`,c,!0),window.addEventListener(`resize`,c),()=>{window.removeEventListener(`scroll`,c,!0),window.removeEventListener(`resize`,c)}},[r,c]),e.length<=1)return null;let l=()=>{c(),i(!0)};return(0,M.jsxs)(`div`,{className:`relative`,children:[(0,M.jsxs)(`button`,{ref:a,type:`button`,onClick:()=>r?i(!1):l(),className:S(`w-full flex items-center justify-between px-3 py-2 text-sm rounded-lg transition-colors cursor-pointer`,`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`),children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,M.jsx)($,{className:`w-4 h-4 flex-shrink-0`}),(0,M.jsx)(`span`,{className:`font-medium truncate`,children:t.name})]}),(0,M.jsx)(Ae,{className:S(`w-4 h-4 flex-shrink-0 transition-transform`,r&&`rotate-180`)})]}),r&&o&&typeof document<`u`&&(0,ie.createPortal)((0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{className:`fixed inset-0 z-40`,onClick:()=>i(!1)}),(0,M.jsx)(`div`,{className:S(`fixed rounded-lg shadow-lg z-50 py-1`,`bg-sidebar border border-sidebar-border`),style:{top:o.top,left:o.left,width:o.width},children:e.map(e=>(0,M.jsxs)(`button`,{type:`button`,onClick:()=>{n(e),i(!1)},className:S(`w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors cursor-pointer text-sidebar-foreground`,e.id===t.id?`bg-sidebar-accent text-sidebar-accent-foreground font-medium`:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`),children:[(0,M.jsx)($,{className:S(`w-4 h-4 flex-shrink-0`)}),(0,M.jsx)(`span`,{className:`truncate`,children:e.name}),e.schema!==`pgboss`&&(0,M.jsxs)(`span`,{className:`ml-auto text-xs opacity-70`,children:[`(`,e.schema,`)`]})]},e.id))})]}),document.body)]})}function Me(){let e=r(`root`),[t]=i(),n=s(),o=a(),{setOpenMobile:c}=V(),l=e?.databases||[],d=e?.currentDb,f=t.get(`db`),p=e=>{let r=new URLSearchParams(t);e.id===l[0]?.id?r.delete(`db`):r.set(`db`,e.id);let i=r.toString();n({pathname:o.pathname,search:i?`?${i}`:``})},m=e=>f?`${e}?db=${f}`:e;return(0,M.jsxs)(U,{children:[(0,M.jsxs)(G,{children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2.5 pl-1.5 pr-3 py-2`,children:[(0,M.jsx)(`div`,{className:`w-8 h-8 rounded-[9px] bg-primary-600 flex items-center justify-center shrink-0`,children:(0,M.jsx)(`span`,{className:`text-white font-bold text-sm tracking-tight`,children:`PG`})}),(0,M.jsxs)(`div`,{className:`leading-tight whitespace-nowrap group-data-[state=collapsed]:hidden`,children:[(0,M.jsx)(`div`,{className:`font-semibold text-sm text-sidebar-accent-foreground`,children:`pg-boss`}),(0,M.jsx)(`div`,{className:`font-mono text-[9px] tracking-[0.15em] text-sidebar-foreground/60`,children:`CONSOLE`})]})]}),l&&d&&l.length>1&&(0,M.jsx)(`div`,{className:`group-data-[state=collapsed]:hidden`,children:(0,M.jsx)(je,{databases:l,currentDb:d,onSelect:p})})]}),(0,M.jsx)(q,{children:(0,M.jsx)(J,{children:(0,M.jsx)(Y,{children:(0,M.jsx)(X,{children:we.map(e=>(0,M.jsx)(Z,{children:(0,M.jsx)(u,{to:m(e.href),end:e.href===`/`,onClick:()=>c(!1),children:({isActive:t})=>(0,M.jsxs)(Q,{isActive:t,tooltip:e.name,children:[(0,M.jsx)(e.icon,{className:`h-5 w-5 flex-shrink-0`}),(0,M.jsx)(`span`,{className:`whitespace-nowrap group-data-[state=collapsed]:hidden`,children:e.name})]})})},e.name))})})})}),(0,M.jsx)(K,{children:(0,M.jsxs)(`div`,{className:`flex flex-col px-2`,children:[(0,M.jsx)(`p`,{className:`px-2 mb-1 text-xs font-medium text-sidebar-foreground/50 uppercase tracking-wider group-data-[state=collapsed]:hidden`,children:`Theme`}),(0,M.jsx)(ce,{}),(0,M.jsx)(de,{})]})})]})}function Ne(){return t().state===`loading`?(0,M.jsx)(`div`,{className:`fixed top-0 left-0 right-0 z-50 h-1 bg-gray-200 dark:bg-gray-800`,children:(0,M.jsx)(`div`,{className:`h-full bg-primary-600 dark:bg-primary-400 animate-loading-bar`})}):null}function Pe(){o();let e=a().pathname.split(`/`).filter(Boolean);if(e.length===0)return null;let t=[];if(e[0]===`queues`){if(t.push({label:`Queues`,href:`/queues`}),e.length>1&&e[1]!==`queues`){let n=decodeURIComponent(e[1]);if(t.push({label:n,href:`/queues/${encodeURIComponent(n)}`}),e.length>2&&e[2]===`jobs`&&e[3]){let n=e[3];t.push({label:`${n.slice(0,8)}...`})}}}else if(e[0]===`schedules`){if(t.push({label:`Schedules`,href:`/schedules`}),e.length>1&&e[1]===`new`)t.push({label:`New Schedule`});else if(e.length>1){let n=decodeURIComponent(e[1]);t.push({label:n})}}else e[0]===`jobs`?t.push({label:`Jobs`}):e[0]===`warnings`?t.push({label:`Warnings`}):e[0]===`send`&&(t.push({label:`Queues`,href:`/queues`}),t.push({label:`Send Job`}));return t.length===0?null:(0,M.jsx)(`div`,{className:`flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400`,children:t.map((e,n)=>{let r=n===t.length-1;return(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n>0&&(0,M.jsx)(`span`,{children:`/`}),e.href&&!r?(0,M.jsx)(te,{to:e.href,className:`hover:text-gray-700 dark:hover:text-gray-300`,children:e.label}):(0,M.jsx)(`span`,{className:r?`text-gray-900 dark:text-gray-100 font-medium`:``,children:e.label})]},n)})})}function Fe({children:e}){let{open:t,isMobile:n,state:r}=V();return(0,M.jsxs)(`main`,{className:S(`flex-1 min-w-0 overflow-x-hidden transition-[padding] duration-150 ease-linear`,!n&&(r===`expanded`?`md:pl-[var(--sidebar-width)]`:`md:pl-[var(--sidebar-width-icon)]`)),style:{background:`var(--gradient-app)`},children:[(0,M.jsxs)(`div`,{className:`sticky top-0 z-20 flex h-14 items-center justify-between gap-3 px-6 border-b border-[var(--border-subtle)] backdrop-blur-md backdrop-saturate-150`,style:{background:`var(--surface-topbar)`,boxShadow:`var(--topbar-shadow)`},children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,M.jsx)(W,{}),(0,M.jsx)(Pe,{})]}),!t&&(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`div`,{className:`w-7 h-7 rounded-lg bg-primary-600 flex items-center justify-center md:hidden`,children:(0,M.jsx)(`span`,{className:`text-white font-bold text-xs`,children:`PG`})}),(0,M.jsx)(`span`,{className:`font-semibold text-sidebar-foreground md:hidden`,children:`pg-boss`})]})]}),(0,M.jsx)(`div`,{className:`px-6 py-6 lg:px-8 lg:py-8`,children:e})]})}var Ie=`
|
|
2
|
+
(function() {
|
|
3
|
+
const stored = localStorage.getItem('pg-boss-theme');
|
|
4
|
+
const mode = stored || 'system';
|
|
5
|
+
let theme = mode;
|
|
6
|
+
if (theme === 'system') {
|
|
7
|
+
theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
8
|
+
}
|
|
9
|
+
document.documentElement.classList.add(theme);
|
|
10
|
+
// Expose the selected mode (light/dark/system) so the sidebar theme label
|
|
11
|
+
// can render from CSS on the first paint instead of client-only React state.
|
|
12
|
+
document.documentElement.dataset.themeMode = mode;
|
|
13
|
+
|
|
14
|
+
const colorHex = {
|
|
15
|
+
cobalt: '#284fe0',
|
|
16
|
+
emerald: '#059669',
|
|
17
|
+
teal: '#0d9488',
|
|
18
|
+
cyan: '#0891b2',
|
|
19
|
+
sky: '#0284c7',
|
|
20
|
+
blue: '#2563eb',
|
|
21
|
+
indigo: '#4f46e5',
|
|
22
|
+
violet: '#7c3aed',
|
|
23
|
+
purple: '#9333ea',
|
|
24
|
+
};
|
|
25
|
+
const colorTheme = localStorage.getItem('pg-boss-color-theme') || 'cobalt';
|
|
26
|
+
document.documentElement.dataset.colorTheme = colorTheme;
|
|
27
|
+
|
|
28
|
+
// Create favicon with color theme
|
|
29
|
+
const hex = colorHex[colorTheme] || colorHex.cobalt;
|
|
30
|
+
const svg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="6" fill="' + hex + '"/><text x="16" y="22" text-anchor="middle" font-family="system-ui,sans-serif" font-size="14" font-weight="bold" fill="white">PG</text></svg>';
|
|
31
|
+
var link = document.querySelector('link[rel="icon"]');
|
|
32
|
+
if (!link) {
|
|
33
|
+
link = document.createElement('link');
|
|
34
|
+
link.rel = 'icon';
|
|
35
|
+
link.type = 'image/svg+xml';
|
|
36
|
+
document.head.appendChild(link);
|
|
37
|
+
}
|
|
38
|
+
link.href = 'data:image/svg+xml,' + encodeURIComponent(svg);
|
|
39
|
+
})();
|
|
40
|
+
`;function Le({children:e}){return(0,M.jsxs)(`html`,{lang:`en`,suppressHydrationWarning:!0,children:[(0,M.jsxs)(`head`,{children:[(0,M.jsx)(`meta`,{charSet:`utf-8`}),(0,M.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,M.jsx)(p,{}),(0,M.jsx)(l,{}),(0,M.jsx)(`script`,{dangerouslySetInnerHTML:{__html:Ie}})]}),(0,M.jsxs)(`body`,{className:`bg-[var(--surface-app)]`,children:[(0,M.jsxs)(se,{children:[(0,M.jsx)(Ne,{}),(0,M.jsxs)(H,{children:[(0,M.jsx)(Me,{}),(0,M.jsx)(Fe,{children:e})]})]}),(0,M.jsx)(m,{}),(0,M.jsx)(d,{})]})]})}var Re=c(function(){return(0,M.jsx)(f,{})}),ze=_(function({error:e}){let t=`Oops!`,n=`An unexpected error occurred.`;return g(e)&&(t=e.status===404?`404`:`Error`,n=e.status===404?`The requested page could not be found.`:e.statusText||n),(0,M.jsxs)(`div`,{className:`flex flex-col items-center justify-center min-h-[50vh] text-center`,children:[(0,M.jsx)(`h1`,{className:`text-4xl font-bold text-gray-900 dark:text-gray-100 mb-2`,children:t}),(0,M.jsx)(`p`,{className:`text-gray-600 dark:text-gray-400 mb-4`,children:n}),void 0]})});function Be(){return[{title:`pg-boss Dashboard`},{name:`description`,content:`Monitor and manage pg-boss job queues`}]}function Ve(){return[{rel:`preconnect`,href:`https://fonts.googleapis.com`},{rel:`preconnect`,href:`https://fonts.gstatic.com`,crossOrigin:`anonymous`},{rel:`stylesheet`,href:`https://fonts.googleapis.com/css2?family=Geist:wght@300..700&family=Geist+Mono:wght@400..600&display=swap`}]}export{ze as ErrorBoundary,Le as Layout,Re as default,Ve as links,Be as meta};
|