diff --git a/project/api/views.py b/project/api/views.py index 885f9fc..b918cda 100644 --- a/project/api/views.py +++ b/project/api/views.py @@ -72,7 +72,7 @@ class AuthViewSet(viewsets.ViewSet): return Response(data = None, content_type = 'application/json') try: decode = jwt.decode(token, private_key, algorithms= ["HS256"]) - except jwt.ExpiredSignature: + except jwt.ExpiredSignatureError: raise JWTExpired user = User.objects.filter(id = decode.get('user_id')).values().first() diff --git a/project/dist/assets/index-0c98eb67.js b/project/dist/assets/index-0c98eb67.js deleted file mode 100644 index 281e3f6..0000000 --- a/project/dist/assets/index-0c98eb67.js +++ /dev/null @@ -1,8 +0,0 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function o(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function A(){}function W(t,e){for(const n in e)t[n]=e[n];return t}function Ne(t){return t()}function de(){return Object.create(null)}function it(t){t.forEach(Ne)}function Zt(t){return typeof t=="function"}function q(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Tt;function me(t,e){return Tt||(Tt=document.createElement("a")),Tt.href=e,t===Tt.href}function dn(t){return Object.keys(t).length===0}function te(t,...e){if(t==null)return A;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function gt(t){let e;return te(t,n=>e=n)(),e}function x(t,e,n){t.$$.on_destroy.push(te(e,n))}function ee(t,e,n,o){if(t){const r=Me(t,e,n,o);return t[0](r)}}function Me(t,e,n,o){return t[1]&&o?W(n.ctx.slice(),t[1](o(e))):n.ctx}function ne(t,e,n,o){if(t[2]&&o){const r=t[2](o(n));if(e.dirty===void 0)return r;if(typeof r=="object"){const s=[],i=Math.max(e.dirty.length,r.length);for(let c=0;c32){const e=[],n=t.ctx.length/32;for(let o=0;ot.removeEventListener(e,n,o)}function Ft(t){return function(e){return e.preventDefault(),t.call(this,e)}}function z(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const pn=["width","height"];function bt(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const o in e)e[o]==null?t.removeAttribute(o):o==="style"?t.style.cssText=e[o]:o==="__value"?t.value=t[o]=e[o]:n[o]&&n[o].set&&pn.indexOf(o)===-1?t[o]=e[o]:z(t,o,e[o])}function _n(t){return Array.from(t.childNodes)}function ot(t,e){e=""+e,t.data!==e&&(t.data=e)}function gn(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function bn(t,e,n){~mn.indexOf(n)?gn(t,e):ot(t,e)}function Mt(t,e){t.value=e??""}function yn(t,e,n,o){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,o?"important":"")}function vn(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,o,e),r}function Ht(t,e){return new t(e)}let $t;function wt(t){$t=t}function Et(){if(!$t)throw new Error("Function called outside component initialization");return $t}function kn(t){Et().$$.on_mount.push(t)}function wn(t){Et().$$.on_destroy.push(t)}function Sn(){const t=Et();return(e,n,{cancelable:o=!1}={})=>{const r=t.$$.callbacks[e];if(r){const s=vn(e,n,{cancelable:o});return r.slice().forEach(i=>{i.call(t,s)}),!s.defaultPrevented}return!0}}function St(t,e){return Et().$$.context.set(t,e),e}function rt(t){return Et().$$.context.get(t)}const ht=[],he=[];let _t=[];const pe=[],De=Promise.resolve();let Qt=!1;function je(){Qt||(Qt=!0,De.then(Fe))}function $n(){return je(),De}function Vt(t){_t.push(t)}const zt=new Set;let dt=0;function Fe(){if(dt!==0)return;const t=$t;do{try{for(;dtt.indexOf(o)===-1?e.push(o):n.push(o)),n.forEach(o=>o()),_t=e}const Ut=new Set;let ut;function Rt(){ut={r:0,c:[],p:ut}}function Pt(){ut.r||it(ut.c),ut=ut.p}function T(t,e){t&&t.i&&(Ut.delete(t),t.i(e))}function N(t,e,n,o){if(t&&t.o){if(Ut.has(t))return;Ut.add(t),ut.c.push(()=>{Ut.delete(t),o&&(n&&t.d(1),o())}),t.o(e)}else o&&o()}function He(t,e){const n={},o={},r={$$scope:1};let s=t.length;for(;s--;){const i=t[s],c=e[s];if(c){for(const u in i)u in c||(o[u]=1);for(const u in c)r[u]||(n[u]=c[u],r[u]=1);t[s]=c}else for(const u in i)r[u]=1}for(const i in o)i in n||(n[i]=void 0);return n}function _e(t){return typeof t=="object"&&t!==null?t:{}}function H(t){t&&t.c()}function j(t,e,n,o){const{fragment:r,after_update:s}=t.$$;r&&r.m(e,n),o||Vt(()=>{const i=t.$$.on_mount.map(Ne).filter(Zt);t.$$.on_destroy?t.$$.on_destroy.push(...i):it(i),t.$$.on_mount=[]}),s.forEach(Vt)}function F(t,e){const n=t.$$;n.fragment!==null&&(Rn(n.after_update),it(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Pn(t,e){t.$$.dirty[0]===-1&&(ht.push(t),je(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const k=m.length?m[0]:d;return l.ctx&&r(l.ctx[a],l.ctx[a]=k)&&(!l.skip_bound&&l.bound[a]&&l.bound[a](k),f&&Pn(t,a)),d}):[],l.update(),f=!0,it(l.before_update),l.fragment=o?o(l.ctx):!1,e.target){if(e.hydrate){const a=_n(e.target);l.fragment&&l.fragment.l(a),a.forEach(g)}else l.fragment&&l.fragment.c();e.intro&&T(t.$$.fragment),j(t,e.target,e.anchor,e.customElement),Fe()}wt(u)}class V{$destroy(){F(this,1),this.$destroy=A}$on(e,n){if(!Zt(n))return A;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const r=o.indexOf(n);r!==-1&&o.splice(r,1)}}$set(e){this.$$set&&!dn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const ge=t=>typeof t>"u",Be=t=>typeof t=="function",xe=t=>typeof t=="number";function In(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function ze(){let t=0;return()=>t++}function Cn(){return Math.random().toString(36).substring(2)}const st=typeof window>"u";function qe(t,e,n){return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}const Ke=(t,e)=>t?{}:{style:e},Jt=t=>({"aria-hidden":"true",...Ke(t,"display:none;")}),mt=[];function Ln(t,e){return{subscribe:G(t,e).subscribe}}function G(t,e=A){let n;const o=new Set;function r(c){if(q(t,c)&&(t=c,n)){const u=!mt.length;for(const l of o)l[1](),mt.push(l,t);if(u){for(let l=0;l{o.delete(l),o.size===0&&n&&(n(),n=null)}}return{set:r,update:s,subscribe:i}}function On(t,e,n){const o=!Array.isArray(t),r=o?[t]:t,s=e.length<2;return Ln(n,i=>{let c=!1;const u=[];let l=0,f=A;const a=()=>{if(l)return;f();const m=e(o?u[0]:u,i);s?i(m):f=Zt(m)?m:A},d=r.map((m,k)=>te(m,R=>{u[k]=R,l&=~(1<{l|=1<`@@svnav-ctx__${t}`,Wt=It("LOCATION"),yt=It("ROUTER"),Ye=It("ROUTE"),An=It("ROUTE_PARAMS"),Tn=It("FOCUS_ELEM"),Ge=/^:(.+)/,kt=(t,e,n)=>t.substr(e,n),Xt=(t,e)=>kt(t,0,e.length)===e,Nn=t=>t==="",Mn=t=>Ge.test(t),Qe=t=>t[0]==="*",Un=t=>t.replace(/\*.*$/,""),Ve=t=>t.replace(/(^\/+|\/+$)/g,"");function Z(t,e=!1){const n=Ve(t).split("/");return e?n.filter(Boolean):n}const qt=(t,e)=>t+(e?`?${e}`:""),ie=t=>`/${Ve(t)}`;function Ct(...t){const e=o=>Z(o,!0).join("/"),n=t.map(e).join("/");return ie(n)}const le=1,xt=2,ft=3,Dn=4,Je=5,jn=6,We=7,Fn=8,Hn=9,Xe=10,Ze=11,Bn={[le]:"Link",[xt]:"Route",[ft]:"Router",[Dn]:"useFocus",[Je]:"useLocation",[jn]:"useMatch",[We]:"useNavigate",[Fn]:"useParams",[Hn]:"useResolvable",[Xe]:"useResolve",[Ze]:"navigate"},ce=t=>Bn[t];function xn(t,e){let n;return t===xt?n=e.path?`path="${e.path}"`:"default":t===le?n=`to="${e.to}"`:t===ft&&(n=`basepath="${e.basepath||""}"`),`<${ce(t)} ${n||""} />`}function zn(t,e,n,o){const r=n&&xn(o||t,n),s=r?` - -Occurred in: ${r}`:"",i=ce(t),c=Be(e)?e(i):e;return`<${i}> ${c}${s}`}const tn=t=>(...e)=>t(zn(...e)),en=tn(t=>{throw new Error(t)}),Bt=tn(console.warn),be=4,qn=3,Kn=2,Yn=1,Gn=1;function Qn(t,e){const n=t.default?0:Z(t.fullPath).reduce((o,r)=>{let s=o;return s+=be,Nn(r)?s+=Gn:Mn(r)?s+=Kn:Qe(r)?s-=be+Yn:s+=qn,s},0);return{route:t,score:n,index:e}}function Vn(t){return t.map(Qn).sort((e,n)=>e.scoren.score?-1:e.index-n.index)}function nn(t,e){let n,o;const[r]=e.split("?"),s=Z(r),i=s[0]==="",c=Vn(t);for(let u=0,l=c.length;u({...f,params:d,uri:L});if(f.default){o=m(e);continue}const k=Z(f.fullPath),R=Math.max(s.length,k.length);let S=0;for(;S{l===".."?u.pop():l!=="."&&u.push(l)}),qt(`/${u.join("/")}`,o)}function ye(t,e){const{pathname:n,hash:o="",search:r="",state:s}=t,i=Z(e,!0),c=Z(n,!0);for(;i.length;)i[0]!==c[0]&&en(ft,`Invalid state: All locations must begin with the basepath "${e}", found "${n}"`),i.shift(),c.shift();return{pathname:Ct(...c),hash:o,search:r,state:s}}const ve=t=>t.length===1?"":t,ue=t=>{const e=t.indexOf("?"),n=t.indexOf("#"),o=e!==-1,r=n!==-1,s=r?ve(kt(t,n)):"",i=r?kt(t,0,n):t,c=o?ve(kt(i,e)):"";return{pathname:(o?kt(i,0,e):i)||"/",search:c,hash:s}},Wn=t=>{const{pathname:e,search:n,hash:o}=t;return e+n+o};function Xn(t,e,n){return Ct(n,Jn(t,e))}function Zn(t,e){const n=ie(Un(t)),o=Z(n,!0),r=Z(e,!0).slice(0,o.length),s=on({fullPath:n},Ct(...r));return s&&s.uri}const Kt="POP",to="PUSH",eo="REPLACE";function Yt(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function no(t){let e=[],n=Yt(t),o=Kt;const r=(s=e)=>s.forEach(i=>i({location:n,action:o}));return{get location(){return n},listen(s){e.push(s);const i=()=>{n=Yt(t),o=Kt,r([s])};r([s]);const c=qe(t,"popstate",i);return()=>{c(),e=e.filter(u=>u!==s)}},navigate(s,i){const{state:c={},replace:u=!1}=i||{};if(o=u?eo:to,xe(s))i&&Bt(Ze,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),o=Kt,t.history.go(s);else{const l={...c,_key:Cn()};try{t.history[u?"replaceState":"pushState"](l,"",s)}catch{t.location[u?"replace":"assign"](s)}}n=Yt(t),r()}}}function Gt(t,e){return{...ue(e),state:t}}function oo(t="/"){let e=0,n=[Gt(null,t)];return{get entries(){return n},get location(){return n[e]},addEventListener(){},removeEventListener(){},history:{get state(){return n[e].state},pushState(o,r,s){e++,n=n.slice(0,e),n.push(Gt(o,s))},replaceState(o,r,s){n[e]=Gt(o,s)},go(o){const r=e+o;r<0||r>n.length-1||(e=r)}}}}const ro=!!(!st&&window.document&&window.document.createElement),so=!st&&window.location.origin==="null",io=no(ro&&!so?window:oo());let nt=null,rn=!0;function lo(t,e){const n=document.querySelectorAll("[data-svnav-router]");for(let o=0;ont.level||t.level===nt.level&&lo(t.routerId,nt.routerId))&&(nt=t)}function uo(){nt=null}function ao(){rn=!1}function ke(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let n;n=qe(t,"blur",()=>{t.removeAttribute(e),n()})}return t.focus(),document.activeElement===t}catch{return!1}}function fo(t,e){return Number(t.dataset.svnavRouteEnd)===e}function mo(t){return/^H[1-6]$/i.test(t.tagName)}function we(t,e=document){return e.querySelector(t)}function ho(t){let n=we(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!fo(n,t);){if(mo(n))return n;const o=we("h1,h2,h3,h4,h5,h6",n);if(o)return o;n=n.nextElementSibling}return null}function po(t){Promise.resolve(gt(t.focusElement)).then(e=>{const n=e||ho(t.id);n||Bt(ft,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,t,xt),!ke(n)&&ke(document.documentElement)})}const _o=(t,e,n)=>(o,r)=>$n().then(()=>{if(!nt||rn){ao();return}if(o&&po(nt.route),t.announcements&&r){const{path:s,fullPath:i,meta:c,params:u,uri:l}=nt.route,f=t.createAnnouncement({path:s,fullPath:i,meta:c,params:u,uri:l},gt(n));Promise.resolve(f).then(a=>{e.set(a)})}uo()}),go="position:fixed;top:-1px;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";function bo(t){let e,n,o=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},Ke(t[6],go)],r={};for(let s=0;s`Navigated to ${y.uri}`,announcements:!0,...k},L=f,O=ie(f),M=rt(Wt),P=rt(yt),v=!M,I=vo(),h=m&&!(P&&!P.manageFocus),E=G("");x(t,E,y=>n(0,c=y));const tt=P?P.disableInlineStyles:R,K=G([]);x(t,K,y=>n(20,i=y));const X=G(null);x(t,X,y=>n(18,r=y));let $=!1;const et=v?0:P.level+1,Y=v?G((()=>ye(st?ue(a):d.location,O))()):M;x(t,Y,y=>n(17,o=y));const ct=G(o);x(t,ct,y=>n(19,s=y));const Ot=_o(S,E,Y),C=y=>B=>B.filter(J=>J.id!==y);function D(y){if(st){if($)return;const B=on(y,o.pathname);if(B)return $=!0,B}else K.update(B=>{const J=C(y.id)(B);return J.push(y),J})}function At(y){K.update(C(y))}return!v&&f!==Se&&Bt(ft,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:f}),v&&(kn(()=>d.listen(B=>{const J=ye(B.location,O);ct.set(o),Y.set(J)})),St(Wt,Y)),St(yt,{activeRoute:X,registerRoute:D,unregisterRoute:At,manageFocus:h,level:et,id:I,history:v?d:P.history,basepath:v?O:P.basepath,disableInlineStyles:tt}),t.$$set=y=>{"basepath"in y&&n(11,f=y.basepath),"url"in y&&n(12,a=y.url),"history"in y&&n(13,d=y.history),"primary"in y&&n(14,m=y.primary),"a11y"in y&&n(15,k=y.a11y),"disableInlineStyles"in y&&n(16,R=y.disableInlineStyles),"$$scope"in y&&n(21,l=y.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&f!==L&&Bt(ft,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const y=nn(i,o.pathname);X.set(y)}if(t.$$.dirty[0]&655360&&v){const y=!!o.hash,B=!y&&h,J=!y||o.pathname!==s.pathname;Ot(B,J)}t.$$.dirty[0]&262144&&h&&r&&r.primary&&co({level:et,routerId:I,route:r})},[c,S,v,I,h,E,tt,K,X,Y,ct,f,a,d,m,k,R,o,r,s,i,l,u]}class wo extends V{constructor(e){super(),Q(this,e,ko,yo,q,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const sn=wo;function Lt(t,e,n=yt,o=ft){rt(n)||en(t,s=>`You cannot use ${s} outside of a ${ce(o)}.`,e)}const So=t=>{const{subscribe:e}=rt(t);return{subscribe:e}};function ln(){return Lt(Je),So(Wt)}function cn(){const{history:t}=rt(yt);return t}function un(){const t=rt(Ye);return t?On(t,e=>e.base):G("/")}function an(){Lt(Xe);const t=un(),{basepath:e}=rt(yt);return o=>Xn(o,gt(t),e)}function $o(){Lt(We);const t=an(),{navigate:e}=cn();return(o,r)=>{const s=xe(o)?o:t(o);return e(s,r)}}const Eo=t=>({params:t&16,location:t&8}),$e=t=>({params:st?gt(t[10]):t[4],location:t[3],navigate:t[11]});function Ee(t){let e,n;return e=new sn({props:{primary:t[1],$$slots:{default:[Io]},$$scope:{ctx:t}}}),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),n=!0},p(o,r){const s={};r&2&&(s.primary=o[1]),r&528409&&(s.$$scope={dirty:r,ctx:o}),e.$set(s)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){N(e.$$.fragment,o),n=!1},d(o){F(e,o)}}}function Ro(t){let e;const n=t[18].default,o=ee(n,t,t[19],$e);return{c(){o&&o.c()},m(r,s){o&&o.m(r,s),e=!0},p(r,s){o&&o.p&&(!e||s&524312)&&oe(o,n,r,r[19],e?ne(n,r[19],s,Eo):re(r[19]),$e)},i(r){e||(T(o,r),e=!0)},o(r){N(o,r),e=!1},d(r){o&&o.d(r)}}}function Po(t){let e,n,o;const r=[{location:t[3]},{navigate:t[11]},st?gt(t[10]):t[4],t[12]];var s=t[0];function i(c){let u={};for(let l=0;l{F(f,1)}),Pt()}s?(e=Ht(s,i()),H(e.$$.fragment),T(e.$$.fragment,1),j(e,n.parentNode,n)):e=null}else s&&e.$set(l)},i(c){o||(e&&T(e.$$.fragment,c),o=!0)},o(c){e&&N(e.$$.fragment,c),o=!1},d(c){c&&g(n),e&&F(e,c)}}}function Io(t){let e,n,o,r;const s=[Po,Ro],i=[];function c(u,l){return u[0]!==null?0:1}return e=c(t),n=i[e]=s[e](t),{c(){n.c(),o=se()},m(u,l){i[e].m(u,l),b(u,o,l),r=!0},p(u,l){let f=e;e=c(u),e===f?i[e].p(u,l):(Rt(),N(i[f],1,1,()=>{i[f]=null}),Pt(),n=i[e],n?n.p(u,l):(n=i[e]=s[e](u),n.c()),T(n,1),n.m(o.parentNode,o))},i(u){r||(T(n),r=!0)},o(u){N(n),r=!1},d(u){i[e].d(u),u&&g(o)}}}function Co(t){let e,n,o,r,s,i=[Jt(t[7]),{"data-svnav-route-start":t[5]}],c={};for(let a=0;a{u=null}),Pt())},i(a){s||(T(u),s=!0)},o(a){N(u),s=!1},d(a){a&&g(e),a&&g(n),u&&u.d(a),a&&g(o),a&&g(r)}}}const Lo=ze();function Oo(t,e,n){let o;const r=["path","component","meta","primary"];let s=jt(e,r),i,c,u,l,{$$slots:f={},$$scope:a}=e,{path:d=""}=e,{component:m=null}=e,{meta:k={}}=e,{primary:R=!0}=e;Lt(xt,e);const S=Lo(),{registerRoute:L,unregisterRoute:O,activeRoute:M,disableInlineStyles:P}=rt(yt);x(t,M,$=>n(16,i=$));const v=un();x(t,v,$=>n(17,u=$));const I=ln();x(t,I,$=>n(3,c=$));const h=G(null);let E;const tt=G(),K=G({});x(t,K,$=>n(4,l=$)),St(Ye,tt),St(An,K),St(Tn,h);const X=$o();return st||wn(()=>O(S)),t.$$set=$=>{n(24,e=W(W({},e),Dt($))),n(12,s=jt(e,r)),"path"in $&&n(13,d=$.path),"component"in $&&n(0,m=$.component),"meta"in $&&n(14,k=$.meta),"primary"in $&&n(1,R=$.primary),"$$scope"in $&&n(19,a=$.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const $=d==="",et=Ct(u,d),lt={id:S,path:d,meta:k,default:$,fullPath:$?"":et,base:$?u:Zn(et,c.pathname),primary:R,focusElement:h};tt.set(lt),n(15,E=L(lt))}if(t.$$.dirty&98304&&n(2,o=!!(E||i&&i.id===S)),t.$$.dirty&98308&&o){const{params:$}=E||i;K.set($)}},e=Dt(e),[m,R,o,c,l,S,M,P,v,I,K,X,s,d,k,E,i,u,f,a]}class Ao extends V{constructor(e){super(),Q(this,e,Oo,Co,q,{path:13,component:0,meta:14,primary:1})}}const To=Ao;function No(t){let e,n,o,r;const s=t[13].default,i=ee(s,t,t[12],null);let c=[{href:t[0]},t[2],t[1]],u={};for(let l=0;ln(11,a=h));const M=Sn(),P=an(),{navigate:v}=cn();function I(h){M("click",h),In(h)&&(h.preventDefault(),v(o,{state:S,replace:i||R}))}return t.$$set=h=>{n(19,e=W(W({},e),Dt(h))),n(18,f=jt(e,l)),"to"in h&&n(5,k=h.to),"replace"in h&&n(6,R=h.replace),"state"in h&&n(7,S=h.state),"getProps"in h&&n(8,L=h.getProps),"$$scope"in h&&n(12,m=h.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&n(0,o=P(k,a)),t.$$.dirty&2049&&n(10,r=Xt(a.pathname,o)),t.$$.dirty&2049&&n(9,s=o===a.pathname),t.$$.dirty&2049&&(i=ue(o)===Wn(a)),t.$$.dirty&512&&n(2,c=s?{"aria-current":"page"}:{}),n(1,u=(()=>{if(Be(L)){const h=L({location:a,href:o,isPartiallyCurrent:r,isCurrent:s});return{...f,...h}}return f})())},e=Dt(e),[o,u,c,O,I,k,R,S,L,s,r,a,m,d]}class Uo extends V{constructor(e){super(),Q(this,e,Mo,No,q,{to:5,replace:6,state:7,getProps:8})}}const vt=Uo;const Do={cantidad:0,monto:0},pt=G(Do),ae="api";async function jo({username:t,password:e}){const n=await fetch(`${ae}/auth/`,{method:"POST",body:JSON.stringify({username:t,password:e}),headers:{"Content-Type":"application/json"}});if(!n.ok)throw await n.json();const o=await n.json();return document.cookie=`token=${o.token}`,o}async function Fo(){const t=await fetch(`${ae}/auth/logout/`,{method:"POST"});if(!t.ok)throw await t.json();const e=await t.text();return document.cookie="token=",e}async function Ho(){const t=await fetch(`${ae}/auth/info/`,{credentials:"include"});if(!t.ok)throw await t.json();return await t.json()}function Bo(t){let e;return{c(){e=U("Home")},m(n,o){b(n,e,o)},d(n){n&&g(e)}}}function xo(t){let e;return{c(){e=U("About")},m(n,o){b(n,e,o)},d(n){n&&g(e)}}}function zo(t){let e;return{c(){e=U("Contact")},m(n,o){b(n,e,o)},d(n){n&&g(e)}}}function qo(t){let e;return{c(){e=U("Productos")},m(n,o){b(n,e,o)},d(n){n&&g(e)}}}function Ko(t){let e;return{c(){e=U("Compras")},m(n,o){b(n,e,o)},d(n){n&&g(e)}}}function Yo(t){let e,n,o,r,s,i,c,u,l,f,a,d,m,k,R,S,L,O,M,P,v=t[0].cantidad+"",I,h,E=t[0].monto+"",tt,K,X,$,et,lt,Y,ct,Ot;return r=new vt({props:{to:"/",$$slots:{default:[Bo]},$$scope:{ctx:t}}}),c=new vt({props:{to:"/about",$$slots:{default:[xo]},$$scope:{ctx:t}}}),f=new vt({props:{to:"/contact",$$slots:{default:[zo]},$$scope:{ctx:t}}}),m=new vt({props:{to:"/productos",$$slots:{default:[qo]},$$scope:{ctx:t}}}),S=new vt({props:{to:"/compras",$$slots:{default:[Ko]},$$scope:{ctx:t}}}),{c(){e=_("div"),n=_("ul"),o=_("li"),H(r.$$.fragment),s=w(),i=_("li"),H(c.$$.fragment),u=w(),l=_("li"),H(f.$$.fragment),a=w(),d=_("li"),H(m.$$.fragment),k=w(),R=_("li"),H(S.$$.fragment),L=w(),O=_("li"),M=U("Itemes comprados:"),P=_("br"),I=U(v),h=U(" - $"),tt=U(E),K=w(),X=_("li"),$=_("a"),$.textContent="Salir",et=w(),lt=_("hr"),yn(O,"color","white"),z($,"href","#"),z(e,"class","navbar")},m(C,D){b(C,e,D),p(e,n),p(n,o),j(r,o,null),p(n,s),p(n,i),j(c,i,null),p(n,u),p(n,l),j(f,l,null),p(n,a),p(n,d),j(m,d,null),p(n,k),p(n,R),j(S,R,null),p(n,L),p(n,O),p(O,M),p(O,P),p(O,I),p(O,h),p(O,tt),p(n,K),p(n,X),p(X,$),b(C,et,D),b(C,lt,D),Y=!0,ct||(Ot=at($,"click",Ft(t[2])),ct=!0)},p(C,[D]){const At={};D&8&&(At.$$scope={dirty:D,ctx:C}),r.$set(At);const y={};D&8&&(y.$$scope={dirty:D,ctx:C}),c.$set(y);const B={};D&8&&(B.$$scope={dirty:D,ctx:C}),f.$set(B);const J={};D&8&&(J.$$scope={dirty:D,ctx:C}),m.$set(J);const fe={};D&8&&(fe.$$scope={dirty:D,ctx:C}),S.$set(fe),(!Y||D&1)&&v!==(v=C[0].cantidad+"")&&ot(I,v),(!Y||D&1)&&E!==(E=C[0].monto+"")&&ot(tt,E)},i(C){Y||(T(r.$$.fragment,C),T(c.$$.fragment,C),T(f.$$.fragment,C),T(m.$$.fragment,C),T(S.$$.fragment,C),Y=!0)},o(C){N(r.$$.fragment,C),N(c.$$.fragment,C),N(f.$$.fragment,C),N(m.$$.fragment,C),N(S.$$.fragment,C),Y=!1},d(C){C&&g(e),F(r),F(c),F(f),F(m),F(S),C&&g(et),C&&g(lt),ct=!1,Ot()}}}function Go(t,e,n){let o;x(t,pt,i=>n(0,o=i));async function r(){try{await Fo(),document.location.href="/"}catch(i){alert(i.detail||i)}}return[o,r,()=>r()]}class Qo extends V{constructor(e){super(),Q(this,e,Go,Yo,q,{})}}function Vo(t){let e,n,o;return{c(){e=_("hr"),n=w(),o=_("footer"),o.textContent="pie de pagina"},m(r,s){b(r,e,s),b(r,n,s),b(r,o,s)},p:A,i:A,o:A,d(r){r&&g(e),r&&g(n),r&&g(o)}}}class Jo extends V{constructor(e){super(),Q(this,e,null,Vo,q,{})}}const fn=G(null);function Wo(t){let e,n,o,r,s;return{c(){e=_("h1"),e.textContent="Pagina de inicio",n=w(),o=_("p"),r=U("Hola: "),s=U(t[0])},m(i,c){b(i,e,c),b(i,n,c),b(i,o,c),p(o,r),p(o,s)},p(i,[c]){c&1&&ot(s,i[0])},i:A,o:A,d(i){i&&g(e),i&&g(n),i&&g(o)}}}function Xo(t,e,n){let o;x(t,fn,s=>n(1,o=s));let r="";return t.$$.update=()=>{t.$$.dirty&2&&n(0,r=`${o.first_name} ${o.last_name}`.trim()||o.username)},[r,o]}let Zo=class extends V{constructor(e){super(),Q(this,e,Xo,Wo,q,{})}};function tr(t){let e,n,o;return{c(){e=_("h1"),e.textContent="Acerca de nosotros",n=w(),o=_("p"),o.textContent="hola"},m(r,s){b(r,e,s),b(r,n,s),b(r,o,s)},p:A,i:A,o:A,d(r){r&&g(e),r&&g(n),r&&g(o)}}}class er extends V{constructor(e){super(),Q(this,e,null,tr,q,{})}}function nr(t){let e,n,o;return{c(){e=_("h1"),e.textContent="Datos de contacto",n=w(),o=_("p"),o.textContent="hola"},m(r,s){b(r,e,s),b(r,n,s),b(r,o,s)},p:A,i:A,o:A,d(r){r&&g(e),r&&g(n),r&&g(o)}}}class or extends V{constructor(e){super(),Q(this,e,null,nr,q,{})}}function rr(t){let e,n,o,r,s,i,c,u,l;return{c(){e=_("h1"),e.textContent="Articulos a comprar",n=w(),o=_("h3"),o.textContent="Perrito de juguete",r=w(),s=_("button"),s.textContent="Agregar",i=U(` | -`),c=_("button"),c.textContent="Quitar"},m(f,a){b(f,e,a),b(f,n,a),b(f,o,a),b(f,r,a),b(f,s,a),b(f,i,a),b(f,c,a),u||(l=[at(s,"click",Ft(t[2])),at(c,"click",Ft(t[3]))],u=!0)},p:A,i:A,o:A,d(f){f&&g(e),f&&g(n),f&&g(o),f&&g(r),f&&g(s),f&&g(i),f&&g(c),u=!1,it(l)}}}function sr(t,e,n){let o;x(t,pt,u=>n(4,o=u));function r(){Nt(pt,o.cantidad++,o),Nt(pt,o.monto+=1200,o)}function s(){o.cantidad>0&&(Nt(pt,o.cantidad--,o),Nt(pt,o.monto-=1200,o))}return[r,s,()=>r(),()=>s()]}class ir extends V{constructor(e){super(),Q(this,e,sr,rr,q,{})}}const lr="https://dummyjson.com";async function cr(){const t=await fetch(lr+"/products");if(!t.ok)throw await t.text();return await t.json()}function Re(t,e,n){const o=t.slice();return o[2]=e[n],o}function Pe(t){let e,n,o=t[2].id+"",r,s,i,c=t[2].title+"",u,l,f,a=t[2].description+"",d,m,k,R,S=t[2].price+"",L,O,M,P,v,I;return{c(){e=_("tr"),n=_("td"),r=U(o),s=w(),i=_("td"),u=U(c),l=w(),f=_("td"),d=U(a),m=w(),k=_("td"),R=U("$"),L=U(S),O=w(),M=_("td"),P=_("img"),I=w(),z(P,"width","120"),z(P,"alt","imagen de producto"),me(P.src,v=t[2].thumbnail)||z(P,"src",v)},m(h,E){b(h,e,E),p(e,n),p(n,r),p(e,s),p(e,i),p(i,u),p(e,l),p(e,f),p(f,d),p(e,m),p(e,k),p(k,R),p(k,L),p(e,O),p(e,M),p(M,P),p(e,I)},p(h,E){E&1&&o!==(o=h[2].id+"")&&ot(r,o),E&1&&c!==(c=h[2].title+"")&&ot(u,c),E&1&&a!==(a=h[2].description+"")&&ot(d,a),E&1&&S!==(S=h[2].price+"")&&ot(L,S),E&1&&!me(P.src,v=h[2].thumbnail)&&z(P,"src",v)},d(h){h&&g(e)}}}function ur(t){let e,n,o,r,s=t[0],i=[];for(let c=0;cID - Titulo - Descripción - Precio - Imagen`,o=w(),r=_("tbody");for(let c=0;c{F(u,1)}),Pt()}r?(e=Ht(r,s()),H(e.$$.fragment),T(e.$$.fragment,1),j(e,n.parentNode,n)):e=null}},i(i){o||(e&&T(e.$$.fragment,i),o=!0)},o(i){e&&N(e.$$.fragment,i),o=!1},d(i){e&&F(e,i),i&&g(n)}}}function Le(t){let e,n;return e=new To({props:{path:t[0].path,$$slots:{default:[dr]},$$scope:{ctx:t}}}),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),n=!0},p(o,r){const s={};r&8&&(s.$$scope={dirty:r,ctx:o}),e.$set(s)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){N(e.$$.fragment,o),n=!1},d(o){F(e,o)}}}function mr(t){let e,n,o,r,s,i,c;e=new Qo({});let u=Ie,l=[];for(let a=0;aN(l[a],1,1,()=>{l[a]=null});return i=new Jo({}),{c(){H(e.$$.fragment),n=w(),o=_("main"),r=_("article");for(let a=0;an(2,s=""),5e3)}finally{n(1,r=!1)}}function c(){o.username=this.value,n(0,o)}function u(){o.password=this.value,n(0,o)}return[o,r,s,i,c,u,()=>i()]}class yr extends V{constructor(e){super(),Q(this,e,br,gr,q,{})}}let Te;async function vr(){try{const t=await Ho();fn.set(t),Te=new pr({target:document.getElementById("app")})}catch(t){console.log(t.detail||t),Te=new yr({target:document.getElementById("app")})}}vr(); diff --git a/project/dist/assets/index-782abf0e.css b/project/dist/assets/index-782abf0e.css deleted file mode 100644 index 46d9a12..0000000 --- a/project/dist/assets/index-782abf0e.css +++ /dev/null @@ -1 +0,0 @@ -.navbar ul{list-style-type:none;margin:0;padding:0;overflow:hidden;background-color:#333}.navbar li{float:left}.navbar li a{display:block;color:#fff;text-align:center;padding:14px 16px;text-decoration:none}.navbar li a:hover{background-color:#111} diff --git a/project/dist/assets/index-85b3eae6.css b/project/dist/assets/index-85b3eae6.css new file mode 100644 index 0000000..770f598 --- /dev/null +++ b/project/dist/assets/index-85b3eae6.css @@ -0,0 +1 @@ +.navbar ul{list-style-type:none;margin:0;padding:0;overflow:hidden;background-color:#333}.navbar li{float:left}.navbar li a{display:block;color:#fff;text-align:center;padding:14px 16px;text-decoration:none}.navbar li a:hover{background-color:#111}.navbar li.active a{background-color:#0ff;color:#000}.navbar .canasta{background-color:#fff;padding:5px 16px;color:#4682b4;border:1px solid black}.login{width:700px;max-width:100%;margin:auto;border:1px #ddd solid;padding:2rem}.login .field{margin-bottom:1rem}.login .field input{width:100%}.login input,.login button{min-height:2rem}.login .message{color:orange} diff --git a/project/dist/assets/index-c72321f9.js b/project/dist/assets/index-c72321f9.js new file mode 100644 index 0000000..bd84289 --- /dev/null +++ b/project/dist/assets/index-c72321f9.js @@ -0,0 +1,8 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}})();function N(){}function V(t,e){for(const n in e)t[n]=e[n];return t}function De(t){return t()}function pe(){return Object.create(null)}function rt(t){t.forEach(De)}function re(t){return typeof t=="function"}function q(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Nt;function _e(t,e){return Nt||(Nt=document.createElement("a")),Nt.href=e,t===Nt.href}function hn(t){return Object.keys(t).length===0}function ie(t,...e){if(t==null)return N;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function _t(t){let e;return ie(t,n=>e=n)(),e}function z(t,e,n){t.$$.on_destroy.push(ie(e,n))}function zt(t,e,n,o){if(t){const s=je(t,e,n,o);return t[0](s)}}function je(t,e,n,o){return t[1]&&o?V(n.ctx.slice(),t[1](o(e))):n.ctx}function qt(t,e,n,o){if(t[2]&&o){const s=t[2](o(n));if(e.dirty===void 0)return s;if(typeof s=="object"){const r=[],i=Math.max(e.dirty.length,s.length);for(let c=0;c32){const e=[],n=t.ctx.length/32;for(let o=0;ot.removeEventListener(e,n,o)}function Ft(t){return function(e){return e.preventDefault(),t.call(this,e)}}function j(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const gn=["width","height"];function gt(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const o in e)e[o]==null?t.removeAttribute(o):o==="style"?t.style.cssText=e[o]:o==="__value"?t.value=t[o]=e[o]:n[o]&&n[o].set&&gn.indexOf(o)===-1?t[o]=e[o]:j(t,o,e[o])}function bn(t){return Array.from(t.childNodes)}function tt(t,e){e=""+e,t.data!==e&&(t.data=e)}function yn(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function vn(t,e,n){~pn.indexOf(n)?yn(t,e):tt(t,e)}function Mt(t,e){t.value=e??""}function kn(t,e,{bubbles:n=!1,cancelable:o=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(t,n,o,e),s}function Bt(t,e){return new t(e)}let Pt;function St(t){Pt=t}function Rt(){if(!Pt)throw new Error("Function called outside component initialization");return Pt}function $n(t){Rt().$$.on_mount.push(t)}function wn(t){Rt().$$.on_destroy.push(t)}function Sn(){const t=Rt();return(e,n,{cancelable:o=!1}={})=>{const s=t.$$.callbacks[e];if(s){const r=kn(e,n,{cancelable:o});return s.slice().forEach(i=>{i.call(t,r)}),!r.defaultPrevented}return!0}}function Et(t,e){return Rt().$$.context.set(t,e),e}function et(t){return Rt().$$.context.get(t)}const mt=[],ge=[];let pt=[];const be=[],Be=Promise.resolve();let Zt=!1;function He(){Zt||(Zt=!0,Be.then(ze))}function En(){return He(),Be}function te(t){pt.push(t)}const Qt=new Set;let ft=0;function ze(){if(ft!==0)return;const t=Pt;do{try{for(;ftt.indexOf(o)===-1?e.push(o):n.push(o)),n.forEach(o=>o()),pt=e}const Ut=new Set;let it;function bt(){it={r:0,c:[],p:it}}function yt(){it.r||rt(it.c),it=it.p}function R(t,e){t&&t.i&&(Ut.delete(t),t.i(e))}function A(t,e,n,o){if(t&&t.o){if(Ut.has(t))return;Ut.add(t),it.c.push(()=>{Ut.delete(t),o&&(n&&t.d(1),o())}),t.o(e)}else o&&o()}function qe(t,e){const n={},o={},s={$$scope:1};let r=t.length;for(;r--;){const i=t[r],c=e[r];if(c){for(const a in i)a in c||(o[a]=1);for(const a in c)s[a]||(n[a]=c[a],s[a]=1);t[r]=c}else for(const a in i)s[a]=1}for(const i in o)i in n||(n[i]=void 0);return n}function ye(t){return typeof t=="object"&&t!==null?t:{}}function H(t){t&&t.c()}function F(t,e,n,o){const{fragment:s,after_update:r}=t.$$;s&&s.m(e,n),o||te(()=>{const i=t.$$.on_mount.map(De).filter(re);t.$$.on_destroy?t.$$.on_destroy.push(...i):rt(i),t.$$.on_mount=[]}),r.forEach(te)}function B(t,e){const n=t.$$;n.fragment!==null&&(Rn(n.after_update),rt(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function In(t,e){t.$$.dirty[0]===-1&&(mt.push(t),He(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const v=h.length?h[0]:d;return l.ctx&&s(l.ctx[u],l.ctx[u]=v)&&(!l.skip_bound&&l.bound[u]&&l.bound[u](v),f&&In(t,u)),d}):[],l.update(),f=!0,rt(l.before_update),l.fragment=o?o(l.ctx):!1,e.target){if(e.hydrate){const u=bn(e.target);l.fragment&&l.fragment.l(u),u.forEach(p)}else l.fragment&&l.fragment.c();e.intro&&R(t.$$.fragment),F(t,e.target,e.anchor,e.customElement),ze()}St(a)}class G{$destroy(){B(this,1),this.$destroy=N}$on(e,n){if(!re(n))return N;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const s=o.indexOf(n);s!==-1&&o.splice(s,1)}}$set(e){this.$$set&&!hn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const ve=t=>typeof t>"u",Ke=t=>typeof t=="function",xe=t=>typeof t=="number";function Cn(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Ye(){let t=0;return()=>t++}function Ln(){return Math.random().toString(36).substring(2)}const st=typeof window>"u";function Ge(t,e,n){return t.addEventListener(e,n),()=>t.removeEventListener(e,n)}const Qe=(t,e)=>t?{}:{style:e},ee=t=>({"aria-hidden":"true",...Qe(t,"display:none;")}),dt=[];function On(t,e){return{subscribe:Q(t,e).subscribe}}function Q(t,e=N){let n;const o=new Set;function s(c){if(q(t,c)&&(t=c,n)){const a=!dt.length;for(const l of o)l[1](),dt.push(l,t);if(a){for(let l=0;l{o.delete(l),o.size===0&&n&&(n(),n=null)}}return{set:s,update:r,subscribe:i}}function Ve(t,e,n){const o=!Array.isArray(t),s=o?[t]:t,r=e.length<2;return On(n,i=>{let c=!1;const a=[];let l=0,f=N;const u=()=>{if(l)return;f();const h=e(o?a[0]:a,i);r?i(h):f=re(h)?h:N},d=s.map((h,v)=>ie(h,C=>{a[v]=C,l&=~(1<{l|=1<`@@svnav-ctx__${t}`,ne=It("LOCATION"),ct=It("ROUTER"),Je=It("ROUTE"),An=It("ROUTE_PARAMS"),Nn=It("FOCUS_ELEM"),We=/^:(.+)/,wt=(t,e,n)=>t.substr(e,n),oe=(t,e)=>wt(t,0,e.length)===e,Tn=t=>t==="",Mn=t=>We.test(t),Xe=t=>t[0]==="*",Un=t=>t.replace(/\*.*$/,""),Ze=t=>t.replace(/(^\/+|\/+$)/g,"");function W(t,e=!1){const n=Ze(t).split("/");return e?n.filter(Boolean):n}const Vt=(t,e)=>t+(e?`?${e}`:""),le=t=>`/${Ze(t)}`;function Ct(...t){const e=o=>W(o,!0).join("/"),n=t.map(e).join("/");return le(n)}const ce=1,Gt=2,ut=3,Dn=4,tn=5,en=6,nn=7,jn=8,Fn=9,on=10,sn=11,Bn={[ce]:"Link",[Gt]:"Route",[ut]:"Router",[Dn]:"useFocus",[tn]:"useLocation",[en]:"useMatch",[nn]:"useNavigate",[jn]:"useParams",[Fn]:"useResolvable",[on]:"useResolve",[sn]:"navigate"},ue=t=>Bn[t];function Hn(t,e){let n;return t===Gt?n=e.path?`path="${e.path}"`:"default":t===ce?n=`to="${e.to}"`:t===ut&&(n=`basepath="${e.basepath||""}"`),`<${ue(t)} ${n||""} />`}function zn(t,e,n,o){const s=n&&Hn(o||t,n),r=s?` + +Occurred in: ${s}`:"",i=ue(t),c=Ke(e)?e(i):e;return`<${i}> ${c}${r}`}const rn=t=>(...e)=>t(zn(...e)),ln=rn(t=>{throw new Error(t)}),Ht=rn(console.warn),ke=4,qn=3,Kn=2,xn=1,Yn=1;function Gn(t,e){const n=t.default?0:W(t.fullPath).reduce((o,s)=>{let r=o;return r+=ke,Tn(s)?r+=Yn:Mn(s)?r+=Kn:Xe(s)?r-=ke+xn:r+=qn,r},0);return{route:t,score:n,index:e}}function Qn(t){return t.map(Gn).sort((e,n)=>e.scoren.score?-1:e.index-n.index)}function cn(t,e){let n,o;const[s]=e.split("?"),r=W(s),i=r[0]==="",c=Qn(t);for(let a=0,l=c.length;a({...f,params:d,uri:O});if(f.default){o=h(e);continue}const v=W(f.fullPath),C=Math.max(r.length,v.length);let k=0;for(;k{l===".."?a.pop():l!=="."&&a.push(l)}),Vt(`/${a.join("/")}`,o)}function se(t,e){const{pathname:n,hash:o="",search:s="",state:r}=t,i=W(e,!0),c=W(n,!0);for(;i.length;)i[0]!==c[0]&&ln(ut,`Invalid state: All locations must begin with the basepath "${e}", found "${n}"`),i.shift(),c.shift();return{pathname:Ct(...c),hash:o,search:s,state:r}}const $e=t=>t.length===1?"":t,fe=t=>{const e=t.indexOf("?"),n=t.indexOf("#"),o=e!==-1,s=n!==-1,r=s?$e(wt(t,n)):"",i=s?wt(t,0,n):t,c=o?$e(wt(i,e)):"";return{pathname:(o?wt(i,0,e):i)||"/",search:c,hash:r}},Jn=t=>{const{pathname:e,search:n,hash:o}=t;return e+n+o};function Wn(t,e,n){return Ct(n,Vn(t,e))}function Xn(t,e){const n=le(Un(t)),o=W(n,!0),s=W(e,!0).slice(0,o.length),r=ae({fullPath:n},Ct(...s));return r&&r.uri}const Jt="POP",Zn="PUSH",to="REPLACE";function Wt(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function eo(t){let e=[],n=Wt(t),o=Jt;const s=(r=e)=>r.forEach(i=>i({location:n,action:o}));return{get location(){return n},listen(r){e.push(r);const i=()=>{n=Wt(t),o=Jt,s([r])};s([r]);const c=Ge(t,"popstate",i);return()=>{c(),e=e.filter(a=>a!==r)}},navigate(r,i){const{state:c={},replace:a=!1}=i||{};if(o=a?to:Zn,xe(r))i&&Ht(sn,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),o=Jt,t.history.go(r);else{const l={...c,_key:Ln()};try{t.history[a?"replaceState":"pushState"](l,"",r)}catch{t.location[a?"replace":"assign"](r)}}n=Wt(t),s()}}}function Xt(t,e){return{...fe(e),state:t}}function no(t="/"){let e=0,n=[Xt(null,t)];return{get entries(){return n},get location(){return n[e]},addEventListener(){},removeEventListener(){},history:{get state(){return n[e].state},pushState(o,s,r){e++,n=n.slice(0,e),n.push(Xt(o,r))},replaceState(o,s,r){n[e]=Xt(o,r)},go(o){const s=e+o;s<0||s>n.length-1||(e=s)}}}}const oo=!!(!st&&window.document&&window.document.createElement),so=!st&&window.location.origin==="null",ro=eo(oo&&!so?window:no());let Z=null,un=!0;function io(t,e){const n=document.querySelectorAll("[data-svnav-router]");for(let o=0;oZ.level||t.level===Z.level&&io(t.routerId,Z.routerId))&&(Z=t)}function co(){Z=null}function uo(){un=!1}function we(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let n;n=Ge(t,"blur",()=>{t.removeAttribute(e),n()})}return t.focus(),document.activeElement===t}catch{return!1}}function ao(t,e){return Number(t.dataset.svnavRouteEnd)===e}function fo(t){return/^H[1-6]$/i.test(t.tagName)}function Se(t,e=document){return e.querySelector(t)}function mo(t){let n=Se(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!ao(n,t);){if(fo(n))return n;const o=Se("h1,h2,h3,h4,h5,h6",n);if(o)return o;n=n.nextElementSibling}return null}function ho(t){Promise.resolve(_t(t.focusElement)).then(e=>{const n=e||mo(t.id);n||Ht(ut,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,t,Gt),!we(n)&&we(document.documentElement)})}const po=(t,e,n)=>(o,s)=>En().then(()=>{if(!Z||un){uo();return}if(o&&ho(Z.route),t.announcements&&s){const{path:r,fullPath:i,meta:c,params:a,uri:l}=Z.route,f=t.createAnnouncement({path:r,fullPath:i,meta:c,params:a,uri:l},_t(n));Promise.resolve(f).then(u=>{e.set(u)})}co()}),_o="position:fixed;top:-1px;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";function go(t){let e,n,o=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},Qe(t[6],_o)],s={};for(let r=0;r`Navigated to ${y.uri}`,announcements:!0,...v},O=f,M=le(f),U=et(ne),S=et(ct),$=!U,L=yo(),m=h&&!(S&&!S.manageFocus),I=Q("");z(t,I,y=>n(0,c=y));const X=S?S.disableInlineStyles:C,K=Q([]);z(t,K,y=>n(20,i=y));const x=Q(null);z(t,x,y=>n(18,s=y));let E=!1;const nt=$?0:S.level+1,T=$?Q((()=>se(st?fe(u):d.location,M))()):U;z(t,T,y=>n(17,o=y));const at=Q(o);z(t,at,y=>n(19,r=y));const Lt=po(k,I,T),kt=y=>J=>J.filter(ot=>ot.id!==y);function Ot(y){if(st){if(E)return;const J=ae(y,o.pathname);if(J)return E=!0,J}else K.update(J=>{const ot=kt(y.id)(J);return ot.push(y),ot})}function At(y){K.update(kt(y))}return!$&&f!==Ee&&Ht(ut,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:f}),$&&($n(()=>d.listen(J=>{const ot=se(J.location,M);at.set(o),T.set(ot)})),Et(ne,T)),Et(ct,{activeRoute:x,registerRoute:Ot,unregisterRoute:At,manageFocus:m,level:nt,id:L,history:$?d:S.history,basepath:$?M:S.basepath,disableInlineStyles:X}),t.$$set=y=>{"basepath"in y&&n(11,f=y.basepath),"url"in y&&n(12,u=y.url),"history"in y&&n(13,d=y.history),"primary"in y&&n(14,h=y.primary),"a11y"in y&&n(15,v=y.a11y),"disableInlineStyles"in y&&n(16,C=y.disableInlineStyles),"$$scope"in y&&n(21,l=y.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&f!==O&&Ht(ut,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const y=cn(i,o.pathname);x.set(y)}if(t.$$.dirty[0]&655360&&$){const y=!!o.hash,J=!y&&m,ot=!y||o.pathname!==r.pathname;Lt(J,ot)}t.$$.dirty[0]&262144&&m&&s&&s.primary&&lo({level:nt,routerId:L,route:s})},[c,k,$,L,m,I,X,K,x,T,at,f,u,d,h,v,C,o,s,r,i,l,a]}class ko extends G{constructor(e){super(),Y(this,e,vo,bo,q,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const an=ko;function vt(t,e,n=ct,o=ut){et(n)||ln(t,r=>`You cannot use ${r} outside of a ${ue(o)}.`,e)}const $o=t=>{const{subscribe:e}=et(t);return{subscribe:e}};function de(){return vt(tn),$o(ne)}function fn(){const{history:t}=et(ct);return t}function dn(){const t=et(Je);return t?Ve(t,e=>e.base):Q("/")}function me(){vt(on);const t=dn(),{basepath:e}=et(ct);return o=>Wn(o,_t(t),e)}function wo(){vt(nn);const t=me(),{navigate:e}=fn();return(o,s)=>{const r=xe(o)?o:t(o);return e(r,s)}}function So(t){vt(en);const e=de(),n=me(),{basepath:o}=et(ct),s=n(t),{pathname:r}=se({pathname:s},o);return Ve(e,i=>ae({fullPath:r,path:t},i.pathname))}const Eo=t=>({params:t&16,location:t&8}),Pe=t=>({params:st?_t(t[10]):t[4],location:t[3],navigate:t[11]});function Re(t){let e,n;return e=new an({props:{primary:t[1],$$slots:{default:[Io]},$$scope:{ctx:t}}}),{c(){H(e.$$.fragment)},m(o,s){F(e,o,s),n=!0},p(o,s){const r={};s&2&&(r.primary=o[1]),s&528409&&(r.$$scope={dirty:s,ctx:o}),e.$set(r)},i(o){n||(R(e.$$.fragment,o),n=!0)},o(o){A(e.$$.fragment,o),n=!1},d(o){B(e,o)}}}function Po(t){let e;const n=t[18].default,o=zt(n,t,t[19],Pe);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),e=!0},p(s,r){o&&o.p&&(!e||r&524312)&&Kt(o,n,s,s[19],e?qt(n,s[19],r,Eo):xt(s[19]),Pe)},i(s){e||(R(o,s),e=!0)},o(s){A(o,s),e=!1},d(s){o&&o.d(s)}}}function Ro(t){let e,n,o;const s=[{location:t[3]},{navigate:t[11]},st?_t(t[10]):t[4],t[12]];var r=t[0];function i(c){let a={};for(let l=0;l{B(f,1)}),yt()}r?(e=Bt(r,i()),H(e.$$.fragment),R(e.$$.fragment,1),F(e,n.parentNode,n)):e=null}else r&&e.$set(l)},i(c){o||(e&&R(e.$$.fragment,c),o=!0)},o(c){e&&A(e.$$.fragment,c),o=!1},d(c){c&&p(n),e&&B(e,c)}}}function Io(t){let e,n,o,s;const r=[Ro,Po],i=[];function c(a,l){return a[0]!==null?0:1}return e=c(t),n=i[e]=r[e](t),{c(){n.c(),o=Yt()},m(a,l){i[e].m(a,l),g(a,o,l),s=!0},p(a,l){let f=e;e=c(a),e===f?i[e].p(a,l):(bt(),A(i[f],1,1,()=>{i[f]=null}),yt(),n=i[e],n?n.p(a,l):(n=i[e]=r[e](a),n.c()),R(n,1),n.m(o.parentNode,o))},i(a){s||(R(n),s=!0)},o(a){A(n),s=!1},d(a){i[e].d(a),a&&p(o)}}}function Co(t){let e,n,o,s,r,i=[ee(t[7]),{"data-svnav-route-start":t[5]}],c={};for(let u=0;u{a=null}),yt())},i(u){r||(R(a),r=!0)},o(u){A(a),r=!1},d(u){u&&p(e),u&&p(n),a&&a.d(u),u&&p(o),u&&p(s)}}}const Lo=Ye();function Oo(t,e,n){let o;const s=["path","component","meta","primary"];let r=jt(e,s),i,c,a,l,{$$slots:f={},$$scope:u}=e,{path:d=""}=e,{component:h=null}=e,{meta:v={}}=e,{primary:C=!0}=e;vt(Gt,e);const k=Lo(),{registerRoute:O,unregisterRoute:M,activeRoute:U,disableInlineStyles:S}=et(ct);z(t,U,E=>n(16,i=E));const $=dn();z(t,$,E=>n(17,a=E));const L=de();z(t,L,E=>n(3,c=E));const m=Q(null);let I;const X=Q(),K=Q({});z(t,K,E=>n(4,l=E)),Et(Je,X),Et(An,K),Et(Nn,m);const x=wo();return st||wn(()=>M(k)),t.$$set=E=>{n(24,e=V(V({},e),Dt(E))),n(12,r=jt(e,s)),"path"in E&&n(13,d=E.path),"component"in E&&n(0,h=E.component),"meta"in E&&n(14,v=E.meta),"primary"in E&&n(1,C=E.primary),"$$scope"in E&&n(19,u=E.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const E=d==="",nt=Ct(a,d),P={id:k,path:d,meta:v,default:E,fullPath:E?"":nt,base:E?a:Xn(nt,c.pathname),primary:C,focusElement:m};X.set(P),n(15,I=O(P))}if(t.$$.dirty&98304&&n(2,o=!!(I||i&&i.id===k)),t.$$.dirty&98308&&o){const{params:E}=I||i;K.set(E)}},e=Dt(e),[h,C,o,c,l,k,U,S,$,L,K,x,r,d,v,I,i,a,f,u]}class Ao extends G{constructor(e){super(),Y(this,e,Oo,Co,q,{path:13,component:0,meta:14,primary:1})}}const No=Ao;function To(t){let e,n,o,s;const r=t[13].default,i=zt(r,t,t[12],null);let c=[{href:t[0]},t[2],t[1]],a={};for(let l=0;ln(11,u=m));const U=Sn(),S=me(),{navigate:$}=fn();function L(m){U("click",m),Cn(m)&&(m.preventDefault(),$(o,{state:k,replace:i||C}))}return t.$$set=m=>{n(19,e=V(V({},e),Dt(m))),n(18,f=jt(e,l)),"to"in m&&n(5,v=m.to),"replace"in m&&n(6,C=m.replace),"state"in m&&n(7,k=m.state),"getProps"in m&&n(8,O=m.getProps),"$$scope"in m&&n(12,h=m.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&n(0,o=S(v,u)),t.$$.dirty&2049&&n(10,s=oe(u.pathname,o)),t.$$.dirty&2049&&n(9,r=o===u.pathname),t.$$.dirty&2049&&(i=fe(o)===Jn(u)),t.$$.dirty&512&&n(2,c=r?{"aria-current":"page"}:{}),n(1,a=(()=>{if(Ke(O)){const m=O({location:u,href:o,isPartiallyCurrent:s,isCurrent:r});return{...f,...m}}return f})())},e=Dt(e),[o,a,c,M,L,v,C,k,O,r,s,u,h,d]}class Uo extends G{constructor(e){super(),Y(this,e,Mo,To,q,{to:5,replace:6,state:7,getProps:8})}}const Do=Uo;function Ie(t){let e,n,o,s;return n=new Do({props:{to:t[0],$$slots:{default:[jo]},$$scope:{ctx:t}}}),{c(){e=b("li"),H(n.$$.fragment),j(e,"class",o=t[1]?" active":"")},m(r,i){g(r,e,i),F(n,e,null),s=!0},p(r,i){const c={};i&1&&(c.to=r[0]),i&64&&(c.$$scope={dirty:i,ctx:r}),n.$set(c),(!s||i&2&&o!==(o=r[1]?" active":""))&&j(e,"class",o)},i(r){s||(R(n.$$.fragment,r),s=!0)},o(r){A(n.$$.fragment,r),s=!1},d(r){r&&p(e),B(n)}}}function jo(t){let e;const n=t[5].default,o=zt(n,t,t[6],null);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),e=!0},p(s,r){o&&o.p&&(!e||r&64)&&Kt(o,n,s,s[6],e?qt(n,s[6],r,null):xt(s[6]),null)},i(s){e||(R(o,s),e=!0)},o(s){A(o,s),e=!1},d(s){o&&o.d(s)}}}function Fo(t){let e,n,o=t[2]&&Ie(t);return{c(){o&&o.c(),e=Yt()},m(s,r){o&&o.m(s,r),g(s,e,r),n=!0},p(s,[r]){s[2]?o?(o.p(s,r),r&4&&R(o,1)):(o=Ie(s),o.c(),R(o,1),o.m(e.parentNode,e)):o&&(bt(),A(o,1,1,()=>{o=null}),yt())},i(s){n||(R(o),n=!0)},o(s){A(o),n=!1},d(s){o&&o.d(s),s&&p(e)}}}function Bo(t,e,n){let o,{$$slots:s={},$$scope:r}=e,{to:i="#"}=e;const c=So(i);z(t,c,f=>n(4,o=f));let a,l=!1;return l=!0,t.$$set=f=>{"to"in f&&n(0,i=f.to),"$$scope"in f&&n(6,r=f.$$scope)},t.$$.update=()=>{t.$$.dirty&17&&n(1,a=(o==null?void 0:o.fullPath)===i)},[i,a,l,c,o,s,r]}class $t extends G{constructor(e){super(),Y(this,e,Bo,Fo,q,{to:0})}}const Ho={cantidad:0,monto:0},ht=Q(Ho),he="api";async function zo({username:t,password:e}){const n=await fetch(`${he}/auth/`,{method:"POST",body:JSON.stringify({username:t,password:e}),headers:{"Content-Type":"application/json"}});if(!n.ok)throw await n.json();const o=await n.json();return document.cookie=`token=${o.token}`,o}async function qo(){const t=await fetch(`${he}/auth/logout/`,{method:"POST"});if(!t.ok)throw await t.json();const e=await t.text();return document.cookie="token=",e}async function Ko(){const t=await fetch(`${he}/auth/info/`,{credentials:"include"});if(!t.ok)throw await t.json();const e=await t.text();return e?JSON.parse(e):null}function xo(t){let e;return{c(){e=D("Home")},m(n,o){g(n,e,o)},d(n){n&&p(e)}}}function Yo(t){let e;return{c(){e=D("About")},m(n,o){g(n,e,o)},d(n){n&&p(e)}}}function Go(t){let e;return{c(){e=D("Contact")},m(n,o){g(n,e,o)},d(n){n&&p(e)}}}function Qo(t){let e;return{c(){e=D("Productos")},m(n,o){g(n,e,o)},d(n){n&&p(e)}}}function Vo(t){let e;return{c(){e=D("Compras")},m(n,o){g(n,e,o)},d(n){n&&p(e)}}}function Jo(t){let e,n,o,s,r,i,c,a,l,f,u,d,h,v,C,k,O,M,U,S=t[0].cantidad+"",$,L,m=t[0].monto+"",I,X,K,x,E,nt;return o=new $t({props:{to:"/",$$slots:{default:[xo]},$$scope:{ctx:t}}}),r=new $t({props:{to:"/about",$$slots:{default:[Yo]},$$scope:{ctx:t}}}),c=new $t({props:{to:"/contact",$$slots:{default:[Go]},$$scope:{ctx:t}}}),l=new $t({props:{to:"/productos",$$slots:{default:[Qo]},$$scope:{ctx:t}}}),u=new $t({props:{to:"/compras",$$slots:{default:[Vo]},$$scope:{ctx:t}}}),{c(){e=b("div"),n=b("ul"),H(o.$$.fragment),s=w(),H(r.$$.fragment),i=w(),H(c.$$.fragment),a=w(),H(l.$$.fragment),f=w(),H(u.$$.fragment),d=w(),h=b("li"),v=b("a"),v.textContent="Salir",C=w(),k=b("li"),O=D("Itemes comprados:"),M=b("br"),U=w(),$=D(S),L=D(" - $"),I=D(m),X=w(),K=b("hr"),j(v,"href","#"),j(k,"class","canasta"),j(e,"class","navbar")},m(P,T){g(P,e,T),_(e,n),F(o,n,null),_(n,s),F(r,n,null),_(n,i),F(c,n,null),_(n,a),F(l,n,null),_(n,f),F(u,n,null),_(n,d),_(n,h),_(h,v),_(n,C),_(n,k),_(k,O),_(k,M),_(k,U),_(k,$),_(k,L),_(k,I),g(P,X,T),g(P,K,T),x=!0,E||(nt=lt(v,"click",Ft(t[2])),E=!0)},p(P,[T]){const at={};T&8&&(at.$$scope={dirty:T,ctx:P}),o.$set(at);const Lt={};T&8&&(Lt.$$scope={dirty:T,ctx:P}),r.$set(Lt);const kt={};T&8&&(kt.$$scope={dirty:T,ctx:P}),c.$set(kt);const Ot={};T&8&&(Ot.$$scope={dirty:T,ctx:P}),l.$set(Ot);const At={};T&8&&(At.$$scope={dirty:T,ctx:P}),u.$set(At),(!x||T&1)&&S!==(S=P[0].cantidad+"")&&tt($,S),(!x||T&1)&&m!==(m=P[0].monto+"")&&tt(I,m)},i(P){x||(R(o.$$.fragment,P),R(r.$$.fragment,P),R(c.$$.fragment,P),R(l.$$.fragment,P),R(u.$$.fragment,P),x=!0)},o(P){A(o.$$.fragment,P),A(r.$$.fragment,P),A(c.$$.fragment,P),A(l.$$.fragment,P),A(u.$$.fragment,P),x=!1},d(P){P&&p(e),B(o),B(r),B(c),B(l),B(u),P&&p(X),P&&p(K),E=!1,nt()}}}function Wo(t,e,n){let o;z(t,ht,i=>n(0,o=i));async function s(){try{await qo(),document.location.href="/"}catch(i){alert(i.detail||i)}}return[o,s,()=>s()]}class Xo extends G{constructor(e){super(),Y(this,e,Wo,Jo,q,{})}}function Zo(t){let e,n,o;return{c(){e=b("hr"),n=w(),o=b("footer"),o.textContent="pie de pagina"},m(s,r){g(s,e,r),g(s,n,r),g(s,o,r)},p:N,i:N,o:N,d(s){s&&p(e),s&&p(n),s&&p(o)}}}class ts extends G{constructor(e){super(),Y(this,e,null,Zo,q,{})}}const mn=Q(null);function es(t){let e,n,o,s,r;return{c(){e=b("h1"),e.textContent="Pagina de inicio",n=w(),o=b("p"),s=D("Hola: "),r=D(t[0])},m(i,c){g(i,e,c),g(i,n,c),g(i,o,c),_(o,s),_(o,r)},p(i,[c]){c&1&&tt(r,i[0])},i:N,o:N,d(i){i&&p(e),i&&p(n),i&&p(o)}}}function ns(t,e,n){let o;z(t,mn,r=>n(1,o=r));let s="";return t.$$.update=()=>{t.$$.dirty&2&&n(0,s=`${o.first_name} ${o.last_name}`.trim()||o.username)},[s,o]}let os=class extends G{constructor(e){super(),Y(this,e,ns,es,q,{})}};function ss(t){let e,n,o;return{c(){e=b("h1"),e.textContent="Acerca de nosotros",n=w(),o=b("p"),o.textContent="hola"},m(s,r){g(s,e,r),g(s,n,r),g(s,o,r)},p:N,i:N,o:N,d(s){s&&p(e),s&&p(n),s&&p(o)}}}class rs extends G{constructor(e){super(),Y(this,e,null,ss,q,{})}}function is(t){let e,n,o;return{c(){e=b("h1"),e.textContent="Datos de contacto",n=w(),o=b("p"),o.textContent="hola"},m(s,r){g(s,e,r),g(s,n,r),g(s,o,r)},p:N,i:N,o:N,d(s){s&&p(e),s&&p(n),s&&p(o)}}}class ls extends G{constructor(e){super(),Y(this,e,null,is,q,{})}}function cs(t){let e,n,o,s,r,i,c,a,l;return{c(){e=b("h1"),e.textContent="Articulos a comprar",n=w(),o=b("h3"),o.textContent="Perrito de juguete",s=w(),r=b("button"),r.textContent="Agregar",i=D(` | +`),c=b("button"),c.textContent="Quitar"},m(f,u){g(f,e,u),g(f,n,u),g(f,o,u),g(f,s,u),g(f,r,u),g(f,i,u),g(f,c,u),a||(l=[lt(r,"click",Ft(t[2])),lt(c,"click",Ft(t[3]))],a=!0)},p:N,i:N,o:N,d(f){f&&p(e),f&&p(n),f&&p(o),f&&p(s),f&&p(r),f&&p(i),f&&p(c),a=!1,rt(l)}}}function us(t,e,n){let o;z(t,ht,a=>n(4,o=a));function s(){Tt(ht,o.cantidad++,o),Tt(ht,o.monto+=1200,o)}function r(){o.cantidad>0&&(Tt(ht,o.cantidad--,o),Tt(ht,o.monto-=1200,o))}return[s,r,()=>s(),()=>r()]}class as extends G{constructor(e){super(),Y(this,e,us,cs,q,{})}}const fs="https://dummyjson.com";async function ds(){const t=await fetch(fs+"/products");if(!t.ok)throw await t.text();return await t.json()}function Ce(t,e,n){const o=t.slice();return o[2]=e[n],o}function Le(t){let e,n,o=t[2].id+"",s,r,i,c=t[2].title+"",a,l,f,u=t[2].description+"",d,h,v,C,k=t[2].price+"",O,M,U,S,$,L;return{c(){e=b("tr"),n=b("td"),s=D(o),r=w(),i=b("td"),a=D(c),l=w(),f=b("td"),d=D(u),h=w(),v=b("td"),C=D("$"),O=D(k),M=w(),U=b("td"),S=b("img"),L=w(),j(S,"width","120"),j(S,"alt","imagen de producto"),_e(S.src,$=t[2].thumbnail)||j(S,"src",$)},m(m,I){g(m,e,I),_(e,n),_(n,s),_(e,r),_(e,i),_(i,a),_(e,l),_(e,f),_(f,d),_(e,h),_(e,v),_(v,C),_(v,O),_(e,M),_(e,U),_(U,S),_(e,L)},p(m,I){I&1&&o!==(o=m[2].id+"")&&tt(s,o),I&1&&c!==(c=m[2].title+"")&&tt(a,c),I&1&&u!==(u=m[2].description+"")&&tt(d,u),I&1&&k!==(k=m[2].price+"")&&tt(O,k),I&1&&!_e(S.src,$=m[2].thumbnail)&&j(S,"src",$)},d(m){m&&p(e)}}}function ms(t){let e,n,o,s,r=t[0],i=[];for(let c=0;cID + Titulo + Descripción + Precio + Imagen`,o=w(),s=b("tbody");for(let c=0;c{B(a,1)}),yt()}s?(e=Bt(s,r()),H(e.$$.fragment),R(e.$$.fragment,1),F(e,n.parentNode,n)):e=null}},i(i){o||(e&&R(e.$$.fragment,i),o=!0)},o(i){e&&A(e.$$.fragment,i),o=!1},d(i){e&&B(e,i),i&&p(n)}}}function Ne(t){let e,n;return e=new No({props:{path:t[0].path,$$slots:{default:[_s]},$$scope:{ctx:t}}}),{c(){H(e.$$.fragment)},m(o,s){F(e,o,s),n=!0},p(o,s){const r={};s&8&&(r.$$scope={dirty:s,ctx:o}),e.$set(r)},i(o){n||(R(e.$$.fragment,o),n=!0)},o(o){A(e.$$.fragment,o),n=!1},d(o){B(e,o)}}}function gs(t){let e,n,o,s,r,i,c;e=new Xo({});let a=Oe,l=[];for(let u=0;uA(l[u],1,1,()=>{l[u]=null});return i=new ts({}),{c(){H(e.$$.fragment),n=w(),o=b("main"),s=b("article");for(let u=0;un(2,r=""),5e3)}finally{n(1,s=!1)}}function c(){o.username=this.value,n(0,o)}function a(){o.password=this.value,n(0,o)}return[o,s,r,i,c,a,()=>i()]}class ws extends G{constructor(e){super(),Y(this,e,$s,ks,q,{})}}let Ue;async function Ss(){try{const t=await Ko();if(!t)throw"";mn.set(t),Ue=new ys({target:document.getElementById("app")})}catch(t){sessionStorage.setItem("login-message",t.detail||t),Ue=new ws({target:document.getElementById("app")})}}Ss(); diff --git a/project/dist/index.html b/project/dist/index.html index e64de90..5049b68 100644 --- a/project/dist/index.html +++ b/project/dist/index.html @@ -5,8 +5,8 @@ Capacitacion de svelte - - + +