@apolitical/component-library 2.1.2-ac.0 → 2.1.2-ac.1

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.
@@ -92,6 +92,8 @@ export interface CarouselTitleProps {
92
92
  size?: 'medium' | 'large';
93
93
  /** The `href` to point the 'view all' link to; it won't show unless this is defined */
94
94
  link?: string;
95
+ /** Whether the title should be hidden */
96
+ hidden?: boolean;
95
97
  }
96
98
  export interface BaseCarouselProps {
97
99
  /** A function to parse and build the card data - this is especially needed in carousels to hydrate the cards */
package/index.js CHANGED
@@ -32,9 +32,9 @@ Check the top-level render call using <`+N+">.")}return C}}function rr(h,C){{if(
32
32
 
33
33
  Please explain why you're reporting this post. Reasons could include: inappropriate language, harassment, spam, hate speech, false information, among others. Include as much detail as you feel comfortable.
34
34
 
35
- Thank you for helping to protect the Apolitical community from abusive content.`,discussion_form_title:"Write your {action}",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Write something...",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_more:"and {number} more...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_responses_placeholder:"Write a comment...",discussion_thread_show:"Show {count} {count, select, 1 {reply} other {replies}}",discussion_thread_hide:"Hide replies",discussion_thread_loadMore:"Load more replies",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their emails below",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",showpassword_show:"Show",showpassword_hide:"Hide",showpassword_aria_show:"Your password is hidden. Click to show.",showpassword_aria_hide:"Your password is visible. Click to hide.",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_community:"Community",footer_community_support:"Support FAQ",footer_community_post:"Post on Apolitical",footer_community_join:"Who can join",footer_community_guidelines:"Guidelines & values",footer_company:"Company",footer_company_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_correspondence:"Correspondence address",footer_contact_correspondence_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital and data",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",inviteModal_title:"You’re registered",overlay_close:"Close",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_profile:"My profile",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",edit_section_placeholder_description:"Add some details",edit_section_placeholder_cta:"add",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll"},ks={languageSwitcher_label:"Me gustaría leer este artículo en...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traducido por un humano",languageSwitcher_translation_machine:"traducido por máquina",languageSwitcher_disclaimer:"Este contenido fue traducido automáticamente y ocasionalmente tendrá errores de género u otras traducciones directas. Estamos intentando resolver este problema, pero mientras tanto, si notas algún error grave, escríbenos a <link>{email}</link>"},Ts={languageSwitcher_label:"Je voudrais lire cet article dans...",languageSwitcher_translation_original:"langue originale",languageSwitcher_translation_human:"traduit par un humain",languageSwitcher_translation_machine:"traduit par machine",languageSwitcher_disclaimer:"Ce contenu est traduit automatiquement et contiendra d’évantuelles erreurs de genre ou d’autres traductions directes. Nous essayons de résoudre ce problème, mais en attendant, si vous remarquez une erreur importante, faites-le nous savoir à <link>{email}</link>",collapsibleSection_summary:"En savoir plus"},Es={languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"linguagem original",languageSwitcher_translation_human:"traduzido por um humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, poderão ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos tentando resolver isso, porém se perceber algo errado por favor nos avise em <link>{email}</link>"},Ss=Object.freeze(Object.defineProperty({__proto__:null,en:Mn,es:ks,fr:Ts,pt:Es},Symbol.toStringTag,{value:"Module"})),Vr=e=>e in Mn,ke=(e,t,n,r,s={})=>{let i="";return Vr(`${t}_${n}`)?i=e({id:`${t}_${n}`},s):i=e({id:t},{[r]:n,...s}),i},Cs=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let s=n.length-1;s>=0;s--){const i=Math.pow(10,(s+1)*3);if(i<=e){e=Math.round(e*t/i)/t,e===1e3&&s<n.length-1&&(e=1,s++),r=`${e}${n[s]}`;break}}return r},wt=(e,t)=>g.Children.map(e,n=>Object.is(n,null)?n:g.cloneElement(n,{...t})),Yr=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},$s=e=>e.replace(/\s+/g,"").length>0,Ms=e=>{const t=e.length>8,n=/[0-9]/.test(e)&&/[`!@#$%^&*()_+\-=[\]{}£;':"\\|,.<>/?~]/.test(e),r=new RegExp("^(?=.*?[A-Z])(?=.*?[a-z])").test(e);return{isValid:t&&n&&r,matchingRules:{isMoreThanEightCharacters:t,includesNumberAndSymbol:n,includesLowerAndUppercase:r}}},X=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:s=!1,element:i="button",onClick:c=!1,className:o="",disabled:u=!1,screenreaderText:d=!1,children:f=!1,...l})=>{const p=Ve(typeof t=="object");if(typeof t=="object"&&typeof p=="number"){const b=Object.assign({},t),y=Ur(Object.keys(b));t=Zr(p,y,b)}const _=[];typeof t=="string"&&_.push(t),r&&(_.push("icon"),typeof r=="object"?(_.push(r.icon),r.position?_.push(r.position):_.push("left"),r.hover&&_.push(`hover_${r.hover}`),r.animate&&(_.push("animate"),typeof r.animate=="string"&&_.push(r.animate))):(_.push(r),!r.includes("right")&&!r.includes("left")&&_.push("left"))),n.muted&&_.push("muted"),n.fullWidth&&_.push("full-width");const v={...l,className:E(e,o,_,{"no-text":!f,disabled:u,button:s}),onClick:b=>{(!s||s[0]==="#")&&c&&(b.preventDefault(),b.stopPropagation()),c&&c(b)},disabled:typeof u=="object"&&"isClickable"in u?!u.isClickable:u};return s&&(i="a",v.href=s),g.createElement(i,v,f||(d?a.jsx(he,{showOnFocus:!1,children:d}):null))},ot=({buttons:e,className:t="",...n})=>{const r=e.length>1?"ul":"p",s=e.map((i,c)=>r==="p"?a.jsx(X,{...i},c):a.jsx("li",{children:a.jsx(X,{...i})},c));return g.createElement(r,{className:E("button-wrapper",t),...n,children:s})};const Te=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return a.jsx("hr",{className:E(e,{"has-max-width":t}),style:n})},dr={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"}},Rs=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:s}=e?dr[e]:dr.fallback;return{range:t&&t.length>0?t:r,sizes:n||s}},Ps=({format:e,height:t,query:n,width:r})=>{let s=`w=${r}&h=${t}`;return s=e?`${s}&fm=${e}`:s,s=n?`${s}&${n}`:s,s},Wt=({format:e,range:t,url:n,query:r})=>t.map(({height:s,width:i})=>`${n}?${Ps({format:e,height:s,query:r,width:i})} ${i}w`).join(", ");const ct=({image:e,className:t,testId:n})=>{const{description:r,height:s,type:i,query:c,url:o,width:u,loading:d,decoding:f,fetchPriority:l}=e,{range:m,sizes:p}=Rs(e),_=Wt({format:"avif",query:c,range:m,url:o}),v=Wt({format:"webp",query:c,range:m,url:o}),b=Wt({format:"",query:c,range:m,url:o});return a.jsxs("picture",{className:t,children:[i!=="image/gif"&&a.jsx("source",{type:"image/avif",srcSet:_,sizes:p,"data-testid":"source"}),a.jsx("source",{type:"image/webp",srcSet:v,sizes:p,"data-testid":"source"}),a.jsx("img",{srcSet:b,sizes:p,src:o,alt:r,loading:d||"lazy",decoding:f||"async",fetchpriority:l||"auto",width:u,height:s,"data-testid":n||"image"})]})};const Ns=({image:e,className:t,testId:n})=>a.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&a.jsx(ct,{image:{...e},className:"image"})}),Ye=({href:e,children:t,fallbackElement:n,className:r="",onClick:s,gtmContext:i,gtmType:c,...o})=>{if(e){const u={...o};return s&&(u.onClick=s),i&&(u["data-gtm-event-context"]=i),c&&(u["data-gtm-event-type"]=c),a.jsx("a",{href:e,className:E("gtm-trackable",r),...u,children:t})}return n?g.createElement(n,{children:t,className:r,...o}):t};const As=({currentStep:e=1,steps:t=1})=>{const[n,r]=g.useState([]);return g.useEffect(()=>{const s=[];for(let i=1;i<t+1;i++)s.push(i);r(s)},[t]),a.jsx("div",{className:"navigation-dots-wrapper",children:a.jsx("div",{className:"dots-wrapper",children:n.map(s=>a.jsxs("div",{className:"dot-wrapper",children:[a.jsx("div",{className:E("dot",{active:s===e,completed:s<e}),"data-testid":"navigation-dot"}),a.jsx("div",{className:E("line",{active:s<e})})]},s))})})};const Fs=({elementId:e,offset:t=20})=>{const n=I.useIntl(),r=()=>{const s=document.getElementById(e);if(!s)return;const i=document.getElementById("header");i&&window.scrollTo({top:s.offsetTop-i.clientHeight-t})};return a.jsx(X,{variant:"secondary",className:"return-to-nav",onClick:r,"data-gtm-event-context":"ListPageMobile","data-gtm-event-type":"back-to-nav-button-click",screenreaderText:n.formatMessage({id:"return_to_nav_button"})})};let Xe=!1;const Gr=({isOpen:e=!1,isLoading:t=!1,children:n})=>{const r=I.useIntl(),s=g.useRef(null),[i,c]=g.useState("hidden");g.useEffect(()=>{const u=s.current;if(u)return u.addEventListener("transitionend",o),()=>{u.removeEventListener("transitionend",o)}},[]);const o=({propertyName:u})=>{u==="opacity"&&(Xe!==!1&&clearTimeout(Xe),c(d=>d==="opening"?"open":d==="closing"?"closed":d==="closed"?"hidden":d))};return Ue(()=>{Xe!==!1&&clearTimeout(Xe);let u="open";e?c("opening"):(c("closing"),u="hidden"),Xe=setTimeout(()=>{c(u)},300)},[e]),a.jsx("aside",{ref:s,className:E("tooltip text-medium",i,{loading:t}),hidden:i==="hidden",children:t?a.jsx("p",{children:r.formatMessage({id:"tooltip_loading"})}):typeof n=="string"?a.jsx("p",{children:n}):n})};const Ie=({children:e,className:t="",...n})=>a.jsx("section",{className:E("full-width-section",t),...n,children:e});const Is=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(s=>{r.push({href:s.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable","data-gtm-event-type":"download-click","data-gtm-event-context":s.eventContext||"Download",target:"_blank",children:s.text})}),a.jsx(Ie,{className:E("download-section",n),children:a.jsxs(a.Fragment,{children:[g.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),a.jsx(ot,{buttons:r})]})})};function Kr({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const Os=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:s,setShowModal:i})=>{const{formatMessage:c}=I.useIntl();return a.jsxs("div",{className:E("edit-section-placeholder",{"has-icon":!!e}),style:ys(e),children:[a.jsx("p",{children:t||c({id:"edit_section_placeholder_description"})}),s&&a.jsx(X,{href:r,variant:"secondary",size:"small",onClick:()=>Kr({href:r,setShowModal:i}),children:n||c({id:"edit_section_placeholder_cta"})})]})},Ls=({children:e,className:t="",formProps:n,href:r,title:s,modalTitle:i,placeholder:c,showDivider:o=!0})=>{const[u,d]=g.useState(!1),f=typeof r=="string"||!!n,l=()=>d(!1);return a.jsxs("section",{className:E("edit-section",t),children:[n&&a.jsx(It,{title:i||`Edit ${s}`,isOpen:u,showDivider:!1,showIcon:!1,functions:{onClose:l},className:E("edit-section-modal"),children:a.jsx(At,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0},functions:{...n==null?void 0:n.functions,onCancel:l}})}),a.jsxs("div",{className:"edit-section-header",children:[a.jsx("h2",{className:"edit-section-header-title",children:s}),f&&a.jsx(X,{href:r,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>Kr({href:r,setShowModal:d}),children:"Edit"})]}),a.jsx("div",{className:"edit-section-body",children:e||a.jsx(Os,{...c,href:r,setShowModal:d,showEditButton:f})}),o&&a.jsx(Te,{})]})};const Ds=({title:e=!1,logos:t=[],className:n=""})=>{const r=t.length;if(r===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:""};return a.jsxs("div",{className:E("logos",n),children:[e&&g.createElement(s.element,{className:"title"},s.text),a.jsx("ul",{className:E({"two-col":r===2||r===4,"three-col":r===5||r<=10&&r%3===0}),children:t.map(({logo:i,nameOfBusiness:c,link:o=!1,description:u=!1},d)=>{if(!i||!i.url)return null;const f=a.jsx("img",{src:i.url,width:i.width||"auto",height:i.height||"auto",alt:c});return a.jsxs("li",{children:[a.jsx("p",{className:"img-wrapper",children:o?a.jsx("a",{href:o,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),u&&a.jsx("small",{children:u})]},window.btoa(`${i.url}_${d}`))})})]})};const Bs=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],qs=({className:e="",content:t,image:n,variant:r="default",spacing:s="normal",hideElements:i={eyebrow:!1,title:!1,text:!1},cta:c,children:o})=>{const u=["eyebrow","title","text"],d={eyebrow:"small",title:"h1",text:"p"},f={};return u.forEach(l=>{if(!t[l]){f[l]=!1;return}if(!i[l]){if(typeof t[l]=="object"){f[l]=t[l];const{text:m,element:p}=t[l];if(p&&Bs.includes(p.toLowerCase()))return;f[l]={text:m,element:d[l]};return}f[l]={text:t[l],element:d[l]}}}),c&&c.link&&c.link[0]==="#"&&(c.props||(c.props={}),c.props.onClick=l=>{l.preventDefault(),l.stopPropagation();const m=document.getElementById(c.link.substring(1));m&&m.scrollIntoView({behavior:"smooth"})}),a.jsx(Ie,{className:E("banner-section",r,s,e,{"has-image":n,"has-extra-spacing":s==="normal"&&f.eyebrow&&f.title}),children:a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"content-wrapper",children:[u.map(l=>{if(f[l]&&typeof f[l]=="object"){const{text:m,element:p=""}=f[l];return l==="text"?a.jsx(kt,{overrideType:"text-only",className:"text",children:m},l):g.createElement(p,{key:l,className:l},m)}return null}),o,c&&c.text&&c.link&&a.jsx(X,{variant:n||r==="light"?"primary":"secondary",size:{mobile:"medium",768:"large"},href:c.link,...c.props,children:c.text})]}),n&&a.jsx(ct,{image:{...n,aspect:"banner"}})]})})},zs=g.memo(qs);const Hs=({alignImage:e="left",className:t,content:n,image:r})=>{const s=()=>typeof n=="string"?a.jsx(We,{children:n}):n;return a.jsxs(Ie,{className:E("highlight-section",t),children:[r&&a.jsx("div",{className:E("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:a.jsx(ct,{image:r})}),a.jsx("div",{className:E("highlight-container highlight-content-wrapper",{"no-image":!r}),children:a.jsx("div",{className:E("highlight-content",{"highlight-content-right":e==="left"}),children:s()})})]})},Us=g.memo(Hs);const Zs=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:s})=>!n&&!r?null:a.jsxs("aside",{className:E("marketing-block",e),children:[n&&a.jsx("p",{className:"title",children:n}),r&&a.jsx("p",{children:r}),t&&a.jsx(X,{variant:"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":s,"data-gtm-event-type":"learn-more-click",children:t.text})]}),Qr=({showDevTools:e=!0,children:t})=>{const n=new fe.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return a.jsxs(fe.QueryClientProvider,{client:n,children:[t,e&&a.jsx(is.ReactQueryDevtools,{initialIsOpen:!1})]})};var Ws=g.createContext({client:xt});function Vs(e){var t=e.children,n=e.client,r=e.apiKey,s=e.options,i=g.useMemo(function(){return n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&s&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n||(r&&(xt.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),xt.init(r,s)),xt)},[n,r]);return g.createElement(Ws.Provider,{value:{client:i}},t)}const Jr=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?a.jsx(Vs,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,disable_session_recording:!0,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id}},children:e}):e,Xr=({children:e,locale:t,messages:n})=>{const r=t||"en",s={...Ss[r],...n||{}};return a.jsx(I.IntlProvider,{locale:r,messages:s,children:e})},Ee=g.createContext({isLoading:!0});function Pt(){return g.useContext(Ee)}const ea=({children:e,user:t})=>a.jsx(Ee.Provider,{value:t,children:e}),Ys=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[s,i]=g.useState({isLoading:!0});return g.useEffect(()=>{e().then(c=>{i({...c,isLoading:!1}),Yr(5e3)}).catch(()=>i({isLoading:!1}))},[]),a.jsx(Xr,{locale:n==null?void 0:n.locale,messages:n==null?void 0:n.messages,children:a.jsx(Cn.CookiesProvider,{children:a.jsx(ea,{user:s,children:a.jsx(Qr,{showDevTools:r,children:a.jsx(Jr,{user:s,children:t})})})})})};const Rn=({label:e=!1,className:t="",children:n})=>{const r=I.useIntl();return a.jsxs("details",{className:E("collapsible-section",t),children:[a.jsx("summary",{children:e||r.formatMessage({id:"collapsibleSection_summary"})}),a.jsx("div",{className:"content",children:n})]})};const Re=({variant:e="primary",icon:t,className:n="",children:r,...s})=>{const i=t?{"--icon":`url(${Fe}icons/${t}.svg)`}:{};return a.jsx("div",{className:E("highlighted-text-box",e,n,{"has-icon":t}),style:i,...s,children:r})};const Oe=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let s=n&&!!Object.keys(n).length;const i=typeof n=="object"&&"breakpoints"in n,c=Ve(i);if(i&&typeof n=="object"&&typeof c=="number"){const l=Object.assign({},n.breakpoints),m=Ur(Object.keys(l));s=Zr(c,m,l)}const{breakpoints:o,text:u="",component:d,...f}=n;return a.jsx(Re,{variant:"subtle",className:E("empty-state-box",e,r),children:a.jsxs(a.Fragment,{children:[t&&a.jsx(We,{options:{forceBlock:!0},children:t}),s&&typeof n=="object"&&(d||a.jsx(X,{...f,variant:n.variant?n.variant:"secondary",children:u}))]})})};const bn=({children:e,...t})=>a.jsx("p",{...t,children:e}),ta={q:bn,blockquote:bn};for(let e=1;e<=6;e++)ta[`h${e}`]={component:bn,props:{className:"title"}};const na=({type:e="default",className:t="",heading:n=!1,children:r})=>a.jsxs("div",{className:E("helper-text-box text-small",e,t),children:[n&&a.jsx("p",{className:"title",children:n}),typeof r=="string"?a.jsx(We,{options:{wrapper:g.Fragment,forceBlock:!0,overrides:ta},children:r}):a.jsx("p",{children:r})]});const Gs=({className:e="",show:t=!1,hide:n=!1,text:r,children:s})=>{const i=I.useIntl(),c=g.useRef(null),[o,u]=g.useState(""),[d,f]=g.useState("closed");g.useEffect(()=>{const p=c.current;if(p)return p.addEventListener("transitionend",l),()=>{p.removeEventListener("transitionend",l)}},[]),g.useEffect(()=>{if(!r||typeof r!="string")return;const p=r.split(`
35
+ Thank you for helping to protect the Apolitical community from abusive content.`,discussion_form_title:"Write your {action}",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Write something...",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_more:"and {number} more...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_responses_placeholder:"Write a comment...",discussion_thread_show:"Show {count} {count, select, 1 {reply} other {replies}}",discussion_thread_hide:"Hide replies",discussion_thread_loadMore:"Load more replies",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their emails below",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",showpassword_show:"Show",showpassword_hide:"Hide",showpassword_aria_show:"Your password is hidden. Click to show.",showpassword_aria_hide:"Your password is visible. Click to hide.",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_community:"Community",footer_community_support:"Support FAQ",footer_community_post:"Post on Apolitical",footer_community_join:"Who can join",footer_community_guidelines:"Guidelines & values",footer_company:"Company",footer_company_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_correspondence:"Correspondence address",footer_contact_correspondence_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital and data",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",inviteModal_title:"You’re registered",overlay_close:"Close",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_profile:"My profile",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",edit_section_placeholder_description:"Add some details",edit_section_placeholder_cta:"add",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll"},ks={languageSwitcher_label:"Me gustaría leer este artículo en...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traducido por un humano",languageSwitcher_translation_machine:"traducido por máquina",languageSwitcher_disclaimer:"Este contenido fue traducido automáticamente y ocasionalmente tendrá errores de género u otras traducciones directas. Estamos intentando resolver este problema, pero mientras tanto, si notas algún error grave, escríbenos a <link>{email}</link>"},Ts={languageSwitcher_label:"Je voudrais lire cet article dans...",languageSwitcher_translation_original:"langue originale",languageSwitcher_translation_human:"traduit par un humain",languageSwitcher_translation_machine:"traduit par machine",languageSwitcher_disclaimer:"Ce contenu est traduit automatiquement et contiendra d’évantuelles erreurs de genre ou d’autres traductions directes. Nous essayons de résoudre ce problème, mais en attendant, si vous remarquez une erreur importante, faites-le nous savoir à <link>{email}</link>",collapsibleSection_summary:"En savoir plus"},Es={languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"linguagem original",languageSwitcher_translation_human:"traduzido por um humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, poderão ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos tentando resolver isso, porém se perceber algo errado por favor nos avise em <link>{email}</link>"},Ss=Object.freeze(Object.defineProperty({__proto__:null,en:Mn,es:ks,fr:Ts,pt:Es},Symbol.toStringTag,{value:"Module"})),Vr=e=>e in Mn,ke=(e,t,n,r,s={})=>{let i="";return Vr(`${t}_${n}`)?i=e({id:`${t}_${n}`},s):i=e({id:t},{[r]:n,...s}),i},Cs=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let s=n.length-1;s>=0;s--){const i=Math.pow(10,(s+1)*3);if(i<=e){e=Math.round(e*t/i)/t,e===1e3&&s<n.length-1&&(e=1,s++),r=`${e}${n[s]}`;break}}return r},wt=(e,t)=>g.Children.map(e,n=>Object.is(n,null)?n:g.cloneElement(n,{...t})),Yr=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},$s=e=>e.replace(/\s+/g,"").length>0,Ms=e=>{const t=e.length>8,n=/[0-9]/.test(e)&&/[`!@#$%^&*()_+\-=[\]{}£;':"\\|,.<>/?~]/.test(e),r=new RegExp("^(?=.*?[A-Z])(?=.*?[a-z])").test(e);return{isValid:t&&n&&r,matchingRules:{isMoreThanEightCharacters:t,includesNumberAndSymbol:n,includesLowerAndUppercase:r}}},X=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:s=!1,element:i="button",onClick:c=!1,className:o="",disabled:u=!1,screenreaderText:d=!1,children:f=!1,...l})=>{const p=Ve(typeof t=="object");if(typeof t=="object"&&typeof p=="number"){const b=Object.assign({},t),y=Ur(Object.keys(b));t=Zr(p,y,b)}const _=[];typeof t=="string"&&_.push(t),r&&(_.push("icon"),typeof r=="object"?(_.push(r.icon),r.position?_.push(r.position):_.push("left"),r.hover&&_.push(`hover_${r.hover}`),r.animate&&(_.push("animate"),typeof r.animate=="string"&&_.push(r.animate))):(_.push(r),!r.includes("right")&&!r.includes("left")&&_.push("left"))),n.muted&&_.push("muted"),n.fullWidth&&_.push("full-width");const v={...l,className:E(e,o,_,{"no-text":!f,disabled:u,button:s}),onClick:b=>{(!s||s[0]==="#")&&c&&(b.preventDefault(),b.stopPropagation()),c&&c(b)},disabled:typeof u=="object"&&"isClickable"in u?!u.isClickable:u};return s&&(i="a",v.href=s),g.createElement(i,v,f||(d?a.jsx(he,{showOnFocus:!1,children:d}):null))},ot=({buttons:e,className:t="",...n})=>{const r=e.length>1?"ul":"p",s=e.map((i,c)=>r==="p"?a.jsx(X,{...i},c):a.jsx("li",{children:a.jsx(X,{...i})},c));return g.createElement(r,{className:E("button-wrapper",t),...n,children:s})};const Te=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return a.jsx("hr",{className:E(e,{"has-max-width":t}),style:n})},dr={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"}},Rs=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:s}=e?dr[e]:dr.fallback;return{range:t&&t.length>0?t:r,sizes:n||s}},Ps=({format:e,height:t,query:n,width:r})=>{let s=`w=${r}&h=${t}`;return s=e?`${s}&fm=${e}`:s,s=n?`${s}&${n}`:s,s},Wt=({format:e,range:t,url:n,query:r})=>t.map(({height:s,width:i})=>`${n}?${Ps({format:e,height:s,query:r,width:i})} ${i}w`).join(", ");const ct=({image:e,className:t,testId:n})=>{const{description:r,height:s,type:i,query:c,url:o,width:u,loading:d,decoding:f,fetchPriority:l}=e,{range:m,sizes:p}=Rs(e),_=Wt({format:"avif",query:c,range:m,url:o}),v=Wt({format:"webp",query:c,range:m,url:o}),b=Wt({format:"",query:c,range:m,url:o});return a.jsxs("picture",{className:t,children:[i!=="image/gif"&&a.jsx("source",{type:"image/avif",srcSet:_,sizes:p,"data-testid":"source"}),a.jsx("source",{type:"image/webp",srcSet:v,sizes:p,"data-testid":"source"}),a.jsx("img",{srcSet:b,sizes:p,src:o,alt:r,loading:d||"lazy",decoding:f||"async",fetchpriority:l||"auto",width:u,height:s,"data-testid":n||"image"})]})};const Ns=({image:e,className:t,testId:n})=>a.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&a.jsx(ct,{image:{...e},className:"image"})}),Ye=({href:e,children:t,fallbackElement:n,className:r="",onClick:s,gtmContext:i,gtmType:c,...o})=>{if(e){const u={...o};return s&&(u.onClick=s),i&&(u["data-gtm-event-context"]=i),c&&(u["data-gtm-event-type"]=c),a.jsx("a",{href:e,className:E("gtm-trackable",r),...u,children:t})}return n?g.createElement(n,{children:t,className:r,...o}):t};const As=({currentStep:e=1,steps:t=1})=>{const[n,r]=g.useState([]);return g.useEffect(()=>{const s=[];for(let i=1;i<t+1;i++)s.push(i);r(s)},[t]),a.jsx("div",{className:"navigation-dots-wrapper",children:a.jsx("div",{className:"dots-wrapper",children:n.map(s=>a.jsxs("div",{className:"dot-wrapper","aria-label":`Step ${e} of ${s}`,children:[a.jsx("div",{className:E("dot",{active:s===e,completed:s<e}),"data-testid":"navigation-dot"}),a.jsx("div",{className:E("line",{active:s<e})})]},s))})})};const Fs=({elementId:e,offset:t=20})=>{const n=I.useIntl(),r=()=>{const s=document.getElementById(e);if(!s)return;const i=document.getElementById("header");i&&window.scrollTo({top:s.offsetTop-i.clientHeight-t})};return a.jsx(X,{variant:"secondary",className:"return-to-nav",onClick:r,"data-gtm-event-context":"ListPageMobile","data-gtm-event-type":"back-to-nav-button-click",screenreaderText:n.formatMessage({id:"return_to_nav_button"})})};let Xe=!1;const Gr=({isOpen:e=!1,isLoading:t=!1,children:n})=>{const r=I.useIntl(),s=g.useRef(null),[i,c]=g.useState("hidden");g.useEffect(()=>{const u=s.current;if(u)return u.addEventListener("transitionend",o),()=>{u.removeEventListener("transitionend",o)}},[]);const o=({propertyName:u})=>{u==="opacity"&&(Xe!==!1&&clearTimeout(Xe),c(d=>d==="opening"?"open":d==="closing"?"closed":d==="closed"?"hidden":d))};return Ue(()=>{Xe!==!1&&clearTimeout(Xe);let u="open";e?c("opening"):(c("closing"),u="hidden"),Xe=setTimeout(()=>{c(u)},300)},[e]),a.jsx("aside",{ref:s,className:E("tooltip text-medium",i,{loading:t}),hidden:i==="hidden",children:t?a.jsx("p",{children:r.formatMessage({id:"tooltip_loading"})}):typeof n=="string"?a.jsx("p",{children:n}):n})};const Ie=({children:e,className:t="",...n})=>a.jsx("section",{className:E("full-width-section",t),...n,children:e});const Is=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(s=>{r.push({href:s.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable","data-gtm-event-type":"download-click","data-gtm-event-context":s.eventContext||"Download",target:"_blank",children:s.text})}),a.jsx(Ie,{className:E("download-section",n),children:a.jsxs(a.Fragment,{children:[g.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),a.jsx(ot,{buttons:r})]})})};function Kr({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const Os=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:s,setShowModal:i})=>{const{formatMessage:c}=I.useIntl();return a.jsxs("div",{className:E("edit-section-placeholder",{"has-icon":!!e}),style:ys(e),children:[a.jsx("p",{children:t||c({id:"edit_section_placeholder_description"})}),s&&a.jsx(X,{href:r,variant:"secondary",size:"small",onClick:()=>Kr({href:r,setShowModal:i}),children:n||c({id:"edit_section_placeholder_cta"})})]})},Ls=({children:e,className:t="",formProps:n,href:r,title:s,modalTitle:i,placeholder:c,showDivider:o=!0})=>{const[u,d]=g.useState(!1),f=typeof r=="string"||!!n,l=()=>d(!1);return a.jsxs("section",{className:E("edit-section",t),children:[n&&a.jsx(It,{title:i||`Edit ${s}`,isOpen:u,showDivider:!1,showIcon:!1,functions:{onClose:l},className:E("edit-section-modal"),children:a.jsx(At,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0},functions:{...n==null?void 0:n.functions,onCancel:l}})}),a.jsxs("div",{className:"edit-section-header",children:[a.jsx("h2",{className:"edit-section-header-title",children:s}),f&&a.jsx(X,{href:r,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>Kr({href:r,setShowModal:d}),children:"Edit"})]}),a.jsx("div",{className:"edit-section-body",children:e||a.jsx(Os,{...c,href:r,setShowModal:d,showEditButton:f})}),o&&a.jsx(Te,{})]})};const Ds=({title:e=!1,logos:t=[],className:n=""})=>{const r=t.length;if(r===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:""};return a.jsxs("div",{className:E("logos",n),children:[e&&g.createElement(s.element,{className:"title"},s.text),a.jsx("ul",{className:E({"two-col":r===2||r===4,"three-col":r===5||r<=10&&r%3===0}),children:t.map(({logo:i,nameOfBusiness:c,link:o=!1,description:u=!1},d)=>{if(!i||!i.url)return null;const f=a.jsx("img",{src:i.url,width:i.width||"auto",height:i.height||"auto",alt:c});return a.jsxs("li",{children:[a.jsx("p",{className:"img-wrapper",children:o?a.jsx("a",{href:o,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),u&&a.jsx("small",{children:u})]},window.btoa(`${i.url}_${d}`))})})]})};const Bs=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],qs=({className:e="",content:t,image:n,variant:r="default",spacing:s="normal",hideElements:i={eyebrow:!1,title:!1,text:!1},cta:c,children:o})=>{const u=["eyebrow","title","text"],d={eyebrow:"small",title:"h1",text:"p"},f={};return u.forEach(l=>{if(!t[l]){f[l]=!1;return}if(!i[l]){if(typeof t[l]=="object"){f[l]=t[l];const{text:m,element:p}=t[l];if(p&&Bs.includes(p.toLowerCase()))return;f[l]={text:m,element:d[l]};return}f[l]={text:t[l],element:d[l]}}}),c&&c.link&&c.link[0]==="#"&&(c.props||(c.props={}),c.props.onClick=l=>{l.preventDefault(),l.stopPropagation();const m=document.getElementById(c.link.substring(1));m&&m.scrollIntoView({behavior:"smooth"})}),a.jsx(Ie,{className:E("banner-section",r,s,e,{"has-image":n,"has-extra-spacing":s==="normal"&&f.eyebrow&&f.title}),children:a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"content-wrapper",children:[u.map(l=>{if(f[l]&&typeof f[l]=="object"){const{text:m,element:p=""}=f[l];return l==="text"?a.jsx(kt,{overrideType:"text-only",className:"text",children:m},l):g.createElement(p,{key:l,className:l},m)}return null}),o,c&&c.text&&c.link&&a.jsx(X,{variant:n||r==="light"?"primary":"secondary",size:{mobile:"medium",768:"large"},href:c.link,...c.props,children:c.text})]}),n&&a.jsx(ct,{image:{...n,aspect:"banner"}})]})})},zs=g.memo(qs);const Hs=({alignImage:e="left",className:t,content:n,image:r})=>{const s=()=>typeof n=="string"?a.jsx(We,{children:n}):n;return a.jsxs(Ie,{className:E("highlight-section",t),children:[r&&a.jsx("div",{className:E("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:a.jsx(ct,{image:r})}),a.jsx("div",{className:E("highlight-container highlight-content-wrapper",{"no-image":!r}),children:a.jsx("div",{className:E("highlight-content",{"highlight-content-right":e==="left"}),children:s()})})]})},Us=g.memo(Hs);const Zs=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:s})=>!n&&!r?null:a.jsxs("aside",{className:E("marketing-block",e),children:[n&&a.jsx("p",{className:"title",children:n}),r&&a.jsx("p",{children:r}),t&&a.jsx(X,{variant:"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":s,"data-gtm-event-type":"learn-more-click",children:t.text})]}),Qr=({showDevTools:e=!0,children:t})=>{const n=new fe.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return a.jsxs(fe.QueryClientProvider,{client:n,children:[t,e&&a.jsx(is.ReactQueryDevtools,{initialIsOpen:!1})]})};var Ws=g.createContext({client:xt});function Vs(e){var t=e.children,n=e.client,r=e.apiKey,s=e.options,i=g.useMemo(function(){return n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&s&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n||(r&&(xt.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),xt.init(r,s)),xt)},[n,r]);return g.createElement(Ws.Provider,{value:{client:i}},t)}const Jr=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?a.jsx(Vs,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,disable_session_recording:!0,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id}},children:e}):e,Xr=({children:e,locale:t,messages:n})=>{const r=t||"en",s={...Ss[r],...n||{}};return a.jsx(I.IntlProvider,{locale:r,messages:s,children:e})},Ee=g.createContext({isLoading:!0});function Pt(){return g.useContext(Ee)}const ea=({children:e,user:t})=>a.jsx(Ee.Provider,{value:t,children:e}),Ys=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[s,i]=g.useState({isLoading:!0});return g.useEffect(()=>{e().then(c=>{i({...c,isLoading:!1}),Yr(5e3)}).catch(()=>i({isLoading:!1}))},[]),a.jsx(Xr,{locale:n==null?void 0:n.locale,messages:n==null?void 0:n.messages,children:a.jsx(Cn.CookiesProvider,{children:a.jsx(ea,{user:s,children:a.jsx(Qr,{showDevTools:r,children:a.jsx(Jr,{user:s,children:t})})})})})};const Rn=({label:e=!1,className:t="",children:n})=>{const r=I.useIntl();return a.jsxs("details",{className:E("collapsible-section",t),children:[a.jsx("summary",{children:e||r.formatMessage({id:"collapsibleSection_summary"})}),a.jsx("div",{className:"content",children:n})]})};const Re=({variant:e="primary",icon:t,className:n="",children:r,...s})=>{const i=t?{"--icon":`url(${Fe}icons/${t}.svg)`}:{};return a.jsx("div",{className:E("highlighted-text-box",e,n,{"has-icon":t}),style:i,...s,children:r})};const Oe=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let s=n&&!!Object.keys(n).length;const i=typeof n=="object"&&"breakpoints"in n,c=Ve(i);if(i&&typeof n=="object"&&typeof c=="number"){const l=Object.assign({},n.breakpoints),m=Ur(Object.keys(l));s=Zr(c,m,l)}const{breakpoints:o,text:u="",component:d,...f}=n;return a.jsx(Re,{variant:"subtle",className:E("empty-state-box",e,r),children:a.jsxs(a.Fragment,{children:[t&&a.jsx(We,{options:{forceBlock:!0},children:t}),s&&typeof n=="object"&&(d||a.jsx(X,{...f,variant:n.variant?n.variant:"secondary",children:u}))]})})};const bn=({children:e,...t})=>a.jsx("p",{...t,children:e}),ta={q:bn,blockquote:bn};for(let e=1;e<=6;e++)ta[`h${e}`]={component:bn,props:{className:"title"}};const na=({type:e="default",className:t="",heading:n=!1,children:r})=>a.jsxs("div",{className:E("helper-text-box text-small",e,t),children:[n&&a.jsx("p",{className:"title",children:n}),typeof r=="string"?a.jsx(We,{options:{wrapper:g.Fragment,forceBlock:!0,overrides:ta},children:r}):a.jsx("p",{children:r})]});const Gs=({className:e="",show:t=!1,hide:n=!1,text:r,children:s})=>{const i=I.useIntl(),c=g.useRef(null),[o,u]=g.useState(""),[d,f]=g.useState("closed");g.useEffect(()=>{const p=c.current;if(p)return p.addEventListener("transitionend",l),()=>{p.removeEventListener("transitionend",l)}},[]),g.useEffect(()=>{if(!r||typeof r!="string")return;const p=r.split(`
36
36
  `);u(p.length<3?`${r.substring(0,400)}...`:p.slice(0,3).join(`
37
- `))},[r]),g.useEffect(()=>{d==="ready-to-close"&&f("closing")},[d]);const l=({propertyName:p})=>{p==="max-height"&&f(_=>_==="opening"?"open":_==="closing"?"closed":_)};if(!r)return null;const m=["opening","open"].includes(d);return a.jsxs(Re,{variant:"subtle",className:E("hide-show-text-box",e),children:[a.jsxs("div",{ref:c,className:E("content",d),children:[a.jsx(We,{options:{forceBlock:!0},children:d==="closed"?o:r}),d!=="closed"&&s]}),a.jsx("p",{className:"cta",children:a.jsx(X,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:E({"rotate-180":m}),onClick:()=>{f(m?"ready-to-close":"opening")},children:m?n||i.formatMessage({id:"hideShowTextBox_hide"}):t||i.formatMessage({id:"hideShowTextBox_show"})})})]})},ge=()=>g.Fragment,Ks=({children:e})=>a.jsx(Re,{variant:"secondary",children:e}),Qs=["span","strong","h1","h2","h3","h4","h5","h6","p"],Js=({children:e})=>{const t=I.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const i of g.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number"))if(g.isValidElement(i)&&i.type==="summary"){if(i.props&&i.props.children){for(const c of g.Children.toArray(i.props.children))if(!(!c||typeof c=="string"||typeof c=="number")&&g.isValidElement(c)){const o=c.type;if(Qs.includes(o)){for(n=c.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(i);const s=n?n.toString():"";return a.jsx(Rn,{label:s,className:["Sources","Resources"].includes(s)?"discrete-links":"",children:r.map(i=>i)})},Xs=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return a.jsx(Re,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return a.jsx(Re,{variant:"primary",children:e});case"pink-textbox":return a.jsx(Re,{variant:"tertiary",children:e});default:return a.jsx("div",{...t,children:e})}return a.jsx("div",{...t,children:e})},ei=e=>{const t=I.useIntl(),n=Date.now().toString();let r="default";const s=e.src;return s.includes("youtube")||s.includes("vimeo")?r="video":s.includes("riddle")||s.includes("sli.do")?r="poll":s.includes("padlet")&&(r="padlet"),a.jsxs(a.Fragment,{children:[a.jsx(he,{children:a.jsx("a",{href:`#content-after-iframe-${n}`,children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})})}),a.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),a.jsx("span",{id:`content-after-iframe-${n}`,tabIndex:-1})]})},ur=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},ti=({children:e,...t})=>{let n={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(n.target="_blank");let r=e,s=!1;for(const i of g.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number")&&g.isValidElement(i)){const c=i.type;if(["button","center","span","strong"].includes(c)&&i.props&&i.props.children&&i.props.children[0])for((c==="button"||ur(i.props.children[0])==="button")&&(s=!0),r=i.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!g.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&ur(r)==="button"&&(s=!0);else break}return s?(n={...n,className:"button primary medium"},a.jsx("p",{className:"center",children:a.jsx(X,{variant:"primary",size:"medium",...n,children:r})})):a.jsx("a",{...n,children:r})},ra=({children:e})=>a.jsx("span",{children:e});const ni={default:{a:ti,CollapsibleSection:Rn,TextBox:Re,CaseStudy:Ks,style:ge,details:Js,div:Xs,iframe:ei},"text-only":{h1:ge,h2:ge,h3:ge,h4:ge,h5:ge,h6:ge,style:ge,details:ge,div:ge,TextBox:ge,CollapsibleSection:ge,CaseStudy:ge,blockquote:ge,iframe:ge,button:ge}},kt=({className:e="",options:t={},children:n,overrideType:r="default"})=>{n=n.replace(/^<br\/?>/,"");const s={wrapper:g.Fragment,forceBlock:!0,overrides:ni[r]};return a.jsx("div",{className:E("markdown-text",e),children:a.jsx(We,{options:{...s,...t},children:n})})};const aa=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:s=""})=>{const i=e?{"--max-width":`${e/16}rem`}:{};return a.jsxs("section",{className:E("page-heading",s),children:[a.jsxs("div",{className:E("content",{"has-max-width":e}),style:i,children:[t&&t.text&&g.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&g.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),r]})};const at=({size:e="medium",variant:t="default",className:n="",children:r,...s})=>a.jsx("span",{className:E("pill",e,t,n),...s,children:r});const st=({element:e="p",children:t=null,className:n="",...r})=>g.createElement(e,{...r,className:E("status-banner text-small",n),"aria-live":"assertive"},t);const ri=({author:e,authorCite:t,content:n})=>a.jsxs("blockquote",{className:"testimonial-block",children:[a.jsx(We,{className:"testimonial",children:n}),e&&a.jsx("p",{className:"author text-small",children:e}),t&&a.jsx("p",{className:"author-cite text-small",children:a.jsx("cite",{children:t})})]}),ai=g.memo(ri);const si=({progress:e=0,text:t=!1,className:n=""})=>{const r=I.useIntl(),s=e>75?100:e>50?75:e>25?50:e>5?25:0,i={"--progress":`${e}%`};return a.jsx("span",{className:E(`progress-bar section-${s}`,n),style:i,children:a.jsx(he,{children:t?`${e} ${t}`:r.formatMessage({id:"progressBar"},{number:e})})})},sa=g.memo(si);const Vt="loadingBlock_",ii=({progress:e=0,steps:t=!1,className:n=""})=>{const r=I.useIntl();t||(t={0:{text:r.formatMessage({id:`${Vt}loading`})},75:{text:r.formatMessage({id:`${Vt}almostDone`})},100:{text:r.formatMessage({id:`${Vt}complete`})}});let s=null;const i=Object.keys(t);for(let o=0;o<i.length&&!(e<parseInt(i[o]));o++)s=i[o];const c=s&&t[s].icon?{"--icon":`url(${Fe}icons/${t[s].icon}.svg)`}:{};return a.jsxs(Re,{className:E("loading-block",n,{"has-icon":s&&t[s].icon}),variant:"subtle",style:c,children:[s&&a.jsx("span",{className:"step",children:t[s].text}),a.jsx(sa,{progress:e})]})},oi=g.memo(ii);const xe=({element:e="div",className:t="",...n})=>a.jsx(Rt,{element:e,className:E("loading-placeholder",t),...n});const yn={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],heading:["title"],cards:["card","card","card","card"],carousel:["cards","controls"],"carousel-with-title":["title","cards","controls"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"]},ia=(e,t)=>e in yn?a.jsx("div",{className:e,children:yn[e].map((n,r)=>ia(n,r))},t):a.jsx(xe,{className:e},t),Pn=({layout:e="overview-page",...t})=>a.jsx("div",{className:E("loading-state",e),...t,children:yn[e].map((n,r)=>ia(n,r))}),oa=e=>{const t=e&&e.toUpperCase().split(" ");return Array.isArray(t)&&t.length>1&&t[0]!==""?t[1]===""?t[0][0]:t[0][0]+t[t.length-1][0]:e?e.substr(0,1):""},ft=["#5AB6A3","#A2D7AF","#806056","#3962B3"],ci=e=>{const t=Math.ceil(26/ft.length),n=oa(e).toLowerCase();if(n==="")return ft[0];const r=n.charCodeAt(0)-96;for(let s=0;s<ft.length;s++)if(r<=t*(s+1))return ft[s]};const fr=256,Ge=({className:e="",src:t="",name:n,alt:r,width:s=fr,height:i=fr,...c})=>{const[o,u]=g.useState(!1),d=g.useRef(null);g.useEffect(()=>{const l=d.current;if(!l)return;const m=l.getContext("2d");if(!m)return;const p=s,_=i;typeof window<"u"&&window.devicePixelRatio&&(l.width=p*window.devicePixelRatio,l.height=_*window.devicePixelRatio,m.scale(window.devicePixelRatio,window.devicePixelRatio)),m.fillStyle=ci(n),m.fillRect(0,0,p,_),m.font=`${p/3}px Arial`,m.textAlign="center",m.fillStyle="white",m.fillText(oa(n),p/2,_/1.6)},[n]);let f=!1;return t&&t!==""&&!o&&(t.includes("http")||t.includes("//"))&&(f=!0),a.jsx("figure",{className:E("profile-picture",e,{error:o}),...c,children:f?a.jsx("img",{src:t,alt:r||n,onError:()=>{u(!0)},width:s,height:i}):a.jsx("canvas",{ref:d})})},Nn=e=>e==="apolitical"?{image:`${Fe}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${Fe}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.country||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail},li=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const s=e!=="",i=t!=="",c=n!=="";if(!s&&!i&&!c)return"";const o=`${e}${s&&i?` — ${t}`:t}`;let u=`${o}${(s||i)&&c?`, ${n}`:n}`;return u.length>r&&(u=o),u.length>r&&(u=He(u,r)),u};const Nt=({element:e="div",member:t="community",additionalContent:n=!1,gtmContext:r="member",gtmType:s="member-click",className:i=""})=>{const c=I.useIntl(),o=Nn(t);o.name||(o.name=c.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:u,url:d,image:f}=o,l=li(o),m=n&&n.createdAt?vn(n.createdAt):!1,p=n&&n.createdAt?Wr(n.createdAt):"";return g.createElement(e,{className:E("member text-medium",i),children:a.jsxs(Ye,{href:d,gtmType:s,gtmContext:r,onClick:_=>{_==null||_.stopPropagation()},children:[a.jsx(Ge,{name:u,src:f}),a.jsxs("p",{className:"details",children:[a.jsx("strong",{children:u}),n&&a.jsxs("span",{className:"additional-content",children:[n.createdAt&&m&&a.jsx("span",{className:"date",title:p,"aria-label":p,children:c.formatMessage({id:`dates_${m.path}`},{number:m.number})}),n.didEdit&&a.jsx("em",{children:c.formatMessage({id:"discussion_edited"})})]}),l&&a.jsx("small",{children:l})]})]})})};const mr={small:24,medium:48},An=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:s,showGap:i,showPlaceholders:c}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,className:u="",...d})=>{const f=I.useIntl();return!n||n.length===0?null:g.createElement(e,{...d,className:E("contributors",u,s,{"has-gap":i}),children:a.jsxs(a.Fragment,{children:[a.jsx("ul",{children:n.map((l,m)=>{let p,_="";if(m<o){const{name:v="",image:b=""}=Nn(l);if(c)return a.jsx(xe,{element:"li",className:"contributor"},m);p=a.jsx(Ge,{name:v,src:b,width:mr[s||"medium"],height:mr[s||"medium"]})}else if(m===o){const v=(t||n.length)-o;p=a.jsxs("small",{className:E({"large-number":v>99}),children:["+",Cs(v,0)]}),_="number-left"}return p?a.jsx("li",{className:E("contributor",_),children:p},m):null})}),r&&a.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?f.formatMessage({id:`member_${n[0]}`}):He(n[0].name||"",20):null})]})})},di=({type:e,data:t})=>{const n=I.useIntl(),{answers:r,createdAt:s,dateHasPassed:i,isOngoingEvent:c,pill:o,readingTime:u,publishedDate:d,startDate:f}=t;if(e==="question"){const l=s&&vn(s);return a.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),s&&a.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:l?n.formatMessage({id:`dates_${l.path}`},{number:l.number}):0})]})]})}if(f&&!i||c)return a.jsx("p",{className:"details",children:c?n.formatMessage({id:"card_bootcamp"}):Wr(f)});if(o)return a.jsx(at,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(u||d){const l=d&&vn(d);return a.jsxs("ul",{className:"details",children:[u&&a.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:u})}),d&&a.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:l?n.formatMessage({id:`dates_${l.path}`},{number:l.number}):0})})]})}return null},Tt={customCard:{className:"custom",gtmEvent:"custom",length:{text:335,secondaryText:150}},event:{basePath:"/events/",className:"event",gtmEvent:"event"},microcourse:{basePath:"/microcourses/en/",className:"course",gtmEvent:"microcourse-overview"},solutionArticle:{basePath:"/solution-articles/en/",className:"article",length:{title:60},gtmEvent:"article"},qaQuestion:{basePath:"/questions-answers/",className:"question",length:{title:190},gtmEvent:"q-and-a-question"},listPage:{basePath:"/list/en/",className:"list",gtmEvent:"list"},people:{basePath:"/profiles/",className:"people",length:{people:1e3},gtmEvent:"person"},learningHub:{basePath:"/learning-hub/",className:"learning-hub",length:{title:190},gtmEvent:"learning-hub"}},ui=({data:e,cta:t,link:n,gtmContext:r})=>{var _;const s=I.useIntl(),[i,c]=g.useState({loading:!1,registered:e.registered||!1});g.useEffect(()=>{e.registered&&c(v=>({...v,registered:!0}))},[e.registered]);const{startDate:o,dateHasPassed:u,pill:d,slug:f}=e,l=e.contentType;let m="";if((_=Tt[l])!=null&&_.gtmEvent&&(m=Tt[l].gtmEvent),o&&u)return a.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${m}-click`,children:s.formatMessage({id:"card_watch"})});if(l==="people")return a.jsx(X,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${m}-click`,children:s.formatMessage({id:"card_cta_people"})});const p=["microcourse","event"];if(t&&t.onClick&&p.includes(l)&&d!=="premium"){const v=i.loading||i.registered,b=async y=>{if(y.preventDefault(),y.stopPropagation(),!(v||!t||!t.onClick)){c(x=>({...x,loading:!0}));try{const x=await t.onClick(e);c(x==="success"?()=>({registered:!0,loading:!1}):k=>({...k,loading:!1}))}catch{c(k=>({...k,loading:!1}))}}};return a.jsx(X,{onClick:b,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:v,"data-gtm-event-context":`${r}Page-${l}: ${f}`,"data-gtm-event-type":`${r}-${l}-register-click`,"data-testid":"in-card-button",children:s.formatMessage({id:`card_cta_${l}${v?`_${i.loading?"loading":"done"}`:""}`})})}return null},pr={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},fi=e=>{let t=e;return Object.keys(pr).includes(e)&&(t=pr[e]),`url(${Fe}icons/${t}.svg)`};const mi={title:66,text:3e3,secondaryText:1e3,partner:25},Fn=({id:e="",card:t,buildCardData:n,cta:r,gtmContext:s="Carousel",className:i=""})=>{const c=I.useIntl(),o=g.useContext(Ee),u=o&&typeof o.id=="string",[d,f]=g.useState({data:null,isLoading:!0}),{data:l,isLoading:m}=d,p=g.useCallback(()=>{n(t,u).then(S=>{f(()=>({data:S,isLoading:!1}))}).catch(()=>f(S=>({...S,isLoading:!1})))},[e]);if(g.useEffect(()=>{p()},[]),m||!l)return a.jsx(xe,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});const{contentType:_}=l;if(!_||!Tt[_])return a.jsx(xe,{element:"li",className:"card-wrapper"});const{basePath:v="",className:b,length:y,gtmEvent:x}=Tt[_],k=Vr(`card_label_${_}`)?c.formatMessage({id:`card_label_${_}`}):!1,j=l.slug?`${v}${l.slug}`:!1,w={...mi,...y};let O={className:"card"};j&&(O={href:j,className:"card gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${x}-click`,"data-testid":"link"},l.openInNewTab&&(O.target="_blank"));const M=l.customIcon?{"--custom-icon":fi(l.customIcon)}:{};return a.jsx("li",{className:E("card-wrapper text-medium",b,i,{"has-link":j,"no-link":!j,"has-custom-icon":l.customIcon,"has-image":l.banner}),style:M,"data-testid":`${_}-card`,children:g.createElement(j?"a":"div",O,a.jsxs(a.Fragment,{children:[(l.customLabel||k)&&a.jsx("small",{className:E("card-label text-small",b),children:l.customLabel||k}),l.startDate&&!l.isOngoingEvent&&a.jsx(at,{size:"small",variant:l.dateHasPassed?"default":"information","data-testid":"date",children:l.dateHasPassed?c.formatMessage({id:"card_ended"}):xs(l.startDate)}),l.banner?a.jsxs("p",{className:"img",children:[l.registered&&a.jsx(at,{size:"small",variant:"registered",children:c.formatMessage({id:"card_registered"})}),a.jsx(ct,{image:l.banner})]}):b==="people"?a.jsx(Ge,{name:l.title||"",src:l.profile,"data-testid":"people-profile-picture"}):null,l.contributors&&a.jsx(An,{contributors:{data:l.contributors},styling:{size:"small",showGap:b!=="question",showText:!0},"data-testid":"contributors"}),l.partner&&a.jsx("p",{className:"partners","data-testid":"partners",children:He(l.partner.title,w.partner)}),["title","text","secondaryText"].map(S=>{const A=l[S];if(!A)return null;const F=vs(S);return a.jsx("p",{className:F,"data-testid":F,children:He(A,w[S])},S)}),a.jsx(di,{type:b||"",data:l}),a.jsx(ui,{data:l,cta:r,link:j||"",gtmContext:s})]}))})};const ca=({cards:e,cardTypes:t,className:n="",...r})=>a.jsx("ul",{className:E("card-block",n),children:e.map((s,i)=>{const c=s.slug?`${s.slug}-${t[i]}`:`${t[i]}-${i}`;return a.jsx(Fn,{id:c,card:{...s,contentType:t[i]},...r},c)})}),pi=(e,t,n,r)=>{const s=t*n<=e,i=e<t*(n+1),c=r.includes(Math.floor(e/t));return s&&i||c},hi=({id:e,title:t})=>{const n=I.useIntl();if(!t||!t.text)return null;const{text:r,element:s="h2",variant:i="default",size:c="medium",link:o}=t;return g.createElement(s,{className:E("title",i,c,{"highlighted-title":i==="highlighted"}),children:a.jsxs(a.Fragment,{children:[r,o&&a.jsx("a",{href:o,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${e||window.btoa(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const Yt={fourCards:1024,threeCards:769,twoCards:480};let mt=null;const gi=({id:e,cards:t,cardTypes:n,buildCardData:r,title:s,className:i,gtmContext:c})=>{const o=I.useIntl(),[u,d]=g.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:f,isLoading:l}=u,[m,p]=g.useState({currentPage:0,loadedPages:[0]}),{currentPage:_,loadedPages:v}=m,b=t.length,y=Math.ceil(b/f),x=g.useRef(null),k=Ve(!0,!0,x==null?void 0:x.current);g.useEffect(()=>{let S=1;k&&(k>=Yt.fourCards?S=4:k>=Yt.threeCards?S=3:k>=Yt.twoCards&&(S=2),S>b&&(S=b)),d(A=>({...A,cardsPerPage:S,isLoading:!1}))},[k,b]);const j=(S="next")=>{let A=_;if(typeof S=="string")if(S==="next")if(_<y-1)A=_+1;else return;else if(_>0)A=_-1;else return;else A=S;p(F=>({...F,currentPage:A,loadedPages:[...new Set([...v,A])]}))},w=S=>{mt=S.touches[0].clientX},O=S=>{if(mt===null)return;const A=S.touches[0].clientX,F=mt-A;F>5?j("next"):F<-5&&j("previous"),mt=null},M={"--width":`${k||0}px`,"--total-cards":b,"--cards-per-page":f,"--page":_};return l?a.jsx(Pn,{layout:`carousel${s?"-with-title":""}`}):a.jsxs("section",{ref:x,className:E("carousel-wrapper",i),"data-testid":"carousel",children:[a.jsx(hi,{id:e,title:s}),a.jsx("ul",{className:"carousel",onTouchStart:w,onTouchMove:O,style:M,"data-testid":"carousel-list",children:t.map((S,A)=>{let F=S&&S.sys&&S.sys.id?`${e}-card-${S.sys.id}`:null;return F&&pi(A,f,_,v)?a.jsx(Fn,{id:F,card:{...S,contentType:n[A]},buildCardData:r,gtmContext:c},F):(F=F||`${e}-card-${A}`,a.jsx(xe,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},F))})}),y<=1?null:a.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[a.jsx("li",{className:"arrow previous",children:a.jsx(X,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:S=>{S.preventDefault(),S.stopPropagation(),j("previous")},screenreaderText:o.formatMessage({id:"carousel_pagination_previous"}),disabled:_<=0})}),[...Array(y)].map((S,A)=>a.jsx("li",{"data-testid":"carousel-controls-button",children:a.jsx("button",{className:E("page-indicator",{selected:A===_}),onClick:F=>{F.preventDefault(),F.stopPropagation(),j(A)},children:a.jsx(he,{showOnFocus:!1,children:o.formatMessage({id:"carousel_pagination_page"},{number:A+1,total:y})})})},`page-indicator-${A}`)),a.jsx("li",{className:"arrow next",children:a.jsx(X,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:S=>{S.preventDefault(),S.stopPropagation(),j("next")},screenreaderText:o.formatMessage({id:"carousel_pagination_next"}),disabled:_>=y-1})})]})]})},_i=({carousels:e=[],isLoading:t,title:n,className:r="",...s})=>!e||!e.length?null:e.map(({title:i,viewAllUrl:c,cards:o,cardsTypes:u},d)=>{const f=i?window.btoa(i):`carousel-${d}`,l=d===e.length-1;return t?a.jsxs(g.Fragment,{children:[a.jsx(Pn,{layout:`carousel${i?"-with-title":""}`,"data-testid":"carousel-placeholder"}),l?null:a.jsx(Te,{})]},`placeholder-${f}`):a.jsxs(g.Fragment,{children:[a.jsx(gi,{cards:o,cardTypes:u,title:{...n,text:i,link:c},...s}),l?null:a.jsx(Te,{})]},`carousel-${f}`)});const Gt="joinCommunityButton",In=({isMember:e=!1,isShort:t=!1,functions:{join:n,leave:r}={join:()=>{},leave:()=>{}}})=>{const s=I.useIntl(),i=g.useContext(Ee),c=i&&typeof i.id=="string",[o,u]=g.useState(e),[d,f]=g.useState(e?"joined":"notJoined");g.useEffect(()=>{d==="joining"?f("joined"):d==="leaving"&&f("notJoined")},[o]);const l={},m={};return o&&d!=="leaving"&&(l["data-hover-text"]=s.formatMessage({id:`${Gt}_leave`}),l["aria-label"]=s.formatMessage({id:`${Gt}_member_aria`}),m["aria-hidden"]="true"),a.jsx(X,{variant:o?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:o&&d!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async p=>{c&&(p.currentTarget.blur(),o?(f("leaving"),typeof r=="function"&&await r()):(f("joining"),typeof n=="function"&&await n()),u(!o))},className:E("join-community-button",d,{active:d==="joining"}),disabled:!c,...l,children:a.jsx("span",{className:"text",...m,children:s.formatMessage({id:`${Gt}${["joining","leaving"].includes(d)?`_${d}`:o?"_member":t?"_short":""}`})})})};const Kt="communityDetails_",vi=({className:e="",isMember:t=!1,slug:n,members:{number:r=0,data:s=[]}={number:0,data:[]},functions:{invite:i,...c}})=>{const o=I.useIntl(),u=5,d=r||s.length,f=s.length?s:Array(u).fill({}),l=`/communities/${n}/members`===window.location.pathname;return a.jsxs("div",{className:E("community-details",e),children:[a.jsx(Te,{}),a.jsxs("div",{className:"member-details",children:[a.jsxs("div",{className:"top",children:[a.jsxs("h4",{children:[o.formatMessage({id:`${Kt}members`}),a.jsx("span",{className:"count",children:d})]}),!l&&a.jsx("p",{className:"text-small",children:a.jsx("a",{href:`/communities/${n}/members`,children:o.formatMessage({id:`${Kt}viewAll`})})})]}),a.jsx(An,{contributors:{total:r,data:f},styling:{size:"medium",showGap:!0,showPlaceholders:d===0},cutoff:u})]}),a.jsx(In,{isMember:t,functions:{...c}}),t&&a.jsx(X,{variant:"primary",onClick:i,icon:{icon:"plus"},styling:{fullWidth:!0},children:o.formatMessage({id:`${Kt}invite`})})]})};const bi=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=I.useIntl();return a.jsxs(a.Fragment,{children:[a.jsx(he,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),a.jsx("ul",{className:E("breadcrumbs text-small",n),children:e.map(({text:s,href:i,current:c=!1},o)=>a.jsxs("li",{children:[c&&a.jsx(he,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),a.jsx(Ye,{href:c?void 0:i,children:He(s,t)})]},`${window.btoa(s)}_${o}`))})]})};const yi=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:s=""})=>{const i=I.useIntl(),c=t?[{id:"all",text:typeof t!="boolean"&&t.text||i.formatMessage({id:"filters_all"})},...e]:e,[o,u]=g.useState(t?["all"]:[]),d=(f,l)=>{let m=[];o.includes(f)?m=o.filter(p=>p!==f):f==="all"?m=["all"]:n?m=[...o.filter(p=>p!=="all"),f]:m=[f],u(p=>(r&&typeof r=="function"&&r({current:m,previous:p}),m)),l&&typeof l=="function"&&l()};return a.jsx("ul",{className:E("filters",s),children:c.map(({id:f,text:l,disabled:m=!1,callback:p=()=>{}})=>{let _={};return m&&(_={disabled:!0,"aria-label":i.formatMessage({id:"filters_disabled"},{name:l})}),a.jsx("li",{children:a.jsx("button",{className:E(f,{selected:o.includes(f)}),onClick:v=>{v.preventDefault(),v.stopPropagation(),d(f,p)},..._,children:l})},f)})})},xi=(e,t)=>{const n=String(e);if(!t||!t.length)return`/${n}`;let r="";return t.forEach(({url:s,position:i})=>{i==="before-lang"?r+=`/${s}`:(r.includes(`/${n}/`)||(r+=`/${n}`),r+=`/${s}`)}),r.includes(`/${n}/`)||(r+=`/${n}`),r};const Qt={en:"English",es:"Español",fr:"Français",pt:"Português"},pt="languageSwitcher_",wi=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:s=()=>{},urlParts:i,variant:c="default",label:o,className:u=""})=>{const d=I.useIntl(),[f,l]=g.useState(e);if(g.useEffect(()=>{e!==f&&l(e)},[e]),!r||!Object.values(r).some(v=>v&&v.post_name))return null;const p=Object.keys(r),_=f!==e;return a.jsxs("div",{className:E("language-switcher text-small",c,u),children:[a.jsxs("nav",{children:[c!=="short"&&a.jsx("p",{children:o||d.formatMessage({id:`${pt}label`})}),a.jsx("ul",{children:p.map(v=>{if(!Qt[v])return null;let b={className:v};return f===v?b["aria-label"]=d.formatMessage({id:`${pt}selected`},{language:Qt[v]}):b={...b,href:xi(v,i),onClick:y=>{y.preventDefault(),y.stopPropagation(),l(v),s(v)}},a.jsx("li",{children:a.jsx(Ye,{...b,fallbackElement:"span",children:Qt[v]})},v)})}),c!=="short"&&!_&&a.jsx("p",{children:d.formatMessage({id:`${pt}translation_${t?"original":n?"human":"machine"}`})})]}),c!=="short"&&!_&&!t&&!n&&a.jsx("small",{children:d.formatMessage({id:`${pt}disclaimer`},{email:qe.support,link:v=>{const b=`mailto:${v}`;return a.jsx("a",{href:b,children:v})}})})]})};const Jt=I.createIntl({locale:"en",messages:Mn}),lt=({hasNextPage:e=!0,loadNextPage:t=()=>{},variant:n="secondary",size:r="medium",styling:s={muted:!1,fullWidth:!1},icon:i=!1,messages:c={button:Jt.formatMessage({id:"loadMore_button"}),endOfFeed:Jt.formatMessage({id:"loadMore_endOfFeed"}),error:Jt.formatMessage({id:"loadMore_error"})},className:o="",gtmContext:u="LoadMore"})=>{const[d,f]=g.useState(""),l=async m=>{try{await t(m)}catch(p){p instanceof Error?f(p.message):f("Unknown error")}};return!d&&!e&&!c.endOfFeed?null:a.jsx("footer",{className:E("load-more",o),children:!d&&e?a.jsx(X,{variant:n,size:r,styling:s,icon:i,onClick:l,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:c.button}):c.endOfFeed&&(!d||d!=null&&d.includes("Cannot read items"))?a.jsx("p",{children:c.endOfFeed}):d&&a.jsx("p",{className:"error",children:c.error})})};const On=({variant:e="default",version:t="default",className:n="",...r})=>a.jsx("p",{className:"logo-wrapper",children:a.jsx("a",{href:"/home/",className:E("logo",e,t,n),...r,children:a.jsx(he,{children:a.jsx(I.FormattedMessage,{id:"apolitical"})})})});let ht=!1;const la=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const s=I.useIntl(),i=g.useRef(null),[c,o]=g.useState(!1),u=d=>{i.current&&d.target instanceof HTMLElement&&!i.current.contains(d.target)&&o(!1)};return g.useEffect(()=>(document.addEventListener("click",u,!0),()=>{document.removeEventListener("click",u,!0)})),g.createElement(e,{ref:i,className:E("more-menu text-medium",r),children:a.jsxs(a.Fragment,{children:[a.jsx(X,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>o(!c),"aria-haspopup":"true","aria-expanded":c,"aria-controls":t,screenreaderText:s.formatMessage({id:"moreMenu"})}),a.jsx("ul",{id:t,hidden:!c,children:n.map(({href:d,onClick:f,text:l,icon:m,...p},_)=>{const v={...p,onClick:b=>{o(!1),typeof f=="function"&&f(b)},onFocus:()=>{ht&&(clearTimeout(ht),ht=!1)},onBlur:()=>{ht=setTimeout(()=>{o(!1)},100)}};return d&&(v.href=d),a.jsx("li",{children:a.jsx(X,{variant:"tertiary",size:"medium",icon:m?{icon:m,position:"left"}:!1,...v,children:l})},`${window.btoa(l)}_${_}`)})})]})})},ji=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const ki=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"}],da=({activeLink:e})=>{const t=I.useIntl(),n=g.useContext(Ee),r=n&&typeof n.id=="string";return a.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[ki.map(({key:s,href:i})=>a.jsx("li",{className:E(s,{active:ji(i,e)}),children:a.jsx("a",{href:i,"data-gtm-event-type":`${s}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:t.formatMessage({id:`navigationMenu_links_${s}`})})},s)),r&&a.jsx("li",{className:"profile","data-testid":"profile-link",children:a.jsxs("a",{href:"/profiles/me","data-gtm-event-type":"profile-click","data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:[a.jsx(Ge,{name:(n==null?void 0:n.name)||"",src:n!=null&&n.image?n.image.thumbnail:""}),a.jsx("span",{children:t.formatMessage({id:"navigationMenu_profile"})})]})})]})},et=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,Ti=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${et(t,"linkedin",n)}&src=linkedin`)}&title=${encodeURIComponent(e)}&source=Apolitical`},{key:"twitter",icon:"social_twitter",url:`https://twitter.com/share?ref_src=twsrc%5Etfw&url=${encodeURIComponent(`${et(t,"twitter",n)}&src=twitter`)}&text=${encodeURIComponent(e)}&via=${encodeURIComponent("apoliticalco")}`},{key:"facebook",icon:"social_facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(`${et(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
37
+ `))},[r]),g.useEffect(()=>{d==="ready-to-close"&&f("closing")},[d]);const l=({propertyName:p})=>{p==="max-height"&&f(_=>_==="opening"?"open":_==="closing"?"closed":_)};if(!r)return null;const m=["opening","open"].includes(d);return a.jsxs(Re,{variant:"subtle",className:E("hide-show-text-box",e),children:[a.jsxs("div",{ref:c,className:E("content",d),children:[a.jsx(We,{options:{forceBlock:!0},children:d==="closed"?o:r}),d!=="closed"&&s]}),a.jsx("p",{className:"cta",children:a.jsx(X,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:E({"rotate-180":m}),onClick:()=>{f(m?"ready-to-close":"opening")},children:m?n||i.formatMessage({id:"hideShowTextBox_hide"}):t||i.formatMessage({id:"hideShowTextBox_show"})})})]})},ge=()=>g.Fragment,Ks=({children:e})=>a.jsx(Re,{variant:"secondary",children:e}),Qs=["span","strong","h1","h2","h3","h4","h5","h6","p"],Js=({children:e})=>{const t=I.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const i of g.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number"))if(g.isValidElement(i)&&i.type==="summary"){if(i.props&&i.props.children){for(const c of g.Children.toArray(i.props.children))if(!(!c||typeof c=="string"||typeof c=="number")&&g.isValidElement(c)){const o=c.type;if(Qs.includes(o)){for(n=c.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(i);const s=n?n.toString():"";return a.jsx(Rn,{label:s,className:["Sources","Resources"].includes(s)?"discrete-links":"",children:r.map(i=>i)})},Xs=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return a.jsx(Re,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return a.jsx(Re,{variant:"primary",children:e});case"pink-textbox":return a.jsx(Re,{variant:"tertiary",children:e});default:return a.jsx("div",{...t,children:e})}return a.jsx("div",{...t,children:e})},ei=e=>{const t=I.useIntl(),n=Date.now().toString();let r="default";const s=e.src;return s.includes("youtube")||s.includes("vimeo")?r="video":s.includes("riddle")||s.includes("sli.do")?r="poll":s.includes("padlet")&&(r="padlet"),a.jsxs(a.Fragment,{children:[a.jsx(he,{children:a.jsx("a",{href:`#content-after-iframe-${n}`,children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})})}),a.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),a.jsx("span",{id:`content-after-iframe-${n}`,tabIndex:-1})]})},ur=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},ti=({children:e,...t})=>{let n={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(n.target="_blank");let r=e,s=!1;for(const i of g.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number")&&g.isValidElement(i)){const c=i.type;if(["button","center","span","strong"].includes(c)&&i.props&&i.props.children&&i.props.children[0])for((c==="button"||ur(i.props.children[0])==="button")&&(s=!0),r=i.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!g.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&ur(r)==="button"&&(s=!0);else break}return s?(n={...n,className:"button primary medium"},a.jsx("p",{className:"center",children:a.jsx(X,{variant:"primary",size:"medium",...n,children:r})})):a.jsx("a",{...n,children:r})},ra=({children:e})=>a.jsx("span",{children:e});const ni={default:{a:ti,CollapsibleSection:Rn,TextBox:Re,CaseStudy:Ks,style:ge,details:Js,div:Xs,iframe:ei},"text-only":{h1:ge,h2:ge,h3:ge,h4:ge,h5:ge,h6:ge,style:ge,details:ge,div:ge,TextBox:ge,CollapsibleSection:ge,CaseStudy:ge,blockquote:ge,iframe:ge,button:ge}},kt=({className:e="",options:t={},children:n,overrideType:r="default"})=>{n=n.replace(/^<br\/?>/,"");const s={wrapper:g.Fragment,forceBlock:!0,overrides:ni[r]};return a.jsx("div",{className:E("markdown-text",e),children:a.jsx(We,{options:{...s,...t},children:n})})};const aa=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:s=""})=>{const i=e?{"--max-width":`${e/16}rem`}:{};return a.jsxs("section",{className:E("page-heading",s),children:[a.jsxs("div",{className:E("content",{"has-max-width":e}),style:i,children:[t&&t.text&&g.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&g.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),r]})};const at=({size:e="medium",variant:t="default",className:n="",children:r,...s})=>a.jsx("span",{className:E("pill",e,t,n),...s,children:r});const st=({element:e="p",children:t=null,className:n="",...r})=>g.createElement(e,{...r,className:E("status-banner text-small",n),"aria-live":"assertive"},t);const ri=({author:e,authorCite:t,content:n})=>a.jsxs("blockquote",{className:"testimonial-block",children:[a.jsx(We,{className:"testimonial",children:n}),e&&a.jsx("p",{className:"author text-small",children:e}),t&&a.jsx("p",{className:"author-cite text-small",children:a.jsx("cite",{children:t})})]}),ai=g.memo(ri);const si=({progress:e=0,text:t=!1,className:n=""})=>{const r=I.useIntl(),s=e>75?100:e>50?75:e>25?50:e>5?25:0,i={"--progress":`${e}%`};return a.jsx("span",{className:E(`progress-bar section-${s}`,n),style:i,children:a.jsx(he,{children:t?`${e} ${t}`:r.formatMessage({id:"progressBar"},{number:e})})})},sa=g.memo(si);const Vt="loadingBlock_",ii=({progress:e=0,steps:t=!1,className:n=""})=>{const r=I.useIntl();t||(t={0:{text:r.formatMessage({id:`${Vt}loading`})},75:{text:r.formatMessage({id:`${Vt}almostDone`})},100:{text:r.formatMessage({id:`${Vt}complete`})}});let s=null;const i=Object.keys(t);for(let o=0;o<i.length&&!(e<parseInt(i[o]));o++)s=i[o];const c=s&&t[s].icon?{"--icon":`url(${Fe}icons/${t[s].icon}.svg)`}:{};return a.jsxs(Re,{className:E("loading-block",n,{"has-icon":s&&t[s].icon}),variant:"subtle",style:c,children:[s&&a.jsx("span",{className:"step",children:t[s].text}),a.jsx(sa,{progress:e})]})},oi=g.memo(ii);const xe=({element:e="div",className:t="",...n})=>a.jsx(Rt,{element:e,className:E("loading-placeholder",t),...n});const yn={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],heading:["title"],cards:["card","card","card","card"],carousel:["cards","controls"],"carousel-with-title":["title","cards","controls"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"]},ia=(e,t)=>e in yn?a.jsx("div",{className:e,children:yn[e].map((n,r)=>ia(n,r))},t):a.jsx(xe,{className:e},t),Pn=({layout:e="overview-page",...t})=>a.jsx("div",{className:E("loading-state",e),...t,children:yn[e].map((n,r)=>ia(n,r))}),oa=e=>{const t=e&&e.toUpperCase().split(" ");return Array.isArray(t)&&t.length>1&&t[0]!==""?t[1]===""?t[0][0]:t[0][0]+t[t.length-1][0]:e?e.substr(0,1):""},ft=["#5AB6A3","#A2D7AF","#806056","#3962B3"],ci=e=>{const t=Math.ceil(26/ft.length),n=oa(e).toLowerCase();if(n==="")return ft[0];const r=n.charCodeAt(0)-96;for(let s=0;s<ft.length;s++)if(r<=t*(s+1))return ft[s]};const fr=256,Ge=({className:e="",src:t="",name:n,alt:r,width:s=fr,height:i=fr,...c})=>{const[o,u]=g.useState(!1),d=g.useRef(null);g.useEffect(()=>{const l=d.current;if(!l)return;const m=l.getContext("2d");if(!m)return;const p=s,_=i;typeof window<"u"&&window.devicePixelRatio&&(l.width=p*window.devicePixelRatio,l.height=_*window.devicePixelRatio,m.scale(window.devicePixelRatio,window.devicePixelRatio)),m.fillStyle=ci(n),m.fillRect(0,0,p,_),m.font=`${p/3}px Arial`,m.textAlign="center",m.fillStyle="white",m.fillText(oa(n),p/2,_/1.6)},[n]);let f=!1;return t&&t!==""&&!o&&(t.includes("http")||t.includes("//"))&&(f=!0),a.jsx("figure",{className:E("profile-picture",e,{error:o}),...c,children:f?a.jsx("img",{src:t,alt:r||n,onError:()=>{u(!0)},width:s,height:i}):a.jsx("canvas",{ref:d})})},Nn=e=>e==="apolitical"?{image:`${Fe}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${Fe}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.country||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail},li=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const s=e!=="",i=t!=="",c=n!=="";if(!s&&!i&&!c)return"";const o=`${e}${s&&i?` — ${t}`:t}`;let u=`${o}${(s||i)&&c?`, ${n}`:n}`;return u.length>r&&(u=o),u.length>r&&(u=He(u,r)),u};const Nt=({element:e="div",member:t="community",additionalContent:n=!1,gtmContext:r="member",gtmType:s="member-click",className:i=""})=>{const c=I.useIntl(),o=Nn(t);o.name||(o.name=c.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:u,url:d,image:f}=o,l=li(o),m=n&&n.createdAt?vn(n.createdAt):!1,p=n&&n.createdAt?Wr(n.createdAt):"";return g.createElement(e,{className:E("member text-medium",i),children:a.jsxs(Ye,{href:d,gtmType:s,gtmContext:r,onClick:_=>{_==null||_.stopPropagation()},children:[a.jsx(Ge,{name:u,src:f}),a.jsxs("p",{className:"details",children:[a.jsx("strong",{children:u}),n&&a.jsxs("span",{className:"additional-content",children:[n.createdAt&&m&&a.jsx("span",{className:"date",title:p,"aria-label":p,children:c.formatMessage({id:`dates_${m.path}`},{number:m.number})}),n.didEdit&&a.jsx("em",{children:c.formatMessage({id:"discussion_edited"})})]}),l&&a.jsx("small",{children:l})]})]})})};const mr={small:24,medium:48},An=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:s,showGap:i,showPlaceholders:c}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,className:u="",...d})=>{const f=I.useIntl();return!n||n.length===0?null:g.createElement(e,{...d,className:E("contributors",u,s,{"has-gap":i}),children:a.jsxs(a.Fragment,{children:[a.jsx("ul",{children:n.map((l,m)=>{let p,_="";if(m<o){const{name:v="",image:b=""}=Nn(l);if(c)return a.jsx(xe,{element:"li",className:"contributor"},m);p=a.jsx(Ge,{name:v,src:b,width:mr[s||"medium"],height:mr[s||"medium"]})}else if(m===o){const v=(t||n.length)-o;p=a.jsxs("small",{className:E({"large-number":v>99}),children:["+",Cs(v,0)]}),_="number-left"}return p?a.jsx("li",{className:E("contributor",_),children:p},m):null})}),r&&a.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?f.formatMessage({id:`member_${n[0]}`}):He(n[0].name||"",20):null})]})})},di=({type:e,data:t})=>{const n=I.useIntl(),{answers:r,createdAt:s,dateHasPassed:i,isOngoingEvent:c,pill:o,readingTime:u,publishedDate:d,startDate:f}=t;if(e==="question"){const l=s&&vn(s);return a.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),s&&a.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:l?n.formatMessage({id:`dates_${l.path}`},{number:l.number}):0})]})]})}if(f&&!i||c)return a.jsx("p",{className:"details",children:c?n.formatMessage({id:"card_bootcamp"}):Wr(f)});if(o)return a.jsx(at,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(u||d){const l=d&&vn(d);return a.jsxs("ul",{className:"details",children:[u&&a.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:u})}),d&&a.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:l?n.formatMessage({id:`dates_${l.path}`},{number:l.number}):0})})]})}return null},Tt={customCard:{className:"custom",gtmEvent:"custom",length:{text:335,secondaryText:150}},event:{basePath:"/events/",className:"event",gtmEvent:"event"},microcourse:{basePath:"/microcourses/en/",className:"course",gtmEvent:"microcourse-overview"},solutionArticle:{basePath:"/solution-articles/en/",className:"article",length:{title:60},gtmEvent:"article"},qaQuestion:{basePath:"/questions-answers/",className:"question",length:{title:190},gtmEvent:"q-and-a-question"},listPage:{basePath:"/list/en/",className:"list",gtmEvent:"list"},people:{basePath:"/profiles/",className:"people",length:{people:1e3},gtmEvent:"person"},learningHub:{basePath:"/learning-hub/",className:"learning-hub",length:{title:190},gtmEvent:"learning-hub"}},ui=({data:e,cta:t,link:n,gtmContext:r})=>{var _;const s=I.useIntl(),[i,c]=g.useState({loading:!1,registered:e.registered||!1});g.useEffect(()=>{e.registered&&c(v=>({...v,registered:!0}))},[e.registered]);const{startDate:o,dateHasPassed:u,pill:d,slug:f}=e,l=e.contentType;let m="";if((_=Tt[l])!=null&&_.gtmEvent&&(m=Tt[l].gtmEvent),o&&u)return a.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${m}-click`,children:s.formatMessage({id:"card_watch"})});if(l==="people")return a.jsx(X,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${m}-click`,children:s.formatMessage({id:"card_cta_people"})});const p=["microcourse","event"];if(t&&t.onClick&&p.includes(l)&&d!=="premium"){const v=i.loading||i.registered,b=async y=>{if(y.preventDefault(),y.stopPropagation(),!(v||!t||!t.onClick)){c(x=>({...x,loading:!0}));try{const x=await t.onClick(e);c(x==="success"?()=>({registered:!0,loading:!1}):k=>({...k,loading:!1}))}catch{c(k=>({...k,loading:!1}))}}};return a.jsx(X,{onClick:b,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:v,"data-gtm-event-context":`${r}Page-${l}: ${f}`,"data-gtm-event-type":`${r}-${l}-register-click`,"data-testid":"in-card-button",children:s.formatMessage({id:`card_cta_${l}${v?`_${i.loading?"loading":"done"}`:""}`})})}return null},pr={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},fi=e=>{let t=e;return Object.keys(pr).includes(e)&&(t=pr[e]),`url(${Fe}icons/${t}.svg)`};const mi={title:66,text:3e3,secondaryText:1e3,partner:25},Fn=({id:e="",card:t,buildCardData:n,cta:r,gtmContext:s="Carousel",className:i=""})=>{const c=I.useIntl(),o=g.useContext(Ee),u=o&&typeof o.id=="string",[d,f]=g.useState({data:null,isLoading:!0}),{data:l,isLoading:m}=d,p=g.useCallback(()=>{n(t,u).then(S=>{f(()=>({data:S,isLoading:!1}))}).catch(()=>f(S=>({...S,isLoading:!1})))},[e]);if(g.useEffect(()=>{p()},[]),m||!l)return a.jsx(xe,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});const{contentType:_}=l;if(!_||!Tt[_])return a.jsx(xe,{element:"li",className:"card-wrapper"});const{basePath:v="",className:b,length:y,gtmEvent:x}=Tt[_],k=Vr(`card_label_${_}`)?c.formatMessage({id:`card_label_${_}`}):!1,j=l.slug?`${v}${l.slug}`:!1,w={...mi,...y};let O={className:"card"};j&&(O={href:j,className:"card gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${x}-click`,"data-testid":"link"},l.openInNewTab&&(O.target="_blank"));const M=l.customIcon?{"--custom-icon":fi(l.customIcon)}:{};return a.jsx("li",{className:E("card-wrapper text-medium",b,i,{"has-link":j,"no-link":!j,"has-custom-icon":l.customIcon,"has-image":l.banner}),style:M,"data-testid":`${_}-card`,children:g.createElement(j?"a":"div",O,a.jsxs(a.Fragment,{children:[(l.customLabel||k)&&a.jsx("small",{className:E("card-label text-small",b),children:l.customLabel||k}),l.startDate&&!l.isOngoingEvent&&a.jsx(at,{size:"small",variant:l.dateHasPassed?"default":"information","data-testid":"date",children:l.dateHasPassed?c.formatMessage({id:"card_ended"}):xs(l.startDate)}),l.banner?a.jsxs("p",{className:"img",children:[l.registered&&a.jsx(at,{size:"small",variant:"registered",children:c.formatMessage({id:"card_registered"})}),a.jsx(ct,{image:l.banner})]}):b==="people"?a.jsx(Ge,{name:l.title||"",src:l.profile,"data-testid":"people-profile-picture"}):null,l.contributors&&a.jsx(An,{contributors:{data:l.contributors},styling:{size:"small",showGap:b!=="question",showText:!0},"data-testid":"contributors"}),l.partner&&a.jsx("p",{className:"partners","data-testid":"partners",children:He(l.partner.title,w.partner)}),["title","text","secondaryText"].map(S=>{const A=l[S];if(!A)return null;const F=vs(S);return a.jsx("p",{className:F,"data-testid":F,children:He(A,w[S])},S)}),a.jsx(di,{type:b||"",data:l}),a.jsx(ui,{data:l,cta:r,link:j||"",gtmContext:s})]}))})};const ca=({cards:e,cardTypes:t,className:n="",...r})=>a.jsx("ul",{className:E("card-block",n),children:e.map((s,i)=>{const c=s.slug?`${s.slug}-${t[i]}`:`${t[i]}-${i}`;return a.jsx(Fn,{id:c,card:{...s,contentType:t[i]},...r},c)})}),pi=(e,t,n,r)=>{const s=t*n<=e,i=e<t*(n+1),c=r.includes(Math.floor(e/t));return s&&i||c},hi=({id:e,title:t})=>{const n=I.useIntl();if(!t||!t.text)return null;const{text:r,element:s="h2",variant:i="default",size:c="medium",link:o}=t;return g.createElement(s,{className:E("title",i,c,{"highlighted-title":i==="highlighted"}),children:a.jsxs(a.Fragment,{children:[r,o&&a.jsx("a",{href:o,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${e||window.btoa(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const Yt={fourCards:1024,threeCards:769,twoCards:480};let mt=null;const gi=({id:e,cards:t,cardTypes:n,buildCardData:r,title:s,className:i,gtmContext:c})=>{const o=I.useIntl(),[u,d]=g.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:f,isLoading:l}=u,[m,p]=g.useState({currentPage:0,loadedPages:[0]}),{currentPage:_,loadedPages:v}=m,b=t.length,y=Math.ceil(b/f),x=g.useRef(null),k=Ve(!0,!0,x==null?void 0:x.current);g.useEffect(()=>{let S=1;k&&(k>=Yt.fourCards?S=4:k>=Yt.threeCards?S=3:k>=Yt.twoCards&&(S=2),S>b&&(S=b)),d(A=>({...A,cardsPerPage:S,isLoading:!1}))},[k,b]);const j=(S="next")=>{let A=_;if(typeof S=="string")if(S==="next")if(_<y-1)A=_+1;else return;else if(_>0)A=_-1;else return;else A=S;p(F=>({...F,currentPage:A,loadedPages:[...new Set([...v,A])]}))},w=S=>{mt=S.touches[0].clientX},O=S=>{if(mt===null)return;const A=S.touches[0].clientX,F=mt-A;F>5?j("next"):F<-5&&j("previous"),mt=null},M={"--width":`${k||0}px`,"--total-cards":b,"--cards-per-page":f,"--page":_};return l?a.jsx(Pn,{layout:`carousel${s?"-with-title":""}`}):a.jsxs("section",{ref:x,className:E("carousel-wrapper",i),"data-testid":"carousel",children:[a.jsx(hi,{id:e,title:s}),a.jsx("ul",{className:"carousel",onTouchStart:w,onTouchMove:O,style:M,"data-testid":"carousel-list",children:t.map((S,A)=>{let F=S&&S.sys&&S.sys.id?`${e}-card-${S.sys.id}`:null;return F&&pi(A,f,_,v)?a.jsx(Fn,{id:F,card:{...S,contentType:n[A]},buildCardData:r,gtmContext:c},F):(F=F||`${e}-card-${A}`,a.jsx(xe,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},F))})}),y<=1?null:a.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[a.jsx("li",{className:"arrow previous",children:a.jsx(X,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:S=>{S.preventDefault(),S.stopPropagation(),j("previous")},screenreaderText:o.formatMessage({id:"carousel_pagination_previous"}),disabled:_<=0})}),[...Array(y)].map((S,A)=>a.jsx("li",{"data-testid":"carousel-controls-button",children:a.jsx("button",{className:E("page-indicator",{selected:A===_}),onClick:F=>{F.preventDefault(),F.stopPropagation(),j(A)},children:a.jsx(he,{showOnFocus:!1,children:o.formatMessage({id:"carousel_pagination_page"},{number:A+1,total:y})})})},`page-indicator-${A}`)),a.jsx("li",{className:"arrow next",children:a.jsx(X,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:S=>{S.preventDefault(),S.stopPropagation(),j("next")},screenreaderText:o.formatMessage({id:"carousel_pagination_next"}),disabled:_>=y-1})})]})]})},_i=({carousels:e=[],isLoading:t,title:n,className:r="",...s})=>!e||!e.length?null:e.map(({title:i,viewAllUrl:c,cards:o,cardsTypes:u},d)=>{const f=i?window.btoa(i):`carousel-${d}`,l=d===e.length-1;return t?a.jsxs(g.Fragment,{children:[a.jsx(Pn,{layout:`carousel${i?"-with-title":""}`,"data-testid":"carousel-placeholder"}),l?null:a.jsx(Te,{})]},`placeholder-${f}`):a.jsxs(g.Fragment,{children:[a.jsx(gi,{cards:o,cardTypes:u,title:n!=null&&n.hidden?{}:{...n,text:i,link:c},...s}),l?null:a.jsx(Te,{})]},`carousel-${f}`)});const Gt="joinCommunityButton",In=({isMember:e=!1,isShort:t=!1,functions:{join:n,leave:r}={join:()=>{},leave:()=>{}}})=>{const s=I.useIntl(),i=g.useContext(Ee),c=i&&typeof i.id=="string",[o,u]=g.useState(e),[d,f]=g.useState(e?"joined":"notJoined");g.useEffect(()=>{d==="joining"?f("joined"):d==="leaving"&&f("notJoined")},[o]);const l={},m={};return o&&d!=="leaving"&&(l["data-hover-text"]=s.formatMessage({id:`${Gt}_leave`}),l["aria-label"]=s.formatMessage({id:`${Gt}_member_aria`}),m["aria-hidden"]="true"),a.jsx(X,{variant:o?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:o&&d!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async p=>{c&&(p.currentTarget.blur(),o?(f("leaving"),typeof r=="function"&&await r()):(f("joining"),typeof n=="function"&&await n()),u(!o))},className:E("join-community-button",d,{active:d==="joining"}),disabled:!c,...l,children:a.jsx("span",{className:"text",...m,children:s.formatMessage({id:`${Gt}${["joining","leaving"].includes(d)?`_${d}`:o?"_member":t?"_short":""}`})})})};const Kt="communityDetails_",vi=({className:e="",isMember:t=!1,slug:n,members:{number:r=0,data:s=[]}={number:0,data:[]},functions:{invite:i,...c}})=>{const o=I.useIntl(),u=5,d=r||s.length,f=s.length?s:Array(u).fill({}),l=`/communities/${n}/members`===window.location.pathname;return a.jsxs("div",{className:E("community-details",e),children:[a.jsx(Te,{}),a.jsxs("div",{className:"member-details",children:[a.jsxs("div",{className:"top",children:[a.jsxs("h4",{children:[o.formatMessage({id:`${Kt}members`}),a.jsx("span",{className:"count",children:d})]}),!l&&a.jsx("p",{className:"text-small",children:a.jsx("a",{href:`/communities/${n}/members`,children:o.formatMessage({id:`${Kt}viewAll`})})})]}),a.jsx(An,{contributors:{total:r,data:f},styling:{size:"medium",showGap:!0,showPlaceholders:d===0},cutoff:u})]}),a.jsx(In,{isMember:t,functions:{...c}}),t&&a.jsx(X,{variant:"primary",onClick:i,icon:{icon:"plus"},styling:{fullWidth:!0},children:o.formatMessage({id:`${Kt}invite`})})]})};const bi=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=I.useIntl();return a.jsxs(a.Fragment,{children:[a.jsx(he,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),a.jsx("ul",{className:E("breadcrumbs text-small",n),children:e.map(({text:s,href:i,current:c=!1},o)=>a.jsxs("li",{children:[c&&a.jsx(he,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),a.jsx(Ye,{href:c?void 0:i,children:He(s,t)})]},`${window.btoa(s)}_${o}`))})]})};const yi=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:s=""})=>{const i=I.useIntl(),c=t?[{id:"all",text:typeof t!="boolean"&&t.text||i.formatMessage({id:"filters_all"})},...e]:e,[o,u]=g.useState(t?["all"]:[]),d=(f,l)=>{let m=[];o.includes(f)?m=o.filter(p=>p!==f):f==="all"?m=["all"]:n?m=[...o.filter(p=>p!=="all"),f]:m=[f],u(p=>(r&&typeof r=="function"&&r({current:m,previous:p}),m)),l&&typeof l=="function"&&l()};return a.jsx("ul",{className:E("filters",s),children:c.map(({id:f,text:l,disabled:m=!1,callback:p=()=>{}})=>{let _={};return m&&(_={disabled:!0,"aria-label":i.formatMessage({id:"filters_disabled"},{name:l})}),a.jsx("li",{children:a.jsx("button",{className:E(f,{selected:o.includes(f)}),onClick:v=>{v.preventDefault(),v.stopPropagation(),d(f,p)},..._,children:l})},f)})})},xi=(e,t)=>{const n=String(e);if(!t||!t.length)return`/${n}`;let r="";return t.forEach(({url:s,position:i})=>{i==="before-lang"?r+=`/${s}`:(r.includes(`/${n}/`)||(r+=`/${n}`),r+=`/${s}`)}),r.includes(`/${n}/`)||(r+=`/${n}`),r};const Qt={en:"English",es:"Español",fr:"Français",pt:"Português"},pt="languageSwitcher_",wi=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:s=()=>{},urlParts:i,variant:c="default",label:o,className:u=""})=>{const d=I.useIntl(),[f,l]=g.useState(e);if(g.useEffect(()=>{e!==f&&l(e)},[e]),!r||!Object.values(r).some(v=>v&&v.post_name))return null;const p=Object.keys(r),_=f!==e;return a.jsxs("div",{className:E("language-switcher text-small",c,u),children:[a.jsxs("nav",{children:[c!=="short"&&a.jsx("p",{children:o||d.formatMessage({id:`${pt}label`})}),a.jsx("ul",{children:p.map(v=>{if(!Qt[v])return null;let b={className:v};return f===v?b["aria-label"]=d.formatMessage({id:`${pt}selected`},{language:Qt[v]}):b={...b,href:xi(v,i),onClick:y=>{y.preventDefault(),y.stopPropagation(),l(v),s(v)}},a.jsx("li",{children:a.jsx(Ye,{...b,fallbackElement:"span",children:Qt[v]})},v)})}),c!=="short"&&!_&&a.jsx("p",{children:d.formatMessage({id:`${pt}translation_${t?"original":n?"human":"machine"}`})})]}),c!=="short"&&!_&&!t&&!n&&a.jsx("small",{children:d.formatMessage({id:`${pt}disclaimer`},{email:qe.support,link:v=>{const b=`mailto:${v}`;return a.jsx("a",{href:b,children:v})}})})]})};const Jt=I.createIntl({locale:"en",messages:Mn}),lt=({hasNextPage:e=!0,loadNextPage:t=()=>{},variant:n="secondary",size:r="medium",styling:s={muted:!1,fullWidth:!1},icon:i=!1,messages:c={button:Jt.formatMessage({id:"loadMore_button"}),endOfFeed:Jt.formatMessage({id:"loadMore_endOfFeed"}),error:Jt.formatMessage({id:"loadMore_error"})},className:o="",gtmContext:u="LoadMore"})=>{const[d,f]=g.useState(""),l=async m=>{try{await t(m)}catch(p){p instanceof Error?f(p.message):f("Unknown error")}};return!d&&!e&&!c.endOfFeed?null:a.jsx("footer",{className:E("load-more",o),children:!d&&e?a.jsx(X,{variant:n,size:r,styling:s,icon:i,onClick:l,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:c.button}):c.endOfFeed&&(!d||d!=null&&d.includes("Cannot read items"))?a.jsx("p",{children:c.endOfFeed}):d&&a.jsx("p",{className:"error",children:c.error})})};const On=({variant:e="default",version:t="default",className:n="",...r})=>a.jsx("p",{className:"logo-wrapper",children:a.jsx("a",{href:"/home/",className:E("logo",e,t,n),...r,children:a.jsx(he,{children:a.jsx(I.FormattedMessage,{id:"apolitical"})})})});let ht=!1;const la=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const s=I.useIntl(),i=g.useRef(null),[c,o]=g.useState(!1),u=d=>{i.current&&d.target instanceof HTMLElement&&!i.current.contains(d.target)&&o(!1)};return g.useEffect(()=>(document.addEventListener("click",u,!0),()=>{document.removeEventListener("click",u,!0)})),g.createElement(e,{ref:i,className:E("more-menu text-medium",r),children:a.jsxs(a.Fragment,{children:[a.jsx(X,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>o(!c),"aria-haspopup":"true","aria-expanded":c,"aria-controls":t,screenreaderText:s.formatMessage({id:"moreMenu"})}),a.jsx("ul",{id:t,hidden:!c,children:n.map(({href:d,onClick:f,text:l,icon:m,...p},_)=>{const v={...p,onClick:b=>{o(!1),typeof f=="function"&&f(b)},onFocus:()=>{ht&&(clearTimeout(ht),ht=!1)},onBlur:()=>{ht=setTimeout(()=>{o(!1)},100)}};return d&&(v.href=d),a.jsx("li",{children:a.jsx(X,{variant:"tertiary",size:"medium",icon:m?{icon:m,position:"left"}:!1,...v,children:l})},`${window.btoa(l)}_${_}`)})})]})})},ji=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const ki=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"}],da=({activeLink:e})=>{const t=I.useIntl(),n=g.useContext(Ee),r=n&&typeof n.id=="string";return a.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[ki.map(({key:s,href:i})=>a.jsx("li",{className:E(s,{active:ji(i,e)}),children:a.jsx("a",{href:i,"data-gtm-event-type":`${s}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:t.formatMessage({id:`navigationMenu_links_${s}`})})},s)),r&&a.jsx("li",{className:"profile","data-testid":"profile-link",children:a.jsxs("a",{href:"/profiles/me","data-gtm-event-type":"profile-click","data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:[a.jsx(Ge,{name:(n==null?void 0:n.name)||"",src:n!=null&&n.image?n.image.thumbnail:""}),a.jsx("span",{children:t.formatMessage({id:"navigationMenu_profile"})})]})})]})},et=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,Ti=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${et(t,"linkedin",n)}&src=linkedin`)}&title=${encodeURIComponent(e)}&source=Apolitical`},{key:"twitter",icon:"social_twitter",url:`https://twitter.com/share?ref_src=twsrc%5Etfw&url=${encodeURIComponent(`${et(t,"twitter",n)}&src=twitter`)}&text=${encodeURIComponent(e)}&via=${encodeURIComponent("apoliticalco")}`},{key:"facebook",icon:"social_facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(`${et(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
38
38
 
39
39
  ${et(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:et(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,s)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(s))}];const Ei="shareLinks_",Si=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:s="large",variant:i="default",className:c=""})=>{const o=I.useIntl(),u=Ti({title:e,link:t,referrer:n});return a.jsxs("aside",{className:E("share-links",s,i,c),children:[a.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),a.jsx("ul",{children:u.map(({key:d,icon:f,url:l,shouldRender:m=!0,onClick:p})=>{if(typeof m=="function"&&!m())return null;const _={};return p&&(_.onClick=v=>p(v,l)),a.jsx("li",{children:a.jsx(X,{size:s,variant:"tertiary",icon:{icon:f||d},href:l,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${d}-click`,"data-testid":"link",screenreaderText:o.formatMessage({id:`${Ei}link_${d}`}),..._})},d)})})]})};const Ci=({tabs:e,className:t=""})=>{var u;const n=(d,f,l)=>(d||(d=`panel-${window.btoa(f)}-${l}`),d);let r=e.findIndex(d=>d.current===!0);if(r<0&&(r=0),window.location.hash){const d=window.location.hash.replace("#","");if(e.find(l=>l.id===d)){for(let l=0;l<e.length;l++)if(n(e[l].id,e[l].text,l)===d){r=l;break}}}const[s,i]=g.useState((u=e[r])!=null&&u.id?e[r].id:n(e[r].id,e[r].text,r)),c=[],o=[];return e.forEach(({id:d,text:f,content:l,href:m},p)=>{d=n(d,f,p);const _=s===d,v={};m||(v["aria-controls"]=d,v.onClick=b=>{b.preventDefault(),b.stopPropagation(),i(d),window.location.hash=`#${d}`},o.push(a.jsx("section",{id:d,hidden:!_,role:"tabpanel","aria-labelledby":`tab-${d}`,"aria-live":_?"assertive":"off",children:typeof l=="string"?a.jsx("p",{children:l}):l},`section-${d}`))),c.push(a.jsx("li",{children:a.jsx("a",{href:m||`#${d}`,id:`tab-${d}`,className:E({selected:_}),role:"tab","aria-selected":_,...v,children:f})},`tab-${d}`))}),a.jsxs("div",{className:E("tabs-wrapper",t),children:[a.jsx("ul",{className:"tabs",role:"tablist",children:c}),a.jsx("div",{className:"tab-content",children:o})]})};const $i={"2-1":901,"1-3":769},ua=({layout:e="2-1",hideOnMobile:t=!1,className:n="",children:r})=>{const s=Ve(!0);let i=r;return g.Children.count(r)===1&&(i=g.Children.toArray(r)[0],i.props&&(i=i.props.children)),a.jsx("section",{className:E("columns",`layout-${e}`,n),children:g.Children.map(i,(c,o)=>t!==!1&&o===t&&s&&s<$i[e]?null:c)})};const gt="emailHelperTextBox_",fa=({type:e,email:t,redirectPath:n,resendVerificationCode:r})=>{const s=I.useIntl(),[i,c]=g.useState({path:`${gt}default`,type:"default",link:{},mail:{},error:""}),[o,u]=g.useState(!1),d=g.useCallback(p=>{p.preventDefault(),p.stopPropagation();const _=v=>{c({path:`${gt}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:b=>d(b),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:v})};if(typeof r!="function"){_(s.formatMessage({id:`${gt}error_noFunction`}));return}u(!0),r(t).then(()=>{localStorage.setItem("email",t),window.location.href=n||"/signup/verify-email"}).catch(v=>{_(v.message)}).finally(()=>{u(!1)})},[t,n,r]);g.useEffect(()=>{let p=gt,_="default",v={},b={};switch(e){case"gov":p+="autoApproved",_="success";break;case"nonGov":p+="unrecognisedEmail",_="error",v={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":p+="pendingApproval",_="error",b={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":p+="emailUnverified",_="error",v={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:y=>d(y),"data-testid":"send-verify-email-click"};break;case"exists":p+="emailAlreadyExists",_="error",v={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},b={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:p+="default",v={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}c({...i,path:p,type:_,link:v,mail:b})},[e]);const f={};return["link","mail"].forEach(p=>{f[p]=Object.keys(i[p]).length?_=>a.jsx("a",{...i[p],children:_}):_=>_}),a.jsx(na,{type:i.type,heading:o?!1:s.formatMessage({id:`${i.path}_title`}),children:o?a.jsxs(a.Fragment,{children:[a.jsx(xe,{element:"span"}),a.jsx(xe,{element:"span"})]}):s.formatMessage({id:`${i.path}_text`},{...f,strong:p=>a.jsx("strong",{children:p}),em:p=>a.jsx("em",{children:p}),br:a.jsxs(a.Fragment,{children:[a.jsx("br",{}),a.jsx("br",{})]}),error:i.error})})},nt=({className:e="",element:t="input",id:n,inputRef:r,functions:s={onChange:()=>{}},name:i=n,placeholder:c,type:o="text",value:u,...d})=>{const f=g.useRef(),l=r||f;return g.createElement(t,{ref:l,...d,type:o,id:n,name:i,className:E(e,t,{"has-scrollbar":o==="textarea"&&l.current&&l.current.clientHeight<l.current.scrollHeight}),value:u,placeholder:c,...s,onChange:m=>{const p=m.target;s.onChange(p.value)}})};const ma=({className:e="",disabled:t,element:n="p",functions:r={onChange:()=>{}},id:s,inputRef:i,intlPath:c=!1,label:o,shownValue:u=!0,type:d="checkbox",value:f,...l})=>{const m=I.useIntl(),{onChange:p,..._}=r,v=()=>{t||p(f?null:u)},b=a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:i,id:s,name:s,type:d,value:u,checked:f,onKeyDown:y=>{(y.key==="Enter"||y.code==="Space")&&(y.preventDefault(),y.stopPropagation(),v())},readOnly:!0,disabled:t}),a.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),a.jsx("label",{htmlFor:s,children:o||m.formatMessage({id:c?`${c}_${s}`:s})})]});return g.createElement(n,{onClick:y=>{const x=y.target;x.nodeName.toLowerCase()==="a"||x.parentNode&&x.parentNode.nodeName.toLowerCase()==="a"||(y.preventDefault(),y.stopPropagation(),v())},className:E("checkbox-wrapper",e),...l,..._},b)};const Mi=g.memo(function({direction:t="down"}){return a.jsx(Rt,{className:E("rotating-chevron",`direction-${t}`)})});const Ri=({className:e,options:t,initialValue:n,value:r,functions:s={onChange:()=>{},onMultiSelectSubmit:()=>{}},gtm:{context:i}={context:""},placeholder:c,multiSelect:o,multiSelectOptions:u,id:d})=>{const f=I.useIntl(),[l,m]=g.useState(!1),p=r||n,_=Array.isArray(p)?[...p]:p?[p]:[],[v,b]=g.useState(_);let y;Array.isArray(v)&&v.length===1&&typeof v[0]=="string"?y=t&&v?t.find(M=>M.id===v[0]):t?t[0]:{id:"",label:""}:Array.isArray(v)&&v.length===1&&typeof v[0]!="string"?y=v[0]:y={id:"",label:""},g.useEffect(()=>{b(_)},[r,n]);const{onChange:x,onMultiSelectSubmit:k,...j}=s,w=M=>{if(o){let S=[];v!=null&&v.includes(M.id)?S=v.filter(A=>A!==M.id):S=[...v,M.id],b([...S]),x&&x([...S])}else b([M]),x&&x(M.id),m(!1)},O=M=>{if(M==="all"){const S=(t==null?void 0:t.map(A=>A.id))||[];b(S),x&&x(S)}else b([]),x&&x([])};return a.jsxs("div",{className:E("dropdown-wrapper",e),children:[a.jsxs("button",{className:"input","aria-expanded":l,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:M=>{M.preventDefault(),M.stopPropagation(),m(!l)},"data-testid":"dropdown-selector",...j,children:[o?`${c} · ${v.length}`:y.label,a.jsx(Mi,{direction:l?"up":"down"})]}),a.jsx("select",{defaultValue:y.id,onChange:M=>{M.preventDefault(),M.stopPropagation();const S=t&&t.find(A=>A.id===M.target.value);w(S)},hidden:!l,...j,children:t==null?void 0:t.map(M=>a.jsx("option",{value:M.id,children:M.label},M.id))}),a.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!l,children:[a.jsxs("div",{className:"dropdown-menu-list",children:[(u==null?void 0:u.topbar)&&a.jsxs("div",{className:"action-bar",children:[a.jsx("p",{children:`${v==null?void 0:v.length} selected`}),a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx(X,{variant:"tertiary",size:"small",onClick:()=>O("all"),className:"gtm-trackable",children:f.formatMessage({id:"dropdown_menu_multiselect_all"})})}),a.jsx("li",{children:a.jsx(X,{variant:"tertiary",size:"small",onClick:()=>O("none"),className:"gtm-trackable",children:f.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),a.jsx("ul",{children:t==null?void 0:t.map(M=>{const S=M.id===y.id||(v==null?void 0:v.includes(M))||(v==null?void 0:v.includes(M.id));return a.jsx("li",{"data-testid":"dropdown-options",children:a.jsxs("button",{className:E("gtm-trackable",{selected:S,"selected-single":S&&!o}),"data-gtm-event-type":`${M}-click`,"data-gtm-event-context":i,onClick:A=>{A.preventDefault(),A.stopPropagation(),w(M)},role:"menuitem","aria-current":S,"data-testid":S?"current-selection":"",children:[o&&a.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),a.jsx("span",{className:E({"menu-option-label":o}),children:M.label})]})},M.id)})})]}),(u==null?void 0:u.submitSection)&&a.jsx("p",{className:"submit",children:a.jsx(X,{variant:"secondary",onClick:()=>{k&&k(v),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:d||"dropdown-multi-select",value:v}})),m(!1)},children:f.formatMessage({id:"form_submit"})})})]})]})};const Pi=({className:e="",functions:t={onChange:()=>{}},intlPath:n=!1,id:r,label:s,multiSelect:i=!1,name:c,options:o,required:u,type:d="checkboxes",value:f,...l})=>{const m=I.useIntl(),p=i?f:[],_=f;return a.jsx("ul",{...l,className:E("options-wrapper",e),"data-testid":`ul-${r}`,children:o==null?void 0:o.map(({id:v,label:b=!1,value:y=v,disabled:x=!1})=>{const k=`${r}_${v}`,j=()=>{if(x)return;let w;if(i){const O=p==null?void 0:p.indexOf(y);Array.isArray(p)&&O>=0?(w=p,w.splice(O,1)):(!p||p.length===0?w=[]:w=p,w.push(y))}else w=_===y?void 0:y;t.onChange(w)};return a.jsx(ma,{element:"li",id:k,type:d==="checkboxes"?"checkbox":"radio",shownValue:y,value:i?p==null?void 0:p.includes(y):_===y,functions:{...t,onChange:j},intlPath:n,label:b||m.formatMessage({id:n?`${n}_${v}`:v}),disabled:x},k)})})};const Ni=({inputRef:e,type:t="password",gtm:{context:n}={context:void 0},...r})=>{const s=I.useIntl(),i=g.useRef(),c=e||i,[o,u]=g.useState(!1),[d,f]=g.useState(t),l=()=>{var m;u(!o),f(o?"password":"text"),(m=c.current)==null||m.focus()};return a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:E("show-password gtm-trackable",{"password-visible":o}),"data-gtm-event-context":n,"data-gtm-event-type":`${o?"hide":"show"}-password-click`,onClick:l,"aria-label":s.formatMessage({id:`showpassword_aria_${o?"hide":"show"}`}),children:s.formatMessage({id:`showpassword_${o?"hide":"show"}`})}),a.jsx(nt,{inputRef:c,type:d,...r})]})};const Be={text:{component:nt},email:{component:nt},textarea:{component:nt,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:ma},checkboxes:{component:Pi,props:{multiSelect:!0}},select:{component:Ri},password:{component:Ni}},Ai=({id:e,intlPath:t=!1,className:n="",error:r,functions:s={onChange:()=>{}},limit:i=0,showRequiredLabels:c=!0,type:o,validation:u,value:d,...f})=>{const l=I.useIntl(),m=u&&u.some(({condition:j})=>j==="required"),p=(d==null?void 0:d.toString().length)||0,_=o&&Be[o]&&Be[o].component?Be[o].component:nt,v={};o&&["checkboxes"].includes(o)?v.element="span":v.htmlFor=e;let b={...f,id:e,name:e,className:r?"error":"",type:o,required:m,"aria-required":m,functions:tt(s),value:d};i>0&&(b["data-character-limit"]=i,b.functions&&(b.functions.onChange=j=>{((j==null?void 0:j.toString().length)||0)>i&&(j=j==null?void 0:j.toString().slice(0,i)),s.onChange(j)})),o&&Be[o]&&Be[o].props&&(b={...b,...Be[o].props}),o&&["checkboxes"].includes(o)&&(b.intlPath=`${t}_${e}`),r&&(b["aria-invalid"]=!0,b["aria-describedby"]=`error-${e}`);const y=f.label||l.formatMessage({id:t?`${t}_${e}`:e}),x=({...j})=>r?g.createElement(j.as||"dd",{id:`error-${e}`,className:"error text-small",role:"alert","aria-live":"assertive",...j},r):null;if(o&&["checkbox"].includes(o))return a.jsxs(a.Fragment,{children:[a.jsx(_,{...b,label:y,className:E("field-wrapper",n)}),a.jsx(x,{as:"p"})]});const k=j=>g.createElement(j.element||"label",{...j,className:"checkboxes-label text-small","data-testid":`label-${e}`});return a.jsxs("dl",{className:E("field-wrapper text-medium",n),children:[a.jsx("dt",{children:a.jsxs(k,{...v,children:[y,m&&c&&a.jsxs(a.Fragment,{children:[" ",a.jsxs("small",{children:["(",l.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})}),a.jsxs("dd",{children:[a.jsx(_,{...b}),i>0?a.jsxs("small",{className:E("character-limit",{"near-limit":p>=.99*i,"approaching-limit":p>=.9*i&&p<.99*i}),children:[a.jsx("span",{className:"hidden",children:l.formatMessage({id:"form_fieldWrapper_characterLimit"})}),p," / ",i]}):null]}),a.jsx(x,{})]})},Fi=(e,t)=>{const{type:n,payload:r}=t,s=e.errors?tt(e.errors):{},i=e.values?tt(e.values):{};switch(n){case"toggleSubmitting":return{...e,isSubmitting:!e.isSubmitting};case"updateValue":if(r!=null&&r.key&&s[r==null?void 0:r.key]&&delete s[r==null?void 0:r.key],r!=null&&r.key){if(["isSubmitting","formSubmitted","errors"].includes(r==null?void 0:r.key))return{...e,errors:s,[r==null?void 0:r.key]:r==null?void 0:r.value};i[r==null?void 0:r.key]=r==null?void 0:r.value}return{...e,errors:s,values:i};case"addError":return r!=null&&r.key&&!s[r==null?void 0:r.key]&&(s[r==null?void 0:r.key]=r==null?void 0:r.value),{...e,errors:s};case"removeError":return r!=null&&r.key&&s[r==null?void 0:r.key]&&delete s[r==null?void 0:r.key],{...e,errors:s};case"submitForm":{const{fields:c=[],dispatch:o=()=>{},onSuccess:u=()=>{},onFailure:d=()=>{},intl:f}=r,l=tt(Object.keys(s));for(const m of c)if(m.validation)for(let p=0;p<m.validation.length;p++){const{condition:_="required",error:v=!1}=m.validation[p];let b=!1;if(typeof _=="function"){const y=_(i);y&&(b=v||y)}else{const y=i[m.id];switch(_){case"required":(!y||typeof y=="string"&&y.trim().length===0)&&(b=v||(f==null?void 0:f.formatMessage({id:"form_error_required"})));break;case"no-numbers":{y&&!/^([^0-9]*)$/.test(y)&&(b=v||(f==null?void 0:f.formatMessage({id:"form_error_numbers"})));break}case"valid-email":{y&&!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(y)&&(b=v||(f==null?void 0:f.formatMessage({id:"form_error_email"})));break}case"valid-url":{y&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(y)&&(b=v||(f==null?void 0:f.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(b){o({type:"addError",payload:{key:m.id,value:b}}),l.push(m.id);break}}return l.length===0?u(i):d(i,l),{...e,isSubmitting:!1}}case"formSubmitted":return{...e,isSubmitting:!1,formSubmitted:!0,errors:{}};case"formSubmittedAndReset":return{isSubmitting:!1,formSubmitted:!0,errors:{}};default:return e}};let Xt=null;const At=({fields:e,className:t="",id:n=e.length?`form__${e[0].id}`:"form",formRef:r,intlPath:s=!1,button:i={variant:"primary",size:"large",customOnSubmit:!1},secondaryActionButton:c={variant:"secondary",size:"large"},meta:{shouldShowCancelButton:o=!1,shouldReset:u=!0,showRequiredLabels:d=!0,showSuccessMessage:f=!1}={shouldShowCancelButton:!1,shouldReset:!0,showRequiredLabels:!0,showSuccessMessage:!1},gtm:l={context:"Form",event:"form-submit-click"},functions:{onSuccess:m=async()=>{},onCancel:p=()=>{},onCatch:_=()=>{},onFailure:v=()=>{}}={onSuccess:async()=>{},onCancel:()=>{},onCatch:()=>{},onFailure:()=>{}},...b})=>{const{customOnSubmit:y,hideButton:x,...k}=i,j=40,w=I.useIntl(),O={};e.length&&e.forEach(U=>{const Z=U.id||U.name;Z&&(O[Z]=U.value||"")});const[M,S]=g.useReducer(Fi,{isSubmitting:!1,formSubmitted:!1,errors:{},values:O}),{errors:A,isSubmitting:F,formSubmitted:L,values:le}=M;g.useEffect(()=>{u&&L&&(Xt=setTimeout(()=>{S({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[L]),g.useEffect(()=>()=>{Xt&&clearTimeout(Xt)},[]),g.useEffect(()=>{const U=Z=>{S({type:"updateValue",payload:{key:Z.detail.id,value:Z.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",U),()=>{document.removeEventListener("dropdownMultiSelectSubmit",U)}},[]);const D=g.useRef(null),V=r||D;if(!e.length)return null;i.text||(i.text=w.formatMessage({id:"form_submit"}));const G=U=>{var ae;if(U.preventDefault(),U.stopPropagation(),F)return;let Z=0;if((ae=V==null?void 0:V.current)!=null&&ae.id){const T=document.getElementById(V.current.id);T&&(Z=T.getBoundingClientRect().top+window.scrollY)}const ee=document.getElementById("header");if(ee&&(Z=Z-ee.offsetHeight-j),Z<0&&(Z=0),window.scrollTo({top:Z,behavior:"smooth"}),S({type:"toggleSubmitting"}),i.disabled){typeof i.disabled=="object"&&i.disabled.isClickable&&S({type:"submitForm",payload:{fields:e,dispatch:S,intl:w}});return}S({type:"submitForm",payload:{fields:e,dispatch:S,onSuccess:async T=>{try{await m(T),S({type:u?"formSubmittedAndReset":"formSubmitted"})}catch($){_($),S({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:(T,$)=>{v(T,$),S({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:w}})};return a.jsxs(a.Fragment,{children:[a.jsxs("form",{...b,id:n,className:E("form",t),ref:V,children:[A!=null&&A.general?a.jsx(Oe,{variant:"error",text:w.formatMessage({id:"form_error_generalError"})}):null,(!F&&!L||y)&&e.map((U,Z)=>{const{id:ee=U.name||Z,component:ae,functions:T={onChange:()=>{}}}=U;if(ae)return a.jsx(ae,{...U.props||{}},`component-${ee}-${Z}`);const $=le?le[ee]:"";return a.jsx(Ai,{intlPath:s,...U,showRequiredLabels:d,value:$,error:A==null?void 0:A[ee],functions:{...T,onChange:B=>{S({type:"updateValue",payload:{key:ee,value:B}}),T.onChange(B&&B.toString(),S)}}},ee)}),x?null:(F||L)&&y?a.jsxs("div",{className:"form-buttons",children:[o&&a.jsx(X,{...c,className:"gtm-trackable","data-gtm-event-context":l.context,"data-gtm-event-type":l.event,disabled:F||L,onClick:p,children:c.text||w.formatMessage({id:"form_cancel"})}),"customOnSubmit"]}):a.jsx("p",{className:`cta ${F||L?"center":""} ${L?"submitted":""}`,children:a.jsxs("div",{className:"form-buttons",children:[o&&a.jsx(X,{...c,className:"gtm-trackable","data-gtm-event-context":l.context,"data-gtm-event-type":l.event,disabled:F||L,onClick:p,children:c.text||w.formatMessage({id:"form_cancel"})}),a.jsx(X,{...k,icon:L?{icon:"tick",position:"left"}:!1,className:"gtm-trackable",onClick:G,disabled:F||L||i.disabled,"data-gtm-event-context":l.context,"data-gtm-event-type":l.event,children:F||L?w.formatMessage({id:`form_${F?"submitting":"submitted"}`}):i.text})]})})]}),f&&L&&a.jsx(st,{className:"success",children:typeof f=="string"?f:w.formatMessage({id:"form_success"})})]})};const _t="passwordRules_",pa="isMoreThanEightCharacters",ha="includesNumberAndSymbol",ga="includesLowerAndUppercase",Ii={[pa]:"8Characters",[ha]:"numberSymbol",[ga]:"lowercaseUppercase"},Oi=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=I.useIntl();return a.jsxs("aside",{className:E("password-rules",t),children:[a.jsx("small",{children:n.formatMessage({id:`${_t}intro`})}),a.jsx("ul",{children:[pa,ha,ga].map(r=>a.jsxs("li",{className:E({matches:e[r]}),children:[a.jsxs(he,{children:[n.formatMessage({id:`${_t}rule_label`})," "]}),a.jsx("span",{children:n.formatMessage({id:`${_t}rule_${Ii[r]}`})}),!e[r]&&a.jsxs(he,{element:"strong",children:[" ",n.formatMessage({id:`${_t}notMet`})]})]},`rule-${r}`))})]})},Li=g.memo(Oi);const Di=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:s=()=>{}},className:i="",hasLoaded:c=!1})=>{const o=I.useIntl(),[u,d]=g.useState({setUp:!1,id:null,rating:null,disabled:!0}),f=async()=>{try{const y=await n();d(x=>({...x,setUp:!0,id:y&&y.id,disabled:!1}))}catch(y){d(x=>({...x,setUp:!0,disabled:!0})),s(y)}};if(g.useEffect(()=>{c&&!u.setUp&&f()},[c]),!c)return a.jsx(xe,{className:"rating-placeholder"});const{id:l,rating:m,disabled:p}=u,_="ratings_",v={text:o.formatMessage({id:`${_}text`}),low:o.formatMessage({id:`${_}low`}),high:o.formatMessage({id:`${_}high`}),success:o.formatMessage({id:`${_}success`}),...e},b=async y=>{if(!(!l||p))try{d(x=>({...x,rating:y,disabled:!0})),await r({id:l,value:y})}catch(x){d(k=>({...k,rating:null})),s(x)}finally{d(x=>({...x,disabled:!1}))}};return a.jsxs("div",{className:E("rating",i),children:[a.jsx("span",{className:"label",children:v[m?"success":"text"]}),a.jsx("ol",{children:Array.from(new Array(t).keys()).map(y=>{const x=y+1;return a.jsx("li",{className:E({selected:m&&x<=m}),children:a.jsx(X,{variant:"tertiary",size:"small",icon:{icon:`star${!m||x>m?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${o.formatMessage({id:`${_}stars`},{number:x,total:t})}${x===1||x===t?` - ${v[x===1?"low":"high"]}`:""}`,onClick:k=>{k.preventDefault(),k.stopPropagation(),b(x)},disabled:p})},`rating-${x}`)})})]})},_a=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:s="contact-form-submit-click"}=e||{};return a.jsx(At,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}]},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:s},functions:{onSuccess:t,onFailure:n}})};const va=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:s,backgroundColor:i,onClose:c,reportError:o,sendInvites:u,initialFormStatus:d="NOT_SUBMITTED"})=>{const[f,l]=g.useState([]),[m,p]=g.useState(!0),[_,v]=g.useState(d),{formatMessage:b}=I.useIntl(),y=async j=>{j.preventDefault();try{await u(f),l([]),v("SUCCESS")}catch(w){v("ERROR"),o(w)}},x=j=>{j.preventDefault(),v("NOT_SUBMITTED"),p(!0),l([])},k=j=>{j.preventDefault(),c(),v("CLOSED")};return _==="CLOSED"?null:_==="ERROR"||_==="SUCCESS"?a.jsxs("div",{className:"invite-form-wrapper",children:[a.jsx("div",{className:"content centred",children:_==="SUCCESS"?a.jsx("h2",{className:"success-title",children:b({id:"inviteForm_success"})}):a.jsxs("h2",{className:"error-title",children:[" ",b({id:"inviteForm_error"})]})}),a.jsx(Te,{}),a.jsx("div",{className:"footer",children:_==="SUCCESS"?a.jsxs(a.Fragment,{children:[a.jsx(X,{variant:"secondary",onClick:x,children:b({id:"inviteForm_ctaSendMoreInvites"})}),a.jsx(X,{onClick:k,children:b({id:"inviteForm_ctaDone"})})]}):a.jsx(X,{onClick:x,children:b({id:"inviteForm_ctaTryAgain"})})})]}):a.jsx("div",{className:"invite-form-wrapper",children:a.jsxs("form",{style:{backgroundColor:i},onSubmit:y,className:E("invite-form gtm-trackable"),children:[a.jsxs("fieldset",{className:"content",children:[a.jsx("h2",{className:"title",style:{color:r},children:e}),a.jsx("label",{htmlFor:"email-input",className:"label",style:{color:s},children:t}),a.jsx(os.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:b({id:"inviteForm_email_placeholder"}),emails:f,onChange:j=>{l(j),p(!j.length)},autoFocus:!1,getLabel:(j,w,O)=>a.jsxs("div",{className:"email text-medium",children:[a.jsx("div",{"data-tag-item":!0,children:j}),a.jsx(X,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{O(w),p(!f.length)},className:"remove-email-button",screenreaderText:b({id:"overlay_close"})})]},w)})]}),a.jsx(Te,{}),a.jsx("fieldset",{className:"footer",children:a.jsx(X,{className:"sendEmailsButton",disabled:m,children:n})})]})})};const ba=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:s="search-bar",gtmEvent:i="form-submission"})=>{const{searchIsOpen:c=!0,isDesktopVersion:o=!1}=n||{},u=I.useIntl(),d=g.useRef(null);Ue(()=>{!n||o||!c||d.current&&d.current.focus()},[c]);const f=l=>{l.preventDefault(),l.stopPropagation(),!(!d.current||!d.current.value||d.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(d.current.value)}`)};return a.jsx("form",{onSubmit:f,className:E("search-form gtm-trackable",t),"data-gtm-event-context":s,"data-gtm-event-type":i,children:a.jsx("fieldset",{id:`${e}-form`,hidden:n?!c:!1,role:"search",children:a.jsxs("p",{children:[a.jsx(he,{element:"label",htmlFor:e,children:u.formatMessage({id:"search_label"})}),a.jsx("input",{ref:d,type:"search",id:e,name:e,defaultValue:r,placeholder:u.formatMessage({id:"search_placeholder"}),onKeyDown:l=>{l.key==="Enter"&&f(l)}}),a.jsx("button",{className:"clear",onClick:l=>{l.preventDefault(),l.stopPropagation(),d.current&&d.current.value&&(d.current.value="")},children:a.jsx(he,{children:u.formatMessage({id:"search_clear"})})}),a.jsx("button",{className:"search",onClick:f,children:a.jsx(he,{children:u.formatMessage({id:"search_cta"})})})]})})})},hr=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const s=e.current.value.toString().toLowerCase().trim(),i={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let c=Object.assign({},i);try{c=await t(s),c===void 0&&(c=i)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:s,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:o=!1,autoApproved:u=!1,exists:d}=c;let f="";return o?f=u?"gov":"nonGov":d.registration?d.engagement&&!d.user?f=d.auth?"verify":"pending":f="exists":d.auth&&(f="exists"),n([{type:"shouldManuallyApprove",value:!u},{type:"emailDetails",value:{email:s,boxType:f,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(s)}},{type:"validFields.email",value:!0}])},Bi=e=>{const t={};for(const n of e.entries())t[n[0]]=n[1];return{name:t.full_name,email:t.email_address.toString().toLowerCase().trim(),jobTitle:t.job_title,organization:t.organization,bioLink:t.url,optIn:!0,expectation:t.expectation,page:window.location.pathname,"g-recaptcha-response":t["g-recaptcha-response"]}},ya=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:s,state:i})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}if(e.recaptcha&&e.recaptcha.current&&!e.recaptcha.current.getValue()){e.recaptcha.current.execute();return}const c=Bi(new FormData(e.form.current)),o=Object.assign(c,t);await n(o),localStorage.setItem("email",c.email),r&&r({...c,...i.values}),s([{type:"showSuccessMessage",value:!0}])};var xn={exports:{}},wn={exports:{}},ie={};/** @license React v16.13.1
40
40
  * react-is.production.min.js
package/index.mjs CHANGED
@@ -1568,26 +1568,34 @@ const Tc = ({ currentStep: e = 1, steps: t = 1 }) => {
1568
1568
  for (let i = 1; i < t + 1; i++)
1569
1569
  s.push(i);
1570
1570
  r(s);
1571
- }, [t]), /* @__PURE__ */ a.jsx("div", { className: "navigation-dots-wrapper", children: /* @__PURE__ */ a.jsx("div", { className: "dots-wrapper", children: n.map((s) => /* @__PURE__ */ a.jsxs("div", { className: "dot-wrapper", children: [
1572
- /* @__PURE__ */ a.jsx(
1573
- "div",
1574
- {
1575
- className: T("dot", {
1576
- active: s === e,
1577
- completed: s < e
1578
- }),
1579
- "data-testid": "navigation-dot"
1580
- }
1581
- ),
1582
- /* @__PURE__ */ a.jsx(
1583
- "div",
1584
- {
1585
- className: T("line", {
1586
- active: s < e
1587
- })
1588
- }
1589
- )
1590
- ] }, s)) }) });
1571
+ }, [t]), /* @__PURE__ */ a.jsx("div", { className: "navigation-dots-wrapper", children: /* @__PURE__ */ a.jsx("div", { className: "dots-wrapper", children: n.map((s) => /* @__PURE__ */ a.jsxs(
1572
+ "div",
1573
+ {
1574
+ className: "dot-wrapper",
1575
+ "aria-label": `Step ${e} of ${s}`,
1576
+ children: [
1577
+ /* @__PURE__ */ a.jsx(
1578
+ "div",
1579
+ {
1580
+ className: T("dot", {
1581
+ active: s === e,
1582
+ completed: s < e
1583
+ }),
1584
+ "data-testid": "navigation-dot"
1585
+ }
1586
+ ),
1587
+ /* @__PURE__ */ a.jsx(
1588
+ "div",
1589
+ {
1590
+ className: T("line", {
1591
+ active: s < e
1592
+ })
1593
+ }
1594
+ )
1595
+ ]
1596
+ },
1597
+ s
1598
+ )) }) });
1591
1599
  };
1592
1600
  const Ec = ({ elementId: e, offset: t = 20 }) => {
1593
1601
  const n = W(), r = () => {
@@ -3039,7 +3047,7 @@ const li = ({
3039
3047
  {
3040
3048
  cards: o,
3041
3049
  cardTypes: u,
3042
- title: { ...n, text: i, link: c },
3050
+ title: n != null && n.hidden ? {} : { ...n, text: i, link: c },
3043
3051
  ...s
3044
3052
  }
3045
3053
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "2.1.2-ac.0",
3
+ "version": "2.1.2-ac.1",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {