From bfef8356888f4465dcd6df2d68900efba8339f3c Mon Sep 17 00:00:00 2001 From: chichoon Date: Mon, 23 Oct 2023 16:46:03 +0900 Subject: [PATCH] deploy --- .gitignore | 2 ++ ...{AlbumListView-b17c0ee8.js => AlbumListView-80183b1b.js} | 2 +- ...mponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js} | 2 +- ...omponent-fb63cb18.js => PaginationComponent-e4d19a62.js} | 2 +- .../{PostListView-edf2fddb.js => PostListView-6c5f9623.js} | 2 +- ...fileListView-59e0a4c7.js => ProfileListView-f318d6f6.js} | 2 +- assets/{ProfileView-2cfe8d57.js => ProfileView-913bd9ab.js} | 2 +- .../{TodoListView-ca4ca47a.js => TodoListView-76397d39.js} | 2 +- assets/{constants-99ec137a.js => constants-635cc42e.js} | 2 +- assets/{index-0204c66f.js => index-778020de.js} | 2 +- index.html | 6 +++--- 11 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 .gitignore rename assets/{AlbumListView-b17c0ee8.js => AlbumListView-80183b1b.js} (85%) rename assets/{ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js => ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js} (99%) rename assets/{PaginationComponent-fb63cb18.js => PaginationComponent-e4d19a62.js} (91%) rename assets/{PostListView-edf2fddb.js => PostListView-6c5f9623.js} (82%) rename assets/{ProfileListView-59e0a4c7.js => ProfileListView-f318d6f6.js} (85%) rename assets/{ProfileView-2cfe8d57.js => ProfileView-913bd9ab.js} (90%) rename assets/{TodoListView-ca4ca47a.js => TodoListView-76397d39.js} (92%) rename assets/{constants-99ec137a.js => constants-635cc42e.js} (65%) rename assets/{index-0204c66f.js => index-778020de.js} (97%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f06235c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/assets/AlbumListView-b17c0ee8.js b/assets/AlbumListView-80183b1b.js similarity index 85% rename from assets/AlbumListView-b17c0ee8.js rename to assets/AlbumListView-80183b1b.js index 12aab5b..aa915a0 100644 --- a/assets/AlbumListView-b17c0ee8.js +++ b/assets/AlbumListView-80183b1b.js @@ -1 +1 @@ -import{d as y,h as P,i as A,l as m,m as L,c as p,u as t,e as d,b as h,t as E,a as _,j,F as C,o as n}from"./index-0204c66f.js";import{P as g}from"./PaginationComponent-fb63cb18.js";import{u as k,C as V,S as w}from"./constants-99ec137a.js";import{a as B,L as I,_ as T}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js";const u={all:["photo"],album:{all:()=>[...u.all,"album"],id:e=>[...u.album.all(),e]},id:e=>[...u.all,e]};function x(e){return fetch(`https://jsonplaceholder.typicode.com/photos/${e}`).then(a=>a.json())}function N(){return fetch("https://jsonplaceholder.typicode.com/photos").then(e=>e.json())}function F(e){return fetch(`https://jsonplaceholder.typicode.com/albums/${e}/photos`).then(a=>a.json())}const S={get:x,getAll:N,getAllPhotosInAlbum:F};function $(e){return k({queryKey:u.album.id(e),queryFn:()=>S.getAllPhotosInAlbum(e.value),cacheTime:V,staleTime:w})}const q={key:2,class:"album-wrapper"},K=["src","alt"],M=y({__name:"AlbumListView",setup(e){const a=P(),i=A(()=>Number(a.params.id)),s=m((i.value-1)*10+1),o=m(0),{data:r,isLoading:f,isError:b,error:v}=$(s);return L(s,()=>{o.value=0}),(U,l)=>(n(),p(C,null,[t(f)?(n(),d(I,{key:0})):t(b)?(n(),d(B,{key:1,error:t(v)},null,8,["error"])):t(r)?(n(),p("div",q,[h("h3",null,E(t(r)[o.value].title),1),h("img",{src:t(r)[o.value].url,alt:t(r)[o.value].title},null,8,K),_(g,{currentPage:o.value,"onUpdate:currentPage":l[0]||(l[0]=c=>o.value=c),start:0,limit:t(r).length-1},null,8,["currentPage","limit"])])):j("",!0),_(g,{currentPage:s.value,"onUpdate:currentPage":l[1]||(l[1]=c=>s.value=c),start:(i.value-1)*10+1,limit:(i.value-1)*10+10},null,8,["currentPage","start","limit"])],64))}});const R=T(M,[["__scopeId","data-v-b2584de5"]]);export{R as default}; +import{d as y,h as P,i as A,l as m,m as L,c as p,u as t,e as d,b as h,t as E,a as _,j,F as C,o as n}from"./index-778020de.js";import{P as g}from"./PaginationComponent-e4d19a62.js";import{u as k,C as V,S as w}from"./constants-635cc42e.js";import{a as B,L as I,_ as T}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js";const u={all:["photo"],album:{all:()=>[...u.all,"album"],id:e=>[...u.album.all(),e]},id:e=>[...u.all,e]};function x(e){return fetch(`https://jsonplaceholder.typicode.com/photos/${e}`).then(a=>a.json())}function N(){return fetch("https://jsonplaceholder.typicode.com/photos").then(e=>e.json())}function F(e){return fetch(`https://jsonplaceholder.typicode.com/albums/${e}/photos`).then(a=>a.json())}const S={get:x,getAll:N,getAllPhotosInAlbum:F};function $(e){return k({queryKey:u.album.id(e),queryFn:()=>S.getAllPhotosInAlbum(e.value),cacheTime:V,staleTime:w})}const q={key:2,class:"album-wrapper"},K=["src","alt"],M=y({__name:"AlbumListView",setup(e){const a=P(),i=A(()=>Number(a.params.id)),s=m((i.value-1)*10+1),o=m(0),{data:r,isLoading:f,isError:b,error:v}=$(s);return L(s,()=>{o.value=0}),(U,l)=>(n(),p(C,null,[t(f)?(n(),d(I,{key:0})):t(b)?(n(),d(B,{key:1,error:t(v)},null,8,["error"])):t(r)?(n(),p("div",q,[h("h3",null,E(t(r)[o.value].title),1),h("img",{src:t(r)[o.value].url,alt:t(r)[o.value].title},null,8,K),_(g,{currentPage:o.value,"onUpdate:currentPage":l[0]||(l[0]=c=>o.value=c),start:0,limit:t(r).length-1},null,8,["currentPage","limit"])])):j("",!0),_(g,{currentPage:s.value,"onUpdate:currentPage":l[1]||(l[1]=c=>s.value=c),start:(i.value-1)*10+1,limit:(i.value-1)*10+10},null,8,["currentPage","start","limit"])],64))}});const R=T(M,[["__scopeId","data-v-b2584de5"]]);export{R as default}; diff --git a/assets/ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js b/assets/ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js similarity index 99% rename from assets/ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js rename to assets/ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js index fd68390..4f7c13a 100644 --- a/assets/ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js +++ b/assets/ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js @@ -1 +1 @@ -import{S as j,x as w,y as N,z as M,A as x,B as z,C as H,D as W,E as k,G,H as J,I as X,J as Y,K as Z,i as D,L as $,m as Q,M as P,N as ee,O as te,P as se,u as S,Q as re,R as ne,T as ie,o as F,c as T,b as U,d as K,a as ue,t as ae}from"./index-0204c66f.js";class Ce extends j{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),A(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){const s=this.options,o=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),w(s,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=s.queryKey),this.updateQuery();const i=this.hasListeners();i&&B(this.currentQuery,o,this.options,s)&&this.executeFetch(),this.updateResult(t),i&&(this.currentQuery!==o||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&this.updateStaleTimeout();const u=this.computeRefetchInterval();i&&(this.currentQuery!==o||this.options.enabled!==s.enabled||u!==this.currentRefetchInterval)&&this.updateRefetchInterval(u)}getOptimisticResult(e){const t=this.client.getQueryCache().build(this.client,e),s=this.createResult(t,e);return ce(this,s,e)&&(this.currentResult=s,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),s}getCurrentResult(){return this.currentResult}trackResult(e){const t={};return Object.keys(e).forEach(s=>{Object.defineProperty(t,s,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(s),e[s])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){const t=this.client.defaultQueryOptions(e),s=this.client.getQueryCache().build(this.client,t);return s.isFetchingOptimistic=!0,s.fetch().then(()=>this.createResult(s,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:(t=e.cancelRefetch)!=null?t:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(N)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),M||this.currentResult.isStale||!x(this.options.staleTime))return;const t=z(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},t)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(M||this.options.enabled===!1||!x(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||H.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){const s=this.currentQuery,o=this.options,i=this.currentResult,u=this.currentResultState,n=this.currentResultOptions,h=e!==s,l=h?e.state:this.currentQueryInitialState,d=h?this.currentResult:this.previousQueryResult,{state:c}=e;let{dataUpdatedAt:m,error:b,errorUpdatedAt:v,fetchStatus:a,status:f}=c,R=!1,g=!1,p;if(t._optimisticResults){const y=this.hasListeners(),I=!y&&A(e,t),V=y&&B(e,s,t,o);(I||V)&&(a=W(e.options.networkMode)?"fetching":"paused",m||(f="loading")),t._optimisticResults==="isRestoring"&&(a="idle")}if(t.keepPreviousData&&!c.dataUpdatedAt&&d!=null&&d.isSuccess&&f!=="error")p=d.data,m=d.dataUpdatedAt,f=d.status,R=!0;else if(t.select&&typeof c.data<"u")if(i&&c.data===(u==null?void 0:u.data)&&t.select===this.selectFn)p=this.selectResult;else try{this.selectFn=t.select,p=t.select(c.data),p=k(i==null?void 0:i.data,p,t),this.selectResult=p,this.selectError=null}catch(y){this.selectError=y}else p=c.data;if(typeof t.placeholderData<"u"&&typeof p>"u"&&f==="loading"){let y;if(i!=null&&i.isPlaceholderData&&t.placeholderData===(n==null?void 0:n.placeholderData))y=i.data;else if(y=typeof t.placeholderData=="function"?t.placeholderData():t.placeholderData,t.select&&typeof y<"u")try{y=t.select(y),this.selectError=null}catch(I){this.selectError=I}typeof y<"u"&&(f="success",p=k(i==null?void 0:i.data,y,t),g=!0)}this.selectError&&(b=this.selectError,p=this.selectResult,v=Date.now(),f="error");const _=a==="fetching",O=f==="loading",C=f==="error";return{status:f,fetchStatus:a,isLoading:O,isSuccess:f==="success",isError:C,isInitialLoading:O&&_,data:p,dataUpdatedAt:m,error:b,errorUpdatedAt:v,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:_,isRefetching:_&&!O,isLoadingError:C&&c.dataUpdatedAt===0,isPaused:a==="paused",isPlaceholderData:g,isPreviousData:R,isRefetchError:C&&c.dataUpdatedAt!==0,isStale:L(e,t),refetch:this.refetch,remove:this.remove}}updateResult(e){const t=this.currentResult,s=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,w(s,t))return;this.currentResult=s;const o={cache:!0},i=()=>{if(!t)return!0;const{notifyOnChangeProps:u}=this.options,n=typeof u=="function"?u():u;if(n==="all"||!n&&!this.trackedProps.size)return!0;const h=new Set(n??this.trackedProps);return this.options.useErrorBoundary&&h.add("error"),Object.keys(this.currentResult).some(l=>{const d=l;return this.currentResult[d]!==t[d]&&h.has(d)})};(e==null?void 0:e.listeners)!==!1&&i()&&(o.listeners=!0),this.notify({...o,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const t={};e.type==="success"?t.onSuccess=!e.manual:e.type==="error"&&!G(e.error)&&(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){J.batch(()=>{if(e.onSuccess){var t,s,o,i;(t=(s=this.options).onSuccess)==null||t.call(s,this.currentResult.data),(o=(i=this.options).onSettled)==null||o.call(i,this.currentResult.data,null)}else if(e.onError){var u,n,h,l;(u=(n=this.options).onError)==null||u.call(n,this.currentResult.error),(h=(l=this.options).onSettled)==null||h.call(l,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:d})=>{d(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function oe(r,e){return e.enabled!==!1&&!r.state.dataUpdatedAt&&!(r.state.status==="error"&&e.retryOnMount===!1)}function A(r,e){return oe(r,e)||r.state.dataUpdatedAt>0&&E(r,e,e.refetchOnMount)}function E(r,e,t){if(e.enabled!==!1){const s=typeof t=="function"?t(r):t;return s==="always"||s!==!1&&L(r,e)}return!1}function B(r,e,t,s){return t.enabled!==!1&&(r!==e||s.enabled===!1)&&(!t.suspense||r.state.status!=="error")&&L(r,t)}function L(r,e){return r.isStaleByTime(e.staleTime)}function ce(r,e,t){return t.keepPreviousData?!1:t.placeholderData!==void 0?e.isPlaceholderData:!w(r.getCurrentResult(),e)}function le(r=""){const e=Z(r),t=X(e,null);if(!t){var s;throw((s=Y())==null?void 0:s.proxy)?new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library."):new Error("vue-query hooks can only be used inside setup() function.")}return t}function Ie(r,e,t={},s={}){var o;const i=D(()=>he(e,t,s)),u=(o=i.value.queryClient)!=null?o:le(i.value.queryClientKey),n=D(()=>{const a=u.defaultQueryOptions(i.value);return a._optimisticResults=u.isRestoring.value?"isRestoring":"optimistic",a}),h=new r(u,n.value),l=$(h.getCurrentResult());let d=()=>{};Q(u.isRestoring,a=>{a||(d(),d=h.subscribe(f=>{P(l,f)}))},{immediate:!0});const c=()=>{h.setOptions(n.value),P(l,h.getCurrentResult())};Q(n,c),ie(()=>{d()});const m=(...a)=>(c(),l.refetch(...a)),b=()=>new Promise((a,f)=>{let R=()=>{};const g=()=>{if(n.value.enabled!==!1){const p=h.getOptimisticResult(n.value);p.isStale?(R(),h.fetchOptimistic(n.value).then(a,f)):(R(),a(p))}};g(),R=Q(n,g)});Q(()=>l.error,a=>{if(l.isError&&!l.isFetching&&ee(n.value.useErrorBoundary,[a,h.getCurrentQuery()]))throw a});const v=te(se(l));for(const a in l)typeof l[a]=="function"&&(v[a]=l[a]);return v.suspense=b,v.refetch=m,v}function he(r,e={},t={}){const s=S(r),o=S(e),i=S(t);let u=s;re(s)?typeof o=="function"?u={...i,queryKey:s,queryFn:o}:u={...o,queryKey:s}:u=s;const n=ne(u);return typeof n.enabled=="function"&&(n.enabled=n.enabled()),n}const q=(r,e)=>{const t=r.__vccOpts||r;for(const[s,o]of e)t[s]=o;return t},de={},fe={width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},pe=U("path",{d:"M12 2.99988V5.99988M12 20.9999V17.9999M4.20577 16.4999L6.80385 14.9999M21 11.9999H18M16.5 19.7941L15 17.196M3 11.9999H6M7.5 4.20565L9 6.80373M7.5 19.7941L9 17.196M19.7942 16.4999L17.1962 14.9999M4.20577 7.49988L6.80385 8.99988",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),ye=[pe];function ve(r,e){return F(),T("svg",fe,ye)}const Re=q(de,[["render",ve]]),me={class:"loading-wrapper"},ge=K({__name:"LoadingComponent",setup(r){return(e,t)=>(F(),T("div",me,[ue(Re)]))}});const Se=q(ge,[["__scopeId","data-v-3b2562c8"]]),be={class:"error-wrapper"},Qe=U("h1",null,"Something went wrong",-1),we=K({__name:"ErrorComponent",props:{error:{}},setup(r){return(e,t)=>(F(),T("div",be,[Qe,U("p",null,ae(e.error),1)]))}});export{Se as L,Ce as Q,q as _,we as a,Ie as u}; +import{S as j,x as w,y as N,z as M,A as x,B as z,C as H,D as W,E as k,G,H as J,I as X,J as Y,K as Z,i as D,L as $,m as Q,M as P,N as ee,O as te,P as se,u as S,Q as re,R as ne,T as ie,o as F,c as T,b as U,d as K,a as ue,t as ae}from"./index-778020de.js";class Ce extends j{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),A(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){const s=this.options,o=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),w(s,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=s.queryKey),this.updateQuery();const i=this.hasListeners();i&&B(this.currentQuery,o,this.options,s)&&this.executeFetch(),this.updateResult(t),i&&(this.currentQuery!==o||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&this.updateStaleTimeout();const u=this.computeRefetchInterval();i&&(this.currentQuery!==o||this.options.enabled!==s.enabled||u!==this.currentRefetchInterval)&&this.updateRefetchInterval(u)}getOptimisticResult(e){const t=this.client.getQueryCache().build(this.client,e),s=this.createResult(t,e);return ce(this,s,e)&&(this.currentResult=s,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),s}getCurrentResult(){return this.currentResult}trackResult(e){const t={};return Object.keys(e).forEach(s=>{Object.defineProperty(t,s,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(s),e[s])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){const t=this.client.defaultQueryOptions(e),s=this.client.getQueryCache().build(this.client,t);return s.isFetchingOptimistic=!0,s.fetch().then(()=>this.createResult(s,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:(t=e.cancelRefetch)!=null?t:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(N)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),M||this.currentResult.isStale||!x(this.options.staleTime))return;const t=z(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},t)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(M||this.options.enabled===!1||!x(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||H.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){const s=this.currentQuery,o=this.options,i=this.currentResult,u=this.currentResultState,n=this.currentResultOptions,h=e!==s,l=h?e.state:this.currentQueryInitialState,d=h?this.currentResult:this.previousQueryResult,{state:c}=e;let{dataUpdatedAt:m,error:b,errorUpdatedAt:v,fetchStatus:a,status:f}=c,R=!1,g=!1,p;if(t._optimisticResults){const y=this.hasListeners(),I=!y&&A(e,t),V=y&&B(e,s,t,o);(I||V)&&(a=W(e.options.networkMode)?"fetching":"paused",m||(f="loading")),t._optimisticResults==="isRestoring"&&(a="idle")}if(t.keepPreviousData&&!c.dataUpdatedAt&&d!=null&&d.isSuccess&&f!=="error")p=d.data,m=d.dataUpdatedAt,f=d.status,R=!0;else if(t.select&&typeof c.data<"u")if(i&&c.data===(u==null?void 0:u.data)&&t.select===this.selectFn)p=this.selectResult;else try{this.selectFn=t.select,p=t.select(c.data),p=k(i==null?void 0:i.data,p,t),this.selectResult=p,this.selectError=null}catch(y){this.selectError=y}else p=c.data;if(typeof t.placeholderData<"u"&&typeof p>"u"&&f==="loading"){let y;if(i!=null&&i.isPlaceholderData&&t.placeholderData===(n==null?void 0:n.placeholderData))y=i.data;else if(y=typeof t.placeholderData=="function"?t.placeholderData():t.placeholderData,t.select&&typeof y<"u")try{y=t.select(y),this.selectError=null}catch(I){this.selectError=I}typeof y<"u"&&(f="success",p=k(i==null?void 0:i.data,y,t),g=!0)}this.selectError&&(b=this.selectError,p=this.selectResult,v=Date.now(),f="error");const _=a==="fetching",O=f==="loading",C=f==="error";return{status:f,fetchStatus:a,isLoading:O,isSuccess:f==="success",isError:C,isInitialLoading:O&&_,data:p,dataUpdatedAt:m,error:b,errorUpdatedAt:v,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:_,isRefetching:_&&!O,isLoadingError:C&&c.dataUpdatedAt===0,isPaused:a==="paused",isPlaceholderData:g,isPreviousData:R,isRefetchError:C&&c.dataUpdatedAt!==0,isStale:L(e,t),refetch:this.refetch,remove:this.remove}}updateResult(e){const t=this.currentResult,s=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,w(s,t))return;this.currentResult=s;const o={cache:!0},i=()=>{if(!t)return!0;const{notifyOnChangeProps:u}=this.options,n=typeof u=="function"?u():u;if(n==="all"||!n&&!this.trackedProps.size)return!0;const h=new Set(n??this.trackedProps);return this.options.useErrorBoundary&&h.add("error"),Object.keys(this.currentResult).some(l=>{const d=l;return this.currentResult[d]!==t[d]&&h.has(d)})};(e==null?void 0:e.listeners)!==!1&&i()&&(o.listeners=!0),this.notify({...o,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const t={};e.type==="success"?t.onSuccess=!e.manual:e.type==="error"&&!G(e.error)&&(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){J.batch(()=>{if(e.onSuccess){var t,s,o,i;(t=(s=this.options).onSuccess)==null||t.call(s,this.currentResult.data),(o=(i=this.options).onSettled)==null||o.call(i,this.currentResult.data,null)}else if(e.onError){var u,n,h,l;(u=(n=this.options).onError)==null||u.call(n,this.currentResult.error),(h=(l=this.options).onSettled)==null||h.call(l,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:d})=>{d(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function oe(r,e){return e.enabled!==!1&&!r.state.dataUpdatedAt&&!(r.state.status==="error"&&e.retryOnMount===!1)}function A(r,e){return oe(r,e)||r.state.dataUpdatedAt>0&&E(r,e,e.refetchOnMount)}function E(r,e,t){if(e.enabled!==!1){const s=typeof t=="function"?t(r):t;return s==="always"||s!==!1&&L(r,e)}return!1}function B(r,e,t,s){return t.enabled!==!1&&(r!==e||s.enabled===!1)&&(!t.suspense||r.state.status!=="error")&&L(r,t)}function L(r,e){return r.isStaleByTime(e.staleTime)}function ce(r,e,t){return t.keepPreviousData?!1:t.placeholderData!==void 0?e.isPlaceholderData:!w(r.getCurrentResult(),e)}function le(r=""){const e=Z(r),t=X(e,null);if(!t){var s;throw((s=Y())==null?void 0:s.proxy)?new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library."):new Error("vue-query hooks can only be used inside setup() function.")}return t}function Ie(r,e,t={},s={}){var o;const i=D(()=>he(e,t,s)),u=(o=i.value.queryClient)!=null?o:le(i.value.queryClientKey),n=D(()=>{const a=u.defaultQueryOptions(i.value);return a._optimisticResults=u.isRestoring.value?"isRestoring":"optimistic",a}),h=new r(u,n.value),l=$(h.getCurrentResult());let d=()=>{};Q(u.isRestoring,a=>{a||(d(),d=h.subscribe(f=>{P(l,f)}))},{immediate:!0});const c=()=>{h.setOptions(n.value),P(l,h.getCurrentResult())};Q(n,c),ie(()=>{d()});const m=(...a)=>(c(),l.refetch(...a)),b=()=>new Promise((a,f)=>{let R=()=>{};const g=()=>{if(n.value.enabled!==!1){const p=h.getOptimisticResult(n.value);p.isStale?(R(),h.fetchOptimistic(n.value).then(a,f)):(R(),a(p))}};g(),R=Q(n,g)});Q(()=>l.error,a=>{if(l.isError&&!l.isFetching&&ee(n.value.useErrorBoundary,[a,h.getCurrentQuery()]))throw a});const v=te(se(l));for(const a in l)typeof l[a]=="function"&&(v[a]=l[a]);return v.suspense=b,v.refetch=m,v}function he(r,e={},t={}){const s=S(r),o=S(e),i=S(t);let u=s;re(s)?typeof o=="function"?u={...i,queryKey:s,queryFn:o}:u={...o,queryKey:s}:u=s;const n=ne(u);return typeof n.enabled=="function"&&(n.enabled=n.enabled()),n}const q=(r,e)=>{const t=r.__vccOpts||r;for(const[s,o]of e)t[s]=o;return t},de={},fe={width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},pe=U("path",{d:"M12 2.99988V5.99988M12 20.9999V17.9999M4.20577 16.4999L6.80385 14.9999M21 11.9999H18M16.5 19.7941L15 17.196M3 11.9999H6M7.5 4.20565L9 6.80373M7.5 19.7941L9 17.196M19.7942 16.4999L17.1962 14.9999M4.20577 7.49988L6.80385 8.99988",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),ye=[pe];function ve(r,e){return F(),T("svg",fe,ye)}const Re=q(de,[["render",ve]]),me={class:"loading-wrapper"},ge=K({__name:"LoadingComponent",setup(r){return(e,t)=>(F(),T("div",me,[ue(Re)]))}});const Se=q(ge,[["__scopeId","data-v-3b2562c8"]]),be={class:"error-wrapper"},Qe=U("h1",null,"Something went wrong",-1),we=K({__name:"ErrorComponent",props:{error:{}},setup(r){return(e,t)=>(F(),T("div",be,[Qe,U("p",null,ae(e.error),1)]))}});export{Se as L,Ce as Q,q as _,we as a,Ie as u}; diff --git a/assets/PaginationComponent-fb63cb18.js b/assets/PaginationComponent-e4d19a62.js similarity index 91% rename from assets/PaginationComponent-fb63cb18.js rename to assets/PaginationComponent-e4d19a62.js index e74aaf3..714946c 100644 --- a/assets/PaginationComponent-fb63cb18.js +++ b/assets/PaginationComponent-e4d19a62.js @@ -1 +1 @@ -import{_ as r}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js";import{o as s,c as a,b as t,d as p,a as _,v as d,t as g}from"./index-0204c66f.js";const h={},m={width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f=t("path",{d:"M6 12H18M6 12L11 7M6 12L11 17",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),P=[f];function w(n,o){return s(),a("svg",m,P)}const v=r(h,[["render",w]]),x={},k={width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b=t("path",{d:"M6 12H18M18 12L13 7M18 12L13 17",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),C=[b];function $(n,o){return s(),a("svg",k,C)}const M=r(x,[["render",$]]),B={class:"wrapper"},L=p({__name:"PaginationComponent",props:{currentPage:{},start:{},limit:{}},emits:["update:currentPage"],setup(n,{emit:o}){const e=n,c=o,l=()=>{e.currentPage!==e.start&&c("update:currentPage",e.currentPage-1)},u=()=>{e.currentPage!==e.limit&&c("update:currentPage",e.currentPage+1)};return(i,y)=>(s(),a("div",B,[t("button",{class:d(["button",{disabled:i.currentPage<=e.start}]),onClick:l},[_(v)],2),t("div",null,[t("span",null,g(e.currentPage),1)]),t("button",{class:d(["button",{disabled:i.currentPage>=e.limit}]),onClick:u},[_(M)],2)]))}});const j=r(L,[["__scopeId","data-v-9f268eed"]]);export{j as P}; +import{_ as r}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js";import{o as s,c as a,b as t,d as p,a as _,v as d,t as g}from"./index-778020de.js";const h={},m={width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f=t("path",{d:"M6 12H18M6 12L11 7M6 12L11 17",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),P=[f];function w(n,o){return s(),a("svg",m,P)}const v=r(h,[["render",w]]),x={},k={width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b=t("path",{d:"M6 12H18M18 12L13 7M18 12L13 17",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),C=[b];function $(n,o){return s(),a("svg",k,C)}const M=r(x,[["render",$]]),B={class:"wrapper"},L=p({__name:"PaginationComponent",props:{currentPage:{},start:{},limit:{}},emits:["update:currentPage"],setup(n,{emit:o}){const e=n,c=o,l=()=>{e.currentPage!==e.start&&c("update:currentPage",e.currentPage-1)},u=()=>{e.currentPage!==e.limit&&c("update:currentPage",e.currentPage+1)};return(i,y)=>(s(),a("div",B,[t("button",{class:d(["button",{disabled:i.currentPage<=e.start}]),onClick:l},[_(v)],2),t("div",null,[t("span",null,g(e.currentPage),1)]),t("button",{class:d(["button",{disabled:i.currentPage>=e.limit}]),onClick:u},[_(M)],2)]))}});const j=r(L,[["__scopeId","data-v-9f268eed"]]);export{j as P}; diff --git a/assets/PostListView-edf2fddb.js b/assets/PostListView-6c5f9623.js similarity index 82% rename from assets/PostListView-edf2fddb.js rename to assets/PostListView-6c5f9623.js index 43cc65b..b505664 100644 --- a/assets/PostListView-edf2fddb.js +++ b/assets/PostListView-6c5f9623.js @@ -1 +1 @@ -import{d as h,h as y,i as g,l as P,u as t,e as l,c as v,b as u,t as i,a as j,j as C,o as n}from"./index-0204c66f.js";import{u as L,C as k,S as E}from"./constants-99ec137a.js";import{a as V,L as b,_ as B}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js";import{P as I}from"./PaginationComponent-fb63cb18.js";const a={all:["post"],user:{all:()=>[...a.all,"user"],id:e=>[...a.user.all(),e]},id:e=>[...a.all,e]};function T(e){return fetch(`https://jsonplaceholder.typicode.com/posts/${e}`).then(s=>s.json())}function w(){return fetch("https://jsonplaceholder.typicode.com/posts").then(e=>e.json())}function x(e){return fetch(`https://jsonplaceholder.typicode.com/users/${e}/posts`).then(s=>s.json())}const N={get:T,getAll:w,getFromUserId:x};function U(e){return L({queryKey:a.user.id(e),queryFn:()=>N.getFromUserId(e.value),cacheTime:k,staleTime:E})}const A={key:2,class:"post-wrapper"},F=h({__name:"PostListView",setup(e){const s=y(),p=g(()=>Number(s.params.id)),o=P(0),{data:r,isLoading:d,isError:m,error:_}=U(p);return(S,c)=>t(d)?(n(),l(b,{key:0})):t(m)?(n(),l(V,{key:1,error:t(_)},null,8,["error"])):t(r)?(n(),v("div",A,[u("h3",null,i(t(r)[o.value].title),1),u("p",null,i(t(r)[o.value].body),1),j(I,{currentPage:o.value,"onUpdate:currentPage":c[0]||(c[0]=f=>o.value=f),start:0,limit:t(r).length-1},null,8,["currentPage","limit"])])):C("",!0)}});const D=B(F,[["__scopeId","data-v-b6697fcd"]]);export{D as default}; +import{d as h,h as y,i as g,l as P,u as t,e as l,c as v,b as u,t as i,a as j,j as C,o as n}from"./index-778020de.js";import{u as L,C as k,S as E}from"./constants-635cc42e.js";import{a as V,L as b,_ as B}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js";import{P as I}from"./PaginationComponent-e4d19a62.js";const a={all:["post"],user:{all:()=>[...a.all,"user"],id:e=>[...a.user.all(),e]},id:e=>[...a.all,e]};function T(e){return fetch(`https://jsonplaceholder.typicode.com/posts/${e}`).then(s=>s.json())}function w(){return fetch("https://jsonplaceholder.typicode.com/posts").then(e=>e.json())}function x(e){return fetch(`https://jsonplaceholder.typicode.com/users/${e}/posts`).then(s=>s.json())}const N={get:T,getAll:w,getFromUserId:x};function U(e){return L({queryKey:a.user.id(e),queryFn:()=>N.getFromUserId(e.value),cacheTime:k,staleTime:E})}const A={key:2,class:"post-wrapper"},F=h({__name:"PostListView",setup(e){const s=y(),p=g(()=>Number(s.params.id)),o=P(0),{data:r,isLoading:d,isError:m,error:_}=U(p);return(S,c)=>t(d)?(n(),l(b,{key:0})):t(m)?(n(),l(V,{key:1,error:t(_)},null,8,["error"])):t(r)?(n(),v("div",A,[u("h3",null,i(t(r)[o.value].title),1),u("p",null,i(t(r)[o.value].body),1),j(I,{currentPage:o.value,"onUpdate:currentPage":c[0]||(c[0]=f=>o.value=f),start:0,limit:t(r).length-1},null,8,["currentPage","limit"])])):C("",!0)}});const D=B(F,[["__scopeId","data-v-b6697fcd"]]);export{D as default}; diff --git a/assets/ProfileListView-59e0a4c7.js b/assets/ProfileListView-f318d6f6.js similarity index 85% rename from assets/ProfileListView-59e0a4c7.js rename to assets/ProfileListView-f318d6f6.js index 3e6f6bd..a1724b0 100644 --- a/assets/ProfileListView-59e0a4c7.js +++ b/assets/ProfileListView-f318d6f6.js @@ -1 +1 @@ -import{p as m,a as h}from"./profile-eb2515ba.js";import{u as y,C as v,S as w}from"./constants-99ec137a.js";import{d as u,r as P,o as e,c as t,a as k,w as L,b as o,t as i,u as a,e as l,F as c,f as g,p as C,g as I}from"./index-0204c66f.js";import{_ as d,a as E,L as S}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js";function T(){return y({queryKey:m.all,queryFn:()=>h.getAll(),cacheTime:v,staleTime:w})}const V={class:"element-wrapper"},$={class:"username"},B=u({__name:"ProfilePreview",props:{profile:{}},setup(r){return(s,_)=>{const n=P("RouterLink");return e(),t("li",V,[k(n,{to:`/profile/${s.profile.id}`,class:"link"},{default:L(()=>[o("div",$,[o("h3",null,i(s.profile.username),1),o("h4",null,i(s.profile.name),1)]),o("span",null,i(s.profile.email),1)]),_:1},8,["to"])])}}});const b=d(B,[["__scopeId","data-v-6cba3051"]]),x=r=>(C("data-v-ff4143dd"),r=r(),I(),r),A=x(()=>o("header",{class:"header"},[o("h1",null,"Profiles")],-1)),F={key:2,class:"list-wrapper"},q=u({__name:"ProfileListView",setup(r){const{data:s,isLoading:_,isError:n,error:f}=T();return(K,M)=>(e(),t(c,null,[A,a(_)?(e(),l(S,{key:0})):a(n)?(e(),l(E,{key:1,error:a(f)},null,8,["error"])):(e(),t("ul",F,[(e(!0),t(c,null,g(a(s),p=>(e(),l(b,{key:p.id,profile:p},null,8,["profile"]))),128))]))],64))}});const H=d(q,[["__scopeId","data-v-ff4143dd"]]);export{H as default}; +import{p as m,a as h}from"./profile-eb2515ba.js";import{u as y,C as v,S as w}from"./constants-635cc42e.js";import{d as u,r as P,o as e,c as t,a as k,w as L,b as o,t as i,u as a,e as l,F as c,f as g,p as C,g as I}from"./index-778020de.js";import{_ as d,a as E,L as S}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js";function T(){return y({queryKey:m.all,queryFn:()=>h.getAll(),cacheTime:v,staleTime:w})}const V={class:"element-wrapper"},$={class:"username"},B=u({__name:"ProfilePreview",props:{profile:{}},setup(r){return(s,_)=>{const n=P("RouterLink");return e(),t("li",V,[k(n,{to:`/profile/${s.profile.id}`,class:"link"},{default:L(()=>[o("div",$,[o("h3",null,i(s.profile.username),1),o("h4",null,i(s.profile.name),1)]),o("span",null,i(s.profile.email),1)]),_:1},8,["to"])])}}});const b=d(B,[["__scopeId","data-v-6cba3051"]]),x=r=>(C("data-v-ff4143dd"),r=r(),I(),r),A=x(()=>o("header",{class:"header"},[o("h1",null,"Profiles")],-1)),F={key:2,class:"list-wrapper"},q=u({__name:"ProfileListView",setup(r){const{data:s,isLoading:_,isError:n,error:f}=T();return(K,M)=>(e(),t(c,null,[A,a(_)?(e(),l(S,{key:0})):a(n)?(e(),l(E,{key:1,error:a(f)},null,8,["error"])):(e(),t("ul",F,[(e(!0),t(c,null,g(a(s),p=>(e(),l(b,{key:p.id,profile:p},null,8,["profile"]))),128))]))],64))}});const H=d(q,[["__scopeId","data-v-ff4143dd"]]);export{H as default}; diff --git a/assets/ProfileView-2cfe8d57.js b/assets/ProfileView-913bd9ab.js similarity index 90% rename from assets/ProfileView-2cfe8d57.js rename to assets/ProfileView-913bd9ab.js index e162b0f..81c8cd0 100644 --- a/assets/ProfileView-2cfe8d57.js +++ b/assets/ProfileView-913bd9ab.js @@ -1 +1 @@ -import{a as b,L as h,_ as G}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js";import{p as k,a as N}from"./profile-eb2515ba.js";import{u as w,C as T,S as V}from"./constants-99ec137a.js";import{d as R,h as q,i as B,r as v,c as d,b as t,a as r,w as c,u as e,e as p,j as y,t as i,F,o as a,k as l,p as $,g as A}from"./index-0204c66f.js";function D(o){return w({queryKey:k.id(o),queryFn:()=>N.get(o.value),cacheTime:T,staleTime:V})}function K(){return fetch("https://dog.ceo/api/breeds/image/random").then(o=>o.json())}const j={get:K};function M(o){return w({queryKey:k.dog(o),queryFn:j.get,cacheTime:T,staleTime:V})}const C=o=>($("data-v-76e019a7"),o=o(),A(),o),H={class:"header"},Q=C(()=>t("span",null,"Profile",-1)),W=C(()=>t("div",null,null,-1)),z={key:2,class:"wrapper"},J={class:"profile"},O={class:"profile-img-wrapper"},U=["src"],X={class:"profile-metadata-wrapper"},Y={class:"link-wrapper"},Z=R({__name:"ProfileView",setup(o){const L=q(),_=B(()=>Number(L.params.id)),{data:s,isLoading:x,isError:E,error:I}=D(_),{data:u,isLoading:P}=M(_);return(ee,oe)=>{var m,f,g;const n=v("RouterLink"),S=v("RouterView");return a(),d(F,null,[t("header",H,[r(n,{to:"/profile"},{default:c(()=>[l(i("<"))]),_:1}),Q,W]),e(x)?(a(),p(h,{key:0})):e(E)?(a(),p(b,{key:1,error:e(I)},null,8,["error"])):e(s)?(a(),d("div",z,[t("div",J,[t("div",O,[e(P)?(a(),p(h,{key:0})):e(u)?(a(),d("img",{key:1,src:e(u).message,alt:"dog"},null,8,U)):y("",!0)]),t("div",X,[t("h2",null,i(e(s).name)+" ("+i(e(s).username)+")",1),t("span",null,i(e(s).email),1),t("span",null,"Working in "+i(e(s).company.name),1)])]),t("div",Y,[r(n,{to:`/profile/${(m=e(s))==null?void 0:m.id}/album`,"active-class":"active"},{default:c(()=>[l("Go To Album")]),_:1},8,["to"]),r(n,{to:`/profile/${(f=e(s))==null?void 0:f.id}/todo`,"active-class":"active"},{default:c(()=>[l("Go To Todo")]),_:1},8,["to"]),r(n,{to:`/profile/${(g=e(s))==null?void 0:g.id}/post`,"active-class":"active"},{default:c(()=>[l("Go To Post")]),_:1},8,["to"])]),r(S)])):y("",!0)],64)}}});const ie=G(Z,[["__scopeId","data-v-76e019a7"]]);export{ie as default}; +import{a as b,L as h,_ as G}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js";import{p as k,a as N}from"./profile-eb2515ba.js";import{u as w,C as T,S as V}from"./constants-635cc42e.js";import{d as R,h as q,i as B,r as v,c as d,b as t,a as r,w as c,u as e,e as p,j as y,t as i,F,o as a,k as l,p as $,g as A}from"./index-778020de.js";function D(o){return w({queryKey:k.id(o),queryFn:()=>N.get(o.value),cacheTime:T,staleTime:V})}function K(){return fetch("https://dog.ceo/api/breeds/image/random").then(o=>o.json())}const j={get:K};function M(o){return w({queryKey:k.dog(o),queryFn:j.get,cacheTime:T,staleTime:V})}const C=o=>($("data-v-76e019a7"),o=o(),A(),o),H={class:"header"},Q=C(()=>t("span",null,"Profile",-1)),W=C(()=>t("div",null,null,-1)),z={key:2,class:"wrapper"},J={class:"profile"},O={class:"profile-img-wrapper"},U=["src"],X={class:"profile-metadata-wrapper"},Y={class:"link-wrapper"},Z=R({__name:"ProfileView",setup(o){const L=q(),_=B(()=>Number(L.params.id)),{data:s,isLoading:x,isError:E,error:I}=D(_),{data:u,isLoading:P}=M(_);return(ee,oe)=>{var m,f,g;const n=v("RouterLink"),S=v("RouterView");return a(),d(F,null,[t("header",H,[r(n,{to:"/profile"},{default:c(()=>[l(i("<"))]),_:1}),Q,W]),e(x)?(a(),p(h,{key:0})):e(E)?(a(),p(b,{key:1,error:e(I)},null,8,["error"])):e(s)?(a(),d("div",z,[t("div",J,[t("div",O,[e(P)?(a(),p(h,{key:0})):e(u)?(a(),d("img",{key:1,src:e(u).message,alt:"dog"},null,8,U)):y("",!0)]),t("div",X,[t("h2",null,i(e(s).name)+" ("+i(e(s).username)+")",1),t("span",null,i(e(s).email),1),t("span",null,"Working in "+i(e(s).company.name),1)])]),t("div",Y,[r(n,{to:`/profile/${(m=e(s))==null?void 0:m.id}/album`,"active-class":"active"},{default:c(()=>[l("Go To Album")]),_:1},8,["to"]),r(n,{to:`/profile/${(f=e(s))==null?void 0:f.id}/todo`,"active-class":"active"},{default:c(()=>[l("Go To Todo")]),_:1},8,["to"]),r(n,{to:`/profile/${(g=e(s))==null?void 0:g.id}/post`,"active-class":"active"},{default:c(()=>[l("Go To Post")]),_:1},8,["to"])]),r(S)])):y("",!0)],64)}}});const ie=G(Z,[["__scopeId","data-v-76e019a7"]]);export{ie as default}; diff --git a/assets/TodoListView-ca4ca47a.js b/assets/TodoListView-76397d39.js similarity index 92% rename from assets/TodoListView-ca4ca47a.js rename to assets/TodoListView-76397d39.js index 4cafe78..8053152 100644 --- a/assets/TodoListView-ca4ca47a.js +++ b/assets/TodoListView-76397d39.js @@ -1 +1 @@ -import{n as b,q as k,s as $,d as w,h as F,i as L,c as n,u as i,e as x,j as N,b as p,F as _,f as M,o,v as j,t as R}from"./index-0204c66f.js";import{Q as B,u as O,a as Q,L as C,_ as I}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js";class V extends B{constructor(e,s){super(e,s)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,s){super.setOptions({...e,behavior:b()},s)}getOptimisticResult(e){return e.behavior=b(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...s}={}){return this.fetch({...s,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...s}={}){return this.fetch({...s,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,s){var r,u,d,l,h,P;const{state:a}=e,f=super.createResult(e,s),{isFetching:g,isRefetching:c}=f,v=g&&((r=a.fetchMeta)==null||(u=r.fetchMore)==null?void 0:u.direction)==="forward",y=g&&((d=a.fetchMeta)==null||(l=d.fetchMore)==null?void 0:l.direction)==="backward";return{...f,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:k(s,(h=a.data)==null?void 0:h.pages),hasPreviousPage:$(s,(P=a.data)==null?void 0:P.pages),isFetchingNextPage:v,isFetchingPreviousPage:y,isRefetching:c&&!v&&!y}}}function T(t,e,s){return O(V,t,e,s)}const m={all:["todo"],user:{all:()=>[...m.all,"user"],id:t=>[...m.user.all(),t]},id:t=>[...m.all,t]};function q(t){return fetch(`https://jsonplaceholder.typicode.com/todos/${t}`).then(e=>e.json())}function E(){return fetch("https://jsonplaceholder.typicode.com/todos").then(t=>t.json())}function K(t){return fetch(`https://jsonplaceholder.typicode.com/users/${t}/todos`).then(e=>e.json())}const U={get:q,getAll:E,getFromUserId:K};function z(t){return T({queryKey:m.user.id(t),queryFn:()=>U.getFromUserId(t.value),getNextPageParam:()=>!0})}const A={key:2,class:"todo-wrapper"},D={class:"todo-list"},G=w({__name:"TodoListView",setup(t){const e=F(),s=L(()=>Number(e.params.id)),{data:r,isLoading:u,isError:d,error:l,fetchNextPage:h}=z(s);return(P,a)=>(o(),n(_,null,[i(u)?(o(),x(C,{key:0})):i(d)?(o(),x(Q,{key:1,error:i(l)},null,8,["error"])):N("",!0),i(r)?(o(),n("div",A,[p("ul",D,[(o(!0),n(_,null,M(i(r).pages,(f,g)=>(o(),n(_,{key:g},[(o(!0),n(_,null,M(f,c=>(o(),n("li",{key:c.id,class:"todo-element"},[p("div",{class:j({dot:!0,done:c.completed})},null,2),p("span",null,R(c.title),1)]))),128))],64))),128))]),p("button",{class:"load-button",onClick:a[0]||(a[0]=()=>i(h)())},"Load more")])):N("",!0)],64))}});const J=I(G,[["__scopeId","data-v-fdcb6cb6"]]);export{J as default}; +import{n as b,q as k,s as $,d as w,h as F,i as L,c as n,u as i,e as x,j as N,b as p,F as _,f as M,o,v as j,t as R}from"./index-778020de.js";import{Q as B,u as O,a as Q,L as C,_ as I}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js";class V extends B{constructor(e,s){super(e,s)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,s){super.setOptions({...e,behavior:b()},s)}getOptimisticResult(e){return e.behavior=b(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...s}={}){return this.fetch({...s,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...s}={}){return this.fetch({...s,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,s){var r,u,d,l,h,P;const{state:a}=e,f=super.createResult(e,s),{isFetching:g,isRefetching:c}=f,v=g&&((r=a.fetchMeta)==null||(u=r.fetchMore)==null?void 0:u.direction)==="forward",y=g&&((d=a.fetchMeta)==null||(l=d.fetchMore)==null?void 0:l.direction)==="backward";return{...f,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:k(s,(h=a.data)==null?void 0:h.pages),hasPreviousPage:$(s,(P=a.data)==null?void 0:P.pages),isFetchingNextPage:v,isFetchingPreviousPage:y,isRefetching:c&&!v&&!y}}}function T(t,e,s){return O(V,t,e,s)}const m={all:["todo"],user:{all:()=>[...m.all,"user"],id:t=>[...m.user.all(),t]},id:t=>[...m.all,t]};function q(t){return fetch(`https://jsonplaceholder.typicode.com/todos/${t}`).then(e=>e.json())}function E(){return fetch("https://jsonplaceholder.typicode.com/todos").then(t=>t.json())}function K(t){return fetch(`https://jsonplaceholder.typicode.com/users/${t}/todos`).then(e=>e.json())}const U={get:q,getAll:E,getFromUserId:K};function z(t){return T({queryKey:m.user.id(t),queryFn:()=>U.getFromUserId(t.value),getNextPageParam:()=>!0})}const A={key:2,class:"todo-wrapper"},D={class:"todo-list"},G=w({__name:"TodoListView",setup(t){const e=F(),s=L(()=>Number(e.params.id)),{data:r,isLoading:u,isError:d,error:l,fetchNextPage:h}=z(s);return(P,a)=>(o(),n(_,null,[i(u)?(o(),x(C,{key:0})):i(d)?(o(),x(Q,{key:1,error:i(l)},null,8,["error"])):N("",!0),i(r)?(o(),n("div",A,[p("ul",D,[(o(!0),n(_,null,M(i(r).pages,(f,g)=>(o(),n(_,{key:g},[(o(!0),n(_,null,M(f,c=>(o(),n("li",{key:c.id,class:"todo-element"},[p("div",{class:j({dot:!0,done:c.completed})},null,2),p("span",null,R(c.title),1)]))),128))],64))),128))]),p("button",{class:"load-button",onClick:a[0]||(a[0]=()=>i(h)())},"Load more")])):N("",!0)],64))}});const J=I(G,[["__scopeId","data-v-fdcb6cb6"]]);export{J as default}; diff --git a/assets/constants-99ec137a.js b/assets/constants-635cc42e.js similarity index 65% rename from assets/constants-99ec137a.js rename to assets/constants-635cc42e.js index 389a294..bcf63a4 100644 --- a/assets/constants-99ec137a.js +++ b/assets/constants-635cc42e.js @@ -1 +1 @@ -import{u,Q as t}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js";function n(e,s,r){return u(t,e,s,r)}const c=1e3*60*60*24,E=1e3*60*5;export{c as C,E as S,n as u}; +import{u,Q as t}from"./ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js";function n(e,s,r){return u(t,e,s,r)}const c=1e3*60*60*24,E=1e3*60*5;export{c as C,E as S,n as u}; diff --git a/assets/index-0204c66f.js b/assets/index-778020de.js similarity index 97% rename from assets/index-0204c66f.js rename to assets/index-778020de.js index 11b7020..bae6516 100644 --- a/assets/index-0204c66f.js +++ b/assets/index-778020de.js @@ -2,4 +2,4 @@ * vue-router v4.2.5 * (c) 2023 Eduardo San Martin Morote * @license MIT - */const yt=typeof window<"u";function Yu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const G=Object.assign;function Kn(e,t){const n={};for(const s in t){const r=t[s];n[s]=Te(r)?r.map(e):e(r)}return n}const Lt=()=>{},Te=Array.isArray,Gu=/\/$/,Ju=e=>e.replace(Gu,"");function Hn(e,t,n="/"){let s,r={},i="",o="";const l=t.indexOf("#");let u=t.indexOf("?");return l=0&&(u=-1),u>-1&&(s=t.slice(0,u),i=t.slice(u+1,l>-1?l:t.length),r=e(i)),l>-1&&(s=s||t.slice(0,l),o=t.slice(l,t.length)),s=tc(s??t,n),{fullPath:s+(i&&"?")+i+o,path:s,query:r,hash:o}}function Xu(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Cr(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Zu(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&xt(t.matched[s],n.matched[r])&&Yi(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function xt(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Yi(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!ec(e[n],t[n]))return!1;return!0}function ec(e,t){return Te(e)?Or(e,t):Te(t)?Or(t,e):e===t}function Or(e,t){return Te(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function tc(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let i=n.length-1,o,l;for(o=0;o1&&i--;else break;return n.slice(0,i).join("/")+"/"+s.slice(o-(o===s.length?1:0)).join("/")}var zt;(function(e){e.pop="pop",e.push="push"})(zt||(zt={}));var Kt;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Kt||(Kt={}));function nc(e){if(!e)if(yt){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Ju(e)}const sc=/^[^#]+#/;function rc(e,t){return e.replace(sc,"#")+t}function ic(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Tn=()=>({left:window.pageXOffset,top:window.pageYOffset});function oc(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=ic(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function xr(e,t){return(history.state?history.state.position-t:-1)+e}const os=new Map;function lc(e,t){os.set(e,t)}function uc(e){const t=os.get(e);return os.delete(e),t}let cc=()=>location.protocol+"//"+location.host;function Gi(e,t){const{pathname:n,search:s,hash:r}=t,i=e.indexOf("#");if(i>-1){let l=r.includes(e.slice(i))?e.slice(i).length:1,u=r.slice(l);return u[0]!=="/"&&(u="/"+u),Cr(u,"")}return Cr(n,e)+s+r}function ac(e,t,n,s){let r=[],i=[],o=null;const l=({state:g})=>{const m=Gi(e,location),P=n.value,R=t.value;let A=0;if(g){if(n.value=m,t.value=g,o&&o===P){o=null;return}A=R?g.position-R.position:0}else s(m);r.forEach(x=>{x(n.value,P,{delta:A,type:zt.pop,direction:A?A>0?Kt.forward:Kt.back:Kt.unknown})})};function u(){o=n.value}function f(g){r.push(g);const m=()=>{const P=r.indexOf(g);P>-1&&r.splice(P,1)};return i.push(m),m}function c(){const{history:g}=window;g.state&&g.replaceState(G({},g.state,{scroll:Tn()}),"")}function d(){for(const g of i)g();i=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",c)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",c,{passive:!0}),{pauseListeners:u,listen:f,destroy:d}}function Rr(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Tn():null}}function fc(e){const{history:t,location:n}=window,s={value:Gi(e,n)},r={value:t.state};r.value||i(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(u,f,c){const d=e.indexOf("#"),g=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+u:cc()+e+u;try{t[c?"replaceState":"pushState"](f,"",g),r.value=f}catch(m){console.error(m),n[c?"replace":"assign"](g)}}function o(u,f){const c=G({},t.state,Rr(r.value.back,u,r.value.forward,!0),f,{position:r.value.position});i(u,c,!0),s.value=u}function l(u,f){const c=G({},r.value,t.state,{forward:u,scroll:Tn()});i(c.current,c,!0);const d=G({},Rr(s.value,u,null),{position:c.position+1},f);i(u,d,!1),s.value=u}return{location:s,state:r,push:l,replace:o}}function hc(e){e=nc(e);const t=fc(e),n=ac(e,t.state,t.location,t.replace);function s(i,o=!0){o||n.pauseListeners(),history.go(i)}const r=G({location:"",base:e,go:s,createHref:rc.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function dc(e){return typeof e=="string"||e&&typeof e=="object"}function Ji(e){return typeof e=="string"||typeof e=="symbol"}const Ye={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Xi=Symbol("");var Ar;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Ar||(Ar={}));function Rt(e,t){return G(new Error,{type:e,[Xi]:!0},t)}function Ke(e,t){return e instanceof Error&&Xi in e&&(t==null||!!(e.type&t))}const Sr="[^/]+?",pc={sensitive:!1,strict:!1,start:!0,end:!0},gc=/[.+*?^${}()[\]/\\]/g;function mc(e,t){const n=G({},pc,t),s=[];let r=n.start?"^":"";const i=[];for(const f of e){const c=f.length?[]:[90];n.strict&&!f.length&&(r+="/");for(let d=0;dt.length?t.length===1&&t[0]===40+40?1:-1:0}function vc(e,t){let n=0;const s=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const bc={type:0,value:""},_c=/[a-zA-Z0-9_]/;function Ec(e){if(!e)return[[]];if(e==="/")return[[bc]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${n})/"${f}": ${m}`)}let n=0,s=n;const r=[];let i;function o(){i&&r.push(i),i=[]}let l=0,u,f="",c="";function d(){f&&(n===0?i.push({type:0,value:f}):n===1||n===2||n===3?(i.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:f,regexp:c,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),f="")}function g(){f+=u}for(;l{o(T)}:Lt}function o(c){if(Ji(c)){const d=s.get(c);d&&(s.delete(c),n.splice(n.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=n.indexOf(c);d>-1&&(n.splice(d,1),c.record.name&&s.delete(c.record.name),c.children.forEach(o),c.alias.forEach(o))}}function l(){return n}function u(c){let d=0;for(;d=0&&(c.record.path!==n[d].record.path||!Zi(c,n[d]));)d++;n.splice(d,0,c),c.record.name&&!Tr(c)&&s.set(c.record.name,c)}function f(c,d){let g,m={},P,R;if("name"in c&&c.name){if(g=s.get(c.name),!g)throw Rt(1,{location:c});R=g.record.name,m=G(Fr(d.params,g.keys.filter(T=>!T.optional).map(T=>T.name)),c.params&&Fr(c.params,g.keys.map(T=>T.name))),P=g.stringify(m)}else if("path"in c)P=c.path,g=n.find(T=>T.re.test(P)),g&&(m=g.parse(P),R=g.record.name);else{if(g=d.name?s.get(d.name):n.find(T=>T.re.test(d.path)),!g)throw Rt(1,{location:c,currentLocation:d});R=g.record.name,m=G({},d.params,c.params),P=g.stringify(m)}const A=[];let x=g;for(;x;)A.unshift(x.record),x=x.parent;return{name:R,path:P,params:m,matched:A,meta:xc(A)}}return e.forEach(c=>i(c)),{addRoute:i,resolve:f,removeRoute:o,getRoutes:l,getRecordMatcher:r}}function Fr(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Cc(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:Oc(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function Oc(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Tr(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function xc(e){return e.reduce((t,n)=>G(t,n.meta),{})}function Ir(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}function Zi(e,t){return t.children.some(n=>n===e||Zi(e,n))}const eo=/#/g,Rc=/&/g,Ac=/\//g,Sc=/=/g,Mc=/\?/g,to=/\+/g,Fc=/%5B/g,Tc=/%5D/g,no=/%5E/g,Ic=/%60/g,so=/%7B/g,Dc=/%7C/g,ro=/%7D/g,qc=/%20/g;function Is(e){return encodeURI(""+e).replace(Dc,"|").replace(Fc,"[").replace(Tc,"]")}function Uc(e){return Is(e).replace(so,"{").replace(ro,"}").replace(no,"^")}function ls(e){return Is(e).replace(to,"%2B").replace(qc,"+").replace(eo,"%23").replace(Rc,"%26").replace(Ic,"`").replace(so,"{").replace(ro,"}").replace(no,"^")}function Nc(e){return ls(e).replace(Sc,"%3D")}function Qc(e){return Is(e).replace(eo,"%23").replace(Mc,"%3F")}function jc(e){return e==null?"":Qc(e).replace(Ac,"%2F")}function mn(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function Lc(e){const t={};if(e===""||e==="?")return t;const s=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;ri&&ls(i)):[s&&ls(s)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function Kc(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=Te(s)?s.map(r=>r==null?null:""+r):s==null?s:""+s)}return t}const Hc=Symbol(""),qr=Symbol(""),Ds=Symbol(""),qs=Symbol(""),us=Symbol("");function Dt(){let e=[];function t(s){return e.push(s),()=>{const r=e.indexOf(s);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Xe(e,t,n,s,r){const i=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise((o,l)=>{const u=d=>{d===!1?l(Rt(4,{from:n,to:t})):d instanceof Error?l(d):dc(d)?l(Rt(2,{from:t,to:d})):(i&&s.enterCallbacks[r]===i&&typeof d=="function"&&i.push(d),o())},f=e.call(s&&s.instances[r],t,n,u);let c=Promise.resolve(f);e.length<3&&(c=c.then(u)),c.catch(d=>l(d))})}function kn(e,t,n,s){const r=[];for(const i of e)for(const o in i.components){let l=i.components[o];if(!(t!=="beforeRouteEnter"&&!i.instances[o]))if(kc(l)){const f=(l.__vccOpts||l)[t];f&&r.push(Xe(f,n,s,i,o))}else{let u=l();r.push(()=>u.then(f=>{if(!f)return Promise.reject(new Error(`Couldn't resolve component "${o}" at "${i.path}"`));const c=Yu(f)?f.default:f;i.components[o]=c;const g=(c.__vccOpts||c)[t];return g&&Xe(g,n,s,i,o)()}))}}return r}function kc(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ur(e){const t=Qe(Ds),n=Qe(qs),s=Ae(()=>t.resolve(et(e.to))),r=Ae(()=>{const{matched:u}=s.value,{length:f}=u,c=u[f-1],d=n.matched;if(!c||!d.length)return-1;const g=d.findIndex(xt.bind(null,c));if(g>-1)return g;const m=Nr(u[f-2]);return f>1&&Nr(c)===m&&d[d.length-1].path!==m?d.findIndex(xt.bind(null,u[f-2])):g}),i=Ae(()=>r.value>-1&&zc(n.params,s.value.params)),o=Ae(()=>r.value>-1&&r.value===n.matched.length-1&&Yi(n.params,s.value.params));function l(u={}){return Wc(u)?t[et(e.replace)?"replace":"push"](et(e.to)).catch(Lt):Promise.resolve()}return{route:s,href:Ae(()=>s.value.href),isActive:i,isExactActive:o,navigate:l}}const Bc=Rs({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Ur,setup(e,{slots:t}){const n=On(Ur(e)),{options:s}=Qe(Ds),r=Ae(()=>({[Qr(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Qr(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&t.default(n);return e.custom?i:Vi("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),$c=Bc;function Wc(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function zc(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!Te(r)||r.length!==s.length||s.some((i,o)=>i!==r[o]))return!1}return!0}function Nr(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Qr=(e,t,n)=>e??t??n,Vc=Rs({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Qe(us),r=Ae(()=>e.route||s.value),i=Qe(qr,0),o=Ae(()=>{let f=et(i);const{matched:c}=r.value;let d;for(;(d=c[f])&&!d.components;)f++;return f}),l=Ae(()=>r.value.matched[o.value]);on(qr,Ae(()=>o.value+1)),on(Hc,l),on(us,r);const u=vi();return sn(()=>[u.value,l.value,e.name],([f,c,d],[g,m,P])=>{c&&(c.instances[d]=f,m&&m!==c&&f&&f===g&&(c.leaveGuards.size||(c.leaveGuards=m.leaveGuards),c.updateGuards.size||(c.updateGuards=m.updateGuards))),f&&c&&(!m||!xt(c,m)||!g)&&(c.enterCallbacks[d]||[]).forEach(R=>R(f))},{flush:"post"}),()=>{const f=r.value,c=e.name,d=l.value,g=d&&d.components[c];if(!g)return jr(n.default,{Component:g,route:f});const m=d.props[c],P=m?m===!0?f.params:typeof m=="function"?m(f):m:null,A=Vi(g,G({},P,t,{onVnodeUnmounted:x=>{x.component.isUnmounted&&(d.instances[c]=null)},ref:u}));return jr(n.default,{Component:A,route:f})||A}}});function jr(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const io=Vc;function Yc(e){const t=Pc(e.routes,e),n=e.parseQuery||Lc,s=e.stringifyQuery||Dr,r=e.history,i=Dt(),o=Dt(),l=Dt(),u=il(Ye);let f=Ye;yt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Kn.bind(null,v=>""+v),d=Kn.bind(null,jc),g=Kn.bind(null,mn);function m(v,F){let O,D;return Ji(v)?(O=t.getRecordMatcher(v),D=F):D=v,t.addRoute(D,O)}function P(v){const F=t.getRecordMatcher(v);F&&t.removeRoute(F)}function R(){return t.getRoutes().map(v=>v.record)}function A(v){return!!t.getRecordMatcher(v)}function x(v,F){if(F=G({},F||u.value),typeof v=="string"){const p=Hn(n,v,F.path),y=t.resolve({path:p.path},F),b=r.createHref(p.fullPath);return G(p,y,{params:g(y.params),hash:mn(p.hash),redirectedFrom:void 0,href:b})}let O;if("path"in v)O=G({},v,{path:Hn(n,v.path,F.path).path});else{const p=G({},v.params);for(const y in p)p[y]==null&&delete p[y];O=G({},v,{params:d(p)}),F.params=d(F.params)}const D=t.resolve(O,F),Y=v.hash||"";D.params=c(g(D.params));const a=Xu(s,G({},v,{hash:Uc(Y),path:D.path})),h=r.createHref(a);return G({fullPath:a,hash:Y,query:s===Dr?Kc(v.query):v.query||{}},D,{redirectedFrom:void 0,href:h})}function T(v){return typeof v=="string"?Hn(n,v,u.value.path):G({},v)}function L(v,F){if(f!==v)return Rt(8,{from:F,to:v})}function M(v){return K(v)}function ee(v){return M(G(T(v),{replace:!0}))}function H(v){const F=v.matched[v.matched.length-1];if(F&&F.redirect){const{redirect:O}=F;let D=typeof O=="function"?O(v):O;return typeof D=="string"&&(D=D.includes("?")||D.includes("#")?D=T(D):{path:D},D.params={}),G({query:v.query,hash:v.hash,params:"path"in D?{}:v.params},D)}}function K(v,F){const O=f=x(v),D=u.value,Y=v.state,a=v.force,h=v.replace===!0,p=H(O);if(p)return K(G(T(p),{state:typeof p=="object"?G({},Y,p.state):Y,force:a,replace:h}),F||O);const y=O;y.redirectedFrom=F;let b;return!a&&Zu(s,D,O)&&(b=Rt(16,{to:y,from:D}),Ie(D,D,!0,!1)),(b?Promise.resolve(b):pe(y,D)).catch(_=>Ke(_)?Ke(_,2)?_:ze(_):V(_,y,D)).then(_=>{if(_){if(Ke(_,2))return K(G({replace:h},T(_.to),{state:typeof _.to=="object"?G({},Y,_.to.state):Y,force:a}),F||y)}else _=We(y,D,!0,h,Y);return Ee(y,D,_),_})}function $(v,F){const O=L(v,F);return O?Promise.reject(O):Promise.resolve()}function ue(v){const F=pt.values().next().value;return F&&typeof F.runWithContext=="function"?F.runWithContext(v):v()}function pe(v,F){let O;const[D,Y,a]=Gc(v,F);O=kn(D.reverse(),"beforeRouteLeave",v,F);for(const p of D)p.leaveGuards.forEach(y=>{O.push(Xe(y,v,F))});const h=$.bind(null,v,F);return O.push(h),ae(O).then(()=>{O=[];for(const p of i.list())O.push(Xe(p,v,F));return O.push(h),ae(O)}).then(()=>{O=kn(Y,"beforeRouteUpdate",v,F);for(const p of Y)p.updateGuards.forEach(y=>{O.push(Xe(y,v,F))});return O.push(h),ae(O)}).then(()=>{O=[];for(const p of a)if(p.beforeEnter)if(Te(p.beforeEnter))for(const y of p.beforeEnter)O.push(Xe(y,v,F));else O.push(Xe(p.beforeEnter,v,F));return O.push(h),ae(O)}).then(()=>(v.matched.forEach(p=>p.enterCallbacks={}),O=kn(a,"beforeRouteEnter",v,F),O.push(h),ae(O))).then(()=>{O=[];for(const p of o.list())O.push(Xe(p,v,F));return O.push(h),ae(O)}).catch(p=>Ke(p,8)?p:Promise.reject(p))}function Ee(v,F,O){l.list().forEach(D=>ue(()=>D(v,F,O)))}function We(v,F,O,D,Y){const a=L(v,F);if(a)return a;const h=F===Ye,p=yt?history.state:{};O&&(D||h?r.replace(v.fullPath,G({scroll:h&&p&&p.scroll},Y)):r.push(v.fullPath,Y)),u.value=v,Ie(v,F,O,h),ze()}let we;function Ft(){we||(we=r.listen((v,F,O)=>{if(!Vt.listening)return;const D=x(v),Y=H(D);if(Y){K(G(Y,{replace:!0}),D).catch(Lt);return}f=D;const a=u.value;yt&&lc(xr(a.fullPath,O.delta),Tn()),pe(D,a).catch(h=>Ke(h,12)?h:Ke(h,2)?(K(h.to,D).then(p=>{Ke(p,20)&&!O.delta&&O.type===zt.pop&&r.go(-1,!1)}).catch(Lt),Promise.reject()):(O.delta&&r.go(-O.delta,!1),V(h,D,a))).then(h=>{h=h||We(D,a,!1),h&&(O.delta&&!Ke(h,8)?r.go(-O.delta,!1):O.type===zt.pop&&Ke(h,20)&&r.go(-1,!1)),Ee(D,a,h)}).catch(Lt)}))}let ht=Dt(),oe=Dt(),X;function V(v,F,O){ze(v);const D=oe.list();return D.length?D.forEach(Y=>Y(v,F,O)):console.error(v),Promise.reject(v)}function Le(){return X&&u.value!==Ye?Promise.resolve():new Promise((v,F)=>{ht.add([v,F])})}function ze(v){return X||(X=!v,Ft(),ht.list().forEach(([F,O])=>v?O(v):F()),ht.reset()),v}function Ie(v,F,O,D){const{scrollBehavior:Y}=e;if(!yt||!Y)return Promise.resolve();const a=!O&&uc(xr(v.fullPath,0))||(D||!O)&&history.state&&history.state.scroll||null;return wi().then(()=>Y(v,F,a)).then(h=>h&&oc(h)).catch(h=>V(h,v,F))}const ge=v=>r.go(v);let dt;const pt=new Set,Vt={currentRoute:u,listening:!0,addRoute:m,removeRoute:P,hasRoute:A,getRoutes:R,resolve:x,options:e,push:M,replace:ee,go:ge,back:()=>ge(-1),forward:()=>ge(1),beforeEach:i.add,beforeResolve:o.add,afterEach:l.add,onError:oe.add,isReady:Le,install(v){const F=this;v.component("RouterLink",$c),v.component("RouterView",io),v.config.globalProperties.$router=F,Object.defineProperty(v.config.globalProperties,"$route",{enumerable:!0,get:()=>et(u)}),yt&&!dt&&u.value===Ye&&(dt=!0,M(r.location).catch(Y=>{}));const O={};for(const Y in Ye)Object.defineProperty(O,Y,{get:()=>u.value[Y],enumerable:!0});v.provide(Ds,F),v.provide(qs,hi(O)),v.provide(us,u);const D=v.unmount;pt.add(v),v.unmount=function(){pt.delete(v),pt.size<1&&(f=Ye,we&&we(),we=null,u.value=Ye,dt=!1,X=!1),D()}}};function ae(v){return v.reduce((F,O)=>F.then(()=>ue(O)),Promise.resolve())}return Vt}function Gc(e,t){const n=[],s=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let o=0;oxt(f,l))?s.push(l):n.push(l));const u=e.matched[o];u&&(t.matched.find(f=>xt(f,u))||r.push(u))}return[n,s,r]}function ba(){return Qe(qs)}const Jc=Rs({__name:"App",setup(e){return(t,n)=>(Ki(),ki(et(io)))}}),Xc="modulepreload",Zc=function(e){return"/"+e},Lr={},qt=function(t,n,s){if(!n||n.length===0)return t();const r=document.getElementsByTagName("link");return Promise.all(n.map(i=>{if(i=Zc(i),i in Lr)return;Lr[i]=!0;const o=i.endsWith(".css"),l=o?'[rel="stylesheet"]':"";if(!!s)for(let c=r.length-1;c>=0;c--){const d=r[c];if(d.href===i&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${l}`))return;const f=document.createElement("link");if(f.rel=o?"stylesheet":Xc,o||(f.as="script",f.crossOrigin=""),f.href=i,document.head.appendChild(f),o)return new Promise((c,d)=>{f.addEventListener("load",c),f.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t()).catch(i=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i})},ea=Yc({history:hc("/"),routes:[{path:"/",redirect:"/profile"},{path:"/profile",component:()=>qt(()=>import("./ProfileListView-59e0a4c7.js"),["assets/ProfileListView-59e0a4c7.js","assets/profile-eb2515ba.js","assets/constants-99ec137a.js","assets/ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js","assets/ErrorComponent-6b00240c.css","assets/ProfileListView-df482a93.css"])},{path:"/profile/:id",component:()=>qt(()=>import("./ProfileView-2cfe8d57.js"),["assets/ProfileView-2cfe8d57.js","assets/ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js","assets/ErrorComponent-6b00240c.css","assets/profile-eb2515ba.js","assets/constants-99ec137a.js","assets/ProfileView-34df1f5e.css"]),children:[{path:"album",component:()=>qt(()=>import("./AlbumListView-b17c0ee8.js"),["assets/AlbumListView-b17c0ee8.js","assets/PaginationComponent-fb63cb18.js","assets/ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js","assets/ErrorComponent-6b00240c.css","assets/PaginationComponent-65249885.css","assets/constants-99ec137a.js","assets/AlbumListView-787e3161.css"])},{path:"todo",component:()=>qt(()=>import("./TodoListView-ca4ca47a.js"),["assets/TodoListView-ca4ca47a.js","assets/ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js","assets/ErrorComponent-6b00240c.css","assets/TodoListView-cc794562.css"])},{path:"post",component:()=>qt(()=>import("./PostListView-edf2fddb.js"),["assets/PostListView-edf2fddb.js","assets/constants-99ec137a.js","assets/ErrorComponent.vue_vue_type_script_setup_true_lang-a1b8f0de.js","assets/ErrorComponent-6b00240c.css","assets/PaginationComponent-fb63cb18.js","assets/PaginationComponent-65249885.css","assets/PostListView-4102934c.css"])}]}]}),Us=Ku(Jc);Us.use(ea);Us.use(Vu);Us.mount("#app");export{lo as A,uo as B,$n as C,as as D,ao as E,ke as F,In as G,de as H,Qe as I,ma as J,Bu as K,On as L,ya as M,va as N,ca as O,di as P,Oe as Q,q as R,yn as S,ua as T,_e as a,$i as b,pa as c,Rs as d,ki as e,da as f,fa as g,ba as h,Ae as i,ga as j,ou as k,vi as l,sn as m,_o as n,Ki as o,aa as p,ra as q,ha as r,ia as s,la as t,et as u,vs as v,vl as w,ta as x,xe as y,vn as z}; + */const yt=typeof window<"u";function Yu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const G=Object.assign;function Kn(e,t){const n={};for(const s in t){const r=t[s];n[s]=Te(r)?r.map(e):e(r)}return n}const Lt=()=>{},Te=Array.isArray,Gu=/\/$/,Ju=e=>e.replace(Gu,"");function Hn(e,t,n="/"){let s,r={},i="",o="";const l=t.indexOf("#");let u=t.indexOf("?");return l=0&&(u=-1),u>-1&&(s=t.slice(0,u),i=t.slice(u+1,l>-1?l:t.length),r=e(i)),l>-1&&(s=s||t.slice(0,l),o=t.slice(l,t.length)),s=tc(s??t,n),{fullPath:s+(i&&"?")+i+o,path:s,query:r,hash:o}}function Xu(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Cr(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Zu(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&xt(t.matched[s],n.matched[r])&&Yi(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function xt(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Yi(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!ec(e[n],t[n]))return!1;return!0}function ec(e,t){return Te(e)?Or(e,t):Te(t)?Or(t,e):e===t}function Or(e,t){return Te(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function tc(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let i=n.length-1,o,l;for(o=0;o1&&i--;else break;return n.slice(0,i).join("/")+"/"+s.slice(o-(o===s.length?1:0)).join("/")}var zt;(function(e){e.pop="pop",e.push="push"})(zt||(zt={}));var Kt;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Kt||(Kt={}));function nc(e){if(!e)if(yt){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Ju(e)}const sc=/^[^#]+#/;function rc(e,t){return e.replace(sc,"#")+t}function ic(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Tn=()=>({left:window.pageXOffset,top:window.pageYOffset});function oc(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=ic(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function xr(e,t){return(history.state?history.state.position-t:-1)+e}const os=new Map;function lc(e,t){os.set(e,t)}function uc(e){const t=os.get(e);return os.delete(e),t}let cc=()=>location.protocol+"//"+location.host;function Gi(e,t){const{pathname:n,search:s,hash:r}=t,i=e.indexOf("#");if(i>-1){let l=r.includes(e.slice(i))?e.slice(i).length:1,u=r.slice(l);return u[0]!=="/"&&(u="/"+u),Cr(u,"")}return Cr(n,e)+s+r}function ac(e,t,n,s){let r=[],i=[],o=null;const l=({state:g})=>{const m=Gi(e,location),P=n.value,R=t.value;let A=0;if(g){if(n.value=m,t.value=g,o&&o===P){o=null;return}A=R?g.position-R.position:0}else s(m);r.forEach(x=>{x(n.value,P,{delta:A,type:zt.pop,direction:A?A>0?Kt.forward:Kt.back:Kt.unknown})})};function u(){o=n.value}function f(g){r.push(g);const m=()=>{const P=r.indexOf(g);P>-1&&r.splice(P,1)};return i.push(m),m}function c(){const{history:g}=window;g.state&&g.replaceState(G({},g.state,{scroll:Tn()}),"")}function d(){for(const g of i)g();i=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",c)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",c,{passive:!0}),{pauseListeners:u,listen:f,destroy:d}}function Rr(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Tn():null}}function fc(e){const{history:t,location:n}=window,s={value:Gi(e,n)},r={value:t.state};r.value||i(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(u,f,c){const d=e.indexOf("#"),g=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+u:cc()+e+u;try{t[c?"replaceState":"pushState"](f,"",g),r.value=f}catch(m){console.error(m),n[c?"replace":"assign"](g)}}function o(u,f){const c=G({},t.state,Rr(r.value.back,u,r.value.forward,!0),f,{position:r.value.position});i(u,c,!0),s.value=u}function l(u,f){const c=G({},r.value,t.state,{forward:u,scroll:Tn()});i(c.current,c,!0);const d=G({},Rr(s.value,u,null),{position:c.position+1},f);i(u,d,!1),s.value=u}return{location:s,state:r,push:l,replace:o}}function hc(e){e=nc(e);const t=fc(e),n=ac(e,t.state,t.location,t.replace);function s(i,o=!0){o||n.pauseListeners(),history.go(i)}const r=G({location:"",base:e,go:s,createHref:rc.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function dc(e){return typeof e=="string"||e&&typeof e=="object"}function Ji(e){return typeof e=="string"||typeof e=="symbol"}const Ye={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Xi=Symbol("");var Ar;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Ar||(Ar={}));function Rt(e,t){return G(new Error,{type:e,[Xi]:!0},t)}function Ke(e,t){return e instanceof Error&&Xi in e&&(t==null||!!(e.type&t))}const Sr="[^/]+?",pc={sensitive:!1,strict:!1,start:!0,end:!0},gc=/[.+*?^${}()[\]/\\]/g;function mc(e,t){const n=G({},pc,t),s=[];let r=n.start?"^":"";const i=[];for(const f of e){const c=f.length?[]:[90];n.strict&&!f.length&&(r+="/");for(let d=0;dt.length?t.length===1&&t[0]===40+40?1:-1:0}function vc(e,t){let n=0;const s=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const bc={type:0,value:""},_c=/[a-zA-Z0-9_]/;function Ec(e){if(!e)return[[]];if(e==="/")return[[bc]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${n})/"${f}": ${m}`)}let n=0,s=n;const r=[];let i;function o(){i&&r.push(i),i=[]}let l=0,u,f="",c="";function d(){f&&(n===0?i.push({type:0,value:f}):n===1||n===2||n===3?(i.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:f,regexp:c,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),f="")}function g(){f+=u}for(;l{o(T)}:Lt}function o(c){if(Ji(c)){const d=s.get(c);d&&(s.delete(c),n.splice(n.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=n.indexOf(c);d>-1&&(n.splice(d,1),c.record.name&&s.delete(c.record.name),c.children.forEach(o),c.alias.forEach(o))}}function l(){return n}function u(c){let d=0;for(;d=0&&(c.record.path!==n[d].record.path||!Zi(c,n[d]));)d++;n.splice(d,0,c),c.record.name&&!Tr(c)&&s.set(c.record.name,c)}function f(c,d){let g,m={},P,R;if("name"in c&&c.name){if(g=s.get(c.name),!g)throw Rt(1,{location:c});R=g.record.name,m=G(Fr(d.params,g.keys.filter(T=>!T.optional).map(T=>T.name)),c.params&&Fr(c.params,g.keys.map(T=>T.name))),P=g.stringify(m)}else if("path"in c)P=c.path,g=n.find(T=>T.re.test(P)),g&&(m=g.parse(P),R=g.record.name);else{if(g=d.name?s.get(d.name):n.find(T=>T.re.test(d.path)),!g)throw Rt(1,{location:c,currentLocation:d});R=g.record.name,m=G({},d.params,c.params),P=g.stringify(m)}const A=[];let x=g;for(;x;)A.unshift(x.record),x=x.parent;return{name:R,path:P,params:m,matched:A,meta:xc(A)}}return e.forEach(c=>i(c)),{addRoute:i,resolve:f,removeRoute:o,getRoutes:l,getRecordMatcher:r}}function Fr(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Cc(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:Oc(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function Oc(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Tr(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function xc(e){return e.reduce((t,n)=>G(t,n.meta),{})}function Ir(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}function Zi(e,t){return t.children.some(n=>n===e||Zi(e,n))}const eo=/#/g,Rc=/&/g,Ac=/\//g,Sc=/=/g,Mc=/\?/g,to=/\+/g,Fc=/%5B/g,Tc=/%5D/g,no=/%5E/g,Ic=/%60/g,so=/%7B/g,Dc=/%7C/g,ro=/%7D/g,qc=/%20/g;function Is(e){return encodeURI(""+e).replace(Dc,"|").replace(Fc,"[").replace(Tc,"]")}function Uc(e){return Is(e).replace(so,"{").replace(ro,"}").replace(no,"^")}function ls(e){return Is(e).replace(to,"%2B").replace(qc,"+").replace(eo,"%23").replace(Rc,"%26").replace(Ic,"`").replace(so,"{").replace(ro,"}").replace(no,"^")}function Nc(e){return ls(e).replace(Sc,"%3D")}function Qc(e){return Is(e).replace(eo,"%23").replace(Mc,"%3F")}function jc(e){return e==null?"":Qc(e).replace(Ac,"%2F")}function mn(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function Lc(e){const t={};if(e===""||e==="?")return t;const s=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;ri&&ls(i)):[s&&ls(s)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function Kc(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=Te(s)?s.map(r=>r==null?null:""+r):s==null?s:""+s)}return t}const Hc=Symbol(""),qr=Symbol(""),Ds=Symbol(""),qs=Symbol(""),us=Symbol("");function Dt(){let e=[];function t(s){return e.push(s),()=>{const r=e.indexOf(s);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Xe(e,t,n,s,r){const i=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise((o,l)=>{const u=d=>{d===!1?l(Rt(4,{from:n,to:t})):d instanceof Error?l(d):dc(d)?l(Rt(2,{from:t,to:d})):(i&&s.enterCallbacks[r]===i&&typeof d=="function"&&i.push(d),o())},f=e.call(s&&s.instances[r],t,n,u);let c=Promise.resolve(f);e.length<3&&(c=c.then(u)),c.catch(d=>l(d))})}function kn(e,t,n,s){const r=[];for(const i of e)for(const o in i.components){let l=i.components[o];if(!(t!=="beforeRouteEnter"&&!i.instances[o]))if(kc(l)){const f=(l.__vccOpts||l)[t];f&&r.push(Xe(f,n,s,i,o))}else{let u=l();r.push(()=>u.then(f=>{if(!f)return Promise.reject(new Error(`Couldn't resolve component "${o}" at "${i.path}"`));const c=Yu(f)?f.default:f;i.components[o]=c;const g=(c.__vccOpts||c)[t];return g&&Xe(g,n,s,i,o)()}))}}return r}function kc(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ur(e){const t=Qe(Ds),n=Qe(qs),s=Ae(()=>t.resolve(et(e.to))),r=Ae(()=>{const{matched:u}=s.value,{length:f}=u,c=u[f-1],d=n.matched;if(!c||!d.length)return-1;const g=d.findIndex(xt.bind(null,c));if(g>-1)return g;const m=Nr(u[f-2]);return f>1&&Nr(c)===m&&d[d.length-1].path!==m?d.findIndex(xt.bind(null,u[f-2])):g}),i=Ae(()=>r.value>-1&&zc(n.params,s.value.params)),o=Ae(()=>r.value>-1&&r.value===n.matched.length-1&&Yi(n.params,s.value.params));function l(u={}){return Wc(u)?t[et(e.replace)?"replace":"push"](et(e.to)).catch(Lt):Promise.resolve()}return{route:s,href:Ae(()=>s.value.href),isActive:i,isExactActive:o,navigate:l}}const Bc=Rs({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Ur,setup(e,{slots:t}){const n=On(Ur(e)),{options:s}=Qe(Ds),r=Ae(()=>({[Qr(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Qr(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&t.default(n);return e.custom?i:Vi("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),$c=Bc;function Wc(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function zc(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!Te(r)||r.length!==s.length||s.some((i,o)=>i!==r[o]))return!1}return!0}function Nr(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Qr=(e,t,n)=>e??t??n,Vc=Rs({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Qe(us),r=Ae(()=>e.route||s.value),i=Qe(qr,0),o=Ae(()=>{let f=et(i);const{matched:c}=r.value;let d;for(;(d=c[f])&&!d.components;)f++;return f}),l=Ae(()=>r.value.matched[o.value]);on(qr,Ae(()=>o.value+1)),on(Hc,l),on(us,r);const u=vi();return sn(()=>[u.value,l.value,e.name],([f,c,d],[g,m,P])=>{c&&(c.instances[d]=f,m&&m!==c&&f&&f===g&&(c.leaveGuards.size||(c.leaveGuards=m.leaveGuards),c.updateGuards.size||(c.updateGuards=m.updateGuards))),f&&c&&(!m||!xt(c,m)||!g)&&(c.enterCallbacks[d]||[]).forEach(R=>R(f))},{flush:"post"}),()=>{const f=r.value,c=e.name,d=l.value,g=d&&d.components[c];if(!g)return jr(n.default,{Component:g,route:f});const m=d.props[c],P=m?m===!0?f.params:typeof m=="function"?m(f):m:null,A=Vi(g,G({},P,t,{onVnodeUnmounted:x=>{x.component.isUnmounted&&(d.instances[c]=null)},ref:u}));return jr(n.default,{Component:A,route:f})||A}}});function jr(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const io=Vc;function Yc(e){const t=Pc(e.routes,e),n=e.parseQuery||Lc,s=e.stringifyQuery||Dr,r=e.history,i=Dt(),o=Dt(),l=Dt(),u=il(Ye);let f=Ye;yt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Kn.bind(null,v=>""+v),d=Kn.bind(null,jc),g=Kn.bind(null,mn);function m(v,F){let O,D;return Ji(v)?(O=t.getRecordMatcher(v),D=F):D=v,t.addRoute(D,O)}function P(v){const F=t.getRecordMatcher(v);F&&t.removeRoute(F)}function R(){return t.getRoutes().map(v=>v.record)}function A(v){return!!t.getRecordMatcher(v)}function x(v,F){if(F=G({},F||u.value),typeof v=="string"){const p=Hn(n,v,F.path),y=t.resolve({path:p.path},F),b=r.createHref(p.fullPath);return G(p,y,{params:g(y.params),hash:mn(p.hash),redirectedFrom:void 0,href:b})}let O;if("path"in v)O=G({},v,{path:Hn(n,v.path,F.path).path});else{const p=G({},v.params);for(const y in p)p[y]==null&&delete p[y];O=G({},v,{params:d(p)}),F.params=d(F.params)}const D=t.resolve(O,F),Y=v.hash||"";D.params=c(g(D.params));const a=Xu(s,G({},v,{hash:Uc(Y),path:D.path})),h=r.createHref(a);return G({fullPath:a,hash:Y,query:s===Dr?Kc(v.query):v.query||{}},D,{redirectedFrom:void 0,href:h})}function T(v){return typeof v=="string"?Hn(n,v,u.value.path):G({},v)}function L(v,F){if(f!==v)return Rt(8,{from:F,to:v})}function M(v){return K(v)}function ee(v){return M(G(T(v),{replace:!0}))}function H(v){const F=v.matched[v.matched.length-1];if(F&&F.redirect){const{redirect:O}=F;let D=typeof O=="function"?O(v):O;return typeof D=="string"&&(D=D.includes("?")||D.includes("#")?D=T(D):{path:D},D.params={}),G({query:v.query,hash:v.hash,params:"path"in D?{}:v.params},D)}}function K(v,F){const O=f=x(v),D=u.value,Y=v.state,a=v.force,h=v.replace===!0,p=H(O);if(p)return K(G(T(p),{state:typeof p=="object"?G({},Y,p.state):Y,force:a,replace:h}),F||O);const y=O;y.redirectedFrom=F;let b;return!a&&Zu(s,D,O)&&(b=Rt(16,{to:y,from:D}),Ie(D,D,!0,!1)),(b?Promise.resolve(b):pe(y,D)).catch(_=>Ke(_)?Ke(_,2)?_:ze(_):V(_,y,D)).then(_=>{if(_){if(Ke(_,2))return K(G({replace:h},T(_.to),{state:typeof _.to=="object"?G({},Y,_.to.state):Y,force:a}),F||y)}else _=We(y,D,!0,h,Y);return Ee(y,D,_),_})}function $(v,F){const O=L(v,F);return O?Promise.reject(O):Promise.resolve()}function ue(v){const F=pt.values().next().value;return F&&typeof F.runWithContext=="function"?F.runWithContext(v):v()}function pe(v,F){let O;const[D,Y,a]=Gc(v,F);O=kn(D.reverse(),"beforeRouteLeave",v,F);for(const p of D)p.leaveGuards.forEach(y=>{O.push(Xe(y,v,F))});const h=$.bind(null,v,F);return O.push(h),ae(O).then(()=>{O=[];for(const p of i.list())O.push(Xe(p,v,F));return O.push(h),ae(O)}).then(()=>{O=kn(Y,"beforeRouteUpdate",v,F);for(const p of Y)p.updateGuards.forEach(y=>{O.push(Xe(y,v,F))});return O.push(h),ae(O)}).then(()=>{O=[];for(const p of a)if(p.beforeEnter)if(Te(p.beforeEnter))for(const y of p.beforeEnter)O.push(Xe(y,v,F));else O.push(Xe(p.beforeEnter,v,F));return O.push(h),ae(O)}).then(()=>(v.matched.forEach(p=>p.enterCallbacks={}),O=kn(a,"beforeRouteEnter",v,F),O.push(h),ae(O))).then(()=>{O=[];for(const p of o.list())O.push(Xe(p,v,F));return O.push(h),ae(O)}).catch(p=>Ke(p,8)?p:Promise.reject(p))}function Ee(v,F,O){l.list().forEach(D=>ue(()=>D(v,F,O)))}function We(v,F,O,D,Y){const a=L(v,F);if(a)return a;const h=F===Ye,p=yt?history.state:{};O&&(D||h?r.replace(v.fullPath,G({scroll:h&&p&&p.scroll},Y)):r.push(v.fullPath,Y)),u.value=v,Ie(v,F,O,h),ze()}let we;function Ft(){we||(we=r.listen((v,F,O)=>{if(!Vt.listening)return;const D=x(v),Y=H(D);if(Y){K(G(Y,{replace:!0}),D).catch(Lt);return}f=D;const a=u.value;yt&&lc(xr(a.fullPath,O.delta),Tn()),pe(D,a).catch(h=>Ke(h,12)?h:Ke(h,2)?(K(h.to,D).then(p=>{Ke(p,20)&&!O.delta&&O.type===zt.pop&&r.go(-1,!1)}).catch(Lt),Promise.reject()):(O.delta&&r.go(-O.delta,!1),V(h,D,a))).then(h=>{h=h||We(D,a,!1),h&&(O.delta&&!Ke(h,8)?r.go(-O.delta,!1):O.type===zt.pop&&Ke(h,20)&&r.go(-1,!1)),Ee(D,a,h)}).catch(Lt)}))}let ht=Dt(),oe=Dt(),X;function V(v,F,O){ze(v);const D=oe.list();return D.length?D.forEach(Y=>Y(v,F,O)):console.error(v),Promise.reject(v)}function Le(){return X&&u.value!==Ye?Promise.resolve():new Promise((v,F)=>{ht.add([v,F])})}function ze(v){return X||(X=!v,Ft(),ht.list().forEach(([F,O])=>v?O(v):F()),ht.reset()),v}function Ie(v,F,O,D){const{scrollBehavior:Y}=e;if(!yt||!Y)return Promise.resolve();const a=!O&&uc(xr(v.fullPath,0))||(D||!O)&&history.state&&history.state.scroll||null;return wi().then(()=>Y(v,F,a)).then(h=>h&&oc(h)).catch(h=>V(h,v,F))}const ge=v=>r.go(v);let dt;const pt=new Set,Vt={currentRoute:u,listening:!0,addRoute:m,removeRoute:P,hasRoute:A,getRoutes:R,resolve:x,options:e,push:M,replace:ee,go:ge,back:()=>ge(-1),forward:()=>ge(1),beforeEach:i.add,beforeResolve:o.add,afterEach:l.add,onError:oe.add,isReady:Le,install(v){const F=this;v.component("RouterLink",$c),v.component("RouterView",io),v.config.globalProperties.$router=F,Object.defineProperty(v.config.globalProperties,"$route",{enumerable:!0,get:()=>et(u)}),yt&&!dt&&u.value===Ye&&(dt=!0,M(r.location).catch(Y=>{}));const O={};for(const Y in Ye)Object.defineProperty(O,Y,{get:()=>u.value[Y],enumerable:!0});v.provide(Ds,F),v.provide(qs,hi(O)),v.provide(us,u);const D=v.unmount;pt.add(v),v.unmount=function(){pt.delete(v),pt.size<1&&(f=Ye,we&&we(),we=null,u.value=Ye,dt=!1,X=!1),D()}}};function ae(v){return v.reduce((F,O)=>F.then(()=>ue(O)),Promise.resolve())}return Vt}function Gc(e,t){const n=[],s=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let o=0;oxt(f,l))?s.push(l):n.push(l));const u=e.matched[o];u&&(t.matched.find(f=>xt(f,u))||r.push(u))}return[n,s,r]}function ba(){return Qe(qs)}const Jc=Rs({__name:"App",setup(e){return(t,n)=>(Ki(),ki(et(io)))}}),Xc="modulepreload",Zc=function(e){return"/vue-query-test/"+e},Lr={},qt=function(t,n,s){if(!n||n.length===0)return t();const r=document.getElementsByTagName("link");return Promise.all(n.map(i=>{if(i=Zc(i),i in Lr)return;Lr[i]=!0;const o=i.endsWith(".css"),l=o?'[rel="stylesheet"]':"";if(!!s)for(let c=r.length-1;c>=0;c--){const d=r[c];if(d.href===i&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${l}`))return;const f=document.createElement("link");if(f.rel=o?"stylesheet":Xc,o||(f.as="script",f.crossOrigin=""),f.href=i,document.head.appendChild(f),o)return new Promise((c,d)=>{f.addEventListener("load",c),f.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t()).catch(i=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i})},ea=Yc({history:hc("/vue-query-test/"),routes:[{path:"/",redirect:"/profile"},{path:"/profile",component:()=>qt(()=>import("./ProfileListView-f318d6f6.js"),["assets/ProfileListView-f318d6f6.js","assets/profile-eb2515ba.js","assets/constants-635cc42e.js","assets/ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js","assets/ErrorComponent-6b00240c.css","assets/ProfileListView-df482a93.css"])},{path:"/profile/:id",component:()=>qt(()=>import("./ProfileView-913bd9ab.js"),["assets/ProfileView-913bd9ab.js","assets/ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js","assets/ErrorComponent-6b00240c.css","assets/profile-eb2515ba.js","assets/constants-635cc42e.js","assets/ProfileView-34df1f5e.css"]),children:[{path:"album",component:()=>qt(()=>import("./AlbumListView-80183b1b.js"),["assets/AlbumListView-80183b1b.js","assets/PaginationComponent-e4d19a62.js","assets/ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js","assets/ErrorComponent-6b00240c.css","assets/PaginationComponent-65249885.css","assets/constants-635cc42e.js","assets/AlbumListView-787e3161.css"])},{path:"todo",component:()=>qt(()=>import("./TodoListView-76397d39.js"),["assets/TodoListView-76397d39.js","assets/ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js","assets/ErrorComponent-6b00240c.css","assets/TodoListView-cc794562.css"])},{path:"post",component:()=>qt(()=>import("./PostListView-6c5f9623.js"),["assets/PostListView-6c5f9623.js","assets/constants-635cc42e.js","assets/ErrorComponent.vue_vue_type_script_setup_true_lang-f57c9f2d.js","assets/ErrorComponent-6b00240c.css","assets/PaginationComponent-e4d19a62.js","assets/PaginationComponent-65249885.css","assets/PostListView-4102934c.css"])}]}]}),Us=Ku(Jc);Us.use(ea);Us.use(Vu);Us.mount("#app");export{lo as A,uo as B,$n as C,as as D,ao as E,ke as F,In as G,de as H,Qe as I,ma as J,Bu as K,On as L,ya as M,va as N,ca as O,di as P,Oe as Q,q as R,yn as S,ua as T,_e as a,$i as b,pa as c,Rs as d,ki as e,da as f,fa as g,ba as h,Ae as i,ga as j,ou as k,vi as l,sn as m,_o as n,Ki as o,aa as p,ra as q,ha as r,ia as s,la as t,et as u,vs as v,vl as w,ta as x,xe as y,vn as z}; diff --git a/index.html b/index.html index cb9f5ff..6712b40 100644 --- a/index.html +++ b/index.html @@ -2,11 +2,11 @@ - + Vite App - - + +