hypnagaga/docs/assets/collect-stories-cce06d4a.js
2023-06-10 20:17:38 +01:00

2 lines
9.8 KiB
JavaScript

import{E as X,s as h,F as W,G as H,H as w,S as O,i as E,p as k,I as S,e as Y,a as D,b as m,g as F,t as y,c as P,d as G,J as Z,K as me,L as v,q as oe,u as re,r as ie,v as ae,h as I,j as M,m as L,n as j}from"./index-25af778d.js";const b=[];function K(s,e=X){let o;const t=new Set;function n(c){if(h(s,c)&&(s=c,o)){const a=!b.length;for(const l of t)l[1](),b.push(l,s);if(a){for(let l=0;l<b.length;l+=2)b[l][0](b[l+1]);b.length=0}}}function r(c){n(c(s))}function i(c,a=X){const l=[c,a];return t.add(l),t.size===1&&(o=e(n)||X),c(s),()=>{t.delete(l),t.size===0&&o&&(o(),o=null)}}return{set:n,update:r,subscribe:i}}const J="storybook-registration-context",B="storybook-registration-context-component";function pe(s={}){w(J,{render:!0,register:()=>{},meta:{},args:{},...s})}function Q(){return W(J)||pe(),H(J)}function ce(){return W(B)||w(B,{argsStore:K({}),storyContextStore:K({})}),H(B)}function ye(s,e,o){return Q().meta=e,s.$$set=t=>{o(0,e=k(k({},e),S(t)))},e=S(e),[]}class _e extends O{constructor(e){super(),E(this,e,ye,null,h,{})}}_e.__docgen={version:3,name:"Meta.svelte",data:[],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const ge=s=>s&2,xe=s=>({context:s&4,args:s&2}),$=s=>({...s[1],context:s[2],args:s[1]});function ee(s){let e;const o=s[8].default,t=oe(o,s,s[7],$);return{c(){t&&t.c()},m(n,r){t&&t.m(n,r),e=!0},p(n,r){t&&t.p&&(!e||r&134)&&re(t,o,n,n[7],ge(r)||!e?ie(n[7]):ae(o,n[7],r,xe),$)},i(n){e||(m(t,n),e=!0)},o(n){y(t,n),e=!1},d(n){t&&t.d(n)}}}function be(s){let e,o,t=s[0]&&ee(s);return{c(){t&&t.c(),e=Y()},m(n,r){t&&t.m(n,r),D(n,e,r),o=!0},p(n,[r]){n[0]?t?(t.p(n,r),r&1&&m(t,1)):(t=ee(n),t.c(),m(t,1),t.m(e.parentNode,e)):t&&(F(),y(t,1,1,()=>{t=null}),P())},i(n){o||(m(t),o=!0)},o(n){y(t),o=!1},d(n){t&&t.d(n),n&&G(e)}}}function ke(s,e,o){let t;const n=["name","template"];let r=Z(e,n),i,c,{$$slots:a={},$$scope:l}=e;const C=me(a),p=Q();let{name:u}=e,{template:f=null}=e;if(!u)throw new Error("Missing Story name");p.register({name:u,...r,template:f??(C.default?null:"default")});const _=ce(),T=_.argsStore;v(s,T,d=>o(1,i=d));const x=_.storyContextStore;return v(s,x,d=>o(2,c=d)),s.$$set=d=>{e=k(k({},e),S(d)),o(12,r=Z(e,n)),"name"in d&&o(5,u=d.name),"template"in d&&o(6,f=d.template),"$$scope"in d&&o(7,l=d.$$scope)},s.$$.update=()=>{s.$$.dirty&32&&o(0,t=p.render&&!p.templateName&&p.storyName==u)},[t,i,c,T,x,u,f,l,a]}class he extends O{constructor(e){super(),E(this,e,ke,be,h,{name:5,template:6})}}he.__docgen={version:3,name:"Story.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:"template",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"",name:"default",params:[{name:"{...$args}",type:{kind:"type",text:"*",type:"any"}},{name:"context",type:{kind:"type",text:"*",type:"any"}},{name:"args",type:{kind:"type",text:"*",type:"any"}}],parameters:[{name:"{...$args}",type:{kind:"type",text:"*",type:"any"}},{name:"context",type:{kind:"type",text:"*",type:"any"}},{name:"args",type:{kind:"type",text:"*",type:"any"}}]}],refs:[]};const Ce=s=>s&2,Se=s=>({context:s&4,args:s&2}),te=s=>({...s[1],context:s[2],args:s[1]});function ne(s){let e;const o=s[7].default,t=oe(o,s,s[6],te);return{c(){t&&t.c()},m(n,r){t&&t.m(n,r),e=!0},p(n,r){t&&t.p&&(!e||r&70)&&re(t,o,n,n[6],Ce(r)||!e?ie(n[6]):ae(o,n[6],r,Se),te)},i(n){e||(m(t,n),e=!0)},o(n){y(t,n),e=!1},d(n){t&&t.d(n)}}}function we(s){let e,o,t=s[0]&&ne(s);return{c(){t&&t.c(),e=Y()},m(n,r){t&&t.m(n,r),D(n,e,r),o=!0},p(n,[r]){n[0]?t?(t.p(n,r),r&1&&m(t,1)):(t=ne(n),t.c(),m(t,1),t.m(e.parentNode,e)):t&&(F(),y(t,1,1,()=>{t=null}),P())},i(n){o||(m(t),o=!0)},o(n){y(t),o=!1},d(n){t&&t.d(n),n&&G(e)}}}function Oe(s,e,o){let t,n,r,{$$slots:i={},$$scope:c}=e;const a=Q();let{id:l="default"}=e;a.register({id:l,isTemplate:!0});const C=ce(),p=C.argsStore;v(s,p,f=>o(1,n=f));const u=C.storyContextStore;return v(s,u,f=>o(2,r=f)),s.$$set=f=>{"id"in f&&o(5,l=f.id),"$$scope"in f&&o(6,c=f.$$scope)},s.$$.update=()=>{s.$$.dirty&32&&o(0,t=a.render&&a.templateId===l)},[t,n,r,p,u,l,c,i]}class Ee extends O{constructor(e){super(),E(this,e,Oe,we,h,{id:5})}}Ee.__docgen={version:3,name:"Template.svelte",data:[{visibility:"public",description:null,keywords:[],name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"default"}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"",name:"default",params:[{name:"{...$args}",type:{kind:"type",text:"*",type:"any"}},{name:"context",type:{kind:"type",text:"*",type:"any"}},{name:"args",type:{kind:"type",text:"*",type:"any"}}],parameters:[{name:"{...$args}",type:{kind:"type",text:"*",type:"any"}},{name:"context",type:{kind:"type",text:"*",type:"any"}},{name:"args",type:{kind:"type",text:"*",type:"any"}}]}],refs:[]};module&&module.hot&&module.hot.decline&&module.hot.decline();const{logger:Te}=__STORYBOOK_MODULE_CLIENT_LOGGER__;function Ne(s){const e=s.split("").reduce((o,t)=>(o<<5)-o+t.charCodeAt(0)|0,0);return Math.abs(e).toString(16)}function Re({id:s,name:e},o=[]){if(s)return s;if(!e)throw new Error("Id or Name should be specified");let t=e.replace(/\W+(.|$)/g,(n,r)=>r.toUpperCase());return o.indexOf(t)>=0&&(Te.warn(`Story name conflict with exports - Please add an explicit id for story ${e}`),t+=Ne(e)),t}const le="storybook-registration-context",z="storybook-registration-context-component";function ve(s={}){w(le,{render:!0,register:()=>{},meta:{},args:{},...s})}function Ie(s){w(le,{render:!1,register:e=>{s.stories.push(e)},set meta(e){s.meta=e},args:{}})}function Me(){return W(z)||w(z,{argsStore:K({}),storyContextStore:K({})}),H(z)}function Le(s,e){const o=Me();o.argsStore.set(s),o.storyContextStore.set(e)}function je(s){let e,o,t;var n=s[0];function r(i){return{}}return n&&(e=I(n,r())),{c(){e&&M(e.$$.fragment),o=Y()},m(i,c){e&&L(e,i,c),D(i,o,c),t=!0},p(i,[c]){if(c&1&&n!==(n=i[0])){if(e){F();const a=e;y(a.$$.fragment,1,0,()=>{j(a,1)}),P()}n?(e=I(n,r()),M(e.$$.fragment),m(e.$$.fragment,1),L(e,o.parentNode,o)):e=null}},i(i){t||(e&&m(e.$$.fragment,i),t=!0)},o(i){e&&y(e.$$.fragment,i),t=!1},d(i){i&&G(o),e&&j(e,i)}}}function Ke(s,e,o){let{Stories:t}=e,{repositories:n}=e;return Ie(n),s.$$set=r=>{"Stories"in r&&o(0,t=r.Stories),"repositories"in r&&o(1,n=r.repositories)},[t,n]}class ue extends O{constructor(e){super(),E(this,e,Ke,je,h,{Stories:0,repositories:1})}}ue.__docgen={version:3,name:"RegisterContext.svelte",data:[{visibility:"public",description:null,keywords:[],name:"Stories",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"repositories",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function Ye(s){let e,o,t;var n=s[0];function r(i){return{}}return n&&(e=I(n,r())),{c(){e&&M(e.$$.fragment),o=Y()},m(i,c){e&&L(e,i,c),D(i,o,c),t=!0},p(i,[c]){if(c&1&&n!==(n=i[0])){if(e){F();const a=e;y(a.$$.fragment,1,0,()=>{j(a,1)}),P()}n?(e=I(n,r()),M(e.$$.fragment),m(e.$$.fragment,1),L(e,o.parentNode,o)):e=null}},i(i){t||(e&&m(e.$$.fragment,i),t=!0)},o(i){e&&y(e.$$.fragment,i),t=!1},d(i){i&&G(o),e&&j(e,i)}}}function De(s,e,o){let{Stories:t}=e,{args:n={}}=e,{storyContext:r={}}=e;return ve(e),s.$$set=i=>{o(3,e=k(k({},e),S(i))),"Stories"in i&&o(0,t=i.Stories),"args"in i&&o(1,n=i.args),"storyContext"in i&&o(2,r=i.storyContext)},s.$$.update=()=>{s.$$.dirty&6&&Le(n,r)},e=S(e),[t,n,r]}class fe extends O{constructor(e){super(),E(this,e,De,Ye,h,{Stories:0,args:1,storyContext:2})}}fe.__docgen={version:3,name:"RenderContext.svelte",data:[{visibility:"public",description:null,keywords:[],name:"Stories",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"args",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"}},{visibility:"public",description:null,keywords:[],name:"storyContext",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"}}],computed:[],methods:[],components:[],description:"@component",keywords:[{name:"component",description:""},{name:"wrapper",description:""}],events:[],slots:[],refs:[]};const{logger:V}=__STORYBOOK_MODULE_CLIENT_LOGGER__,{combineParameters:se}=__STORYBOOK_MODULE_CLIENT_API__,Fe=document.createDocumentFragment?()=>document.createDocumentFragment():()=>document.createElement("div"),Ge=(s,{stories:e={},allocatedIds:o})=>{const t={meta:null,stories:[]};try{new ue({target:Fe(),props:{Stories:s,repositories:t}}).$destroy()}catch(a){V.error(`Error extracting stories ${a.toString()}`,a)}const{meta:n}=t;if(!n)return V.error("Missing <Meta/> tag"),{};const{component:r}=n,i=t.stories.filter(a=>a.isTemplate).map(a=>a.id),c=i.filter((a,l)=>i.indexOf(a)!==l);return c.length>0&&V.warn(`Found duplicates templates id for stories '${n.name}': ${c}`),{meta:n,stories:t.stories.filter(a=>!a.isTemplate).reduce((a,l)=>{const{id:C,name:p,template:u,component:f,source:_=!1,...T}=l,x=Re(l,o);if(!x)return a;const d=u!=null&&i.indexOf(u)<0,g=(A,U)=>{if(d)throw new Error(`Story ${p} is referencing an unknown template ${u}`);return{Component:fe,props:{Stories:s,storyName:p,templateId:u,args:A,storyContext:U,sourceComponent:f||r}}};g.storyName=p,Object.entries(T).forEach(([A,U])=>{g[A]=U});const N=e[u?`tpl:${u}`:x],de=N?N.hasArgs:!0,q=N?N.source:null;q&&(g.parameters=se(g.parameters||{},{storySource:{source:q}}));let R;return _===!0||_===!1&&!de?R=q:typeof _=="string"&&(R=_),R&&(g.parameters=se(g.parameters||{},{docs:{source:{code:R}}})),a[x]=g,a},{})}};export{_e as M,he as S,Ee as T,Ge as p,K as w};
//# sourceMappingURL=collect-stories-cce06d4a.js.map