Anvil/assets/Header-976773b5.js

2 lines
3.3 KiB
JavaScript
Raw Normal View History

2024-02-08 10:52:22 +01:00
import{S,i as j,s as C,t as k,c as I,a as y,g as T,b as E,d as H,m as L,n as W,e as V}from"./index-29d97ebc.js";import{e as v,a as M,c as b,b as $,d as q,f as D,h as d,i as F,j as w,k as h,l as N,t as A,m as z,n as P}from"./lifecycle-1566062d.js";import{B}from"./Button-880c7a21.js";function R(f){let t,s,l,r;return t=new B({props:{size:"small",label:"Log in"}}),t.$on("click",f[1]),l=new B({props:{primary:!0,size:"small",label:"Sign up"}}),l.$on("click",f[3]),{c(){E(t.$$.fragment),s=M(),E(l.$$.fragment)},l(n){H(t.$$.fragment,n),s=D(n),H(l.$$.fragment,n)},m(n,c){L(t,n,c),w(n,s,c),L(l,n,c),r=!0},p:W,i(n){r||(y(t.$$.fragment,n),y(l.$$.fragment,n),r=!0)},o(n){k(t.$$.fragment,n),k(l.$$.fragment,n),r=!1},d(n){n&&d(s),V(t,n),V(l,n)}}}function G(f){let t,s,l,r=f[0].name+"",n,c,a,e,m;return e=new B({props:{size:"small",label:"Log out"}}),e.$on("click",f[2]),{c(){t=v("span"),s=A("Welcome, "),l=v("b"),n=A(r),c=A("!"),a=M(),E(e.$$.fragment),this.h()},l(i){t=b(i,"SPAN",{class:!0});var o=$(t);s=z(o,"Welcome, "),l=b(o,"B",{});var g=$(l);n=z(g,r),g.forEach(d),c=z(o,"!"),o.forEach(d),a=D(i),H(e.$$.fragment,i),this.h()},h(){F(t,"class","welcome")},m(i,o){w(i,t,o),h(t,s),h(t,l),h(l,n),h(t,c),w(i,a,o),L(e,i,o),m=!0},p(i,o){(!m||o&1)&&r!==(r=i[0].name+"")&&P(n,r)},i(i){m||(y(e.$$.fragment,i),m=!0)},o(i){k(e.$$.fragment,i),m=!1},d(i){i&&(d(t),d(a)),V(e,i)}}}function J(f){let t,s,l,r='<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z" fill="#FFF"></path><path d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z" fill="#555AB9"></path><path d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z" fill="#91BAF8"></path></g></svg> <h1>Acme</h1>',n,c,a,e,m;const i=[G,R],o=[];function g(u,p){return u[0]?0:1}return a=g(f),e=o[a]=i[a](f),{c(){t=v("header"),s=v("div"),l=v("div"),l.innerHTML=r,n=M(),c=v("div"),e.c(),this.h()},l(u){t=b(u,"HEADER",{});var p=$(t);s=b(p,"DIV",{class:!0});var _=$(s);l=b(_,"DIV",{"data-svelte-h":!0}),q(l)!=="svelte-mhlgcu"&&(l.innerHTML=r),n=D(_),c=b(_,"DIV",{});var x=$(c);e.l(x),x.forEach(d),_.forEach(d),p.forEach(d),this.h()},h(){F(s,"class","storybook-header")},m(u,p){w(u,t,p),h(t,s),h(s,l),h(s,n),h(s,c),o[a].m(c,null),m=!0},p(u,[p]){let _=a;a=g(u),a===_?o[a].p(u,p):(T(),k(o[_],1,1,()=>{o[_]=null}),I(),e=o[a],e?e.p(u,p):(e=o[a]=i[a](u),e.c()),y(e,1),e.m(c,null))},i(u){m||(y(e),m=!0)},o(u){k(e),m=!1},d(u){u&&d(t),o[a].d()}}}function K(f,t,s){let{user:l=null}=t;const r=N();function n(e){r("login",e)}function c(e){r("logout",e)}function a(e){r("createAccount",e)}return f.$$set=e=>{"user"in e&&s(0,l=e.user)},[l,n,c,a]}class O extends S{constructor(t){super(),j(this,t,K,J,C,{user:0})}}O.__docgen={version:3,name:"Header.svelte",data:[{visibility:"public",description:null,keywords:[],name:"user",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null}],computed:[],methods:[],components:[],description:null,keywords:[],events:[{visibility:"public",description:null,keywords:[],name:"login"},{visibility:"public",description:null,keywords:[],name:"logout"},{visibility:"public",description:null,keywords:[],name:"createAccount"}],slots:[],refs:[]};export{O as H};