Anvil/assets/entry-preview-5c34d948.js

6 lines
7.4 KiB
JavaScript
Raw Normal View History

2024-03-14 19:56:07 +01:00
import{a as Y,d as w}from"./utils-6ebe0a8e.js";import{e as _,i as v,d as E,o as K,u as k}from"./lifecycle-cafe499b.js";import{S as B,i as L,t as d,e as R,a as m,g as T,f as U,c as y,b as D,m as h,d as g}from"./index-3a0d73e3.js";import{g as b,a as C}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={};for(let c=0;c<a.length;c+=1)l=w(l,a[c]);return o!==void 0&&o&4&&(l=w(l,b(a,[C(t[2])]))),{props:l}}return r&&(e=k(r,f(s)),s[8](e)),{c(){e&&y(e.$$.fragment),n=_()},l(t){e&&D(e.$$.fragment,t),n=_()},m(t,o){e&&h(e,t,o),v(t,n,o),i=!0},p(t,o){if(o&2&&r!==(r=t[1])){if(e){T();const l=e;d(l.$$.fragment,1,0,()=>{g(l,1)}),R()}r?(e=k(r,f(t,o)),t[8](e),y(e.$$.fragment),m(e.$$.fragment,1),h(e,n.parentNode,n)):e=null}else if(r){const l=o&4?b(a,[C(t[2])]):{};e.$set(l)}},i(t){i||(e&&m(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&E(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}};for(let c=0;c<a.length;c+=1)l=w(l,a[c]);return o!==void 0&&o&1&&(l=w(l,b(a,[C(t[0].props)]))),{props:l}}return r&&(e=k(r,f(s)),s[7](e)),{c(){e&&y(e.$$.fragment),n=_()},l(t){e&&D(e.$$.fragment,t),n=_()},m(t,o){e&&h(e,t,o),v(t,n,o),i=!0},p(t,o){if(o&1&&r!==(r=t[0].Component)){if(e){T();const l=e;d(l.$$.fragment,1,0,()=>{g(l,1)}),R()}r?(e=k(r,f(t,o)),t[7](e),y(e.$$.fragment),m(e.$$.fragment,1),h(e,n.parentNode,n)):e=null}else if(r){const l=o&1?b(a,[C(t[0].props)]):{};o&1038&&(l.$$scope={dirty:o,ctx:t}),e.$set(l)}},i(t){i||(e&&m(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&E(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={};for(let c=0;c<a.length;c+=1)l=w(l,a[c]);return o!==void 0&&o&4&&(l=w(l,b(a,[C(t[2])]))),{props:l}}return r&&(e=k(r,f(s)),s[6](e)),{c(){e&&y(e.$$.fragment),n=_()},l(t){e&&D(e.$$.fragment,t),n=_()},m(t,o){e&&h(e,t,o),v(t,n,o),i=!0},p(t,o){if(o&2&&r!==(r=t[1])){if(e){T();const l=e;d(l.$$.fragment,1,0,()=>{g(l,1)}),R()}r?(e=k(r,f(t,o)),t[6](e),y(e.$$.fragment),m(e.$$.fragment,1),h(e,n.parentNode,n)):e=null}else if(r){const l=o&4?b(a,[C(t[2])]):{};e.$set(l)}},i(t){i||(e&&m(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){t&&E(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=_()},l(o){n.l(o),i=_()},m(o,l){f[e].m(o,l),v(o,i,l),a=!0},p(o,[l]){let c=e;e=t(o),e===c?f[e].p(o,l):(T(),d(f[c],1,1,()=>{f[c]=null}),R(),n=f[e],n?n.p(o,l):(n=f[e]=r[e](o),n.c()),m(n,1),n.m(i.parentNode,i))},i(o){a||(m(n),a=!0)},o(o){d(n),a=!1},d(o){o&&E(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){U[p?"unshift":"push"](()=>{t=p,n(3,t)})}function O(p){U[p?"unshift":"push"](()=>{o=p,n(4,o)})}function F(p){U[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,O,F]}class A extends B{constructor(e){super(),L(this,e,J,H,Y,{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:{C
2024-03-14 18:43:30 +01:00
Did you forget to return the Svelte component configuration from the story?
Use "() => ({ Component: YourComponent, props: {} })"
when defining the story.
`}),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}=F(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 B{constructor(e){super(),L(this,e,X,Q,Y,{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 ie(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 S=new Map;function P(s){S.has(s)&&(S.get(s).$destroy(),s.innerHTML="",S.delete(s))}var j=new Set;Z.getChannel().on(x,({storyId:s})=>{j.add(s)});function se({storyFn:s,kind:e,name:n,showMain:i,showError:a,storyContext:r,forceRemount:f},t){let o=S.get(t),l=f;if(j.has(r.id)&&(l=!0,j.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}});S.set(t,c)}else o.$set({storyFn:s,storyContext:r,name:n,kind:e,showError:a});return i(),()=>{P(t)}}var le=(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}},ae={renderer:"svelte"};export{ie as applyDecorators,ae as parameters,le as render,se as renderToCanvas};