4 lines
15 KiB
JavaScript
4 lines
15 KiB
JavaScript
import{S as H,i as M,s as P,v as D,d as $,w as W,h as c,x as F,t as u,f as y,l as A,u as I,p as V,q as S,o as G,b as X,g as b,m as g,j as h,y as x,z as L,k as ee,e as te,A as ie}from"./index-85f88930.js";import{B as Y}from"./Block-d1b8152c.js";import{P as z}from"./PaddingReset-c34038dd.js";import{M as U}from"./Markdown-e31fd5d7.js";function ne(s){let t;const n=s[2].default,e=A(n,s,s[1],null);return{c(){e&&e.c()},m(i,l){e&&e.m(i,l),t=!0},p(i,l){e&&e.p&&(!t||l&2)&&I(e,n,i,i[1],t?S(n,i[1],l,null):V(i[1]),null)},i(i){t||(u(e,i),t=!0)},o(i){c(e,i),t=!1},d(i){e&&e.d(i)}}}function le(s){let t,n;const e=s[2].default,i=A(e,s,s[1],null);return{c(){t=G("div"),i&&i.c(),X(t,"aria-hidden","true")},m(l,r){$(l,t,r),i&&i.m(t,null),n=!0},p(l,r){i&&i.p&&(!n||r&2)&&I(i,e,l,l[1],n?S(e,l[1],r,null):V(l[1]),null)},i(l){n||(u(i,l),n=!0)},o(l){c(i,l),n=!1},d(l){l&&y(t),i&&i.d(l)}}}function se(s){let t,n,e,i;const l=[le,ne],r=[];function a(o,d){return o[0]?0:1}return t=a(s),n=r[t]=l[t](s),{c(){n.c(),e=D()},m(o,d){r[t].m(o,d),$(o,e,d),i=!0},p(o,[d]){let k=t;t=a(o),t===k?r[t].p(o,d):(W(),c(r[k],1,1,()=>{r[k]=null}),F(),n=r[t],n?n.p(o,d):(n=r[t]=l[t](o),n.c()),u(n,1),n.m(e.parentNode,e))},i(o){i||(u(n),i=!0)},o(o){c(n),i=!1},d(o){o&&y(e),r[t].d(o)}}}function re(s,t,n){let{$$slots:e={},$$scope:i}=t,{hidden:l=!1}=t;return s.$$set=r=>{"hidden"in r&&n(0,l=r.hidden),"$$scope"in r&&n(1,i=r.$$scope)},[l,i,e]}class Z extends H{constructor(t){super(),M(this,t,re,se,P,{hidden:0})}}Z.__docgen={version:3,name:"AriaHidden.svelte",data:[{keywords:[],visibility:"public",description:"Whether to wrap the graphic with an aria hidden tag.",name:"hidden",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"",name:"default"}],refs:[]};function oe(s){let t;const n=s[1].default,e=A(n,s,s[2],null);return{c(){e&&e.c()},m(i,l){e&&e.m(i,l),t=!0},p(i,l){e&&e.p&&(!t||l&4)&&I(e,n,i,i[2],t?S(n,i[2],l,null):V(i[2]),null)},i(i){t||(u(e,i),t=!0)},o(i){c(e,i),t=!1},d(i){e&&e.d(i)}}}function ae(s){let t,n;return t=new Y({props:{width:s[0],class:"notes fmy-0",$$slots:{default:[fe]},$$scope:{ctx:s}}}),{c(){b(t.$$.fragment)},m(e,i){g(t,e,i),n=!0},p(e,i){const l={};i&1&&(l.width=e[0]),i&4&&(l.$$scope={dirty:i,ctx:e}),t.$set(l)},i(e){n||(u(t.$$.fragment,e),n=!0)},o(e){c(t.$$.fragment,e),n=!1},d(e){h(t,e)}}}function fe(s){let t;const n=s[1].default,e=A(n,s,s[2],null);return{c(){e&&e.c()},m(i,l){e&&e.m(i,l),t=!0},p(i,l){e&&e.p&&(!t||l&4)&&I(e,n,i,i[2],t?S(n,i[2],l,null):V(i[2]),null)},i(i){t||(u(e,i),t=!0)},o(i){c(e,i),t=!1},d(i){e&&e.d(i)}}}function ue(s){let t,n,e,i;const l=[ae,oe],r=[];function a(o,d){return o[0]?0:1}return t=a(s),n=r[t]=l[t](s),{c(){n.c(),e=D()},m(o,d){r[t].m(o,d),$(o,e,d),i=!0},p(o,[d]){let k=t;t=a(o),t===k?r[t].p(o,d):(W(),c(r[k],1,1,()=>{r[k]=null}),F(),n=r[t],n?n.p(o,d):(n=r[t]=l[t](o),n.c()),u(n,1),n.m(e.parentNode,e))},i(o){i||(u(n),i=!0)},o(o){c(n),i=!1},d(o){o&&y(e),r[t].d(o)}}}function ce(s,t,n){let{$$slots:e={},$$scope:i}=t,{width:l=null}=t;return s.$$set=r=>{"width"in r&&n(0,l=r.width),"$$scope"in r&&n(2,i=r.$$scope)},[l,e,i]}class C extends H{constructor(t){super(),M(this,t,ce,ue,P,{width:0})}}C.__docgen={version:3,name:"TextBlock.svelte",data:[{keywords:[],visibility:"public",description:"Width of the component within the text well.",name:"width",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"}],refs:[]};const de=s=>({}),E=s=>({}),pe=s=>({}),J=s=>({}),_e=s=>({}),K=s=>({});function me(s){let t,n;return t=new z({props:{containerIsFluid:s[0]==="fluid",$$slots:{default:[ge]},$$scope:{ctx:s}}}),{c(){b(t.$$.fragment)},m(e,i){g(t,e,i),n=!0},p(e,i){const l={};i&1&&(l.containerIsFluid=e[0]==="fluid"),i&8640&&(l.$$scope={dirty:i,ctx:e}),t.$set(l)},i(e){n||(u(t.$$.fragment,e),n=!0)},o(e){c(t.$$.fragment,e),n=!1},d(e){h(t,e)}}}function ke(s){let t,n;return t=new z({props:{containerIsFluid:s[0]==="fluid",$$slots:{default:[$e]},$$scope:{ctx:s}}}),{c(){b(t.$$.fragment)},m(e,i){g(t,e,i),n=!0},p(e,i){const l={};i&1&&(l.containerIsFluid=e[0]==="fluid"),i&8256&&(l.$$scope={dirty:i,ctx:e}),t.$set(l)},i(e){n||(u(t.$$.fragment,e),n=!0)},o(e){c(t.$$.fragment,e),n=!1},d(e){h(t,e)}}}function O(s){let t,n;return t=new U({props:{source:s[8]}}),{c(){b(t.$$.fragment)},m(e,i){g(t,e,i),n=!0},p(e,i){const l={};i&256&&(l.source=e[8]),t.$set(l)},i(e){n||(u(t.$$.fragment,e),n=!0)},o(e){c(t.$$.fragment,e),n=!1},d(e){h(t,e)}}}function be(s){let t,n,e,i,l,r=s[8]&&O(s);return{c(){t=G("h3"),n=ee(s[7]),e=L(),r&&r.c(),i=D()},m(a,o){$(a,t,o),te(t,n),$(a,e,o),r&&r.m(a,o),$(a,i,o),l=!0},p(a,o){(!l||o&128)&&ie(n,a[7]),a[8]?r?(r.p(a,o),o&256&&u(r,1)):(r=O(a),r.c(),u(r,1),r.m(i.parentNode,i)):r&&(W(),c(r,1,1,()=>{r=null}),F())},i(a){l||(u(r),l=!0)},o(a){c(r),l=!1},d(a){a&&(y(t),y(e),y(i)),r&&r.d(a)}}}function ge(s){let t,n;return t=new C({props:{width:s[6],$$slots:{default:[be]},$$scope:{ctx:s}}}),{c(){b(t.$$.fragment)},m(e,i){g(t,e,i),n=!0},p(e,i){const l={};i&64&&(l.width=e[6]),i&8576&&(l.$$scope={dirty:i,ctx:e}),t.$set(l)},i(e){n||(u(t.$$.fragment,e),n=!0)},o(e){c(t.$$.fragment,e),n=!1},d(e){h(t,e)}}}function he(s){let t;const n=s[12].title,e=A(n,s,s[13],K);return{c(){e&&e.c()},m(i,l){e&&e.m(i,l),t=!0},p(i,l){e&&e.p&&(!t||l&8192)&&I(e,n,i,i[13],t?S(n,i[13],l,_e):V(i[13]),K)},i(i){t||(u(e,i),t=!0)},o(i){c(e,i),t=!1},d(i){e&&e.d(i)}}}function $e(s){let t,n;return t=new C({props:{width:s[6],$$slots:{default:[he]},$$scope:{ctx:s}}}),{c(){b(t.$$.fragment)},m(e,i){g(t,e,i),n=!0},p(e,i){const l={};i&64&&(l.width=e[6]),i&8192&&(l.$$scope={dirty:i,ctx:e}),t.$set(l)},i(e){n||(u(t.$$.fragment,e),n=!0)},o(e){c(t.$$.fragment,e),n=!1},d(e){h(t,e)}}}function ye(s){let t;const n=s[12].default,e=A(n,s,s[13],null);return{c(){e&&e.c()},m(i,l){e&&e.m(i,l),t=!0},p(i,l){e&&e.p&&(!t||l&8192)&&I(e,n,i,i[13],t?S(n,i[13],l,null):V(i[13]),null)},i(i){t||(u(e,i),t=!0)},o(i){c(e,i),t=!1},d(i){e&&e.d(i)}}}function Q(s){let t,n,e,i;const l=[ve,we],r=[];function a(o,d){return o[11].aria?0:1}return n=a(s),e=r[n]=l[n](s),{c(){t=G("div"),e.c(),X(t,"class","visually-hidden")},m(o,d){$(o,t,d),r[n].m(t,null),i=!0},p(o,d){let k=n;n=a(o),n===k?r[n].p(o,d):(W(),c(r[k],1,1,()=>{r[k]=null}),F(),e=r[n],e?e.p(o,d):(e=r[n]=l[n](o),e.c()),u(e,1),e.m(t,null))},i(o){i||(u(e),i=!0)},o(o){c(e),i=!1},d(o){o&&y(t),r[n].d()}}}function we(s){let t,n;return t=new U({props:{source:s[10]}}),{c(){b(t.$$.fragment)},m(e,i){g(t,e,i),n=!0},p(e,i){const l={};i&1024&&(l.source=e[10]),t.$set(l)},i(e){n||(u(t.$$.fragment,e),n=!0)},o(e){c(t.$$.fragment,e),n=!1},d(e){h(t,e)}}}function ve(s){let t;const n=s[12].aria,e=A(n,s,s[13],J);return{c(){e&&e.c()},m(i,l){e&&e.m(i,l),t=!0},p(i,l){e&&e.p&&(!t||l&8192)&&I(e,n,i,i[13],t?S(n,i[13],l,pe):V(i[13]),J)},i(i){t||(u(e,i),t=!0)},o(i){c(e,i),t=!1},d(i){e&&e.d(i)}}}function Ae(s){let t,n;return t=new z({props:{containerIsFluid:s[0]==="fluid",$$slots:{default:[Se]},$$scope:{ctx:s}}}),{c(){b(t.$$.fragment)},m(e,i){g(t,e,i),n=!0},p(e,i){const l={};i&1&&(l.containerIsFluid=e[0]==="fluid"),i&8288&&(l.$$scope={dirty:i,ctx:e}),t.$set(l)},i(e){n||(u(t.$$.fragment,e),n=!0)},o(e){c(t.$$.fragment,e),n=!1},d(e){h(t,e)}}}function Ie(s){let t,n;return t=new z({props:{containerIsFluid:s[0]==="fluid",$$slots:{default:[Fe]},$$scope:{ctx:s}}}),{c(){b(t.$$.fragment)},m(e,i){g(t,e,i),n=!0},p(e,i){const l={};i&1&&(l.containerIsFluid=e[0]==="fluid"),i&8256&&(l.$$scope={dirty:i,ctx:e}),t.$set(l)},i(e){n||(u(t.$$.fragment,e),n=!0)},o(e){c(t.$$.fragment,e),n=!1},d(e){h(t,e)}}}function Ve(s){let t,n,e;return n=new U({props:{source:s[5]}}),{c(){t=G("aside"),b(n.$$.fragment)},m(i,l){$(i,t,l),g(n,t,null),e=!0},p(i,l){const r={};l&32&&(r.source=i[5]),n.$set(r)},i(i){e||(u(n.$$.fragment,i),e=!0)},o(i){c(n.$$.fragment,i),e=!1},d(i){i&&y(t),h(n)}}}function Se(s){let t,n;return t=new C({props:{width:s[6],$$slots:{default:[Ve]},$$scope:{ctx:s}}}),{c(){b(t.$$.fragment)},m(e,i){g(t,e,i),n=!0},p(e,i){const l={};i&64&&(l.width=e[6]),i&8224&&(l.$$scope={dirty:i,ctx:e}),t.$set(l)},i(e){n||(u(t.$$.fragment,e),n=!0)},o(e){c(t.$$.fragment,e),n=!1},d(e){h(t,e)}}}function We(s){let t;const n=s[12].notes,e=A(n,s,s[13],E);return{c(){e&&e.c()},m(i,l){e&&e.m(i,l),t=!0},p(i,l){e&&e.p&&(!t||l&8192)&&I(e,n,i,i[13],t?S(n,i[13],l,de):V(i[13]),E)},i(i){t||(u(e,i),t=!0)},o(i){c(e,i),t=!1},d(i){e&&e.d(i)}}}function Fe(s){let t,n;return t=new C({props:{width:s[6],$$slots:{default:[We]},$$scope:{ctx:s}}}),{c(){b(t.$$.fragment)},m(e,i){g(t,e,i),n=!0},p(e,i){const l={};i&64&&(l.width=e[6]),i&8192&&(l.$$scope={dirty:i,ctx:e}),t.$set(l)},i(e){n||(u(t.$$.fragment,e),n=!0)},o(e){c(t.$$.fragment,e),n=!1},d(e){h(t,e)}}}function Ne(s){let t,n,e,i,l,r,a,o,d,k;const N=[ke,me],w=[];function R(f,m){return f[11].title?0:f[7]?1:-1}~(t=R(s))&&(n=w[t]=N[t](s)),i=new Z({props:{hidden:!!s[11].aria||!!s[10],$$slots:{default:[ye]},$$scope:{ctx:s}}});let _=(s[11].aria||s[10])&&Q(s);const B=[Ie,Ae],v=[];function p(f,m){return f[11].notes?0:f[5]?1:-1}return~(a=p(s))&&(o=v[a]=B[a](s)),{c(){n&&n.c(),e=L(),b(i.$$.fragment),l=L(),_&&_.c(),r=L(),o&&o.c(),d=D()},m(f,m){~t&&w[t].m(f,m),$(f,e,m),g(i,f,m),$(f,l,m),_&&_.m(f,m),$(f,r,m),~a&&v[a].m(f,m),$(f,d,m),k=!0},p(f,m){let j=t;t=R(f),t===j?~t&&w[t].p(f,m):(n&&(W(),c(w[j],1,1,()=>{w[j]=null}),F()),~t?(n=w[t],n?n.p(f,m):(n=w[t]=N[t](f),n.c()),u(n,1),n.m(e.parentNode,e)):n=null);const T={};m&3072&&(T.hidden=!!f[11].aria||!!f[10]),m&8192&&(T.$$scope={dirty:m,ctx:f}),i.$set(T),f[11].aria||f[10]?_?(_.p(f,m),m&3072&&u(_,1)):(_=Q(f),_.c(),u(_,1),_.m(r.parentNode,r)):_&&(W(),c(_,1,1,()=>{_=null}),F());let q=a;a=p(f),a===q?~a&&v[a].p(f,m):(o&&(W(),c(v[q],1,1,()=>{v[q]=null}),F()),~a?(o=v[a],o?o.p(f,m):(o=v[a]=B[a](f),o.c()),u(o,1),o.m(d.parentNode,d)):o=null)},i(f){k||(u(n),u(i.$$.fragment,f),u(_),u(o),k=!0)},o(f){c(n),c(i.$$.fragment,f),c(_),c(o),k=!1},d(f){f&&(y(e),y(l),y(r),y(d)),~t&&w[t].d(f),h(i,f),_&&_.d(f),~a&&v[a].d(f)}}}function Re(s){let t,n;return t=new Y({props:{id:s[1],snap:s[3],role:s[4],width:s[0],ariaLabel:s[9],class:"graphic fmy-6 "+s[2],$$slots:{default:[Ne]},$$scope:{ctx:s}}}),{c(){b(t.$$.fragment)},m(e,i){g(t,e,i),n=!0},p(e,[i]){const l={};i&2&&(l.id=e[1]),i&8&&(l.snap=e[3]),i&16&&(l.role=e[4]),i&1&&(l.width=e[0]),i&512&&(l.ariaLabel=e[9]),i&4&&(l.class="graphic fmy-6 "+e[2]),i&11745&&(l.$$scope={dirty:i,ctx:e}),t.$set(l)},i(e){n||(u(t.$$.fragment,e),n=!0)},o(e){c(t.$$.fragment,e),n=!1},d(e){h(t,e)}}}function Be(s,t,n){let{$$slots:e={},$$scope:i}=t;const l=x(e);let{width:r="normal"}=t,{id:a=""}=t,{class:o=""}=t,{snap:d=!1}=t,{role:k=null}=t,{notes:N=null}=t,{textWidth:w="normal"}=t,{title:R=null}=t,{description:_=null}=t,{ariaLabel:B="chart"}=t,{ariaDescription:v=null}=t;return s.$$set=p=>{"width"in p&&n(0,r=p.width),"id"in p&&n(1,a=p.id),"class"in p&&n(2,o=p.class),"snap"in p&&n(3,d=p.snap),"role"in p&&n(4,k=p.role),"notes"in p&&n(5,N=p.notes),"textWidth"in p&&n(6,w=p.textWidth),"title"in p&&n(7,R=p.title),"description"in p&&n(8,_=p.description),"ariaLabel"in p&&n(9,B=p.ariaLabel),"ariaDescription"in p&&n(10,v=p.ariaDescription),"$$scope"in p&&n(13,i=p.$$scope)},[r,a,o,d,k,N,w,R,_,B,v,l,e,i]}class Ce extends H{constructor(t){super(),M(this,t,Be,Re,P,{width:0,id:1,class:2,snap:3,role:4,notes:5,textWidth:6,title:7,description:8,ariaLabel:9,ariaDescription:10})}}Ce.__docgen={version:3,name:"GraphicBlock.svelte",data:[{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Width of the component within the text well.",name:"width",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"normal"},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Add an id to the block tag to target it with custom CSS.",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""},{visibility:"public",description:"Add extra classes to the block tag to target it with custom CSS.",keywords:[{name:"type",description:"{string}"}],name:"class",kind:"const",static:!1,readonly:!0,type:{kind:"type",text:"string",type:"string"},localName:"cls",defaultValue:""},{keywords:[],visibility:"public",description:"Snap block to column widths, rather than fluidly resizing them.",name:"snap",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"ARIA [role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) for the block",name:"role",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Notes to the graphic, passed in as a markdown string.",name:"notes",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:`Set a different width for the text within the text well, for example,
|
|
"normal" to keep the title, description and notes inline with the rest
|
|
of the text well. Can't ever be wider than \`width\`.`,name:"textWidth",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"normal"},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Title of the graphic",name:"title",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"Description of the graphic, passed in as a markdown string.",name:"description",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"ARIA [label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) for the block",name:"ariaLabel",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"chart"},{keywords:[{name:"type",description:"{string}"}],visibility:"public",description:"ARIA description, passed in as a markdown string.",name:"ariaDescription",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:null}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[{keywords:[],visibility:"public",description:"Custom title content",name:"title"},{keywords:[],visibility:"public",description:"Graphic content",name:"default"},{keywords:[],visibility:"public",description:"Custom ARIA markup",name:"aria"},{keywords:[],visibility:"public",description:"Custom notes content",name:"notes"}],refs:[]};export{Ce as G};
|
|
//# sourceMappingURL=GraphicBlock-44d96d12.js.map
|