diff --git a/assets/index-DS2yny_c.js b/assets/index-CL2171Bt.js similarity index 99% rename from assets/index-DS2yny_c.js rename to assets/index-CL2171Bt.js index b9479a2..716e471 100644 --- a/assets/index-DS2yny_c.js +++ b/assets/index-CL2171Bt.js @@ -53,7 +53,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var va=C,Mg=Rg;function Og(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lg=typeof Object.is=="function"?Object.is:Og,Ag=Mg.useSyncExternalStore,jg=va.useRef,Ig=va.useEffect,Ng=va.useMemo,Dg=va.useDebugValue;Hp.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=jg(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Ng(function(){function u(f){if(!d){if(d=!0,h=f,f=r(f),i!==void 0&&s.hasValue){var p=s.value;if(i(p,f))return l=p}return l=f}if(p=l,Lg(h,f))return p;var v=r(f);return i!==void 0&&i(p,v)?p:(h=f,l=v)}var d=!1,h,l,c=n===void 0?null:n;return[function(){return u(t())},c===null?void 0:function(){return u(c())}]},[t,n,r,i]);var a=Ag(e,o[0],o[1]);return Ig(function(){s.hasValue=!0,s.value=a},[a]),Dg(a),a};Up.exports=Hp;var Fg=Up.exports;class $g{constructor(t,n){this.listeners=new Set,this._batching=!1,this._flushing=0,this.subscribe=r=>{var i,o;this.listeners.add(r);const s=(o=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:o.call(i,r,this);return()=>{this.listeners.delete(r),s==null||s()}},this.setState=r=>{var i,o,s;const a=this.state;this.state=(i=this.options)!=null&&i.updateFn?this.options.updateFn(a)(r):r(a),(s=(o=this.options)==null?void 0:o.onUpdate)==null||s.call(o),this._flush()},this._flush=()=>{if(this._batching)return;const r=++this._flushing;this.listeners.forEach(i=>{this._flushing===r&&i()})},this.batch=r=>{if(this._batching)return r();this._batching=!0,r(),this._batching=!1,this._flush()},this.state=t,this.options=n}}function zg(e,t=n=>n){return Fg.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,Vg)}function Vg(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r{t.substring(0,1)==="?"&&(t=t.substring(1));const n=Ug(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function Zg(e,t){function n(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(typeof r=="string"&&typeof t=="function")try{return t(r),e(r)}catch{}return r}return r=>{r={...r},Object.keys(r).forEach(o=>{const s=r[o];typeof s>"u"||s===void 0?delete r[o]:r[o]=n(s)});const i=Bg(r).toString();return i?`?${i}`:""}}function Li(e){return e[e.length-1]}function qg(e){return typeof e=="function"}function Er(e,t){return qg(e)?e(t):e}function Ai(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function dr(e,t){if(e===t)return e;const n=t,r=Hd(e)&&Hd(n);if(r||Qr(e)&&Qr(n)){const i=r?e:Object.keys(e),o=i.length,s=r?n:Object.keys(n),a=s.length,u=r?[]:{};let d=0;for(let h=0;h"u")return!0;const n=t.prototype;return!(!Ud(n)||!n.hasOwnProperty("isPrototypeOf"))}function Ud(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hd(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function jr(e,t,n=!1){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Qr(e)&&Qr(t)){const r=Object.keys(e).filter(o=>e[o]!==void 0),i=Object.keys(t).filter(o=>t[o]!==void 0);return!n&&r.length!==i.length?!1:!i.some(o=>!(o in e)||!jr(e[o],t[o],n))}return Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:!e.some((r,i)=>!jr(r,t[i],n)):!1}const al=typeof window<"u"?C.useLayoutEffect:C.useEffect;function fr(e){let t,n;const r=new Promise((i,o)=>{t=i,n=o});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e==null||e(i)},r.reject=i=>{r.status="rejected",n(i)},r}function Qd(e){const t=C.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Gg(e,t,n={},r={}){const i=C.useRef(typeof IntersectionObserver=="function"),o=C.useRef(null);return C.useEffect(()=>{if(!(!e.current||!i.current||r.disabled))return o.current=new IntersectionObserver(([s])=>{t(s)},n),o.current.observe(e.current),()=>{var s;(s=o.current)==null||s.disconnect()}},[t,n,r.disabled,e]),o.current}function Kg(e){const t=C.useRef(null);return C.useEffect(()=>{e&&(typeof e=="function"?e(t.current):e.current=t.current)}),t}function Cn(e){return ya(e.filter(t=>t!==void 0).join("/"))}function ya(e){return e.replace(/\/{2,}/g,"/")}function wc(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Un(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Xg(e){return Un(wc(e))}function js(e,t){return e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Yg(e,t,n){return js(e,n)===js(t,n)}function Jg({basepath:e,base:t,to:n,trailingSlash:r="never"}){var i,o;t=Is(e,t),n=Is(e,n);let s=Wr(t);const a=Wr(n);s.length>1&&((i=Li(s))==null?void 0:i.value)==="/"&&s.pop(),a.forEach((d,h)=>{d.value==="/"?h?h===a.length-1&&s.push(d):s=[d]:d.value===".."?s.pop():d.value==="."||s.push(d)}),s.length>1&&(((o=Li(s))==null?void 0:o.value)==="/"?r==="never"&&s.pop():r==="always"&&s.push({type:"pathname",value:"/"}));const u=Cn([e,...s.map(d=>d.value)]);return ya(u)}function Wr(e){if(!e)return[];e=ya(e);const t=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map(r=>r==="$"||r==="*"?{type:"wildcard",value:r}:r.charAt(0)==="$"?{type:"param",value:r}:{type:"pathname",value:decodeURI(r)})),e.slice(-1)==="/"&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),t}function ll({path:e,params:t,leaveWildcards:n,leaveParams:r}){const i=Wr(e),o={};for(const[s,a]of Object.entries(t)){const u=typeof a=="string";["*","_splat"].includes(s)?o[s]=u?encodeURI(a):a:o[s]=u?encodeURIComponent(a):a}return Cn(i.map(s=>{if(s.type==="wildcard"){const a=o._splat;return n?`${s.value}${a??""}`:a}if(s.type==="param"){if(r){const a=o[s.value];return`${s.value}${a??""}`}return o[s.value.substring(1)]??"undefined"}return s.value}))}function Qo(e,t,n){const r=e_(e,t,n);if(!(n.to&&!r))return r??{}}function Is(e,t){switch(!0){case e==="/":return t;case t===e:return"";case t.length{for(let u=0;u=i.length-1,c=u>=o.length-1;if(h){if(h.type==="wildcard"){const f=decodeURI(Cn(i.slice(u).map(p=>p.value)));return s["*"]=f,s._splat=f,!0}if(h.type==="pathname"){if(h.value==="/"&&!(d!=null&&d.value))return!0;if(d){if(n.caseSensitive){if(h.value!==d.value)return!1}else if(h.value.toLowerCase()!==d.value.toLowerCase())return!1}}if(!d)return!1;if(h.type==="param"){if(d.value==="/")return!1;d.value.charAt(0)!=="$"&&(s[h.value.substring(1)]=decodeURIComponent(d.value))}}if(!l&&c)return s["**"]=Cn(i.slice(u+1).map(f=>f.value)),!!n.fuzzy&&(h==null?void 0:h.value)!=="/"}return!0})()?s:void 0}function $n(e){return!!(e!=null&&e.isRedirect)}function Wd(e){return!!(e!=null&&e.isRedirect)&&e.href}function xc(e){const t=e.errorComponent??ga;return w.jsx(t_,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?C.createElement(t,{error:n,reset:r}):e.children})}class t_ extends C.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function ga({error:e}){const[t,n]=C.useState(!1);return w.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[w.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),w.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),w.jsx("div",{style:{height:".25rem"}}),t?w.jsx("div",{children:w.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?w.jsx("code",{children:e.message}):null})}):null]})}function et(e){const t=Nn({warn:(e==null?void 0:e.router)===void 0});return zg(((e==null?void 0:e.router)||t).__store,e==null?void 0:e.select)}function Nt(e){return!!(e!=null&&e.isNotFound)}function n_(e){const t=et({select:n=>`not-found-${n.location.pathname}-${n.status}`});return w.jsx(xc,{getResetKey:()=>t,onCatch:(n,r)=>{var i;if(Nt(n))(i=e.onCatch)==null||i.call(e,n,r);else throw n},errorComponent:({error:n})=>{var r;return(r=e.fallback)==null?void 0:r.call(e,n)},children:e.children})}function r_(){return w.jsx("p",{children:"Not Found"})}const i_={stringify:e=>JSON.stringify(e,function(n,r){const i=this[n],o=Zd.find(s=>s.stringifyCondition(i));return o?o.stringify(i):r}),parse:e=>JSON.parse(e,function(n,r){const i=this[n],o=Zd.find(s=>s.parseCondition(i));return o?o.parse(i):r})},Zd=[{stringifyCondition:e=>e instanceof Date,stringify:e=>({$date:e.toISOString()}),parseCondition:e=>Qr(e)&&e.$date,parse:e=>new Date(e.$date)},{stringifyCondition:e=>e===void 0,stringify:()=>({$undefined:""}),parseCondition:e=>Qr(e)&&e.$undefined==="",parse:()=>{}}],o_=["component","errorComponent","pendingComponent","notFoundComponent"];function s_(e){return new a_(e)}class a_{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.subscribers=new Set,this.startReactTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options;this.options={...this.options,...n},this.isServer=this.options.isServer??typeof document>"u",(!this.basepath||n.basepath&&n.basepath!==r.basepath)&&(n.basepath===void 0||n.basepath===""||n.basepath==="/"?this.basepath="/":this.basepath=`/${Xg(n.basepath)}`),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history??(this.isServer?gg({initialEntries:[this.basepath||"/"]}):zp()),this.latestLocation=this.parseLocation()),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),this.__store||(this.__store=new $g(c_(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(i=>!["redirected"].includes(i.status))}}}))},this.buildRouteTree=()=>{this.routesById={},this.routesByPath={};const n=this.options.notFoundRoute;n&&(n.init({originalIndex:99999999999}),this.routesById[n.id]=n);const r=s=>{s.forEach((a,u)=>{a.init({originalIndex:u});const d=this.routesById[a.id];if(Ze(!d,`Duplicate routes found with id: ${String(a.id)}`),this.routesById[a.id]=a,!a.isRoot&&a.path){const l=Un(a.fullPath);(!this.routesByPath[l]||a.fullPath.endsWith("/"))&&(this.routesByPath[l]=a)}const h=a.children;h!=null&&h.length&&r(h)})};r([this.routeTree]);const i=[];Object.values(this.routesById).forEach((s,a)=>{var u;if(s.isRoot||!s.path)return;const d=wc(s.fullPath),h=Wr(d);for(;h.length>1&&((u=h[0])==null?void 0:u.value)==="/";)h.shift();const l=h.map(c=>c.value==="/"?.75:c.type==="param"?.5:c.type==="wildcard"?.25:1);i.push({child:s,trimmed:d,parsed:h,index:a,scores:l})}),this.flatRoutes=i.sort((s,a)=>{const u=Math.min(s.scores.length,a.scores.length);for(let d=0;da.parsed[d].value?1:-1;return s.index-a.index}).map((s,a)=>(s.child.rank=a,s.child))},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=n=>{const r=({pathname:a,search:u,hash:d,state:h})=>{const l=this.options.parseSearch(u),c=this.options.stringifySearch(l);return{pathname:a,searchStr:c,search:dr(n==null?void 0:n.search,l),hash:d.split("#").reverse()[0]??"",href:`${a}${c}${d}`,state:dr(n==null?void 0:n.state,h)}},i=r(this.history.location),{__tempLocation:o,__tempKey:s}=i.state;if(o&&(!s||s===this.tempLocationKey)){const a=r(o);return a.state.key=i.state.key,delete a.state.__tempLocation,{...a,maskedLocation:i}}return i},this.resolvePathWithBase=(n,r)=>Jg({basepath:this.basepath,base:n,to:ya(r),trailingSlash:this.options.trailingSlash}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r.pendingTimeout))},this.cancelMatches=()=>{var n;(n=this.state.pendingMatches)==null||n.forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=n=>{const r=(o={},s)=>{var a,u,d,h;const l=o._fromLocation?this.matchRoutes(o._fromLocation):this.state.matches,c=o.from!=null?l.find(F=>Qo(this.basepath,Un(F.pathname),{to:o.from,caseSensitive:!1,fuzzy:!1})):void 0,f=(c==null?void 0:c.pathname)||this.latestLocation.pathname;Ze(o.from==null||c!=null,"Could not find match for from: "+o.from);const p=this.state.pendingMatches?(a=Li(this.state.pendingMatches))==null?void 0:a.search:((u=Li(l))==null?void 0:u.search)||this.latestLocation.search,v=s==null?void 0:s.filter(F=>l.find(W=>W.routeId===F.routeId)),_=this.routesById[(d=v==null?void 0:v.find(F=>F.pathname===f))==null?void 0:d.routeId];let m=o.to?this.resolvePathWithBase(f,`${o.to}`):this.resolvePathWithBase(f,(_==null?void 0:_.to)??f);const y={...(h=Li(l))==null?void 0:h.params};let g=(o.params??!0)===!0?y:{...y,...Er(o.params,y)};Object.keys(g).length>0&&(s==null||s.map(F=>{var W;const Q=this.looseRoutesById[F.routeId];return((W=Q==null?void 0:Q.options.params)==null?void 0:W.stringify)??Q.options.stringifyParams}).filter(Boolean).forEach(F=>{g={...g,...F(g)}})),m=ll({path:m,params:g??{},leaveWildcards:!1,leaveParams:n.leaveParams});const x=(v==null?void 0:v.map(F=>this.looseRoutesById[F.routeId].options.preSearchFilters??[]).flat().filter(Boolean))??[],S=(v==null?void 0:v.map(F=>this.looseRoutesById[F.routeId].options.postSearchFilters??[]).flat().filter(Boolean))??[],b=x.length?x.reduce((F,W)=>W(F),p):p,E=o.search===!0?b:o.search?Er(o.search,b):x.length?b:{},P=S.length?S.reduce((F,W)=>W(F),E):E,T=dr(p,P),O=this.options.stringifySearch(T),V=o.hash===!0?this.latestLocation.hash:o.hash?Er(o.hash,this.latestLocation.hash):void 0,N=V?`#${V}`:"";let K=o.state===!0?this.latestLocation.state:o.state?Er(o.state,this.latestLocation.state):{};return K=dr(this.latestLocation.state,K),{pathname:m,search:T,searchStr:O,state:K,hash:V??"",href:`${m}${O}${N}`,unmaskOnReload:o.unmaskOnReload}},i=(o={},s)=>{var a;const u=r(o);let d=s?r(s):void 0;if(!d){let p={};const v=(a=this.options.routeMasks)==null?void 0:a.find(_=>{const m=Qo(this.basepath,u.pathname,{to:_.from,caseSensitive:!1,fuzzy:!1});return m?(p=m,!0):!1});if(v){const{from:_,...m}=v;s={...Ai(n,["from"]),...m,params:p},d=r(s)}}const h=this.matchRoutes(u),l=d?this.matchRoutes(d):void 0,c=d?r(s,l):void 0,f=r(o,h);return c&&(f.maskedLocation=c),f};return n.mask?i(n,{...Ai(n,["from"]),...n.mask}):i(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:r,...i})=>{const o=()=>{i.state.key=this.latestLocation.state.key;const u=jr(i.state,this.latestLocation.state);return delete i.state.key,u},s=this.latestLocation.href===i.href,a=this.commitLocationPromise;if(this.commitLocationPromise=fr(()=>{a==null||a.resolve()}),s&&o())this.load();else{let{maskedLocation:u,...d}=i;u&&(d={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...d,search:d.searchStr,state:{...d.state,__tempKey:void 0,__tempLocation:void 0,key:void 0}}}},(d.unmaskOnReload??this.options.unmaskOnReload??!1)&&(d.state.__tempKey=this.tempLocationKey)),this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](d.href,d.state,{ignoreBlocker:r})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,viewTransition:i,ignoreBlocker:o,...s}={})=>{const a=s.href;if(a){const d=Ji(a,{});s.to=d.pathname,s.search=this.options.parseSearch(d.search),s.hash=d.hash}const u=this.buildLocation(s);return this.commitLocation({...u,viewTransition:i,replace:n,resetScroll:r,ignoreBlocker:o})},this.navigate=({to:n,...r})=>{const i=String(n);let o;try{new URL(`${i}`),o=!0}catch{}return Ze(!o),this.buildAndCommitLocation({...r,to:n})},this.load=async()=>{this.latestLocation=this.parseLocation(this.latestLocation);let n,r,i;for(i=new Promise(o=>{this.startReactTransition(async()=>{var s;try{const a=this.latestLocation,u=this.state.resolvedLocation,d=u.href!==a.href;this.cancelMatches();let h;this.__store.batch(()=>{h=this.matchRoutes(a),this.__store.setState(l=>({...l,status:"pending",isLoading:!0,location:a,pendingMatches:h,cachedMatches:l.cachedMatches.filter(c=>!h.find(f=>f.id===c.id))}))}),this.state.redirect||this.emit({type:"onBeforeNavigate",fromLocation:u,toLocation:a,pathChanged:d}),this.emit({type:"onBeforeLoad",fromLocation:u,toLocation:a,pathChanged:d}),await this.loadMatches({matches:h,location:a,onReady:async()=>{this.startViewTransition(async()=>{let l,c,f;this.__store.batch(()=>{this.__store.setState(p=>{const v=p.matches,_=p.pendingMatches||p.matches;return l=v.filter(m=>!_.find(y=>y.id===m.id)),c=_.filter(m=>!v.find(y=>y.id===m.id)),f=v.filter(m=>_.find(y=>y.id===m.id)),{...p,isLoading:!1,loadedAt:Date.now(),matches:_,pendingMatches:void 0,cachedMatches:[...p.cachedMatches,...l.filter(m=>m.status!=="error")]}}),this.cleanCache()}),[[l,"onLeave"],[c,"onEnter"],[f,"onStay"]].forEach(([p,v])=>{p.forEach(_=>{var m,y;(y=(m=this.looseRoutesById[_.routeId].options)[v])==null||y.call(m,_)})})})}})}catch(a){Wd(a)?(n=a,this.isServer||this.navigate({...a,replace:!0,ignoreBlocker:!0})):Nt(a)&&(r=a),this.__store.setState(u=>({...u,statusCode:n?n.statusCode:r?404:u.matches.some(d=>d.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&((s=this.commitLocationPromise)==null||s.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;delete this.shouldViewTransition,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"?document.startViewTransition(n):n()},this.updateMatch=(n,r)=>{var i;let o;const s=(i=this.state.pendingMatches)==null?void 0:i.find(d=>d.id===n),a=this.state.matches.find(d=>d.id===n),u=s?"pendingMatches":a?"matches":"cachedMatches";return this.__store.setState(d=>{var h;return{...d,[u]:(h=d[u])==null?void 0:h.map(l=>l.id===n?o=r(l):l)}}),o},this.getMatch=n=>[...this.state.cachedMatches,...this.state.pendingMatches??[],...this.state.matches].find(r=>r.id===n),this.loadMatches=async({location:n,matches:r,preload:i,onReady:o,updateMatch:s=this.updateMatch})=>{let a,u=!1;const d=async()=>{u||(u=!0,await(o==null?void 0:o()))};!this.isServer&&!this.state.matches.length&&d();const h=(l,c)=>{var f,p,v;if(Wd(c))throw c;if($n(c)||Nt(c)){if(s(l.id,_=>({..._,status:$n(c)?"redirected":Nt(c)?"notFound":"error",isFetching:!1,error:c,beforeLoadPromise:void 0,loaderPromise:void 0})),c.routeId||(c.routeId=l.routeId),(f=l.beforeLoadPromise)==null||f.resolve(),(p=l.loaderPromise)==null||p.resolve(),(v=l.loadPromise)==null||v.resolve(),$n(c))throw u=!0,c=this.resolveRedirect({...c,_fromLocation:n}),c;if(Nt(c))throw this._handleNotFound(r,c,{updateMatch:s}),c}};try{await new Promise((l,c)=>{(async()=>{var f,p,v;try{const _=(g,x,S)=>{var b,E;const{id:P,routeId:T}=r[g],O=this.looseRoutesById[T];if(x instanceof Promise)throw x;x.routerCode=S,a=a??g,h(this.getMatch(P),x);try{(E=(b=O.options).onError)==null||E.call(b,x)}catch(V){x=V,h(this.getMatch(P),x)}s(P,V=>{var N;return(N=V.beforeLoadPromise)==null||N.resolve(),{...V,error:x,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController,beforeLoadPromise:void 0}})};for(const[g,{id:x,routeId:S}]of r.entries()){const b=this.getMatch(x),E=(f=r[g-1])==null?void 0:f.id,P=this.looseRoutesById[S],T=P.options.pendingMs??this.options.defaultPendingMs,O=!!(o&&!this.isServer&&!i&&(P.options.loader||P.options.beforeLoad)&&typeof T=="number"&&T!==1/0&&(P.options.pendingComponent??this.options.defaultPendingComponent));if(b.beforeLoadPromise||b.loaderPromise)O&&setTimeout(()=>{try{d()}catch{}},T),await b.beforeLoadPromise;else{try{s(x,B=>({...B,loadPromise:fr(()=>{var _e;(_e=B.loadPromise)==null||_e.resolve()}),beforeLoadPromise:fr()}));const V=new AbortController;let N;O&&(N=setTimeout(()=>{try{d()}catch{}},T));const{paramsError:K,searchError:F}=this.getMatch(x);K&&_(g,K,"PARSE_PARAMS"),F&&_(g,F,"VALIDATE_SEARCH");const W=()=>E?this.getMatch(E).context:this.options.context??{};s(x,B=>({...B,isFetching:"beforeLoad",fetchCount:B.fetchCount+1,abortController:V,pendingTimeout:N,context:{...W(),...B.__routeContext,...B.__beforeLoadContext}}));const{search:Q,params:oe,context:k,cause:j}=this.getMatch(x),D={search:Q,abortController:V,params:oe,preload:!!i,context:k,location:n,navigate:B=>this.navigate({...B,_fromLocation:n}),buildLocation:this.buildLocation,cause:i?"preload":j,matches:r};let $=await((v=(p=P.options).beforeLoad)==null?void 0:v.call(p,D))??{};this.serializeLoaderData&&($=this.serializeLoaderData("__beforeLoadContext",$,{router:this,match:this.getMatch(x)})),($n($)||Nt($))&&_(g,$,"BEFORE_LOAD"),s(x,B=>({...B,__beforeLoadContext:$,context:{...W(),...B.__routeContext,...$},abortController:V}))}catch(V){_(g,V,"BEFORE_LOAD")}s(x,V=>{var N;return(N=V.beforeLoadPromise)==null||N.resolve(),{...V,beforeLoadPromise:void 0,isFetching:!1}})}}const m=r.slice(0,a),y=[];m.forEach(({id:g,routeId:x},S)=>{y.push((async()=>{const{loaderPromise:b}=this.getMatch(g);let E=!1;if(b)await b;else{const P=y[S-1],T=this.looseRoutesById[x],O=()=>{const{params:D,loaderDeps:$,abortController:B,context:_e,cause:Se}=this.getMatch(g);return{params:D,deps:$,preload:!!i,parentMatchPromise:P,abortController:B,context:_e,location:n,navigate:wt=>this.navigate({...wt,_fromLocation:n}),cause:i?"preload":Se,route:T}},V=Date.now()-this.getMatch(g).updatedAt,N=i?T.options.preloadStaleTime??this.options.defaultPreloadStaleTime??3e4:T.options.staleTime??this.options.defaultStaleTime??0,K=T.options.shouldReload,F=typeof K=="function"?K(O()):K;s(g,D=>({...D,loaderPromise:fr(),preload:!!i&&!this.state.matches.find($=>$.id===g)}));const W=async()=>{var D,$,B,_e,Se,wt,ft,Ht;try{const lr=async()=>{const We=this.getMatch(g);We.minPendingPromise&&await We.minPendingPromise};try{T._lazyPromise=T._lazyPromise||(T.lazyFn?T.lazyFn().then(At=>{Object.assign(T.options,At.options)}):Promise.resolve());const We=this.getMatch(g).componentsPromise||T._lazyPromise.then(()=>Promise.all(o_.map(async At=>{const ae=T.options[At];ae!=null&&ae.preload&&await ae.preload()})));s(g,At=>({...At,isFetching:"loader",componentsPromise:We})),await T._lazyPromise;let nt=await(($=(D=T.options).loader)==null?void 0:$.call(D,O()));this.serializeLoaderData&&(nt=this.serializeLoaderData("loaderData",nt,{router:this,match:this.getMatch(g)})),h(this.getMatch(g),nt),await lr();const Lt=(_e=(B=T.options).meta)==null?void 0:_e.call(B,{matches:r,match:this.getMatch(g),params:this.getMatch(g).params,loaderData:nt}),To=(wt=(Se=T.options).headers)==null?void 0:wt.call(Se,{loaderData:nt});s(g,At=>({...At,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:nt,meta:Lt,headers:To}))}catch(We){let nt=We;await lr(),h(this.getMatch(g),We);try{(Ht=(ft=T.options).onError)==null||Ht.call(ft,We)}catch(Lt){nt=Lt,h(this.getMatch(g),Lt)}s(g,Lt=>({...Lt,error:nt,status:"error",isFetching:!1}))}await this.getMatch(g).componentsPromise}catch(lr){h(this.getMatch(g),lr)}},{status:Q,invalid:oe}=this.getMatch(g);E=Q==="success"&&(oe||(F??V>N)),i&&T.options.preload===!1||(E?(async()=>{try{await W()}catch{}})():Q!=="success"&&await W());const{loaderPromise:k,loadPromise:j}=this.getMatch(g);k==null||k.resolve(),j==null||j.resolve()}s(g,P=>({...P,isFetching:E?P.isFetching:!1,loaderPromise:void 0}))})())}),await Promise.all(y),l()}catch(_){c(_)}})()}),await d()}catch(l){if($n(l)||Nt(l))throw Nt(l)&&!i&&await d(),l}return r},this.invalidate=()=>{const n=r=>({...r,invalid:!0,...r.status==="error"?{status:"pending",error:void 0}:{}});return this.__store.setState(r=>{var i;return{...r,matches:r.matches.map(n),cachedMatches:r.cachedMatches.map(n),pendingMatches:(i=r.pendingMatches)==null?void 0:i.map(n)}}),this.load()},this.resolveRedirect=n=>{const r=n;return r.href||(r.href=this.buildLocation(r).href),r},this.cleanCache=()=>{this.__store.setState(n=>({...n,cachedMatches:n.cachedMatches.filter(r=>{const i=this.looseRoutesById[r.routeId];if(!i.options.loader)return!1;const o=(r.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??5*60*1e3;return r.status!=="error"&&Date.now()-r.updatedAt{const r=this.buildLocation(n);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0});const o=Object.fromEntries([...this.state.matches,...this.state.pendingMatches??[],...this.state.cachedMatches].map(a=>[a.id,!0]));this.__store.batch(()=>{i.forEach(a=>{o[a.id]||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,a]}))})});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id));try{return i=await this.loadMatches({matches:i,location:r,preload:!0,updateMatch:(a,u)=>{s.has(a)?i=i.map(d=>d.id===a?u(d):d):this.updateMatch(a,u)}}),i}catch(a){if($n(a))return await this.preloadRoute({...a,_fromLocation:r});console.error(a);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(i);if(r!=null&&r.pending&&this.state.status!=="pending")return!1;const a=((r==null?void 0:r.pending)===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation,u=Qo(this.basepath,a.pathname,{...r,to:o.pathname});return!u||n.params&&!jr(u,n.params,!0)?!1:u&&((r==null?void 0:r.includeSearch)??!0)?jr(a.search,o.search,!0)?u:!1:u},this.dehydrate=()=>{var n;const r=((n=this.options.errorSerializer)==null?void 0:n.serialize)??d_;return{state:{dehydratedMatches:this.state.matches.map(i=>({...Ai(i,["id","status","updatedAt"]),error:i.error?{data:r(i.error),__isServerError:!0}:void 0}))},manifest:this.manifest}},this.hydrate=()=>{var n,r,i;let o;typeof document<"u"&&(o=this.options.transformer.parse((n=window.__TSR__)==null?void 0:n.dehydrated)),Ze(o),this.dehydratedData=o.payload,(i=(r=this.options).hydrate)==null||i.call(r,o.payload);const s=o.router.state,a=this.matchRoutes(this.state.location).map(u=>{const d=s.dehydratedMatches.find(h=>h.id===u.id);return Ze(d,`Could not find a client-side match for dehydrated match with id: ${u.id}!`),{...u,...d}});this.__store.setState(u=>({...u,matches:a})),this.manifest=o.router.manifest},this.injectedHtml=[],this.injectHtml=n=>{const r=()=>(this.injectedHtml=this.injectedHtml.filter(i=>i!==r),n);this.injectedHtml.push(r)},this.streamedKeys=new Set,this.getStreamedValue=n=>{var r;if(this.isServer)return;const i=(r=window.__TSR__)==null?void 0:r.streamedValues[n];if(i)return i.parsed||(i.parsed=this.options.transformer.parse(i.value)),i.parsed},this.streamValue=(n,r)=>{var i;this.streamedKeys.has(n),this.streamedKeys.add(n);const o=`__TSR__.streamedValues['${n}'] = { value: ${(i=this.serializer)==null?void 0:i.call(this,this.options.transformer.stringify(r))}}`;this.injectHtml(` + diff --git a/manifest.webmanifest b/manifest.webmanifest index e8fdaa1..a5c0786 100644 --- a/manifest.webmanifest +++ b/manifest.webmanifest @@ -1 +1 @@ -{"name":"Toddler Games","short_name":"Toddler Games","start_url":"/toddler-games/","display":"minimal-ui","background_color":"#000000","lang":"en","scope":"/toddler-games/","description":"Toddler Games","theme_color":"#BB017A","categories":["education","game"],"icons":[{"src":"./logo.svg","sizes":"192x192","type":"image/svg"},{"src":"./logo.svg","sizes":"512x512","type":"image/svg"},{"src":"./logo.svg","sizes":"1024x1024","type":"image/svg"}]} +{"name":"Toddler Games","short_name":"Toddler Games","start_url":"/toddler-games/","display":"fullscreen","background_color":"#000000","lang":"en","scope":"/toddler-games/","description":"Toddler Games","theme_color":"#BB017A","categories":["education","game"],"icons":[{"src":"./logo.svg","sizes":"192x192","type":"image/svg"},{"src":"./logo.svg","sizes":"512x512","type":"image/svg"},{"src":"./logo.svg","sizes":"1024x1024","type":"image/svg"}]} diff --git a/sw.js b/sw.js index 3ab6135..01c4c03 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const c=e=>i(e,t),l={module:{uri:t},exports:o,require:c};s[t]=Promise.all(n.map((e=>l[e]||c(e)))).then((e=>(r(...e),o)))}}define(["./workbox-e1498109"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-CmBOohN-.css",revision:null},{url:"assets/index-DS2yny_c.js",revision:null},{url:"index.html",revision:"8bde01f4161cc9ac3a89c5a8ea35f1ee"},{url:"registerSW.js",revision:"c9efba4313003d61db381f3033dab82d"},{url:"logo.svg",revision:"7d06c228cd2478414feee148a1843c26"},{url:"manifest.webmanifest",revision:"c7bfebcf70a47a59e44ff97c90eead6e"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const f=e=>i(e,t),l={module:{uri:t},exports:o,require:f};s[t]=Promise.all(n.map((e=>l[e]||f(e)))).then((e=>(r(...e),o)))}}define(["./workbox-e1498109"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-CL2171Bt.js",revision:null},{url:"assets/index-CmBOohN-.css",revision:null},{url:"index.html",revision:"4a2a49fcdc69212ff5ffd044f5b7ff55"},{url:"registerSW.js",revision:"c9efba4313003d61db381f3033dab82d"},{url:"logo.svg",revision:"7d06c228cd2478414feee148a1843c26"},{url:"manifest.webmanifest",revision:"52e0e9b2b1178c9e483fa6dfe119c196"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));