import{R as e,B as h,F as a,H as j,T as p,r as l,b as D,L as C,I as S,v as F,A as y,S as H}from"./index-DgY5Jiz8.js";import{A as P}from"./index-CINc0KOo.js";import{M as B}from"./index-C9ws7fpb.js";import{n as v,o as z,q as L,r as N,s as O,t as _,W as $,v as G,P as M,w as U,R as J,x as q,T as V,S as Y,k as Q,b as T,y as K}from"./index-BxDETT50.js";import{L as X,A as Z}from"./index-DSTLbREw.js";import"./Helmet-Cxamvgp4.js";import"./index.esm-CqgmUNlE.js";function ee(t){const{data:r}=t;return e.createElement(h,{as:a,flexDirection:"column",justifyContent:"center",alignContent:"center",backgroundColor:"#4D4D4D",h:"255px",wrap:"wrap"},e.createElement(h,{my:10,mx:{lg:60,md:20,base:5},as:a,flexDirection:"column",justifyContent:"center",alignContent:"center",textAlign:"center",maxW:"826px"},e.createElement(j,{as:"h1",fontWeight:"700",fontSize:{base:"25px",md:"32px",lg:"40px"},lineHeight:{base:"74px",md:"74px",lg:"74px"},color:"white"},r==null?void 0:r.headline),e.createElement(p,{fontWeight:"400",fontSize:{base:"16px",md:"20px",lg:"22px"},lineHeight:{base:"22px",md:"27px",lg:"30px"},color:"white"},r==null?void 0:r.sub_text)))}const A=t=>{if(isNaN(t))return;const r={Jan:"Jan.",Feb:"Feb.",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"Aug.",Sep:"Sept.",Oct:"Oct.",Nov:"Nov.",Dec:"Dec."},n=(()=>{const o=new Date(t*1e3);return o.getFullYear()>1e4?new Date(t):o})().toUTCString().split(" ");return n.length>3?`${n[1]-0} ${r[n[2]]} ${n[3]}`:n.join(" ")},te=({result:t})=>{var i;const[r,n]=l.useState(),o=D();return l.useEffect(()=>{t&&n(A(t.published_dtm))},[t]),t?e.createElement(a,{key:t.objectID,as:C,href:t.uri,border:`solid 1px ${o.colors.Grey3}`,p:"8px",justify:"space-between",borderRadius:"24px",w:{base:"100%",lg:"48.5%"},_hover:{textDecor:"none",boxShadow:"0px 24px 34px 0px rgba(0,0,0,0.07)"},role:"group",mb:"16px"},e.createElement(a,{direction:"column",gap:"8px",flex:1,m:"8px",justify:"center",textOverflow:"ellipsis"},e.createElement(a,{direction:"row",gap:"8px",flexWrap:"wrap"},t.category==="news_article"&&e.createElement(h,{color:"DarkGreen",borderColor:"DarkGreen",border:"solid 1px",w:"max-content",borderRadius:"20px",textAlign:"center",px:"16px"},e.createElement(p,{letterSpacing:".035em",fontWeight:"600",fontSize:".875rem",lineHeight:"1.188rem"},"IAPP ORIGINAL")),((i=t.tags)==null?void 0:i.includes("internal_class=analysis"))&&e.createElement(h,{color:`${o.colors.DarkBlue}`,borderColor:`${o.colors.DarkBlue}`,border:"solid 1px",w:"max-content",borderRadius:"20px",textAlign:"center",px:"12px"},e.createElement(p,{letterSpacing:"3.5%",fontWeight:"600",fontSize:"14px",lineHeight:"1.188rem",fontFamily:"Open Sans, semi-bold"},"ANALYSIS"))),e.createElement(p,{color:"#4D4D4D",fontWeight:"600",fontSize:".875rem",lineHeight:"1.188rem",letterSpacing:".08em"},r),e.createElement(a,{textOverflow:"ellipsis"},e.createElement(p,{fontWeight:"600",fontSize:"1rem",lineHeight:"1.688rem",_groupHover:{textDecor:"underline"},noOfLines:3},t.name))),e.createElement(a,{h:"auto",flex:1,maxWidth:{lg:"160px",md:"160px",sm:"130px",base:"160px"}},t.category==="news_article"&&e.createElement(S,{alt:t.name,src:t.imageUri,fallbackSrc:v,fit:"cover",borderRadius:"0 16px 16px 0"}),t.category==="news_blurb"&&e.createElement(S,{alt:t.name,src:t.imageUri,fallbackSrc:v,fit:"cover",borderRadius:"0 15px 15px 0"}))):null},ne=({result:t})=>{const{published_dtm:r}=t||{},n=l.useMemo(()=>A(r),[r]),{gated:o,type:i,original:c}=l.useMemo(()=>{const x=u=>(t.tags||[]).includes(u);return{gated:x("internal_class=member_gated"),type:x("internal_class=resource_article")?"Resource Article":void 0,original:x("internal_class=iapp_original")}},[t==null?void 0:t.tags]),s=D(),[d]=z(i);return t?e.createElement(a,{key:t.objectID,as:C,href:t.uri,border:`solid 1px ${s.colors.Grey4}`,p:"8px",justify:"space-between",borderRadius:"20px",w:{base:"100%",lg:"48.5%"},h:"174px",_hover:{textDecor:"none",boxShadow:"0px 24px 34px 0px rgba(0,0,0,0.07)"},role:"group",mb:{base:"20px",md:"16px",lg:"2%"},position:"relative"},o&&e.createElement(a,{position:"absolute",boxSize:"35px",justify:"center",align:"center",right:"8px",bgColor:"WhiteOpaque"},e.createElement(F,{faIcon:"fa-lock",color:"PrimaryGreen"})),e.createElement(a,{direction:"column",gap:"16px",flex:1,m:"8px",justify:"start"},e.createElement(a,{gap:".02em",flexWrap:"wrap",whiteSpace:"nowrap"},i&&e.createElement(a,{gap:"10px",mr:"10px",ml:"-16px",align:"center"},e.createElement(h,{w:"15px",h:"24px",bgColor:d}),e.createElement(p,{fontFamily:"Lato",fontWeight:"700",fontSize:".875rem",lineHeight:"1.05rem"},i)),c&&e.createElement(a,{whiteSpace:"nowrap",flex:1,maxW:"min-content",color:"DarkGreen",borderColor:"DarkGreen",border:"solid 1px",w:"max-content",borderRadius:"20px",textAlign:"center",px:"16px"},e.createElement(p,{letterSpacing:".035em",fontWeight:"600",fontSize:".875rem",lineHeight:"1.188rem"},"IAPP ORIGINAL"))),n&&e.createElement(p,{color:"#4D4D4D",fontWeight:"600",fontSize:".875rem",lineHeight:"1.188rem",letterSpacing:".08em"},n),e.createElement(p,{fontWeight:"600",fontSize:"1rem",lineHeight:"1.688rem",_groupHover:{textDecor:"underline"},noOfLines:n?2:3,textOverflow:"ellipsis"},t.name)),e.createElement(a,{h:"100%",flex:.75,maxW:"25%",borderRadius:"0 15px 15px 0"},t.category==="news_article"&&e.createElement(S,{src:t.imageUri,fallbackSrc:v,fit:"cover",borderRadius:"0 15px 15px 0"}))):null},re=()=>(l.useEffect(()=>{document.querySelectorAll(".rc-pagination-item").forEach(r=>{r.setAttribute("title","")})}),null),ae=({ct:t})=>e.createElement(a,{gap:{md:"2.5%"},w:"100%",className:"non-overview-container"},t==="news_overview"&&e.createElement(a,{maxW:{base:"100%",md:"29%",lg:"22.5%"},flex:{base:0,md:1}}),e.createElement(U,null)),oe=({ct:t,tags:r,setTags:n,filters:o})=>t=="news_overview"||!o?e.createElement(e.Fragment,null):e.createElement(a,{display:{base:"none",md:"flex"},w:"100%",className:"non-overview-container"},e.createElement(_,{type:"entity",ct:t,tags:r,setTags:n,filters:o})),ie=({cta:t,ct:r})=>r!=="news_overview"?e.createElement(e.Fragment,null):e.createElement(a,{border:t?"solid 1px #999999":"none",borderRadius:"20px",py:"27px",px:{base:"22px",lg:"38px"},maxW:{base:"100%",md:"29%",lg:"22.5%"},mt:"30px"},e.createElement(J,{fontSize:{base:".875rem",md:"1rem",lg:"1.125rem"},lineHeight:"1.563rem",letterSpacing:"-.02em",data:t,style:["card"],px:"initial"})),le=({ct:t,filters:r,setTags:n,tags:o,sortfilters:i,dates:c,setDates:s,sort:d,setSort:x,index:u})=>{const g=(r==null?void 0:r.filter(m=>m!=="sections"))??[];return e.createElement(a,{h:"auto",align:"center",flex:1,direction:{base:"column",md:"row"},className:"non-overview-container",width:"100%"},e.createElement(a,{flex:1,maxW:{md:"30%"},minW:{base:"100%",md:"initial"},align:"center",justify:"space-between",width:"100%",my:"25px"}," ",r&&e.createElement(_,{setTags:n,tags:o,type:"mobile",ct:t,filters:g,display:{base:"flex",md:"none"}}),(i==null?void 0:i.length)>0&&e.createElement(q,{index:u,sort:d,setSort:x,sortFilters:i})),r&&e.createElement(a,{gap:"29px",flex:2,direction:{base:"row-reverse",md:"row"},w:{base:"100%",md:"auto"},align:"center"},e.createElement(V,{dates:c,tags:o,setTags:n,setDates:s})))};function ce({cta:t,index:r,ct:n,filters:o,prefilter:i,sortfilters:c}){const[s,d]=l.useState([]),[x,u]=l.useState(),[g,m]=l.useState([]),[f,E]=l.useState(!0);l.useEffect(()=>{const b=setTimeout(()=>{E(!1)},500);return()=>clearTimeout(b)},[]);const w=(o==null?void 0:o.filter(b=>b!=="sections"))??[],W="https://search.iapp.org",R={debug:!1,alwaysSearchOnInitialLoad:!0,apiConnector:new L(W,r,{prefilter:i}),initialState:{resultsPerPage:16},searchQuery:{search_fields:{name:{weight:3}},filters:[]},result_fields:{name:{snippet:{size:100,fallback:!0}}}},k={ct:n,filters:o,setTags:d,tags:s,sortfilters:c,dates:g,setDates:m,sort:x,setSort:u,index:r};return e.createElement(N,{config:R},e.createElement(a,{direction:"column",pl:"42px",pr:"50px",className:["search-container",n].join(" ")},e.createElement(a,{direction:"column",mx:"auto",w:"100%",maxW:"1440px",gap:"30px"},e.createElement(a,{justifyContent:{base:"center",md:"space-between"},direction:{base:"column",md:"row"}},e.createElement(ie,{cta:t,ct:n}),e.createElement(a,{direction:"column",width:"100%"},e.createElement(ae,{ct:n}),e.createElement(oe,{ct:n,tags:s,setTags:d,filters:o}),e.createElement(a,{pl:{md:"2.5%"},direction:{base:"column",md:"row"},gap:"2.5%",w:"100%"},e.createElement(le,k)))),e.createElement(a,{gap:{md:"2.5%"},direction:{base:"column",md:"row"},maxW:n!=="news_overview"&&"980px",mx:n!=="news_overview"&&"auto"},n==="news_overview"&&e.createElement(a,{direction:"column",maxW:{md:"29%",lg:"22.5%"},minH:{md:"1000px"},gap:"37px",flex:1,visibility:{base:"hidden",md:"visible"}},e.createElement(a,{h:"100%",direction:"column",display:{base:"none",md:"initial"}},e.createElement(a,{p:"16px",border:"solid #00000010 1px"},e.createElement(O,{dates:g,setDates:m})),e.createElement(_,{type:"desktop",ct:n,tags:s,setTags:d,filters:w}))),e.createElement(a,{direction:"column",flex:1},e.createElement(a,{direction:"column"},e.createElement(a,{minH:"30px",h:"132%",direction:"column"},e.createElement($,{mapContextToProps:({totalResults:b})=>({totalResults:b})},b=>{const{totalResults:I}=b;return f?e.createElement("div",null,"Loading..."):I>0?e.createElement(a,{as:G,columnGap:{base:"20px",md:"16px",lg:"2%"},flexWrap:"wrap",resultView:n==="news_overview"?te:ne,titleField:"name",h:"inherit"}):e.createElement(a,{justifyContent:"center"},e.createElement(p,null,"No results found"))})),e.createElement(a,{py:{base:"36px",lg:"100px"},justify:"center"},e.createElement(M,null),e.createElement(re,null))))),e.createElement(a,{py:{base:"36px",lg:"100px"},justify:"center",visibility:{lg:"hidden"}}))))}function se(){const[t,r]=l.useState();function n(o,i,c){o==="resources_overview"&&r('["category:resource_entry","tags:internal_class=resource_article"]'),o==="news_overview"&&r('["category:news_article","category:news_blurb"]'),!t&&i&&c&&r(`"tags:${encodeURIComponent(i)}=${encodeURIComponent(c)}"`)}return[t,n]}function Ee({ct:t,parent:r}){var u,g;const[n,o]=l.useState(),i=window.location.pathname,[c,s]=se();l.useEffect(()=>{d()},[t]);const d=async()=>{var f,E;const m=t!=null&&t.includes("overview")?await y.getAllEntriesWithRef(t||"news_overview","leaderboard"):await y.getArticle(t,i,"en-us","leaderboard");r==="subjects"?s(t,"subject",(f=m[0])==null?void 0:f.title):s(t,r,(E=m[0])==null?void 0:E.title),o(m[0])};function x(m){const f=[];return m.split("-").map(w=>{f.push(w[0].toUpperCase()+w.slice(1))}),f.join(" ")}return e.createElement("main",{id:"main"},e.createElement(H,null),n&&e.createElement("div",null,n.seo&&e.createElement(B,{data:n.seo,override:n}),e.createElement(P,null),r&&e.createElement(X,{data:{title:`All ${x(r)}`,href:`/resources/${r}`}}),n.banner&&e.createElement(ee,{data:n.banner}),n.section_hero_banner&&e.createElement(Y,{data:n.section_hero_banner[0]}),((u=n.interior_section_header)==null?void 0:u.length)>0&&e.createElement(Q,{data:n.interior_section_header[0]}),n.page_content&&e.createElement(T,{data:n.page_content}),((g=n.leaderboard)==null?void 0:g.length)>0&&e.createElement(a,{m:"23px auto 0",px:{base:"16px",md:"32px",lg:"60px"},flex:1},e.createElement(Z,{data:n.leaderboard})),e.createElement(ce,{cta:n.call_to_action,index:t,prefilter:c,filters:n.search_filters,ct:t,sortfilters:K(n)})))}export{Ee as default};