import{r as P,u as O,R as r,C as B,z as X,F as j,B as D,L as G,A as H,a as R,E as q,G as z,j as V,J as F,K as J,O as K,P as U}from"./index-BWYuRdqs.js";import{R as Y,A as Z}from"./BlockContainer-CCUp_6io.js";import{H as Q}from"./Helmet-GxQ5C0qj.js";function v(b){var A,l,m,y,k,w;const[n,e]=P.useState(!1),{alert:s}=b,g=O();P.useEffect(()=>{const T=localStorage.getItem((s==null?void 0:s.title)+"dismissedAt");let x=!0;if(T){const a=Date.now()-new Date(T).getTime(),t=30*60*1e3;a<t&&(x=!1)}e(x)},[]);const d=()=>{e(!1),localStorage.setItem((s==null?void 0:s.title)+"dismissedAt",new Date().toISOString())};return!s||!s.active||!n?null:r.createElement(r.Fragment,null,s&&s.active&&n&&r.createElement(B,{as:X,color:g.colors.White,backgroundColor:g.colors.Blue150,minW:"100%",direction:{base:"column",md:"row"},justify:{base:"center",md:"space-between"},align:{base:"center",md:"center"}},r.createElement(B,{color:g.colors.White,backgroundColor:g.colors.Blue150,minW:"100%",as:j,flexDirection:"row",justifyContent:"space-between"},r.createElement(D,{minW:"100%",align:"center",paddingX:"32px",paddingY:"8px",maxWidth:"1200px"},r.createElement(D,{maxWidth:"1200px"},r.createElement(Y,{data:s.message,fontSize:"1rem",px:"0",mx:"0",display:"inline",addedClassName:"alertBanner"})," ",r.createElement(G,{href:(l=(A=s.url_path)==null?void 0:A.link)==null?void 0:l.href,target:(m=s.url_path)!=null&&m.new_window?"_blank":"_self",textDecoration:(y=s.url_path)!=null&&y.external?"underline":"none",fontWeight:"bold"},(w=(k=s.url_path)==null?void 0:k.link)==null?void 0:w.title))),r.createElement(D,{flexGrow:.03},r.createElement(H,{onClick:d})))))}function se(b){const e=R().pathname,{data:s,isError:g,failureReason:d}=q(V.messageAlert);if(g)throw new Error("Error loading message alert: ",(d==null?void 0:d.message)||"unknown reason");const A=(l,m)=>m===z.homePage&&l==="Home page only"||m.startsWith(l)?!0:l==="All pages";return s?r.createElement(D,null,s==null?void 0:s.map((l,m)=>A(l==null?void 0:l.page_path,e)&&r.createElement(D,{key:m},r.createElement(v,{alert:l})))):null}const ee=["es","fr","pt","nl","en-us"];var S={exports:{}};(function(b){(function(n){if(typeof e!="function"){var e=function(a){return a};e.nonNative=!0}const s=e("plaintext"),g=e("html"),d=e("comment"),A=/<(\w*)>/g,l=/<\/?([^\s\/>]+)/;function m(a,t,E){a=a||"",t=t||[],E=E||"";let C=k(t,E);return w(a,C)}function y(a,t){a=a||[],t=t||"";let E=k(a,t);return function(p){return w(p||"",E)}}m.init_streaming_mode=y;function k(a,t){return a=T(a),{allowable_tags:a,tag_replacement:t,state:s,tag_buffer:"",depth:0,in_quote_char:""}}function w(a,t){if(typeof a!="string")throw new TypeError("'html' parameter must be a string");let E=t.allowable_tags,C=t.tag_replacement,p=t.state,c=t.tag_buffer,i=t.depth,u=t.in_quote_char,h="";for(let _=0,M=a.length;_<M;_++){let f=a[_];if(p===s)switch(f){case"<":p=g,c+=f;break;default:h+=f;break}else if(p===g)switch(f){case"<":if(u)break;i++;break;case">":if(u)break;if(i){i--;break}u="",p=s,c+=">",E.has(x(c))?h+=c:h+=C,c="";break;case'"':case"'":f===u?u="":u=u||f,c+=f;break;case"-":c==="<!-"&&(p=d),c+=f;break;case" ":case`
`:if(c==="<"){p=s,h+="< ",c="";break}c+=f;break;default:c+=f;break}else if(p===d)switch(f){case">":c.slice(-2)=="--"&&(p=s),c="";break;default:c+=f;break}}return t.state=p,t.tag_buffer=c,t.depth=i,t.in_quote_char=u,h}function T(a){let t=new Set;if(typeof a=="string"){let E;for(;E=A.exec(a);)t.add(E[1])}else!e.nonNative&&typeof a[e.iterator]=="function"?t=new Set(a):typeof a.forEach=="function"&&a.forEach(t.add,t);return t}function x(a){let t=l.exec(a);return t?t[1].toLowerCase():null}b.exports?b.exports=m:n.striptags=m})(F)})(S);var te=S.exports;const I=J(te),$=160;function ie(b){var w,T,x,a,t,E,C,p,c;const{data:n,override:e,isArticle:s}=b,{l:g}=K();U();const d=()=>{const i=document.head,u=Array.from(i.childNodes),h=(o,W)=>{const N=o.name,L=W.name;return N==="description"&&L!=="description"?-1:L==="description"&&N!=="description"?1:0},_=u.filter(o=>o.nodeName==="META").sort(h),M=u.filter(o=>o.nodeName==="TITLE"),f=u.filter(o=>o.nodeName==="LINK");_.forEach(o=>i.removeChild(o)),M.forEach(o=>i.removeChild(o)),f.forEach(o=>i.removeChild(o)),f.forEach(o=>i.insertBefore(o,i.firstChild)),_.forEach(o=>i.insertBefore(o,i.firstChild)),M.forEach(o=>i.insertBefore(o,i.firstChild)),window&&(window.prerenderReady=!0)};P.useEffect(()=>{d()},[]);const A=i=>Z(i,"yyyy-MM-dd'T'HH:mm:ssXXX"),l=()=>{const i=n==null?void 0:n.meta_description;if(i)return i;if(e!=null&&e.article_body&&Array.isArray(e.article_body)){const u=e.article_body.map(h=>{var _;return((_=h==null?void 0:h.rte)==null?void 0:_.rich_text_editor)||(e==null?void 0:e.entry_summary)||""}).join(" ");return I(u).trim().slice(0,$)}return e!=null&&e.entry_summary?I(e.entry_summary).trim().slice(0,$):""},m=((w=n==null?void 0:n.meta_image)==null?void 0:w.url)||((T=e==null?void 0:e.main_image)==null?void 0:T.url)||((a=(x=e==null?void 0:e.headline_banner)==null?void 0:x.image)==null?void 0:a.url),y=(n==null?void 0:n.meta_page_title)||(e==null?void 0:e.title),k=P.useMemo(()=>{var h,_;const[i]=((h=e==null?void 0:e.article_details)==null?void 0:h.author)||[""],u=l();return{"@context":"https://schema.org","@type":"NewsArticle",headline:((_=e==null?void 0:e.article_details)==null?void 0:_.headline)||y,description:u,url:window.location.origin+e.url,image:m,datePublished:e==null?void 0:e.created_at,dateModified:e==null?void 0:e.updated_at,author:{"@type":"Person",name:(i==null?void 0:i.name)||"IAPP Staff"},publisher:{"@type":"Organization",name:"IAPP"}}},[n,e,m,y,l]);return r.createElement(Q,null,r.createElement("title",null,`${y}  | IAPP`),r.createElement("meta",{name:"description",content:l(),"data-rh":"true"}),((t=e==null?void 0:e.publish_details)==null?void 0:t.time)&&r.createElement("meta",{"http-equiv":"last-modified",content:A((E=e==null?void 0:e.publish_details)==null?void 0:E.time)}),r.createElement("link",{rel:"canonical",href:`${n==null?void 0:n.canonical_url}`||`https://iapp.org${e==null?void 0:e.url}`}),r.createElement("meta",{property:"og:title",content:`${n==null?void 0:n.meta_page_title}`||`${(C=e==null?void 0:e.article_details)==null?void 0:C.headline}`}),r.createElement("meta",{property:"og:description",content:l()}),m&&r.createElement("meta",{property:"og:image",content:m}),r.createElement("meta",{property:"og:type",content:"article"}),r.createElement("meta",{property:"og:url",content:`${n==null?void 0:n.canonical_url}`||`https://iapp.org${e==null?void 0:e.url}`}),r.createElement("meta",{property:"og:locale",content:g&&ee.includes(g)?`${g}`:"en_US"}),r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("meta",{name:"twitter:site",content:"@IAPP"}),r.createElement("meta",{name:"twitter:title",content:`${y}`}),r.createElement("meta",{name:"twitter:description",content:`${n==null?void 0:n.meta_description}`||`${e==null?void 0:e.news_blurb}`}),r.createElement("meta",{name:"twitter:image",content:((p=n==null?void 0:n.meta_image)==null?void 0:p.url)||((c=e==null?void 0:e.main_image)==null?void 0:c.url)}),r.createElement("meta",null),s&&r.createElement("script",{type:"application/ld+json"},JSON.stringify(k)))}export{se as A,ie as M};