@datawheel/bespoke 0.7.15-rc.23 → 0.7.15-rc.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/report.js +1 -1
  2. package/package.json +1 -1
package/dist/report.js CHANGED
@@ -59,7 +59,7 @@ var Zf=Object.defineProperty;var v=(e,t)=>()=>(e&&(t=e(e=0)),t);var Aa=(e,t)=>{f
59
59
  In pulvinar sapien ut tincidunt volutpat. Donec auctor tellus eu augue feugiat,
60
60
  a viverra sapien pulvinar.`,style:r,append:t?jsx(Be,{content:t,style:{display:"inline-block",verticalAlign:"bottom"}}):jsx(Fragment,{}),isPreview:!0})}var sd=v(()=>{c();qt();we();});function yi({subtitle:e,title:t,value:r,tooltip:o,settings:n,_iconType:a,_iconVariant:s,_icon:i,_iconRadius:l,_iconSize:u,_iconPadding:p}){let d=t||"<span class='cr-block-placeholder'>Title</span>",m=r||"<span class='cr-block-placeholder'>Big Stat</span>",b=e||"<span class='cr-block-placeholder'>Subtitle</span>",f=n&&n.align||"left";return jsx("div",{className:"bespoke-Stat-root",children:jsxs(Group,{className:"bespoke-StatGroup-wrapper",position:lt(f),children:[a!=="none"&&a&&jsx(Re,{blockType:"stat",iconType:a,iconVariant:s,iconRadius:l,iconSize:u,icon:i,iconPadding:p}),jsxs("div",{className:"bespoke-Stat-wrapper",children:[jsx(ie,{component:"div",size:"md",html:d,style:n,isPreview:!0}),jsx(ie,{component:"div",size:"xl",html:m,style:n,isPreview:!0}),jsx(ie,{component:"div",size:"sm",html:b,style:n,isPreview:!0})]},"stat"),o&&jsx(Be,{content:o})]})})}var ld=v(()=>{c();qt();Lr();we();ze();});function bi({subtitle:e,tooltip:t,settings:r}){let o=Ve(e)||"<span class='cr-block-placeholder'>Small subtitle.</span>",n=r&&r.align?r.align:"left";return jsxs(Group,{spacing:"sm",position:lt(n),children:[jsx(ie,{size:"sm",html:o,isPreview:!0}),t&&jsx(Be,{content:t,style:{display:"inline-flex"}})]})}var ud=v(()=>{c();qt();wr();we();ze();});function vi({title:e,tooltip:t,_iconType:r,_iconVariant:o,_icon:n,settings:a,_iconRadius:s,_iconSize:i,_iconPadding:l}){let u=Ve(e)||"Title",p=a&&a.order?parseInt(a.order,10):1,d=p<=6?p:1,m=!!(a&&a.search&&a.search!=="off"),b=a&&a.search?a.search:"",f=a&&a.align?a.align:"left";return jsxs(Group,{spacing:"sm",position:lt(f),children:[r!=="none"&&r&&jsx(Re,{blockType:"title",iconType:r,iconVariant:o,iconRadius:s,iconSize:i,icon:n,iconPadding:l}),jsx(ie,{component:"h",order:d,style:a,html:u,isPreview:!0}),m&&jsx(Tooltip,{label:`Click will open '${b}' report search`,children:jsx(ActionIcon,{variant:"light",children:jsx(IconSearch,{size:20})})}),t&&jsx(Be,{content:t})]})}var pd=v(()=>{c();qt();wr();Lr();we();ze();});function xi(e){let{id:t,type:r,defaultValue:o,options:n,name:a,settings:s,hideLabel:i,component:l,resetSectionVars:u,section:p}=e,d=useDispatch(),m=useContext($t),b=Q(x=>x.status.query),{sectionVariables:f,resetSectionVariables:y}=Ae(p),h=kT(t),w=useMemo(()=>b[h]||o,[b[h],r,o]),L=useMemo(()=>CT(b[h],o),[b[h],r,o]),[k,A]=useState(n?.map(x=>({value:x.id,label:x.label,imageUrl:x.imageUrl}))||[]),[N,z]=useState((n||[]).map(x=>x.id).join("-"));useEffect(()=>{let x=n.map(I=>`${I.label}|${I.id}`).join("-");if(N===x)return;z(x);let O=n.map(I=>({value:I.id,label:I.label}));A(O);let D=r===ke.SINGLE?w:L;yr(r,D,n)||d(fs(m,h));},[JSON.stringify(n),t]);let E=()=>{u==="true"&&f&&y();},F=x=>{d(Pr(m,h,x)),E();},C=x=>{d(Pr(m,h,x.join())),E();},R=i==="true"?jsx(Fragment,{}):jsx(ie,{component:"div",html:a,size:"sm",style:s,isPreview:!0});return k.length===0?jsx(Text,{c:"dimmed",size:"xs",children:"No options defined yet. Selector hidden in report."}):k.length===1?jsxs(Text,{c:"dimmed",size:"xs",children:["Only one option defined. Selector hidden in report. ",JSON.stringify(k)]}):{[ke.SINGLE]:l===yn.SEGMENTED_CONTROL?jsxs("div",{children:[R,jsx(SegmentedControl,{data:k,value:k.map(x=>x.value).includes(w)?w:"",onChange:F,fullWidth:!0})]}):jsx(Select,{label:R,data:k,value:w,onChange:F,itemComponent:PT,styles:{label:{display:i==="true"?"none":"block"}}}),[ke.MULTI]:jsx(MultiSelect,{label:R,data:k,value:L,onChange:C,styles:{label:{display:i==="true"?"none":"block"}}})}[r]}var kT,CT,PT,fd=v(()=>{c();Vo();vn();ye();he();Ut();we();Se();kT=e=>`selector${e}id`,CT=(e,t)=>e&&typeof e=="string"?e.split(","):t,PT=forwardRef(function({imageUrl:t,label:r,...o},n){return jsx("div",{ref:n,...o,children:jsxs(Group,{noWrap:!0,children:[t&&jsx(Box,{component:"img",w:25,h:25,src:t}),jsx("div",{children:jsx(Text,{size:"sm",children:r})})]})})});});var gd=v(()=>{});function Ci({dimmed:e=!1,label:t,root:r=!0,value:o,parentIsArray:n=!1,level:a=0}){let s=useMantineTheme();if(a===ki)return null;let i=jsx(Text,{lineClamp:1,size:"xs",variant:"dimmed",p:5,children:"[Max depth hitted for preview]"}),l=Ei(o),u=o,p=JSON.stringify(o),d=!!(p&&p.length>50),m=!!(p&&p.length>1e3),b=10,f={control:{padding:"5px 0px 5px 5px"},label:{padding:"5px 0px"},content:{paddingTop:0,paddingBottom:0,paddingRight:0}};if(l==="object")return jsx(Accordion,{className:"cr-variable-accordion",variant:"contained",styles:f,children:jsxs(Accordion.Item,{value:"label",children:[jsx(Accordion.Control,{children:jsx(Text,{lineClamp:1,size:"xs",weight:700,color:e?"dimmed":s.primaryColor,children:r?`{{${t}}}`:n?`[${t}]`:t})}),jsx(Accordion.Panel,{children:a+1<ki?Object.keys(o).sort((y,h)=>{let w=Ei(o[y]),L=Ei(o[h]);return w!==L?hd.indexOf(w)-hd.indexOf(L):y.localeCompare(h)}).map(y=>jsx(Ci,{root:!1,label:y,value:o[y],level:a+1},y)):i})]})});if(l==="array"){let y=o.length>b,h=y?o.slice(0,b):o,w=y?o.length-b:0;return jsx(Accordion,{className:"cr-variable-accordion",variant:"contained",styles:f,children:jsxs(Accordion.Item,{value:"label",children:[jsx(Accordion.Control,{children:jsx(Text,{lineClamp:1,size:"xs",weight:700,p:0,color:e?"dimmed":s.primaryColor,children:r?`{{${t}}}`:n?`[${t}]`:t})}),jsxs(Accordion.Panel,{children:[a+1<ki?h.map((L,k)=>jsx(Ci,{root:!1,label:k,value:L,level:a+1,parentIsArray:!0},k)):i,y&&jsxs(Text,{lineClamp:1,size:"xs",variant:"dimmed",p:5,children:["[+ ",w," other elements]"]})]})]})})}return l==="string"?u=m?`"${u.substring(0,1e3)} ... "`:`"${u}"`:l==="error"?u=`Error: ${u.message}`:l==="undefined"?u=l:u.toString&&(u=u.toString()),jsxs(Group,{noWrap:!0,spacing:0,children:[jsx(Text,{color:e?"dimmed":s.primaryColor,lineClamp:1,size:"xs",pl:5,style:{overflow:"visible",wordBreak:"keep-all",whiteSpace:"nowrap"},weight:700,children:r?`{{${t}}}`:n?`[${t}]`:t}),jsx(Prism,{className:"cr-variable",language:"jsx",noCopy:!0,scrollAreaComponent:"div",styles:{root:{flex:"1 1 100%",textAlign:"right",overflow:"hidden"},code:{padding:"5px 0 5px 5px"},scrollArea:{marginLeft:"5px"},line:{paddingRight:"5px"}},children:u}),d&&jsxs(HoverCard,{width:400,shadow:"md",withinPortal:!0,children:[jsx(HoverCard.Target,{children:jsx(ActionIcon,{children:jsx(IconCodePlus,{})})}),jsx(HoverCard.Dropdown,{children:jsx(Text,{size:"sm",children:JSON.stringify(o).substring(0,5e3)})})]})]})}var Ei,hd,ki,yd,bd=v(()=>{c();gd();Ei=e=>{let t=typeof e;if(t==="object"){if(e===null)return "undefined";Array.isArray(e)?t="array":["Error","EvalError","ReferenceError","SyntaxError"].includes(e.constructor.name)&&(t="error");}return t},hd=["object","array","string","number"],ki=5;yd=Ci;});var vd,Sd=v(()=>{c();vd=e=>t=>t.replace(new RegExp(`^${e}`),"").startsWith("_");});function NT({reserved:e=[],id:t,variables:r={},showInternal:o=!1}){let a=gt(t==="attributes"?null:t).data,s=a?a.type:"block",i=a?.type&&a?.id?`${a.type}${a.id}`:"",l=Object.keys(r).filter(o?()=>!0:u=>!vd(i)(u));return jsx(Stack,{spacing:0,children:l.length?l.map(u=>jsx(yd,{dimmed:e.includes(u),label:u,value:r[u]},u)):jsx(Text,{color:"dimmed",size:"xs",children:jsx("i",{children:`empty ${s}`})})})}var Td,xd=v(()=>{c();bd();he();Sd();Td=NT;});function qT({outputVariables:e,status:t,hasAPI:r=!1,debug:o,type:n}){let[a,s]=useState(!1),i=r&&!Object.keys(e).length&&!t.error,l=Object.keys(e).some(p=>p.startsWith("_"));return o?i?jsxs(Stack,{align:"center",children:[jsx(Loader,{}),jsxs(Text,{size:"sm",children:["Loading ",n]})]}):jsxs(Fragment,{children:[jsx(Divider,{label:"Output Variables",labelPosition:"center"}),l&&jsx(Switch,{label:"Show internal variables",mb:"xs",size:"xs",checked:a,onChange:p=>s(p.currentTarget.checked)}),jsx(Td,{variables:e,showInternal:a})]}):jsx(Center,{children:jsx(Badge,{color:"gray",variant:"outline",children:n.toUpperCase()},"type")})}var Ai,Rd=v(()=>{c();xd();Ai=qT;});function wi(e){let{alt:t,src:r,desc:o,title:n,settings:a,...s}=e,i=Ve(t),l=Ve(r),u=Ve(o),p=jsx("img",{src:l,alt:i,style:s}),d=a&&a.align?String(a.align):"left";return (u&&u.length||n&&n.length)&&(p=jsxs(Stack,{className:"bespoke-Image-wrapper",align:It(d),spacing:"sm",children:[n&&jsx(ie,{component:"p",html:n,style:a,isPreview:!0}),p,o&&jsx(ie,{component:"p",size:"sm",html:o,style:a,isPreview:!0})]})),l&&i?p:jsx(Center,{mih:100,bg:"white",children:jsx(Badge,{color:"gray",variant:"outline",children:"IMAGE"},"type")})}var Ed=v(()=>{c();wr();we();ze();});function Oi({headings:e,settings:t}){let{min:r="1",max:o="6",icons:n="yes"}=t||{},a=mo(parseInt(r,10),parseInt(o,10),e),s=n==="yes",i=lo(t&&t.align?String(t.align):"left"),l=u=>!u||!u?.length?null:jsx(Fragment,{children:u.map(p=>jsxs(Fragment$1,{children:[jsx(Menu.Item,{children:jsx(Anchor,{href:`#bespoke-title-${p.id}`,children:jsxs(Group,{spacing:"sm",children:[s&&jsx(Re,{...p.iconProps,iconSize:"sm"}),jsx(Text,{dangerouslySetInnerHTML:{__html:p.label}})]})})},p.id),jsx(Box,{pl:"xs",children:l(p.children)})]},p.id))});return jsx(Box,{pos:"relative",children:jsxs(List,{sx:u=>({display:"flex",gap:u.spacing.md,justifyContent:i,listStyleType:"none"}),children:[a?.map(u=>jsx(List.Item,{children:jsxs(Menu,{trigger:"hover",openDelay:100,closeDelay:400,children:[jsx(Menu.Target,{children:jsx(Anchor,{href:`#bespoke-title-${u.id}`,children:jsxs(Group,{spacing:"sm",noWrap:!0,children:[s&&jsx(Re,{blockType:"nav",...u.iconProps,iconSize:"sm",iconPadding:"2"}),jsx(Text,{dangerouslySetInnerHTML:{__html:u.label}})]})})}),u?.children?.length?jsx(Menu.Dropdown,{children:l(u.children)}):null]})},u.id)),!a||a.length===0&&jsx(List.Item,{children:jsx(Text,{color:"dimmed",children:"- Include some titles as inputs to see the Nav component -"})})]})})}var Ad=v(()=>{c();Js();Lr();ze();});function Bi(e){let{related_reports:t,settings:r}=e;if(!t?.length)return jsx(Text,{children:"There are no available members related to your current selection and report."});let o=lo(r&&r.align?String(r.align):"left");return jsx(List,{sx:()=>({display:"flex",justifyContent:o,"& li":{marginRight:"1rem"}}),children:t.map(n=>jsx(List.Item,{children:n.entities.map(a=>a.name).join(" & ")},n.link))})}var Id=v(()=>{c();ze();});function Ni({id:e,label:t,settings:r,showIcon:o,fullWidth:n,showWhenDisabled:a}){let s=gt(e).data,{sectionVariables:i,resetSectionVariables:l}=Ae(s?.section_id),u=!!Object.keys(i).length,p=It(r&&r.align?r.align:"left");return jsxs(Stack,{align:p,children:[!u&&!a&&jsx(Text,{size:"xs",ta:r?.align||"left",children:"Reset button will not be shown on its disabled state"}),jsx(Button,{onClick:()=>l(),disabled:!u,fullWidth:n,children:jsxs(Group,{align:"center",children:[t,o&&jsx(IconRefresh,{})]})})]})}var Od=v(()=>{c();Se();Se();ze();});function Fi({settings:e,label:t,showIcon:r,position:o="center"}){let n=e&&e.search?e.search:"";return jsxs(Group,{position:o,children:[jsx(Tooltip,{label:`Click will open '${n}' report search`,children:jsx(Button,{children:jsxs(Group,{align:"center",children:[t||"Comparison Button",r&&jsx(IconPlus,{})]})})}),jsx(ActionIcon,{variant:"light",children:jsx(IconSearch,{size:20})})]})}var Md=v(()=>{c();});function Vi({columns:e=[],id:t,data:r=[],tableProps:o={}}){let[n,a]=useState({}),{initialState:s}=o,i=s?.pagination?.pageIndex,l=s?.pagination?.pageSize,u=`table-${[t,i,l].filter(f=>f).join("-")}`,p=useMemo(()=>e.map(f=>f.accessorKey),[e]),d=useMemo(()=>r.filter(f=>typeof f=="object"&&f!==null&&!Array.isArray(f)&&Object.keys(f).some(y=>p.includes(y))),[p,r]),m=useMemo(()=>e.map(f=>({...f,Cell:({renderedCellValue:y})=>jsx(ie,{html:`${y}`,isPreview:!0}),filterFn:"contains"})),[e]),b=Ic();return useEffect(()=>{(async()=>{try{let y=b||"en",h=`${y.toUpperCase()}`,w=await import(`mantine-react-table/locales/${y}.js`);a(w[`MRT_Localization_${h}`]);}catch(y){console.error("Error loading translations:",y);}})();},[b]),createElement(MantineReactTable,{...o,autoResetPageIndex:!1,columns:m,data:d,enableColumnFilterModes:!0,enableFilterMatchHighlighting:!1,globalFilterFn:"contains",key:u,layoutMode:"grid",localization:n,state:{...o.state,isFullScreen:!1}})}var Nd=v(()=>{c();we();Se();});function zi({label:e,url:t,settings:r}){let{align:o}=r;return jsx(Group,{position:o,grow:o==="justify",children:jsx(Button,{component:"a",target:"_blank",href:t||"",children:e||"Button"})})}var Dd=v(()=>{c();});function Ui(e){let t=useDispatch(),r=useContext($t),o=Q(V=>V.status.query),n=Ox(e.id),a=useMantineTheme(),{allLabel:s,colorKey:i,data:l,defaultValue:u,defaultValueType:p,iconKey:d,levels:m,limit:b,placeholder:f,searchIndexKey:y,searchIndexSeparator:h,resetSectionVars:w,section:L}=e,[k,A]=useState(!1),[N,z]=useState(!0),[E,F]=useState(""),[C,R]=useState(!1),[x,O]=useState([""].slice(1)),{sectionVariables:D,resetSectionVariables:I}=Ae(L),P=useMemo(()=>_x(o[`${n}-value`],u),[o,u,n]),Y=useMemo(()=>o[`${n}-type`]||p,[o,p,n]),j=useCallback(()=>{w==="true"&&D&&I();},[w,D,I]),H=useCallback(V=>{j(),t(Pr(r,`${n}-value`,V.join()));},[t,r,n,j]),ee=useCallback(V=>{j(),t(Pr(r,`${n}-type`,V));},[t,r,n,j]),oe=useRef(null),ce=useRef(!1),K=useRef(!!b&&b<P.length),q=x.length,G=m[q],$=x.filter(Boolean);x.length>0&&$.length===0&&$.push(`${s} ${G?.label}`),useEffect(()=>{let V=()=>{z(!0);};return window.addEventListener("touchmove",V),()=>{window.removeEventListener("touchmove",V);}},[]);let M=useMemo(()=>wx(l,m,i,d,y,h),[i,l,d,m,y,h]),_=useMemo(()=>{let V=Ix(E),pe=Array.from(Lx(M,V)).reverse();return C?pe:x.reduce((B,ne)=>B.filter(re=>!ne||re.searchindex.indexOf(ne)>-1),pe.filter(B=>B.type===G?.value))},[G,M,E,C,x]),te=useRef(null),U=Gn({count:k?_.length:0,estimateSize:()=>30,getScrollElement:useCallback(()=>te.current,[]),overscan:10,rangeExtractor:useCallback(V=>Yo(V),[])}),[Z,X]=useState(-1),ae=Math.min(Z,_.length-1),le=useCallback(V=>{let pe=x.concat(V);C&&R(!1),O(pe);},[C,x]),qe=useCallback(()=>{let V=x.slice(0,q-1);C&&R(!1),O(V);},[C,x,q]),ue=useCallback(V=>{F(V.currentTarget.value),!K.current&&l.length>0&&A(!0);},[l,F,K,A]),je=useCallback(()=>{F(""),H([]),oe.current?.focus(),b&&(K.current=!1);},[F,H,oe,b,K]),$e=useCallback(V=>{let pe=P.filter(B=>B!==V);H(pe),b&&pe.length<b&&(K.current=!1);},[P,H,b,K]),We=useCallback(V=>{Y||ee(V.type),Y!==V.type?(ee(V.type),H([V.value])):P.includes(V.value)?$e(V.value):b?(P.length<b&&H([...P,V.value]),P.length===b&&H([...P.slice(1),V.value])):H([...P,V.value]),F("");},[Y,ee,H,P,$e,b]),Eo=useCallback(()=>{P.length>0&&E.length===0&&(H(P.slice(0,-1)),A(!0),b&&(K.current=!1)),E.length>0&&F(E.slice(0,-1));},[P,E,H,F,A,b,K]),ko=useCallback(()=>{z(V=>V&&(ce.current=V,!V)),X(V=>V+1>=_.length?V:V+1);},[X,_]),mr=useCallback(()=>{let V=_[ae];V&&We(V);},[_,ae,We]),Co=useCallback(()=>{A(!1);},[A]),va=useCallback(()=>{qe(),X(0);},[X,qe]),Sa=useCallback(()=>{let V=_[ae];!C&&V&&V.type!==m[m.length-1]?.value&&(le(V.name),X(0));},[_,ae,C,m,X,le]),Ta=useCallback(()=>{z(V=>V&&(ce.current=V,!V)),X(V=>V-1<0?0:V-1);},[X]),xa=({label:V,onRemove:pe,...B})=>jsxs("div",{style:{alignItems:"center",backgroundColor:a.colorScheme==="dark"?a.colors.dark[7]:a.colors.gray[1],borderRadius:a.radius.sm,cursor:"default",color:a.colorScheme==="dark"?a.colors.dark[0]:a.colors.gray[7],display:"flex",fontSize:rem(12),fontWeight:500,height:rem(22),margin:`calc(${a.spacing.xs} / 2 - ${rem(2)}) calc(${a.spacing.xs} / 2)`,maxWidth:`calc(100% - ${rem(10)})`,paddingLeft:`calc(${a.spacing.sm} / 1.5)`,paddingRight:0,userSelect:"none"},...B,children:[jsx("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:V}),jsx(CloseButton,{"aria-hidden":!0,iconSize:"70%",onMouseDown:pe,radius:2,size:"sm",sx:{color:a.colorScheme==="dark"?a.colors.dark[0]:a.colors.gray[7],marginLeft:`calc(${a.spacing.sm} / 6)`},tabIndex:-1})]}),Ra=useMemo(()=>P.map(V=>M.find(pe=>pe.value===V)).filter(V=>!!V).map((V,pe)=>createElement(xa,{...V,index:pe,key:V.value,onRemove:B=>{B.preventDefault(),B.stopPropagation(),$e(V.value);}})),[P]),Ea=forwardRef(function({color:pe,icon:B,label:ne,value:re,...Ke},be){return jsx("div",{ref:be,style:{cursor:"pointer",width:"100%"},...Ke,children:jsxs(Group,{align:"center",noWrap:!0,spacing:"xs",w:"100%",children:[B&&jsx(Box,{bg:pe??"transparent",component:"img",w:20,h:20,src:B}),jsx(Text,{lineClamp:1,size:"sm",children:ne||re})]})})}),{settings:ka}=e,Ca=e.hideLabel==="true"||!e.label?jsx(Fragment,{}):jsx(ie,{component:"div",html:e.label,size:"sm",style:ka,isPreview:!0});return jsx(Input.Wrapper,{label:Ca,children:jsxs(Popover,{closeOnClickOutside:!0,keepMounted:!0,opened:k,onChange:A,onClose:()=>{X(0),F("");},onOpen:()=>{U.scrollToIndex(0);},shadow:"sm",width:"target",withinPortal:!0,children:[jsx(Popover.Target,{children:jsxs(Box,{"aria-haspopup":"listbox",component:"div",onMouseLeave:()=>X(0),sx:{position:"relative","& .defaultValue":{backgroundColor:a.colorScheme==="dark"?a.colors.dark[5]:a.colors.gray[3],color:a.colorScheme==="dark"?a.colors.dark[1]:a.colors.gray[7]}},tabIndex:-1,children:[jsx("input",{type:"hidden",value:P.join(",")}),jsx(Input,{component:"div",multiline:!0,onMouseDown:V=>{V.preventDefault(),!K.current&&l.length>0&&A(!k),oe.current?.focus();},rightSection:P.length>0?jsx(CloseButton,{onClick:je,onMouseDown:V=>V.preventDefault(),variant:"transparent"}):jsx(IconSelector,{color:a.colors.gray[6],size:18,stroke:1.5}),style:{overflow:"hidden"},w:"100%",children:jsxs(Box,{component:"div","data-clearable":!0,sx:{alignItems:"center",boxSizing:"border-box",display:"flex",flexWrap:"wrap",marginLeft:`calc(-${a.spacing.xs} / 2)`,minHeight:`calc(${rem(36)} - ${rem(2)})`,"&[data-clearable]":{marginRight:rem(36)},"&::placeholder":{color:a.colorScheme==="dark"?a.colors.dark[3]:a.colors.gray[5],opacity:1}},children:[Ra,jsx("input",{autoComplete:"off","data-mantine-stop-propagation":k,onChange:ue,onKeyDown:getHotkeyHandler([["ArrowDown",ko],["ArrowLeft",va],["ArrowRight",Sa],["ArrowUp",Ta],["Backspace",Eo],["Enter",mr],["Escape",Co]]),placeholder:P.length===0?f:void 0,ref:oe,readOnly:K.current,style:{appearance:"none",backgroundColor:"transparent",border:0,color:"inherit",flex:1,fontSize:a.fontSizes.sm,marginLeft:`calc(${a.spacing.xs} / 2)`,maxHeight:rem(22),minWidth:rem(60),outline:0,padding:0},type:"search",value:E})]})})]})}),jsx(Popover.Dropdown,{onMouseDown:V=>V.preventDefault(),p:0,children:jsx("div",{style:{display:"flex",maxHeight:rem(300)},children:jsx(Box,{component:"div","data-combobox-popover":!0,onMouseDown:V=>V.preventDefault(),role:"listbox",sx:{width:"100%"},tabIndex:-1,children:jsxs(Stack,{h:"100%",py:"xs",spacing:"xs",w:"100%",children:[m.length>1&&jsxs(Stack,{spacing:"xs",children:[jsxs(Group,{onClick:V=>{V.stopPropagation();},px:"xs",position:"center",spacing:"xs",children:[jsx(Button,{onClick:()=>{X(0),R(!0),O([]),_.length>0&&U.scrollToIndex(0);},size:"xs",variant:C?"filled":"outline",children:s}),m.map((V,pe)=>jsx(Button,{onClick:()=>{C&&R(!1);let B=[""].slice(1),ne=pe;for(;ne--;)B[ne]=x[ne]||"";X(0),O(B),_.length>0&&U.scrollToIndex(0);},size:"xs",variant:!C&&x.length===m.findIndex(B=>B.value===V?.value)?"filled":"outline",children:V?.label},V?.value))]}),jsx(Divider,{})]}),q>0&&jsxs(Group,{align:"center",noWrap:!0,px:"xs",children:[jsx(ActionIcon,{onClick:qe,size:"sm",children:jsx(IconChevronLeft,{})}),jsx("div",{children:$.map(V=>jsx(Text,{lineClamp:1,size:"xs",children:V},`${V}`))})]}),jsx(ScrollArea,{mah:250,onWheel:()=>z(!0),px:"xs",style:{overflow:"auto",width:"100%"},viewportRef:te,viewportProps:{tabIndex:-1},w:"100%",children:jsx("div",{style:{height:`${U.getTotalSize()}px`,position:"relative",width:"100%"},children:U.getVirtualItems().map(V=>{let pe=_[V.index],B=ae===V.index,ne=P.includes(pe.value);return _.length>0&&B&&!N&&U.scrollToIndex(ae),jsxs(Group,{"aria-selected":B,align:"center","data-hovered":B||void 0,"data-index":V.index,"data-selected":ne,id:pe.vale,noWrap:!0,onMouseEnter:re=>{re.preventDefault(),re.stopPropagation(),N&&(X(V.index),z(!1));},onMouseMove:re=>{re.preventDefault(),re.stopPropagation(),z(!0);},onMouseDown:re=>{re.preventDefault(),We(pe);},position:"apart",ref:U.measureElement,role:"option",spacing:"xs",sx:re=>({borderRadius:re.radius.xs,padding:"15px 5px 15px",paddingLeft:C&&10*m.findIndex(Ke=>Ke?.value===pe.type)||5,position:"absolute",top:0,left:0,height:`${V.size}px`,transform:`translateY(${V.start}px)`,width:"100%","&[data-hovered]":{backgroundColor:re.colorScheme==="dark"?re.colors.dark[4]:re.colors.gray[1]},"&:hover":{backgroundColor:re.colorScheme==="dark"?re.colors.dark[4]:re.colors.gray[1]}}),tabIndex:-1,children:[jsx(Ea,{index:V.index,...pe}),!C&&pe.type!==m[m.length-1]?.value&&jsx(ActionIcon,{onMouseDown:re=>{re.preventDefault(),re.stopPropagation(),le(pe.name);},size:"sm",tabIndex:-1,children:jsx(IconChevronRight,{})})]},pe.value)})})})]})})})})]})})}var wx,Ix,Lx,Ox,_x,qd=v(()=>{c();Us();we();Ut();he();Se();Vo();wx=(e=[],t=[],r="",o="",n="",a="|")=>{let s=t.map(y=>y.value).slice(),i=`${s.pop()}`,l=y=>y[r],u=y=>y[o],p=y=>{if(y[n])return typeof y[n]=="string"?y[n].split(a):y[n]},d=new Set,m=[],b=[],f=nest().rollup(y=>{let h=y[0],w=C=>C&&C.value&&!d.has(C.value),L=s.map(C=>h[`${C} ID`]),k=s.map(C=>h[C]),A=s.map((C,R)=>{if(b[R]!==k[R]){b[R]=k[R];let x=l[R]||l[l.length-1]||l,O=u[R]||u[u.length-1]||u,D=p[R]||p[p.length-1]||p;return {color:x(h,C)||void 0,icon:O(h,C)||void 0,value:`${L[R]}`,label:k[R],name:k[R],type:C,searchindex:k.slice(0,R+1).concat(D(h,C)).join("|")}}return {}}).filter(w);A.forEach(C=>d.add(C.value));let N=l[l.length-1]||l,z=u[u.length-1]||u,E=p[p.length-1]||p,F=y.map(C=>({color:N(C,i)||void 0,icon:z(C,i)||void 0,value:`${C[`${i} ID`]}`,label:C[i],name:C[i],type:i,searchindex:k.concat(C[i]).concat(E(C,i)).join("|")}));m.push(...A.concat(F));});return s.forEach(y=>{f.key(h=>`${h[`${y} ID`]}|${h[y]}`);}),f.entries(e),m},Ix=e=>{if(!e)return /./i;let t=e.normalize("NFD").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g,"[^|]+");return RegExp(t,"i")},Lx=(e,t)=>{let r=e.length,o,n=i=>o&&o.searchindex.includes(i.searchindex),s={next:()=>{for(let i=r-1;i>-1;i--){let l=e[i];if(t.test(`${l.value} ${l.label} ${l.searchindex}`)||n(l))return o=l,r=i,{done:!1,value:l}}return {done:!0,value:void 0}},[Symbol.iterator]:()=>s};return s},Ox=e=>`multihierarchySelector${e}`,_x=(e,t)=>e&&typeof e=="string"?e.split(","):t;});var Wd={};Aa(Wd,{default:()=>Hx});function Gx({block:e,active:t,locale:r,variables:o,debug:n,configOverride:a={}}){let s=$x(),i=Oe(e),l=At(r),u={variables:o},p=useRouter(),{sectionVariables:d,setSectionVariables:m,resetSectionVariables:b}=Ae(e.section_id),f=useMemo(()=>{if(!t)return {error:"Activate to View"};if(!i?.logic)return {error:"Add a Configuration"};let C=st({logic:i.logic},l,u).logic,R={router:p,section:{variables:d,setVariables:m,resetVariables:b}};return ir(C,l,o,r,e.id,{},R)},[i?.logic,t,o,d]);useMemo(()=>{if(!t||!i?.logic)return {};let{logic:C}=i,{vars:R}=at("variables",o,C,l,void 0,u);return R},[e,t]);let {type:h}=f.config||{},w=h&&Gi[h]?h:"Treemap";h||(f.config={error:'Visualization missing "type"'}),Gi[h]||(f.config={error:`"${h}" is not a valid Visualization Type`});let L=Gi[w],k=f.error||f.config?.error||!1;if(k)return jsx(Center,{style:{height:"100%"},children:jsx(Badge,{color:"gray",variant:"outline",children:k},"type")});let{_data:A,...N}=f.config,z={locale:r,variables:o,...N,...a};console.log(s.print,"print aca viz"),s.print&&(z.detectVisible=!1);!s.print&&h!=="Graphic"&&h!=="HTML";return jsx("div",{style:{display:"flex",flex:"1 1 100%"},children:jsx(Fr,{fallback:jsx("p",{children:"Error in d3plus viz config."}),children:jsx(L,{style:{flex:1},dataFormat:C=>{f.data&&Array.isArray(f.data)&&f.data.length>1&&f.data.some(D=>typeof D=="string")?C:[C];let O;try{O=f.dataFormat(C);}catch(D){console.log("Error in dataFormat: ",D),O=[];}return O},linksFormat:f.linksFormat,nodesFormat:f.nodesFormat,topojsonFormat:f.topojsonFormat,config:{...z}},"viz-key")})})}var $x,Ux,Gi,Hx,Kd=v(()=>{c();hr();Wr();mi();Jo();br();Se();di();$x=()=>({}),Ux={},Gi={HTML:en,...QS,...Ux};Hx=memo(Gx,(e,t)=>e.block.contentByLocale.logic.content===t.block.contentByLocale.logic.content&&e.active===t.active&&e.locale===t.locale&&JSON.stringify(e.variables)===JSON.stringify(t.variables)&&JSON.stringify(e.configOverride)===JSON.stringify(t.configOverride));});var jx,Fe,Yd=v(()=>{c();ye();sd();ld();ud();pd();fd();Rd();Ed();Ad();Id();Od();Md();Nd();Dd();qd();jx=eT(()=>Promise.resolve().then(()=>(Kd(),Wd)),{ssr:!1}),Fe={[g.PARAGRAPH]:hi,[g.STAT]:yi,[g.SUBTITLE]:bi,[g.TITLE]:vi,[g.SELECTOR]:xi,[g.VIZ]:jx,[g.GENERATOR]:Ai,[g.SECTION_FLAG]:Ai,[g.IMAGE]:wi,[g.NAV]:Oi,[g.RELATED]:Bi,[g.RESET_BUTTON]:Ni,[g.COMPARISON_BUTTON]:Fi,[g.TABLE]:Vi,[g.BUTTON]:zi,[g.MULTIHIERARCHY_SELECTOR]:Ui};});var Xd=v(()=>{c();ye();({[g.TITLE]:IconHeading,[g.GENERATOR]:IconApi,[g.SECTION_FLAG]:IconFlag,[g.STAT]:IconPercentage,[g.VIZ]:IconChartBar,[g.PARAGRAPH]:IconAlignLeft,[g.SELECTOR]:IconSelector,[g.IMAGE]:IconPhoto,[g.TABLE]:IconTable,[g.MULTIHIERARCHY_SELECTOR]:IconListTree});});var Qd=v(()=>{c();ye();({[g.TITLE]:"Title",[g.GENERATOR]:"Data",[g.STAT]:"Stat",[g.VIZ]:"Visualization",[g.PARAGRAPH]:"Paragraph",[g.SELECTOR]:"Selector",[g.SUBTITLE]:"Subtitle",[g.RESET_BUTTON]:"Reset Button",[g.COMPARISON_BUTTON]:"Comparison Button",[g.RELATED]:"Related Reports",[g.NAV]:"Navigation",[g.IMAGE]:"Image",[g.TABLE]:"Table",[g.BUTTON]:"Button",[g.FALLBACK]:"Fallback",[g.SECTION_FLAG]:"Section Flag",[g.MULTIHIERARCHY_SELECTOR]:"Multihierarchy Selector"});});var oR,Hi,Zd=v(()=>{c();ye();ad();Yd();Xd();Qd();oR={[g.GENERATOR]:{type:g.GENERATOR,renderer:Fe[g.GENERATOR],renderPreviewOnEdit:!1},[g.SECTION_FLAG]:{type:g.SECTION_FLAG,renderer:Fe[g.SECTION_FLAG],renderPreviewOnEdit:!1},[g.IMAGE]:{type:g.IMAGE,renderer:Fe[g.IMAGE],renderPreviewOnEdit:!1},[g.PARAGRAPH]:{type:g.PARAGRAPH,renderer:Fe[g.PARAGRAPH],renderPreviewOnEdit:!0,evalWhenNonActive:!0},[g.RELATED]:{type:g.RELATED,renderer:Fe[g.RELATED],renderPreviewOnEdit:!1,evalWhenNonActive:!1},[g.SELECTOR]:{type:g.SELECTOR,renderer:Fe[g.SELECTOR],adapter:rn[g.SELECTOR],nonActiveAdapter:()=>rn[g.SELECTOR]({name:"Selector Preview"}),renderPreviewOnEdit:!1},[g.STAT]:{type:g.STAT,renderer:Fe[g.STAT],renderPreviewOnEdit:!0,evalWhenNonActive:!0},[g.SUBTITLE]:{type:g.SUBTITLE,renderer:Fe[g.SUBTITLE],renderPreviewOnEdit:!0,evalWhenNonActive:!0},[g.TITLE]:{type:g.TITLE,renderer:Fe[g.TITLE],renderPreviewOnEdit:!0,evalWhenNonActive:!0},[g.VIZ]:{type:g.VIZ,renderer:Fe[g.VIZ],renderPreviewOnEdit:!1},[g.NAV]:{type:g.NAV,renderer:Fe[g.NAV],renderPreviewOnEdit:!0,evalWhenNonActive:!0},[g.RESET_BUTTON]:{type:g.RESET_BUTTON,renderer:Fe[g.RESET_BUTTON],renderPreviewOnEdit:!0,evalWhenNonActive:!0},[g.COMPARISON_BUTTON]:{type:g.COMPARISON_BUTTON,renderer:Fe[g.COMPARISON_BUTTON],renderPreviewOnEdit:!0,evalWhenNonActive:!0},[g.TABLE]:{type:g.TABLE,renderer:Fe[g.TABLE],renderPreviewOnEdit:!1,evalWhenNonActive:!1},[g.BUTTON]:{type:g.BUTTON,renderer:Fe[g.BUTTON],renderPreviewOnEdit:!0,evalWhenNonActive:!0},[g.MULTIHIERARCHY_SELECTOR]:{type:g.MULTIHIERARCHY_SELECTOR,renderer:Fe[g.MULTIHIERARCHY_SELECTOR],adapter:rn[g.MULTIHIERARCHY_SELECTOR],nonActiveAdapter:()=>rn[g.MULTIHIERARCHY_SELECTOR]({label:"Multihierarchy Selector Preview"}),renderPreviewOnEdit:!1}},Hi=oR;});function ia({blockId:e,active:t=!0,asComparison:r=!1}){let{query:o,locale:n=mt}=useRouter(),a=Ze(),s=gt(e).data,i=oo(e,r&&a.active?a?.variables.variables:void 0,r&&a.active?a?.variables.attributes:void 0),l=Oe(s,n),u=At(n),p={variables:i,query:o,locale:n},d=Q(w=>w.variables.variables[s.id]||{}),m=Q(w=>w.variables.status[s.id]||{}),[b,f]=useState(()=>{if(![g.GENERATOR,g.VIZ,g.NAV].includes(s.type)){if(s?.type===g.SELECTOR){let k=Oe(s,n),{config:A}=Kr(s.id,k?.logic,u,p);return {...A,id:s.id,section:s.section_id}}if(s?.type===g.MULTIHIERARCHY_SELECTOR){let k=Oe(s,n),{config:A}=Yr(s.id,k.logic,u,p);return {...A,id:s.id,section:s.section_id}}let w=Vt(l?.logic,u,p),{vars:L}=at("variables",i,w,u,void 0,p);return L}return null});useEffect(()=>{(async()=>{if(!s||s.type===g.GENERATOR)return;if(s.type===g.VIZ){f({block:s,locale:n,variables:i,active:t});return}if(!t&&!Hi[s.type].evalWhenNonActive){let{nonActiveAdapter:A}=Hi[s.type],N=A&&typeof A=="function"?A():{};f(N);return}if(s.type===g.GENERATOR){f({outputVariables:d});return}if(g.SELECTOR===s.type){let A=Oe(s,n),{config:N}=Kr(s.id,A.logic,u,p);f({...N,id:s.id,section:s.section_id});return}if(g.MULTIHIERARCHY_SELECTOR===s.type){let A=Oe(s,n),{config:N}=Yr(s.id,A.logic,u,p);f({...N,id:s.id,section:s.section_id});return}if(s.type===g.NAV){let A=Oe(s,n).simple;f({id:s.id,headings:s.inputs,type:A?.type,section:s.section_id,settings:s.settings});return}if(s.type===g.RELATED){let{related_reports:A}=d;f({related_reports:A});return}if(s.type===g.RESET_BUTTON){f({id:s.id,...l.simple});return}if(s.type===g.COMPARISON_BUTTON){f({id:s.id,...l.simple});return}if(s.type===g.FALLBACK){f({id:s.id,type:s.original_type,roles:s.settings.access});return}let L=Vt(l?.logic,u,p),{vars:k}=at("variables",i,L,u,void 0,p);if(s.type===g.TABLE){f({sectionId:s.section_id,...k});return}f(k);})();},[l,i]);let y=m.allowed||s?.type===g.NAV;if(!s||!b||!y)return null;let h=Zp[s.type];return jsx("div",{id:`bespoke-${s.type}-${s.id}`,className:`cms-block-wrapper bespoke-block-area cms-block-${e}`,children:jsx(h,{...b,settings:s.settings,asComparison:r})})}var em=v(()=>{c();ye();Jp();Zd();br();Se();bn();Wr();kn();Da();za();Wt();});var tm,iR,rm,la,ca=v(()=>{c();tm={margin:{label:"Content Margin",defaultValue:"md",options:[{label:"None",value:"0px"},{label:"Small",value:"sm"},{label:"Medium",value:"md"},{label:"Large",value:"lg"}]},columnGutter:{label:"Column Gutter",defaultValue:"md",options:[{label:"None",value:"0px"},{label:"Small",value:"sm"},{label:"Medium",value:"md"},{label:"Large",value:"lg"}]},width:{label:"Width",defaultValue:"full",options:[{label:"Full Width",value:"full"},{label:"Center",value:"center"}]},position:{label:"Position",defaultValue:"normal",options:[{label:"Normal",value:"normal"},{label:"Sticky",value:"sticky"}]},style:{label:"Style",defaultValue:"none",options:[{label:"None",value:"none"},{label:"Card",value:"card"}]}},iR=Object.keys(tm).reduce((e,t)=>(e[t]=tm[t].defaultValue,e),{}),rm={memberImageBg:!1,optionsMenu:!1,optionData:!0,optionImage:!0,optionShare:!0,showAnchor:!1,...iR},la=e=>({data:typeof e.optionData=="boolean"?e.optionData:!0,image:typeof e.optionImage=="boolean"?e.optionImage:!0,share:typeof e.optionShare=="boolean"?e.optionShare:!0});});function om({previews:e}){let t=e.map((r,o)=>({key:r?`bg-${r.content_id}`:`bg-${o}`,src:r?`/api/cms/member/image?member=${r.content_id}&size=splash`:""}));return jsxs(Fragment,{children:[jsx(Group,{className:"cms-section-bg",grow:!0,spacing:0,style:{position:"absolute",width:"100%",height:"100%"},children:t.map(r=>jsx("div",{className:"cms-section-member-bg",style:{backgroundImage:`url(${r.src})`,backgroundSize:"cover",backgroundPosition:"center center",height:"100%",width:"100%"}},r.key))}),jsx("div",{className:"cms-section-gradient-bg",style:{background:"white",position:"absolute",width:"100%",height:"100%",opacity:.33}})]})}var nm=v(()=>{c();});function am({data:e}){let o=(e&&Array.isArray(e)&&e[0]?Object.keys(e[0]):[]).filter(n=>!n.startsWith("_")).map(n=>({accessorKey:n,header:n,enableSorting:!0,mantineTableBodyCellProps:{sx:{textWrap:"wrap"}}}));return jsx(MantineReactTable,{columns:o,data:e,enableBottomToolbar:!1,enableColumnActions:!1,enablePagination:!1,enableSorting:!0,enableTopToolbar:!1,initialState:{density:"xs"},layoutMode:"grid",mantineTableContainerProps:{sx:{minHeight:100,maxHeight:350}}})}var sm=v(()=>{c();});function xo(e){let t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'","&#x60;":"`","&nbsp;":""},r=`(?:${Object.keys(t).join("|")})`,o=RegExp(r),n=RegExp(r,"g"),a=String(e).replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();return o.test(a)?a.replace(n,s=>t[s]):a}var ji=v(()=>{c();});function Wi(e){return typeof e=="string"?String(e).replace(/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-f]{1,6});/ig," "):e}var im=v(()=>{c();});function fR(e){return e?mR(Wi(xo(e)),{replacement:"-",remove:/[*+~.()'"!:@]/g,lower:!0,strict:!0,trim:!0}):""}var Xt,ln=v(()=>{c();ji();im();Xt=fR;});function dm(e){let{section:t}=e,r=_t(),o=useRouter(),n=Q(M=>M.status.isCMS),a=Q(M=>M.status.currentLocale),s=o.locale,i=n?a:s,l=50,u=At(i),p=Ie("options"),d={...Zi,...p.data_tab},[m,b]=useState([]),[f,y]=useState([]),[h,w]=useState(),[L,k]=useState(),[A,N]=useState(!1),[z,E]=useState({}),[F,C]=useState(!0),[R,x]=useState(!0),{sectionVariables:O,setSectionVariables:D,resetSectionVariables:I}=Ae(t.id),P=t.blocks||[],Y=Q(M=>M),j=useMemo(()=>P.reduce((M,_)=>{let te=Y.records.entities.block[_],U=Y.variables.variables[_],Z=Y.variables.status[_];return (g.GENERATOR===te.type&&U._downloadEnabled===!0&&Z.allowed||g.VIZ===te.type&&Z.allowed)&&(M[_]={entity:te,variables:Y.variables.variables[_],status:Y.variables.status[_],inputVariablesFlat:te.inputs.reduce((X,ae)=>({...X,...Y.variables.variables[ae]}),Y.variables.attributes)}),M},{}),[P]),H=M=>{y(_=>_.includes(M)?_:[..._,M]);},ee=M=>{b(_=>(_.find(U=>U.ix===M.ix)?_:[..._,M]).sort((U,Z)=>U.ix>Z.ix?1:-1));};function oe(M){!h&&M[0]&&ce(M[0]);}function ce(M){w(M),k("0");}useEffect(()=>{let M=async(_,te,U)=>{let Z=dataLoad.bind({});return new Promise((X,ae)=>{Z(te,null,null,(le,qe)=>{if(le)ae(le);else {let ue=U instanceof Function?U(qe):qe;_.data.unshift(ue),ee(_),X(qe);}});})};if(m.length===0&&f.length===0){let _=0;for(let te of Object.values(j)){let U=te.entity;if([g.GENERATOR,g.SECTION_FLAG].includes(U.type)){let Z=te.variables._downloadData||te.variables._downloadUrl||te.status.api;if(Z){let X=[];typeof Z=="string"?X=Z.split(Sn):X=[Z];let ae=te.variables._downloadTitle||`${d.data_source} ${_+1}`,le=te.variables._downloadFileName||ae;ee({ix:_,id:U.id,title:xo(ae),fileName:le,data:Array.isArray(X)?X:[X],loading:!1,type:g.GENERATOR}),H(_),_++;}}else if(U.type===g.VIZ){let Z=Oe(U),X=te.inputVariablesFlat,ae={variables:X},le=st({logic:Z.logic},u,ae).logic,qe={router:o,section:{variables:O,setVariables:D,resetVariables:I}},ue=ir(le,u,X,i,U.id,{},qe),je=ue.config._downloadTitle||ue.config.title||`${d.viz_source} ${_+1}`,$e=ue.config._downloadFileName||je;if(ue.config._downloadEnabled!==!1)try{let We=ue.config._downloadUrl||ue.config.data,Eo=typeof We=="string"?[We]:We,ko=ue.dataFormat instanceof Function?ue.dataFormat:!1,mr=ue.config._downloadDataFormat instanceof Function?ue.config._downloadDataFormat:!1;M({ix:_,id:U.id,title:xo(je),fileName:$e,data:Eo,loading:!1,type:g.VIZ},We,mr||ko),H(_),_++;}catch(We){console.error("DataLoad catch",We);}}}x(!1);}},[j]),useEffect(()=>{m.length===f.length&&oe(m);},[m]),useEffect(()=>{if(h&&L){let M=parseInt(L,10);if(h.data[M]&&(!z[h.ix]||!z[h.ix][L])){C(!0);let _=h.data[L];typeof _=="string"?Ha(_,r,i).then(te=>{let U=MR(te);E({...z,[h.ix]:{...z[h.ix],[M]:U}});}).catch(te=>{console.error(te);}).finally(()=>{C(!1);}):(E({...z,[h.ix]:{...z[h.ix],[M]:_}}),C(!1));}}},[L,h]);let K=(M,_)=>{let te=M===_?"":`-${M}`.toLowerCase();if(h){let U=h.data.length>1&&L?`-${parseInt(L,10)+1}`:"";return `${Xt(h.fileName)}${te}${U}.${_.toLowerCase()}`}return `${te}.${_}`},q=async M=>{if(h){N(!0);let _=new TR,te=K(M,M);try{switch(M){case pa.json.extension:_.file(te,JSON.stringify(G));break;case pa.csv.extension:_.file(te,csvFormat(G));break;case pa.xlsx.extension:let{utils:U,write:Z}=await import('xlsx'),X=U.book_new();U.book_append_sheet(X,U.json_to_sheet(G),te.substring(0,30));let ae=Z(X,{bookType:"xlsx",bookSST:!0,type:"binary"});_.file(te,ae,{binary:!0});break;default:break}_.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:9}}).then(U=>{N(!1),saveAs(U,K(M,"zip"));});}catch(U){console.error(d.error_generating,U),N(!1);}}},G=useMemo(()=>h&&z[h.ix]&&z[h.ix][L]?z[h.ix][L]:[],[z,h,L]),$=useMemo(()=>m&&m.length>0&&m.length===f.length&&m.map((M,_)=>jsx(Button,{leftIcon:jsx(IconDatabase,{size:16}),onClick:()=>ce(M),variant:h?.ix===_?"filled":"default",loading:M.loading,disabled:M.loading,children:M.title},`source-${M.id}-${_}`)),[m,h,f]);return jsxs(Stack,{className:"cms-section-options-data",children:[jsx(Space,{h:"xs"}),jsx(LoadingOverlay,{visible:R,overlayBlur:2}),m.length===0&&!R&&jsxs(Alert,{icon:jsx(IconAlertCircle,{size:"1rem"}),title:"Oops!",children:[d.no_data_src," awa"]}),m.length>1&&m.length===f.length&&!R&&jsx(Input.Wrapper,{label:`${d.choose_data_src}:`,children:jsx(Group,{spacing:"xs",children:$})}),h&&L&&jsx(Stack,{spacing:"xs",children:jsx(Input.Wrapper,{label:`${d.preview}
61
61
  ${G.length>l?d.rows_preview.replace("{nrows}",l):""}:`,children:jsxs(Group,{spacing:"xs",children:[jsx(Select,{disabled:!(h.data.length>1),style:{flex:"1"},value:L,onChange:M=>k(M),data:h.data.map((M,_)=>({value:`${_}`,group:typeof M=="string"?d.raw_group:d.formatted_group,label:typeof M=="string"?M:d.formatted_src.replace("{src}",h.title)})),icon:typeof h.data[L]=="string"?jsx(IconLink,{}):jsx(IconSparkles,{})}),jsx(CopyButton,{value:typeof h.data[L]=="string"?h.data[L]:"",timeout:2e3,children:({copied:M,copy:_})=>jsx(Tooltip,{label:M?d.copied:d.copy,withArrow:!0,position:"top",children:jsx(ActionIcon,{variant:M?"filled":"subtle",onClick:_,disabled:typeof h.data[L]!="string",children:M?jsx(IconClipboardCheck,{size:16}):jsx(IconClipboardCopy,{size:16})})})})]})})}),h&&!F&&G.length===0&&jsx(Alert,{icon:jsx(IconAlertCircle,{size:"1rem"}),title:"Oops!",children:d.error_preview}),h&&L&&!F&&G.length===0&&jsx("a",{href:h.data[L],target:"_blank",rel:"noreferrer",children:jsx(Button,{leftIcon:jsx(IconExternalLink,{size:16}),fullWidth:!0,children:d.open_in_window.replace("{src}",h.title)})}),jsxs(Stack,{pos:"relative",mih:"430px",children:[jsx(LoadingOverlay,{visible:F&&m.length>0,overlayBlur:2}),h&&!F&&G.length>0&&jsxs(Fragment,{children:[jsx(Box,{h:"350px",children:jsx(am,{data:G.slice(0,l)})}),jsx(Input.Wrapper,{label:`${d.download}:`,children:jsx(Button.Group,{children:Object.values(pa).map(M=>jsx(Button,{leftIcon:jsx(M.icon,{size:24}),onClick:()=>q(M.extension),loading:A,fullWidth:!0,children:M.extension},`format-${M.extension}`))})})]})]})]})}var pa,Zi,MR,Ji=v(()=>{c();he();sm();ye();Jo();ln();ji();br();Se();hr();Sr();po();$a();ht();pa={csv:{extension:"CSV",icon:IconFileTypeCsv},json:{extension:"JSON",icon:IconFileTypeJs},xlsx:{extension:"XLSX",icon:IconFileTypeXls}},Zi={data_source:"Data Source",no_data_src:"No data sources defined",viz_source:"Visualization Source",error_generating:"Error generating file.",choose_data_src:"Choose data source",original_src:"Original {src}",loading:"Loading...",error_preview:`Sorry. We could not generate the data preview as a table.
62
- Try to open the source and check the data directly.`,open_in_window:"Open {src} response in a new window",formatted_src:"Formatted {src}",formatted_group:"Formatted Data",raw_group:"Raw Data",rows_preview:"(First {nrows} rows as preview)",choose_format:"Choose format",processing_file:"Processing file...",download:"Download data as",preview:"Preview",copy:"Click to copy",copied:"Copied!"},MR=e=>{let t=[];return e&&e.data&&(e.data&&Array.isArray(e.data)?t=e.data:e.data&&e.data.data&&Array.isArray(e.data.data)?t=e.data.data:e.data&&e.data.data&&e.data.data.results&&Array.isArray(e.data.data.results)?t=e.data.data.results:e.data&&e.data.results&&Array.isArray(e.data.results)&&(t=e.data.results)),t};});function hm(e){let{section:t}=e,r=t.blocks||[],o=Q(U=>r.map(Z=>U.records.entities.block[Z]).filter(Z=>Z.type===g.VIZ&&U.variables.status[Z.id].allowed)),{variant_slug1:n,slug1:a}=Q(U=>U.variables.attributes),s=Rp(),[i,l]=useState(St.section),[u,p]=useState(Tt.png),[d,m]=useState(!1),[b,f]=useState(!1),[y,h]=useState([]),[w,L]=useState(o.length>0?o[0].id:null),k=i!==St.section,{print:A,downloadLoading:N,error:z}=xp(t.id,n,a,k?w:null),[E,F]=useState(!0),[C,R]=useState(!1),x=Ie("options"),O={...tE,...x.image_tab},{siteProps:D}=Ar(),I=D?.logoSrc&&typeof D.logoSrc=="string",P=t?.settings?.name||`section-${t.id}`,Y=`#${P}`,j=useMantineTheme(),H=()=>{let U=ce(w);return select(U).select("svg").size()===1},ee=()=>`${Xt(P)}`,oe=()=>{let U=document.getElementById(P);return select(U).select(".bespoke-section-content").node()},ce=U=>{let Z=oe();return select(Z).select(`#bespoke-visualization-${U}.bespoke-block-area`).node()},K=()=>new Promise(U=>{let Z;i===St.section?Z=oe():i===St.viz&&(Z=ce(w));let X=document.createElement("div");X.style.display="flex",X.style.justifyContent="space-between",X.classList.add("bespoke-Viz-source"),X.style.padding=j.spacing.xs,X.style.width="100%";let ae=document.createElement("div");if(ae.innerText=O.source.replace("{src}",`${window.location}${Y}`),ae.style.fontSize=j.fontSizes.xs,X.appendChild(ae),I){let le=document.createElement("img");le.src=D.logoSrc,le.style.height="30px",le.onload=()=>U(Z),le.onerror=()=>{le.remove(),U(Z);},X.appendChild(le),Z.appendChild(X);}else Z.appendChild(X),U(Z);}),q=U=>{if(E)return "transparent";let Z=select(U).style("background-color");return Z!=="rgba(0, 0, 0, 0)"&&Z!=="transparent"?Z:U===document.body?"white":q(U.parentNode)},G=async(U,Z)=>{let{toPng:X}=await import('html-to-image');X(U,{backgroundColor:Z.background,cacheBust:!0,filter:ae=>ae&&ae.classList?!Z.exclusionClasses.some(le=>ae.classList.contains(le)):!0}).then(ae=>{let le=document.createElement("a");le.download=`${Z.filename}.png`,le.href=ae,le.click(),eE(),m(!1);}).catch(ae=>{console.log(ae);});},$=(U,Z)=>{saveElement(U,{filename:Z.filename,type:"svg",callback:()=>m(!1)},{background:Z.background});},M=async()=>{m(!0);let U=await K(),Z={background:q(U),exclusionClasses:["export-hidden"],filename:ee()},X=u===Tt.png?G:$;try{if(U)X(U,Z);else throw new Error(O.wrong_node)}catch{m(!1);}},_=async()=>{let{toCanvas:U}=await import('html-to-image');Promise.all(o.map(Z=>{let X=ce(Z.id),ae=X.querySelector("g.d3plus-geomap-tileGroup");return ae.style.display="none",U(X).then(le=>(ae.style.display="block",le))})).then(Z=>{h(Z.map(X=>X.toDataURL())),R(!1);});};useEffect(()=>{i===St.viz&&o.length>0?(L(o[0].id),R(!0),_()):i===St.section&&h([]);},[i]),useEffect(()=>{w&&(H()?f(!0):(f(!1),p(Tt.png)));},[w]);useRouter();return jsxs(Stack,{className:"cms-section-options-image",children:[jsx(Space,{h:"xs"}),o.length>0?jsx(Input.Wrapper,{label:`${O.choose_area}:`,children:jsx(SegmentedControl,{fullWidth:!0,value:i,data:[{value:St.section,label:jsxs(Center,{children:[jsx(IconTemplate,{size:"1rem"}),jsx(Box,{ml:10,children:O.entire_section})]})},{value:St.viz,label:jsxs(Center,{children:[jsx(IconChartBar,{size:"1rem"}),jsx(Box,{ml:10,children:O.viz_only})]})}],onChange:U=>{l(U),U===St.section&&p(Tt.png);}})}):jsx(Text,{fw:"700",color:"gray.7",children:`${O.entire_section}:`}),i===St.viz&&o.length>0&&jsxs(Input.Wrapper,{label:`${O.choose_viz}:`,style:{minHeight:"161px",position:"relative"},children:[!C&&y.length>0&&jsx(ScrollArea,{style:{height:250},children:jsx(SimpleGrid,{cols:3,children:o.map((U,Z)=>jsx(Image,{alt:`Viz ${U.id}`,onClick:()=>{L(U.id);},style:{cursor:"pointer",border:w===U.id?"4px solid #228be6":"4px solid #eee"},radius:0,src:y[Z],withPlaceholder:!0},`viz-option-${U.id}`))})}),jsx(LoadingOverlay,{visible:C})]}),b&&i!==St.section&&jsx(Input.Wrapper,{label:`${O.choose_format}:`,children:jsxs(Button.Group,{children:[jsx(Button,{leftIcon:jsx(IconPolaroid,{size:16}),onClick:()=>p(Tt.png),variant:u===Tt.png?"filled":"default",fullWidth:!0,children:Tt.png}),jsx(Button,{leftIcon:jsx(IconCode,{size:16}),onClick:()=>p(Tt.svg),variant:u===Tt.svg?"filled":"default",fullWidth:!0,children:Tt.svg})]})}),jsx(Checkbox,{checked:E,label:`${O.transparent_bg}`,onChange:()=>F(!E),radius:"xl"}),jsx(Button,{leftIcon:jsx(IconDownload,{size:16}),loading:d||N,onClick:s&&u!==Tt.svg?()=>A(E):M,fullWidth:!0,children:jsx("span",{children:d||N?O.processing:O.download.replace("{imageFormat}",u)})})]})}var St,Tt,eE,tE,ym=v(()=>{c();ln();he();ht();Ut();ea();ye();St={viz:"viz",section:"section"},Tt={png:"PNG",svg:"SVG"},eE=()=>{let e=document.getElementsByClassName("bespoke-Viz-source");Array.from(e).forEach(t=>t.remove());},tE={wrong_node:"Wrong node in export",choose_area:"Choose image area",choose_viz:"Choose visualization",choose_format:"Choose format",transparent_bg:"Transparent background",processing:"Processing image...",download:"Download {imageFormat}",entire_section:"Entire section",viz_only:"Visualization only",source:"Source: {src}"};});function vm(e){let{title:t,url:r,disabled:o=!1}=e,n=o?IconCode:IconLink;return jsx(Input.Wrapper,{label:t,children:jsx(Input,{icon:jsx(n,{}),value:r,disabled:o,readOnly:!0,rightSection:jsx(CopyButton,{value:r,timeout:2e3,children:({copied:a,copy:s})=>jsx(Tooltip,{label:a?"Copied":"Copy",withArrow:!0,position:"right",children:jsx(ActionIcon,{variant:a?"filled":"subtle",onClick:s,disabled:o,children:a?jsx(IconClipboardCheck,{size:16}):jsx(IconClipboardCopy,{size:16})})})})})})}var Sm=v(()=>{c();});function xm(e){let{section:t}=e,[r,o]=useState(""),[n,a]=useState(""),[s,i]=useState(!0),l=Ie("options"),u={...AE,...l.share_tab};return useEffect(()=>{a(document.title);let{origin:p,pathname:d}=window.location,m=`${p}${d}`,b=s?t.settings?.name?.length?`#${Xt(t.settings.name)}`:`#section-${t.id}`:"";o(`${m}${b}`);},[s]),jsxs(Stack,{className:"cms-section-options-share",children:[jsx(Space,{h:"xs"}),jsx(vm,{title:`${u.title}: ${n}`,url:r}),jsx(Checkbox,{checked:s,label:u.include_section,onChange:()=>i(!s),radius:"xl"}),jsxs(Group,{position:"center",children:[jsx(FacebookShareButton,{url:r,quote:n,children:jsx(FacebookIcon,{size:32,round:!0})}),jsx(TwitterShareButton,{url:r,title:n,children:jsx(TwitterIcon,{size:32,round:!0})}),jsx(TelegramShareButton,{url:r,title:n,children:jsx(TelegramIcon,{size:32,round:!0})}),jsx(WhatsappShareButton,{url:r,title:n,separator:":: ",children:jsx(WhatsappIcon,{size:32,round:!0})}),jsx(LinkedinShareButton,{url:r,children:jsx(LinkedinIcon,{size:32,round:!0})}),jsx(RedditShareButton,{url:r,title:n,windowWidth:660,windowHeight:460,children:jsx(RedditIcon,{size:32,round:!0})}),jsx(EmailShareButton,{url:r,subject:n,children:jsx(EmailIcon,{size:32,round:!0})})]})]})}var AE,Rm=v(()=>{c();Sm();ht();ln();AE={title:"Title",include_section:"Include Section"};});function Cm(e){let{section:t,initialMode:r,onEnds:o,open:n,title:a}=e,s=la(t.settings),i=useMemo(()=>OE.filter(b=>s[b]),[s]),[l,u]=useState(r||i[0]||"data"),p=Ie("options");useEffect(()=>{r!==l&&u(r);},[r]);let d={...rl,...p},m=useMemo(()=>jsxs(Fragment,{children:[jsxs(Tabs.List,{children:[s.data&&jsx(Tabs.Tab,{value:"data",children:d.download_title}),s.image&&jsx(Tabs.Tab,{value:"image",children:d.image_title}),s.share&&jsx(Tabs.Tab,{value:"share",children:d.share_title})]}),s.data&&jsx(Tabs.Panel,{value:"data",children:jsx(dm,{section:t})}),s.image&&jsx(Tabs.Panel,{value:"image",children:jsx(hm,{section:t})}),s.share&&jsx(Tabs.Panel,{value:"share",children:jsx(xm,{section:t})})]}),[s,t,d]);return jsx("div",{className:"cms-section-options-modal",children:n&&jsx(Modal,{className:"bespoke-options-modal",opened:!0,onClose:()=>o(),size:"xl",title:a,children:jsx(Tabs,{onTabChange:u,value:l,keepMounted:!1,children:m})})})}var rl,OE,Pm=v(()=>{c();Ji();ym();Rm();ht();ca();rl={download_title:"Download Data",image_title:"Save Image",share_title:"Share Link"},OE=["data","image","share"];});function Im(e){let{sectionId:t,disabled:r=!1}=e,[o,n]=useState(!1),[a,s]=useState("data"),i=Mn(t),l=Ie("options"),u={...rl,...l},p=la(i.isSuccess?i.data.settings:{}),d=b=>{s(b),n(!0);},m=()=>{n(!1);};return jsxs("div",{className:"cms-section-options",children:[jsxs(Button.Group,{children:[p.data&&jsx(Button,{variant:"default",size:"xs",compact:!0,onClick:()=>d("data"),"aria-label":u.download_title,disabled:r,children:jsx(IconTable,{size:16})}),p.image&&jsx(Button,{variant:"default",size:"xs",compact:!0,onClick:()=>d("image"),"aria-label":u.image_title,disabled:r,children:jsx(IconCamera,{size:16})}),p.share&&jsx(Button,{variant:"default",size:"xs",compact:!0,onClick:()=>d("share"),"aria-label":u.share_title,disabled:r,children:jsx(IconShare,{size:16})})]}),i.isSuccess&&jsx(Cm,{section:i.data,initialMode:a,open:o,onEnds:m})]})}var Lm=v(()=>{c();Pm();he();ht();ca();});function DE({children:e,containerProps:t},r){return jsx(Flex,{ref:r,className:"bespoke-section-content",pos:"relative",align:"stretch",p:0,direction:{base:"column",md:"row"},wrap:"wrap",...t,children:e})}var ga,Bm,Nm=v(()=>{c();he();Qs();ga=Kt__default.forwardRef(function({children:t,column:r,basis:o,columnSettings:n={},sx:a={},...s},i){let l=Object.values(r).some(m=>m.settings?.display==="inline"),u=n?.width?`${n.width}px`:o,p=n?.width?`${n?.width}px`:"100%",d=n?.full?"100%":p;return jsx(Flex,{ref:i,className:"bespoke-section-col",align:"flex-start",direction:l?"row":"column",wrap:l?"wrap":"nowrap",maw:{base:"100%",md:d},miw:{base:"none",md:300},p:0,pos:"relative",sx:[{flexGrow:1,flexShrink:n?.full?0:1,flexBasis:n?.full?"100%":u},...packSx(a)],...s,children:t})}),Bm=Kt__default.forwardRef(DE);});var Fm=v(()=>{c();});var pn,Dm=v(()=>{c();ze();he();Fm();ye();pn={px:e=>Number.isNaN(parseFloat(e))?"px":`${e}px`.replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),"%":e=>Number.isNaN(parseFloat(e))?"%":`${e}%`.replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")},{px:{defaultValue:400,min:25,step:5,formatter:pn.px},"%":{defaultValue:50,min:20,max:100,step:5,formatter:pn["%"]}};});var ol,Vm=v(()=>{c();ol={backgroundColor:"#fafafa",block:{padding:10},column:{padding:12},section:{backgroundColor:"white",borderRadius:10,boxShadow:"0px 6px 10px rgba(12, 32, 50, 0.14), 0px 1px 15px rgba(12, 32, 50, 0.12), 0px 3px 5px rgba(12, 32, 50, 0.15)",margin:8,padding:32}};});function al({previews:e,translations:t}){let{print:r}=Ue(),o=useMemo(()=>e.map(({image:n,name:a},s)=>(n?.author||n?.url)&&jsxs(Stack,{spacing:0,children:[n.author&&jsxs(Text,{size:"xs",children:[a," ",t.image_by," ",jsx("strong",{children:n.author})]}),n.url&&jsxs(Text,{size:"xs",children:["URL: "," ",jsx(Anchor,{href:n.url,target:"_blank",children:n.url})]}),s+1<e.length&&jsx(Divider,{})]},n.id)),[e]);return jsx(Fragment,{children:r?jsx(Fragment,{children:o}):jsxs(Popover,{position:"right",children:[jsx(Popover.Target,{children:jsx(ActionIcon,{variant:"light",radius:"xl",children:jsx(IconPhoto,{size:20})})}),jsx(Popover.Dropdown,{children:o})]})})}var Um=v(()=>{c();jt();});function Gm(){let{locales:e}=useRouter(),t=location&&location.pathname.split("/").filter(r=>r.length>0)[0];return e?.includes(t)}var Hm=v(()=>{c();});function JE({name:e,children:t,id:r,sectionSettings:o,sectionStyles:n,previews:a,translations:s}){let{print:i}=Ue(),l=o.memberImageBg&&a.some(({image:p})=>p&&(p.url||p.author)),u=useMemo(()=>o.showAnchor&&o.optionsMenu?"apart":!o.showAnchor&&o.optionsMenu?"right":o.showAnchor&&!o.optionsMenu?"left":"right",[o.showAnchor,o.optionsMenu]);return jsxs(XE,{className:`bespoke-Section-${r} bespoke-Section-root `,settings:o,styles:n?.root||void 0,print:i,children:[o.memberImageBg&&jsx(om,{previews:a}),jsxs(QE,{className:`bespoke-Section-${r} bespoke-Section-container `,settings:o,styles:n?.container,id:e?.length?Xt(e):`section-${r}`,pos:"relative",children:[!i&&jsxs(Group,{position:u,mb:"xs",children:[o.showAnchor&&jsxs(Anchor,{className:"cms-section-anchor",href:`#${o.name?Xt(o.name):"section-"+r}`,sx:{"&:hover .cms-section-name":{visibility:"visible",opacity:1}},children:[jsx(Text,{span:!0,size:"small",children:"#"}),jsx(Text,{span:!0,size:"small",className:"cms-section-name",sx:{visibility:"hidden",opacity:0,transition:"visibility 0s, opacity 0.2s ease-in-out"},children:o.name||"section-"+r})]}),o.optionsMenu&&jsx(Im,{sectionId:r,disabled:!1})]}),jsxs(ZE,{print:i,className:`bespoke-Section-${r} bespoke-Section-container`,settings:o,styles:n?.content,children:[t,l&&jsx(al,{previews:a,translations:s})]})]})]})}function tk({section:e,sectionLoader:t}){let{isEmbed:r}=Ue(),{id:o,settings:n}=e,a={...rm,...n},s=Ze(),i=Q(E=>E),l=Q(E=>E.variables.status),{previews:u,isRunConsumersRunning:p}=Q(E=>E.status),d=s.active&&s.status?u.concat(s.status?.previews||[]):u,m=ot().Section,b=wt(i),f=Object.values(b||{}).filter(E=>E.section_id===o),y=Ie("sections"),h={...YE,...y},w=f.some(E=>{try{return l[E.id].allowed&&![g.GENERATOR,g.SECTION_FLAG].includes(E.type)||E.type===g.NAV}catch{return E.settings.allowed==="always"}}),L=f.filter(E=>![g.GENERATOR,g.SECTION_FLAG].includes(E.type)).reduce((E,F)=>(E[F.blockcol]?E[F.blockcol][F.blockrow]=F:E[F.blockcol]={[F.blockrow]:F},E),{}),k=Object.keys(f).length>0&&!n.hidden&&w,A=Object.keys(L).length;if(!k||s.active&&n.comparisonHide)return null;let N=(E,F=!1)=>{let C=Array.from(new Set(E.map(x=>x.blockcol))).map(x=>({blockcol:x})).sort((x,O)=>Ye(x,O,"blockcol")),R=[];return C.forEach(({blockcol:x})=>{let O=E.filter(D=>D.blockcol===x).sort((D,I)=>Ye(D,I,"blockrow")).map(D=>{if(!D.id||!l[D.id]?.allowed&&D.type!==g.NAV)return null;let{settings:I,type:P}=b[D.id],Y=I.width&&!I.width.stretch&&I.width.unit?pn[I.width.unit](I.width.value):I.display==="inline"?"auto":"100%",j={alignSelf:P===g.VIZ?"stretch":"flex-start",flexGrow:0,margin:"0",width:Y,minWidth:300};return jsx(Box,{className:"bespoke-Block-wrapper",id:`bespoke-Block-${D.id}`,sx:j,py:ol.block.padding,children:jsx(ia,{blockId:D.id,asComparison:F},D.id)},D.id)});R.push(O);}),R.flat()},z=[];if(s.active&&!n.comparisonMerge){let E=f.filter(F=>![g.GENERATOR,g.SECTION_FLAG].includes(F.type)).reduce((F,C)=>({...F,[C.id]:C}),{});z=[jsx(ga,{column:E,basis:"50%",children:N(Object.values(f.filter(F=>![g.GENERATOR,g.SECTION_FLAG].includes(F.type))))},"original"),jsx(ga,{column:E,basis:"50%",children:N(Object.values(f.filter(F=>![g.GENERATOR,g.SECTION_FLAG].includes(F.type))),!0)},"comparison")];}else z=Object.keys(L).sort((E,F)=>-wa(E,F)).map(E=>{let F=L[E],C=n.columnSettings?n.columnSettings[E]:{},R=Object.values(F).sort((x,O)=>Ye(x,O,"blockrow"));return R.some(x=>!l[x.id]||l[x.id].allowed||x.type===g.NAV)?jsx(ga,{column:F,columnSettings:C,basis:`calc(${100/A}% - (10px * ${A}))`,children:R.map(x=>{if(!x.id||!l[x.id]?.allowed&&x.type!==g.NAV)return null;let{settings:O,type:D}=b[x.id],I=O.width&&!O.width.stretch&&O.width.unit?pn[O.width.unit](O.width.value):O.display==="inline"?"auto":"100%",P={alignSelf:D===g.VIZ?"stretch":"flex-start",flexGrow:0,margin:"0",width:I,minWidth:300};return jsx(Box,{className:`bespoke-Block-wrapper bespoke-${x.type}-wrapper`,id:`bespoke-Block-${x.id}`,sx:P,py:ol.block.padding,children:jsx(ia,{blockId:x.id},x.id)},x.id)})},E):null});return jsxs(JE,{id:o,name:e?.settings?.name,previews:d,sectionSettings:a,sectionStyles:m,translations:h,children:[p.includes(o)&&t,jsx(Bm,{containerProps:{gap:a.columnGutter||"md",wrap:s.active?"nowrap":"wrap",sx:{zIndex:20}},children:z}),r&&jsx(ek,{})]})}var YE,sl,XE,QE,ZE,ek,Xm,Qm=v(()=>{c();he();or();em();ca();zr();nm();Lm();Or();ye();Nm();Dm();Vm();jt();ht();Um();Wt();ln();Ut();Hm();YE={image_by:"image by"},sl=(e,t)=>r=>e?e(r,t):{},XE=({settings:e,styles:t,print:r,children:o,...n})=>{let{position:a,shouldBreak:s}=e,i={normal:{position:"relative",backgroundColor:r?"transparent":"initial",borderRadius:0},sticky:{position:"sticky",zIndex:2,top:0,borderRadius:0,borderTop:r?"none":"initial",borderLeft:r?"none":"initial",borderRight:r?"none":"initial"}},l={normal:{radius:0},sticky:{radius:0,withBorder:!0}},u=[i[a],sl(t,e),s?{pageBreakBefore:"always"}:{}];return jsx(Paper,{component:"section",sx:u,...l[a],...n,children:o})},QE=({settings:e,styles:t,children:r,...o})=>{let{width:n}=e,a={center:{zIndex:1},full:{zIndex:1}},s={center:{size:"lg",p:"sm",fluid:!1},full:{fluid:!0,p:"md"}},i=[a[n],sl(t,e)];return jsx(Container,{sx:i,...s[n],...o,children:r})},ZE=({settings:e,styles:t,print:r,children:o,...n})=>{let{style:a}=e,s={none:{},card:{boxShadow:r?"none":"initial"}},i={none:{bg:"transparent"},card:{shadow:r?"none":"lg",p:"md",radius:"md"}},l=[s[a],sl(t,e)];return jsx(Paper,{sx:l,...i[a],...n,"data-screenshot-target":"true",children:o})};ek=()=>{let e=useRouter(),{query:t,locale:r}=e,{siteProps:o={logoSrc:""},profilePrefix:n,pathSegment:a}=Ar(),s=t[a],i=Array.isArray(s)?s.join("/"):[],u=Gm()?`/${r}`:"";u+=`${n}/${i}/`;let p=new URL(u,window.location.href).href;return jsxs(Group,{position:"apart",noWrap:!0,sx:{flexGrow:1},children:[jsx(Anchor,{href:p,target:"_blank",children:p}),jsx("img",{src:o.logoSrc,height:40,width:"auto",alt:"Site Logo"})]})};Xm=tk;});var Zm=v(()=>{c();se();W({name:"abbreviate",description:"Abbreviates a number into a smaller more human-readable number.",logicFactory(e){return t=>e.d3plus.formatAbbreviate(t)},inputType:"number",testValue:"123456",type:"formatter"});});var Jm=v(()=>{c();se();W({name:"abs",description:"Simple Absolute Value.",logicFactory(e){return t=>Math.abs(t)},inputType:"number",testValue:"-123",type:"formatter"});});var nk,ef=v(()=>{c();se();nk=()=>function(t){let o=new RegExp(/([\$0-9\,]+)[A-z\-\s\&]*([\$0-9\,]*)/g).exec(t);return o?(o=o.slice(1).filter(n=>n.length).map(n=>(n.includes(",")&&(n.indexOf(",")===n.length-4?n=n.replace(/,000$/g,"k").replace(/([0-9]+)(,999$)/g,a=>`${parseInt(a)+1}k`):n.indexOf(",")===n.length-8&&(n=n.replace(/,000,000$/g,"M").replace(/([0-9]+)(,999,999$)/g,a=>`${parseInt(a)+1}M`))),n)),o.length===2?o.join(" - "):t.toLowerCase().match(/under|less|\</g)?`< ${o[0]}`:t.toLowerCase().match(/over|more|\+|\>/g)?`${o[0]}+`:`${o[0]}`):"None"},W({name:"bucket",description:"Sanitizes bucket strings to '< n', 'n1 - n2', and 'n+'",logicFactory:nk,inputType:"number",testValue:"1234",type:"formatter"});});var tf=v(()=>{c();se();W({name:"commas",description:"* Rounds to nearest whole number and adds commas.",logicFactory(e){return t=>e.d3.format(",")(Math.round(t))},inputType:"number",testValue:"1234.6",type:"formatter"});});var rf=v(()=>{c();se();W({name:"date",description:"Formats a date into '%B %d, %Y' format.",logicFactory(e){return t=>(typeof t=="string"&&(t=e.d3plus.date(t)),e.d3.timeFormat("%B %d, %Y")(t))},inputType:"date",testValue:"2022-01-01",type:"formatter"});});var of=v(()=>{c();se();W({name:"dollar",description:"Adds a US dollar sign to the beginning of a String or Number.",logicFactory(e){return t=>(typeof t=="number"&&(t=e.d3plus.formatAbbreviate(t)),t.charAt(0)==="-"?t.replace("-","-$"):`$${t}`)},inputType:"number",testValue:"123",type:"formatter"});});var nf=v(()=>{c();se();W({name:"formatFieldName",description:"Based on field name returns a string",logicFactory(e){return t=>{if(t.contentType.toLowerCase()==="stat"){if(t.field==="title")return "Stat label";if(t.field==="value")return "Stat value";if(t.field==="subtitle")return "Stat subtitle";if(t.field==="tooltip")return "Tooltip text"}return t.contentType.toLowerCase()==="section"&&t.field==="short"?"Short title":t.contentType.toLowerCase()==="description"&&t.field==="description"?"Paragraph":t.field}},inputType:"object",testValue:'{"field":"title","contentType":"stat"}',type:"formatter"});});var af=v(()=>{c();se();W({name:"grewTo",description:"Returns the text with grow direction: 'declined from', 'grew to' o 'stayed at'",logicFactory(e){return t=>t<0?"declined from":t>0?"grew to":"stayed at"},inputType:"number",testValue:"-1234",type:"formatter"});});var sf=v(()=>{c();se();W({name:"grewWord",description:"Returns either 'grew', 'declined', or 'stayed' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"declined":t>0?"grew":"stayed"},inputType:"number",testValue:"-1234",type:"formatter"});});var lf=v(()=>{c();se();W({name:"growing",description:"Returns either 'declining', 'growing' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"declining":"growing"},inputType:"number",testValue:"-1234",type:"formatter"});});var mk,cf=v(()=>{c();se();mk=()=>function(t){let{curr:r,currMoe:o=0,prev:n,prevMoe:a=0}=t,s;if(o||a){let i=(-n/r**2)**2*o**2,l=(1/r)**2*a**2;s=Math.sqrt(i+l);}else s=(r-n)/n;return s*100},W({name:"growth",description:"Calculates the growth percentage between two numbers provided the following object format: {curr, prev}. Also supports calculating the growth between two margin of errors using this format: {curr, currMoe, prev, prevMoe}",logicFactory:mk,inputType:"object",testValue:'{"curr":10,"currMoe":0,"prev":13,"prevMoe":0}',type:"formatter"});});var uf=v(()=>{c();se();W({name:"growthPct",description:"Abbreviates a growth value, turns it absolute, and adds a percent sign.",logicFactory(e){return t=>`${e.d3plus.formatAbbreviate(Math.abs(t))}%`},inputType:"number",testValue:"12345",type:"formatter"});});var pf=v(()=>{c();se();W({name:"growthWord",description:"Returns either 'growth' or 'decline' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"decline":"growth"},inputType:"number",testValue:"-1234",type:"formatter"});});var df=v(()=>{c();se();W({name:"highWord",description:"Returns either 'higher than', 'lower than', or 'approximately the same as' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"lower than":t>0?"higher than":"approximately the same as"},inputType:"number",testValue:"0",type:"formatter"});});var mf=v(()=>{c();se();W({name:"increaseWord",description:"Returns either 'increase', 'decrease', or 'change' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"decrease":t>0?"increase":"change"},inputType:"number",testValue:"1234",type:"formatter"});});var ff=v(()=>{c();se();W({name:"increasedWord",description:"Returns either 'increased', 'decreased', or 'remained the same' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"decreased":t>0?"increased":"remained the same"},inputType:"number",testValue:"0",type:"formatter"});});var gf=v(()=>{c();se();W({name:"increasing",description:"Returns either 'decreasing', 'increasing' or 'maintaining' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"decreasing":t>0?"increasing":"maintaining"},inputType:"number",testValue:"-1234",type:"formatter"});});var hf=v(()=>{c();se();W({name:"largerThan",description:"Returns either 'higher than', 'lower than', or 'approximately the same as' depending on the provided number's sign",logicFactory(e){return t=>t<0?"smaller than":t>0?"larger than":"the same as"},inputType:"number",testValue:"-1234",type:"formatter"});});var yf=v(()=>{c();se();W({name:"list",description:"Joins an array of strings together, adding commas and 'and' when necessary.",logicFactory(e){return t=>t.reduce((r,o,n)=>(n?n===t.length-1&&n===1?r+=` and ${o}`:n===t.length-1?r+=`, and ${o}`:r+=`, ${o}`:r+=o,r),"")},inputType:"object",testValue:'["foo","bar","bee"]',type:"formatter"});});var bf=v(()=>{c();se();W({name:"longWord",description:"",logicFactory(e){return t=>t<0?"shorter":t>0?"longer":"similar"},inputType:"number",testValue:"5",type:"formatter"});});var vf=v(()=>{c();se();W({name:"lowerCaseFirst",description:"Converts the first letter of a string to lowercase",logicFactory(e){return t=>typeof t=="string"?t.charAt(0).toLowerCase()+t.slice(1):t},inputType:"string",testValue:"foo",type:"formatter"});});var Sf=v(()=>{c();se();W({name:"moreFewerWord",description:"",logicFactory(e){return t=>t<0?"fewer":"more"},inputType:"number",testValue:"-5",type:"formatter"});});var Tf=v(()=>{c();se();W({name:"moreLess",description:"Returns either 'more' or 'less' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"less":"more"},inputType:"number",testValue:"-5",type:"formatter"});});var xf=v(()=>{c();se();W({name:"moreLess",description:"Returns either 'more than', 'less than', or 'approximately the same' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"less than":t>0?"more than":"approximately the same"},inputType:"number",testValue:"-5",type:"formatter"});});var Rf=v(()=>{c();se();W({name:"olderWord",description:"",logicFactory(e){return t=>t<0?"getting younger":t>0?"getting older":"staying the same age"},inputType:"number",testValue:"-5",type:"formatter"});});var Ef=v(()=>{c();se();W({name:"olderYounger",description:"",logicFactory(e){return t=>t<0?"younger than":t>0?"older than":"the same age as"},inputType:"number",testValue:"-5",type:"formatter"});});var kf=v(()=>{c();se();W({name:"plural",description:"Pluralizes a word.",logicFactory(e){return t=>t.replace(/\w$/g,r=>r==="y"?"ies":`${r}s`)},inputType:"string",testValue:"Foo",type:"formatter"});});var Cf=v(()=>{c();se();W({name:"pxToInt",description:"Takes a pixel value and converts it to an integer",logicFactory(e){return t=>parseInt(t.replace(/\D+/g,""),10)},inputType:"string",testValue:"12px",type:"formatter"});});var Pf=v(()=>{c();se();W({name:"salary",description:"Displays salary values with proper precision (ie. '$74,200' instead of '$74.2k')",logicFactory(e){return t=>{let r;return t<1e6?r=e.d3.format(",")(t.toFixed(0)):r=e.d3plus.formatAbbreviate(t),`$${r}`}},inputType:"number",testValue:"1000000",type:"formatter"});});var Af=v(()=>{c();se();W({name:"stripEntities",description:"Removes non breaking spaces & other html entities from a string",logicFactory(e){return t=>typeof t=="string"?String(t).replace(/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-f]{1,6});/ig," "):t},inputType:"string",testValue:"<b>MyText</b>",type:"formatter"});});var il,wf=v(()=>{c();se();il=W({name:"stripHTML",description:"Converts html tags to spaces, then removes redundant spaces",logicFactory(e){return t=>{let r={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'","&#x60;":"`","&nbsp;":""},o=`(?:${Object.keys(r).join("|")})`,n=RegExp(o),a=RegExp(o,"g"),s=String(t).replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();return n.test(s)?s.replace(a,i=>r[i]):s}},inputType:"string",testValue:"<b>My text</b>",type:"formatter"});});var If=v(()=>{c();se();W({name:"stripOL",description:"Removes ordered list wrapper tags from a string.",logicFactory(e){return t=>t.replace(/<ol>/g,"").replace(/<\/ol>/g,"")},inputType:"string",testValue:"<ol><li>My list</li></ol>",type:"formatter"});});var Lf=v(()=>{c();se();W({name:"stripP",description:"Removes all paragraph tags from a string.",logicFactory(e){return t=>t.replace(/<p>/g,"").replace(/<\/p>/g,"")},inputType:"string",testValue:"<p>My p</p>",type:"formatter"});});var Of=v(()=>{c();se();W({name:"stripUL",description:"Removes unordered list wrapper tags from a string.",logicFactory(e){return t=>t.replace(/<ul>/g,"").replace(/<\/ul>/g,"")},inputType:"string",testValue:"<ul><li>My list</li></ul>",type:"formatter"});});var _f=v(()=>{c();se();W({name:"toKebabCase",description:"Takes a camelCase or PascalCase string and converts it to kebab-case.",logicFactory(e){return t=>typeof t=="string"?(t=t.charAt(0).toLowerCase()+t.substring(1),t.replace(/([A-Z])/g,"-$1").toLowerCase()):"invalid string passed to toKebabCase()"},inputType:"string",testValue:"camelCaseText",type:"formatter"});});var Bf=v(()=>{c();se();W({name:"toSpacedCase",description:"Takes a camelCase or PascalCase string and adds spaces (I know Spaced Case isn't a thing, deal with it).",logicFactory(e){return t=>typeof t=="string"?t.replace(/([A-Z])/g," $1").toLowerCase().trim():"invalid string passed to toSpacedCase()"},inputType:"string",testValue:"camelCaseText",type:"formatter"});});var Mf=v(()=>{c();se();W({name:"upperCaseFirst",description:"Converts the first letter of a string to uppercase",logicFactory(e){return t=>t.charAt(0).toUpperCase()+t.slice(1)},inputType:"string",testValue:"my name",type:"formatter"});});var Nf=v(()=>{c();Zm();Jm();ef();tf();rf();of();nf();af();sf();lf();cf();uf();pf();df();mf();ff();gf();hf();yf();bf();vf();Sf();Tf();xf();Rf();Ef();kf();Cf();Pf();Af();wf();If();Lf();Of();_f();Bf();Mf();});function zf({onDownloadPDF:e,onDownloadCSV:t}){let[r,o]=useState(!1),[n,a]=useState(!1),[s,i]=useState(!1),l=useMediaQuery("(max-width: 768px)"),u=Ie("export"),p={...Wk,...u},d=async()=>{if(e){o(!0);try{await e();}finally{o(!1),i(!1);}}},m=async()=>{if(t){a(!0);try{await t();}finally{a(!1),i(!1);}}},b=(h,w,L,k,A,N)=>jsx(Button,{id:N,size:"sm",onClick:h,disabled:w,fullWidth:!0,variant:"subtle",h:"auto",px:"xs",w:"100%",styles:z=>({inner:{width:"100%",display:"block"}}),children:jsxs(Group,{noWrap:!0,position:"left",spacing:"xs",w:"100%",children:[w?jsx(Loader,{size:"1.75rem"}):L,jsxs(Stack,{spacing:0,w:"100%",py:"0.5rem",className:"bespoke-report-download-btn-text-container",children:[jsx(Text,{w:"100%",size:"sm",lineClamp:1,className:"bespoke-report-download-btn-text-container-cta",children:k}),A&&jsx(Text,{size:"xs",w:"100%",lineClamp:2,maw:"100%",style:{wordWrap:"break-word",whiteSpace:"normal"},variant:"dimmed",lh:"0.9rem",h:"1.9rem",className:"bespoke-report-download-btn-text-desc",children:A})]})]})}),f=e&&b(d,r,jsx(IconFileTypePdf,{size:"1.75rem"}),p.pdf.label,p.pdf.desc,"bespoke-download-pdf-btn"),y=t&&b(m,n,jsx(IconFileTypeXls,{size:"1.75rem"}),p.xlsx.label,p.xlsx.desc,"bespoke-download-xlsx-btn");return e||t?jsx(Affix,{position:{bottom:l?rem(0):rem(20),right:l?rem(0):rem(20)},id:"bespoke-report-download-affix",style:{width:l?"100%":"auto",boxShadow:l?"0px -2px 6px rgba(0, 0, 0, 0.1)":"0px 2px 6px rgba(0, 0, 0, 0.1)",borderRadius:"0.25rem",background:"white"},p:"xs",children:jsxs(Popover,{opened:s,onChange:i,position:"top",shadow:"md",width:l?"100%":250,id:"bespoke-report-download-popover",children:[jsx(Popover.Target,{children:jsx(Button,{id:"bespoke-report-download-btn",size:"sm",onClick:()=>i(h=>!h),leftIcon:jsx(IconDownload,{size:"1.2rem"}),variant:"subtle",loading:r||n,fullWidth:l,children:p.export})}),jsx(Popover.Dropdown,{p:"0.5rem",children:jsxs(Stack,{spacing:"xs",children:[f,y]})})]})}):null}var Wk,$f=v(()=>{"use client";c();ht();Wk={export:"Export",pdf:{label:"Download PDF",desc:"Generates a printable version of the report page in PDF format."},xlsx:{label:"Download XLSX",desc:"Creates a downloadable spreadsheet of the report page data."}};});function Qk(e,t){let r=e.replace(/[:\\/?*[\]]/g,"");return r.trim().length===0&&(r=`Sheet${t+1}`),r.slice(0,31)}function Zk(e){let t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o)&255;return t}function Uf(e){return `data_export_${new Date().toISOString()}`}var Xk,Jk,Gf,Hf=v(()=>{c();Xk=e=>new Promise((t,r)=>{let o="xlsx";if(!e||e.length===0){r(new Error("No data provided"));return}try{let n=Ro.utils.book_new();e.forEach((l,u)=>{if(l.data&&l.data.length>0){let p=l.data[0],d=Ro.utils.json_to_sheet(p),m=Qk(l.fileName||`Sheet${u+1}`,u),b=1;for(;n.SheetNames.includes(m);){let f=` (${b})`;m=`${m.slice(0,31-f.length)}${f}`,b++;}Ro.utils.book_append_sheet(n,d,m);}});let a=Ro.write(n,{bookType:"xlsx",type:"binary"}),s=new Blob([Zk(a)],{type:"application/octet-stream"}),i=new TR;i.file(`${Uf(o)}.xlsx`,s),i.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:9}}).then(l=>{t(l);}).catch(r);}catch(n){r(n);}});Jk=async e=>{try{let t=await Xk(e);saveAs(t,`${Uf("xlsx")}.zip`);}catch(t){console.error("Error generating file:",t);}},Gf=Jk;});function Ue(){let e=useContext(Kf);if(e===void 0)throw new Error("usePrint must be used within a PrintContext");return e}function cC(e){return useMemo(()=>e.data.reduce((r,o)=>(o.blocks&&o.blocks.forEach(n=>{r[n]=o.id;}),r),{}),[e.data])}function uC({pathSegmentsKey:e="bespoke",sectionLoader:t,mode:r}){let{query:o}=useRouter(),n=zo(),a=Ze(),s=Xo(),i=Ig(o.print)??!1,l=r==="embed",{printReport:u,error:p,setError:d}=Jn();Yn();let m=jf.locale,b=At(m),f=useMemo(()=>n.data?.sort(Ye).filter(R=>R.settings?.hidden!==!0).reduce((R,x)=>(x.blocks&&x.blocks.length>0&&R.push(...x.blocks),R),[]),[n.data]),y=cC({data:n.data||[]}),{sectionsVariables:h,resetSectionVariables:w,setSectionVariables:L}=wc(n.data?.map(R=>R.id)||[]),k=Q(R=>R),A=Ie("options"),N={...Zi,...A.data_tab},z=useMemo(()=>f.reduce((R,x)=>{let O=k.records.entities.block[x],D=k.variables.status[x];return g.VIZ===O?.type&&D.allowed&&R.push({id:x,entity:O,variables:k.variables.variables[x],status:k.variables.status[x],inputVariablesFlat:O.inputs.reduce((I,P)=>({...I,...k.variables.variables[P]}),k.variables.attributes)}),R},[]),[f,k.records.entities.block,k.variables.attributes,k.variables.status,k.variables.variables]);function E(R){return R=R.replace(/<p>/g,""),R=R.replace(/<\/p>/g,""),R}let F=async(R,x,O)=>{let D=dataLoad.bind({});return new Promise((I,P)=>{D(x,null,null,(Y,j)=>{if(Y)P(Y);else try{R||(R={data:[]}),Array.isArray(R.data)||(R.data=[]);let H=O instanceof Function?O(j):j;R.data.unshift(H),R.rawData=j,I(R);}catch(H){P(H);}});})},C=async()=>{if(!s.XlsxVizActive)return;let R=[],x=[],O=0,D=1;for(let Y of z){let j=Y.entity,H=Oe(j),ee=Y.inputVariablesFlat,oe={variables:ee},ce=st({logic:H.logic},b,oe).logic,K={router:jf,section:{variables:h[y[j.id]],setVariables:L(h[y[j.id]]),resetVariables:w(h[y[j.id]])}},q=ir(ce,b,ee,m,j.id,{},K),G=q.config._downloadTitle||q.config.title||`${N.viz_source} ${O+1}`,$=q.config._downloadFileName||G;if(q.config._downloadEnabled!==!1){let M=q.config._downloadUrl||q.config.data;if(!M){console.error("API is undefined for block:",j.id);continue}let _=typeof M=="string"?[M]:M,te=q.dataFormat instanceof Function?q.dataFormat:!1,U=q.config._downloadDataFormat instanceof Function?q.config._downloadDataFormat:!1,Z=q.config._downloadSectionName,X=q.config._downloadSource;try{let ae=await F({ix:O,id:j.id,title:il(G),fileName:X?Z?`${D} ${E(Z)}`:`${D} ${$}`:Z?E(Z):$,data:_,loading:!1,type:g.VIZ},M,U||te);if(X){let le=Array.isArray(ae.rawData)?ae.rawData:[ae.rawData],qe=new Set;le.forEach((ue,je)=>{let $e=X(ue);qe.has($e.link)||(qe.add($e.link),x.push({Name:Z?`${D} ${E(Z)} - ${$}${le.length>1?` (${je+1})`:""}`:`${D} ${$}${le.length>1?` (${je+1})`:""}`,Source:`${$e.name} - ${$e.description} (${$e.link})`}),D++);});}R.push(ae),O++;}catch(ae){console.error(`Error loading data for block ${j.id}:`,ae);}}}let I=R,P={fileName:"Metadata",data:x.length>0?[x]:[]};return I.unshift(P),I};return jsxs(Kf.Provider,{value:{print:i,isEmbed:l},children:[jsxs(Container,{id:"bespoke-report",className:a.comparisonLoaded?"compare":"",p:0,pos:"relative",fluid:!0,children:[n.isSuccess&&n.data.sort(Ye).map(R=>jsx(Xm,{section:R,sectionLoader:t},R.id)),pC({pdf:s,print:i,printReport:u,downloadCSV:Gf,isPosition:Qn,handleLoadData:C})]}),p&&jsx(Affix,{position:{bottom:rem(80),right:rem(20)},children:jsx(Notification,{title:"Error",color:"red",onClose:()=>d(null),icon:jsx(IconX,{size:"1.1rem"}),children:p})})]})}function pC({pdf:e,print:t,printReport:r,downloadCSV:o,isPosition:n,handleLoadData:a}){return t||!n(e.position,"DEFAULT")?null:e.active||e.XlsxVizActive?jsx(zf,{onDownloadPDF:e.active?r:void 0,onDownloadCSV:e.XlsxVizActive?async()=>{let s=await a();s&&s.length>0?await o(s):console.error("No data loaded for CSV download");}:void 0}):null}var Kf,Yf,jt=v(()=>{c();he();zr();Qm();Wt();Xn();Ws();ea();ei();ye();br();hr();Se();Jo();Nf();ht();$f();Hf();Ji();Kf=createContext({print:!1,isEmbed:!1});Yf=uC;});c();c();Ut();jt();Ys();ht();Wt();Xn();co();function mC({pathSegmentsKey:e="bespoke",translations:t,bespokeStyles:r,buildTime:o,siteProps:n,profilePrefix:a="/defaultPath",loader:s=jsx(LoadingOverlay,{visible:!0}),sectionLoader:i=jsx(LoadingOverlay,{visible:!0}),mantineProviderProps:l={},mode:u}){return Kn(e)?jsx(Fragment,{children:s}):jsx(MantineProvider,{...l,theme:{other:{bespokeStyles:r}},inherit:!0,children:jsxs(Nc,{pathSegment:"bespoke",profilePrefix:a,siteProps:n,children:[jsx(xs,{translations:t,children:jsx(Os,{children:jsx(Xs,{children:jsx(tu,{pageSize:12,children:jsx(Yf,{sectionLoader:i||s,mode:u})})})})}),jsx("small",{className:"bespoke-timestamp",children:o})]})})}/*! Bundled license information:
62
+ Try to open the source and check the data directly.`,open_in_window:"Open {src} response in a new window",formatted_src:"Formatted {src}",formatted_group:"Formatted Data",raw_group:"Raw Data",rows_preview:"(First {nrows} rows as preview)",choose_format:"Choose format",processing_file:"Processing file...",download:"Download data as",preview:"Preview",copy:"Click to copy",copied:"Copied!"},MR=e=>{let t=[];return e&&e.data&&(e.data&&Array.isArray(e.data)?t=e.data:e.data&&e.data.data&&Array.isArray(e.data.data)?t=e.data.data:e.data&&e.data.data&&e.data.data.results&&Array.isArray(e.data.data.results)?t=e.data.data.results:e.data&&e.data.results&&Array.isArray(e.data.results)&&(t=e.data.results)),t};});function hm(e){let{section:t}=e,r=t.blocks||[],o=Q(U=>r.map(Z=>U.records.entities.block[Z]).filter(Z=>Z.type===g.VIZ&&U.variables.status[Z.id].allowed)),{variant_slug1:n,slug1:a}=Q(U=>U.variables.attributes),s=Rp(),[i,l]=useState(St.section),[u,p]=useState(Tt.png),[d,m]=useState(!1),[b,f]=useState(!1),[y,h]=useState([]),[w,L]=useState(o.length>0?o[0].id:null),k=i!==St.section,{print:A,downloadLoading:N,error:z}=xp(t.id,n,a,k?w:null),[E,F]=useState(!0),[C,R]=useState(!1),x=Ie("options"),O={...tE,...x.image_tab},{siteProps:D}=Ar(),I=D?.logoSrc&&typeof D.logoSrc=="string",P=t?.settings?.name||`section-${t.id}`,Y=`#${P}`,j=useMantineTheme(),H=()=>{let U=ce(w);return select(U).select("svg").size()===1},ee=()=>`${Xt(P)}`,oe=()=>{let U=document.getElementById(P);return select(U).select(".bespoke-section-content").node()},ce=U=>{let Z=oe();return select(Z).select(`#bespoke-visualization-${U}.bespoke-block-area`).node()},K=()=>new Promise(U=>{let Z;i===St.section?Z=oe():i===St.viz&&(Z=ce(w));let X=document.createElement("div");X.style.display="flex",X.style.justifyContent="space-between",X.classList.add("bespoke-Viz-source"),X.style.padding=j.spacing.xs,X.style.width="100%";let ae=document.createElement("div");if(ae.innerText=O.source.replace("{src}",`${window.location}${Y}`),ae.style.fontSize=j.fontSizes.xs,X.appendChild(ae),I){let le=document.createElement("img");le.src=D.logoSrc,le.style.height="30px",le.onload=()=>U(Z),le.onerror=()=>{le.remove(),U(Z);},X.appendChild(le),Z.appendChild(X);}else Z.appendChild(X),U(Z);}),q=U=>{if(E)return "transparent";let Z=select(U).style("background-color");return Z!=="rgba(0, 0, 0, 0)"&&Z!=="transparent"?Z:U===document.body?"white":q(U.parentNode)},G=async(U,Z)=>{let{toPng:X}=await import('html-to-image');X(U,{backgroundColor:Z.background,cacheBust:!0,filter:ae=>ae&&ae.classList?!Z.exclusionClasses.some(le=>ae.classList.contains(le)):!0}).then(ae=>{let le=document.createElement("a");le.download=`${Z.filename}.png`,le.href=ae,le.click(),eE(),m(!1);}).catch(ae=>{console.log(ae);});},$=(U,Z)=>{saveElement(U,{filename:Z.filename,type:"svg",callback:()=>m(!1)},{background:Z.background});},M=async()=>{m(!0);let U=await K(),Z={background:q(U),exclusionClasses:["export-hidden"],filename:ee()},X=u===Tt.png?G:$;try{if(U)X(U,Z);else throw new Error(O.wrong_node)}catch{m(!1);}},_=async()=>{let{toCanvas:U}=await import('html-to-image');Promise.all(o.map(Z=>{let X=ce(Z.id),ae=X.querySelector("g.d3plus-geomap-tileGroup");return ae.style.display="none",U(X).then(le=>(ae.style.display="block",le))})).then(Z=>{h(Z.map(X=>X.toDataURL())),R(!1);});};useEffect(()=>{i===St.viz&&o.length>0?(L(o[0].id),R(!0),_()):i===St.section&&h([]);},[i]),useEffect(()=>{w&&(H()?f(!0):(f(!1),p(Tt.png)));},[w]);useRouter();return jsxs(Stack,{className:"cms-section-options-image",children:[jsx(Space,{h:"xs"}),o.length>0?jsx(Input.Wrapper,{label:`${O.choose_area}:`,children:jsx(SegmentedControl,{fullWidth:!0,value:i,data:[{value:St.section,label:jsxs(Center,{children:[jsx(IconTemplate,{size:"1rem"}),jsx(Box,{ml:10,children:O.entire_section})]})},{value:St.viz,label:jsxs(Center,{children:[jsx(IconChartBar,{size:"1rem"}),jsx(Box,{ml:10,children:O.viz_only})]})}],onChange:U=>{l(U),U===St.section&&p(Tt.png);}})}):jsx(Text,{fw:"700",color:"gray.7",children:`${O.entire_section}:`}),i===St.viz&&o.length>0&&jsxs(Input.Wrapper,{label:`${O.choose_viz}:`,style:{minHeight:"161px",position:"relative"},children:[!C&&y.length>0&&jsx(ScrollArea,{style:{height:250},children:jsx(SimpleGrid,{cols:3,children:o.map((U,Z)=>jsx(Image,{alt:`Viz ${U.id}`,onClick:()=>{L(U.id);},style:{cursor:"pointer",border:w===U.id?"4px solid #228be6":"4px solid #eee"},radius:0,src:y[Z],withPlaceholder:!0},`viz-option-${U.id}`))})}),jsx(LoadingOverlay,{visible:C})]}),b&&i!==St.section&&jsx(Input.Wrapper,{label:`${O.choose_format}:`,children:jsxs(Button.Group,{children:[jsx(Button,{leftIcon:jsx(IconPolaroid,{size:16}),onClick:()=>p(Tt.png),variant:u===Tt.png?"filled":"default",fullWidth:!0,children:Tt.png}),jsx(Button,{leftIcon:jsx(IconCode,{size:16}),onClick:()=>p(Tt.svg),variant:u===Tt.svg?"filled":"default",fullWidth:!0,children:Tt.svg})]})}),jsx(Checkbox,{checked:E,label:`${O.transparent_bg}`,onChange:()=>F(!E),radius:"xl"}),jsx(Button,{leftIcon:jsx(IconDownload,{size:16}),loading:d||N,onClick:s&&u!==Tt.svg?()=>A(E):M,fullWidth:!0,children:jsx("span",{children:d||N?O.processing:O.download.replace("{imageFormat}",u)})})]})}var St,Tt,eE,tE,ym=v(()=>{c();ln();he();ht();Ut();ea();ye();St={viz:"viz",section:"section"},Tt={png:"PNG",svg:"SVG"},eE=()=>{let e=document.getElementsByClassName("bespoke-Viz-source");Array.from(e).forEach(t=>t.remove());},tE={wrong_node:"Wrong node in export",choose_area:"Choose image area",choose_viz:"Choose visualization",choose_format:"Choose format",transparent_bg:"Transparent background",processing:"Processing image...",download:"Download {imageFormat}",entire_section:"Entire section",viz_only:"Visualization only",source:"Source: {src}"};});function vm(e){let{title:t,url:r,disabled:o=!1}=e,n=o?IconCode:IconLink;return jsx(Input.Wrapper,{label:t,children:jsx(Input,{icon:jsx(n,{}),value:r,disabled:o,readOnly:!0,rightSection:jsx(CopyButton,{value:r,timeout:2e3,children:({copied:a,copy:s})=>jsx(Tooltip,{label:a?"Copied":"Copy",withArrow:!0,position:"right",children:jsx(ActionIcon,{variant:a?"filled":"subtle",onClick:s,disabled:o,children:a?jsx(IconClipboardCheck,{size:16}):jsx(IconClipboardCopy,{size:16})})})})})})}var Sm=v(()=>{c();});function xm(e){let{section:t}=e,[r,o]=useState(""),[n,a]=useState(""),[s,i]=useState(!0),l=Ie("options"),u={...AE,...l.share_tab};return useEffect(()=>{a(document.title);let{origin:p,pathname:d}=window.location,m=`${p}${d}`,b=s?t.settings?.name?.length?`#${Xt(t.settings.name)}`:`#section-${t.id}`:"";o(`${m}${b}`);},[s]),jsxs(Stack,{className:"cms-section-options-share",children:[jsx(Space,{h:"xs"}),jsx(vm,{title:`${u.title}: ${n}`,url:r}),jsx(Checkbox,{checked:s,label:u.include_section,onChange:()=>i(!s),radius:"xl"}),jsxs(Group,{position:"center",children:[jsx(FacebookShareButton,{url:r,quote:n,children:jsx(FacebookIcon,{size:32,round:!0})}),jsx(TwitterShareButton,{url:r,title:n,children:jsx(TwitterIcon,{size:32,round:!0})}),jsx(TelegramShareButton,{url:r,title:n,children:jsx(TelegramIcon,{size:32,round:!0})}),jsx(WhatsappShareButton,{url:r,title:n,separator:":: ",children:jsx(WhatsappIcon,{size:32,round:!0})}),jsx(LinkedinShareButton,{url:r,children:jsx(LinkedinIcon,{size:32,round:!0})}),jsx(RedditShareButton,{url:r,title:n,windowWidth:660,windowHeight:460,children:jsx(RedditIcon,{size:32,round:!0})}),jsx(EmailShareButton,{url:r,subject:n,children:jsx(EmailIcon,{size:32,round:!0})})]})]})}var AE,Rm=v(()=>{c();Sm();ht();ln();AE={title:"Title",include_section:"Include Section"};});function Cm(e){let{section:t,initialMode:r,onEnds:o,open:n,title:a}=e,s=la(t.settings),i=useMemo(()=>OE.filter(b=>s[b]),[s]),[l,u]=useState(r||i[0]||"data"),p=Ie("options");useEffect(()=>{r!==l&&u(r);},[r]);let d={...rl,...p},m=useMemo(()=>jsxs(Fragment,{children:[jsxs(Tabs.List,{children:[s.data&&jsx(Tabs.Tab,{value:"data",children:d.download_title}),s.image&&jsx(Tabs.Tab,{value:"image",children:d.image_title}),s.share&&jsx(Tabs.Tab,{value:"share",children:d.share_title})]}),s.data&&jsx(Tabs.Panel,{value:"data",children:jsx(dm,{section:t})}),s.image&&jsx(Tabs.Panel,{value:"image",children:jsx(hm,{section:t})}),s.share&&jsx(Tabs.Panel,{value:"share",children:jsx(xm,{section:t})})]}),[s,t,d]);return jsx("div",{className:"cms-section-options-modal",children:n&&jsx(Modal,{className:"bespoke-options-modal",opened:!0,onClose:()=>o(),size:"xl",title:a,children:jsx(Tabs,{onTabChange:u,value:l,keepMounted:!1,children:m})})})}var rl,OE,Pm=v(()=>{c();Ji();ym();Rm();ht();ca();rl={download_title:"Download Data",image_title:"Save Image",share_title:"Share Link"},OE=["data","image","share"];});function Im(e){let{sectionId:t,disabled:r=!1}=e,[o,n]=useState(!1),[a,s]=useState("data"),i=Mn(t),l=Ie("options"),u={...rl,...l},p=la(i.isSuccess?i.data.settings:{}),d=b=>{s(b),n(!0);},m=()=>{n(!1);};return jsxs("div",{className:"cms-section-options",children:[jsxs(Button.Group,{children:[p.data&&jsx(Button,{variant:"default",size:"xs",compact:!0,onClick:()=>d("data"),"aria-label":u.download_title,disabled:r,children:jsx(IconTable,{size:16})}),p.image&&jsx(Button,{variant:"default",size:"xs",compact:!0,onClick:()=>d("image"),"aria-label":u.image_title,disabled:r,children:jsx(IconCamera,{size:16})}),p.share&&jsx(Button,{variant:"default",size:"xs",compact:!0,onClick:()=>d("share"),"aria-label":u.share_title,disabled:r,children:jsx(IconShare,{size:16})})]}),i.isSuccess&&jsx(Cm,{section:i.data,initialMode:a,open:o,onEnds:m})]})}var Lm=v(()=>{c();Pm();he();ht();ca();});function DE({children:e,containerProps:t},r){return jsx(Flex,{ref:r,className:"bespoke-section-content",pos:"relative",align:"stretch",p:0,direction:{base:"column",md:"row"},wrap:"wrap",...t,children:e})}var ga,Bm,Nm=v(()=>{c();he();Qs();ga=Kt__default.forwardRef(function({children:t,column:r,basis:o,columnSettings:n={},sx:a={},...s},i){let l=Object.values(r).some(m=>m.settings?.display==="inline"),u=n?.width?`${n.width}px`:o,p=n?.width?`${n?.width}px`:"100%",d=n?.full?"100%":p;return jsx(Flex,{ref:i,className:"bespoke-section-col",align:"flex-start",direction:l?"row":"column",wrap:l?"wrap":"nowrap",maw:{base:"100%",md:d},miw:{base:"none",md:300},p:0,pos:"relative",sx:[{flexGrow:1,flexShrink:n?.full?0:1,flexBasis:n?.full?"100%":u},...packSx(a)],...s,children:t})}),Bm=Kt__default.forwardRef(DE);});var Fm=v(()=>{c();});var pn,Dm=v(()=>{c();ze();he();Fm();ye();pn={px:e=>Number.isNaN(parseFloat(e))?"px":`${e}px`.replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),"%":e=>Number.isNaN(parseFloat(e))?"%":`${e}%`.replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")},{px:{defaultValue:400,min:25,step:5,formatter:pn.px},"%":{defaultValue:50,min:20,max:100,step:5,formatter:pn["%"]}};});var ol,Vm=v(()=>{c();ol={backgroundColor:"#fafafa",block:{padding:10},column:{padding:12},section:{backgroundColor:"white",borderRadius:10,boxShadow:"0px 6px 10px rgba(12, 32, 50, 0.14), 0px 1px 15px rgba(12, 32, 50, 0.12), 0px 3px 5px rgba(12, 32, 50, 0.15)",margin:8,padding:32}};});function al({previews:e,translations:t}){let{print:r}=Ue(),o=useMemo(()=>e.map(({image:n,name:a},s)=>(n?.author||n?.url)&&jsxs(Stack,{spacing:0,children:[n.author&&jsxs(Text,{size:"xs",children:[a," ",t.image_by," ",jsx("strong",{children:n.author})]}),n.url&&jsxs(Text,{size:"xs",children:["URL: "," ",jsx(Anchor,{href:n.url,target:"_blank",children:n.url})]}),s+1<e.length&&jsx(Divider,{})]},n.id)),[e]);return jsx(Fragment,{children:r?jsx(Fragment,{children:o}):jsxs(Popover,{position:"right",children:[jsx(Popover.Target,{children:jsx(ActionIcon,{variant:"light",radius:"xl",children:jsx(IconPhoto,{size:20})})}),jsx(Popover.Dropdown,{children:o})]})})}var Um=v(()=>{c();jt();});function Gm(){let{locales:e}=useRouter(),t=location&&location.pathname.split("/").filter(r=>r.length>0)[0];return e?.includes(t)}var Hm=v(()=>{c();});function JE({name:e,children:t,id:r,sectionSettings:o,sectionStyles:n,previews:a,translations:s}){let{print:i}=Ue(),l=o.memberImageBg&&a.some(({image:p})=>p&&(p.url||p.author)),u=useMemo(()=>o.showAnchor&&o.optionsMenu?"apart":!o.showAnchor&&o.optionsMenu?"right":o.showAnchor&&!o.optionsMenu?"left":"right",[o.showAnchor,o.optionsMenu]);return jsxs(XE,{className:`bespoke-Section-${r} bespoke-Section-root `,settings:o,styles:n?.root||void 0,print:i,children:[o.memberImageBg&&jsx(om,{previews:a}),jsxs(QE,{className:`bespoke-Section-${r} bespoke-Section-container `,settings:o,styles:n?.container,id:e?.length?Xt(e):`section-${r}`,pos:"relative",children:[!i&&jsxs(Group,{position:u,mb:"xs",children:[o.showAnchor&&jsxs(Anchor,{className:"cms-section-anchor",href:`#${o.name?Xt(o.name):"section-"+r}`,sx:{"&:hover .cms-section-name":{visibility:"visible",opacity:1}},children:[jsx(Text,{span:!0,size:"small",children:"#"}),jsx(Text,{span:!0,size:"small",className:"cms-section-name",sx:{visibility:"hidden",opacity:0,transition:"visibility 0s, opacity 0.2s ease-in-out"},children:o.name||"section-"+r})]}),o.optionsMenu&&jsx(Im,{sectionId:r,disabled:!1})]}),jsxs(ZE,{print:i,className:`bespoke-Section-${r} bespoke-Section-container`,settings:o,styles:n?.content,children:[t,l&&jsx(al,{previews:a,translations:s})]})]})]})}function tk({section:e,sectionLoader:t}){let{isEmbed:r}=Ue(),{id:o,settings:n}=e,a={...rm,...n},s=Ze(),i=Q(E=>E),l=Q(E=>E.variables.status),{previews:u,isRunConsumersRunning:p}=Q(E=>E.status),d=s.active&&s.status?u.concat(s.status?.previews||[]):u,m=ot().Section,b=wt(i),f=Object.values(b||{}).filter(E=>E.section_id===o),y=Ie("sections"),h={...YE,...y},w=f.some(E=>{try{return l[E.id].allowed&&![g.GENERATOR,g.SECTION_FLAG].includes(E.type)||E.type===g.NAV}catch{return E.settings.allowed==="always"}}),L=f.filter(E=>![g.GENERATOR,g.SECTION_FLAG].includes(E.type)).reduce((E,F)=>(E[F.blockcol]?E[F.blockcol][F.blockrow]=F:E[F.blockcol]={[F.blockrow]:F},E),{}),k=Object.keys(f).length>0&&!n.hidden&&w,A=Object.keys(L).length;if(!k||s.active&&n.comparisonHide)return null;let N=(E,F=!1)=>{let C=Array.from(new Set(E.map(x=>x.blockcol))).map(x=>({blockcol:x})).sort((x,O)=>Ye(x,O,"blockcol")),R=[];return C.forEach(({blockcol:x})=>{let O=E.filter(D=>D.blockcol===x).sort((D,I)=>Ye(D,I,"blockrow")).map(D=>{if(!D.id||!l[D.id]?.allowed&&D.type!==g.NAV)return null;let{settings:I,type:P}=b[D.id],Y=I.width&&!I.width.stretch&&I.width.unit?pn[I.width.unit](I.width.value):I.display==="inline"?"auto":"100%",j={alignSelf:P===g.VIZ?"stretch":"flex-start",flexGrow:0,margin:"0",width:Y,minWidth:300};return jsx(Box,{className:"bespoke-Block-wrapper",id:`bespoke-Block-${D.id}`,sx:j,py:ol.block.padding,children:jsx(ia,{blockId:D.id,asComparison:F},D.id)},D.id)});R.push(O);}),R.flat()},z=[];if(s.active&&!n.comparisonMerge){let E=f.filter(F=>![g.GENERATOR,g.SECTION_FLAG].includes(F.type)).reduce((F,C)=>({...F,[C.id]:C}),{});z=[jsx(ga,{column:E,basis:"50%",children:N(Object.values(f.filter(F=>![g.GENERATOR,g.SECTION_FLAG].includes(F.type))))},"original"),jsx(ga,{column:E,basis:"50%",children:N(Object.values(f.filter(F=>![g.GENERATOR,g.SECTION_FLAG].includes(F.type))),!0)},"comparison")];}else z=Object.keys(L).sort((E,F)=>-wa(E,F)).map(E=>{let F=L[E],C=n.columnSettings?n.columnSettings[E]:{},R=Object.values(F).sort((x,O)=>Ye(x,O,"blockrow"));return R.some(x=>!l[x.id]||l[x.id].allowed||x.type===g.NAV)?jsx(ga,{column:F,columnSettings:C,basis:`calc(${100/A}% - (10px * ${A}))`,children:R.map(x=>{if(!x.id||!l[x.id]?.allowed&&x.type!==g.NAV)return null;let{settings:O,type:D}=b[x.id],I=O.width&&!O.width.stretch&&O.width.unit?pn[O.width.unit](O.width.value):O.display==="inline"?"auto":"100%",P={alignSelf:D===g.VIZ?"stretch":"flex-start",flexGrow:0,margin:"0",width:I,minWidth:300};return jsx(Box,{className:`bespoke-Block-wrapper bespoke-${x.type}-wrapper`,id:`bespoke-Block-${x.id}`,sx:P,py:ol.block.padding,children:jsx(ia,{blockId:x.id},x.id)},x.id)})},E):null});return jsxs(JE,{id:o,name:e?.settings?.name,previews:d,sectionSettings:a,sectionStyles:m,translations:h,children:[p.includes(o)&&t,jsx(Bm,{containerProps:{gap:a.columnGutter||"md",wrap:s.active?"nowrap":"wrap",sx:{zIndex:20}},children:z}),r&&jsx(ek,{})]})}var YE,sl,XE,QE,ZE,ek,Xm,Qm=v(()=>{c();he();or();em();ca();zr();nm();Lm();Or();ye();Nm();Dm();Vm();jt();ht();Um();Wt();ln();Ut();Hm();YE={image_by:"image by"},sl=(e,t)=>r=>e?e(r,t):{},XE=({settings:e,styles:t,print:r,children:o,...n})=>{let{position:a,shouldBreak:s}=e,i={normal:{position:"relative",backgroundColor:r?"transparent":"initial",borderRadius:0},sticky:{position:"sticky",zIndex:2,top:0,borderRadius:0,borderTop:r?"none":"initial",borderLeft:r?"none":"initial",borderRight:r?"none":"initial"}},l={normal:{radius:0},sticky:{radius:0,withBorder:!0}},u=[i[a],sl(t,e),s?{pageBreakBefore:"always"}:{}];return jsx(Paper,{component:"section",sx:u,...l[a],...n,children:o})},QE=({settings:e,styles:t,children:r,...o})=>{let{width:n}=e,a={center:{zIndex:1},full:{zIndex:1}},s={center:{size:"lg",p:"sm",fluid:!1},full:{fluid:!0,p:"md"}},i=[a[n],sl(t,e)];return jsx(Container,{sx:i,...s[n],...o,children:r})},ZE=({settings:e,styles:t,print:r,children:o,...n})=>{let{style:a}=e,s={none:{},card:{boxShadow:r?"none":"initial"}},i={none:{bg:"transparent"},card:{shadow:r?"none":"lg",p:"md",radius:"md"}},l=[s[a],sl(t,e)];return jsx(Paper,{sx:l,...i[a],...n,"data-screenshot-target":"true",children:o})};ek=()=>{let e=useRouter(),{query:t,locale:r}=e,{siteProps:o={logoSrc:""},profilePrefix:n,pathSegment:a}=Ar(),s=t[a],i=Array.isArray(s)?s.join("/"):[],u=Gm()?`/${r}`:"";u+=`${n}/${i}/`;let p=new URL(u,window.location.href).href;return jsxs(Group,{position:"apart",noWrap:!0,sx:{flexGrow:1},children:[jsx(Anchor,{href:p,target:"_blank",children:p}),jsx("img",{src:o.logoSrc,height:40,width:"auto",alt:"Site Logo"})]})};Xm=tk;});var Zm=v(()=>{c();se();W({name:"abbreviate",description:"Abbreviates a number into a smaller more human-readable number.",logicFactory(e){return t=>e.d3plus.formatAbbreviate(t)},inputType:"number",testValue:"123456",type:"formatter"});});var Jm=v(()=>{c();se();W({name:"abs",description:"Simple Absolute Value.",logicFactory(e){return t=>Math.abs(t)},inputType:"number",testValue:"-123",type:"formatter"});});var nk,ef=v(()=>{c();se();nk=()=>function(t){let o=new RegExp(/([\$0-9\,]+)[A-z\-\s\&]*([\$0-9\,]*)/g).exec(t);return o?(o=o.slice(1).filter(n=>n.length).map(n=>(n.includes(",")&&(n.indexOf(",")===n.length-4?n=n.replace(/,000$/g,"k").replace(/([0-9]+)(,999$)/g,a=>`${parseInt(a)+1}k`):n.indexOf(",")===n.length-8&&(n=n.replace(/,000,000$/g,"M").replace(/([0-9]+)(,999,999$)/g,a=>`${parseInt(a)+1}M`))),n)),o.length===2?o.join(" - "):t.toLowerCase().match(/under|less|\</g)?`< ${o[0]}`:t.toLowerCase().match(/over|more|\+|\>/g)?`${o[0]}+`:`${o[0]}`):"None"},W({name:"bucket",description:"Sanitizes bucket strings to '< n', 'n1 - n2', and 'n+'",logicFactory:nk,inputType:"number",testValue:"1234",type:"formatter"});});var tf=v(()=>{c();se();W({name:"commas",description:"* Rounds to nearest whole number and adds commas.",logicFactory(e){return t=>e.d3.format(",")(Math.round(t))},inputType:"number",testValue:"1234.6",type:"formatter"});});var rf=v(()=>{c();se();W({name:"date",description:"Formats a date into '%B %d, %Y' format.",logicFactory(e){return t=>(typeof t=="string"&&(t=e.d3plus.date(t)),e.d3.timeFormat("%B %d, %Y")(t))},inputType:"date",testValue:"2022-01-01",type:"formatter"});});var of=v(()=>{c();se();W({name:"dollar",description:"Adds a US dollar sign to the beginning of a String or Number.",logicFactory(e){return t=>(typeof t=="number"&&(t=e.d3plus.formatAbbreviate(t)),t.charAt(0)==="-"?t.replace("-","-$"):`$${t}`)},inputType:"number",testValue:"123",type:"formatter"});});var nf=v(()=>{c();se();W({name:"formatFieldName",description:"Based on field name returns a string",logicFactory(e){return t=>{if(t.contentType.toLowerCase()==="stat"){if(t.field==="title")return "Stat label";if(t.field==="value")return "Stat value";if(t.field==="subtitle")return "Stat subtitle";if(t.field==="tooltip")return "Tooltip text"}return t.contentType.toLowerCase()==="section"&&t.field==="short"?"Short title":t.contentType.toLowerCase()==="description"&&t.field==="description"?"Paragraph":t.field}},inputType:"object",testValue:'{"field":"title","contentType":"stat"}',type:"formatter"});});var af=v(()=>{c();se();W({name:"grewTo",description:"Returns the text with grow direction: 'declined from', 'grew to' o 'stayed at'",logicFactory(e){return t=>t<0?"declined from":t>0?"grew to":"stayed at"},inputType:"number",testValue:"-1234",type:"formatter"});});var sf=v(()=>{c();se();W({name:"grewWord",description:"Returns either 'grew', 'declined', or 'stayed' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"declined":t>0?"grew":"stayed"},inputType:"number",testValue:"-1234",type:"formatter"});});var lf=v(()=>{c();se();W({name:"growing",description:"Returns either 'declining', 'growing' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"declining":"growing"},inputType:"number",testValue:"-1234",type:"formatter"});});var mk,cf=v(()=>{c();se();mk=()=>function(t){let{curr:r,currMoe:o=0,prev:n,prevMoe:a=0}=t,s;if(o||a){let i=(-n/r**2)**2*o**2,l=(1/r)**2*a**2;s=Math.sqrt(i+l);}else s=(r-n)/n;return s*100},W({name:"growth",description:"Calculates the growth percentage between two numbers provided the following object format: {curr, prev}. Also supports calculating the growth between two margin of errors using this format: {curr, currMoe, prev, prevMoe}",logicFactory:mk,inputType:"object",testValue:'{"curr":10,"currMoe":0,"prev":13,"prevMoe":0}',type:"formatter"});});var uf=v(()=>{c();se();W({name:"growthPct",description:"Abbreviates a growth value, turns it absolute, and adds a percent sign.",logicFactory(e){return t=>`${e.d3plus.formatAbbreviate(Math.abs(t))}%`},inputType:"number",testValue:"12345",type:"formatter"});});var pf=v(()=>{c();se();W({name:"growthWord",description:"Returns either 'growth' or 'decline' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"decline":"growth"},inputType:"number",testValue:"-1234",type:"formatter"});});var df=v(()=>{c();se();W({name:"highWord",description:"Returns either 'higher than', 'lower than', or 'approximately the same as' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"lower than":t>0?"higher than":"approximately the same as"},inputType:"number",testValue:"0",type:"formatter"});});var mf=v(()=>{c();se();W({name:"increaseWord",description:"Returns either 'increase', 'decrease', or 'change' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"decrease":t>0?"increase":"change"},inputType:"number",testValue:"1234",type:"formatter"});});var ff=v(()=>{c();se();W({name:"increasedWord",description:"Returns either 'increased', 'decreased', or 'remained the same' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"decreased":t>0?"increased":"remained the same"},inputType:"number",testValue:"0",type:"formatter"});});var gf=v(()=>{c();se();W({name:"increasing",description:"Returns either 'decreasing', 'increasing' or 'maintaining' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"decreasing":t>0?"increasing":"maintaining"},inputType:"number",testValue:"-1234",type:"formatter"});});var hf=v(()=>{c();se();W({name:"largerThan",description:"Returns either 'higher than', 'lower than', or 'approximately the same as' depending on the provided number's sign",logicFactory(e){return t=>t<0?"smaller than":t>0?"larger than":"the same as"},inputType:"number",testValue:"-1234",type:"formatter"});});var yf=v(()=>{c();se();W({name:"list",description:"Joins an array of strings together, adding commas and 'and' when necessary.",logicFactory(e){return t=>t.reduce((r,o,n)=>(n?n===t.length-1&&n===1?r+=` and ${o}`:n===t.length-1?r+=`, and ${o}`:r+=`, ${o}`:r+=o,r),"")},inputType:"object",testValue:'["foo","bar","bee"]',type:"formatter"});});var bf=v(()=>{c();se();W({name:"longWord",description:"",logicFactory(e){return t=>t<0?"shorter":t>0?"longer":"similar"},inputType:"number",testValue:"5",type:"formatter"});});var vf=v(()=>{c();se();W({name:"lowerCaseFirst",description:"Converts the first letter of a string to lowercase",logicFactory(e){return t=>typeof t=="string"?t.charAt(0).toLowerCase()+t.slice(1):t},inputType:"string",testValue:"foo",type:"formatter"});});var Sf=v(()=>{c();se();W({name:"moreFewerWord",description:"",logicFactory(e){return t=>t<0?"fewer":"more"},inputType:"number",testValue:"-5",type:"formatter"});});var Tf=v(()=>{c();se();W({name:"moreLess",description:"Returns either 'more' or 'less' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"less":"more"},inputType:"number",testValue:"-5",type:"formatter"});});var xf=v(()=>{c();se();W({name:"moreLess",description:"Returns either 'more than', 'less than', or 'approximately the same' depending on the provided number's sign.",logicFactory(e){return t=>t<0?"less than":t>0?"more than":"approximately the same"},inputType:"number",testValue:"-5",type:"formatter"});});var Rf=v(()=>{c();se();W({name:"olderWord",description:"",logicFactory(e){return t=>t<0?"getting younger":t>0?"getting older":"staying the same age"},inputType:"number",testValue:"-5",type:"formatter"});});var Ef=v(()=>{c();se();W({name:"olderYounger",description:"",logicFactory(e){return t=>t<0?"younger than":t>0?"older than":"the same age as"},inputType:"number",testValue:"-5",type:"formatter"});});var kf=v(()=>{c();se();W({name:"plural",description:"Pluralizes a word.",logicFactory(e){return t=>t.replace(/\w$/g,r=>r==="y"?"ies":`${r}s`)},inputType:"string",testValue:"Foo",type:"formatter"});});var Cf=v(()=>{c();se();W({name:"pxToInt",description:"Takes a pixel value and converts it to an integer",logicFactory(e){return t=>parseInt(t.replace(/\D+/g,""),10)},inputType:"string",testValue:"12px",type:"formatter"});});var Pf=v(()=>{c();se();W({name:"salary",description:"Displays salary values with proper precision (ie. '$74,200' instead of '$74.2k')",logicFactory(e){return t=>{let r;return t<1e6?r=e.d3.format(",")(t.toFixed(0)):r=e.d3plus.formatAbbreviate(t),`$${r}`}},inputType:"number",testValue:"1000000",type:"formatter"});});var Af=v(()=>{c();se();W({name:"stripEntities",description:"Removes non breaking spaces & other html entities from a string",logicFactory(e){return t=>typeof t=="string"?String(t).replace(/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-f]{1,6});/ig," "):t},inputType:"string",testValue:"<b>MyText</b>",type:"formatter"});});var il,wf=v(()=>{c();se();il=W({name:"stripHTML",description:"Converts html tags to spaces, then removes redundant spaces",logicFactory(e){return t=>{let r={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'","&#x60;":"`","&nbsp;":""},o=`(?:${Object.keys(r).join("|")})`,n=RegExp(o),a=RegExp(o,"g"),s=String(t).replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();return n.test(s)?s.replace(a,i=>r[i]):s}},inputType:"string",testValue:"<b>My text</b>",type:"formatter"});});var If=v(()=>{c();se();W({name:"stripOL",description:"Removes ordered list wrapper tags from a string.",logicFactory(e){return t=>t.replace(/<ol>/g,"").replace(/<\/ol>/g,"")},inputType:"string",testValue:"<ol><li>My list</li></ol>",type:"formatter"});});var Lf=v(()=>{c();se();W({name:"stripP",description:"Removes all paragraph tags from a string.",logicFactory(e){return t=>t.replace(/<p>/g,"").replace(/<\/p>/g,"")},inputType:"string",testValue:"<p>My p</p>",type:"formatter"});});var Of=v(()=>{c();se();W({name:"stripUL",description:"Removes unordered list wrapper tags from a string.",logicFactory(e){return t=>t.replace(/<ul>/g,"").replace(/<\/ul>/g,"")},inputType:"string",testValue:"<ul><li>My list</li></ul>",type:"formatter"});});var _f=v(()=>{c();se();W({name:"toKebabCase",description:"Takes a camelCase or PascalCase string and converts it to kebab-case.",logicFactory(e){return t=>typeof t=="string"?(t=t.charAt(0).toLowerCase()+t.substring(1),t.replace(/([A-Z])/g,"-$1").toLowerCase()):"invalid string passed to toKebabCase()"},inputType:"string",testValue:"camelCaseText",type:"formatter"});});var Bf=v(()=>{c();se();W({name:"toSpacedCase",description:"Takes a camelCase or PascalCase string and adds spaces (I know Spaced Case isn't a thing, deal with it).",logicFactory(e){return t=>typeof t=="string"?t.replace(/([A-Z])/g," $1").toLowerCase().trim():"invalid string passed to toSpacedCase()"},inputType:"string",testValue:"camelCaseText",type:"formatter"});});var Mf=v(()=>{c();se();W({name:"upperCaseFirst",description:"Converts the first letter of a string to uppercase",logicFactory(e){return t=>t.charAt(0).toUpperCase()+t.slice(1)},inputType:"string",testValue:"my name",type:"formatter"});});var Nf=v(()=>{c();Zm();Jm();ef();tf();rf();of();nf();af();sf();lf();cf();uf();pf();df();mf();ff();gf();hf();yf();bf();vf();Sf();Tf();xf();Rf();Ef();kf();Cf();Pf();Af();wf();If();Lf();Of();_f();Bf();Mf();});function zf({onDownloadPDF:e,onDownloadCSV:t}){let[r,o]=useState(!1),[n,a]=useState(!1),[s,i]=useState(!1),l=useMediaQuery("(max-width: 768px)"),u=Ie("export"),p={...Wk,...u},d=async()=>{if(e){o(!0);try{await e();}finally{o(!1),i(!1);}}},m=async()=>{if(t){a(!0);try{await t();}finally{a(!1),i(!1);}}},b=(h,w,L,k,A,N)=>jsx(Button,{id:N,size:"sm",onClick:h,disabled:w,fullWidth:!0,variant:"subtle",h:"auto",px:"xs",w:"100%",styles:z=>({inner:{width:"100%",display:"block"}}),children:jsxs(Group,{noWrap:!0,position:"left",spacing:"xs",w:"100%",children:[w?jsx(Loader,{size:"1.75rem"}):L,jsxs(Stack,{spacing:0,w:"100%",py:"0.5rem",className:"bespoke-report-download-btn-text-container",children:[jsx(Text,{w:"100%",size:"sm",lineClamp:1,className:"bespoke-report-download-btn-text-container-cta",children:k}),A&&jsx(Text,{size:"xs",w:"100%",lineClamp:2,maw:"100%",style:{wordWrap:"break-word",whiteSpace:"normal"},variant:"dimmed",lh:"0.9rem",h:"1.9rem",className:"bespoke-report-download-btn-text-desc",children:A})]})]})}),f=e&&b(d,r,jsx(IconFileTypePdf,{size:"1.75rem"}),p.pdf.label,p.pdf.desc,"bespoke-download-pdf-btn"),y=t&&b(m,n,jsx(IconFileTypeXls,{size:"1.75rem"}),p.xlsx.label,p.xlsx.desc,"bespoke-download-xlsx-btn");return e||t?jsx(Affix,{position:{bottom:l?rem(0):rem(20),right:l?rem(0):rem(20)},id:"bespoke-report-download-affix",style:{width:l?"100%":"auto",boxShadow:l?"0px -2px 6px rgba(0, 0, 0, 0.1)":"0px 2px 6px rgba(0, 0, 0, 0.1)",borderRadius:"0.25rem",background:"white"},p:"xs",children:jsxs(Popover,{opened:s,onChange:i,position:"top",shadow:"md",width:l?"100%":250,id:"bespoke-report-download-popover",children:[jsx(Popover.Target,{children:jsx(Button,{id:"bespoke-report-download-btn",size:"sm",onClick:()=>i(h=>!h),leftIcon:jsx(IconDownload,{size:"1.2rem"}),variant:"subtle",loading:r||n,fullWidth:l,children:p.export})}),jsx(Popover.Dropdown,{p:"0.5rem",children:jsxs(Stack,{spacing:"xs",children:[f,y]})})]})}):null}var Wk,$f=v(()=>{"use client";c();ht();Wk={export:"Export",pdf:{label:"Download PDF",desc:"Generates a printable version of the report page in PDF format."},xlsx:{label:"Download XLSX",desc:"Creates a downloadable spreadsheet of the report page data."}};});function Qk(e,t){let r=e.replace(/[:\\/?*[\]]/g,"");return r.trim().length===0&&(r=`Sheet${t+1}`),r.slice(0,31)}function Zk(e){let t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o)&255;return t}function Uf(e){return `data_export_${new Date().toISOString()}`}var Xk,Jk,Gf,Hf=v(()=>{c();Xk=e=>new Promise((t,r)=>{let o="xlsx";if(!e||e.length===0){r(new Error("No data provided"));return}try{let n=Ro.utils.book_new();e.forEach((l,u)=>{if(l.data&&l.data.length>0){let p=l.data[0],d=Ro.utils.json_to_sheet(p),m=Qk(l.fileName||`Sheet${u+1}`,u),b=1;for(;n.SheetNames.includes(m);){let f=` (${b})`;m=`${m.slice(0,31-f.length)}${f}`,b++;}Ro.utils.book_append_sheet(n,d,m);}});let a=Ro.write(n,{bookType:"xlsx",type:"binary"}),s=new Blob([Zk(a)],{type:"application/octet-stream"}),i=new TR;i.file(`${Uf(o)}.xlsx`,s),i.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:9}}).then(l=>{t(l);}).catch(r);}catch(n){r(n);}});Jk=async e=>{try{let t=await Xk(e);saveAs(t,`${Uf("xlsx")}.zip`);}catch(t){console.error("Error generating file:",t);}},Gf=Jk;});function Ue(){let e=useContext(Kf);if(e===void 0)throw new Error("usePrint must be used within a PrintContext");return e}function cC(e){return useMemo(()=>e.data.reduce((r,o)=>(o.blocks&&o.blocks.forEach(n=>{r[n]=o.id;}),r),{}),[e.data])}function uC({pathSegmentsKey:e="bespoke",sectionLoader:t,mode:r}){let{query:o}=useRouter(),n=zo(),a=Ze(),s=Xo(),i=Ig(o.print)??!1,l=r==="embed",{printReport:u,error:p,setError:d}=Jn();Yn();let m=jf.locale,b=At(m),f=useMemo(()=>n.data?.sort(Ye).filter(R=>R.settings?.hidden!==!0).reduce((R,x)=>(x.blocks&&x.blocks.length>0&&R.push(...x.blocks),R),[]),[n.data]),y=cC({data:n.data||[]}),{sectionsVariables:h,resetSectionVariables:w,setSectionVariables:L}=wc(n.data?.map(R=>R.id)||[]),k=Q(R=>R),A=Ie("options"),N={...Zi,...A.data_tab},z=useMemo(()=>f.reduce((R,x)=>{let O=k.records.entities.block[x],D=k.variables.status[x];return g.VIZ===O?.type&&D.allowed&&R.push({id:x,entity:O,variables:k.variables.variables[x],status:k.variables.status[x],inputVariablesFlat:O.inputs.reduce((I,P)=>({...I,...k.variables.variables[P]}),k.variables.attributes)}),R},[]),[f,k.records.entities.block,k.variables.attributes,k.variables.status,k.variables.variables]);function E(R){return R=R.replace(/<p>/g,""),R=R.replace(/<\/p>/g,""),R}let F=async(R,x,O)=>{let D=dataLoad.bind({});return new Promise((I,P)=>{D(x,null,null,(Y,j)=>{if(Y)P(Y);else try{R||(R={data:[]}),Array.isArray(R.data)||(R.data=[]);let H=O instanceof Function?O(j):j;R.data.unshift(H),R.rawData=j,I(R);}catch(H){P(H);}});})},C=async()=>{if(!s.XlsxVizActive)return;let R=[],x=[],O=0,D=1;for(let Y of z){let j=Y.entity,H=Oe(j),ee=Y.inputVariablesFlat,oe={variables:ee},ce=st({logic:H.logic},b,oe).logic,K={router:jf,section:{variables:h[y[j.id]],setVariables:L(h[y[j.id]]),resetVariables:w(h[y[j.id]])}},q=ir(ce,b,ee,m,j.id,{},K),G=q.config._downloadTitle||q.config.title||`${N.viz_source} ${O+1}`,$=q.config._downloadFileName||G;if(q.config._downloadEnabled!==!1){let M=q.config._downloadUrl||q.config.data;if(!M){console.error("API is undefined for block:",j.id);continue}let _=typeof M=="string"?[M]:M,te=q.dataFormat instanceof Function?q.dataFormat:!1,U=q.config._downloadDataFormat instanceof Function?q.config._downloadDataFormat:!1,Z=q.config._downloadSectionName,X=q.config._downloadSource;try{let ae=await F({ix:O,id:j.id,title:il(G),fileName:X?Z?`${D} ${E(Z)}`:`${D} ${$}`:Z?E(Z):$,data:_,loading:!1,type:g.VIZ},M,U||te);if(X){let le=Array.isArray(ae.rawData)?ae.rawData:[ae.rawData],qe=new Set;le.forEach((ue,je)=>{let $e=X(ue);qe.has($e.link)||(qe.add($e.link),x.push({"Sheet Number":D,Name:Z?`${E(Z)} - ${$}${le.length>1?` (${je+1})`:""}`:`${$}${le.length>1?` (${je+1})`:""}`,Source:`${$e.name} - ${$e.description} (${$e.link})`}),D++);});}R.push(ae),O++;}catch(ae){console.error(`Error loading data for block ${j.id}:`,ae);}}}let I=R,P={fileName:"Metadata",data:x.length>0?[x]:[]};return I.unshift(P),I};return jsxs(Kf.Provider,{value:{print:i,isEmbed:l},children:[jsxs(Container,{id:"bespoke-report",className:a.comparisonLoaded?"compare":"",p:0,pos:"relative",fluid:!0,children:[n.isSuccess&&n.data.sort(Ye).map(R=>jsx(Xm,{section:R,sectionLoader:t},R.id)),pC({pdf:s,print:i,printReport:u,downloadCSV:Gf,isPosition:Qn,handleLoadData:C})]}),p&&jsx(Affix,{position:{bottom:rem(80),right:rem(20)},children:jsx(Notification,{title:"Error",color:"red",onClose:()=>d(null),icon:jsx(IconX,{size:"1.1rem"}),children:p})})]})}function pC({pdf:e,print:t,printReport:r,downloadCSV:o,isPosition:n,handleLoadData:a}){return t||!n(e.position,"DEFAULT")?null:e.active||e.XlsxVizActive?jsx(zf,{onDownloadPDF:e.active?r:void 0,onDownloadCSV:e.XlsxVizActive?async()=>{let s=await a();s&&s.length>0?await o(s):console.error("No data loaded for CSV download");}:void 0}):null}var Kf,Yf,jt=v(()=>{c();he();zr();Qm();Wt();Xn();Ws();ea();ei();ye();br();hr();Se();Jo();Nf();ht();$f();Hf();Ji();Kf=createContext({print:!1,isEmbed:!1});Yf=uC;});c();c();Ut();jt();Ys();ht();Wt();Xn();co();function mC({pathSegmentsKey:e="bespoke",translations:t,bespokeStyles:r,buildTime:o,siteProps:n,profilePrefix:a="/defaultPath",loader:s=jsx(LoadingOverlay,{visible:!0}),sectionLoader:i=jsx(LoadingOverlay,{visible:!0}),mantineProviderProps:l={},mode:u}){return Kn(e)?jsx(Fragment,{children:s}):jsx(MantineProvider,{...l,theme:{other:{bespokeStyles:r}},inherit:!0,children:jsxs(Nc,{pathSegment:"bespoke",profilePrefix:a,siteProps:n,children:[jsx(xs,{translations:t,children:jsx(Os,{children:jsx(Xs,{children:jsx(tu,{pageSize:12,children:jsx(Yf,{sectionLoader:i||s,mode:u})})})})}),jsx("small",{className:"bespoke-timestamp",children:o})]})})}/*! Bundled license information:
63
63
 
64
64
  @tanstack/react-virtual/build/lib/_virtual/_rollupPluginBabelHelpers.mjs:
65
65
  (**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datawheel/bespoke",
3
- "version": "0.7.15-rc.23",
3
+ "version": "0.7.15-rc.24",
4
4
  "description": "Content management system for creating automated data reports",
5
5
  "exports": {
6
6
  ".": {