Anvil/assets/entry-preview-0f676f23.js
André Jaenisch 5cbc208247
Updates
2024-02-08 10:52:22 +01:00

5 lines
7.6 KiB
JavaScript

import{S as Y,i as B,s as L,t as d,c as O,a as _,g as E,f as j,b as y,d as v,m as h,e as g,h as U}from"./index-29d97ebc.js";import{r as m,j as R,h as T,o as K,u as k}from"./lifecycle-1566062d.js";import{d as W}from"./index-356e4a49.js";function w(r,e){const t={},s={},f={$$scope:1};let i=r.length;for(;i--;){const a=r[i],n=e[i];if(n){for(const o in a)o in n||(s[o]=1);for(const o in n)f[o]||(t[o]=n[o],f[o]=1);r[i]=n}else for(const o in a)f[o]=1}for(const a in s)a in t||(t[a]=void 0);return t}function b(r){return typeof r=="object"&&r!==null?r:{}}function q(r){let e,t,s;const f=[r[2]];var i=r[1];function a(n,o){let l={};if(o!==void 0&&o&4)l=w(f,[b(n[2])]);else for(let c=0;c<f.length;c+=1)l=U(l,f[c]);return{props:l}}return i&&(e=k(i,a(r)),r[8](e)),{c(){e&&y(e.$$.fragment),t=m()},l(n){e&&v(e.$$.fragment,n),t=m()},m(n,o){e&&h(e,n,o),R(n,t,o),s=!0},p(n,o){if(o&2&&i!==(i=n[1])){if(e){E();const l=e;d(l.$$.fragment,1,0,()=>{g(l,1)}),O()}i?(e=k(i,a(n,o)),n[8](e),y(e.$$.fragment),_(e.$$.fragment,1),h(e,t.parentNode,t)):e=null}else if(i){const l=o&4?w(f,[b(n[2])]):{};e.$set(l)}},i(n){s||(e&&_(e.$$.fragment,n),s=!0)},o(n){e&&d(e.$$.fragment,n),s=!1},d(n){n&&T(t),r[8](null),e&&g(e,n)}}}function z(r){let e,t,s;const f=[r[0].props];var i=r[0].Component;function a(n,o){let l={$$slots:{default:[G]},$$scope:{ctx:n}};if(o!==void 0&&o&1)l=w(f,[b(n[0].props)]);else for(let c=0;c<f.length;c+=1)l=U(l,f[c]);return{props:l}}return i&&(e=k(i,a(r)),r[7](e)),{c(){e&&y(e.$$.fragment),t=m()},l(n){e&&v(e.$$.fragment,n),t=m()},m(n,o){e&&h(e,n,o),R(n,t,o),s=!0},p(n,o){if(o&1&&i!==(i=n[0].Component)){if(e){E();const l=e;d(l.$$.fragment,1,0,()=>{g(l,1)}),O()}i?(e=k(i,a(n,o)),n[7](e),y(e.$$.fragment),_(e.$$.fragment,1),h(e,t.parentNode,t)):e=null}else if(i){const l=o&1?w(f,[b(n[0].props)]):{};o&1038&&(l.$$scope={dirty:o,ctx:n}),e.$set(l)}},i(n){s||(e&&_(e.$$.fragment,n),s=!0)},o(n){e&&d(e.$$.fragment,n),s=!1},d(n){n&&T(t),r[7](null),e&&g(e,n)}}}function G(r){let e,t,s;const f=[r[2]];var i=r[1];function a(n,o){let l={};if(o!==void 0&&o&4)l=w(f,[b(n[2])]);else for(let c=0;c<f.length;c+=1)l=U(l,f[c]);return{props:l}}return i&&(e=k(i,a(r)),r[6](e)),{c(){e&&y(e.$$.fragment),t=m()},l(n){e&&v(e.$$.fragment,n),t=m()},m(n,o){e&&h(e,n,o),R(n,t,o),s=!0},p(n,o){if(o&2&&i!==(i=n[1])){if(e){E();const l=e;d(l.$$.fragment,1,0,()=>{g(l,1)}),O()}i?(e=k(i,a(n,o)),n[6](e),y(e.$$.fragment),_(e.$$.fragment,1),h(e,t.parentNode,t)):e=null}else if(i){const l=o&4?w(f,[b(n[2])]):{};e.$set(l)}},i(n){s||(e&&_(e.$$.fragment,n),s=!0)},o(n){e&&d(e.$$.fragment,n),s=!1},d(n){n&&T(t),r[6](null),e&&g(e,n)}}}function H(r){let e,t,s,f;const i=[z,q],a=[];function n(o,l){return o[0]?0:1}return e=n(r),t=a[e]=i[e](r),{c(){t.c(),s=m()},l(o){t.l(o),s=m()},m(o,l){a[e].m(o,l),R(o,s,l),f=!0},p(o,[l]){let c=e;e=n(o),e===c?a[e].p(o,l):(E(),d(a[c],1,1,()=>{a[c]=null}),O(),t=a[e],t?t.p(o,l):(t=a[e]=i[e](o),t.c()),_(t,1),t.m(s.parentNode,s))},i(o){f||(_(t),f=!0)},o(o){d(t),f=!1},d(o){o&&T(s),a[e].d(o)}}}function J(r,e,t){let{decorator:s=void 0}=e,{Component:f}=e,{props:i={}}=e,{on:a=void 0}=e,n,o;function l(){return n||o}a&&Object.keys(a).forEach(u=>{K(()=>l().$on(u,a[u]))});function c(u){j[u?"unshift":"push"](()=>{n=u,t(3,n)})}function S(u){j[u?"unshift":"push"](()=>{o=u,t(4,o)})}function D(u){j[u?"unshift":"push"](()=>{n=u,t(3,n)})}return r.$$set=u=>{"decorator"in u&&t(0,s=u.decorator),"Component"in u&&t(1,f=u.Component),"props"in u&&t(2,i=u.props),"on"in u&&t(5,a=u.on)},[s,f,i,n,o,a,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(r){let e,t;return e=new A({props:{Component:r[0],props:r[1],on:{...r[3],...r[2]}}}),{c(){y(e.$$.fragment)},l(s){v(e.$$.fragment,s)},m(s,f){h(e,s,f),t=!0},p(s,[f]){const i={};f&1&&(i.Component=s[0]),f&2&&(i.props=s[1]),f&4&&(i.on={...s[3],...s[2]}),e.$set(i)},i(s){t||(_(e.$$.fragment,s),t=!0)},o(s){d(e.$$.fragment,s),t=!1},d(s){g(e,s)}}}function X(r,e,t){let{name:s}=e,{kind:f}=e,{storyFn:i}=e,{showError:a}=e,{storyContext:n}=e,{Component:o,props:l={},on:c}=i(),S=!0;function D(p){return S?(S=!1,{Component:o,props:l,on:c}):p()}const u=Object.fromEntries(Object.entries(n.argTypes).filter(([p,F])=>F.action&&l[p]!=null).map(([p,F])=>[F.action,l[p]]));return o||a({title:`Expecting a Svelte component from the story: "${s}" of "${f}".`,description:W`
Did you forget to return the Svelte component configuration from the story?
Use "() => ({ Component: YourComponent, props: {} })"
when defining the story.
`}),r.$$set=p=>{"name"in p&&t(4,s=p.name),"kind"in p&&t(5,f=p.kind),"storyFn"in p&&t(6,i=p.storyFn),"showError"in p&&t(7,a=p.showError),"storyContext"in p&&t(8,n=p.storyContext)},r.$$.update=()=>{r.$$.dirty&64&&t(0,{Component:o,props:l={},on:c}=D(i),o,(t(1,l),t(6,i)),(t(2,c),t(6,i)))},[o,l,c,u,s,f,i,a,n]}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(r){return r&&typeof r=="object"&&"default"in r?r.default:r}function N(r,e,t){let s=I(e),f=t&&I(t),i;return!s||Object.keys(s).length===0?i={Component:r.component}:s.Component?i=s:i={Component:s},f?{Component:A,props:{...f,decorator:i}}:i}function oe(r,e){return e.reduce((t,s)=>f=>{let i,a=s(n=>(i=t({...f,...$(n)}),i),f);return i||(i=t(f)),a===i?i:N(f,a,i)},t=>N(t,r(t)))}var C=new Map;function P(r){C.has(r)&&(C.get(r).$destroy(),r.innerHTML="",C.delete(r))}var M=new Set;Z.getChannel().on(x,({storyId:r})=>{M.add(r)});function ie({storyFn:r,kind:e,name:t,showMain:s,showError:f,storyContext:i,forceRemount:a},n){let o=C.get(n),l=a;if(M.has(i.id)&&(l=!0,M.delete(i.id)),l&&P(n),!o||l){let c=new V({target:n,props:{storyFn:r,storyContext:i,name:t,kind:e,showError:f}});C.set(n,c)}else o.$set({storyFn:r,storyContext:i,name:t,kind:e,showError:f});return s(),()=>{P(n)}}var re=(r,e)=>{let{id:t,component:s}=e;if(!s)throw new Error(`Unable to render story ${t} as the component annotation is missing from the default export`);return{Component:s,props:r}},se={renderer:"svelte"};export{oe as applyDecorators,se as parameters,re as render,ie as renderToCanvas};