import{r as d,u as j,R as e,B as E,F as o,T as f,c as N,d as D,S as M,H as I,e as R,f as P,a as $,g as G,h as T,i as O}from"./index-DnDa_30t.js";import A from"./SubPage-CJmnd4-z.js";import{M as K,A as U}from"./Metadata-DYqxgzuX.js";import{L as q}from"./LinkBanner-CwQLG-sL.js";import{A as J,I as Q,C as V,N as X}from"./NewsContent-DdGssgwi.js";import{u as Y,a as F,R as Z,B as v,b as C,c as ee,C as te}from"./BlockContainer-CksxSEY6.js";import{C as re}from"./index-DK2CZzxQ.js";import{C as ne}from"./index-DDuyBhLr.js";import{L as le}from"./Loading-CnYNTdfZ.js";import"./BannerGroup-hJ_sTWow.js";import"./Navigation-C2mb1m81.js";import"./Helmet-tDWpWdZ8.js";import"./index.esm-8eeMStuO.js";import"./AdBanner-C9WbQJKV.js";function ae({lgCards:t,mdCards:n,smCards:r}){const[p,c]=Y({slideChanged(){var x,s,b;return a((b=(s=(x=c==null?void 0:c.current)==null?void 0:x.track)==null?void 0:s.details)==null?void 0:b.rel)}},[]),[l,a]=d.useState(0),[u,g]=F(),h=l!==0,i=l<(t==null?void 0:t.length)-1,y=l<(n==null?void 0:n.length)-1,k=l<(r==null?void 0:r.length)-1;d.useEffect(()=>{g()},[]),window.addEventListener("resize",g);const m=j();if(u==="lg")return e.createElement(E,{pt:"24px"},e.createElement(o,{align:"center",p:"25px",border:" solid 1px",borderColor:(t==null?void 0:t.length)>1?m.colors.Grey100:"transparent",pl:(t==null?void 0:t.length)>1?"25px":"initial",borderRadius:"20px",gap:"24px"},h&&e.createElement(W,{current:l,setCurrent:a,instanceRef:c}),e.createElement(E,{ref:p,className:"keen-slider"},t==null?void 0:t.map((x,s)=>e.createElement(o,{className:"keen-slider__slide",key:s,gap:"24px"},x.map((b,_)=>{var S;return e.createElement(o,{key:_,direction:"column",flex:1,pr:"28px",pl:_===0?"0":"28px",borderLeft:_===0?"none":`solid 2px ${m.colors.Grey100}`},e.createElement(f,{fontWeight:"600",letterSpacing:".03em",fontSize:"1.375rem",lineHeight:"1.875rem"},b.name),e.createElement(f,{fontWeight:"400",fontSize:"1rem",letterSpacing:".03em",lineHeight:"1.362rem",color:m.colors.Grey130},(S=b.designations)==null?void 0:S.join(", ")))})))),i&&e.createElement(z,{current:l,setCurrent:a,instanceRef:c})),(t==null?void 0:t.length)>1&&e.createElement(o,{justify:"center",py:"24px",gap:".5rem"},t==null?void 0:t.map((x,s)=>e.createElement(E,{key:s,borderRadius:"full",minW:"10px",minH:"10px",border:`${m.colors.Black} solid 2px`,bgColor:l===s?m.colors.White:m.colors.Black}))));if(u==="md")return e.createElement(E,{pt:"24px"},e.createElement(o,{align:"center",p:"25px",border:" solid 1px",borderColor:(n==null?void 0:n.length)>1?m.colors.Grey100:"transparent",pl:(n==null?void 0:n.length)>1?"25px":"initial",borderRadius:"20px",gap:"24px"},h&&e.createElement(W,{current:l,setCurrent:a,instanceRef:c}),e.createElement(E,{ref:p,className:"keen-slider"},n==null?void 0:n.map((x,s)=>e.createElement(o,{className:"keen-slider__slide",key:s,gap:"24px"},x.map((b,_)=>{var S;return e.createElement(o,{key:_,direction:"column",flex:1,pr:"28px",pl:_===0?"0":"28px",borderLeft:_===0?"none":`${m.colors.Grey70} solid 2px`},e.createElement(f,{fontWeight:"600",letterSpacing:".03em",fontSize:"1.125rem",lineHeight:"1.5rem"},b.name),e.createElement(f,{fontWeight:"400",fontSize:".875rem",letterSpacing:".03em",lineHeight:"1.25rem",color:m.colors.Grey100},(S=b.designations)==null?void 0:S.join(", ")))})))),y&&e.createElement(z,{current:l,setCurrent:a,instanceRef:c})),(n==null?void 0:n.length)>1&&e.createElement(o,{justify:"center",py:"24px",gap:".5rem"},n==null?void 0:n.map((x,s)=>e.createElement(E,{key:s,borderRadius:"full",minW:"10px",minH:"10px",border:`${m.colors.Black} solid 2px`,bgColor:l===s?m.colors.White:m.colors.Black}))));if(u==="sm")return e.createElement(E,{py:"12px"},e.createElement(o,{align:"center",p:"25px",pl:(r==null?void 0:r.length)>1?"25px":"initial",border:" solid 1px",borderColor:(r==null?void 0:r.length)>1?m.colors.Grey100:"transparent",borderRadius:"20px",gap:"24px"},h&&e.createElement(W,{current:l,setCurrent:a,instanceRef:c}),e.createElement(E,{ref:p,className:"keen-slider"},r==null?void 0:r.map((x,s)=>e.createElement(o,{className:"keen-slider__slide",key:s,direction:"column",flex:1},e.createElement(f,{fontWeight:"600",letterSpacing:".03em",fontSize:"1rem",lineHeight:"1.25rem"},x.name),e.createElement(f,{fontWeight:"400",letterSpacing:".03em",fontSize:".75rem",lineHeight:"1rem",color:m.colors.Grey100},x.certifications)))),k&&e.createElement(z,{current:l,setCurrent:a,instanceRef:c})),(r==null?void 0:r.length)>1&&e.createElement(o,{justify:"center",py:"24px",gap:".5rem"},r.map((x,s)=>e.createElement(E,{key:s,borderRadius:"full",minW:"10px",minH:"10px",border:`${m.colors.Black} solid 2px`,bgColor:l===s?m.colors.White:m.colors.Black}))))}const z=({instanceRef:t})=>e.createElement(N,{onClick:()=>{var n;return(n=t==null?void 0:t.current)==null?void 0:n.next()},bg:"inherit"},e.createElement(ne,null)),W=({instanceRef:t})=>e.createElement(N,{onClick:()=>{var n;return(n=t==null?void 0:t.current)==null?void 0:n.prev()},bg:"inherit"},e.createElement(re,null));function H(){return H=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var p in r)({}).hasOwnProperty.call(r,p)&&(t[p]=r[p])}return t},H.apply(null,arguments)}function ie(t){const{data:n}=t,r=d.memo(ae),p=n,c=p.reduce((a,u,g)=>{const i=Math.floor(g/3);return a[i]||(a[i]=[]),a[i].push(u),a},[]),l=p.reduce((a,u,g)=>{const i=Math.floor(g/4);return a[i]||(a[i]=[]),a[i].push(u),a},[]);return e.createElement(e.Fragment,null," ",e.createElement(r,H({},t,{lgCards:l,mdCards:c,smCards:n})))}function oe({coPub:t,ctaGroup:n}){var r,p,c;return e.createElement(o,{justify:"space-between",direction:{base:"column",md:"row"},gap:{base:"20px",md:"0"},py:{base:"22px",md:"50px"}},t&&t!=="<p><span></span></p>"&&e.createElement(o,{justify:"start"},e.createElement(Z,{data:t,px:"inital",w:"100%"})),(n.cta_button_1||n.cta_button_2||n.cta_button_3)&&e.createElement(o,{gap:{base:"11px",md:"13px"},direction:{base:"column",md:"row"},flexWrap:"wrap",justify:t?{base:"initial",md:"end"}:"initial"},(r=n.cta_button_1)==null?void 0:r.map((l,a)=>e.createElement(v,{refData:l,key:a,mx:{lg:"12px"}})),(p=n.cta_button_2)==null?void 0:p.map((l,a)=>e.createElement(v,{refData:l,key:a,mx:{lg:"12px"}})),(c=n.cta_button_3)==null?void 0:c.map((l,a)=>e.createElement(v,{refData:l,key:a,mx:{lg:"12px"}}))))}function ce(t){var k,m,x,s,b,_,S;const{ct:n}=t,[r,p]=d.useState(),[c]=ee(),[l,a]=d.useState(),[u,g]=d.useState(),h=window.location.pathname,i=j();d.useEffect(()=>{y()},[n]);async function y(){var L;const B=await D.getArticle(n,h,"en-us","article_details.author,related_resources.resource_entry");p(B[0]),a(()=>{var w;return c(new Date((w=B[0].article_details)==null?void 0:w.date).getTime(),"month_year")}),((L=B[0].article_details)==null?void 0:L.date_updated)!=null?g(()=>{var w;return c(new Date((w=B[0].article_details)==null?void 0:w.date_updated).getTime(),"month_year")}):g(null)}return e.createElement("main",{id:"main"},e.createElement(M,null),r?e.createElement(E,{h:"100%"},r.seo&&e.createElement(K,{data:r.seo,override:r}),e.createElement(U,null),e.createElement(q,{data:{title:"All Resources",href:"/resources"}}),e.createElement(E,{maxW:"1220px",mx:"auto",h:"100%"},e.createElement(J,{data:r,ct:n}),((k=r.article_details)==null?void 0:k.headline)&&e.createElement(o,{ml:{base:"35px",md:"50px",lg:"62px"},mr:{base:"35px",md:"50px",lg:"76px"},mb:{base:"12px",md:"28px",lg:"35px"},h:{base:"128px",md:"225px",lg:"347px"},bgImage:(x=(m=r.headline_banner)==null?void 0:m.image)==null?void 0:x.url,bgPos:"center",bgSize:"cover",bgRepeat:"no-repeat",borderRadius:"15px",textOverflow:"ellipsis"},e.createElement(o,{align:"center",justify:"center",borderRadius:"inherit",h:"100%",w:"100%",bgGradient:(s=r.headline_banner)==null?void 0:s.image_gradient},e.createElement(f,{as:"h1",fontFamily:"Lato",fontWeight:"800",fontSize:{base:"1.5rem",md:"2.5rem"},lineHeight:"3rem",textAlign:"center",color:(b=r.headline_banner)!=null&&b.white_text?i.colors.White:i.colors.Black},(_=r.article_details)==null?void 0:_.headline))),r.entry_summary&&e.createElement(f,{ml:{base:"35px",md:"50px",lg:"62px"},mr:{base:"35px",md:"50px",lg:"76px"},fontFamily:"Lato",fontSize:{base:".75rem",md:"1.563rem"},lineHeight:"1.875rem",letterSpacing:".015em",fontWeight:"800"},r.entry_summary),e.createElement(o,{gap:{base:"5%",lg:"6%"},h:"100%",ml:{base:"35px",md:"50px",lg:"62px"},mr:{base:"35px",md:"50px",lg:"76px"},direction:{base:"column-reverse",md:"row"},mt:!r.main_image&&{base:"12px",md:"28px",lg:"69px"}},e.createElement(o,{h:"100%",maxW:"100%",flex:1,direction:"column"},e.createElement(o,{borderBottom:`solid ${i.colors.Black} 1px`,pb:{base:"29px",md:"17px",lg:"24px"}},e.createElement(o,{flex:1},e.createElement(o,{direction:"column",gap:"11px",letterSpacing:".03%"},e.createElement(o,{gap:"1rem"},e.createElement(f,{fontSize:{base:".75rem",md:"1.563rem"},lineHeight:"2.125rem",fontWeight:"600"},"Published:"),e.createElement(f,{fontSize:{base:".75rem",md:"1.563rem"},lineHeight:"2.125rem",letterSpacing:".03%"},l)),e.createElement(o,{gap:"1rem"},u&&e.createElement(f,{fontSize:{base:".75rem",md:"1.563rem"},lineHeight:"2.125rem",fontWeight:"600"},"Last updated:"),e.createElement(f,{fontSize:{base:".75rem",md:"1.563rem"},lineHeight:"2.125rem"},u)))),e.createElement(o,{flex:1,justify:"end"},e.createElement(Q,null))),e.createElement(ie,{data:(S=r.article_details)==null?void 0:S.author}),(r.co_published_field||r.resource_entry_cta_buttons_)&&e.createElement(oe,{coPub:r.co_published_field,ctaGroup:r.resource_entry_cta_buttons_}),e.createElement(E,{id:"article",className:"Article-Body",mt:"29px"},e.createElement(C,{data:r.article_body,rtecontainerpx:"initial",px:"initial",contained:"true"})),r.cpe_eligible&&e.createElement(V,{data:r,ct:n}))),r.related_resources.length===3&&e.createElement(me,{array:r.related_resources}))):e.createElement(le,{minH:"100vh"}))}const me=({array:t,index:n})=>{const[r,p]=F();d.useEffect(()=>{p()},[]);let c=t.slice(0,2);return r==="lg"&&(c=t),window.addEventListener("resize",p),e.createElement(o,{key:n,direction:"column",ml:{base:"35px",md:"50px",lg:"62px"},mr:{base:"35px",md:"50px",lg:"76px"},my:{lg:"65px"},gap:{sm:"28px",md:"41px",lg:"48px"}},e.createElement(I,{fontWeight:"700",fontSize:{base:"1.5rem",md:"2.5rem"}},"Related Resources"),e.createElement(o,{gap:"4%",justify:"space-between",direction:{base:"column",md:"row"}},c==null?void 0:c.map(l=>{var a;return(a=l==null?void 0:l.resource_entry)==null?void 0:a.map((u,g)=>{var h,i;return e.createElement(te,{key:g,data:u,titleProp:(h=u.tags_group)==null?void 0:h.type,overrideAlt:l.override_image_alt,override:(i=l.override_image)==null?void 0:i.url,my:"8px"})})})))};function pe({contentType:t}){return t===R.newsArticle||t===R.newsBlurb?e.createElement(X,{contentType:t}):t===P?e.createElement(ce,{ct:t}):t?e.createElement(A,{ct:t}):null}function Be(){const t=$(),n=d.useMemo(()=>{const i=t.pathname.split("/");return i.length>2?(i.splice(i.length-1,1,":title"),i.join("/")):i},[t]),{isError:r,isLoading:p,data:c,failureReason:l,isSuccess:a}=G(n),u=d.useMemo(()=>a?c.map(i=>i.uid):[],[c]),g=T(u,t.pathname),h=d.useMemo(()=>{if(g.every(y=>y.isSuccess)){let y;return g.forEach((k,m)=>{var x;((x=k.data)==null?void 0:x.length)>0&&(y=u[m])}),y}return null},[g,u]);if(p||g.some(i=>i.isLoading))return e.createElement(O,null);if(r||g.some(i=>i.isError))throw new Error("Error loading ContentTypeFilter: ",(l==null?void 0:l.message)||"checkResources");return u.length===1?e.createElement(A,{ct:h}):e.createElement(pe,{contentType:h})}export{Be as default};