@apolitical/component-library 4.3.0-4520.2 → 4.3.0-4520.3
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.
- package/index.js +2 -2
- package/index.mjs +8 -12
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -32,7 +32,7 @@ Check the top-level render call using <`+le+">.")}return ae}}function jo(P,ae){{
|
|
|
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_likes_show:"Show who liked this {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_share_copy_link:"Copy link",discussion_share_copy_link_success:"Link copied to clipboard",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_fieldWrapper_characterLimit_aria_default:"You have {remaining, plural, =0 {no characters} one {1 character} other {# characters}} remaining.",form_fieldWrapper_characterLimit_aria_over:"You are {over, plural, one {1 character} other {# characters}} over the limit. Please shorten your text to {limit} characters.",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",inputAutocomplete_placeholder:"Start typing...",passwordRules_unmatched_text:"Passwords do not match",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",passwordRules_currentPassword_label:"Current password",passwordRules_newPassword_label:"New password",passwordRules_confirmPassword_label:"Confirm new password",profile_image_change_uploading_text:"Uploading image...",profile_image_change_cta_with_picture:"Change photo",profile_image_change_cta_without_picture:"+ Add profile photo",profile_image_change_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",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!",richTextEditor_placeholder:"Write something...",richTextEditor_toolbar:"Formatting options",richTextEditor_bold:"Bold",richTextEditor_italic:"Italic",richTextEditor_strikeThrough:"Strikethrough",richTextEditor_link:"Link",richTextEditor_link_text:"Text:",richTextEditor_link_text_aria:"Text to be linked:",richTextEditor_link_url:"Link:",richTextEditor_link_placeholder:"Type or paste URL",richTextEditor_link_error_required:"Please enter a URL to link to",richTextEditor_link_open:"Open: {link}",richTextEditor_link_open_text:"Opens in a new window",richTextEditor_link_edit:"Edit",richTextEditor_link_remove:"Remove",richTextEditor_link_button:"Add link",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",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>",tableOfContents:"Table of contents",timeToComplete_hours:"{time, plural, =0 {} one {1 hour} other {# hours}}",timeToComplete_hours_short:"{time}h",timeToComplete_minutes:"{time, plural, =0 {} one {1 minute} other {# minutes}}",timeToComplete_minutes_short:"{time}m",timeToComplete_range:"{early} - {late}",timeToComplete_range_aria:"between {early} and {late}",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",progressTracker:"Step {current} of {total}",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_platform_communities:"Communities",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_news:"News",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_ai:"AI principles",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_explore_communities:"Communities",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",inviteModal_formTitle:"Know someone who might like to join this workshop?",inviteModal_formLabel:"Invite your colleagues by typing or pasting their emails below.",inviteModal_cta:"Send",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_links_communities:"Communities",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",contentTypeLabel_event:"Event",contentTypeLabel_learningHub:"Programme",contentTypeLabel_listPage:"List",contentTypeLabel_microcourse:"Course",contentTypeLabel_qaQuestion:"Q&A",contentTypeLabel_solutionArticle:"Article",contentTypeLabel_communityPage:"Community",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"},Nh={...Xn,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>"},Rh={...Xn,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"},Mh={...Xn,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>"},Ih=Object.freeze(Object.defineProperty({__proto__:null,en:Xn,es:Nh,fr:Rh,pt:Mh},Symbol.toStringTag,{value:"Module"})),La=(e,t=Xn)=>e in t,kt=(e,t,n,r,a={})=>{let i="";return La(`${t}_${n}`)?i=e({id:`${t}_${n}`},a):i=e({id:t},{[r]:n,...a}),i},$h=(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 a=n.length-1;a>=0;a--){const i=Math.pow(10,(a+1)*3);if(i<=e){e=Math.round(e*t/i)/t,e===1e3&&a<n.length-1&&(e=1,a++),r=`${e}${n[a]}`;break}}return r},oa=(e,t)=>C.Children.map(e,n=>Object.is(n,null)?n:C.cloneElement(n,{...t})),Nc=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},Lh=(e,t,n)=>!t.id||!t.name?"":n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),Rc=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var i;if(!n)return e;const a=e.match(rs);if(!a)return e;for(const s of a){const o=s.replace(rs,(c,h)=>h),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=((i=l==null?void 0:l.data)==null?void 0:i.name)||"",u.id=l.id||"";else{const c=l;if(c.startsWith(ns))try{const h=c.replace(ns,"");u.id=h,await r({id:h}).then(p=>{const{name:m}=p;u.name=m||""})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?Lh(e,u,t):s)}return e},Mc=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},zh=(e="")=>e.replace(/\s+/g,"").length>0,is=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}}};const Be=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:a=!1,element:i="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",screenreaderText:c=!1,children:h=!1,...p})=>{const g=Jn(typeof t=="object"),{showTooltip:f,tooltipProps:D}=Rs(!!u);if(typeof t=="object"&&typeof g=="number"){const _=Object.assign({},t),E=_c(Object.keys(_));t=Bc(g,E,_)}!l&&u&&(u="");const y=[];typeof t=="string"&&y.push(t),r&&(y.push("icon"),typeof r=="object"?(y.push(r.icon),r.position?y.push(r.position):y.push("left"),r.hover&&y.push(`hover_${r.hover}`),r.animate&&(y.push("animate"),typeof r.animate=="string"&&y.push(r.animate))):(y.push(r),!r.includes("right")&&!r.includes("left")&&y.push("left"))),n.muted&&y.push("muted"),n.fullWidth&&y.push("full-width");const x={...p,className:Y(e,o,y,{"no-text":!h,disabled:l,button:a}),onClick:_=>{(!a||a[0]==="#")&&s&&(_.preventDefault(),_.stopPropagation()),s&&s(_)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};a&&(i="a",x.href=a);const A=C.createElement(i,x,h||(c?d.jsx(Me,{showOnFocus:!1,children:c}):null));return l&&u?d.jsxs("span",{className:"button-container",...D,children:[d.jsx(En,{isOpen:f,children:u}),A]}):A},kn=({buttons:e,wrappers:t=[],className:n="",...r})=>{const a=e.length>1?"ul":"p",i=e.map((s,o)=>{var l;return a==="p"?d.jsx(Be,{...s},o):d.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:d.jsx(Be,{...s})},o)});return C.createElement(a,{className:Y("button-wrapper",n),...r,children:i})};const tn=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return d.jsx("hr",{className:Y(e,{"has-max-width":t}),style:n})},$o={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"}},qh=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:a}=e?$o[e]:$o.fallback;return{range:t&&t.length>0?t:r,sizes:n||a}},Wh=({format:e,height:t,query:n,width:r})=>{let a=`w=${r}&h=${t}`;return a=e?`${a}&fm=${e}`:a,a=n?`${a}&${n}`:a,a},ii=({format:e,range:t,url:n,query:r})=>t.map(({height:a,width:i})=>`${n}?${Wh({format:e,height:a,query:r,width:i})} ${i}w`).join(", ");const er=({image:e,className:t,testId:n})=>{const{description:r,alt:a,height:i,type:s,query:o,url:l,width:u,loading:c,decoding:h,fetchPriority:p}=e;let m=a;m===""?m="":a==null&&r&&(m=r);const{range:g,sizes:f}=qh(e),D=ii({format:"avif",query:o,range:g,url:l}),y=ii({format:"webp",query:o,range:g,url:l}),x=ii({format:"",query:o,range:g,url:l});return s&&s.includes("svg")?d.jsx("picture",{className:t,children:d.jsx("img",{src:l,alt:r,loading:c||"lazy",decoding:h||"async",fetchpriority:p||"auto",width:u,height:i,"data-testid":n||"image"})}):d.jsxs("picture",{className:t,children:[s!=="image/gif"&&d.jsx("source",{type:"image/avif",srcSet:D,sizes:f,"data-testid":"source"}),d.jsx("source",{type:"image/webp",srcSet:y,sizes:f,"data-testid":"source"}),d.jsx("img",{srcSet:x,sizes:f,src:l,alt:m,loading:c||"lazy",decoding:h||"async",fetchpriority:p||"auto",width:u,height:i,"data-testid":n||"image"})]})};const Hh=({image:e,className:t="",testId:n})=>d.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&d.jsx(er,{image:{...e},className:"image"})}),_n=({href:e,children:t,fallbackElement:n,className:r="",onClick:a,gtmContext:i,gtmType:s,...o})=>{if(e){const l={...o};return a&&(l.onClick=a),i&&(l["data-gtm-event-context"]=i),s&&(l["data-gtm-event-type"]=s),d.jsx("a",{href:e,className:Y("gtm-trackable",r),...l,children:t})}return n?C.createElement(n,{children:t,className:r,...o}):d.jsx(d.Fragment,{children:t})};const Ic=C.forwardRef(({className:e="",children:t},n)=>{const r=C.useRef(null),a=n||r;return d.jsx("aside",{ref:a,className:Y("popover",e),"aria-live":"polite",children:t})}),Is=({children:e})=>typeof document=="object"?vc.createPortal(e,document.body):null;const Uh=({currentStep:e=1,steps:t=1})=>d.jsxs(d.Fragment,{children:[d.jsx(Me,{children:d.jsx(ue.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),d.jsx("div",{className:"progress-tracker",children:d.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const a=r+1;return d.jsxs("div",{className:"dot-wrapper",children:[d.jsx("div",{className:Y("dot",{active:a===e,completed:a<e}),"data-testid":"progress-dot"}),d.jsx("div",{className:Y("line",{active:a<e})})]},r)})})})]});const Vh=({elementId:e,offset:t=20})=>{const n=ue.useIntl(),r=()=>{const a=document.getElementById(e);if(!a)return;const i=document.getElementById("header");i&&window.scrollTo({top:a.offsetTop-i.clientHeight-t})};return d.jsx(Be,{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"})})};const Kh=({items:e,className:t="",...n})=>d.jsx("ul",{className:Y("buckets",t),...n,children:e.map(({title:r,text:a,link:i,...s},o)=>d.jsx("li",{className:"bucket text-medium",children:d.jsxs("a",{href:i,...s,children:[d.jsx("p",{className:"title",children:r}),d.jsx("p",{children:a})]})},o))}),Lo=300,zo="ease-in-out";class Zh{constructor(t){this.el=t,this.summary=t.querySelector("summary"),this.content=t.querySelector(".content"),this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.summary.addEventListener("click",n=>this.onClick(n))}cleanUp(){this.summary.removeEventListener("click",t=>this.onClick(t))}onClick(t){t.preventDefault(),t.stopPropagation(),this.el.style.overflow="hidden",this.isClosing||!this.el.open?this.open():(this.isExpanding||this.el.open)&&this.shrink()}shrink(){this.isClosing=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:Lo,easing:zo}),this.animation.onfinish=()=>this.onAnimationFinish(!1),this.animation.oncancel=()=>this.isClosing=!1}open(){this.el.style.height=`${this.el.offsetHeight}px`,this.el.open=!0,window.requestAnimationFrame(()=>this.expand())}expand(){this.isExpanding=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight+this.content.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:Lo,easing:zo}),this.animation.onfinish=()=>this.onAnimationFinish(!0),this.animation.oncancel=()=>this.isExpanding=!1}onAnimationFinish(t){this.el.open=t,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.el.style.height=this.el.style.overflow=""}}const za=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const a=ue.useIntl(),i=C.useRef(null);return C.useEffect(()=>{let s;return r&&(s=new Zh(i.current)),()=>{r&&s&&s.cleanUp()}},[]),d.jsxs("details",{ref:i,className:Y("collapsible-section",t,{"should-animate":r}),children:[d.jsx("summary",{children:e||a.formatMessage({id:"collapsibleSection_summary"})}),d.jsx("div",{className:"content",children:n})]})},qo={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},Yh=e=>{let t=e;return Object.keys(qo).includes(e)&&(t=qo[e]),`url(${Ht}icons/${t}.svg)`};const Wo={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},$c=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const a=ue.useIntl(),i=t?{"--custom-icon":Yh(t)}:{},s=La(`contentTypeLabel_${e}`)?a.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:d.jsx("small",{className:Y("content-type-label text-small",e in Wo?Wo[e]:e,r,{"has-custom-icon":t}),style:i,"data-testid":"content-type-label",children:n||s})};const Nt=({variant:e="primary",icon:t,styling:n={},className:r="",children:a,...i})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Ht}icons/${t}.svg)`}:{};return d.jsx("div",{className:Y("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...i,children:a})};const an=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let a=n&&!!Object.keys(n).length;const i=typeof n=="object"&&"breakpoints"in n,s=Jn(i);if(i&&typeof n=="object"&&typeof s=="number"){const h=Object.assign({},n.breakpoints),p=_c(Object.keys(h));a=Bc(s,p,h)}const{breakpoints:o,text:l="",component:u,...c}=n;return d.jsx(Nt,{variant:"subtle",className:Y("empty-state-box",e,r),children:d.jsxs(d.Fragment,{children:[t&&typeof t=="string"?d.jsx(Pt,{options:{forceBlock:!0},children:t}):t,a&&typeof n=="object"&&(u||d.jsx(Be,{...c,variant:n.variant?n.variant:"secondary",children:l}))]})})};const ss=({children:e,...t})=>d.jsx("p",{...t,children:e}),Lc={q:ss,blockquote:ss};for(let e=1;e<=6;e++)Lc[`h${e}`]={component:ss,props:{className:"title"}};const zc=({type:e="default",className:t="",heading:n=!1,children:r})=>d.jsxs("div",{className:Y("helper-text-box text-small",e,t),children:[n&&d.jsx("p",{className:"title",children:n}),typeof r=="string"?d.jsx(Pt,{options:{wrapper:C.Fragment,forceBlock:!0,overrides:Lc},children:r}):d.jsx("p",{children:r})]});const qc=({id:e,className:t="",show:n=!1,hide:r=!1,text:a,markdownOptions:i,children:s})=>{const o=ue.useIntl(),l=C.useRef(null);e||(e=Date.now().toString());const[u,c]=C.useState(""),[h,p]=C.useState("closed");C.useEffect(()=>{const f=l.current;if(f)return f.addEventListener("transitionend",m),()=>{f.removeEventListener("transitionend",m)}},[]),C.useEffect(()=>{if(!a||typeof a!="string")return;const f=a.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_likes_show:"Show who liked this {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_share_copy_link:"Copy link",discussion_share_copy_link_success:"Link copied to clipboard",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_fieldWrapper_characterLimit_aria_default:"You have {remaining, plural, =0 {no characters} one {1 character} other {# characters}} remaining.",form_fieldWrapper_characterLimit_aria_over:"You are {over, plural, one {1 character} other {# characters}} over the limit. Please shorten your text to {limit} characters.",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",inputAutocomplete_placeholder:"Start typing...",passwordRules_unmatched_text:"Passwords do not match",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",passwordRules_currentPassword_label:"Current password",passwordRules_newPassword_label:"New password",passwordRules_confirmPassword_label:"Confirm new password",profile_image_change_uploading_text:"Uploading image...",profile_image_change_cta_with_picture:"Change photo",profile_image_change_cta_without_picture:"+ Add profile photo",profile_image_change_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",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!",richTextEditor_placeholder:"Write something...",richTextEditor_toolbar:"Formatting options",richTextEditor_bold:"Bold",richTextEditor_italic:"Italic",richTextEditor_strikeThrough:"Strikethrough",richTextEditor_link:"Link",richTextEditor_link_text:"Text:",richTextEditor_link_text_aria:"Text to be linked:",richTextEditor_link_url:"Link:",richTextEditor_link_placeholder:"Type or paste URL",richTextEditor_link_error_required:"Please enter a URL to link to",richTextEditor_link_open:"Open: {link}",richTextEditor_link_open_text:"Opens in a new window",richTextEditor_link_edit:"Edit",richTextEditor_link_remove:"Remove",richTextEditor_link_button:"Add link",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",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>",tableOfContents:"Table of contents",timeToComplete_hours:"{time, plural, =0 {} one {1 hour} other {# hours}}",timeToComplete_hours_short:"{time}h",timeToComplete_minutes:"{time, plural, =0 {} one {1 minute} other {# minutes}}",timeToComplete_minutes_short:"{time}m",timeToComplete_range:"{early} - {late}",timeToComplete_range_aria:"between {early} and {late}",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",progressTracker:"Step {current} of {total}",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_platform_communities:"Communities",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_news:"News",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_ai:"AI principles",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_explore_communities:"Communities",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",inviteModal_formTitle:"Know someone who might like to join this workshop?",inviteModal_formLabel:"Invite your colleagues by typing or pasting their emails below.",inviteModal_cta:"Send",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_links_communities:"Communities",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",contentTypeLabel_event:"Event",contentTypeLabel_learningHub:"Programme",contentTypeLabel_listPage:"List",contentTypeLabel_microcourse:"Course",contentTypeLabel_qaQuestion:"Q&A",contentTypeLabel_solutionArticle:"Article",contentTypeLabel_communityPage:"Community",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"},Nh={...Xn,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>"},Rh={...Xn,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"},Mh={...Xn,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>"},Ih=Object.freeze(Object.defineProperty({__proto__:null,en:Xn,es:Nh,fr:Rh,pt:Mh},Symbol.toStringTag,{value:"Module"})),La=(e,t=Xn)=>e in t,kt=(e,t,n,r,a={})=>{let i="";return La(`${t}_${n}`)?i=e({id:`${t}_${n}`},a):i=e({id:t},{[r]:n,...a}),i},$h=(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 a=n.length-1;a>=0;a--){const i=Math.pow(10,(a+1)*3);if(i<=e){e=Math.round(e*t/i)/t,e===1e3&&a<n.length-1&&(e=1,a++),r=`${e}${n[a]}`;break}}return r},oa=(e,t)=>C.Children.map(e,n=>Object.is(n,null)?n:C.cloneElement(n,{...t})),Nc=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},Lh=(e,t,n)=>!t.id||!t.name?"":n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),Rc=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var i;if(!n)return e;const a=e.match(rs);if(!a)return e;for(const s of a){const o=s.replace(rs,(c,h)=>h),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=((i=l==null?void 0:l.data)==null?void 0:i.name)||"",u.id=l.id||"";else{const c=l;if(c.startsWith(ns))try{const h=c.replace(ns,"");u.id=h,await r({id:h}).then(p=>{const{name:m}=p;u.name=m||""})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?Lh(e,u,t):s)}return e},Mc=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},zh=(e="")=>e.replace(/\s+/g,"").length>0,is=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}}};const Be=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:a=!1,element:i="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",screenreaderText:c=!1,children:h=!1,...p})=>{const g=Jn(typeof t=="object"),{showTooltip:f,tooltipProps:D}=Rs(!!u);if(typeof t=="object"&&typeof g=="number"){const _=Object.assign({},t),E=_c(Object.keys(_));t=Bc(g,E,_)}!l&&u&&(u="");const y=[];typeof t=="string"&&y.push(t),r&&(y.push("icon"),typeof r=="object"?(y.push(r.icon),r.position?y.push(r.position):y.push("left"),r.hover&&y.push(`hover_${r.hover}`),r.animate&&(y.push("animate"),typeof r.animate=="string"&&y.push(r.animate))):(y.push(r),!r.includes("right")&&!r.includes("left")&&y.push("left"))),n.muted&&y.push("muted"),n.fullWidth&&y.push("full-width");const x={...p,className:Y(e,o,y,{"no-text":!h,disabled:l,button:a}),onClick:_=>{(!a||a[0]==="#")&&s&&(_.preventDefault(),_.stopPropagation()),s&&s(_)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};a&&(i="a",x.href=a);const A=C.createElement(i,x,h||(c?d.jsx(Me,{showOnFocus:!1,children:c}):null));return l&&u?d.jsxs("span",{className:"button-container",...D,children:[d.jsx(En,{isOpen:f,children:u}),A]}):A},kn=({buttons:e,wrappers:t=[],className:n="",...r})=>{const a=e.length>1?"ul":"p",i=e.map((s,o)=>{var l;return a==="p"?d.jsx(Be,{...s},o):d.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:d.jsx(Be,{...s})},o)});return C.createElement(a,{className:Y("button-wrapper",n),...r,children:i})};const tn=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return d.jsx("hr",{className:Y(e,{"has-max-width":t}),style:n})},$o={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"}},qh=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:a}=e?$o[e]:$o.fallback;return{range:t&&t.length>0?t:r,sizes:n||a}},Wh=({format:e,height:t,query:n,width:r})=>{let a=`w=${r}&h=${t}`;return a=e?`${a}&fm=${e}`:a,a=n?`${a}&${n}`:a,a},ii=({format:e,range:t,url:n,query:r})=>t.map(({height:a,width:i})=>`${n}?${Wh({format:e,height:a,query:r,width:i})} ${i}w`).join(", ");const er=({image:e,className:t,testId:n})=>{const{description:r,alt:a,height:i,type:s,query:o,url:l,width:u,loading:c,decoding:h,fetchPriority:p}=e,{range:m,sizes:g}=qh(e),f=ii({format:"avif",query:o,range:m,url:l}),D=ii({format:"webp",query:o,range:m,url:l}),y=ii({format:"",query:o,range:m,url:l});return s&&s.includes("svg")?d.jsx("picture",{className:t,children:d.jsx("img",{src:l,alt:r,loading:c||"lazy",decoding:h||"async",fetchpriority:p||"auto",width:u,height:i,"data-testid":n||"image"})}):d.jsxs("picture",{className:t,children:[s!=="image/gif"&&d.jsx("source",{type:"image/avif",srcSet:f,sizes:g,"data-testid":"source"}),d.jsx("source",{type:"image/webp",srcSet:D,sizes:g,"data-testid":"source"}),d.jsx("img",{srcSet:y,sizes:g,src:l,alt:a||r,loading:c||"lazy",decoding:h||"async",fetchpriority:p||"auto",width:u,height:i,"data-testid":n||"image"})]})};const Hh=({image:e,className:t="",testId:n})=>d.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&d.jsx(er,{image:{...e},className:"image"})}),_n=({href:e,children:t,fallbackElement:n,className:r="",onClick:a,gtmContext:i,gtmType:s,...o})=>{if(e){const l={...o};return a&&(l.onClick=a),i&&(l["data-gtm-event-context"]=i),s&&(l["data-gtm-event-type"]=s),d.jsx("a",{href:e,className:Y("gtm-trackable",r),...l,children:t})}return n?C.createElement(n,{children:t,className:r,...o}):d.jsx(d.Fragment,{children:t})};const Ic=C.forwardRef(({className:e="",children:t},n)=>{const r=C.useRef(null),a=n||r;return d.jsx("aside",{ref:a,className:Y("popover",e),"aria-live":"polite",children:t})}),Is=({children:e})=>typeof document=="object"?vc.createPortal(e,document.body):null;const Uh=({currentStep:e=1,steps:t=1})=>d.jsxs(d.Fragment,{children:[d.jsx(Me,{children:d.jsx(ue.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),d.jsx("div",{className:"progress-tracker",children:d.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const a=r+1;return d.jsxs("div",{className:"dot-wrapper",children:[d.jsx("div",{className:Y("dot",{active:a===e,completed:a<e}),"data-testid":"progress-dot"}),d.jsx("div",{className:Y("line",{active:a<e})})]},r)})})})]});const Vh=({elementId:e,offset:t=20})=>{const n=ue.useIntl(),r=()=>{const a=document.getElementById(e);if(!a)return;const i=document.getElementById("header");i&&window.scrollTo({top:a.offsetTop-i.clientHeight-t})};return d.jsx(Be,{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"})})};const Kh=({items:e,className:t="",...n})=>d.jsx("ul",{className:Y("buckets",t),...n,children:e.map(({title:r,text:a,link:i,...s},o)=>d.jsx("li",{className:"bucket text-medium",children:d.jsxs("a",{href:i,...s,children:[d.jsx("p",{className:"title",children:r}),d.jsx("p",{children:a})]})},o))}),Lo=300,zo="ease-in-out";class Zh{constructor(t){this.el=t,this.summary=t.querySelector("summary"),this.content=t.querySelector(".content"),this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.summary.addEventListener("click",n=>this.onClick(n))}cleanUp(){this.summary.removeEventListener("click",t=>this.onClick(t))}onClick(t){t.preventDefault(),t.stopPropagation(),this.el.style.overflow="hidden",this.isClosing||!this.el.open?this.open():(this.isExpanding||this.el.open)&&this.shrink()}shrink(){this.isClosing=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:Lo,easing:zo}),this.animation.onfinish=()=>this.onAnimationFinish(!1),this.animation.oncancel=()=>this.isClosing=!1}open(){this.el.style.height=`${this.el.offsetHeight}px`,this.el.open=!0,window.requestAnimationFrame(()=>this.expand())}expand(){this.isExpanding=!0;const t=`${this.el.offsetHeight}px`,n=`${this.summary.offsetHeight+this.content.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[t,n]},{duration:Lo,easing:zo}),this.animation.onfinish=()=>this.onAnimationFinish(!0),this.animation.oncancel=()=>this.isExpanding=!1}onAnimationFinish(t){this.el.open=t,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.el.style.height=this.el.style.overflow=""}}const za=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const a=ue.useIntl(),i=C.useRef(null);return C.useEffect(()=>{let s;return r&&(s=new Zh(i.current)),()=>{r&&s&&s.cleanUp()}},[]),d.jsxs("details",{ref:i,className:Y("collapsible-section",t,{"should-animate":r}),children:[d.jsx("summary",{children:e||a.formatMessage({id:"collapsibleSection_summary"})}),d.jsx("div",{className:"content",children:n})]})},qo={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},Yh=e=>{let t=e;return Object.keys(qo).includes(e)&&(t=qo[e]),`url(${Ht}icons/${t}.svg)`};const Wo={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},$c=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const a=ue.useIntl(),i=t?{"--custom-icon":Yh(t)}:{},s=La(`contentTypeLabel_${e}`)?a.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:d.jsx("small",{className:Y("content-type-label text-small",e in Wo?Wo[e]:e,r,{"has-custom-icon":t}),style:i,"data-testid":"content-type-label",children:n||s})};const Nt=({variant:e="primary",icon:t,styling:n={},className:r="",children:a,...i})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Ht}icons/${t}.svg)`}:{};return d.jsx("div",{className:Y("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...i,children:a})};const an=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let a=n&&!!Object.keys(n).length;const i=typeof n=="object"&&"breakpoints"in n,s=Jn(i);if(i&&typeof n=="object"&&typeof s=="number"){const h=Object.assign({},n.breakpoints),p=_c(Object.keys(h));a=Bc(s,p,h)}const{breakpoints:o,text:l="",component:u,...c}=n;return d.jsx(Nt,{variant:"subtle",className:Y("empty-state-box",e,r),children:d.jsxs(d.Fragment,{children:[t&&typeof t=="string"?d.jsx(Pt,{options:{forceBlock:!0},children:t}):t,a&&typeof n=="object"&&(u||d.jsx(Be,{...c,variant:n.variant?n.variant:"secondary",children:l}))]})})};const ss=({children:e,...t})=>d.jsx("p",{...t,children:e}),Lc={q:ss,blockquote:ss};for(let e=1;e<=6;e++)Lc[`h${e}`]={component:ss,props:{className:"title"}};const zc=({type:e="default",className:t="",heading:n=!1,children:r})=>d.jsxs("div",{className:Y("helper-text-box text-small",e,t),children:[n&&d.jsx("p",{className:"title",children:n}),typeof r=="string"?d.jsx(Pt,{options:{wrapper:C.Fragment,forceBlock:!0,overrides:Lc},children:r}):d.jsx("p",{children:r})]});const qc=({id:e,className:t="",show:n=!1,hide:r=!1,text:a,markdownOptions:i,children:s})=>{const o=ue.useIntl(),l=C.useRef(null);e||(e=Date.now().toString());const[u,c]=C.useState(""),[h,p]=C.useState("closed");C.useEffect(()=>{const f=l.current;if(f)return f.addEventListener("transitionend",m),()=>{f.removeEventListener("transitionend",m)}},[]),C.useEffect(()=>{if(!a||typeof a!="string")return;const f=a.split(`
|
|
36
36
|
`);c(f.length<3?`${a.substring(0,400)}...`:f.slice(0,3).join(`
|
|
37
37
|
`))},[a]),C.useEffect(()=>{h==="ready-to-close"&&p("closing")},[h]);const m=({propertyName:f})=>{f==="max-height"&&p(D=>D==="opening"?"open":D==="closing"?"closed":D)};if(!a)return null;const g=["opening","open"].includes(h);return d.jsxs(Nt,{variant:"subtle",className:Y("hide-show-text-box",t),children:[d.jsxs("div",{ref:l,id:e,className:Y("content",h),children:[d.jsx(Pt,{options:{forceBlock:!0,...i},children:h==="closed"?u:a}),h!=="closed"&&s]}),d.jsx("p",{className:"cta",children:d.jsx(Be,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:Y({"rotate-180":g}),onClick:()=>{p(g?"ready-to-close":"opening")},"aria-expanded":g,"aria-controls":e,children:g?r||o.formatMessage({id:"hideShowTextBox_hide"}):n||o.formatMessage({id:"hideShowTextBox_show"})})})]})};const Gh=({element:e="ul",layout:t="vertical",variant:n="default",items:r=[],styling:a={},className:i=""})=>{const{hasBorder:s=!1,zebraStriping:o=!1}=a;return C.createElement(e,{className:Y("icon-bulleted-list text-medium",n,i,{"has-border":s,"has-zebra-stripes":o,[t]:e!=="dl"}),children:r.map((l,u)=>{const c={wrapper:C.Fragment,forceInline:!0},h={"--icon":`url(${Ht}icons/${l.icon}.svg)`};return e==="dl"?d.jsxs(C.Fragment,{children:[d.jsx("dt",{style:h,children:d.jsx(Pt,{options:c,children:l.dt||""})},`dt-${u}`),d.jsx("dd",{children:typeof l.text=="string"?d.jsx(Pt,{options:c,children:l.text}):l.text},`dd-${u}`)]},`dl-${u}`):d.jsx("li",{style:h,children:typeof l.text=="string"?d.jsx(Pt,{options:c,children:l.text}):l.text},u)})})},tt=()=>C.Fragment,Qh=({children:e})=>d.jsx(Nt,{variant:"secondary",children:e}),Jh=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?d.jsx("p",{className:"center",children:e}):d.jsx("div",{className:"center",children:e}),Xh=["span","strong","h1","h2","h3","h4","h5","h6","p"],em=({children:e})=>{const t=ue.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const i of C.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number"))if(C.isValidElement(i)&&i.type==="summary"){if(i.props&&i.props.children){for(const s of C.Children.toArray(i.props.children))if(!(!s||typeof s=="string"||typeof s=="number")&&C.isValidElement(s)){const o=s.type;if(Xh.includes(o)){for(n=s.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 a=n?n.toString():"";return d.jsx(za,{label:a,className:["Sources","Resources"].includes(a)?"discrete-links":"",children:r.map(i=>i)})},tm=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return d.jsx(Nt,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return d.jsx(Nt,{variant:"primary",children:e});case"pink-textbox":return d.jsx(Nt,{variant:"tertiary",children:e});case"content":return typeof e=="object"&&Object.keys(e||{}).length===1?d.jsx("p",{children:e}):e;default:return d.jsx("div",{...t,children:e})}return d.jsx("div",{...t,children:e})},nm=e=>{const t=ue.useIntl(),n=Date.now().toString();let r="default";const a=e.src;return a.includes("youtube")||a.includes("vimeo")?r="video":a.includes("riddle")||a.includes("sli.do")?r="poll":a.includes("padlet")&&(r="padlet"),d.jsxs(d.Fragment,{children:[d.jsx(Me,{element:"a",href:`#content-after-iframe-${n}`,onClick:i=>{var s;i.preventDefault(),i.stopPropagation(),(s=document.getElementById(`content-after-iframe-${n}`))==null||s.scrollIntoView({behavior:"smooth"})},children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})}),d.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),d.jsx("span",{id:`content-after-iframe-${n}`})]})},Ho=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},rm=({children:e,...t})=>{let n={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(n.target="_blank");let r=e,a=!1;for(const i of C.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number")&&C.isValidElement(i)){const s=i.type;if(["button","center","span","strong"].includes(s)&&i.props&&i.props.children&&i.props.children[0])for((s==="button"||Ho(i.props.children[0])==="button")&&(a=!0),r=i.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!C.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&Ho(r)==="button"&&(a=!0);else break}return a?(n={...n,className:"button primary medium"},d.jsx("p",{className:"center",children:d.jsx(Be,{variant:"primary",size:"medium",...n,children:r})})):d.jsx("a",{...n,children:r})},os=({children:e,...t})=>d.jsx("span",{className:Y({url:t==null?void 0:t.href}),children:e});const am={default:{a:rm,CollapsibleSection:za,TextBox:Nt,CaseStudy:Qh,style:tt,details:em,div:tm,iframe:nm,center:Jh},"text-only":{h1:tt,h2:tt,h3:tt,h4:tt,h5:tt,h6:tt,style:tt,details:tt,div:tt,TextBox:tt,CollapsibleSection:tt,CaseStudy:tt,blockquote:tt,iframe:tt,button:tt}},Vn=({className:e="",options:t={},children:n,overrideType:r="default",styling:a={}})=>{if(!n)return null;const{highlightTitles:i=!1}=a;n=n.replace(/^<br\/?>/,"");const s={wrapper:C.Fragment,forceBlock:!0};let o=am[r];return t.overrides&&(o={...o,...t.overrides}),d.jsx("div",{className:Y("markdown-text",e,{"highlight-titles":i}),children:d.jsx(Pt,{options:{...s,...t,overrides:o},children:n})})};const Wc=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:a=""})=>{const i=e?{"--max-width":`${e/16}rem`}:{};return d.jsxs("section",{className:Y("page-heading",a),children:[d.jsxs("div",{className:Y("content",{"has-max-width":e}),style:i,children:[t&&t.text&&C.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&C.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),r]})};const hn=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:a="",children:i,...s})=>{const o={"--icon":`url(${Ht}icons/${r}.svg)`},{showTooltip:l,tooltipProps:u}=Rs(!!a),c=d.jsx("span",{...u,className:Y("pill",e,t,n,{"has-icon":r}),style:o,...s,children:i});return a?d.jsxs("span",{className:"pill-wrapper",children:[d.jsx(En,{isOpen:l,children:a}),c]}):c};const Er=({element:e="p",children:t=null,className:n="",...r})=>C.createElement(e,{...r,className:Y("status-banner text-small",n),"aria-live":"assertive"},t);const im=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const a=ue.useIntl(),{showText:i=!1,layout:s="bar",size:o="default",color:l="default"}=e,u=t>75?100:t>50?75:t>25?50:t>5?25:0,c={"--progress":`${t}%`};return d.jsx("span",{className:Y(`progress-bar section-${u}`,s,r,{[o]:o!=="default",[l!=="default"?l:""]:l!=="default"}),style:c,children:C.createElement(i?"span":Me,{className:i?"text":"",children:n||a.formatMessage({id:"progressBar"},{number:t})})})},$s=C.memo(im);const si="loadingBlock_",sm=({progress:e=0,steps:t=!1,className:n=""})=>{const r=ue.useIntl();t||(t={0:{text:r.formatMessage({id:`${si}loading`})},75:{text:r.formatMessage({id:`${si}almostDone`})},100:{text:r.formatMessage({id:`${si}complete`})}});let a=null;const i=Object.keys(t);for(let o=0;o<i.length&&!(e<parseInt(i[o]));o++)a=i[o];const s=a&&t[a].icon?{"--icon":`url(${Ht}icons/${t[a].icon}.svg)`}:{};return d.jsxs(Nt,{className:Y("loading-block",n,{"has-icon":a&&t[a].icon}),variant:"subtle",style:s,children:[a&&d.jsx("span",{className:"step",children:t[a].text}),d.jsx($s,{progress:e})]})},om=C.memo(sm);const wt=({element:e="div",className:t="",...n})=>d.jsx($a,{element:e,className:Y("loading-placeholder",t),...n});const us={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"],answers:["text","text","text"],"text-page":["title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"form-with-answers":["question","subtitle","form","answers","answers","answers","answers","answers"],"general-website-page":["banner","text-page"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"],"course-navigation":["button","button"],"course-lesson-page":["breadcrumb","course-navigation","text-page"],"course-lesson-quiz":["text-page","quiz-box"]},Hc=(e,t)=>e in us?d.jsx("div",{className:e,children:us[e].map((n,r)=>Hc(n,r))},t):d.jsx(wt,{className:e},t),Ls=({layout:e="overview-page",...t})=>d.jsx("div",{className:Y("loading-state",e),...t,children:us[e].map((n,r)=>Hc(n,r))}),Uc=e=>{const t=e&&e.toUpperCase().trim().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):""},Lr=["#5AB6A3","#A2D7AF","#806056","#3962B3"],um=e=>{const t=Math.ceil(26/Lr.length),n=Uc(e).toLowerCase();if(n==="")return Lr[0];const r=n.charCodeAt(0)-96;for(let a=0;a<Lr.length;a++)if(r<=t*(a+1))return Lr[a]};const Uo=256,sn=({className:e="",src:t="",name:n,alt:r,width:a=Uo,height:i=Uo,...s})=>{const[o,l]=C.useState(!1),u=C.useRef(null);let c=r;c===""?c="":r==null&&(c=n),C.useEffect(()=>{const p=u.current;if(!p)return;const m=p.getContext("2d");if(!m)return;const g=a,f=i;typeof window<"u"&&window.devicePixelRatio&&(p.width=g*window.devicePixelRatio,p.height=f*window.devicePixelRatio,m.scale(window.devicePixelRatio,window.devicePixelRatio)),m.fillStyle=um(n),m.fillRect(0,0,g,f),m.font=`${g/3}px Arial`,m.textAlign="center",m.fillStyle="white",m.fillText(Uc(n),g/2,f/1.6)},[n]);let h=!1;return t&&t!==""&&!o&&(t.includes("http")||t.includes("//"))&&(h=!0),d.jsx("figure",{className:Y("profile-picture",e,{error:o}),...s,children:h?d.jsx("img",{src:t,alt:c,onError:()=>{l(!0)},width:a,height:i}):d.jsx("canvas",{ref:u})})},zs=e=>e==="apolitical"?{image:`${Ht}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${Ht}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},lm=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const a=e!=="",i=t!=="",s=n!=="";if(!a&&!i&&!s)return"";const o=`${e}${a&&i?` — ${t}`:t}`;let l=`${o}${(a||i)&&s?`, ${n}`:n}`;return l.length>r&&(l=o),l.length>r&&(l=Hn(l,r)),l};const tr=({element:e="div",member:t="community",additionalContent:n=!1,styling:r={},functions:a={},gtmContext:i="member",gtmType:s="member-click",className:o="",alt:l=""})=>{const u=ue.useIntl(),{size:c="medium"}=r,h=zs(t);h.name||(h.name=u.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:p,image:m}=h;let{url:g}=h;t.link!==void 0&&(t.link===!1?g=void 0:g=t.link);const f=lm(h),D=n&&n.createdAt?as(n.createdAt):!1,y=n&&n.createdAt?Ms(n.createdAt):"";return C.createElement(e,{className:Y("member text-medium",c,o),...a,children:d.jsxs(_n,{href:g,gtmType:s,gtmContext:i,onClick:x=>{x==null||x.stopPropagation()},children:[d.jsx(sn,{name:p,src:m,alt:l}),d.jsxs("p",{className:"details",children:[d.jsxs("strong",{children:[p,n&&d.jsxs("span",{className:"additional-content",children:[n.createdAt&&D&&d.jsx("span",{className:"date",title:y,"aria-label":y,children:u.formatMessage({id:`dates_${D.path}`},{number:D.number})}),n.didEdit&&d.jsx("em",{children:u.formatMessage({id:"discussion_edited"})})]})]}),f&&d.jsx("small",{className:Y({"text-medium":c==="large"}),children:f})]})]})})};const Vo={small:24,medium:48},qs=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:a,showGap:i,showPlaceholders:s}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,multipleText:l,className:u="",...c})=>{const h=ue.useIntl();return!n||n.length===0?null:C.createElement(e,{...c,className:Y("contributors",u,a,{"has-gap":i}),children:d.jsxs(d.Fragment,{children:[d.jsx("ul",{children:n.map((p,m)=>{let g,f="";if(m<o){const{name:D="",image:y=""}=zs(p);if(s)return d.jsx(wt,{element:"li",className:"contributor"},m);g=d.jsx(sn,{name:D,src:y,width:Vo[a||"medium"],height:Vo[a||"medium"]})}else if(m===o){const D=(t||n.length)-o;g=d.jsxs("small",{className:Y({"large-number":D>99}),children:["+",$h(D,0)]}),f="number-left"}return g?d.jsx("li",{className:Y("contributor",f),children:g},m):null})}),r&&d.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?h.formatMessage({id:`member_${n[0]}`}):Hn(n[0].name||"",20):l||null})]})})};const Ws=({limit:e,valueLength:t})=>{const n=ue.useIntl(),r="form_fieldWrapper_characterLimit";if(e===0)return null;const a=e-t,i=Math.abs(t-e);return d.jsxs("small",{className:Y("character-limit",{"near-limit":t>=.99*e,"approaching-limit":t>=.9*e&&t<.99*e}),"aria-live":"polite","aria-label":n.formatMessage({id:`${r}_aria_${a<0?"over":"default"}`},{remaining:a,over:i,limit:e}),children:[d.jsx("span",{className:"hidden",children:n.formatMessage({id:r})}),t," / ",e]})},qa=e=>(e==null?void 0:e.toString().length)||0,Vc=(e,t=null)=>{const n={};return e===0||(n["data-character-limit"]=e,t&&(n.functions={onChange:r=>{qa(r)>e&&(r=r==null?void 0:r.toString().slice(0,e)),t(r)}})),n};const zr="emailHelperTextBox_",Kc=({type:e,email:t,redirectPath:n,resendVerificationCode:r})=>{const a=ue.useIntl(),[i,s]=C.useState({path:`${zr}default`,type:"default",link:{},mail:{},error:""}),[o,l]=C.useState(!1),u=C.useCallback(m=>{m.preventDefault(),m.stopPropagation();const g=f=>{s({path:`${zr}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:D=>u(D),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:f})};if(typeof r!="function"){g(a.formatMessage({id:`${zr}error_noFunction`}));return}l(!0),r(t).then(()=>{localStorage.setItem("email",t),window.location.href=n||"/signup/verify-email"}).catch(f=>{g(f.message)}).finally(()=>{l(!1)})},[t,n,r]);C.useEffect(()=>{let m=zr,g="default",f={},D={};switch(e){case"gov":m+="autoApproved",g="success";break;case"nonGov":m+="unrecognisedEmail",g="error",f={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":m+="pendingApproval",g="error",D={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":m+="emailUnverified",g="error",f={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:y=>u(y),"data-testid":"send-verify-email-click"};break;case"exists":m+="emailAlreadyExists",g="error",f={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},D={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:m+="default",f={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}s({...i,path:m,type:g,link:f,mail:D})},[e]);const c={};return["link","mail"].forEach(m=>{c[m]=Object.keys(i[m]).length?g=>d.jsx("a",{...i[m],children:g}):g=>g}),d.jsx(zc,{type:i.type,heading:o?!1:a.formatMessage({id:`${i.path}_title`}),children:o?d.jsxs(d.Fragment,{children:[d.jsx(wt,{element:"span"}),d.jsx(wt,{element:"span"})]}):a.formatMessage({id:`${i.path}_text`},{...c,strong:m=>d.jsx("strong",{children:m}),em:m=>d.jsx("em",{children:m}),br:d.jsxs(d.Fragment,{children:[d.jsx("br",{}),d.jsx("br",{})]}),error:i.error})})},Rn=({className:e="",element:t="input",id:n,inputRef:r,functions:a={onChange:()=>{}},name:i=n,placeholder:s,type:o="text",value:l,...u})=>{const c=C.useRef(),h=r||c;return C.createElement(t,{ref:h,...u,type:o,id:n,name:i,className:Y(e,t,{"has-scrollbar":o==="textarea"&&h.current&&h.current.clientHeight<h.current.scrollHeight}),value:l,placeholder:s,...a,onChange:p=>{const m=p.target;a.onChange(m.value)}})};const Tn={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},cm=500,dm=({id:e,name:t=e,value:n,placeholder:r,functions:a={onChange:()=>{},onKeyInput:async()=>new Promise(()=>{})},...i})=>{const{onChange:s=()=>{},onKeyInput:o=async()=>{}}=a,[{input:l,displayInput:u,debouncedInput:c},h]=C.useState({input:n,displayInput:n,debouncedInput:n}),[{predictions:p,activePredictionIndex:m,isPredictionSelected:g},f]=C.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!n}),{formatMessage:D}=ue.useIntl();r||(r=D({id:"inputAutocomplete_placeholder"})),C.useEffect(()=>{const _=setTimeout(()=>{g||h(E=>({...E,debouncedInput:l}))},cm);return()=>{clearTimeout(_)}},[l,g]),C.useEffect(()=>{c&&!g?(async()=>{try{const E=await o(c)||[];f(F=>({...F,predictions:E}))}catch(E){console.error("Error fetching predictions:",E),f(F=>({...F,predictions:[]}))}})():f(_=>({..._,predictions:[]}))},[c,g]),C.useEffect(()=>{m>=0&&p[m]&&h(_=>({..._,displayInput:p[m].description}))},[m,p]);const y=_=>{[Tn.DOWN,Tn.UP,Tn.ENTER].includes(_.key)&&(_.preventDefault(),_.key===Tn.DOWN&&m<p.length-1?f(E=>({...E,activePredictionIndex:m+1})):_.key===Tn.UP&&m>0?f(E=>({...E,activePredictionIndex:m-1})):_.key===Tn.ENTER&&m>-1&&(s(p[m].description),h(E=>({...E,input:p[m].description})),f(E=>({...E,predictions:[],isPredictionSelected:!0}))))},x=_=>{s(_.target.value),h(E=>({...E,input:_.target.value,displayInput:_.target.value})),f(E=>({...E,activePredictionIndex:-1,isPredictionSelected:!1}))},A=_=>{s(_.description),h(E=>({...E,input:_.description,displayInput:_.description})),f(E=>({...E,isPredictionSelected:!0,predictions:[]}))};return d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",value:u,onChange:x,onKeyDown:y,placeholder:r,name:t,id:e,...i}),d.jsx("ul",{className:"predictions-list",children:p.map((_,E)=>d.jsx("li",{onClick:()=>A(_),onMouseEnter:()=>f(F=>({...F,activePredictionIndex:E})),className:Y("predictions-list-item",{active:E===m}),children:_.description},E))})]})};const Zc=({className:e="",disabled:t,element:n="p",functions:r={onChange:()=>{}},id:a,inputRef:i,intlPath:s=!1,label:o,shownValue:l=!0,type:u="checkbox",value:c,...h})=>{const p=ue.useIntl(),{onChange:m,...g}=r,f=()=>{t||m(c?null:l)},D=d.jsxs(d.Fragment,{children:[d.jsx("input",{ref:i,id:a,name:a,type:u,value:l,checked:c,onKeyDown:y=>{(y.key==="Enter"||y.code==="Space")&&(y.preventDefault(),y.stopPropagation(),f())},readOnly:!0,disabled:t}),d.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),d.jsx("label",{htmlFor:a,children:o||p.formatMessage({id:s?`${s}_${a}`:a})})]});return C.createElement(n,{onClick:y=>{const x=y.target;x.nodeName.toLowerCase()==="a"||x.parentNode&&x.parentNode.nodeName.toLowerCase()==="a"||(y.preventDefault(),y.stopPropagation(),f())},className:Y("checkbox-wrapper",e),...h,...g},D)};const fm=C.memo(function({direction:t="down"}){return d.jsx($a,{className:Y("rotating-chevron",`direction-${t}`)})});const hm=({className:e,options:t,initialValue:n,value:r,functions:a={onChange:()=>{},onMultiSelectSubmit:()=>{}},gtm:{context:i}={context:""},placeholder:s,multiSelect:o,multiSelectOptions:l,id:u})=>{const c=ue.useIntl(),[h,p]=C.useState(!1),m=r||n,g=Array.isArray(m)?[...m]:m?[m]:[],[f,D]=C.useState(g);let y;Array.isArray(f)&&f.length===1&&typeof f[0]=="string"?y=t&&f?t.find(S=>S.id===f[0]):t?t[0]:{id:"",label:""}:Array.isArray(f)&&f.length===1&&typeof f[0]!="string"?y=f[0]:y={id:"",label:""},C.useEffect(()=>{D(g)},[r,n]);const{onChange:x,onMultiSelectSubmit:A,..._}=a,E=S=>{if(o){let $=[];f!=null&&f.includes(S.id)?$=f.filter(R=>R!==S.id):$=[...f,S.id],D([...$]),x&&x([...$])}else D([S]),x&&x(S.id),p(!1)},F=S=>{if(S==="all"){const $=(t==null?void 0:t.map(R=>R.id))||[];D($),x&&x($)}else D([]),x&&x([])};return d.jsxs("div",{className:Y("dropdown-wrapper",e),children:[d.jsxs("button",{className:"input","aria-expanded":h,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:S=>{S.preventDefault(),S.stopPropagation(),p(!h)},"data-testid":"dropdown-selector",..._,children:[o?`${s} · ${f.length}`:y.label,d.jsx(fm,{direction:h?"up":"down"})]}),d.jsx("select",{defaultValue:y.id,onChange:S=>{S.preventDefault(),S.stopPropagation();const $=t&&t.find(R=>R.id===S.target.value);E($)},hidden:!h,..._,children:t==null?void 0:t.map(S=>d.jsx("option",{value:S.id,children:S.label},S.id))}),d.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!h,children:[d.jsxs("div",{className:"dropdown-menu-list",children:[(l==null?void 0:l.topbar)&&d.jsxs("div",{className:"action-bar",children:[d.jsx("p",{children:`${f==null?void 0:f.length} selected`}),d.jsxs("ul",{children:[d.jsx("li",{children:d.jsx(Be,{variant:"tertiary",size:"small",onClick:()=>F("all"),className:"gtm-trackable",children:c.formatMessage({id:"dropdown_menu_multiselect_all"})})}),d.jsx("li",{children:d.jsx(Be,{variant:"tertiary",size:"small",onClick:()=>F("none"),className:"gtm-trackable",children:c.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),d.jsx("ul",{children:t==null?void 0:t.map(S=>{const $=S.id===y.id||(f==null?void 0:f.includes(S))||(f==null?void 0:f.includes(S.id));return d.jsx("li",{"data-testid":"dropdown-options",children:d.jsxs("button",{className:Y("gtm-trackable",{selected:$,"selected-single":$&&!o}),"data-gtm-event-type":`${S}-click`,"data-gtm-event-context":i,onClick:R=>{R.preventDefault(),R.stopPropagation(),E(S)},role:"menuitem","aria-current":$,"data-testid":$?"current-selection":"",children:[o&&d.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),d.jsx("span",{className:Y({"menu-option-label":o}),children:S.label})]})},S.id)})})]}),(l==null?void 0:l.submitSection)&&d.jsx("p",{className:"submit",children:d.jsx(Be,{variant:"secondary",onClick:()=>{A&&A(f),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:u||"dropdown-multi-select",value:f}})),p(!1)},children:c.formatMessage({id:"form_submit"})})})]})]})};const mm=({className:e="",functions:t={onChange:()=>{}},intlPath:n=!1,id:r,label:a,multiSelect:i=!1,name:s,options:o,required:l,type:u="checkboxes",value:c,...h})=>{const p=ue.useIntl(),m=i?c:[],g=c;return d.jsx("ul",{...h,className:Y("options-wrapper",e),"data-testid":`ul-${r}`,children:o==null?void 0:o.map(({id:f,label:D=!1,value:y=f,disabled:x=!1})=>{const A=`${r}_${f}`,_=()=>{if(x)return;let E;if(i){const F=m==null?void 0:m.indexOf(y);Array.isArray(m)&&F>=0?(E=m,E.splice(F,1)):(!m||m.length===0?E=[]:E=m,E.push(y))}else E=g===y?void 0:y;t.onChange(E)};return d.jsx(Zc,{element:"li",id:A,type:u==="checkboxes"?"checkbox":"radio",shownValue:y,value:i?m==null?void 0:m.includes(y):g===y,functions:{...t,onChange:_},intlPath:n,label:D||p.formatMessage({id:n?`${n}_${f}`:f}),disabled:x},A)})})};const pm=({inputRef:e,type:t="password",gtm:{context:n}={context:void 0},...r})=>{const a=ue.useIntl(),i=C.useRef(),s=e||i,[o,l]=C.useState(!1),[u,c]=C.useState(t),h=()=>{var p;l(!o),c(o?"password":"text"),(p=s.current)==null||p.focus()};return d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:Y("show-password gtm-trackable",{"password-visible":o}),"data-gtm-event-context":n,"data-gtm-event-type":`${o?"hide":"show"}-password-click`,onClick:h,"aria-label":a.formatMessage({id:`showpassword_aria_${o?"hide":"show"}`}),children:a.formatMessage({id:`showpassword_${o?"hide":"show"}`})}),d.jsx(Rn,{inputRef:s,type:u,...r})]})};const Sn={text:{component:Rn},email:{component:Rn},url:{component:Rn},textarea:{component:Rn,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:Zc},checkboxes:{component:mm,props:{multiSelect:!0}},select:{component:hm},password:{component:pm},autocomplete:{component:dm}},gm=({id:e,intlPath:t=!1,className:n="",error:r,functions:a={onChange:()=>{}},limit:i=0,showRequiredLabels:s=!0,type:o,validation:l,value:u,submitOnEnter:c,...h})=>{const p=ue.useIntl(),m=l&&l.some(({condition:E})=>E==="required"),g=qa(u),f=o&&Sn[o]&&Sn[o].component?Sn[o].component:Rn,D={};o&&["checkboxes"].includes(o)?D.element="span":D.htmlFor=e;let y={...h,id:e,name:e,className:r?"error":"",type:o,required:m,"aria-required":m,functions:pn(a),value:u};if(i>0){const E=Vc(i,a.onChange);y={...y,...E},E.functions&&typeof E.functions=="object"&&(y.functions={...y.functions,...E.functions})}o&&Sn[o]&&Sn[o].props&&(y={...y,...Sn[o].props}),o&&["checkboxes"].includes(o)&&(y.intlPath=`${t}_${e}`),r&&(y["aria-invalid"]=!0,y["aria-describedby"]=`error-${e}`);const x=h.label||p.formatMessage({id:t?`${t}_${e}`:e}),A=({...E})=>r?C.createElement(E.as||"dd",{id:`error-${e}`,className:"error text-small",role:"alert","aria-live":"assertive",...E},r):null;if(o&&["checkbox"].includes(o))return d.jsxs(d.Fragment,{children:[d.jsx(f,{...y,label:x,className:Y("field-wrapper",n)}),d.jsx(A,{as:"p"})]});const _=E=>C.createElement(E.element||"label",{...E,className:"checkboxes-label text-small","data-testid":`label-${e}`});return d.jsxs("dl",{className:Y("field-wrapper text-medium",n),children:[d.jsx("dt",{children:d.jsxs(_,{...D,children:[x,m&&s&&d.jsxs(d.Fragment,{children:[" ",d.jsxs("small",{children:["(",p.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})}),d.jsxs("dd",{children:[d.jsx(f,{...y}),d.jsx(Ws,{limit:i,valueLength:g})]}),d.jsx(A,{})]})},vm=(e,t)=>{const{type:n,payload:r}=t,a=e.errors?pn(e.errors):{},i=e.values?pn(e.values):{};switch(n){case"toggleSubmitting":return{...e,isSubmitting:!e.isSubmitting};case"updateValue":if(r!=null&&r.key&&a[r==null?void 0:r.key]&&delete a[r==null?void 0:r.key],r!=null&&r.key){if(["isSubmitting","formSubmitted","errors"].includes(r==null?void 0:r.key))return{...e,errors:a,[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:a,values:i};case"addError":return r!=null&&r.key&&!a[r==null?void 0:r.key]&&(a[r==null?void 0:r.key]=r==null?void 0:r.value),{...e,errors:a};case"removeError":return r!=null&&r.key&&a[r==null?void 0:r.key]&&delete a[r==null?void 0:r.key],{...e,errors:a};case"submitForm":{const{fields:s=[],dispatch:o=()=>{},onSuccess:l=()=>{},onFailure:u=()=>{},intl:c}=r,h=pn(Object.keys(a));for(const p of s)if(p.validation)for(let m=0;m<p.validation.length;m++){const{condition:g="required",error:f=!1}=p.validation[m];let D=!1;if(typeof g=="function"){const y=g(i);y&&(D=f||y)}else{const y=i[p.id];switch(g){case"required":(!y||typeof y=="string"&&y.trim().length===0)&&(D=f||(c==null?void 0:c.formatMessage({id:"form_error_required"})));break;case"no-numbers":{y&&!/^([^0-9]*)$/.test(y)&&(D=f||(c==null?void 0:c.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)&&(D=f||(c==null?void 0:c.formatMessage({id:"form_error_email"})));break}case"valid-url":{y&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(y)&&(D=f||(c==null?void 0:c.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(D){o({type:"addError",payload:{key:p.id,value:D}}),h.push(p.id);break}}return h.length===0?l(i):u(i,h),{...e,isSubmitting:!1}}case"formSubmitted":return{...e,isSubmitting:!1,formSubmitted:!0,errors:{}};case"formSubmittedAndReset":return{isSubmitting:!1,formSubmitted:!0,errors:{}};default:return e}};let oi=null;const nr=({element:e="form",fields:t,className:n="",id:r=t.length?`form__${t[0].id}`:"form",formRef:a,intlPath:i=!1,button:s={variant:"primary",size:"large",customOnSubmit:!1},secondaryActionButton:o={variant:"secondary",size:"large"},meta:l,gtm:u={context:"Form",event:"form-submit-click"},functions:{onSuccess:c=async()=>{},onCancel:h=()=>{},onCatch:p=()=>{},onFailure:m=()=>{}}={onSuccess:async()=>{},onCancel:()=>{},onCatch:()=>{},onFailure:()=>{}},...g})=>{const{customOnSubmit:f,hideButton:D,...y}=s,x=40,{shouldShowCancelButton:A=!1,shouldReset:_=!0,showRequiredLabels:E=!0,showSuccessMessage:F=!1}=l||{},S=ue.useIntl(),$={};t.length&&t.forEach(v=>{const H=v.id||v.name;H&&($[H]=v.value||"")});const[R,I]=C.useReducer(vm,{isSubmitting:!1,formSubmitted:!1,errors:{},values:$}),{errors:M,isSubmitting:w,formSubmitted:k,values:O}=R;C.useEffect(()=>{_&&k&&(oi=setTimeout(()=>{I({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[k]),C.useEffect(()=>()=>{oi&&clearTimeout(oi)},[]),C.useEffect(()=>{const v=H=>{I({type:"updateValue",payload:{key:H.detail.id,value:H.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",v),()=>{document.removeEventListener("dropdownMultiSelectSubmit",v)}},[]);const j=C.useRef(null),q=a||j;if(!t.length)return null;s.text||(s.text=S.formatMessage({id:"form_submit"}));const z=()=>{if(!w){if(I({type:"toggleSubmitting"}),s.disabled){typeof s.disabled=="object"&&s.disabled.isClickable&&I({type:"submitForm",payload:{fields:t,dispatch:I,intl:S}});return}I({type:"submitForm",payload:{fields:t,dispatch:I,onSuccess:async v=>{try{await c(v),I({type:_?"formSubmittedAndReset":"formSubmitted"})}catch(H){p(H),I({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:(v,H)=>{m(v,H),I({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:S}})}},X=[{...y,icon:k?{icon:"tick",position:"left"}:!1,className:"gtm-trackable",onClick:v=>{var B;if(v.preventDefault(),v.stopPropagation(),w)return;let H=0;if((B=q==null?void 0:q.current)!=null&&B.id){const T=document.getElementById(q.current.id);T&&(H=T.getBoundingClientRect().top+window.scrollY)}const ee=document.getElementById("header");ee&&(H=H-ee.offsetHeight-x),H<0&&(H=0),window.scrollTo({top:H,behavior:"smooth"}),z()},disabled:w||k||s.disabled,"data-gtm-event-context":u.context,"data-gtm-event-type":u.event,children:w||k?S.formatMessage({id:`form_${w?"submitting":"submitted"}`}):s.text}];return A&&X.unshift({...o,className:"gtm-trackable","data-gtm-event-context":u.context,"data-gtm-event-type":u.event,disabled:w||k,onClick:h,children:o.text||S.formatMessage({id:"form_cancel"})}),d.jsxs(d.Fragment,{children:[C.createElement(e,{...g,id:r,className:Y("form",n),ref:q},d.jsxs(d.Fragment,{children:[M!=null&&M.general?d.jsx(an,{variant:"error",text:S.formatMessage({id:"form_error_generalError"})}):null,(!_||!w&&!k||f)&&t.map((v,H)=>{const{id:ee=v.name||H,component:B,functions:T={onChange:()=>{}},submitOnEnter:W=!1}=v;if(B)return d.jsx(B,{...v.props||{}},`component-${ee}-${H}`);const L=O?O[ee]:"",U={...T,onChange:te=>{I({type:"updateValue",payload:{key:ee,value:te}}),T.onChange(te&&te.toString(),I)}};return W&&(U.onKeyDown=te=>{te.key==="Enter"&&(te.stopPropagation(),te.preventDefault(),z()),T.onKeyDown&&T.onKeyDown(te)}),d.jsx(gm,{intlPath:i,...v,showRequiredLabels:E,value:L,error:M==null?void 0:M[ee],functions:U},ee)}),D?null:(w||k)&&f?f:d.jsx(kn,{className:Y("cta",{center:w||k,submitted:k}),buttons:X})]})),F&&k&&d.jsx(Er,{className:"success",children:typeof F=="string"?F:S.formatMessage({id:"form_success"})})]})};const qr="passwordRules_",Yc="isMoreThanEightCharacters",Gc="includesNumberAndSymbol",Qc="includesLowerAndUppercase",bm={[Yc]:"8Characters",[Gc]:"numberSymbol",[Qc]:"lowercaseUppercase"},ym=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=ue.useIntl();return d.jsxs("aside",{className:Y("password-rules",t),children:[d.jsx("small",{children:n.formatMessage({id:`${qr}intro`})}),d.jsx("ul",{children:[Yc,Gc,Qc].map(r=>d.jsxs("li",{className:Y({matches:e[r]}),children:[d.jsxs(Me,{children:[n.formatMessage({id:`${qr}rule_label`})," "]}),d.jsx("span",{children:n.formatMessage({id:`${qr}rule_${bm[r]}`})}),!e[r]&&d.jsxs(Me,{element:"strong",children:[" ",n.formatMessage({id:`${qr}notMet`})]})]},`rule-${r}`))})]})},Jc=C.memo(ym);const Dm=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:a=()=>{}},className:i="",hasLoaded:s=!1})=>{const o=ue.useIntl(),[l,u]=C.useState({setUp:!1,id:null,rating:null,disabled:!0}),c=async()=>{try{const y=await n();u(x=>({...x,setUp:!0,id:y&&y.id,disabled:!1}))}catch(y){u(x=>({...x,setUp:!0,disabled:!0})),a(y)}};if(C.useEffect(()=>{s&&!l.setUp&&c()},[s]),!s)return d.jsx(wt,{className:"rating-placeholder"});const{id:h,rating:p,disabled:m}=l,g="ratings_",f={text:o.formatMessage({id:`${g}text`}),low:o.formatMessage({id:`${g}low`}),high:o.formatMessage({id:`${g}high`}),success:o.formatMessage({id:`${g}success`}),...e},D=async y=>{if(!(!h||m))try{u(x=>({...x,rating:y,disabled:!0})),await r({id:h,value:y})}catch(x){u(A=>({...A,rating:null})),a(x)}finally{u(x=>({...x,disabled:!1}))}};return d.jsxs("div",{className:Y("rating",i),children:[d.jsx("span",{className:"label",children:f[p?"success":"text"]}),d.jsx("ol",{children:Array.from(new Array(t).keys()).map(y=>{const x=y+1;return d.jsx("li",{className:Y({selected:p&&x<=p}),children:d.jsx(Be,{variant:"tertiary",size:"small",icon:{icon:`star${!p||x>p?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${o.formatMessage({id:`${g}stars`},{number:x,total:t})}${x===1||x===t?` - ${f[x===1?"low":"high"]}`:""}`,onClick:A=>{A.preventDefault(),A.stopPropagation(),D(x)},disabled:m})},`rating-${x}`)})})]})};function Cm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}function ls(e,t){return Array(t+1).join(e)}function xm(e){return e.replace(/^\n*/,"")}function wm(e){for(var t=e.length;t>0&&e[t-1]===`
|
|
38
38
|
`;)t--;return e.substring(0,t)}var Em=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Hs(e){return Us(e,Em)}var Xc=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function ed(e){return Us(e,Xc)}function km(e){return nd(e,Xc)}var td=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function _m(e){return Us(e,td)}function Bm(e){return nd(e,td)}function Us(e,t){return t.indexOf(e.nodeName)>=0}function nd(e,t){return e.getElementsByTagName&&t.some(function(n){return e.getElementsByTagName(n).length})}var nt={};nt.paragraph={filter:"p",replacement:function(e){return`
|
|
@@ -154,6 +154,6 @@ Valid keys: `+JSON.stringify(Object.keys(v),null," "));var Q=fe(U,ie,T,W,L+"."+
|
|
|
154
154
|
*/var Af=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Ba=Af.join(","),Ff=typeof Element>"u",xn=Ff?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Aa=!Ff&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Fa=function e(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=a===""||a==="true",s=i||n&&t&&e(t.parentNode);return s},rx=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Tf=function(t,n,r){if(Fa(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(Ba));return n&&xn.call(t,Ba)&&a.unshift(t),a=a.filter(r),a},Sf=function e(t,n,r){for(var a=[],i=Array.from(t);i.length;){var s=i.shift();if(!Fa(s,!1))if(s.tagName==="SLOT"){var o=s.assignedElements(),l=o.length?o:s.children,u=e(l,!0,r);r.flatten?a.push.apply(a,u):a.push({scopeParent:s,candidates:u})}else{var c=xn.call(s,Ba);c&&r.filter(s)&&(n||!t.includes(s))&&a.push(s);var h=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!Fa(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(h&&p){var m=e(h===!0?s.children:h.children,!0,r);r.flatten?a.push.apply(a,m):a.push({scopeParent:s,candidates:m})}else i.unshift.apply(i,s.children)}}return a},jf=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Jt=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||rx(t))&&!jf(t)?0:t.tabIndex},ax=function(t,n){var r=Jt(t);return r<0&&n&&!jf(t)?0:r},ix=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Of=function(t){return t.tagName==="INPUT"},sx=function(t){return Of(t)&&t.type==="hidden"},ox=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},ux=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},lx=function(t){if(!t.name)return!0;var n=t.form||Aa(t),r=function(o){return n.querySelectorAll('input[type="radio"][name="'+o+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=ux(a,t.form);return!i||i===t},cx=function(t){return Of(t)&&t.type==="radio"},dx=function(t){return cx(t)&&!lx(t)},fx=function(t){var n,r=t&&Aa(t),a=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,o,l;for(i=!!((s=a)!==null&&s!==void 0&&(o=s.ownerDocument)!==null&&o!==void 0&&o.contains(a)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&a;){var u,c,h;r=Aa(a),a=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=a)!==null&&c!==void 0&&(h=c.ownerDocument)!==null&&h!==void 0&&h.contains(a))}}return i},ec=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},hx=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=xn.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(xn.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof a=="function"){for(var o=t;t;){var l=t.parentElement,u=Aa(t);if(l&&!l.shadowRoot&&a(l)===!0)return ec(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=o}if(fx(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ec(t);return!1},mx=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return xn.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},Ta=function(t,n){return!(n.disabled||Fa(n)||sx(n)||hx(n,t)||ox(n)||mx(n))},js=function(t,n){return!(dx(n)||Jt(n)<0||!Ta(t,n))},px=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},gx=function e(t){var n=[],r=[];return t.forEach(function(a,i){var s=!!a.scopeParent,o=s?a.scopeParent:a,l=ax(o,s),u=s?e(a.candidates):o;l===0?s?n.push.apply(n,u):n.push(o):r.push({documentOrder:i,tabIndex:l,item:a,isScope:s,content:u})}),r.sort(ix).reduce(function(a,i){return i.isScope?a.push.apply(a,i.content):a.push(i.content),a},[]).concat(n)},Pf=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Sf([t],n.includeContainer,{filter:js.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:px}):r=Tf(t,n.includeContainer,js.bind(null,n)),gx(r)},Nf=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Sf([t],n.includeContainer,{filter:Ta.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Tf(t,n.includeContainer,Ta.bind(null,n)),r},dn=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return xn.call(t,Ba)===!1?!1:js(n,t)},vx=Af.concat("iframe").join(","),pa=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return xn.call(t,vx)===!1?!1:Ta(n,t)};const bx=Object.freeze(Object.defineProperty({__proto__:null,focusable:Nf,getTabIndex:Jt,isFocusable:pa,isTabbable:dn,tabbable:Pf},Symbol.toStringTag,{value:"Module"}));/*!
|
|
155
155
|
* focus-trap 7.5.4
|
|
156
156
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
157
|
-
*/function tc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tc(Object(n),!0).forEach(function(r){yx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yx(e,t,n){return t=Cx(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dx(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cx(e){var t=Dx(e,"string");return typeof t=="symbol"?t:String(t)}var rc={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var a=t.indexOf(n);a===-1||t.splice(a,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}},xx=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},wx=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},xr=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},Ex=function(t){return xr(t)&&!t.shiftKey},kx=function(t){return xr(t)&&t.shiftKey},ac=function(t){return setTimeout(t,0)},ic=function(t,n){var r=-1;return t.every(function(a,i){return n(a)?(r=i,!1):!0}),r},lr=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return typeof t=="function"?t.apply(void 0,r):t},Xr=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},_x=[],Bx=function(t,n){var r=(n==null?void 0:n.document)||document,a=(n==null?void 0:n.trapStack)||_x,i=nc({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Ex,isKeyBackward:kx},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,l=function(w,k,O){return w&&w[k]!==void 0?w[k]:i[O||k]},u=function(w,k){var O=typeof(k==null?void 0:k.composedPath)=="function"?k.composedPath():void 0;return s.containerGroups.findIndex(function(j){var q=j.container,z=j.tabbableNodes;return q.contains(w)||(O==null?void 0:O.includes(q))||z.find(function(re){return re===w})})},c=function(w){var k=i[w];if(typeof k=="function"){for(var O=arguments.length,j=new Array(O>1?O-1:0),q=1;q<O;q++)j[q-1]=arguments[q];k=k.apply(void 0,j)}if(k===!0&&(k=void 0),!k){if(k===void 0||k===!1)return k;throw new Error("`".concat(w,"` was specified but was not a node, or did not return a node"))}var z=k;if(typeof k=="string"&&(z=r.querySelector(k),!z))throw new Error("`".concat(w,"` as selector refers to no known node"));return z},h=function(){var w=c("initialFocus");if(w===!1)return!1;if(w===void 0||!pa(w,i.tabbableOptions))if(u(r.activeElement)>=0)w=r.activeElement;else{var k=s.tabbableGroups[0],O=k&&k.firstTabbableNode;w=O||c("fallbackFocus")}if(!w)throw new Error("Your focus-trap needs to have at least one focusable element");return w},p=function(){if(s.containerGroups=s.containers.map(function(w){var k=Pf(w,i.tabbableOptions),O=Nf(w,i.tabbableOptions),j=k.length>0?k[0]:void 0,q=k.length>0?k[k.length-1]:void 0,z=O.find(function(v){return dn(v)}),re=O.slice().reverse().find(function(v){return dn(v)}),X=!!k.find(function(v){return Jt(v)>0});return{container:w,tabbableNodes:k,focusableNodes:O,posTabIndexesFound:X,firstTabbableNode:j,lastTabbableNode:q,firstDomTabbableNode:z,lastDomTabbableNode:re,nextTabbableNode:function(H){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,B=k.indexOf(H);return B<0?ee?O.slice(O.indexOf(H)+1).find(function(T){return dn(T)}):O.slice(0,O.indexOf(H)).reverse().find(function(T){return dn(T)}):k[B+(ee?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(w){return w.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(w){return w.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function M(w){var k=w.activeElement;if(k)return k.shadowRoot&&k.shadowRoot.activeElement!==null?M(k.shadowRoot):k},g=function M(w){if(w!==!1&&w!==m(document)){if(!w||!w.focus){M(h());return}w.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=w,xx(w)&&w.select()}},f=function(w){var k=c("setReturnFocus",w);return k||(k===!1?!1:w)},D=function(w){var k=w.target,O=w.event,j=w.isBackward,q=j===void 0?!1:j;k=k||Xr(O),p();var z=null;if(s.tabbableGroups.length>0){var re=u(k,O),X=re>=0?s.containerGroups[re]:void 0;if(re<0)q?z=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:z=s.tabbableGroups[0].firstTabbableNode;else if(q){var v=ic(s.tabbableGroups,function(L){var U=L.firstTabbableNode;return k===U});if(v<0&&(X.container===k||pa(k,i.tabbableOptions)&&!dn(k,i.tabbableOptions)&&!X.nextTabbableNode(k,!1))&&(v=re),v>=0){var H=v===0?s.tabbableGroups.length-1:v-1,ee=s.tabbableGroups[H];z=Jt(k)>=0?ee.lastTabbableNode:ee.lastDomTabbableNode}else xr(O)||(z=X.nextTabbableNode(k,!1))}else{var B=ic(s.tabbableGroups,function(L){var U=L.lastTabbableNode;return k===U});if(B<0&&(X.container===k||pa(k,i.tabbableOptions)&&!dn(k,i.tabbableOptions)&&!X.nextTabbableNode(k))&&(B=re),B>=0){var T=B===s.tabbableGroups.length-1?0:B+1,W=s.tabbableGroups[T];z=Jt(k)>=0?W.firstTabbableNode:W.firstDomTabbableNode}else xr(O)||(z=X.nextTabbableNode(k))}}else z=c("fallbackFocus");return z},y=function(w){var k=Xr(w);if(!(u(k,w)>=0)){if(lr(i.clickOutsideDeactivates,w)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}lr(i.allowOutsideClick,w)||w.preventDefault()}},x=function(w){var k=Xr(w),O=u(k,w)>=0;if(O||k instanceof Document)O&&(s.mostRecentlyFocusedNode=k);else{w.stopImmediatePropagation();var j,q=!0;if(s.mostRecentlyFocusedNode)if(Jt(s.mostRecentlyFocusedNode)>0){var z=u(s.mostRecentlyFocusedNode),re=s.containerGroups[z].tabbableNodes;if(re.length>0){var X=re.findIndex(function(v){return v===s.mostRecentlyFocusedNode});X>=0&&(i.isKeyForward(s.recentNavEvent)?X+1<re.length&&(j=re[X+1],q=!1):X-1>=0&&(j=re[X-1],q=!1))}}else s.containerGroups.some(function(v){return v.tabbableNodes.some(function(H){return Jt(H)>0})})||(q=!1);else q=!1;q&&(j=D({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),g(j||s.mostRecentlyFocusedNode||h())}s.recentNavEvent=void 0},A=function(w){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=w;var O=D({event:w,isBackward:k});O&&(xr(w)&&w.preventDefault(),g(O))},_=function(w){if(wx(w)&&lr(i.escapeDeactivates,w)!==!1){w.preventDefault(),o.deactivate();return}(i.isKeyForward(w)||i.isKeyBackward(w))&&A(w,i.isKeyBackward(w))},E=function(w){var k=Xr(w);u(k,w)>=0||lr(i.clickOutsideDeactivates,w)||lr(i.allowOutsideClick,w)||(w.preventDefault(),w.stopImmediatePropagation())},F=function(){if(s.active)return rc.activateTrap(a,o),s.delayInitialFocusTimer=i.delayInitialFocus?ac(function(){g(h())}):g(h()),r.addEventListener("focusin",x,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",E,{capture:!0,passive:!1}),r.addEventListener("keydown",_,{capture:!0,passive:!1}),o},S=function(){if(s.active)return r.removeEventListener("focusin",x,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",E,!0),r.removeEventListener("keydown",_,!0),o},$=function(w){var k=w.some(function(O){var j=Array.from(O.removedNodes);return j.some(function(q){return q===s.mostRecentlyFocusedNode})});k&&g(h())},R=typeof window<"u"&&"MutationObserver"in window?new MutationObserver($):void 0,I=function(){R&&(R.disconnect(),s.active&&!s.paused&&s.containers.map(function(w){R.observe(w,{subtree:!0,childList:!0})}))};return o={get active(){return s.active},get paused(){return s.paused},activate:function(w){if(s.active)return this;var k=l(w,"onActivate"),O=l(w,"onPostActivate"),j=l(w,"checkCanFocusTrap");j||p(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,k==null||k();var q=function(){j&&p(),F(),I(),O==null||O()};return j?(j(s.containers.concat()).then(q,q),this):(q(),this)},deactivate:function(w){if(!s.active)return this;var k=nc({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},w);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,S(),s.active=!1,s.paused=!1,I(),rc.deactivateTrap(a,o);var O=l(k,"onDeactivate"),j=l(k,"onPostDeactivate"),q=l(k,"checkCanReturnFocus"),z=l(k,"returnFocus","returnFocusOnDeactivate");O==null||O();var re=function(){ac(function(){z&&g(f(s.nodeFocusedBeforeActivation)),j==null||j()})};return z&&q?(q(f(s.nodeFocusedBeforeActivation)).then(re,re),this):(re(),this)},pause:function(w){if(s.paused||!s.active)return this;var k=l(w,"onPause"),O=l(w,"onPostPause");return s.paused=!0,k==null||k(),S(),I(),O==null||O(),this},unpause:function(w){if(!s.paused||!s.active)return this;var k=l(w,"onUnpause"),O=l(w,"onPostUnpause");return s.paused=!1,k==null||k(),p(),F(),I(),O==null||O(),this},updateContainerElements:function(w){var k=[].concat(w).filter(Boolean);return s.containers=k.map(function(O){return typeof O=="string"?r.querySelector(O):O}),s.active&&p(),I(),this}},o.updateContainerElements(t),o};const Ax=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:Bx},Symbol.toStringTag,{value:"Module"})),Fx=Dc(Ax),Tx=Dc(bx);function Gn(e){"@babel/helpers - typeof";return Gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gn(e)}function Sx(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rf(r.key),r)}}function jx(e,t,n){return t&&sc(e.prototype,t),n&&sc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ox(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Os(e,t)}function Os(e,t){return Os=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Os(e,t)}function Px(e){var t=Rx();return function(){var r=Sa(e),a;if(t){var i=Sa(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return Nx(this,a)}}function Nx(e,t){if(t&&(Gn(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pr(e)}function pr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rx(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sa(e){return Sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sa(e)}function Mx(e,t,n){return t=Rf(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rf(e){var t=Ix(e,"string");return Gn(t)==="symbol"?t:String(t)}function Ix(e,t){if(Gn(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Gn(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ea=C,be=nx,$x=Fx,Lx=$x.createFocusTrap,zx=Tx,qx=zx.isFocusable,bo=function(e){Ox(n,e);var t=Px(n);function n(r){var a;Sx(this,n),a=t.call(this,r),Mx(pr(a),"getNodeForOption",function(o){var l,u=(l=this.internalOptions[o])!==null&&l!==void 0?l:this.originalOptions[o];if(typeof u=="function"){for(var c=arguments.length,h=new Array(c>1?c-1:0),p=1;p<c;p++)h[p-1]=arguments[p];u=u.apply(void 0,h)}if(u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var m=u;if(typeof u=="string"){var g;if(m=(g=this.getDocument())===null||g===void 0?void 0:g.querySelector(u),!m)throw new Error("`".concat(o,"` as selector refers to no known node"))}return m}),a.handleDeactivate=a.handleDeactivate.bind(pr(a)),a.handlePostDeactivate=a.handlePostDeactivate.bind(pr(a)),a.handleClickOutsideDeactivates=a.handleClickOutsideDeactivates.bind(pr(a)),a.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:a.handleDeactivate,onPostDeactivate:a.handlePostDeactivate,clickOutsideDeactivates:a.handleClickOutsideDeactivates},a.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var i=r.focusTrapOptions;for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){if(s==="returnFocusOnDeactivate"||s==="onDeactivate"||s==="onPostDeactivate"||s==="checkCanReturnFocus"||s==="clickOutsideDeactivates"){a.originalOptions[s]=i[s];continue}a.internalOptions[s]=i[s]}return a.outsideClick=null,a.focusTrapElements=r.containerElements||[],a.updatePreviousElement(),a}return jx(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var a=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return a||(a===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var a=this.getDocument();a&&(this.previouslyFocusedElement=a.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(a){var i=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,a):this.originalOptions.clickOutsideDeactivates;return i&&(this.outsideClick={target:a.target,allowDeactivation:i}),i}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var a=this,i=function(){var o=a.getReturnFocusNode(),l=!!(a.originalOptions.returnFocusOnDeactivate&&o!==null&&o!==void 0&&o.focus&&(!a.outsideClick||a.outsideClick.allowDeactivation&&!qx(a.outsideClick.target,a.internalOptions.tabbableOptions))),u=a.internalOptions.preventScroll,c=u===void 0?!1:u;l&&o.focus({preventScroll:c}),a.originalOptions.onPostDeactivate&&a.originalOptions.onPostDeactivate.call(null),a.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(i,i):i()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var a=this.focusTrapElements.some(Boolean);a&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(a){if(this.focusTrap){a.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var i=!a.active&&this.props.active,s=a.active&&!this.props.active,o=!a.paused&&this.props.paused,l=a.paused&&!this.props.paused;if(i&&(this.updatePreviousElement(),this.focusTrap.activate()),s){this.deactivateTrap();return}o&&this.focusTrap.pause(),l&&this.focusTrap.unpause()}else a.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var a=this,i=this.props.children?ea.Children.only(this.props.children):void 0;if(i){if(i.type&&i.type===ea.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var s=function(u){var c=a.props.containerElements;i&&(typeof i.ref=="function"?i.ref(u):i.ref&&(i.ref.current=u)),a.focusTrapElements=c||[u]},o=ea.cloneElement(i,{ref:s});return o}return null}}]),n}(ea.Component),cr=typeof Element>"u"?Function:Element;bo.propTypes={active:be.bool,paused:be.bool,focusTrapOptions:be.shape({document:be.object,onActivate:be.func,onPostActivate:be.func,checkCanFocusTrap:be.func,onPause:be.func,onPostPause:be.func,onUnpause:be.func,onPostUnpause:be.func,onDeactivate:be.func,onPostDeactivate:be.func,checkCanReturnFocus:be.func,initialFocus:be.oneOfType([be.instanceOf(cr),be.string,be.bool,be.func]),fallbackFocus:be.oneOfType([be.instanceOf(cr),be.string,be.func]),escapeDeactivates:be.oneOfType([be.bool,be.func]),clickOutsideDeactivates:be.oneOfType([be.bool,be.func]),returnFocusOnDeactivate:be.bool,setReturnFocus:be.oneOfType([be.instanceOf(cr),be.string,be.bool,be.func]),allowOutsideClick:be.oneOfType([be.bool,be.func]),preventScroll:be.bool,tabbableOptions:be.shape({displayCheck:be.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:be.oneOfType([be.bool,be.func])}),trapStack:be.array,isKeyForward:be.func,isKeyBackward:be.func}),containerElements:be.arrayOf(be.instanceOf(cr)),children:be.oneOfType([be.element,be.instanceOf(cr)])};bo.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:Lx};var Wx=bo;const Hx=wn(Wx),Mf=({showDevTools:e=!0,children:t})=>{const n=new Ke.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return d.jsxs(Ke.QueryClientProvider,{client:n,children:[t,e&&d.jsx(Dh.ReactQueryDevtools,{initialIsOpen:!1})]})};var Ux=C.createContext({client:sa});function Vx(e){var t=e.children,n=e.client,r=e.apiKey,a=e.options,i=C.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&&a&&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&&(sa.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),sa.init(r,a)),sa)},[n,r]);return C.createElement(Ux.Provider,{value:{client:i}},t)}const If=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?d.jsx(Vx,{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}):d.jsx(d.Fragment,{children:e}),$f=({children:e,locale:t,messages:n})=>{const r=t||"en",a={...Ih[r],...n||{}};return d.jsx(ue.IntlProvider,{locale:r,messages:a,children:e})},yo=C.createContext({}),ga={en:"English",es:"Español",fr:"Français",pt:"Português"},Mt=C.createContext({isLoading:!0});function Ga(){return C.useContext(Mt)}const Lf=({children:e,user:t})=>d.jsx(Mt.Provider,{value:t,children:e}),Do=C.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),zf=()=>C.useContext(Do),qf=({children:e})=>{const[t,n]=C.useState([]);C.useEffect(()=>{t.length>0?document.body.classList.add("has-overlay"):document.body.classList.remove("has-overlay")},[t]);const r=C.useCallback(i=>{n(s=>[...s,i])},[]),a=C.useCallback(i=>{n(s=>s.filter(o=>o!==i))},[]);return d.jsx(Do.Provider,{value:{registerOverlay:r,unregisterOverlay:a},children:e})},Kx=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[a,i]=C.useState({isLoading:!0}),s=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[o,l]=C.useState(s),u=c=>{localStorage.setItem("language",c),l(c)};return C.useEffect(()=>{e().then(c=>{i({...c,isLoading:!1}),Nc(5e3)}).catch(c=>{c.message===Sc&&window.location.pathname!=="/user-onboarding/logout"&&(window.location.href="/user-onboarding/logout"),i({isLoading:!1})})},[]),d.jsx(yo.Provider,{value:{language:o,updateLanguage:u},children:d.jsx($f,{locale:o,messages:n==null?void 0:n.messages,children:d.jsx(Ps.CookiesProvider,{children:d.jsx(Lf,{user:a,children:d.jsx(qf,{children:d.jsx(Mf,{showDevTools:r,children:d.jsx(If,{user:a,children:t})})})})})})})};const Co=({element:e="section",children:t,className:n,...r})=>C.createElement(e,{className:Y("modal",n),children:typeof t=="string"?d.jsx("p",{children:t}):t,...r});const Nr=({id:e="content-overlay",isOpen:t=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:a=()=>{},onClose:i=()=>{}}={},forceShow:{error:s=!1}={},title:o,children:l,buttons:u,className:c="",gtmContext:h="Modal"})=>{const p=ue.useIntl(),{registerOverlay:m,unregisterOverlay:g}=zf(),[f,D]=C.useState(t),y=_=>{_.key==="Escape"&&x(!1)};C.useEffect(()=>(window.addEventListener("keyup",y),()=>{window.removeEventListener("keyup",y)}));const x=_=>{D(_),_?(a(),m(e)):(i(),g(e))};C.useEffect(()=>(x(t),()=>{f&&g(e)}),[t]);const A=r?{"--max-width":`${r/16}rem`}:{};return d.jsx("div",{className:Y("overlay",{open:f}),role:"dialog",children:d.jsx(Co,{id:e,className:Y("overlay-modal",c,{"has-max-width":r}),hidden:!f,style:A,children:t&&d.jsx(Hx,{children:d.jsxs("div",{className:"overlay-content",children:[d.jsxs("div",{className:"top",children:[o&&d.jsx("h2",{className:"modal-title",children:o}),d.jsx(Be,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>x(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":h,screenreaderText:p.formatMessage({id:"overlay_close"})})]}),n&&d.jsx(tn,{}),l,u&&d.jsxs("div",{className:"bottom",children:[d.jsx(tn,{}),d.jsx(kn,{buttons:u})]}),s&&d.jsx(Er,{className:"error",children:s})]})})})})},Wf=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const Zx=({className:e,showModal:t=!0,title:n,formTitle:r,formLabel:a,ctaMessage:i,showIcon:s,onClose:o,reportError:l=()=>{},sendInvites:u})=>{const c=ue.useIntl();return r||(r=c.formatMessage({id:"inviteModal_formTitle"})),a||(a=c.formatMessage({id:"inviteModal_formLabel"})),i||(i=c.formatMessage({id:"inviteModal_cta"})),d.jsx(Nr,{title:n,isOpen:t,showDivider:!1,showIcon:s,functions:{onClose:o},className:Y("invite-modal",e,{success:!!n}),children:d.jsx(Ef,{title:r,label:a,ctaMessage:i,onClose:o,sendInvites:u,reportError:l})})};const Yx=({members:e})=>{const[t,n]=C.useState(!1),r=a=>{const{fullName:i,jobTitle:s,organisation:o,photo:l}=a||{};return d.jsxs(d.Fragment,{children:[d.jsx(sn,{name:i,src:l}),d.jsx("p",{children:i}),d.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return d.jsxs("div",{className:"directory-wrapper",children:[d.jsx("ul",{className:"directory",children:e.map(a=>d.jsx("li",{children:d.jsx("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),n(a)},children:r(a)})},a.fullName))}),d.jsx(Nr,{isOpen:t!==!1,children:t===!1?"":d.jsxs(d.Fragment,{children:[r(t),d.jsx(Vn,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const Gx=({author:e,authorCite:t,content:n,member:r,className:a=""})=>d.jsxs("blockquote",{className:Y("testimonial-block",a),children:[d.jsx(Pt,{className:"testimonial",children:n}),r?d.jsx(tr,{member:r,styling:{size:"large"}}):d.jsxs(d.Fragment,{children:[e&&d.jsx("p",{className:Y("author",{"text-small":!a.includes("new")}),children:e}),t&&d.jsx("p",{className:Y("author-cite",{"text-small":!a.includes("new")}),children:d.jsx("cite",{children:t})})]})]}),Qx=C.memo(Gx);const Jx=({items:e=[],selector:t="",className:n=""})=>{const r=ue.useIntl(),[a,i]=C.useState(e);return C.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,c)=>{s+=`${c>0?", ":""}${t} h${c+1}`});const l=Array.from(document.querySelectorAll(s)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));i(l)},[]),a&&a.length>0&&d.jsxs(Nt,{variant:"subtle",className:Y("table-of-contents",n),children:[d.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),d.jsx("nav",{children:d.jsx("ul",{children:a.map(({id:s,text:o})=>d.jsx("li",{children:d.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const Qa=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:a=""})=>{const i=ue.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=c=>{const h=c/60,p=Math.floor(h),m=(h-p)*60,g=Math.round(m),f=`${i.formatMessage({id:`${s}hours`},{time:p})}${p>0&&g>0?", ":""}${i.formatMessage({id:`${s}minutes`},{time:g})}`;return{text:`${p>0?`${i.formatMessage({id:`${s}hours_short`},{time:p})} `:""}${g>0?i.formatMessage({id:`${s}minutes_short`},{time:g}):""}`,ariaText:f}};let{text:l,ariaText:u}=o(e);if(t){const{text:c,ariaText:h}=o(e+t);l=i.formatMessage({id:`${s}range`},{early:l,late:c}),u=i.formatMessage({id:`${s}range_aria`},{early:u,late:h})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),d.jsx("span",{className:Y("time-to-complete",a),"aria-label":u,children:l})};const Xx=({className:e="",image:t,...n})=>t?(typeof t=="string"&&(t={width:1080,height:200,type:"image/png",url:t}),t.range=[{height:124,width:425},{height:200,width:768},{height:200,width:1368}],t.query="fit=thumb&f=center",d.jsx(er,{...n,className:Y("banner",e),image:{...t,aspect:"banner"}})):null;const ln=({children:e,className:t="",styling:n={},...r})=>{const{background:a="default"}=n;return d.jsx("section",{className:Y("full-width-section",t,{[a]:a!=="default"}),...r,children:e})};const ew=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(a=>{r.push({href:a.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable","data-gtm-event-type":"download-click","data-gtm-event-context":a.eventContext||"Download",target:"_blank",children:a.text})}),d.jsx(ln,{className:Y("download-section",n),children:d.jsxs("div",{className:"content-default",children:[C.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),d.jsx(kn,{buttons:r})]})})};function Hf({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const tw=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:a,setShowModal:i})=>{const{formatMessage:s}=ue.useIntl();return d.jsxs("div",{className:Y("edit-section-placeholder",{"has-icon":!!e}),style:Oc(e),children:[d.jsx("p",{children:t||s({id:"edit_section_placeholder_description"})}),a&&d.jsx(Be,{href:r,variant:"secondary",size:"small",onClick:()=>Hf({href:r,setShowModal:i}),children:n||s({id:"edit_section_placeholder_cta"})})]})},nw=({children:e,className:t="",formProps:n,href:r,title:a,modalTitle:i,placeholder:s,showDivider:o=!0})=>{const[l,u]=C.useState(!1),c=typeof r=="string"||!!n,h=()=>u(!1);return d.jsxs("section",{className:Y("edit-section",t),children:[n&&d.jsx(Nr,{title:i||`Edit ${a}`,isOpen:l,showDivider:!1,showIcon:!1,functions:{onClose:h},className:Y("edit-section-modal"),children:d.jsx(nr,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async p=>{var m,g;(m=n==null?void 0:n.functions)!=null&&m.onSuccess&&await((g=n==null?void 0:n.functions)==null?void 0:g.onSuccess(p)),u(!1)},onCancel:h}})}),d.jsxs("div",{className:"edit-section-header",children:[d.jsx("h2",{className:"edit-section-header-title",children:a}),c&&d.jsx(Be,{href:r,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>Hf({href:r,setShowModal:u}),children:"Edit"})]}),e||d.jsx(tw,{...s,href:r,setShowModal:u,showEditButton:c}),o&&d.jsx(tn,{})]})};const rw=({title:e=!1,text:t,logos:n=[],styling:r={},className:a=""})=>{const i=n.length;if(i===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return d.jsxs("div",{className:Y("logos",a,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&C.createElement(s.element,{className:Y("title",s.className)},s.text),t&&d.jsx("p",{children:t}),d.jsx("ul",{className:Y({"two-col":i===2||i===4,"three-col":i===5||i<=10&&i%3===0}),children:n.map(({logo:c,nameOfBusiness:h,link:p=!1,description:m=!1},g)=>{if(!c||!c.url)return null;const f=d.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:h});return d.jsxs("li",{children:[d.jsx("p",{className:"img-wrapper",children:p?d.jsx("a",{href:p,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),m&&d.jsx("small",{children:m})]},window.btoa(`${c.url}_${g}`))})})]})};const aw=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],iw=({className:e="",content:t,image:n,variant:r,spacing:a="normal",styling:i,hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:l})=>{var g,f;const u={imageFullWidth:!0,...i};r||(r=u.imageFullWidth?"default":"light");const c=["eyebrow","title","text"],h={eyebrow:"small",title:"h1",text:"p"},p={};c.forEach(D=>{if(!t[D]){p[D]=!1;return}if(!s[D]){if(typeof t[D]=="object"){p[D]=t[D];const{text:y,element:x}=t[D];if(x&&aw.includes(x.toLowerCase()))return;p[D]={text:y,element:h[D]};return}p[D]={text:t[D],element:h[D]}}});const m=o&&o.text&&o.link;return m&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=D=>{D.preventDefault(),D.stopPropagation();const y=document.getElementById(o.link.substring(1));y&&y.scrollIntoView({behavior:"smooth"})}),d.jsx(ln,{className:Y("banner-section",r,a,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":m,"has-extra-spacing":r!=="subtle"&&a==="normal"&&p.eyebrow&&p.title}),children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"content-wrapper",children:[c.map(D=>{if(p[D]&&typeof p[D]=="object"){const{text:y,element:x=""}=p[D];return D==="text"?d.jsx(Vn,{overrideType:"text-only",className:"text",children:y},D):C.createElement(x,{key:D,className:D},y)}return null}),l,m&&d.jsx(Be,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:Y({new:r==="subtle",[(g=o.props)==null?void 0:g.className]:(f=o.props)==null?void 0:f.className}),children:o.text})]}),n&&d.jsx(er,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},sw=C.memo(iw);const ow=({image:e,variant:t="default",children:n,className:r=""})=>{const a={};return e&&(a["--image"]=`url(${e})`),d.jsx(ln,{className:Y("custom-content-banner",t,r,{"has-image":e}),style:a,children:d.jsx("div",{className:"content-slim",children:n})})};const uw=({alignImage:e="left",className:t,content:n,image:r})=>{const a=typeof n=="string"?d.jsx(Vn,{children:n}):n;return d.jsxs(ln,{className:Y("highlight-section",t),children:[r&&d.jsx("div",{className:Y("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:d.jsx(er,{image:{...r,alt:""}})}),d.jsx("div",{className:Y("highlight-container highlight-content-wrapper",{"no-image":!r}),children:d.jsx("div",{className:Y("highlight-content",{"highlight-content-right":e==="left"}),children:r?a:d.jsx("div",{className:"content-default",children:a})})})]})},lw=C.memo(uw);const cw=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:a})=>!n&&!r?null:d.jsxs("aside",{className:Y("marketing-block",e),children:[n&&d.jsx("p",{className:"title",children:n}),r&&d.jsx("p",{children:r}),t&&d.jsx(Be,{variant:"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":a,"data-gtm-event-type":"learn-more-click",children:t.text})]}),dw=({type:e,data:t})=>{const n=ue.useIntl(),{answers:r,createdAt:a,dateHasPassed:i,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:c}=t;if(e==="question"){const h=a&&as(a);return d.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),a&&d.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})]})]})}if(c&&!i||s)return d.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):Ms(c)});if(o)return d.jsx(hn,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const h=u&&as(u);return d.jsxs("ul",{className:"details",children:[l&&d.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&d.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})})]})}return null},ja={communityPage:{basePath:"/communities/",className:"communityPage",gtmEvent:"community"},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"}},fw=({data:e,cta:t,link:n,gtmContext:r})=>{var f,D;const a=ue.useIntl(),[i,s]=C.useState({loading:!1,registered:e.registered||!1});C.useEffect(()=>{e.registered&&s(y=>({...y,registered:!0}))},[e.registered]);const{customLinkText:o,startDate:l,dateHasPassed:u,pill:c,slug:h}=e,p=e.contentType;let m="";if((f=ja[p])!=null&&f.gtmEvent&&(m=ja[p].gtmEvent),l&&u)return n?d.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_watch"})}):null;if(p==="people")return n?d.jsx(Be,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_cta_people"})}):null;const g=["communityPage","microcourse","event"];if(t&&t.onClick&&g.includes(p)&&c!=="premium"){const y=i.loading||i.registered||((D=e==null?void 0:e.members)==null?void 0:D.isMember),x=async A=>{if(A.preventDefault(),A.stopPropagation(),!(y||!t||!t.onClick)){s(_=>({..._,loading:!0}));try{const _=await t.onClick(e);s(_==="success"?()=>({registered:!0,loading:!1}):E=>({...E,loading:!1}))}catch{s(E=>({...E,loading:!1}))}}};return d.jsx("p",{className:Y("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:d.jsx(Be,{onClick:x,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:y,"data-gtm-event-context":`${r}Page-${p}: ${h}`,"data-gtm-event-type":`${r}-${p}-register-click`,"data-testid":"in-card-button",children:o||a.formatMessage({id:`card_cta_${p}${y?`_${i.loading?"loading":"done"}`:""}`})})})}return null};const hw={title:66,text:3e3,secondaryText:1e3,partner:25},xo=({id:e="",card:t,buildCardData:n,cta:r,gtmContext:a="Carousel",className:i="",handleCardClick:s,setFocus:o=!1})=>{var M,w,k,O,j;const l=ue.useIntl(),u=C.useContext(Mt),c=u&&typeof u.id=="string",h=C.useRef(null),[p,m]=C.useState({data:null,isLoading:!0}),{data:g,isLoading:f}=p,D=C.useCallback(()=>{n(t,c).then(q=>{m(()=>({data:q,isLoading:!1}))}).catch(()=>m(q=>({...q,isLoading:!1})))},[e]);if(C.useEffect(()=>{D()},[]),f||!g)return d.jsx(wt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});s&&!r&&(r={text:l.formatMessage({id:`card_cta_${t.contentType}`}),onClick:s});const{contentType:y}=g;if(!y||!ja[y])return d.jsx(wt,{element:"li",className:"card-wrapper"});const{basePath:x="",className:A,length:_,gtmEvent:E}=ja[y];let F=g.slug?`${x}${g.slug}`:!1;g.slug&&(g.slug.slice(0,4)==="http"||g.slug.slice(0,2)==="//"||g.slug.slice(0,6)==="mailto"||g.slug.slice(0,3)==="tel")&&(F=g.slug);const S=q=>{F&&(q.preventDefault(),q.stopPropagation(),window.location.href=F)},$={...hw,..._};let R={className:"card"},I={};return F&&(I={href:F,className:"gtm-trackable","data-gtm-event-context":`${a}-CarouselCard`,"data-gtm-event-type":`${E}-click`,"data-testid":"link"},g.openInNewTab&&(I.target="_blank"),R={onClick:S,className:"card gtm-trackable","data-gtm-event-context":`${a}-CarouselCard`,"data-gtm-event-type":`${E}-click`}),o&&(R={...R,tabIndex:"0"},(M=h==null?void 0:h.current)==null||M.focus(),(w=h==null?void 0:h.current)==null||w.scrollIntoView({behavior:"smooth"})),d.jsx("li",{className:Y("card-wrapper text-medium",A,i,{"has-link":F,"no-link":!F,"has-image":g.banner}),"data-testid":`${y}-card`,children:d.jsxs("div",{...R,ref:h,children:[d.jsx($c,{className:"card-label",contentType:y,customIcon:g.isPrivate?"lock-locked":g.customIcon,customLabel:g.customLabel}),y==="communityPage"&&(g==null?void 0:g.createdAt)&&jh(g==null?void 0:g.createdAt,60)&&d.jsx(hn,{size:"small",variant:"information","data-testid":"new-community",children:l.formatMessage({id:"card_new"})}),g.startDate&&!g.isOngoingEvent&&d.jsx(hn,{size:"small",variant:g.dateHasPassed?"default":"information","data-testid":"date",children:g.dateHasPassed?l.formatMessage({id:"card_ended"}):Pc(g.startDate)}),g.banner?d.jsxs("p",{className:"img",children:[g.registered&&d.jsx(hn,{size:"small",variant:"registered",children:l.formatMessage({id:"card_registered"})}),d.jsx(er,{image:{...g.banner,description:""}})]}):A==="people"?d.jsx(sn,{name:g.title||"",src:g.profile,"data-testid":"people-profile-picture"}):null,g.contributors&&d.jsx(qs,{contributors:{data:g.contributors},styling:{size:"small",showGap:A!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(y)?l.formatMessage({id:`card_contributors_${y}`}):void 0,"data-testid":"contributors"}),g.partner&&d.jsx("p",{className:"partners","data-testid":"partners",children:g.partner.length>1?l.formatMessage({id:"card_partner"},{partner:g.partner[0],number:g.partner.length-1}):Hn(g.partner[0],$.partner)}),["title","text","secondaryText"].map(q=>{const z=g[q];if(!z)return null;const re=Ac(q),X={key:q,className:re,"data-testid":re},v={wrapper:"p",forceWrapper:!0,forceInline:!0},H=Hn(z,$[q]);return["title","text"].includes(q)&&F?(v.wrapper="a",d.jsx("p",{...X,children:d.jsx(Pt,{options:v,...I,children:H})})):d.jsx(Pt,{options:v,...X,children:H})}),(u==null?void 0:u.id)&&(g==null?void 0:g.members)&&d.jsxs("span",{className:"member-information",children:[((k=g==null?void 0:g.members)==null?void 0:k.isMember)&&d.jsx(hn,{size:"small",variant:"registered",icon:((O=g==null?void 0:g.members)==null?void 0:O.memberType)==="owner"?"user":"tick",children:l.formatMessage({id:`card_member_type_${(j=g==null?void 0:g.members)==null?void 0:j.memberType}`})}),d.jsx("br",{}),d.jsx("span",{className:"label member-count",children:l.formatMessage({id:"card_member_count"},{count:g==null?void 0:g.members.count})})]}),d.jsx(dw,{type:A||"",data:g}),d.jsx(fw,{data:g,cta:r,link:F||"",gtmContext:a})]})})};const Uf=({cards:e,cardTypes:t,className:n="",...r})=>d.jsx("ul",{className:Y("card-block",n),children:e.map((a,i)=>{const s=a.slug?`${a.slug}-${t[i]}`:`${t[i]}-${i}`;return d.jsx(xo,{id:s,card:{...a,contentType:t[i]},setFocus:i===(r==null?void 0:r.focusCardIndex),...r},s)})}),mw=(e,t,n,r)=>{const a=t*n<=e,i=e<t*(n+1),s=r.includes(Math.floor(e/t));return a&&i||s},pw=({id:e,title:t})=>{const n=ue.useIntl();if(!t||!t.text)return null;const{text:r,element:a="h2",variant:i="default",size:s="medium",link:o}=t;return C.createElement(a,{className:Y("title",i,s,{"highlighted-title":i==="highlighted"}),children:d.jsxs(d.Fragment,{children:[r,o&&d.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 Li={fourCards:1024,threeCards:769,twoCards:480};let ta=null;const gw=({id:e,cards:t,cardTypes:n,buildCardData:r,title:a,className:i,gtmContext:s,...o})=>{const l=ue.useIntl(),[u,c]=C.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:h,isLoading:p}=u,[m,g]=C.useState({currentPage:0,loadedPages:[0]}),{currentPage:f,loadedPages:D}=m,[y,x]=C.useState(""),A=t.length,_=Math.ceil(A/h),E=C.useRef(null),F=Jn(!0,!0,E==null?void 0:E.current);C.useEffect(()=>{let w=1;F&&(F>=Li.fourCards?w=4:F>=Li.threeCards?w=3:F>=Li.twoCards&&(w=2),w>A&&(w=A)),c(k=>({...k,cardsPerPage:w,isLoading:!1}))},[F,A]);const S=(w="next")=>{let k=f;if(typeof w=="string")if(w==="next")if(f<_-1)k=f+1;else return;else if(f>0)k=f-1;else return;else k=w;g(j=>({...j,currentPage:k,loadedPages:[...new Set([...D,k])]}));const O=()=>{const j=k*u.cardsPerPage,q=j+u.cardsPerPage;return t.slice(j,q).length};x(l.formatMessage({id:"carousel_pagination_aria_live"},{direction:w,count:O()}))},$=w=>{ta=w.touches[0].clientX},R=w=>{if(ta===null)return;const k=w.touches[0].clientX,O=ta-k;O>5?S("next"):O<-5&&S("previous"),ta=null},I={"--width":`${F||0}px`,"--total-cards":A,"--cards-per-page":h,"--page":f};if(p)return d.jsx(Ls,{layout:`carousel${a?"-with-title":""}`});const M=(w,k)=>{var j;let O=null;return(j=w==null?void 0:w.sys)!=null&&j.id?O=`card-${w.sys.id}`:w!=null&&w.slug?O=`card-${w.slug}`:[n[k],w.contentType].includes("customCard")&&(O=`card-${window.btoa(`${w.title} ${w.createdAt}`)}-${k}`),O};return d.jsxs("section",{ref:E,className:Y("carousel-wrapper",i),"data-testid":"carousel",children:[d.jsx(pw,{id:e,title:a}),d.jsx("ul",{className:"carousel",onTouchStart:$,onTouchMove:R,style:I,"data-testid":"carousel-list",children:t.map((w,k)=>{let O=M(w,k);return O&&mw(k,h,f,D)?d.jsx(xo,{id:O,card:{...w,contentType:n[k]},buildCardData:r,gtmContext:s,...o},O):(O=O||`${e}-card-${k}`,d.jsx(wt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},O))})}),_<=1?null:d.jsxs(d.Fragment,{children:[d.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[d.jsx("li",{className:"arrow previous",children:d.jsx(Be,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:w=>{w.preventDefault(),w.stopPropagation(),S("previous")},screenreaderText:l.formatMessage({id:"carousel_pagination_previous"}),disabled:f<=0})}),[...Array(_)].map((w,k)=>d.jsx("li",{"data-testid":"carousel-controls-button",children:d.jsx("button",{className:Y("page-indicator",{selected:k===f}),onClick:O=>{O.preventDefault(),O.stopPropagation(),S(k)},children:d.jsx(Me,{showOnFocus:!1,children:l.formatMessage({id:"carousel_pagination_page"},{number:k+1,total:_})})})},`page-indicator-${k}`)),d.jsx("li",{className:"arrow next",children:d.jsx(Be,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:w=>{w.preventDefault(),w.stopPropagation(),S("next")},screenreaderText:l.formatMessage({id:"carousel_pagination_next"}),disabled:f>=_-1})})]}),d.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:y})]})]})},vw=({carousels:e=[],isLoading:t,title:n,className:r="",...a})=>!e||!e.length?null:e.map(({title:i,viewAllUrl:s,cards:o,cardsTypes:l},u)=>{const c=i?window.btoa(i):`carousel-${u}`,h=u===e.length-1;return t?d.jsxs(C.Fragment,{children:[d.jsx(Ls,{layout:`carousel${i?"-with-title":""}`,"data-testid":"carousel-placeholder"}),h?null:d.jsx(tn,{})]},`placeholder-${c}`):d.jsxs(C.Fragment,{children:[d.jsx(gw,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:i,link:s},...a}),h?null:d.jsx(tn,{})]},`carousel-${c}`)});const dr="joinCommunityButton",wo=({isMember:e=!1,isOpen:t=!1,isShort:n=!1,disabled:r=!1,functions:{join:a,leave:i}={join:()=>{},leave:()=>{}}})=>{const s=ue.useIntl(),o=C.useContext(Mt),l=o&&typeof o.id=="string",u=r||!l,[c,h]=C.useState(e),[p,m]=C.useState(e?"joined":"notJoined");C.useEffect(()=>{p==="joining"?m("joined"):p==="leaving"&&m("notJoined")},[c]);const g={},f={};return c&&p!=="leaving"&&(g["data-hover-text"]=s.formatMessage({id:`${dr}_leave`}),g["aria-label"]=s.formatMessage({id:`${dr}_member_aria`}),f["aria-hidden"]="true"),d.jsx(Be,{variant:c?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:c&&p!=="leaving"?{icon:"tick",position:"left"}:!1,tooltip:!t&&!c?s.formatMessage({id:`${dr}_closed_tooltip`}):"",onClick:async D=>{if(u)return;D.currentTarget.blur(),m(c?"leaving":"joining");const y=new CustomEvent("ariaLive",{detail:{message:s.formatMessage({id:`${dr}_aria_live`},{action:c?"leaving":"joining"})}});document.dispatchEvent(y);const x=c?i:a;typeof x=="function"&&setTimeout(async()=>{await x()},500),h(!c)},className:Y("join-community-button",p,{active:p==="joining"}),disabled:u,"data-testid":"join-button",...g,children:d.jsx("span",{className:"text",...f,children:s.formatMessage({id:`${dr}${["joining","leaving"].includes(p)?`_${p}`:c?"_member":n?"_short":""}`})})})};const zi="communityDetails_",bw=({className:e="",isMember:t=!1,isOpen:n=!1,slug:r,members:{number:a=0,data:i=[]}={number:0,data:[]},functions:{invite:s,...o}})=>{const l=ue.useIntl(),u=5,c=a||i.length,h=i.length?i:Array(u).fill({}),p=`/communities/${r}/members`===window.location.pathname,m=t||n,g=!n&&!t;return d.jsxs("div",{className:Y("community-details",e),children:[m&&d.jsxs("div",{className:"member-details",children:[d.jsxs("div",{className:"top",children:[d.jsxs("h4",{children:[l.formatMessage({id:`${zi}members`}),d.jsx("span",{className:"count",children:c})]}),!p&&d.jsx("p",{className:"text-small",children:d.jsx("a",{href:`/communities/${r}/members`,children:l.formatMessage({id:`${zi}viewAll`})})})]}),d.jsx(qs,{contributors:{total:a,data:h},styling:{size:"medium",showGap:!0,showPlaceholders:c===0},cutoff:u})]}),d.jsx(wo,{isMember:t,isOpen:n,disabled:g,functions:{...o}}),t&&d.jsx(Be,{variant:"primary",onClick:s,icon:{icon:"plus"},styling:{fullWidth:!0},children:l.formatMessage({id:`${zi}invite`})})]})};const yw=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=ue.useIntl();return d.jsxs(d.Fragment,{children:[d.jsx(Me,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),d.jsx("ul",{className:Y("breadcrumbs text-small",n),children:e.map(({text:a,href:i,current:s=!1},o)=>{const l={};return s&&(l["aria-current"]="location"),d.jsxs("li",{children:[s&&d.jsx(Me,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),d.jsx(_n,{href:s?void 0:i,...l,children:Hn(a,t)})]},`${window.btoa(a)}_${o}`)})})]})};const Dw=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:a=""})=>{const i=ue.useIntl(),s=t?[{id:"all",text:typeof t!="boolean"&&t.text||i.formatMessage({id:"filters_all"})},...e]:e,[o,l]=C.useState(t?["all"]:[]),u=(c,h)=>{let p=[];o.includes(c)?p=o.filter(m=>m!==c):c==="all"?p=["all"]:n?p=[...o.filter(m=>m!=="all"),c]:p=[c],l(m=>(r&&typeof r=="function"&&r({current:p,previous:m}),p)),h&&typeof h=="function"&&h()};return d.jsx("ul",{className:Y("filters",a),children:s.map(({id:c,text:h,disabled:p=!1,callback:m=()=>{}})=>{let g={};return p&&(g={disabled:!0,"aria-label":i.formatMessage({id:"filters_disabled"},{name:h})}),d.jsx("li",{children:d.jsx("button",{className:Y(c,{selected:o.includes(c)}),onClick:f=>{f.preventDefault(),f.stopPropagation(),u(c,m)},...g,children:h})},c)})})},Cw=(e,t,n)=>{const r=String(e);if(!n||!n.length)return t?`/${r}/${t}`:`/${r}`;let a="",i=!1;return n.forEach(({url:s,position:o})=>{o==="before-lang"?(a+=`/${s}`,i=!0):(a.includes(`/${r}/`)||(a+=`/${r}`),a+=`/${s}`)}),a.includes(`/${r}/`)||(a+=`/${r}`),t&&(a+=`/${t}`),i?{url:a,urlForRouter:`/${a.split("/").slice(2).join("/")}`}:a};const na="languageSwitcher_",xw=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:a,urlParts:i,variant:s="default",label:o,className:l=""})=>{const u=ue.useIntl(),{updateLanguage:c=()=>{}}=C.useContext(yo),[h,p]=C.useState(e);if(C.useEffect(()=>{e!==h&&p(e)},[e]),!r||!Object.values(r).some(D=>D&&D.post_name))return null;const g=Object.keys(r),f=h!==e;return d.jsxs("div",{className:Y("language-switcher text-small",s,l),children:[d.jsxs("nav",{children:[s!=="short"&&d.jsx("p",{children:o||u.formatMessage({id:`${na}label`})}),d.jsx("ul",{children:g.map(D=>{var A;if(!ga[D])return null;const y=(A=r[D])==null?void 0:A.post_name;let x={className:D};if(h===D)x["aria-label"]=u.formatMessage({id:`${na}selected`},{language:ga[D]});else{const _=Cw(D,y,i);x={...x,href:typeof _=="string"?_:_.url,onClick:E=>{p(D),c(D),typeof a<"u"&&(E.preventDefault(),E.stopPropagation(),a(D,typeof _=="string"?_:_.urlForRouter))}}}return d.jsx("li",{children:d.jsx(_n,{...x,fallbackElement:"span",children:ga[D]})},D)})}),s!=="short"&&!f&&d.jsx("p",{children:u.formatMessage({id:`${na}translation_${t?"original":n?"human":"machine"}`})})]}),s!=="short"&&!f&&!t&&!n&&d.jsx("small",{children:u.formatMessage({id:`${na}disclaimer`},{email:Nn.support,link:D=>{const y=`mailto:${D}`;return d.jsx("a",{href:y,children:D})}})})]})};const qi=ue.createIntl({locale:"en",messages:Xn}),Rr=({hasNextPage:e=!0,loadNextPage:t=()=>{},isLoading:n=!1,variant:r="secondary",size:a="medium",styling:i={muted:!1,fullWidth:!1},icon:s=!1,messages:o={button:qi.formatMessage({id:"loadMore_button"}),endOfFeed:qi.formatMessage({id:"loadMore_endOfFeed"}),error:qi.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:u="LoadMore"})=>{const[c,h]=C.useState(""),p=async m=>{if(!n)try{await t(m)}catch(g){g instanceof Error?h(g.message):h("Unknown error")}};return!c&&!e&&!o.endOfFeed?null:d.jsx("footer",{className:Y("load-more",l),children:!c&&e?d.jsx(Be,{variant:r,size:a,styling:i,icon:s,onClick:p,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",disabled:n,className:"gtm-trackable","data-testid":"load-more-button",children:o.button}):o.endOfFeed&&(!c||c!=null&&c.includes("Cannot read items"))?d.jsx("p",{children:o.endOfFeed}):c&&d.jsx("p",{className:"error",children:o.error})})};const Eo=({variant:e="default",version:t="default",className:n="",...r})=>d.jsx("p",{className:"logo-wrapper",children:d.jsx("a",{href:"/home/",className:Y("logo",e,t,n),...r,children:d.jsx(Me,{children:d.jsx(ue.FormattedMessage,{id:"apolitical"})})})});let ra=!1;const Vf=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const a=ue.useIntl(),i=C.useRef(null),[s,o]=C.useState(!1),l=u=>{i.current&&u.target instanceof HTMLElement&&!i.current.contains(u.target)&&o(!1)};return C.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),C.createElement(e,{ref:i,className:Y("more-menu text-medium",r),children:d.jsxs(d.Fragment,{children:[d.jsx(Be,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>o(!s),"aria-haspopup":"true","aria-expanded":s,"aria-controls":t,screenreaderText:a.formatMessage({id:"moreMenu"}),className:"more-menu-button"}),d.jsx("ul",{id:t,hidden:!s,children:n.map(({href:u,onClick:c,text:h,icon:p,...m},g)=>{const f={...m,onClick:D=>{o(!1),typeof c=="function"&&c(D)},onFocus:()=>{ra&&(clearTimeout(ra),ra=!1)},onBlur:()=>{ra=setTimeout(()=>{o(!1)},100)}};return u&&(f.href=u),d.jsx("li",{className:"more-menu-list-item",children:d.jsx(Be,{variant:"tertiary",size:"medium",icon:p?{icon:p,position:"left"}:!1,...f,children:h})},`${window.btoa(h)}_${g}`)})})]})})},ww=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const Ew=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"},{key:"communities",href:"/communities/"}],Kf=({activeLink:e})=>{const t=ue.useIntl(),n=C.useContext(Mt),r=n&&typeof n.id=="string";return d.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[Ew.map(({key:a,href:i})=>{const s=ww(i,e),o={};return s&&(o["aria-current"]="page"),d.jsx("li",{className:Y(a,{active:s}),children:d.jsx("a",{href:i,"data-gtm-event-type":`${a}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",...o,children:t.formatMessage({id:`navigationMenu_links_${a}`})})},a)}),r&&d.jsx("li",{className:"profile","data-testid":"profile-link",children:d.jsxs("a",{href:"/profiles/me","data-gtm-event-type":"profile-click","data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:[d.jsx(sn,{name:(n==null?void 0:n.name)||"",src:n!=null&&n.image?n.image.thumbnail:""}),d.jsx("span",{children:t.formatMessage({id:"navigationMenu_profile"})})]})})]})},fr=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,kw=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${fr(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(`${fr(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(`${fr(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
|
|
157
|
+
*/function tc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tc(Object(n),!0).forEach(function(r){yx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yx(e,t,n){return t=Cx(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dx(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cx(e){var t=Dx(e,"string");return typeof t=="symbol"?t:String(t)}var rc={activateTrap:function(t,n){if(t.length>0){var r=t[t.length-1];r!==n&&r.pause()}var a=t.indexOf(n);a===-1||t.splice(a,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}},xx=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},wx=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},xr=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},Ex=function(t){return xr(t)&&!t.shiftKey},kx=function(t){return xr(t)&&t.shiftKey},ac=function(t){return setTimeout(t,0)},ic=function(t,n){var r=-1;return t.every(function(a,i){return n(a)?(r=i,!1):!0}),r},lr=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return typeof t=="function"?t.apply(void 0,r):t},Xr=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},_x=[],Bx=function(t,n){var r=(n==null?void 0:n.document)||document,a=(n==null?void 0:n.trapStack)||_x,i=nc({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Ex,isKeyBackward:kx},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,l=function(w,k,O){return w&&w[k]!==void 0?w[k]:i[O||k]},u=function(w,k){var O=typeof(k==null?void 0:k.composedPath)=="function"?k.composedPath():void 0;return s.containerGroups.findIndex(function(j){var q=j.container,z=j.tabbableNodes;return q.contains(w)||(O==null?void 0:O.includes(q))||z.find(function(re){return re===w})})},c=function(w){var k=i[w];if(typeof k=="function"){for(var O=arguments.length,j=new Array(O>1?O-1:0),q=1;q<O;q++)j[q-1]=arguments[q];k=k.apply(void 0,j)}if(k===!0&&(k=void 0),!k){if(k===void 0||k===!1)return k;throw new Error("`".concat(w,"` was specified but was not a node, or did not return a node"))}var z=k;if(typeof k=="string"&&(z=r.querySelector(k),!z))throw new Error("`".concat(w,"` as selector refers to no known node"));return z},h=function(){var w=c("initialFocus");if(w===!1)return!1;if(w===void 0||!pa(w,i.tabbableOptions))if(u(r.activeElement)>=0)w=r.activeElement;else{var k=s.tabbableGroups[0],O=k&&k.firstTabbableNode;w=O||c("fallbackFocus")}if(!w)throw new Error("Your focus-trap needs to have at least one focusable element");return w},p=function(){if(s.containerGroups=s.containers.map(function(w){var k=Pf(w,i.tabbableOptions),O=Nf(w,i.tabbableOptions),j=k.length>0?k[0]:void 0,q=k.length>0?k[k.length-1]:void 0,z=O.find(function(v){return dn(v)}),re=O.slice().reverse().find(function(v){return dn(v)}),X=!!k.find(function(v){return Jt(v)>0});return{container:w,tabbableNodes:k,focusableNodes:O,posTabIndexesFound:X,firstTabbableNode:j,lastTabbableNode:q,firstDomTabbableNode:z,lastDomTabbableNode:re,nextTabbableNode:function(H){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,B=k.indexOf(H);return B<0?ee?O.slice(O.indexOf(H)+1).find(function(T){return dn(T)}):O.slice(0,O.indexOf(H)).reverse().find(function(T){return dn(T)}):k[B+(ee?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(w){return w.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(w){return w.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function M(w){var k=w.activeElement;if(k)return k.shadowRoot&&k.shadowRoot.activeElement!==null?M(k.shadowRoot):k},g=function M(w){if(w!==!1&&w!==m(document)){if(!w||!w.focus){M(h());return}w.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=w,xx(w)&&w.select()}},f=function(w){var k=c("setReturnFocus",w);return k||(k===!1?!1:w)},D=function(w){var k=w.target,O=w.event,j=w.isBackward,q=j===void 0?!1:j;k=k||Xr(O),p();var z=null;if(s.tabbableGroups.length>0){var re=u(k,O),X=re>=0?s.containerGroups[re]:void 0;if(re<0)q?z=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:z=s.tabbableGroups[0].firstTabbableNode;else if(q){var v=ic(s.tabbableGroups,function(L){var U=L.firstTabbableNode;return k===U});if(v<0&&(X.container===k||pa(k,i.tabbableOptions)&&!dn(k,i.tabbableOptions)&&!X.nextTabbableNode(k,!1))&&(v=re),v>=0){var H=v===0?s.tabbableGroups.length-1:v-1,ee=s.tabbableGroups[H];z=Jt(k)>=0?ee.lastTabbableNode:ee.lastDomTabbableNode}else xr(O)||(z=X.nextTabbableNode(k,!1))}else{var B=ic(s.tabbableGroups,function(L){var U=L.lastTabbableNode;return k===U});if(B<0&&(X.container===k||pa(k,i.tabbableOptions)&&!dn(k,i.tabbableOptions)&&!X.nextTabbableNode(k))&&(B=re),B>=0){var T=B===s.tabbableGroups.length-1?0:B+1,W=s.tabbableGroups[T];z=Jt(k)>=0?W.firstTabbableNode:W.firstDomTabbableNode}else xr(O)||(z=X.nextTabbableNode(k))}}else z=c("fallbackFocus");return z},y=function(w){var k=Xr(w);if(!(u(k,w)>=0)){if(lr(i.clickOutsideDeactivates,w)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}lr(i.allowOutsideClick,w)||w.preventDefault()}},x=function(w){var k=Xr(w),O=u(k,w)>=0;if(O||k instanceof Document)O&&(s.mostRecentlyFocusedNode=k);else{w.stopImmediatePropagation();var j,q=!0;if(s.mostRecentlyFocusedNode)if(Jt(s.mostRecentlyFocusedNode)>0){var z=u(s.mostRecentlyFocusedNode),re=s.containerGroups[z].tabbableNodes;if(re.length>0){var X=re.findIndex(function(v){return v===s.mostRecentlyFocusedNode});X>=0&&(i.isKeyForward(s.recentNavEvent)?X+1<re.length&&(j=re[X+1],q=!1):X-1>=0&&(j=re[X-1],q=!1))}}else s.containerGroups.some(function(v){return v.tabbableNodes.some(function(H){return Jt(H)>0})})||(q=!1);else q=!1;q&&(j=D({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),g(j||s.mostRecentlyFocusedNode||h())}s.recentNavEvent=void 0},A=function(w){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=w;var O=D({event:w,isBackward:k});O&&(xr(w)&&w.preventDefault(),g(O))},_=function(w){if(wx(w)&&lr(i.escapeDeactivates,w)!==!1){w.preventDefault(),o.deactivate();return}(i.isKeyForward(w)||i.isKeyBackward(w))&&A(w,i.isKeyBackward(w))},E=function(w){var k=Xr(w);u(k,w)>=0||lr(i.clickOutsideDeactivates,w)||lr(i.allowOutsideClick,w)||(w.preventDefault(),w.stopImmediatePropagation())},F=function(){if(s.active)return rc.activateTrap(a,o),s.delayInitialFocusTimer=i.delayInitialFocus?ac(function(){g(h())}):g(h()),r.addEventListener("focusin",x,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",E,{capture:!0,passive:!1}),r.addEventListener("keydown",_,{capture:!0,passive:!1}),o},S=function(){if(s.active)return r.removeEventListener("focusin",x,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",E,!0),r.removeEventListener("keydown",_,!0),o},$=function(w){var k=w.some(function(O){var j=Array.from(O.removedNodes);return j.some(function(q){return q===s.mostRecentlyFocusedNode})});k&&g(h())},R=typeof window<"u"&&"MutationObserver"in window?new MutationObserver($):void 0,I=function(){R&&(R.disconnect(),s.active&&!s.paused&&s.containers.map(function(w){R.observe(w,{subtree:!0,childList:!0})}))};return o={get active(){return s.active},get paused(){return s.paused},activate:function(w){if(s.active)return this;var k=l(w,"onActivate"),O=l(w,"onPostActivate"),j=l(w,"checkCanFocusTrap");j||p(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=r.activeElement,k==null||k();var q=function(){j&&p(),F(),I(),O==null||O()};return j?(j(s.containers.concat()).then(q,q),this):(q(),this)},deactivate:function(w){if(!s.active)return this;var k=nc({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},w);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,S(),s.active=!1,s.paused=!1,I(),rc.deactivateTrap(a,o);var O=l(k,"onDeactivate"),j=l(k,"onPostDeactivate"),q=l(k,"checkCanReturnFocus"),z=l(k,"returnFocus","returnFocusOnDeactivate");O==null||O();var re=function(){ac(function(){z&&g(f(s.nodeFocusedBeforeActivation)),j==null||j()})};return z&&q?(q(f(s.nodeFocusedBeforeActivation)).then(re,re),this):(re(),this)},pause:function(w){if(s.paused||!s.active)return this;var k=l(w,"onPause"),O=l(w,"onPostPause");return s.paused=!0,k==null||k(),S(),I(),O==null||O(),this},unpause:function(w){if(!s.paused||!s.active)return this;var k=l(w,"onUnpause"),O=l(w,"onPostUnpause");return s.paused=!1,k==null||k(),p(),F(),I(),O==null||O(),this},updateContainerElements:function(w){var k=[].concat(w).filter(Boolean);return s.containers=k.map(function(O){return typeof O=="string"?r.querySelector(O):O}),s.active&&p(),I(),this}},o.updateContainerElements(t),o};const Ax=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:Bx},Symbol.toStringTag,{value:"Module"})),Fx=Dc(Ax),Tx=Dc(bx);function Gn(e){"@babel/helpers - typeof";return Gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gn(e)}function Sx(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rf(r.key),r)}}function jx(e,t,n){return t&&sc(e.prototype,t),n&&sc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ox(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Os(e,t)}function Os(e,t){return Os=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Os(e,t)}function Px(e){var t=Rx();return function(){var r=Sa(e),a;if(t){var i=Sa(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return Nx(this,a)}}function Nx(e,t){if(t&&(Gn(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pr(e)}function pr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rx(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sa(e){return Sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sa(e)}function Mx(e,t,n){return t=Rf(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rf(e){var t=Ix(e,"string");return Gn(t)==="symbol"?t:String(t)}function Ix(e,t){if(Gn(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Gn(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ea=C,be=nx,$x=Fx,Lx=$x.createFocusTrap,zx=Tx,qx=zx.isFocusable,bo=function(e){Ox(n,e);var t=Px(n);function n(r){var a;Sx(this,n),a=t.call(this,r),Mx(pr(a),"getNodeForOption",function(o){var l,u=(l=this.internalOptions[o])!==null&&l!==void 0?l:this.originalOptions[o];if(typeof u=="function"){for(var c=arguments.length,h=new Array(c>1?c-1:0),p=1;p<c;p++)h[p-1]=arguments[p];u=u.apply(void 0,h)}if(u===!0&&(u=void 0),!u){if(u===void 0||u===!1)return u;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var m=u;if(typeof u=="string"){var g;if(m=(g=this.getDocument())===null||g===void 0?void 0:g.querySelector(u),!m)throw new Error("`".concat(o,"` as selector refers to no known node"))}return m}),a.handleDeactivate=a.handleDeactivate.bind(pr(a)),a.handlePostDeactivate=a.handlePostDeactivate.bind(pr(a)),a.handleClickOutsideDeactivates=a.handleClickOutsideDeactivates.bind(pr(a)),a.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:a.handleDeactivate,onPostDeactivate:a.handlePostDeactivate,clickOutsideDeactivates:a.handleClickOutsideDeactivates},a.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var i=r.focusTrapOptions;for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){if(s==="returnFocusOnDeactivate"||s==="onDeactivate"||s==="onPostDeactivate"||s==="checkCanReturnFocus"||s==="clickOutsideDeactivates"){a.originalOptions[s]=i[s];continue}a.internalOptions[s]=i[s]}return a.outsideClick=null,a.focusTrapElements=r.containerElements||[],a.updatePreviousElement(),a}return jx(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var a=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return a||(a===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var a=this.getDocument();a&&(this.previouslyFocusedElement=a.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(a){var i=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,a):this.originalOptions.clickOutsideDeactivates;return i&&(this.outsideClick={target:a.target,allowDeactivation:i}),i}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var a=this,i=function(){var o=a.getReturnFocusNode(),l=!!(a.originalOptions.returnFocusOnDeactivate&&o!==null&&o!==void 0&&o.focus&&(!a.outsideClick||a.outsideClick.allowDeactivation&&!qx(a.outsideClick.target,a.internalOptions.tabbableOptions))),u=a.internalOptions.preventScroll,c=u===void 0?!1:u;l&&o.focus({preventScroll:c}),a.originalOptions.onPostDeactivate&&a.originalOptions.onPostDeactivate.call(null),a.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(i,i):i()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var a=this.focusTrapElements.some(Boolean);a&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(a){if(this.focusTrap){a.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var i=!a.active&&this.props.active,s=a.active&&!this.props.active,o=!a.paused&&this.props.paused,l=a.paused&&!this.props.paused;if(i&&(this.updatePreviousElement(),this.focusTrap.activate()),s){this.deactivateTrap();return}o&&this.focusTrap.pause(),l&&this.focusTrap.unpause()}else a.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var a=this,i=this.props.children?ea.Children.only(this.props.children):void 0;if(i){if(i.type&&i.type===ea.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var s=function(u){var c=a.props.containerElements;i&&(typeof i.ref=="function"?i.ref(u):i.ref&&(i.ref.current=u)),a.focusTrapElements=c||[u]},o=ea.cloneElement(i,{ref:s});return o}return null}}]),n}(ea.Component),cr=typeof Element>"u"?Function:Element;bo.propTypes={active:be.bool,paused:be.bool,focusTrapOptions:be.shape({document:be.object,onActivate:be.func,onPostActivate:be.func,checkCanFocusTrap:be.func,onPause:be.func,onPostPause:be.func,onUnpause:be.func,onPostUnpause:be.func,onDeactivate:be.func,onPostDeactivate:be.func,checkCanReturnFocus:be.func,initialFocus:be.oneOfType([be.instanceOf(cr),be.string,be.bool,be.func]),fallbackFocus:be.oneOfType([be.instanceOf(cr),be.string,be.func]),escapeDeactivates:be.oneOfType([be.bool,be.func]),clickOutsideDeactivates:be.oneOfType([be.bool,be.func]),returnFocusOnDeactivate:be.bool,setReturnFocus:be.oneOfType([be.instanceOf(cr),be.string,be.bool,be.func]),allowOutsideClick:be.oneOfType([be.bool,be.func]),preventScroll:be.bool,tabbableOptions:be.shape({displayCheck:be.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:be.oneOfType([be.bool,be.func])}),trapStack:be.array,isKeyForward:be.func,isKeyBackward:be.func}),containerElements:be.arrayOf(be.instanceOf(cr)),children:be.oneOfType([be.element,be.instanceOf(cr)])};bo.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:Lx};var Wx=bo;const Hx=wn(Wx),Mf=({showDevTools:e=!0,children:t})=>{const n=new Ke.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return d.jsxs(Ke.QueryClientProvider,{client:n,children:[t,e&&d.jsx(Dh.ReactQueryDevtools,{initialIsOpen:!1})]})};var Ux=C.createContext({client:sa});function Vx(e){var t=e.children,n=e.client,r=e.apiKey,a=e.options,i=C.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&&a&&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&&(sa.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),sa.init(r,a)),sa)},[n,r]);return C.createElement(Ux.Provider,{value:{client:i}},t)}const If=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?d.jsx(Vx,{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}):d.jsx(d.Fragment,{children:e}),$f=({children:e,locale:t,messages:n})=>{const r=t||"en",a={...Ih[r],...n||{}};return d.jsx(ue.IntlProvider,{locale:r,messages:a,children:e})},yo=C.createContext({}),ga={en:"English",es:"Español",fr:"Français",pt:"Português"},Mt=C.createContext({isLoading:!0});function Ga(){return C.useContext(Mt)}const Lf=({children:e,user:t})=>d.jsx(Mt.Provider,{value:t,children:e}),Do=C.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),zf=()=>C.useContext(Do),qf=({children:e})=>{const[t,n]=C.useState([]);C.useEffect(()=>{t.length>0?document.body.classList.add("has-overlay"):document.body.classList.remove("has-overlay")},[t]);const r=C.useCallback(i=>{n(s=>[...s,i])},[]),a=C.useCallback(i=>{n(s=>s.filter(o=>o!==i))},[]);return d.jsx(Do.Provider,{value:{registerOverlay:r,unregisterOverlay:a},children:e})},Kx=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[a,i]=C.useState({isLoading:!0}),s=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[o,l]=C.useState(s),u=c=>{localStorage.setItem("language",c),l(c)};return C.useEffect(()=>{e().then(c=>{i({...c,isLoading:!1}),Nc(5e3)}).catch(c=>{c.message===Sc&&window.location.pathname!=="/user-onboarding/logout"&&(window.location.href="/user-onboarding/logout"),i({isLoading:!1})})},[]),d.jsx(yo.Provider,{value:{language:o,updateLanguage:u},children:d.jsx($f,{locale:o,messages:n==null?void 0:n.messages,children:d.jsx(Ps.CookiesProvider,{children:d.jsx(Lf,{user:a,children:d.jsx(qf,{children:d.jsx(Mf,{showDevTools:r,children:d.jsx(If,{user:a,children:t})})})})})})})};const Co=({element:e="section",children:t,className:n,...r})=>C.createElement(e,{className:Y("modal",n),children:typeof t=="string"?d.jsx("p",{children:t}):t,...r});const Nr=({id:e="content-overlay",isOpen:t=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:a=()=>{},onClose:i=()=>{}}={},forceShow:{error:s=!1}={},title:o,children:l,buttons:u,className:c="",gtmContext:h="Modal"})=>{const p=ue.useIntl(),{registerOverlay:m,unregisterOverlay:g}=zf(),[f,D]=C.useState(t),y=_=>{_.key==="Escape"&&x(!1)};C.useEffect(()=>(window.addEventListener("keyup",y),()=>{window.removeEventListener("keyup",y)}));const x=_=>{D(_),_?(a(),m(e)):(i(),g(e))};C.useEffect(()=>(x(t),()=>{f&&g(e)}),[t]);const A=r?{"--max-width":`${r/16}rem`}:{};return d.jsx("div",{className:Y("overlay",{open:f}),role:"dialog",children:d.jsx(Co,{id:e,className:Y("overlay-modal",c,{"has-max-width":r}),hidden:!f,style:A,children:t&&d.jsx(Hx,{children:d.jsxs("div",{className:"overlay-content",children:[d.jsxs("div",{className:"top",children:[o&&d.jsx("h2",{className:"modal-title",children:o}),d.jsx(Be,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>x(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":h,screenreaderText:p.formatMessage({id:"overlay_close"})})]}),n&&d.jsx(tn,{}),l,u&&d.jsxs("div",{className:"bottom",children:[d.jsx(tn,{}),d.jsx(kn,{buttons:u})]}),s&&d.jsx(Er,{className:"error",children:s})]})})})})},Wf=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const Zx=({className:e,showModal:t=!0,title:n,formTitle:r,formLabel:a,ctaMessage:i,showIcon:s,onClose:o,reportError:l=()=>{},sendInvites:u})=>{const c=ue.useIntl();return r||(r=c.formatMessage({id:"inviteModal_formTitle"})),a||(a=c.formatMessage({id:"inviteModal_formLabel"})),i||(i=c.formatMessage({id:"inviteModal_cta"})),d.jsx(Nr,{title:n,isOpen:t,showDivider:!1,showIcon:s,functions:{onClose:o},className:Y("invite-modal",e,{success:!!n}),children:d.jsx(Ef,{title:r,label:a,ctaMessage:i,onClose:o,sendInvites:u,reportError:l})})};const Yx=({members:e})=>{const[t,n]=C.useState(!1),r=a=>{const{fullName:i,jobTitle:s,organisation:o,photo:l}=a||{};return d.jsxs(d.Fragment,{children:[d.jsx(sn,{name:i,src:l}),d.jsx("p",{children:i}),d.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return d.jsxs("div",{className:"directory-wrapper",children:[d.jsx("ul",{className:"directory",children:e.map(a=>d.jsx("li",{children:d.jsx("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),n(a)},children:r(a)})},a.fullName))}),d.jsx(Nr,{isOpen:t!==!1,children:t===!1?"":d.jsxs(d.Fragment,{children:[r(t),d.jsx(Vn,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const Gx=({author:e,authorCite:t,content:n,member:r,className:a=""})=>d.jsxs("blockquote",{className:Y("testimonial-block",a),children:[d.jsx(Pt,{className:"testimonial",children:n}),r?d.jsx(tr,{member:r,styling:{size:"large"}}):d.jsxs(d.Fragment,{children:[e&&d.jsx("p",{className:Y("author",{"text-small":!a.includes("new")}),children:e}),t&&d.jsx("p",{className:Y("author-cite",{"text-small":!a.includes("new")}),children:d.jsx("cite",{children:t})})]})]}),Qx=C.memo(Gx);const Jx=({items:e=[],selector:t="",className:n=""})=>{const r=ue.useIntl(),[a,i]=C.useState(e);return C.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,c)=>{s+=`${c>0?", ":""}${t} h${c+1}`});const l=Array.from(document.querySelectorAll(s)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));i(l)},[]),a&&a.length>0&&d.jsxs(Nt,{variant:"subtle",className:Y("table-of-contents",n),children:[d.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),d.jsx("nav",{children:d.jsx("ul",{children:a.map(({id:s,text:o})=>d.jsx("li",{children:d.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const Qa=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:a=""})=>{const i=ue.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=c=>{const h=c/60,p=Math.floor(h),m=(h-p)*60,g=Math.round(m),f=`${i.formatMessage({id:`${s}hours`},{time:p})}${p>0&&g>0?", ":""}${i.formatMessage({id:`${s}minutes`},{time:g})}`;return{text:`${p>0?`${i.formatMessage({id:`${s}hours_short`},{time:p})} `:""}${g>0?i.formatMessage({id:`${s}minutes_short`},{time:g}):""}`,ariaText:f}};let{text:l,ariaText:u}=o(e);if(t){const{text:c,ariaText:h}=o(e+t);l=i.formatMessage({id:`${s}range`},{early:l,late:c}),u=i.formatMessage({id:`${s}range_aria`},{early:u,late:h})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),d.jsx("span",{className:Y("time-to-complete",a),"aria-label":u,children:l})};const Xx=({className:e="",image:t,...n})=>t?(typeof t=="string"&&(t={width:1080,height:200,type:"image/png",url:t}),t.range=[{height:124,width:425},{height:200,width:768},{height:200,width:1368}],t.query="fit=thumb&f=center",d.jsx(er,{...n,className:Y("banner",e),image:{...t,aspect:"banner"}})):null;const ln=({children:e,className:t="",styling:n={},...r})=>{const{background:a="default"}=n;return d.jsx("section",{className:Y("full-width-section",t,{[a]:a!=="default"}),...r,children:e})};const ew=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(a=>{r.push({href:a.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable","data-gtm-event-type":"download-click","data-gtm-event-context":a.eventContext||"Download",target:"_blank",children:a.text})}),d.jsx(ln,{className:Y("download-section",n),children:d.jsxs("div",{className:"content-default",children:[C.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),d.jsx(kn,{buttons:r})]})})};function Hf({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const tw=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:a,setShowModal:i})=>{const{formatMessage:s}=ue.useIntl();return d.jsxs("div",{className:Y("edit-section-placeholder",{"has-icon":!!e}),style:Oc(e),children:[d.jsx("p",{children:t||s({id:"edit_section_placeholder_description"})}),a&&d.jsx(Be,{href:r,variant:"secondary",size:"small",onClick:()=>Hf({href:r,setShowModal:i}),children:n||s({id:"edit_section_placeholder_cta"})})]})},nw=({children:e,className:t="",formProps:n,href:r,title:a,modalTitle:i,placeholder:s,showDivider:o=!0})=>{const[l,u]=C.useState(!1),c=typeof r=="string"||!!n,h=()=>u(!1);return d.jsxs("section",{className:Y("edit-section",t),children:[n&&d.jsx(Nr,{title:i||`Edit ${a}`,isOpen:l,showDivider:!1,showIcon:!1,functions:{onClose:h},className:Y("edit-section-modal"),children:d.jsx(nr,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async p=>{var m,g;(m=n==null?void 0:n.functions)!=null&&m.onSuccess&&await((g=n==null?void 0:n.functions)==null?void 0:g.onSuccess(p)),u(!1)},onCancel:h}})}),d.jsxs("div",{className:"edit-section-header",children:[d.jsx("h2",{className:"edit-section-header-title",children:a}),c&&d.jsx(Be,{href:r,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>Hf({href:r,setShowModal:u}),children:"Edit"})]}),e||d.jsx(tw,{...s,href:r,setShowModal:u,showEditButton:c}),o&&d.jsx(tn,{})]})};const rw=({title:e=!1,text:t,logos:n=[],styling:r={},className:a=""})=>{const i=n.length;if(i===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return d.jsxs("div",{className:Y("logos",a,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&C.createElement(s.element,{className:Y("title",s.className)},s.text),t&&d.jsx("p",{children:t}),d.jsx("ul",{className:Y({"two-col":i===2||i===4,"three-col":i===5||i<=10&&i%3===0}),children:n.map(({logo:c,nameOfBusiness:h,link:p=!1,description:m=!1},g)=>{if(!c||!c.url)return null;const f=d.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:h});return d.jsxs("li",{children:[d.jsx("p",{className:"img-wrapper",children:p?d.jsx("a",{href:p,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),m&&d.jsx("small",{children:m})]},window.btoa(`${c.url}_${g}`))})})]})};const aw=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],iw=({className:e="",content:t,image:n,variant:r,spacing:a="normal",styling:i,hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:l})=>{var g,f;const u={imageFullWidth:!0,...i};r||(r=u.imageFullWidth?"default":"light");const c=["eyebrow","title","text"],h={eyebrow:"small",title:"h1",text:"p"},p={};c.forEach(D=>{if(!t[D]){p[D]=!1;return}if(!s[D]){if(typeof t[D]=="object"){p[D]=t[D];const{text:y,element:x}=t[D];if(x&&aw.includes(x.toLowerCase()))return;p[D]={text:y,element:h[D]};return}p[D]={text:t[D],element:h[D]}}});const m=o&&o.text&&o.link;return m&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=D=>{D.preventDefault(),D.stopPropagation();const y=document.getElementById(o.link.substring(1));y&&y.scrollIntoView({behavior:"smooth"})}),d.jsx(ln,{className:Y("banner-section",r,a,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":m,"has-extra-spacing":r!=="subtle"&&a==="normal"&&p.eyebrow&&p.title}),children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"content-wrapper",children:[c.map(D=>{if(p[D]&&typeof p[D]=="object"){const{text:y,element:x=""}=p[D];return D==="text"?d.jsx(Vn,{overrideType:"text-only",className:"text",children:y},D):C.createElement(x,{key:D,className:D},y)}return null}),l,m&&d.jsx(Be,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:Y({new:r==="subtle",[(g=o.props)==null?void 0:g.className]:(f=o.props)==null?void 0:f.className}),children:o.text})]}),n&&d.jsx(er,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},sw=C.memo(iw);const ow=({image:e,variant:t="default",children:n,className:r=""})=>{const a={};return e&&(a["--image"]=`url(${e})`),d.jsx(ln,{className:Y("custom-content-banner",t,r,{"has-image":e}),style:a,children:d.jsx("div",{className:"content-slim",children:n})})};const uw=({alignImage:e="left",className:t,content:n,image:r})=>{const a=typeof n=="string"?d.jsx(Vn,{children:n}):n;return d.jsxs(ln,{className:Y("highlight-section",t),children:[r&&d.jsx("div",{className:Y("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:d.jsx(er,{image:{...r,description:""}})}),d.jsx("div",{className:Y("highlight-container highlight-content-wrapper",{"no-image":!r}),children:d.jsx("div",{className:Y("highlight-content",{"highlight-content-right":e==="left"}),children:r?a:d.jsx("div",{className:"content-default",children:a})})})]})},lw=C.memo(uw);const cw=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:a})=>!n&&!r?null:d.jsxs("aside",{className:Y("marketing-block",e),children:[n&&d.jsx("p",{className:"title",children:n}),r&&d.jsx("p",{children:r}),t&&d.jsx(Be,{variant:"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":a,"data-gtm-event-type":"learn-more-click",children:t.text})]}),dw=({type:e,data:t})=>{const n=ue.useIntl(),{answers:r,createdAt:a,dateHasPassed:i,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:c}=t;if(e==="question"){const h=a&&as(a);return d.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),a&&d.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})]})]})}if(c&&!i||s)return d.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):Ms(c)});if(o)return d.jsx(hn,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const h=u&&as(u);return d.jsxs("ul",{className:"details",children:[l&&d.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&d.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})})]})}return null},ja={communityPage:{basePath:"/communities/",className:"communityPage",gtmEvent:"community"},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"}},fw=({data:e,cta:t,link:n,gtmContext:r})=>{var f,D;const a=ue.useIntl(),[i,s]=C.useState({loading:!1,registered:e.registered||!1});C.useEffect(()=>{e.registered&&s(y=>({...y,registered:!0}))},[e.registered]);const{customLinkText:o,startDate:l,dateHasPassed:u,pill:c,slug:h}=e,p=e.contentType;let m="";if((f=ja[p])!=null&&f.gtmEvent&&(m=ja[p].gtmEvent),l&&u)return n?d.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_watch"})}):null;if(p==="people")return n?d.jsx(Be,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_cta_people"})}):null;const g=["communityPage","microcourse","event"];if(t&&t.onClick&&g.includes(p)&&c!=="premium"){const y=i.loading||i.registered||((D=e==null?void 0:e.members)==null?void 0:D.isMember),x=async A=>{if(A.preventDefault(),A.stopPropagation(),!(y||!t||!t.onClick)){s(_=>({..._,loading:!0}));try{const _=await t.onClick(e);s(_==="success"?()=>({registered:!0,loading:!1}):E=>({...E,loading:!1}))}catch{s(E=>({...E,loading:!1}))}}};return d.jsx("p",{className:Y("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:d.jsx(Be,{onClick:x,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:y,"data-gtm-event-context":`${r}Page-${p}: ${h}`,"data-gtm-event-type":`${r}-${p}-register-click`,"data-testid":"in-card-button",children:o||a.formatMessage({id:`card_cta_${p}${y?`_${i.loading?"loading":"done"}`:""}`})})})}return null};const hw={title:66,text:3e3,secondaryText:1e3,partner:25},xo=({id:e="",card:t,buildCardData:n,cta:r,gtmContext:a="Carousel",className:i="",handleCardClick:s,setFocus:o=!1})=>{var M,w,k,O,j;const l=ue.useIntl(),u=C.useContext(Mt),c=u&&typeof u.id=="string",h=C.useRef(null),[p,m]=C.useState({data:null,isLoading:!0}),{data:g,isLoading:f}=p,D=C.useCallback(()=>{n(t,c).then(q=>{m(()=>({data:q,isLoading:!1}))}).catch(()=>m(q=>({...q,isLoading:!1})))},[e]);if(C.useEffect(()=>{D()},[]),f||!g)return d.jsx(wt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});s&&!r&&(r={text:l.formatMessage({id:`card_cta_${t.contentType}`}),onClick:s});const{contentType:y}=g;if(!y||!ja[y])return d.jsx(wt,{element:"li",className:"card-wrapper"});const{basePath:x="",className:A,length:_,gtmEvent:E}=ja[y];let F=g.slug?`${x}${g.slug}`:!1;g.slug&&(g.slug.slice(0,4)==="http"||g.slug.slice(0,2)==="//"||g.slug.slice(0,6)==="mailto"||g.slug.slice(0,3)==="tel")&&(F=g.slug);const S=q=>{F&&(q.preventDefault(),q.stopPropagation(),window.location.href=F)},$={...hw,..._};let R={className:"card"},I={};return F&&(I={href:F,className:"gtm-trackable","data-gtm-event-context":`${a}-CarouselCard`,"data-gtm-event-type":`${E}-click`,"data-testid":"link"},g.openInNewTab&&(I.target="_blank"),R={onClick:S,className:"card gtm-trackable","data-gtm-event-context":`${a}-CarouselCard`,"data-gtm-event-type":`${E}-click`}),o&&(R={...R,tabIndex:"0"},(M=h==null?void 0:h.current)==null||M.focus(),(w=h==null?void 0:h.current)==null||w.scrollIntoView({behavior:"smooth"})),d.jsx("li",{className:Y("card-wrapper text-medium",A,i,{"has-link":F,"no-link":!F,"has-image":g.banner}),"data-testid":`${y}-card`,children:d.jsxs("div",{...R,ref:h,children:[d.jsx($c,{className:"card-label",contentType:y,customIcon:g.isPrivate?"lock-locked":g.customIcon,customLabel:g.customLabel}),y==="communityPage"&&(g==null?void 0:g.createdAt)&&jh(g==null?void 0:g.createdAt,60)&&d.jsx(hn,{size:"small",variant:"information","data-testid":"new-community",children:l.formatMessage({id:"card_new"})}),g.startDate&&!g.isOngoingEvent&&d.jsx(hn,{size:"small",variant:g.dateHasPassed?"default":"information","data-testid":"date",children:g.dateHasPassed?l.formatMessage({id:"card_ended"}):Pc(g.startDate)}),g.banner?d.jsxs("p",{className:"img",children:[g.registered&&d.jsx(hn,{size:"small",variant:"registered",children:l.formatMessage({id:"card_registered"})}),d.jsx(er,{image:{...g.banner,description:""}})]}):A==="people"?d.jsx(sn,{name:g.title||"",src:g.profile,"data-testid":"people-profile-picture"}):null,g.contributors&&d.jsx(qs,{contributors:{data:g.contributors},styling:{size:"small",showGap:A!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(y)?l.formatMessage({id:`card_contributors_${y}`}):void 0,"data-testid":"contributors"}),g.partner&&d.jsx("p",{className:"partners","data-testid":"partners",children:g.partner.length>1?l.formatMessage({id:"card_partner"},{partner:g.partner[0],number:g.partner.length-1}):Hn(g.partner[0],$.partner)}),["title","text","secondaryText"].map(q=>{const z=g[q];if(!z)return null;const re=Ac(q),X={key:q,className:re,"data-testid":re},v={wrapper:"p",forceWrapper:!0,forceInline:!0},H=Hn(z,$[q]);return["title","text"].includes(q)&&F?(v.wrapper="a",d.jsx("p",{...X,children:d.jsx(Pt,{options:v,...I,children:H})})):d.jsx(Pt,{options:v,...X,children:H})}),(u==null?void 0:u.id)&&(g==null?void 0:g.members)&&d.jsxs("span",{className:"member-information",children:[((k=g==null?void 0:g.members)==null?void 0:k.isMember)&&d.jsx(hn,{size:"small",variant:"registered",icon:((O=g==null?void 0:g.members)==null?void 0:O.memberType)==="owner"?"user":"tick",children:l.formatMessage({id:`card_member_type_${(j=g==null?void 0:g.members)==null?void 0:j.memberType}`})}),d.jsx("br",{}),d.jsx("span",{className:"label member-count",children:l.formatMessage({id:"card_member_count"},{count:g==null?void 0:g.members.count})})]}),d.jsx(dw,{type:A||"",data:g}),d.jsx(fw,{data:g,cta:r,link:F||"",gtmContext:a})]})})};const Uf=({cards:e,cardTypes:t,className:n="",...r})=>d.jsx("ul",{className:Y("card-block",n),children:e.map((a,i)=>{const s=a.slug?`${a.slug}-${t[i]}`:`${t[i]}-${i}`;return d.jsx(xo,{id:s,card:{...a,contentType:t[i]},setFocus:i===(r==null?void 0:r.focusCardIndex),...r},s)})}),mw=(e,t,n,r)=>{const a=t*n<=e,i=e<t*(n+1),s=r.includes(Math.floor(e/t));return a&&i||s},pw=({id:e,title:t})=>{const n=ue.useIntl();if(!t||!t.text)return null;const{text:r,element:a="h2",variant:i="default",size:s="medium",link:o}=t;return C.createElement(a,{className:Y("title",i,s,{"highlighted-title":i==="highlighted"}),children:d.jsxs(d.Fragment,{children:[r,o&&d.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 Li={fourCards:1024,threeCards:769,twoCards:480};let ta=null;const gw=({id:e,cards:t,cardTypes:n,buildCardData:r,title:a,className:i,gtmContext:s,...o})=>{const l=ue.useIntl(),[u,c]=C.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:h,isLoading:p}=u,[m,g]=C.useState({currentPage:0,loadedPages:[0]}),{currentPage:f,loadedPages:D}=m,[y,x]=C.useState(""),A=t.length,_=Math.ceil(A/h),E=C.useRef(null),F=Jn(!0,!0,E==null?void 0:E.current);C.useEffect(()=>{let w=1;F&&(F>=Li.fourCards?w=4:F>=Li.threeCards?w=3:F>=Li.twoCards&&(w=2),w>A&&(w=A)),c(k=>({...k,cardsPerPage:w,isLoading:!1}))},[F,A]);const S=(w="next")=>{let k=f;if(typeof w=="string")if(w==="next")if(f<_-1)k=f+1;else return;else if(f>0)k=f-1;else return;else k=w;g(j=>({...j,currentPage:k,loadedPages:[...new Set([...D,k])]}));const O=()=>{const j=k*u.cardsPerPage,q=j+u.cardsPerPage;return t.slice(j,q).length};x(l.formatMessage({id:"carousel_pagination_aria_live"},{direction:w,count:O()}))},$=w=>{ta=w.touches[0].clientX},R=w=>{if(ta===null)return;const k=w.touches[0].clientX,O=ta-k;O>5?S("next"):O<-5&&S("previous"),ta=null},I={"--width":`${F||0}px`,"--total-cards":A,"--cards-per-page":h,"--page":f};if(p)return d.jsx(Ls,{layout:`carousel${a?"-with-title":""}`});const M=(w,k)=>{var j;let O=null;return(j=w==null?void 0:w.sys)!=null&&j.id?O=`card-${w.sys.id}`:w!=null&&w.slug?O=`card-${w.slug}`:[n[k],w.contentType].includes("customCard")&&(O=`card-${window.btoa(`${w.title} ${w.createdAt}`)}-${k}`),O};return d.jsxs("section",{ref:E,className:Y("carousel-wrapper",i),"data-testid":"carousel",children:[d.jsx(pw,{id:e,title:a}),d.jsx("ul",{className:"carousel",onTouchStart:$,onTouchMove:R,style:I,"data-testid":"carousel-list",children:t.map((w,k)=>{let O=M(w,k);return O&&mw(k,h,f,D)?d.jsx(xo,{id:O,card:{...w,contentType:n[k]},buildCardData:r,gtmContext:s,...o},O):(O=O||`${e}-card-${k}`,d.jsx(wt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},O))})}),_<=1?null:d.jsxs(d.Fragment,{children:[d.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[d.jsx("li",{className:"arrow previous",children:d.jsx(Be,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:w=>{w.preventDefault(),w.stopPropagation(),S("previous")},screenreaderText:l.formatMessage({id:"carousel_pagination_previous"}),disabled:f<=0})}),[...Array(_)].map((w,k)=>d.jsx("li",{"data-testid":"carousel-controls-button",children:d.jsx("button",{className:Y("page-indicator",{selected:k===f}),onClick:O=>{O.preventDefault(),O.stopPropagation(),S(k)},children:d.jsx(Me,{showOnFocus:!1,children:l.formatMessage({id:"carousel_pagination_page"},{number:k+1,total:_})})})},`page-indicator-${k}`)),d.jsx("li",{className:"arrow next",children:d.jsx(Be,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:w=>{w.preventDefault(),w.stopPropagation(),S("next")},screenreaderText:l.formatMessage({id:"carousel_pagination_next"}),disabled:f>=_-1})})]}),d.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:y})]})]})},vw=({carousels:e=[],isLoading:t,title:n,className:r="",...a})=>!e||!e.length?null:e.map(({title:i,viewAllUrl:s,cards:o,cardsTypes:l},u)=>{const c=i?window.btoa(i):`carousel-${u}`,h=u===e.length-1;return t?d.jsxs(C.Fragment,{children:[d.jsx(Ls,{layout:`carousel${i?"-with-title":""}`,"data-testid":"carousel-placeholder"}),h?null:d.jsx(tn,{})]},`placeholder-${c}`):d.jsxs(C.Fragment,{children:[d.jsx(gw,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:i,link:s},...a}),h?null:d.jsx(tn,{})]},`carousel-${c}`)});const dr="joinCommunityButton",wo=({isMember:e=!1,isOpen:t=!1,isShort:n=!1,disabled:r=!1,functions:{join:a,leave:i}={join:()=>{},leave:()=>{}}})=>{const s=ue.useIntl(),o=C.useContext(Mt),l=o&&typeof o.id=="string",u=r||!l,[c,h]=C.useState(e),[p,m]=C.useState(e?"joined":"notJoined");C.useEffect(()=>{p==="joining"?m("joined"):p==="leaving"&&m("notJoined")},[c]);const g={},f={};return c&&p!=="leaving"&&(g["data-hover-text"]=s.formatMessage({id:`${dr}_leave`}),g["aria-label"]=s.formatMessage({id:`${dr}_member_aria`}),f["aria-hidden"]="true"),d.jsx(Be,{variant:c?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:c&&p!=="leaving"?{icon:"tick",position:"left"}:!1,tooltip:!t&&!c?s.formatMessage({id:`${dr}_closed_tooltip`}):"",onClick:async D=>{if(u)return;D.currentTarget.blur(),m(c?"leaving":"joining");const y=new CustomEvent("ariaLive",{detail:{message:s.formatMessage({id:`${dr}_aria_live`},{action:c?"leaving":"joining"})}});document.dispatchEvent(y);const x=c?i:a;typeof x=="function"&&setTimeout(async()=>{await x()},500),h(!c)},className:Y("join-community-button",p,{active:p==="joining"}),disabled:u,"data-testid":"join-button",...g,children:d.jsx("span",{className:"text",...f,children:s.formatMessage({id:`${dr}${["joining","leaving"].includes(p)?`_${p}`:c?"_member":n?"_short":""}`})})})};const zi="communityDetails_",bw=({className:e="",isMember:t=!1,isOpen:n=!1,slug:r,members:{number:a=0,data:i=[]}={number:0,data:[]},functions:{invite:s,...o}})=>{const l=ue.useIntl(),u=5,c=a||i.length,h=i.length?i:Array(u).fill({}),p=`/communities/${r}/members`===window.location.pathname,m=t||n,g=!n&&!t;return d.jsxs("div",{className:Y("community-details",e),children:[m&&d.jsxs("div",{className:"member-details",children:[d.jsxs("div",{className:"top",children:[d.jsxs("h4",{children:[l.formatMessage({id:`${zi}members`}),d.jsx("span",{className:"count",children:c})]}),!p&&d.jsx("p",{className:"text-small",children:d.jsx("a",{href:`/communities/${r}/members`,children:l.formatMessage({id:`${zi}viewAll`})})})]}),d.jsx(qs,{contributors:{total:a,data:h},styling:{size:"medium",showGap:!0,showPlaceholders:c===0},cutoff:u})]}),d.jsx(wo,{isMember:t,isOpen:n,disabled:g,functions:{...o}}),t&&d.jsx(Be,{variant:"primary",onClick:s,icon:{icon:"plus"},styling:{fullWidth:!0},children:l.formatMessage({id:`${zi}invite`})})]})};const yw=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=ue.useIntl();return d.jsxs(d.Fragment,{children:[d.jsx(Me,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),d.jsx("ul",{className:Y("breadcrumbs text-small",n),children:e.map(({text:a,href:i,current:s=!1},o)=>{const l={};return s&&(l["aria-current"]="location"),d.jsxs("li",{children:[s&&d.jsx(Me,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),d.jsx(_n,{href:s?void 0:i,...l,children:Hn(a,t)})]},`${window.btoa(a)}_${o}`)})})]})};const Dw=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:a=""})=>{const i=ue.useIntl(),s=t?[{id:"all",text:typeof t!="boolean"&&t.text||i.formatMessage({id:"filters_all"})},...e]:e,[o,l]=C.useState(t?["all"]:[]),u=(c,h)=>{let p=[];o.includes(c)?p=o.filter(m=>m!==c):c==="all"?p=["all"]:n?p=[...o.filter(m=>m!=="all"),c]:p=[c],l(m=>(r&&typeof r=="function"&&r({current:p,previous:m}),p)),h&&typeof h=="function"&&h()};return d.jsx("ul",{className:Y("filters",a),children:s.map(({id:c,text:h,disabled:p=!1,callback:m=()=>{}})=>{let g={};return p&&(g={disabled:!0,"aria-label":i.formatMessage({id:"filters_disabled"},{name:h})}),d.jsx("li",{children:d.jsx("button",{className:Y(c,{selected:o.includes(c)}),onClick:f=>{f.preventDefault(),f.stopPropagation(),u(c,m)},...g,children:h})},c)})})},Cw=(e,t,n)=>{const r=String(e);if(!n||!n.length)return t?`/${r}/${t}`:`/${r}`;let a="",i=!1;return n.forEach(({url:s,position:o})=>{o==="before-lang"?(a+=`/${s}`,i=!0):(a.includes(`/${r}/`)||(a+=`/${r}`),a+=`/${s}`)}),a.includes(`/${r}/`)||(a+=`/${r}`),t&&(a+=`/${t}`),i?{url:a,urlForRouter:`/${a.split("/").slice(2).join("/")}`}:a};const na="languageSwitcher_",xw=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:a,urlParts:i,variant:s="default",label:o,className:l=""})=>{const u=ue.useIntl(),{updateLanguage:c=()=>{}}=C.useContext(yo),[h,p]=C.useState(e);if(C.useEffect(()=>{e!==h&&p(e)},[e]),!r||!Object.values(r).some(D=>D&&D.post_name))return null;const g=Object.keys(r),f=h!==e;return d.jsxs("div",{className:Y("language-switcher text-small",s,l),children:[d.jsxs("nav",{children:[s!=="short"&&d.jsx("p",{children:o||u.formatMessage({id:`${na}label`})}),d.jsx("ul",{children:g.map(D=>{var A;if(!ga[D])return null;const y=(A=r[D])==null?void 0:A.post_name;let x={className:D};if(h===D)x["aria-label"]=u.formatMessage({id:`${na}selected`},{language:ga[D]});else{const _=Cw(D,y,i);x={...x,href:typeof _=="string"?_:_.url,onClick:E=>{p(D),c(D),typeof a<"u"&&(E.preventDefault(),E.stopPropagation(),a(D,typeof _=="string"?_:_.urlForRouter))}}}return d.jsx("li",{children:d.jsx(_n,{...x,fallbackElement:"span",children:ga[D]})},D)})}),s!=="short"&&!f&&d.jsx("p",{children:u.formatMessage({id:`${na}translation_${t?"original":n?"human":"machine"}`})})]}),s!=="short"&&!f&&!t&&!n&&d.jsx("small",{children:u.formatMessage({id:`${na}disclaimer`},{email:Nn.support,link:D=>{const y=`mailto:${D}`;return d.jsx("a",{href:y,children:D})}})})]})};const qi=ue.createIntl({locale:"en",messages:Xn}),Rr=({hasNextPage:e=!0,loadNextPage:t=()=>{},isLoading:n=!1,variant:r="secondary",size:a="medium",styling:i={muted:!1,fullWidth:!1},icon:s=!1,messages:o={button:qi.formatMessage({id:"loadMore_button"}),endOfFeed:qi.formatMessage({id:"loadMore_endOfFeed"}),error:qi.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:u="LoadMore"})=>{const[c,h]=C.useState(""),p=async m=>{if(!n)try{await t(m)}catch(g){g instanceof Error?h(g.message):h("Unknown error")}};return!c&&!e&&!o.endOfFeed?null:d.jsx("footer",{className:Y("load-more",l),children:!c&&e?d.jsx(Be,{variant:r,size:a,styling:i,icon:s,onClick:p,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",disabled:n,className:"gtm-trackable","data-testid":"load-more-button",children:o.button}):o.endOfFeed&&(!c||c!=null&&c.includes("Cannot read items"))?d.jsx("p",{children:o.endOfFeed}):c&&d.jsx("p",{className:"error",children:o.error})})};const Eo=({variant:e="default",version:t="default",className:n="",...r})=>d.jsx("p",{className:"logo-wrapper",children:d.jsx("a",{href:"/home/",className:Y("logo",e,t,n),...r,children:d.jsx(Me,{children:d.jsx(ue.FormattedMessage,{id:"apolitical"})})})});let ra=!1;const Vf=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const a=ue.useIntl(),i=C.useRef(null),[s,o]=C.useState(!1),l=u=>{i.current&&u.target instanceof HTMLElement&&!i.current.contains(u.target)&&o(!1)};return C.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),C.createElement(e,{ref:i,className:Y("more-menu text-medium",r),children:d.jsxs(d.Fragment,{children:[d.jsx(Be,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>o(!s),"aria-haspopup":"true","aria-expanded":s,"aria-controls":t,screenreaderText:a.formatMessage({id:"moreMenu"}),className:"more-menu-button"}),d.jsx("ul",{id:t,hidden:!s,children:n.map(({href:u,onClick:c,text:h,icon:p,...m},g)=>{const f={...m,onClick:D=>{o(!1),typeof c=="function"&&c(D)},onFocus:()=>{ra&&(clearTimeout(ra),ra=!1)},onBlur:()=>{ra=setTimeout(()=>{o(!1)},100)}};return u&&(f.href=u),d.jsx("li",{className:"more-menu-list-item",children:d.jsx(Be,{variant:"tertiary",size:"medium",icon:p?{icon:p,position:"left"}:!1,...f,children:h})},`${window.btoa(h)}_${g}`)})})]})})},ww=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const Ew=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"},{key:"communities",href:"/communities/"}],Kf=({activeLink:e})=>{const t=ue.useIntl(),n=C.useContext(Mt),r=n&&typeof n.id=="string";return d.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[Ew.map(({key:a,href:i})=>{const s=ww(i,e),o={};return s&&(o["aria-current"]="page"),d.jsx("li",{className:Y(a,{active:s}),children:d.jsx("a",{href:i,"data-gtm-event-type":`${a}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",...o,children:t.formatMessage({id:`navigationMenu_links_${a}`})})},a)}),r&&d.jsx("li",{className:"profile","data-testid":"profile-link",children:d.jsxs("a",{href:"/profiles/me","data-gtm-event-type":"profile-click","data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:[d.jsx(sn,{name:(n==null?void 0:n.name)||"",src:n!=null&&n.image?n.image.thumbnail:""}),d.jsx("span",{children:t.formatMessage({id:"navigationMenu_profile"})})]})})]})},fr=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,kw=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${fr(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(`${fr(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(`${fr(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
|
|
158
158
|
|
|
159
159
|
${fr(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:fr(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,a)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(a))}];const _w="shareLinks_",Bw=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:a="large",variant:i="default",className:s=""})=>{const o=ue.useIntl(),l=kw({title:e,link:t,referrer:n});return d.jsxs("aside",{className:Y("share-links",a,i,s),children:[d.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),d.jsx("ul",{children:l.map(({key:u,icon:c,url:h,shouldRender:p=!0,onClick:m})=>{if(typeof p=="function"&&!p())return null;const g={};return m&&(g.onClick=f=>m(f,h)),d.jsx("li",{children:d.jsx(Be,{size:a,variant:"tertiary",icon:{icon:c||u},href:h,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${u}-click`,"data-testid":"link",screenreaderText:o.formatMessage({id:`${_w}link_${u}`}),...g})},u)})})]})};const Aw=({tabs:e,className:t="",preventLocationChange:n})=>{var p;const r=(m,g,f)=>(m||(m=`panel-${window.btoa(g)}-${f}`),m);let a=e.findIndex(m=>m.current===!0);if(a<0&&(a=0),window.location.hash){const m=window.location.hash.replace("#","");if(e.find(f=>f.id===m)){for(let f=0;f<e.length;f++)if(r(e[f].id,e[f].text,f)===m){a=f;break}}}const[i,s]=C.useState((p=e[a])!=null&&p.id?e[a].id:r(e[a].id,e[a].text,a)),[o,l]=C.useState(""),u=(m,g)=>{switch(m.key){case"ArrowLeft":case"ArrowRight":{m.preventDefault();let f=g;m.key==="ArrowLeft"?g>0?f=g-1:f=e.length-1:m.key==="ArrowRight"&&(g<e.length-1?f=g+1:f=0);const D=r(e[f].id,e[f].text,f),y=document.getElementById(`tab-${D}`);y==null||y.focus(),l(D);break}case"Enter":s(o),window.location.hash=`#${o}`;break}};C.useEffect(()=>{if(e[a].hasCarousel){const m=new CustomEvent("hiddenSectionVisible",{detail:{id:i}});window.dispatchEvent(m)}},[i]);const c=[],h=[];return e.forEach(({id:m,text:g,content:f,href:D,hasCarousel:y},x)=>{m=r(m,g,x);const A=i===m,_={};D||(_["aria-controls"]=m,_.onClick=E=>{E.preventDefault(),E.stopPropagation(),s(m),!n&&(window.location.hash=`#${m}`)},h.push(d.jsx("section",{id:m,hidden:!A,role:"tabpanel","aria-labelledby":`tab-${m}`,"aria-live":A?"assertive":"off",children:typeof f=="string"?d.jsx("p",{children:f}):f},`section-${m}`))),c.push(d.jsx("li",{"data-testid":"navigation-tab",children:d.jsx("a",{href:D||`#${m}`,id:`tab-${m}`,"aria-controls":m,className:Y({selected:A}),role:"tab",tabIndex:A?0:-1,"aria-selected":A,onKeyDown:E=>u(E,x),..._,children:g})},`tab-${m}`))}),d.jsxs("div",{className:Y("tabs-wrapper",t),children:[d.jsx("ul",{className:"tabs",role:"tablist",children:c}),d.jsx("div",{className:"tab-content",children:h})]})};const Fw={"2-1":901,"1-3":769,"1-1":769},Zf=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:a})=>{const i=Jn(!0);let s=a;return C.Children.count(a)===1&&(s=C.Children.toArray(a)[0],s.props&&(s=s.props.children)),d.jsx("section",{className:Y("columns",`layout-${e}`,r,{"has-containers":n}),children:C.Children.map(s,(o,l)=>t!==!1&&l===t&&i&&i<Fw[e]?null:o)})};let Wi;const Hi="contactFooter_",Tw=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=C.useRef(null),[r,a]=C.useState(0),[i,s]=C.useState(!1),o=()=>{n.current&&a(n.current.clientHeight)},l=()=>{i||(s(!0),clearTimeout(Wi),Wi=setTimeout(()=>{o(),s(!1)},500))};return C.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(Wi),window.removeEventListener("resize",l)}),[]),d.jsx(ln,{id:"contactForm",className:"contact-footer",children:d.jsxs("div",{className:"inner-wrapper",children:[d.jsx("h2",{children:d.jsx(ue.FormattedMessage,{id:`${Hi}title`})}),d.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:i?{}:{minHeight:r},children:[d.jsxs("aside",{children:[d.jsx("p",{children:d.jsx(ue.FormattedMessage,{id:`${Hi}text`})}),d.jsx(_n,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:d.jsx(ue.FormattedMessage,{id:`${Hi}email`})})]}),d.jsx(wf,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},Sw=({activeLink:e,...t})=>d.jsx(ln,{children:d.jsx(Zf,{layout:"1-3",children:d.jsxs(d.Fragment,{children:[d.jsx(Kf,{activeLink:e}),d.jsx(Wc,{...t})]})})});const Ui="cookieBanner_",Vi=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Ki=new Date(Date.now()+12*30*24*60*60*1e3),Yf=()=>{const e=ue.useIntl(),[t,n,r]=Ps.useCookies(Vi),[a,i]=C.useState(!t["apol-cookie-banner"]),s=()=>{Vi.forEach(c=>{n(c,!0,{path:"/",expires:Ki,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),i(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Ki}),Vi.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:Ki});return}r(c)}),i(!1)};if(!a)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,gtmType:"accepted-all"}],u=[];return l.forEach(c=>{u.push({variant:c.href?"tertiary":"primary",href:c.href,onClick:c.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${c.gtmType}-click`,children:e.formatMessage({id:`${Ui}buttons_${c.id}`})})}),d.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[d.jsx("h6",{children:e.formatMessage({id:`${Ui}title`})}),d.jsx("p",{children:e.formatMessage({id:`${Ui}text`})}),d.jsx(kn,{buttons:u})]})},qt={platform:{order:["events","courses","articles","communities"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"},communities:{href:"/communities/",gtmType:"communities-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["news","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-click"},story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility","ai"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},ai:{href:"/pages/ai-principles",gtmType:"ai-principles-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:Nn["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Nn["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:Nn.support,gtmType:"concierge-email-click"},business:{email:Nn.general,gtmType:"hello-email-click"}}},social:{order:["linkedin","twitter","facebook"],linkedin:{href:"https://www.linkedin.com/company/apolitical"},twitter:{href:"https://twitter.com/apoliticalco"},facebook:{href:"https://www.facebook.com/apoliticalco"}}};const zn="footer_",Oa="SiteFooter",oc=({group:e})=>{const t=qt[e].order||[];let n=!1;return"text"in qt[e]&&(n=qt[e].text),d.jsxs(C.Fragment,{children:[d.jsx("p",{className:"pre-title",children:d.jsx(ue.FormattedMessage,{id:`${zn}${e}`})}),Array.isArray(t)&&t.length>0&&d.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:a,gtmType:i}=qt[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),d.jsx("li",{children:d.jsx("a",{href:a,className:"gtm-trackable","data-gtm-event-context":Oa,"data-gtm-event-type":i,...s,children:d.jsx(ue.FormattedMessage,{id:`${zn}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&d.jsx("dl",{className:"text-medium",children:n.order.map(r=>d.jsxs(C.Fragment,{children:[d.jsx("dt",{children:d.jsx(ue.FormattedMessage,{id:`${zn}${e}_${r}`})}),d.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&d.jsx("address",{children:d.jsx(ue.FormattedMessage,{id:`${zn}${e}_${r}_address`,values:{br:d.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&d.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":Oa,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},ko=()=>d.jsx("div",{id:"footer",children:d.jsxs("div",{className:"wrapper",children:[d.jsx($a,{element:"hr"}),d.jsx(Eo,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Oa,"data-gtm-event-type":"logo-homepage-link"}),d.jsx("footer",{children:["platform","community","company","contact"].map(e=>d.jsxs("div",{className:"group",children:[d.jsx(oc,{group:e}),Object.keys(qt[e]).includes("child")&&d.jsx(oc,{group:qt[e].child})]},e))}),d.jsx("hr",{}),d.jsxs("div",{className:"sub-footer",children:[d.jsx("ul",{children:Array.isArray(qt.social.order)&&qt.social.order.map(e=>{const t=qt.social[e];return d.jsx("li",{className:e,children:d.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":Oa,"data-gtm-event-type":"social-click",children:d.jsx("span",{className:"hidden",children:d.jsx(ue.FormattedMessage,{id:`${zn}social_${e}`})})})},e)})}),d.jsx("small",{children:d.jsx(ue.FormattedMessage,{id:`${zn}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),Ne={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=i=>{const s=`logged${e?"In":"Out"}`;return t>=n[i][s]};let a={};return["navigation","search"].forEach(i=>{a[i]=r(i)}),a},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(a=>a===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:a=!1})=>{if(!a&&n[e]===t||!a&&e==="account"&&t===!1&&n.navigation===!0)return;const i=Date.now();if(!a&&!t&&Ne.handlerCalled[e]&&i-Ne.handlerCalled[e]<500)return;Ne.handlerCalled[e]=i;let s=[{type:`menus.${e}`,value:t}];if(t===!0)Object.keys(n).forEach(o=>{o===e||n[o]===!1||s.push({type:`menus.${o}`,value:!1})});else{let o=null;switch(e){case"navigation":o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation > li.parent"));break;case"search":o=document.querySelector("#header .toggle-search-button");break;case"account":o=document.querySelector("#header .account-button");break;default:return}o&&o.focus()}r(s)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const a=yc(e[r],t);if(!(typeof a>"u")&&(!n||a[t]&&a[t].includes(n)||a.value&&a.value.includes(n)||a.toString().includes(n)))return e[r]}return e[0].children?Ne.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:a})=>{var l;if(!t.current||!t.current.children)return;const i=n?"desktop":"default";if(r[e][i]){(l=document.querySelector(`#header ul a[href="${r[e][i]}"]:last-child`))==null||l.focus();return}let s,o;switch(e){case"navigation":if(n){const u=Ne.findFirstChild(t.current.children,"attributes.aria-controls","navigation");s=Ne.findFirstChild(u.children,"href")}else s=Ne.findFirstChild(t.current.children,"href");break;case"account":if(o=Ne.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=Ne.findFirstChild(o.children,"href");break;default:return}s&&(a([{type:`focusElements.${e}.${i}`,value:s.attributes.href.value}]),s.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(Ne.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(Ne.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Ne.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Ne.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},jr={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"navigation",explore:{order:["events","courses","articles","communities"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"},communities:{href:"/communities/",gtmType:"communities-click",className:"icon communities"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup/?ref=header-banner",props:{variant:"primary"}}}},Pa=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:a=()=>{},doTrack:i=null})=>{const s=ue.useIntl(),o=yc(jr,e);if(!o||o.onlyShow&&(o.onlyShow==="logged-in"&&!t||o.onlyShow==="logged-out"&&t))return null;const l="doTrack"in o,u=i===null?l?o.doTrack:!0:i,c=e.includes("buttons.");let h=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(h+=`_logged${t?"In":"Out"}`);let p=!1;if(o.href){let x=o.gtmType||`${e}-click`;if(x.includes(".")){const A=x.split("."),_=A[A.length-2];x=`${_==="topics"?`${_}-`:""}${A[A.length-1]}`}p={href:o.href},u&&(p={...p,className:"gtm-trackable","data-gtm-event-type":x,"data-gtm-event-context":"HeaderButtons"}),c&&(p={...p,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const m=o.order&&o.order[0]&&o[o.order[0]],g=m&&o[o.order[0]].order,f=p&&window.location.pathname===o.href;let D={},y={};if(f&&(D={...D,"aria-current":"page"}),m){const x=o.menuId||e,A={onClick:_=>Ne.events.onClick(_,{id:x,callback:a,isOpen:r[x]}),onFocus:()=>Ne.events.onFocus({id:x}),onBlur:()=>Ne.events.onBlur({id:x,callback:a}),onMouseLeave:()=>Ne.events.onBlur({id:x,callback:a}),onMouseEnter:()=>Ne.events.onMouseEnter({id:x,callback:a})};n&&(g&&(D={...A,onKeyPress:_=>{_.key==="Enter"&&Ne.events.onClick(_,{id:x,callback:a,isOpen:r[x]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":r[x],"aria-controls":x}),y={hidden:x in r?!r[x]:!0}),g||(y={...y,...A})}return d.jsxs("li",{className:Y({[o.className]:o.className,"has-submenu":m,parent:g,active:f}),...D,children:[p?C.createElement(c?Be:"a",p,s.formatMessage({id:h})):s.formatMessage({id:h}),o.order&&d.jsx("ul",{...y,children:o.order.map(x=>{if(!o[x])return null;const A={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:a,doTrack:l?u:null};return o[x].order?d.jsxs("li",{className:Y({[o[x].className]:o[x].className}),children:[s.formatMessage({id:`${h}_${x}`}),d.jsx("ul",{children:o[x].order.map(_=>d.jsx(Pa,{id:`${e}.${x}.${_}`,...A},_))})]},x):d.jsx(Pa,{id:`${e}.${x}`,...A},x)})})]},e)};const jw={height:67,height_desktop:83},_o=({showNavigation:e=!0})=>{const t=ue.useIntl(),n=C.useContext(Mt),r=Jn(!0,!0),a=n&&typeof n.id=="string",i=C.useMemo(()=>Ne.getIsDesktopVersion(a,r),[a,r]),[s,o]=C.useReducer(Or,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:l,menus:u,focusElements:c}=s,h=C.useRef(s);C.useEffect(()=>{h.current=s},[s]),kc({scrollPosition:jw[`height${i.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const f=h.current.menus;!i&&f.navigation||Ne.shouldChangeHeaderIsVisible(!0,f,o)},scrollDown:()=>{const f=h.current.menus;!i&&f.navigation||Ne.shouldChangeHeaderIsVisible(!1,f,o)}}});const p=(f,D,y=!1)=>{Ne.handleMenus({id:f,value:D,menus:h.current.menus,dispatch:o,forceHandle:y})},m=C.useRef(null),g=f=>{f.key==="Escape"&&["navigation","search","account"].forEach(D=>{h.current.menus[D]&&p(D,!1,!0)})};return C.useEffect(()=>{var f;return(f=document.getElementById("header"))==null||f.addEventListener("keydown",g),()=>{var D;(D=document.getElementById("header"))==null||D.removeEventListener("keydown",g)}},[]),Un(()=>{u.navigation&&Ne.autoFocus({menu:"navigation",navigationRef:m,isDesktopVersion:i.navigation,focusElements:c,dispatch:o})},[u.navigation]),Un(()=>{u.account&&Ne.autoFocus({menu:"account",navigationRef:m,isDesktopVersion:i.navigation,focusElements:c,dispatch:o})},[u.account]),n&&n.isLoading?null:d.jsxs(d.Fragment,{children:[d.jsxs("nav",{id:"header",className:Y({"logged-in":a,"logged-out":!a,visible:l}),children:[d.jsx(Me,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),d.jsx(Eo,{variant:"monochrome"}),e&&d.jsxs(d.Fragment,{children:[!i.navigation&&d.jsx("button",{className:"menu-button gtm-trackable",onClick:f=>{f.preventDefault(),f.stopPropagation(),p("navigation",!u.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":u.navigation,"aria-controls":"navigation",children:d.jsx(Me,{children:t.formatMessage({id:`header_menu_${u.navigation?"hide":"show"}`})})}),d.jsx("ul",{ref:m,id:"navigation",hidden:i.navigation||u.account?!1:!u.navigation,"data-showing":!i.navigation&&u.account?"account":"default",children:jr.order.map(f=>d.jsx(Pa,{id:f,isLoggedIn:a,isDesktopVersion:i.navigation,menus:{navigation:u.navigation,account:u.account},callback:p},f))}),!i.search&&d.jsx("button",{className:"search toggle-search-button",onClick:f=>{f.preventDefault(),f.stopPropagation(),p("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:d.jsx(Me,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),d.jsx(kf,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),a?d.jsxs("button",{className:"account-button",onClick:f=>Ne.events.onClick(f,{id:"account",callback:p,isOpen:u.account}),onMouseEnter:()=>Ne.events.onMouseEnter({id:"account",callback:p}),onMouseLeave:()=>Ne.events.onBlur({id:"account",callback:p}),"aria-haspopup":"true","aria-expanded":u.account,"aria-controls":"navigation",children:[d.jsx(Me,{children:t.formatMessage({id:`header_account_${u.account?"hide":"show"}`})}),d.jsx(sn,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):d.jsx("ul",{className:"sign-in-buttons",children:jr.buttons.order.map(f=>d.jsx(Pa,{id:`buttons.${f}`},f))})]})]}),d.jsx("hr",{id:"content-of-page"}),d.jsx("div",{className:Y("overlay",{open:u.navigation||u.account||!i.search&&u.search})})]})};const Ow=()=>{const e=ue.useIntl();return d.jsxs(d.Fragment,{children:[d.jsx(_o,{}),d.jsx("div",{id:"content",children:d.jsx(an,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),d.jsx(ko,{})]})},Gf=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:a={},styling:i={},className:s="",locale:o="en"})=>{const{navigation:l=!0,footer:u=!0}=a,{background:c="default",variant:h="default",circle:p="default",modal:m="default"}=i,g=xc(),[f,D]=C.useState(""),y=F=>{const{detail:{message:S}}=F;D(S)};C.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",y),()=>{document.removeEventListener("ariaLive",y)}),[g]);const x=oa(e,{locale:o}),A=oa(t,{locale:o}),_=oa(n,{locale:o}),E={};return c!=="default"&&(E[c]=!0),h!=="default"&&(E[h]=!0),p!=="default"&&(E[p]=!0),d.jsx(xh.ErrorBoundary,{onError:r,fallback:d.jsx(Ow,{}),children:d.jsxs(C.Suspense,{fallback:null,children:[d.jsxs("div",{id:"wrapper",className:Y(s,E,{"has-footer":u}),children:[d.jsx(_o,{showNavigation:l}),d.jsxs("main",{id:"content-wrapper",children:[A&&d.jsx("div",{className:Y("additional-content prepended",{"large-modal":m==="large"}),children:A}),C.createElement(c==="bold"?Co:"div",{id:"content",children:x,className:Y({"large-modal":m==="large"})})]}),_&&d.jsx("div",{className:"additional-content appended",children:_}),u&&d.jsx(ko,{}),d.jsx(Yf,{})]}),f&&d.jsx(Me,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:f})]})})},uc={default:"tags_",headerTopics:"header_topics_topics_"},Zi={topic:{Climate:"climate",CitiesAndLocalGovernment:"cities-and-local-government",DigitalAndData:"digital-and-data",Education:"education",EquityJusticeAndInclusion:"equity-justice-and-inclusion",HealthAndSocialCare:"health-and-social-care",Innovation:"innovation",LeadershipAndSkills:"leadership-and-skills",LifeInGovernment:"life-in-government",Policymaking:"policymaking",TransportAndInfrastructure:"transport-and-infrastructure",WorkAndTheEconomy:"work-and-the-economy"},"from the community":"community"},Pw={getTagDetails:e=>{if(e.includes("topic_")){if(e=Zi.topic[e.replace("topic_","")],e){const t=jr.topics.topics[e].href;return t?{id:e,href:t,text:`${uc.headerTopics}${e}`}:null}return null}return Zi[e]?(e=Zi[e],{id:e,text:`${uc.default}${e}`}):null}};const Nw=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:a="",gtmType:i="tag-click",gtmContext:s="tags"})=>{const o=ue.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const c=Pw.getTagDetails(u);c&&l.push(c)}),l.length<1?null:d.jsx("ul",{className:Y("tags text-small",t,a,{"one-line":n}),children:l.map(u=>{const c=o.formatMessage({id:u.text});return d.jsx("li",{children:u.href&&r?d.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":i,"data-gtm-event-context":s,children:c}):c},u.id)})})};const Rw=({members:{data:e=[],total:t=e.length},hasNextPage:n=!1,loadNextPage:r=()=>{},gtmContext:a="member",gtmType:i="member-click",className:s=""})=>{const o=ue.useIntl();return e.length===0?null:d.jsxs("div",{className:Y("members-list",s),children:[d.jsxs("h1",{children:[o.formatMessage({id:"membersList"}),d.jsx("span",{className:"count",children:t})]}),d.jsx("ul",{children:e.map((l,u)=>d.jsxs("li",{children:[d.jsx(tr,{member:l,gtmContext:a,gtmType:i}),l.isAdmin&&d.jsx(hn,{children:o.formatMessage({id:"membersList_admin"})})]},u))}),n&&d.jsx(Rr,{hasNextPage:n,loadNextPage:r,icon:{icon:"arrow-down",position:"right"},gtmContext:a})]})};const Mw=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:a=!0},graph:i,styling:s={},className:o=""})=>{const l=ue.useIntl();let u=a?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:c=!1}=s;return C.createElement(e,{className:Y("course-progression",o,{"highlight-percentage":c,"has-circle-graph":i==="circle"}),children:d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:h=>d.jsx("strong",{children:h}),number:u})}),u<100&&a&&d.jsx(Qa,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})}),d.jsx($s,{progress:u,styling:{layout:i||"bar",size:i&&i==="circle"?"small":"default"}})]})})};const Qf=({element:e="span",sectionId:t,subsectionId:n,title:r,className:a=""})=>C.createElement(e,{className:Y("lesson-name",a),"data-number":`${t}.${n}`,children:r});const Jf=({size:e="default",completionTime:t,icon:n,optional:r,type:a,children:i})=>{const s=ue.useIntl(),o=La(`lessonType_${a}`)?s.formatMessage({id:`lessonType_${a}`}):Tc(a||"");return d.jsxs("small",{className:Y("content-type",{[e]:e!=="default"}),children:[d.jsx("span",{className:Y("type",n),children:o})," ",t>0&&!r&&d.jsx(Qa,{time:t})," ",i?d.jsx("span",{className:"additional",children:i}):null]})};const Iw=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:a,sectionId:i,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:c})=>{const h=ue.useIntl(),p="courseStructure_",m=u.toLowerCase().includes("course conclusion");return d.jsxs(za,{className:"course-structure",label:d.jsxs(d.Fragment,{children:[d.jsxs("small",{children:[h.formatMessage({id:`${p}section${m?"_end":""}`},{number:i})," ",!r&&s>=0&&d.jsx("span",{className:"time",children:a&&l===0?h.formatMessage({id:`${p}time_completed`}):d.jsx(Qa,{time:s,appendedText:a?h.formatMessage({id:`${p}time_left`}):""})})]}),d.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[d.jsx("p",{children:n}),d.jsx("ol",{children:e&&e.length>0&&e.map(({completed:g,completionTime:f,contentType:D,icon:y,image:x,isIntroduction:A,optional:_,slug:E,subsectionId:F,title:S,type:$})=>{const R=a&&t||A,I={};return x&&(I.style={"--image":`url(${x})`}),d.jsx("li",{className:Y({article:D===hr.ARTICLE,discussion:D===hr.DISCUSSION,quiz:D===hr.QUIZ,completed:g&&D===hr.ARTICLE,locked:!R}),...I,children:d.jsx(_n,{href:R?`/microcourses/en/${o}/${E}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${Fc(S)}`,gtmType:"article-click",children:d.jsxs(d.Fragment,{children:[d.jsx(Qf,{sectionId:i,subsectionId:F,title:S,className:"course-title"})," ",d.jsx(Jf,{completionTime:f,icon:y,optional:_,type:$,children:c&&c[E]&&d.jsx("span",{className:"quiz-score",children:`${c[E]}%`})})]})})},E)})})]})};const $w=({isComplete:e=!1,onClick:t,...n})=>{const r=ue.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),d.jsx(Be,{...n,variant:"tertiary",icon:e?{icon:"check-inside-circle_no-overlap_inverted"}:{icon:"check-inside-circle_no-overlap",hover:"check-inside-circle_no-overlap_inverted"},onClick:t,className:Y("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})};let aa=null;const it="discussion_form_",Ja=({id:e,content:t={type:"response",slugs:{}},userHasPermissions:n=!0,meta:r={isLoading:!1,isInWrapper:!1,isEditing:!1,showTitle:!1,showSuccessMessage:!0},placeholder:a,maxLength:i=0,forceShow:s={cancel:!1,error:!1},functions:o={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},listMembers:()=>Promise.resolve([]),props:{create:{projectNames:["questions-answers"]}}},data:l={},gtmContext:u="DiscussionForm"})=>{var M,w,k;const c=ue.useIntl(),h=C.useContext(Mt),[p,m]=C.useState(""),[g,f]=C.useState(r.isEditing&&r.isEditing.text||""),[D,y]=C.useState(s.error||!1),[x,A]=C.useState(!1);if(r.isLoading)return d.jsx(wt,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const _=O=>{f(O);let j;!h||!h.id?j=kt(c.formatMessage,`${it}error_loggedOut`,t.type,"action"):n?i>0&&O.length>=i&&(j=`${it}error_tooLong`):j=kt(c.formatMessage,`${it}error_noPermission`,t.type,"action"),j?y(j):D&&y(!1)};let E=`${t.type}-form`;if(t.type==="response"||t.type==="reply"){const O=((M=t.slugs)==null?void 0:M.reply)||((w=t.slugs)==null?void 0:w.answer)||((k=t.slugs)==null?void 0:k.question)||"";O&&(E=`${E}-${O.slice(-15)}`)}e&&(E=`${e}-${E}`);const F=async O=>{var q;if(O.preventDefault(),O.stopPropagation(),!h||!h.id||!n||$)return;aa&&clearTimeout(aa),A("submitting");const j=window.location.pathname;try{let z;switch(t.type){case"post":z=await o.create({content:g});break;case"question":z=await o.create({title:g,authorId:h&&h.id,...(q=o.props)==null?void 0:q.create});break;case"response":z=await o.create({questionSlug:t.slugs.question},{body:g,authorId:h&&h.id,contentPath:j});break;case"reply":z=await o.create({questionSlug:t.slugs.question,answerSlug:t.slugs.answer},{body:g,authorId:h&&h.id,contentPath:j});break;default:break}await Oh(1e3),o.callback&&await o.callback(z),aa=setTimeout(()=>{f(""),A("submitted"),m(kt(c.formatMessage,`${it}success`,t.type,"action"));const re=new Event("discussionFormSubmitted");document.dispatchEvent(re),S()},500)}catch(z){const re=z;let X=`${it}error`;re!=null&&re.message.includes("entry already exists")&&(X=kt(c.formatMessage,`${it}error_alreadyExists`,t.type,"action")),re!=null&&re.message.includes("429")?X=kt(c.formatMessage,`${it}error_tooMany`,t.type,"action"):re!=null&&re.message.includes("400")&&(X=`${it}error`),y(X),S()}},S=()=>{aa=setTimeout(()=>{y(!1),A(!1),m("")},5e3)},$=!g||!zh(g),R=x==="submitting",I=[];return(r.isEditing&&!R||s.cancel)&&I.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:o.handleCancel,className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`cancel-${t.type}-click`,disabled:!s.cancel&&(!h||!h.id||!g),children:c.formatMessage({id:`${it}cancel`})}),I.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:O=>{if(r.isEditing){A("submitting"),o.handleSaveEdit&&o.handleSaveEdit(g);return}F(O)},className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`${r.isEditing?"save":"submit"}-${t.type}-click`,"data-testid":"save-button",disabled:!h||!h.id||!n||$||R||r.isEditing&&g===r.isEditing.text,children:c.formatMessage({id:`${it}${R?r.isEditing?"saving":"posting":r.isEditing?"save":"post"}`})}),d.jsxs(d.Fragment,{children:[d.jsxs("form",{id:E,className:Y("discussion-card discussion-form",{"no-styling":r.isInWrapper&&r.isEditing}),"data-testid":`discussion-${t.type}-form`,children:[(r==null?void 0:r.showTitle)&&!r.isEditing&&["question"].includes(t.type)&&d.jsx("h2",{children:kt(c.formatMessage,`${it}title`,t.type,"action")}),d.jsx(tr,{member:h||"community",gtmContext:u,gtmType:"profile-click"}),d.jsx(Me,{element:"label",showOnFocus:!1,htmlFor:`${E}-input`,children:kt(c.formatMessage,`${it}label`,t.type,"action")}),d.jsx(xf,{id:`${E}-input`,value:x==="submitting"&&!D?"":g,placeholder:a||kt(c.formatMessage,`${it}placeholder`,t.type,"action"),maxLength:i,functions:{onChange:_,listMembers:o.listMembers},data:l,autoFocus:!!r.isEditing,"aria-invalid":!!D,"aria-errormessage":"error-message"}),d.jsx("small",{children:kt(c.formatMessage,`${it}explainer`,t.type,"action",{a:O=>d.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:O})})}),d.jsx(kn,{buttons:I}),x==="submitted"&&r.showSuccessMessage&&d.jsx(Er,{className:"success","data-testid":"success",children:kt(c.formatMessage,`${it}success`,t.type,"action")}),D&&d.jsx(Er,{id:"error-message",className:"error","data-testid":"error",children:s.error?s.error:typeof D=="string"?D.includes(" ")?D:c.formatMessage({id:D},{action:c.formatMessage({id:`discussion_action_${t.type}`}),maxLength:i}):D})]}),p&&d.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:p})]})},Bo=({form:e,membershipRequiredToPost:{isMember:t,required:n,join:r,leave:a,notMemberStateText:i}})=>{if(n&&!t)return d.jsx(an,{text:i,button:{breakpoints:{mobile:!0,901:!1},component:d.jsx(wo,{isShort:!0,functions:{join:r,leave:a}})}});const{content:s,functions:o,meta:l,...u}=e;return d.jsx(Ja,{content:{type:(s==null?void 0:s.type)||"reply",slugs:(s==null?void 0:s.slugs)||{}},functions:{...o,create:(o==null?void 0:o.create)||(()=>{})},meta:{...l,isEditing:(l==null?void 0:l.isEditing)||!1,showSuccessMessage:!1},...u,id:`add-post-${u.id||""}`})},Lw={showForm:!1},Xa=C.createContext(Lw),Xf=({children:e})=>{const[t,n]=C.useState({showForm:!1});return d.jsx(Xa.Provider,{value:{...t,updateConversation:n},children:e})},zw=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),qw=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);const Na=({icon:e,...t})=>d.jsx(Be,{className:"discussion-button",variant:"tertiary",icon:e,...t});let wr=!1;const Yi=()=>{wr!==!1&&(clearTimeout(wr),wr=!1)},Gi=5;let Qi=null;const eh=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:a=!1,content:i={type:"reply",slugs:{}},canLike:s=!0,functions:{createLike:o=()=>{},deleteLike:l=()=>{}}={}})=>{const u=ue.useIntl(),c={numberOfLikes:t,userLikedContent:a,ignoreInteractions:!1,showLikers:!1,tabbableLink:0},[h,p]=C.useReducer(Or,c),{numberOfLikes:m,userLikedContent:g,ignoreInteractions:f,showLikers:D,tabbableLink:y}=h;C.useEffect(()=>{p([{type:"userLikedContent",value:a}])},[a]);const x=C.useMemo(()=>qw(n,Gi),[n]),A=S=>{if(S.preventDefault(),S.stopPropagation(),p([{type:"showLikers",value:!1}]),wr)return Yi(),!1;if(Yi(),f||!s)return!1;wr=setTimeout(_,350)},_=async()=>{if(Yi(),f||!s)return!1;let S=g?m-1:m+1;S<0&&(S=0),p([{type:"ignoreInteractions",value:!0},{type:"numberOfLikes",value:S},{type:"userLikedContent",value:!g}]);try{if(i&&i.slugs){const $=zw(i.slugs);g?await l($):await o({...$,payload:{contentPath:window.location.pathname}})}}catch{p([{type:"numberOfLikes",value:t},{type:"userLikedContent",value:a}])}finally{p([{type:"ignoreInteractions",value:!1}])}},E=()=>{Qi=setTimeout(()=>{p([{type:"showLikers",value:!1}])},500)},F=()=>{Qi&&clearTimeout(Qi)};return C.createElement(e,{className:"likes-wrapper",onKeyDown:S=>{S.key==="Escape"&&p([{type:"showLikers",value:!1}])},onMouseEnter:()=>{F(),p([{type:"showLikers",value:!0}])},onMouseLeave:()=>{E()}},d.jsxs(d.Fragment,{children:[d.jsx(Na,{className:Y("discussion-button text-medium action-button",{"show-spinner":f,"is-liked":g,disabled:!s}),icon:{icon:g?"heart":"heart_empty",animate:"bounce"},disabled:!s,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${i.type}-click`,onClick:A,screenreaderText:s?u.formatMessage({id:`discussion_likes_${g?"unlike":"like"}`},{action:u.formatMessage({id:`discussion_action_${i.type}`})}):!1,"aria-pressed":g,children:d.jsx("span",{"data-testid":"number-of-likes",className:"number-of-likes",children:u.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:m})})}),n&&d.jsxs(d.Fragment,{children:[d.jsx(Me,{"data-testid":"like-a11y-button",element:"button",className:"tertiary small icon navigation_arrow",onFocus:()=>{F()},onBlur:()=>E,onClick:S=>{var R;S.preventDefault(),S.stopPropagation(),F(),p([{type:"showLikers",value:!0}]);const $=(R=S.currentTarget.nextSibling)==null?void 0:R.childNodes[0];if($){const I=$.querySelector("li:first-child a");I&&(p([{type:"tabbableLink",value:0}]),setTimeout(()=>{I.focus()},100))}},onKeyDown:S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),E())},"aria-expanded":D,"aria-controls":`likes-tooltip-${i.slug}`,children:d.jsx(Me,{showOnFocus:!1,children:u.formatMessage({id:"discussion_likes_show"},{action:i.type})})}),d.jsx(En,{id:`likes-tooltip-${i.slug}`,isOpen:D,isLoading:n.length===0,children:n.length&&d.jsxs("ul",{children:[x.map((S,$)=>{if(typeof S=="string"||!S.name)return null;const R={};return y!==$&&(R.tabIndex=-1),d.jsx("li",{"data-index":$,children:d.jsx(_n,{href:S.id?`/profiles/${S.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onClick:I=>I==null?void 0:I.stopPropagation(),onFocus:()=>F(),onKeyDown:I=>{var j,q,z,re;if(!I||!["ArrowUp","ArrowDown"].includes(I.key||""))return;I.stopPropagation(),I.preventDefault();const M=I.key==="ArrowUp"?"up":"down",w=(j=I.currentTarget)==null?void 0:j.parentElement;let k=w==null?void 0:w.nextElementSibling;if(M==="up"){const X=w==null?void 0:w.previousElementSibling;X?k=X:(k=(q=w==null?void 0:w.parentElement)==null?void 0:q.lastElementChild,(k==null?void 0:k.getAttribute("data-index"))==="-1"&&(k=k==null?void 0:k.previousElementSibling))}else(!k||(k==null?void 0:k.getAttribute("data-index"))==="-1")&&(k=(z=w==null?void 0:w.parentElement)==null?void 0:z.firstElementChild);if(!k)return;const O=(k==null?void 0:k.getAttribute("data-index"))||"0";p([{type:"tabbableLink",value:O}]),(re=k==null?void 0:k.querySelector("a"))==null||re.focus()},...R,children:S.name})},S.id||window.btoa(S.name))}),t>Gi&&d.jsx("li",{"data-index":"-1",children:u.formatMessage({id:"discussion_likes_more"},{number:t-Gi})})]})})]})]}))},lc=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},ei=(e,t)=>e&&!t,Ji=({children:e,class:t,...n})=>{const r={...n,class:Y("subtle",t)};return d.jsx("blockquote",{...r,children:e})},Ww=280,Hw=async(e,t,n,r=()=>Promise.resolve([]))=>{let a=t?Hn(e,Ww):e;return a=a.trim(),n?await Rc({text:a,template:'<a href="/profiles/{{id}}" class="mentioned-user">@{{name}}</a>',mentions:n,listMembers:r}):a};const Uw=3e3,Vw=({url:e})=>{const t=ue.useIntl(),[n,r]=C.useState({isOpen:!1,isCopied:!1});return d.jsxs("li",{children:[d.jsx(En,{className:Y("tooltip-share-link",{"tooltip-share-link-copied":n.isCopied}),isOpen:n.isOpen,styling:{hasPointer:"bottom",extraPadding:!1},children:n.isCopied?t.formatMessage({id:"discussion_share_copy_link_success"}):t.formatMessage({id:"discussion_share_copy_link"})}),d.jsx(Na,{icon:{icon:"link_chain"},onMouseOver:()=>r({...n,isOpen:!0}),onFocus:()=>r({...n,isOpen:!0}),onMouseOut:()=>r({isOpen:!1,isCopied:!1}),onBlur:()=>r({isOpen:!1,isCopied:!1}),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{r({isOpen:!0,isCopied:!0}),setTimeout(()=>{r({isOpen:!1,isCopied:!1})},Uw)})}})]})},zt="discussion_",Kw=195,Mr=({element:e="div",content:t,userHasPermissions:n=!0,isLoading:r=!1,originalAuthorId:a,forceHide:i={actionBar:!1,comments:!1,likes:!1},functions:s,links:o={},className:l,gtmContext:u="DiscussionAnswer",children:c,isTruncated:h=!1,styling:{showShareLinkButton:p=!1}={},setFocus:m=!1})=>{var ge,ke,xe,_e,We,Le,Ue,Qe;const g=ue.useIntl(),f=C.useContext(Mt),D=C.useContext(Xa),{createContent:y=async()=>{},deleteContent:x=async()=>{},updateContent:A=async()=>{}}=s.content||{},{createLike:_=()=>{},deleteLike:E=()=>{}}=s.likes||{},{openComments:F=()=>{}}=s.comments||{},{listMembers:S=()=>Promise.resolve([])}=s.mentions||{},{author:$,canLike:R,createdAt:I,id:M,likes:w=0,userLiked:k,comments:O=0,mentions:j}=t,q=f&&f.id&&typeof $!="string"&&$.id&&$.id===f.id||!1,z=typeof R=="boolean"?R:n?!q:!1,re=q&&(!t.createdAt||Sh(t.createdAt,10,"seconds")),X=C.useRef(null),[v,H]=C.useState({body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:""}),[ee,B]=C.useState(!1),[T,W]=C.useState(re?"highlighted":"default"),[L,U]=C.useState("");C.useEffect(()=>{const he=X.current;if(!(!he||T==="default"))return document.addEventListener("discussionFormSubmitted",te),he.addEventListener("transitionend",ne),()=>{document.removeEventListener("discussionFormSubmitted",te),he.removeEventListener("transitionend",ne)}},[]),C.useEffect(()=>{H({...v,body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),C.useEffect(()=>{(async()=>{const Te=await Hw(v.body,h,j,S);H({...v,postBody:Te})})()},[v.body,j]);const te=()=>{setTimeout(()=>{W("fading")},1e3)},ne=({propertyName:he})=>{he==="background-color"&&W(Te=>(Te==="default"&&(document.removeEventListener("discussionFormSubmitted",te),X.current&&X.current.removeEventListener("transitionend",ne)),Te==="fading"?"default":Te))};if(r||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question)||v.postBody==="")return d.jsx(wt,{className:"discussion-card discussion-post"});const ie=async he=>{he||(he=""),U("");try{if(!bc(he,v.body)){const Te=t.type==="question"?{title:he}:{body:he};await A(lc(t.slugs),Te)}H({...v,body:he,isEditing:!1,didEdit:!0})}catch{U(`${zt}form_error`)}},fe=()=>{D&&D.updateConversation&&D.updateConversation({showForm:!0}),setTimeout(()=>{var se,me,ve;const Te=`reply-form-${(t.type==="answer"?t.slug:((se=t.slugs)==null?void 0:se.reply)||((me=t.slugs)==null?void 0:me.answer)||((ve=t.slugs)==null?void 0:ve.question)||"").toLowerCase().slice(-15)}`,$e=document.getElementById(Te),K=document.getElementById(`${Te}-input`);K&&K.focus(),$e&&$e.scrollIntoView({behavior:"smooth"})},0)},Q=async()=>{B(!1);try{await x(lc(t.slugs))}catch{U("delete-error")}},pe=[{text:g.formatMessage({id:`${zt}moreMenu_report`}),onClick:he=>{he.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(g.formatMessage({id:`${zt}report_subject`}))}&body=${encodeURI(g.formatMessage({id:`${zt}report_body`},{contentType:t.type||"",contentSlug:t.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}))}`,icon:"flag"}];return n&&q&&pe.push({text:g.formatMessage({id:`${zt}moreMenu_edit`}),onClick:()=>H({...v,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`edit-${t.type}-click`},{text:g.formatMessage({id:`${zt}moreMenu_delete`}),onClick:he=>{he.preventDefault(),he.stopPropagation(),B(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`delete-${t.type}-click`,...Wf(`delete-${t.slug}-modal`,ee)}),m&&((ge=X==null?void 0:X.current)==null||ge.focus(),(ke=X==null?void 0:X.current)==null||ke.scrollIntoView({behavior:"smooth"})),C.createElement(e,{className:Y("discussion-post",l,{[T]:!l||!l.includes("highlighted-text-box"),"has-link":o.post&&!v.isEditing}),ref:X,tabIndex:m?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${u}-post-click`,onClick:he=>{!o.post||v.isEditing||(he.preventDefault(),he.stopPropagation(),window.location.href=o.post)},children:d.jsxs(d.Fragment,{children:[d.jsxs("div",{id:M||t.slug,className:Y("discussion-card",t.type,{editing:v.isEditing,"has-link":o.post&&!v.isEditing}),children:[!v.isEditing&&d.jsx(tr,{member:$,additionalContent:{createdAt:I,didEdit:v.didEdit},className:typeof $!="string"&&$.id===a?"highlighted":"",gtmContext:u,gtmType:"profile-click"}),v.isEditing?d.jsx(Ja,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:r,isInWrapper:!0,isEditing:{text:v.body}},maxLength:t.type==="question"?250:5e4,forceShow:{error:L!==""&&L!=="delete-error"?g.formatMessage({id:L},{action:g.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:y,handleSaveEdit:ie,handleCancel:()=>{U(""),H({...v,isEditing:!1})},listMembers:S},gtmContext:`${u}Form`,data:{mentions:t.mentions}}):o.post?d.jsxs("a",{href:o.post,children:[(t==null?void 0:t.title)&&d.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),v.postBody.length>Kw?d.jsx(qc,{text:v.postBody,markdownOptions:{overrides:{a:os,blockquote:{component:Ji}}}}):d.jsx(Vn,{options:{overrides:{a:os,blockquote:{component:Ji}}},children:v.postBody})]}):d.jsx(Vn,{options:{wrapper:t.type==="question"?"h1":C.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question",overrides:{blockquote:{component:Ji}}},children:v.postBody}),!v.isEditing&&!(i!=null&&i.actionBar)&&d.jsxs("ul",{className:Y("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[!i.likes&&d.jsx(eh,{element:"li",likes:w,isShort:!1,userLiked:k,content:{type:t.type,slugs:t.slugs,slug:t.slug},canLike:z,peopleWhoLiked:t.peopleWhoLiked,functions:{createLike:_,deleteLike:E}}),!i.comments&&(["question","post"].includes(t.type)||o.comments||typeof F=="function")&&d.jsx("li",{children:d.jsx(Na,{onClick:he=>{he.preventDefault(),he.stopPropagation(),o.comments&&(window.location.href=o.comments),typeof F=="function"&&F()},icon:{icon:"speech-bubble_square"},"data-gtm-event-context":u,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:g.formatMessage({id:`${zt}comments_screenReader`},{count:O}),children:g.formatMessage({id:`${zt}comments`},{count:O})})}),(t.type==="answer"||t.type==="reply")&&d.jsx("li",{children:d.jsx(Na,{styling:{muted:!0},onClick:fe,icon:{icon:"speech-bubble_square"},children:g.formatMessage({id:`${zt}reply`})})}),p&&d.jsx(Vw,{url:(xe=t.slugs)!=null&&xe.reply?`${window.location.origin}${(_e=t.slugs)==null?void 0:_e.question}/${(We=t.slugs)==null?void 0:We.answer}#${(Le=t.slugs)==null?void 0:Le.reply}`:`${window.location.origin}${(Ue=t.slugs)==null?void 0:Ue.question}/${(Qe=t.slugs)==null?void 0:Qe.answer}`}),d.jsx(Vf,{element:"li",id:`more-${t.slug}`,options:pe})]})]}),c,d.jsx(Nr,{id:`delete-${t.slug}-modal`,isOpen:ee,functions:{onOpen:()=>{},onClose:()=>B(!1)},forceShow:{error:L==="delete-error"?g.formatMessage({id:"discussion_delete_error"},{action:g.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:g.formatMessage({id:"discussion_delete_title"},{action:g.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>B(!1),children:g.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:Q,children:g.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:d.jsx(ue.FormattedMessage,{id:"discussion_delete_text",values:{p:he=>d.jsx("p",{children:he}),action:g.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const Xi="discussion_responses_",th=({type:e="answer",responses:t=0})=>{const n=ue.useIntl();return t=parseInt(t),d.jsxs("div",{className:"responses-heading",children:[d.jsx("h4",{children:n.formatMessage({id:`${Xi}title`},{action:n.formatMessage({id:`${Xi}${e}`}),count:t})}),t===0&&d.jsx("p",{children:kt(n.formatMessage,`${Xi}empty`,e,e)})]})};const nh=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:a})=>{const i=ue.useIntl(),s=C.useContext(Xa),o=oa(a,{element:"li"});return d.jsxs("div",{className:Y("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&d.jsx("ul",{className:"thread",children:o}),!e&&d.jsx(Rr,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:i.formatMessage({id:"discussion_thread_loadMore"}),error:i.formatMessage({id:"loadMore_error"})}}),r&&s.showForm&&d.jsx(Ja,{...r})]})},Zw="post",Yw="reply",rh="00000000-0000-0000-0000-000000000000";function Ao({queryClient:e,queryKey:t}){function n(r,a,i){e.setQueryData(t,i)}return n}function Fo({queryClient:e,queryKey:t}){async function n(r){await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);return e.setQueryData(t,r),a}return n}function Gw(){return{latest_reactions:{like:[],reply:[]},reaction_counts:{like:0,reply:0},own_reactions:{like:[],reply:[]}}}function Qw(){return{latest_children:{like:[],reply:[]},children_counts:{like:0,reply:0},own_children:{like:[],reply:[]}}}function ah(e){const{id:t="",name:n="",organization:r="",jobTitle:a="",image:i={}}=e,{thumbnail:s=""}=i;return{id:t,data:{name:n,organization:r,jobTitle:a,thumbnail:s}}}function Jw({content:e}){return{content:e,id:rh,time:new Date().toISOString(),verb:Zw}}function cc({activity:e,user:t}){return{...e,actor:ah(t),...Gw()}}function Ra({activity:e,reaction:t}){var n,r,a;t?(e.latest_reactions={...e.latest_reactions||{},like:[...((r=e.latest_reactions)==null?void 0:r.like)||[],t]},e.own_reactions={...e.own_reactions||{},like:[...((a=e.own_reactions)==null?void 0:a.like)||[],t]}):e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like+1:1}}function ih({activity:e,user:t}){var n,r,a;e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like-1:0},t!=null&&t.id&&(e.latest_reactions={...e.latest_reactions||{},like:(((r=e.latest_reactions)==null?void 0:r.like)||[]).filter(({user_id:i})=>i!==t.id)},e.own_reactions={...e.own_reactions||{},like:(((a=e.own_reactions)==null?void 0:a.like)||[]).filter(({user_id:i})=>i!==t.id)})}function Xw({activityId:e,replyId:t,content:n}){return{activity_id:e,data:{content:n},id:rh,kind:Yw,parent:t||""}}function dc({reply:e,user:t}){const n=ah(t);return{...e,user_id:n.id,user:n,...Qw()}}function fc({reply:e,reaction:t}){var n,r,a;t?(e.latest_children={...e.latest_children||{},like:[...((r=e.latest_children)==null?void 0:r.like)||[],t]},e.own_children={...e.own_children||{},like:[...((a=e.own_children)==null?void 0:a.like)||[],t]}):e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like+1:1}}function eE({reply:e,user:t}){var n,r,a;e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like-1:0},t!=null&&t.id&&(e.latest_children={...e.latest_children||{},like:(((r=e.latest_children)==null?void 0:r.like)||[]).filter(({user_id:i})=>i!==t.id)},e.own_children={...e.own_children||{},like:(((a=e.own_children)==null?void 0:a.like)||[]).filter(({user_id:i})=>i!==t.id)})}const sh=e=>{const t=new CustomEvent("discussionPostAdded",{detail:e});document.dispatchEvent(t)};let hc,es=0;const oh=()=>{C.useEffect(()=>(document.addEventListener("discussionPostAdded",e),()=>{document.removeEventListener("discussionPostAdded",e)}),[]);const e=t=>{const n=t.detail;if(!n)return;clearTimeout(hc);const r=document.getElementById(n);if(r){r.scrollIntoView({behavior:"smooth",block:"start"}),es=0;return}es++,!(es>10)&&(hc=setTimeout(()=>{e(t)},50))}},Qn=Object.freeze({id:"some-user-id-1",name:"some user name 1",organization:"some user organization 1",jobTitle:"some user job title 1",image:{thumbnail:"https://some-user-thumbnail.com/avatar1.png"},isLoading:!1}),rn=Object.freeze({id:"some-user-id-2",name:"some user name 2",organization:"some user organization 2",jobTitle:"some user job title 2",image:{thumbnail:"https://some-user-thumbnail.com/avatar2.png"},isLoading:!1}),uh=Object.freeze({actor:`SU:${Qn.id}`,content:"some content 1",duration:"5.53ms",feed_id:"some-feed-id-1",foreign_id:"post:some-foriegn-id-1",id:"some-activity-id-1",object:"comment",time:"2023-11-24T17:52:36.162000",verb:"post"}),tE=Object.freeze({actor:`SU:${rn.id}`,content:"some content 2",duration:"5.53ms",feed_id:"some-feed-id-2",foreign_id:"post:some-foriegn-id-2",id:"some-activity-id-2",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"}),nE=Object.freeze({actor:`SU:${Qn.id}`,content:"some content 3",duration:"5.53ms",feed_id:"some-feed-id-3",foreign_id:"post:some-foriegn-id-3",id:"some-activity-id-3",object:"comment",time:"2023-11-24T17:56:36.162000",verb:"post"}),rE=Object.freeze({actor:`SU:${rn.id}`,content:"some content 4",duration:"5.53ms",feed_id:"some-feed-id-4",foreign_id:"post:some-foriegn-id-4",id:"some-activity-id-4",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"});Object.freeze({id:"some-reaction-id-1",activity_id:uh.id,kind:"like",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:rn.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:rn.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-1",user_id:rn.id,user:{id:rn.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:uh.id,data:{content:"Some content 1..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-2",user_id:Qn.id,user:{id:Qn.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:tE.id,data:{content:"Some content 2..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:rn.id,user:{id:rn.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:nE.id,data:{content:"Some content 3..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:Qn.id,user:{id:Qn.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:rE.id,data:{content:"Some content 4..."},parent:"",latest_children:{},children_counts:{}});function aE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=Ke.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=cc({activity:Jw(o),user:i});return mc(u,l)}),onError:n,onSuccess:(o,l,u)=>{const c=cc({activity:o,user:i});r.setQueryData(a,mc(c,u,!0)),setTimeout(()=>{sh(c.id)},0)}});return s}function iE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ke.useMutation({mutationFn:e,onMutate:({activityId:a,content:i})=>t(s=>{const o=Ma(a,s);return o&&(o.content=i),s}),onError:n});return r}function sE({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s}){const o=Ke.useQueryClient(),l=Ga(),u={queryClient:o,queryKey:s},c={mutationHandlers:{error:Ao(u),mutate:Fo(u)},user:l,...u},h=aE({...c,mutationFn:e}),p=iE({...c,mutationFn:t}),m=oE({...c,mutationFn:n}),g=lE({...c,mutationFn:a}),f=cE({...c,mutationFn:i}),{activities:D,...y}=uE({queryKey:s,queryFn:r});return{activities:D,mutations:{create:h,edit:p,remove:g,like:m,unlike:f},user:l,...y}}function oE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ke.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=Ma(s,o);return l&&Ra({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=Ma(o,l);u&&Ra({activity:u,reaction:s}),r.setQueryData(a,l)}});return i}function uE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}=Ke.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:null},getNextPageParam:o=>(o==null?void 0:o.next)||null});return{activities:fE(n),error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}}function lE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ke.useMutation({mutationFn:e,onMutate:({activityId:a})=>t(i=>dE(a,i)),onError:n});return r}function cE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ke.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(s=>{const o=Ma(i,s);return o&&ih({activity:o,user:r}),s}),onError:n});return a}function mc(e,t,n=!1){return t?(n?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t):{pages:[{next:"",results:[e]}],pageParams:[""]}}function Ma(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function dE(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:a})=>a===e);if(r!==-1){n.splice(r,1);break}}return t}function fE(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,{results:r})=>[...n,...r],[]))||[]}const hE=({basePath:e,parentId:t,isMember:n,functions:{activities:r,mentions:a,join:i,leave:s}})=>{const o=ue.useIntl(),{activities:l,error:u,fetchNextPage:c,hasNextPage:h,isLoading:p,mutations:{create:m,edit:g,remove:f,like:D,unlike:y},user:x}=sE({queryKey:[e,t,"activities"],queryFns:r}),[A,_]=C.useState(null),E=()=>{_(l.length),c()};return oh(),u?d.jsx(an,{variant:"error",text:u.message}):d.jsxs("section",{children:[d.jsx(Bo,{form:{content:{type:"post",slugs:{}},functions:{create:m,listMembers:a.listMembers},meta:{isEditing:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:i,leave:s,notMemberStateText:o.formatMessage({id:"community_joinToPost"})}}),l==null?void 0:l.map((F,S)=>{var X,v,H,ee,B,T,W,L;const{id:$,own_reactions:R,latest_reactions:I,reaction_counts:M,mentioned_users:w}=F,k=(((X=I==null?void 0:I.like)==null?void 0:X.length)||0)>0,O=(((v=R==null?void 0:R.like)==null?void 0:v.length)||0)>0,j=O?R==null?void 0:R.like[0].id:"",q=k?(H=I==null?void 0:I.like)==null?void 0:H.map(U=>{var te,ne,ie;return{id:(te=U==null?void 0:U.user)==null?void 0:te.id,name:(ie=(ne=U==null?void 0:U.user)==null?void 0:ne.data)==null?void 0:ie.name}}):!1,z=F==null?void 0:F.actor,re=(z==null?void 0:z.id)===(x==null?void 0:x.id);return d.jsx(C.Fragment,{children:d.jsx(Mr,{content:{type:"post",title:F==null?void 0:F.title,body:F==null?void 0:F.content,canLike:ei(n,re),createdAt:(F==null?void 0:F.time)||"",slugs:{question:`${e}/${t}`,answer:$},slug:$,author:{id:z==null?void 0:z.id,name:(ee=z==null?void 0:z.data)==null?void 0:ee.name,organization:(B=z==null?void 0:z.data)==null?void 0:B.organization,jobTitle:(T=z==null?void 0:z.data)==null?void 0:T.jobTitle,location:(W=z==null?void 0:z.data)==null?void 0:W.location,image:{thumbnail:((L=z==null?void 0:z.data)==null?void 0:L.thumbnail)||void 0}},userLiked:O,likes:(M==null?void 0:M.like)||0,comments:(M==null?void 0:M.reply)||0,peopleWhoLiked:q,mentions:w},links:{post:`${e}/${t}/${$}`,comments:`${e}/${t}/${$}`},gtmContext:"community",functions:{content:{createContent:()=>null,deleteContent:()=>f({activityId:$}),updateContent:(U,{body:te})=>g({activityId:$,content:te})},likes:{createLike:()=>D({activityId:$}),deleteLike:()=>y({activityId:$,reactionId:j})},comments:{openComments:()=>null},mentions:a},isTruncated:!0,styling:{showShareLinkButton:!0},setFocus:S===A})},$)}),!p&&d.jsx(Rr,{hasNextPage:h,loadNextPage:E,icon:{icon:"arrow-down",position:"right"},messages:{button:o.formatMessage({id:"loadMore_button"}),error:o.formatMessage({id:"loadMore_error"})}})]})},mE={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 16 (edited)..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 14..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 3..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 2..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 1..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 13..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 12..."},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"};function pE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=Ke.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=dc({reply:Xw(o),user:i});return pc(u,l,{replace:!1,append:(o==null?void 0:o.replyId)!==void 0})}),onError:n,onSuccess:(o,l,u)=>{const c=dc({reply:o,user:i});r.setQueryData(a,pc(c,u,{replace:!0,append:(l==null?void 0:l.replyId)!==void 0})),setTimeout(()=>{sh(c.id)},0)}});return s}function gE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ke.useMutation({mutationFn:e,onMutate:({replyId:a,content:i})=>t(s=>{const o=Ia(a,s);return o&&(o.data.content=i),s}),onError:n});return r}function lh({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s}){const o=Ke.useQueryClient(),l=Ga(),u={queryClient:o,queryKey:s},c={mutationHandlers:{error:Ao(u),mutate:Fo(u)},user:l,...u},h=pE({...c,mutationFn:e}),p=gE({...c,mutationFn:t}),m=vE({...c,mutationFn:n}),g=yE({...c,mutationFn:a}),f=DE({...c,mutationFn:i}),{replies:D,...y}=bE({queryKey:s,queryFn:r});return{replies:D,mutations:{create:h,edit:p,remove:g,like:m,unlike:f},user:l,...y}}function vE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ke.useMutation({mutationFn:e,onMutate:({replyId:s})=>t(o=>{const l=Ia(s,o);return l&&fc({reply:l}),o}),onError:n,onSuccess:(s,{replyId:o},l)=>{const u=Ia(o,l);u&&fc({reply:u,reaction:s}),r.setQueryData(a,l)}});return i}function bE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}=Ke.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:u=>(u==null?void 0:u.next)||null}),o=kE(n),l=`${o.length||0}${i?"+":""}`;return{replies:o,repliesCount:l,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}}function yE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ke.useMutation({mutationFn:e,onMutate:({replyId:a})=>t(i=>EE(a,i)),onError:n});return r}function DE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ke.useMutation({mutationFn:e,onMutate:({replyId:i})=>t(s=>{const o=Ia(i,s);return o&&eE({reply:o,user:r}),s}),onError:n});return a}function CE(e){return{pages:[{next:"",results:[e]}],pageParams:[""]}}function xE(e,t,n){const r=t.pages.length-1,a=t.pages[r].results.length-1;return n!=null&&n.replace?t.pages[r].results[a]=e:t.pages[r].results.push(e),t}function wE(e,t,n){return n!=null&&n.replace?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t}function pc(e,t,n){return t?n!=null&&n.append?xE(e,t,n):wE(e,t,n):CE(e)}function Ia(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function EE(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:a})=>a===e);if(r!==-1){n.splice(r,1);break}}return t}function kE(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,r)=>[...n,...r==null?void 0:r.results],[]))||[]}const _E=({basePath:e,parentId:t,activityId:n,replyId:r,isMember:a,functions:i})=>{const s=ue.useIntl(),o=3,{replies:l,fetchNextPage:u,hasNextPage:c,isLoading:h,mutations:{create:p,edit:m,like:g,remove:f,unlike:D},user:y}=lh({queryKey:[e,t,n,r,"replies"],queryFns:{...i,list:_=>i.list({..._,reactionId:r})}});Ns([h]);const[x,A]=C.useState(!0);return d.jsxs(d.Fragment,{children:[(l==null?void 0:l.length)>=o&&d.jsx(Be,{className:"nested-replies-show-toggle",variant:"secondary",size:"small",icon:{icon:`arrow_corner-${x?"up_left":"down_right"}`,position:"left"},onClick:()=>A(!x),children:s.formatMessage({id:`discussion_thread_${x?"hide":"show"}`},{count:l==null?void 0:l.length})}),x&&d.jsx(nh,{loadMore:{isLoading:h,hasNextPage:c,loadNextPage:()=>u()},form:{content:{type:"reply",slugs:{question:`${e}/${t}`,answer:n,reply:r}},functions:{create:(_,{body:E})=>p({activityId:n,replyId:r,content:E}),listMembers:i.listMembers},meta:{isEditing:!1,showSuccessMessage:!1}},children:l&&l.length>0?l==null?void 0:l.map(_=>{var v,H,ee,B,T,W,L,U,te,ne,ie,fe;const{id:E,own_children:F,latest_children:S,children_counts:$,data:{mentioned_users:R}}=_,M=(((v=F==null?void 0:F.like)==null?void 0:v.length)||0)>0?(H=F==null?void 0:F.like)==null?void 0:H.find(Q=>{var pe;return((pe=Q==null?void 0:Q.user)==null?void 0:pe.id)===(y==null?void 0:y.id)}):!1,w=M?M==null?void 0:M.id:"",k=!!M,j=(((ee=S==null?void 0:S.like)==null?void 0:ee.length)||0)>0?(B=S==null?void 0:S.like)==null?void 0:B.map(Q=>{var pe,ge,ke;return{id:(pe=Q==null?void 0:Q.user)==null?void 0:pe.id,name:(ke=(ge=Q==null?void 0:Q.user)==null?void 0:ge.data)==null?void 0:ke.name}}):!1,q=_==null?void 0:_.user,z=(q==null?void 0:q.id)===(y==null?void 0:y.id),re=ei(a,z),X=typeof _.data.content=="string"?(T=_==null?void 0:_.data)==null?void 0:T.content:((L=(W=_==null?void 0:_.data)==null?void 0:W.content)==null?void 0:L.text)||"";return d.jsx(Mr,{content:{id:E,type:"reply",body:X,canLike:re,createdAt:_==null?void 0:_.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:_==null?void 0:_.parent},slug:"",author:{id:q==null?void 0:q.id,name:(U=q.data)==null?void 0:U.name,organization:(te=q.data)==null?void 0:te.organization,jobTitle:(ne=q.data)==null?void 0:ne.jobTitle,location:(ie=q.data)==null?void 0:ie.location,image:{thumbnail:((fe=q.data)==null?void 0:fe.thumbnail)||void 0}},userLiked:k,likes:($==null?void 0:$.like)||0,peopleWhoLiked:j,mentions:R},functions:{content:{createContent:()=>null,deleteContent:()=>f({replyId:E}),updateContent:(Q,{body:pe})=>m({replyId:E,content:pe})},likes:{createLike:()=>g({replyId:E}),deleteLike:()=>D({replyId:E,reactionId:w})},comments:{},mentions:{listMembers:i.listMembers}},styling:{showShareLinkButton:!0}},E)}):null})]})};const ch=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{reactions:a,mentions:i,join:s,leave:o}})=>{const l=ue.useIntl(),{replies:u,repliesCount:c,fetchNextPage:h,hasNextPage:p,isLoading:m,mutations:{create:g,edit:f,like:D,remove:y,unlike:x},user:A}=lh({queryKey:[e,t,n,"replies"],queryFns:a}),_=()=>{F(u.length),h()},[E,F]=C.useState(null);return Ns([m]),oh(),d.jsxs("section",{className:"replies-feed",children:[d.jsx(th,{type:"comment",responses:c}),d.jsx(Bo,{form:{content:{type:"reply",slugs:{}},functions:{create:(S,{body:$})=>g({activityId:n,content:$}),...i},meta:{isEditing:!1,showSuccessMessage:!1},placeholder:l.formatMessage({id:"discussion_responses_placeholder"})},membershipRequiredToPost:{isMember:r,required:!0,join:s,leave:o,notMemberStateText:l.formatMessage({id:"community_joinToPost"})}}),u==null?void 0:u.map((S,$)=>{var T,W,L,U,te,ne,ie,fe,Q,pe,ge,ke;const{id:R,own_children:I,latest_children:M,children_counts:w,data:{mentioned_users:k}}=S,j=(((T=I==null?void 0:I.like)==null?void 0:T.length)||0)>0?(W=I==null?void 0:I.like)==null?void 0:W.find(xe=>{var _e;return((_e=xe==null?void 0:xe.user)==null?void 0:_e.id)===(A==null?void 0:A.id)}):!1,q=j?j==null?void 0:j.id:"",z=!!j,X=(((L=M==null?void 0:M.like)==null?void 0:L.length)||0)>0?(U=M==null?void 0:M.like)==null?void 0:U.map(xe=>{var _e,We,Le;return{id:(_e=xe==null?void 0:xe.user)==null?void 0:_e.id,name:(Le=(We=xe==null?void 0:xe.user)==null?void 0:We.data)==null?void 0:Le.name}}):!1,v=S==null?void 0:S.user,H=(v==null?void 0:v.id)===(A==null?void 0:A.id),ee=ei(r,H),B=typeof S.data.content=="string"?(te=S==null?void 0:S.data)==null?void 0:te.content:((ie=(ne=S==null?void 0:S.data)==null?void 0:ne.content)==null?void 0:ie.text)||"";return d.jsx(Xf,{children:d.jsx(Mr,{content:{id:R,type:"reply",body:B,canLike:ee,createdAt:S==null?void 0:S.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:R},slug:R,author:{id:v==null?void 0:v.id,name:(fe=v.data)==null?void 0:fe.name,organization:(Q=v.data)==null?void 0:Q.organization,jobTitle:(pe=v.data)==null?void 0:pe.jobTitle,location:(ge=v.data)==null?void 0:ge.location,image:{thumbnail:((ke=v.data)==null?void 0:ke.thumbnail)||void 0}},userLiked:z,likes:(w==null?void 0:w.like)||0,peopleWhoLiked:X,mentions:k},functions:{content:{createContent:()=>null,deleteContent:()=>y({replyId:R}),updateContent:(xe,{body:_e})=>f({replyId:R,content:_e})},likes:{createLike:()=>D({replyId:R}),deleteLike:()=>x({replyId:R,reactionId:q})},comments:{},mentions:i},children:d.jsx(_E,{basePath:e,parentId:t,activityId:n,replyId:R,isMember:r,functions:{...a,...i}}),styling:{showShareLinkButton:!0},setFocus:$===E},R)},R)}),!m&&d.jsx(Rr,{hasNextPage:p,loadNextPage:_,icon:{icon:"arrow-down",position:"right"},messages:{button:l.formatMessage({id:"loadMore_button"}),error:l.formatMessage({id:"loadMore_error"})}})]})};function BE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Ke.useMutation({mutationFn:e,onMutate:({content:a})=>t(i=>(i&&(i.content=a),i)),onError:n});return r}function AE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,isFetching:i}=Ke.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:a,isFetching:i}}function FE({queryFns:{read:e,edit:t,like:n,unlike:r},queryKey:a}){const i=Ke.useQueryClient(),s=Ga(),o={queryClient:i,queryKey:a},l={mutationHandlers:{error:Ao(o),mutate:Fo(o)},user:s,...o},u=BE({...l,mutationFn:t}),c=TE({...l,mutationFn:n}),h=SE({...l,mutationFn:r}),{activity:p,...m}=AE({queryKey:a,queryFn:e});return{activity:p,mutations:{edit:u,like:c,unlike:h},user:s,...m}}function TE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=Ke.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Ra({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Ra({activity:l,reaction:s}),r.setQueryData(a,l)}});return i}function SE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=Ke.useMutation({mutationFn:e,onMutate:i=>t(s=>(s&&ih({activity:s,user:r}),s)),onError:n});return a}const jE=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{activities:{remove:a,...i},reactions:s,mentions:o,join:l,leave:u}})=>{var M,w,k,O,j,q,z,re,X,v;const c=ue.useIntl(),h=C.useContext(Mt),{activity:p,error:m,isLoading:g,mutations:{edit:f,like:D,unlike:y}}=FE({queryFns:i,queryKey:[e,t,n]});if(g)return d.jsx(wt,{style:{height:"400px"}});if(m||!p)return d.jsx(an,{variant:"error",text:c.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:x,latest_reactions:A,mentioned_users:_}=p,E=(((M=A==null?void 0:A.like)==null?void 0:M.length)||0)>0,F=(((w=x==null?void 0:x.like)==null?void 0:w.length)||0)>0,S=F?x==null?void 0:x.like[0].id:"",$=E?(k=A==null?void 0:A.like)==null?void 0:k.map(H=>{var ee,B,T;return{id:(ee=H==null?void 0:H.user)==null?void 0:ee.id,name:(T=(B=H==null?void 0:H.user)==null?void 0:B.data)==null?void 0:T.name}}):!1,R=p==null?void 0:p.actor,I=(R==null?void 0:R.id)===(h==null?void 0:h.id);return d.jsxs("section",{className:"activity-section",children:[d.jsx(Mr,{className:"highlighted-text-box subtle",content:{id:n,type:"post",body:p==null?void 0:p.content,canLike:ei(r,I),createdAt:(p==null?void 0:p.time)||"",slugs:{question:`${e}/${t}`,answer:p==null?void 0:p.id},slug:n,author:{id:R.id,name:(O=R.data)==null?void 0:O.name,organization:(j=R.data)==null?void 0:j.organization,jobTitle:(q=R.data)==null?void 0:q.jobTitle,location:(z=R.data)==null?void 0:z.location,image:{thumbnail:((re=R.data)==null?void 0:re.thumbnail)||void 0}},userLiked:F,likes:((X=p==null?void 0:p.reaction_counts)==null?void 0:X.like)||0,comments:((v=p==null?void 0:p.reaction_counts)==null?void 0:v.reply)||0,peopleWhoLiked:$,mentions:_},originalAuthorId:R==null?void 0:R.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:a,updateContent:(H,{body:ee})=>f({content:ee})},likes:{createLike:()=>D({activityId:n}),deleteLike:()=>y({activityId:n,reactionId:S})},comments:{openComments:()=>{}},mentions:o},styling:{showShareLinkButton:!0}},n),d.jsx(ch,{basePath:e,parentId:t,activityId:n,isMember:r,functions:{reactions:s,mentions:o,join:l,leave:u}})]})},OE=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:a}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:a}}),gc=[{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/kCcBdXurt3uOKu6NdTPm0/1b6d19179b21f98dbdadf2477c03d267/devin-avery-7gwqj0yyrhm-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"why-public-servants-must-learn-to-fail",contributors:["community"]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/12Y0W1K0zVcDKzgLZlbfyC/6eb0757a02cbeea19b1b42d7da04d553/ashkan-forouzani-m0l9nbcivuk-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"organisational-culture-change-and-failure",contributors:[{name:"Mari-Liis",id:"bdb7509c-89ed-4633-8bc0-dbf11f5d9be1"}]},{contentType:"solutionArticle",banner:{description:"",url:"//images.ctfassets.net/txbhe1wabmyx/26TEwu0xVkbQDguuW89fY6/d54ce406cdd652d68979770d526398ab/nik-shuliahin-bunwp1bl0nc-unsplash.jpg",width:295,height:180,type:"image/jpeg",aspect:"responsiveCard",query:"w=295&h=180&fit=thumb&f=center"},slug:"how-to-learn-from-failure-without-causing-a-scandal",contributors:["community"]}];const ia="notFoundError_",PE=()=>{const e=ue.useIntl(),t=[];return gc.forEach((n,r)=>{n.title=e.formatMessage({id:`${ia}post_${r+1}`}),t.push("solutionArticle")}),d.jsxs(Gf,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:d.jsxs(ln,{children:[d.jsx(Uf,{cards:gc,cardTypes:t,buildCardData:n=>new Promise((r,a)=>{r(n)})}),d.jsx(Be,{href:"/solution-articles/",children:e.formatMessage({id:`${ia}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[d.jsx("h1",{children:e.formatMessage({id:`${ia}title`})}),d.jsx("p",{children:e.formatMessage({id:`${ia}text`})})]})};exports.ASSETS_BUCKET=Ht;exports.ActivitiesFeed=hE;exports.ActivitySection=jE;exports.AddPost=Bo;exports.Banner=Xx;exports.BannerSection=sw;exports.Breadcrumbs=yw;exports.Buckets=Kh;exports.Button=Be;exports.ButtonWrapper=kn;exports.COURSE_CONTENT_TYPES=hr;exports.CacheProvider=Mf;exports.Card=xo;exports.CardBlock=Uf;exports.Carousel=vw;exports.CharacterLimit=Ws;exports.CollapsibleSection=za;exports.Columns=Zf;exports.CommunityDetails=bw;exports.ContactFooter=Tw;exports.ContactForm=wf;exports.ContentTypeLabel=$c;exports.Contributors=qs;exports.ConversationContext=Xa;exports.CookieBanner=Yf;exports.CourseProgression=Mw;exports.CourseStructure=Iw;exports.CustomContentBanner=ow;exports.Directory=Yx;exports.DiscussionConversation=Xf;exports.DiscussionForm=Ja;exports.DiscussionLikes=eh;exports.DiscussionPost=Mr;exports.DiscussionThread=nh;exports.Divider=tn;exports.DownloadSection=ew;exports.EMAILS=Nn;exports.EditSection=nw;exports.EmailHelperTextBox=Kc;exports.EmptyStateBox=an;exports.Filters=Dw;exports.FlagsProvider=If;exports.Footer=ko;exports.Form=nr;exports.Formatting=Z;exports.FullWidthSection=ln;exports.GET_STREAM_USER_PREFIX=ns;exports.GlobalProviders=Kx;exports.Header=_o;exports.HelperTextBox=zc;exports.HiddenFromScreenReaders=$a;exports.HideShowTextBox=qc;exports.HighlightSection=lw;exports.HighlightedTextBox=Nt;exports.INVALID_TOKEN=Sc;exports.IconBulletedList=Gh;exports.ImageContainer=Hh;exports.IntlProvider=$f;exports.InviteForm=Ef;exports.InviteModal=Zx;exports.JoinButton=wo;exports.LanguageContext=yo;exports.LanguageSwitcher=xw;exports.LessonName=Qf;exports.LessonType=Jf;exports.Link=_n;exports.LoadMore=Rr;exports.LoadingBlock=om;exports.LoadingPlaceholder=wt;exports.LoadingState=Ls;exports.Logo=Eo;exports.LogoSection=rw;exports.MENTION_REGEX=jc;exports.MarkCompleteButton=$w;exports.MarkdownText=Vn;exports.MarketingBlock=cw;exports.Marks=Ot;exports.Member=tr;exports.MembersList=Rw;exports.Modal=Co;exports.MoreMenu=Vf;exports.NUMBER_OF_COUNTRIES=Th;exports.NUMBER_OF_USERS=Fh;exports.NavigationMenu=Kf;exports.NotFoundError=PE;exports.Overlay=Nr;exports.OverlayContext=Do;exports.OverlayProvider=qf;exports.PageHeading=Wc;exports.PageLayout=Gf;exports.PasswordForm=zC;exports.PasswordRules=Jc;exports.Pill=hn;exports.Popover=Ic;exports.Portal=Is;exports.ProfileImageChange=LC;exports.ProfilePicture=sn;exports.ProgressBar=$s;exports.ProgressTracker=Uh;exports.Rating=Dm;exports.RepliesFeed=ch;exports.ResponsesHeading=th;exports.ResponsiveImage=er;exports.ReturnToNavButton=Vh;exports.RichTextEditor=xf;exports.SearchForm=kf;exports.ShareLinks=Bw;exports.SignupForm=KC;exports.Span=os;exports.StatusBanner=Er;exports.TableOfContents=Jx;exports.Tabs=Aw;exports.Tags=Nw;exports.TestimonialBlock=Qx;exports.TimeToComplete=Qa;exports.Toggle=$C;exports.Tooltip=En;exports.TopLevelPage=Sw;exports.UUID_V4_REGEX=rs;exports.UserContext=Mt;exports.UserProvider=Lf;exports.VisuallyHidden=Me;exports.addAriaProps=Wf;exports.basicReducer=Or;exports.camelCaseToDashCase=Ac;exports.checkIntlPathExists=La;exports.generateConditions=ma;exports.generateCssIcon=Oc;exports.getCharacterLimitProps=Vc;exports.getLongDate=Ms;exports.getMember=zs;exports.getShortDate=Pc;exports.getValueLength=qa;exports.headerData=jr;exports.mapGetStreamData=OE;exports.pageReady=Nc;exports.passwordValidator=is;exports.repliesFeedMock=mE;exports.supportedLanguages=ga;exports.toCamelCase=Fc;exports.toCapitalisedCase=Ah;exports.toSentenceCase=Tc;exports.useCurrentPath=xc;exports.useEffectAfterMount=Un;exports.useElementWidth=Jn;exports.useOverlay=zf;exports.useScrollListener=kc;exports.useScrollToHash=Ns;exports.useTooltips=Rs;exports.useUser=Ga;
|
package/index.mjs
CHANGED
|
@@ -1777,10 +1777,7 @@ const $r = ({ image: e, className: t, testId: n }) => {
|
|
|
1777
1777
|
loading: c,
|
|
1778
1778
|
decoding: h,
|
|
1779
1779
|
fetchPriority: p
|
|
1780
|
-
} = e;
|
|
1781
|
-
let m = a;
|
|
1782
|
-
m === "" ? m = "" : a == null && r && (m = r);
|
|
1783
|
-
const { range: g, sizes: f } = Sh(e), D = si({ format: "avif", query: o, range: g, url: l }), y = si({ format: "webp", query: o, range: g, url: l }), x = si({ format: "", query: o, range: g, url: l });
|
|
1780
|
+
} = e, { range: m, sizes: g } = Sh(e), f = si({ format: "avif", query: o, range: m, url: l }), D = si({ format: "webp", query: o, range: m, url: l }), y = si({ format: "", query: o, range: m, url: l });
|
|
1784
1781
|
return s && s.includes("svg") ? /* @__PURE__ */ d.jsx("picture", { className: t, children: /* @__PURE__ */ d.jsx(
|
|
1785
1782
|
"img",
|
|
1786
1783
|
{
|
|
@@ -1798,19 +1795,19 @@ const $r = ({ image: e, className: t, testId: n }) => {
|
|
|
1798
1795
|
"source",
|
|
1799
1796
|
{
|
|
1800
1797
|
type: "image/avif",
|
|
1801
|
-
srcSet:
|
|
1802
|
-
sizes:
|
|
1798
|
+
srcSet: f,
|
|
1799
|
+
sizes: g,
|
|
1803
1800
|
"data-testid": "source"
|
|
1804
1801
|
}
|
|
1805
1802
|
),
|
|
1806
|
-
/* @__PURE__ */ d.jsx("source", { type: "image/webp", srcSet:
|
|
1803
|
+
/* @__PURE__ */ d.jsx("source", { type: "image/webp", srcSet: D, sizes: g, "data-testid": "source" }),
|
|
1807
1804
|
/* @__PURE__ */ d.jsx(
|
|
1808
1805
|
"img",
|
|
1809
1806
|
{
|
|
1810
|
-
srcSet:
|
|
1811
|
-
sizes:
|
|
1807
|
+
srcSet: y,
|
|
1808
|
+
sizes: g,
|
|
1812
1809
|
src: l,
|
|
1813
|
-
alt:
|
|
1810
|
+
alt: a || r,
|
|
1814
1811
|
loading: c || "lazy",
|
|
1815
1812
|
decoding: h || "async",
|
|
1816
1813
|
fetchpriority: p || "auto",
|
|
@@ -20776,8 +20773,7 @@ const Zw = ({
|
|
|
20776
20773
|
{
|
|
20777
20774
|
image: {
|
|
20778
20775
|
...r,
|
|
20779
|
-
|
|
20780
|
-
// We don't want alt text on the image
|
|
20776
|
+
description: ""
|
|
20781
20777
|
}
|
|
20782
20778
|
}
|
|
20783
20779
|
)
|