2024-02-12 12:40:14 +01:00
|
|
|
import{S as Y,i as B,s as L,t as d,c as v,a as _,g as O,f as j,b as y,d as E,m as h,e as g,h as U}from"./index-788dbe18.js";import{r as m,j as R,h as T,o as K,v as w}from"./lifecycle-e76756ca.js";import{g as k,a as b}from"./spread-8a54911c.js";import{d as W}from"./index-356e4a49.js";function q(s){let e,n,i;const a=[s[2]];var r=s[1];function f(t,o){let l={};if(o!==void 0&&o&4)l=k(a,[b(t[2])]);else for(let c=0;c<a.length;c+=1)l=U(l,a[c]);return{props:l}}return r&&(e=w(r,f(s)),s[8](e)),{c(){e&&y(e.$$.fragment),n=m()},l(t){e&&E(e.$$.fragment,t),n=m()},m(t,o){e&&h(e,t,o),R(t,n,o),i=!0},p(t,o){if(o&2&&r!==(r=t[1])){if(e){O();const l=e;d(l.$$.fragment,1,0,()=>{g(l,1)}),v()}r?(e=w(r,f(t,o)),t[8](e),y(e.$$.fragment),_(e.$$.fragment,1),h(e,n.parentNode,n)):e=null}else if(r){const l=o&4?k(a,[b(t[2])]):{};e.$set(l)}},i(t){i||(e&&_(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&T(n),s[8](null),e&&g(e,t)}}}function z(s){let e,n,i;const a=[s[0].props];var r=s[0].Component;function f(t,o){let l={$$slots:{default:[G]},$$scope:{ctx:t}};if(o!==void 0&&o&1)l=k(a,[b(t[0].props)]);else for(let c=0;c<a.length;c+=1)l=U(l,a[c]);return{props:l}}return r&&(e=w(r,f(s)),s[7](e)),{c(){e&&y(e.$$.fragment),n=m()},l(t){e&&E(e.$$.fragment,t),n=m()},m(t,o){e&&h(e,t,o),R(t,n,o),i=!0},p(t,o){if(o&1&&r!==(r=t[0].Component)){if(e){O();const l=e;d(l.$$.fragment,1,0,()=>{g(l,1)}),v()}r?(e=w(r,f(t,o)),t[7](e),y(e.$$.fragment),_(e.$$.fragment,1),h(e,n.parentNode,n)):e=null}else if(r){const l=o&1?k(a,[b(t[0].props)]):{};o&1038&&(l.$$scope={dirty:o,ctx:t}),e.$set(l)}},i(t){i||(e&&_(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&T(n),s[7](null),e&&g(e,t)}}}function G(s){let e,n,i;const a=[s[2]];var r=s[1];function f(t,o){let l={};if(o!==void 0&&o&4)l=k(a,[b(t[2])]);else for(let c=0;c<a.length;c+=1)l=U(l,a[c]);return{props:l}}return r&&(e=w(r,f(s)),s[6](e)),{c(){e&&y(e.$$.fragment),n=m()},l(t){e&&E(e.$$.fragment,t),n=m()},m(t,o){e&&h(e,t,o),R(t,n,o),i=!0},p(t,o){if(o&2&&r!==(r=t[1])){if(e){O();const l=e;d(l.$$.fragment,1,0,()=>{g(l,1)}),v()}r?(e=w(r,f(t,o)),t[6](e),y(e.$$.fragment),_(e.$$.fragment,1),h(e,n.parentNode,n)):e=null}else if(r){const l=o&4?k(a,[b(t[2])]):{};e.$set(l)}},i(t){i||(e&&_(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&T(n),s[6](null),e&&g(e,t)}}}function H(s){let e,n,i,a;const r=[z,q],f=[];function t(o,l){return o[0]?0:1}return e=t(s),n=f[e]=r[e](s),{c(){n.c(),i=m()},l(o){n.l(o),i=m()},m(o,l){f[e].m(o,l),R(o,i,l),a=!0},p(o,[l]){let c=e;e=t(o),e===c?f[e].p(o,l):(O(),d(f[c],1,1,()=>{f[c]=null}),v(),n=f[e],n?n.p(o,l):(n=f[e]=r[e](o),n.c()),_(n,1),n.m(i.parentNode,i))},i(o){a||(_(n),a=!0)},o(o){d(n),a=!1},d(o){o&&T(i),f[e].d(o)}}}function J(s,e,n){let{decorator:i=void 0}=e,{Component:a}=e,{props:r={}}=e,{on:f=void 0}=e,t,o;function l(){return t||o}f&&Object.keys(f).forEach(p=>{K(()=>l().$on(p,f[p]))});function c(p){j[p?"unshift":"push"](()=>{t=p,n(3,t)})}function S(p){j[p?"unshift":"push"](()=>{o=p,n(4,o)})}function D(p){j[p?"unshift":"push"](()=>{t=p,n(3,t)})}return s.$$set=p=>{"decorator"in p&&n(0,i=p.decorator),"Component"in p&&n(1,a=p.Component),"props"in p&&n(2,r=p.props),"on"in p&&n(5,f=p.on)},[i,a,r,t,o,f,c,S,D]}class A extends Y{constructor(e){super(),B(this,e,J,H,L,{decorator:0,Component:1,props:2,on:5})}}A.__docgen={version:3,name:"SlotDecorator.svelte",data:[{visibility:"public",description:null,keywords:[],name:"decorator",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"Component",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"props",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"}},{visibility:"public",description:null,keywords:[],name:"on",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function Q(s){let e,n;return e=new A({props:{Component:s[0],props:s[1],on:{...s[3]
|
|
|
|
`}),s.$$set=u=>{"name"in u&&n(4,i=u.name),"kind"in u&&n(5,a=u.kind),"storyFn"in u&&n(6,r=u.storyFn),"showError"in u&&n(7,f=u.showError),"storyContext"in u&&n(8,t=u.storyContext)},s.$$.update=()=>{s.$$.dirty&64&&n(0,{Component:o,props:l={},on:c}=D(r),o,(n(1,l),n(6,r)),(n(2,c),n(6,r)))},[o,l,c,p,i,a,r,f,t]}class V extends Y{constructor(e){super(),B(this,e,X,Q,L,{name:4,kind:5,storyFn:6,showError:7,storyContext:8})}}V.__docgen={version:3,name:"PreviewRender.svelte",data:[{visibility:"public",description:null,keywords:[],name:"name",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"kind",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"storyFn",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"showError",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"storyContext",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const{addons:Z,sanitizeStoryContextUpdate:$}=__STORYBOOK_MODULE_PREVIEW_API__,{RESET_STORY_ARGS:x}=__STORYBOOK_MODULE_CORE_EVENTS__;function I(s){return s&&typeof s=="object"&&"default"in s?s.default:s}function N(s,e,n){let i=I(e),a=n&&I(n),r;return!i||Object.keys(i).length===0?r={Component:s.component}:i.Component?r=i:r={Component:i},a?{Component:A,props:{...a,decorator:r}}:r}function re(s,e){return e.reduce((n,i)=>a=>{let r,f=i(t=>(r=n({...a,...$(t)}),r),a);return r||(r=n(a)),f===r?r:N(a,f,r)},n=>N(n,s(n)))}var C=new Map;function P(s){C.has(s)&&(C.get(s).$destroy(),s.innerHTML="",C.delete(s))}var M=new Set;Z.getChannel().on(x,({storyId:s})=>{M.add(s)});function ie({storyFn:s,kind:e,name:n,showMain:i,showError:a,storyContext:r,forceRemount:f},t){let o=C.get(t),l=f;if(M.has(r.id)&&(l=!0,M.delete(r.id)),l&&P(t),!o||l){let c=new V({target:t,props:{storyFn:s,storyContext:r,name:n,kind:e,showError:a}});C.set(t,c)}else o.$set({storyFn:s,storyContext:r,name:n,kind:e,showError:a});return i(),()=>{P(t)}}var se=(s,e)=>{let{id:n,component:i}=e;if(!i)throw new Error(`Unable to render story ${n} as the component annotation is missing from the default export`);return{Component:i,props:s}},le={renderer:"svelte"};export{re as applyDecorators,le as parameters,se as render,ie as renderToCanvas};
|