@apolitical/component-library 7.0.4-ac.0 → 7.0.5

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/helpers/intl.d.ts CHANGED
@@ -426,8 +426,8 @@ export declare const checkIntlPathExists: (path: string, language?: {
426
426
  footer_legal_dataProtection: string;
427
427
  footer_legal_euDataProtection: string;
428
428
  footer_contact: string;
429
- footer_contact_correspondence: string;
430
- footer_contact_correspondence_address: string;
429
+ footer_contact_london: string;
430
+ footer_contact_london_address: string;
431
431
  footer_contact_registered: string;
432
432
  footer_contact_registered_address: string;
433
433
  footer_contact_berlin: string;
package/index.js CHANGED
@@ -32,7 +32,7 @@ Check the top-level render call using <`+fe+">.")}return ue}}function bu(R,ue){{
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.`,discussionFormCard_placeholder:"Create post",discussionFormCard_placeholder_long:"Write a post or ask a question...",discussionFormCard_overlay_title:"Discard post",discussionFormCard_overlay_text:"Are you sure you want to leave without posting? Changes you have made will not be saved.",discussionFormCard_overlay_cta_discard:"Discard",discussionFormCard_overlay_cta_continue:"Continue editing",discussion_form_postType_label:"Post type","discussion_form__postType_no-category":"Post",discussion_form_title:"Write your {action}",discussion_form_titleField_label:"Title",discussion_form_titleField_placeholder:"Write something...",discussion_form_titleField_error:"Please enter a title or a body for your post.",discussion_form_question_label:"Question",discussion_form_question_placeholder:"Question",discussion_form_option_label:"Options",discussion_form_option_placeholder:"Option {number}",discussion_form_option_cta:"Add option",discussion_form_multiplePollAnswers:"Allow multiple answers",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"Body",discussion_form_label_action:"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:"Create 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:"Share a question, insight, or announcement with the community",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_showAll:"Show all...",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_pin:"Pin post",discussion_moreMenu_unpin:"Unpin post",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_comments_loading:"... 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",profileModalLauncher_successMessage:"Your post has been created",profileModalLauncher_title:"Your profile is incomplete",profileModalLauncher_text:"A complete profile builds trust and amplifies your voice across the community. Ensure all your details are up to date including a photo and a bio.",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_fieldWrapper_characterLimit_info:"You can enter up 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_error_multipleInputs_same:"Please enter a unique value into each field",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",form_multipleInputs_label:"Input {number}",form_multipleInputs_filledInCount:"{number}/{total}",form_multipleInputs_filledInCount_aria:"{number} out of {total} available inputs have been filled in",form_multipleInputs_remove:"Remove this input",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 email addresses below",inviteForm_message_label:"Add an invitation note",inviteForm_message_placeholder:"Add a personal note to your invitation...",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",profileForm_image:"Upload photo",profileForm_name:"Full name",profileForm_name_placeholder:"What's your name, so people can recognise you?",profileForm_jobTitle:"Job title",profileForm_jobTitle_placeholder:"What's your current job title?",profileForm_organization:"Organisation",profileForm_organization_placeholder:"Where do you work?",profileForm_location:"Location",profileForm_location_placeholder:"Add your city",profileForm_location_error:"Please choose a location from the list.",profileForm_bio:"Bio",profileForm_bio_placeholder:"Tell us more about yourself...",profileForm_cta:"Save",profileForm_cta_submitting:"Saving...",profileForm_cta_submitted:"Saved",profileImageChange_cta_uploading:"Uploading image...",profileImageChange_cta_change:"Change photo",profileImageChange_cta_upload:"+ Add profile photo",profileImageChange_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.",publishArticleForm_title_label:"Title",publishArticleForm_title_placeholder:"Write a snappy title",publishArticleForm_subtitle_label:"Subtitle",publishArticleForm_subtitle_placeholder:"Your topic, in a nutshell",publishArticleForm_body_label:"Body",publishArticleForm_body_placeholder:"Type or paste your article here",publishArticleForm_tags_label:"Tags (select up to three)",publishArticleForm_cover_image_label:"Cover image",publishArticleForm__tags_topic_CitiesAndLocalGovernment:"Cities and local government",publishArticleForm__tags_topic_Climate:"Climate",publishArticleForm__tags_topic_DigitalAndData:"Digital, data and AI",publishArticleForm__tags_topic_Education:"Education",publishArticleForm__tags_topic_EquityJusticeAndInclusion:"Equity, justice and inclusion",publishArticleForm__tags_topic_HealthAndSocialCare:"Health and social care",publishArticleForm__tags_topic_Innovation:"Innovation",publishArticleForm__tags_topic_LeadershipAndSkills:"Leadership and skills",publishArticleForm__tags_topic_LifeInGovernment:"Life in government",publishArticleForm__tags_topic_Policymaking:"Policymaking",publishArticleForm__tags_topic_TransportAndInfrastructure:"Transport and infrastructure",publishArticleForm__tags_topic_WorkAndTheEconomy:"Work and the economy",publishArticleForm_tags_error_over_three:"You must select no more than three options.",publishArticleForm_tags_error_required:"Please select at least one option.",publishArticleForm_disclaimer:"Ready to publish? Before you do, consider the following: Have you thoroughly proofread your writing? Are you confident in your arguments? Have you included hyperlinks to the necessary resources to support your article?",publishArticleForm_cta_submit:"Publish article",publishArticleForm_cta_submitting:"Publishing...",publishArticleForm_cta_submitted:"Published!",publishArticleForm_aria_success:"Your article is being published. You will be redirected to your article in a moment.",publishArticleForm_error:"Sorry, something went wrong.",publishArticleForm_error_underMinLength:"Please add at least {length, plural, one {1 character} other {# characters}}.",publishArticleForm_error_loggedOut:"You need to be logged in to publish an article. Please log in and try again.",publishArticleForm_progressBar:"Your article is being published",publishArticleForm_selectImage_button:"Select a cover image",publishArticleForm_replaceImage_button:"Replace Image",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_heading_three:"Heading",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_link_enrichedUrl_aria:"Remove this preview for {title}",richTextEditor_link_enrichedUrl_aria_fallback:"the link",richTextEditor_link_enrichedUrl_aria_live:"The link preview has been removed from your post",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",richTextEditor_mention_fallback:"Can't find who you're looking for? Invite them to the community",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>",poll_instructions:"Select one{allowMultipleVotes, select, true { or more} other {}}",poll_num_votes:"{number, plural, one {# vote} other {# votes}}",poll_remove_vote_button:"Remove vote{number, plural, =0 {} one {} other {s}}",poll_aria_votes:"You have {number, plural, =0 {not voted on this poll} other {voted for:}}",replies_feed_missing_polls_vote_message:"Please vote above to view all the comments",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_insights:"Insights",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_washington:"Washington DC Address",footer_contact_washington_address:"1100 15th St NW{br}Washington, DC 20005{br}United States",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_communities:"Communities",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, data and AI",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_browserTooSmall:"Sorry, your device is too small to view this content properly. Please change to a different orientation or another device.",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",discussionFormModal_title:"Create a post",discussionFormModal_cta:"Create post",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 email addresses below.",inviteModal_cta:"Send",overlay_close:"Close",profileModal_title:"Update your profile",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",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",editSection_placeholder_description:"Add some details",editSection_placeholder_cta:"add",editSection_edit:"Edit",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_survey:"Skip past survey",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll",markdown_iframe_survey:"Survey"},Gh={...gr,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>"},Qh={...gr,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"},Jh={...gr,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>"},Xh=Object.freeze(Object.defineProperty({__proto__:null,en:gr,es:Gh,fr:Qh,pt:Jh},Symbol.toStringTag,{value:"Module"})),fa=(e,t=gr)=>e in t,Rt=(e,t,n,r,i={})=>{let a="";return fa(`${t}_${n}`)?a=e({id:`${t}_${n}`},i):a=e({id:t},{[r]:n,...i}),a},ep=(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 i=n.length-1;i>=0;i--){const a=Math.pow(10,(i+1)*3);if(a<=e){e=Math.round(e*t/a)/t,e===1e3&&i<n.length-1&&(e=1,i++),r=`${e}${n[i]}`;break}}return r},Oi=(e,t)=>x.Children.map(e,n=>Object.is(n,null)?n:x.cloneElement(n,{...t})),_d=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},tp=e=>{var a,s;const n=["name","organization","jobTitle","biography"].every(o=>{const l=e[o];return l!=null&&l!==""}),r=((a=e.image)==null?void 0:a.thumbnail)!==void 0,i=((s=e.location)==null?void 0:s.en)!==void 0;return n&&r&&i},np=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,Vr).replace(/{{id}}/g,Vr):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),kd=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var a;if(!n)return e;const i=e.match(Hr);if(!i)return e;for(const s of i){const o=s.replace(Hr,(d,f)=>f),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=l.error?l.error:((a=l==null?void 0:l.data)==null?void 0:a.name)||"",u.id=l.id||"",u.error=l.error;else{const d=l;if(d.startsWith(Ss))try{const f=d.replace(Ss,"");u.id=f,await r({id:f}).then(h=>{const{name:p,error:v}=h;u.name=v||p||"",u.error=v})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?np(e,u,t):s)}return e},po=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},Fd=e=>new URLSearchParams(window.location.search).get(e),Kr=(e="")=>e.replace(/\s+/g,"").length>0,Ps=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 Ae=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:a="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",screenreaderText:d=!1,children:f=!1,...h})=>{const v=wn(typeof t=="object"),{showTooltip:m,tooltipProps:b}=mo(!!u);if(typeof t=="object"&&typeof v=="number"){const k=Object.assign({},t),E=vd(Object.keys(k));t=bd(v,E,k)}!l&&u&&(u="");const g=[];typeof t=="string"&&g.push(t),r&&(g.push("icon"),typeof r=="object"?(g.push(r.icon),r.position?g.push(r.position):g.push("left"),r.hover&&g.push(`hover_${r.hover}`),r.animate&&(g.push("animate"),typeof r.animate=="string"&&g.push(r.animate))):(g.push(r),!r.includes("right")&&!r.includes("left")&&g.push("left")));const y={...h,className:K(e,o,g,{"no-text":!f,disabled:l,button:i,muted:n.muted,"full-width":n.fullWidth}),onClick:k=>{(!i||i[0]==="#")&&s&&(k.preventDefault(),k.stopPropagation()),s&&s(k)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};i&&(a="a",y.href=i);const C=x.createElement(a,y,f||(d?c.jsx(Me,{showOnFocus:!1,children:d}):null));return l&&u?c.jsxs("span",{className:"button-container",...b,children:[c.jsx(Ln,{isOpen:m,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),C]}):C},vr=({buttons:e,wrappers:t=[],className:n="",...r})=>{const i=e.length>1?"ul":"p",a=e.map((s,o)=>{var l;return i==="p"?c.jsx(Ae,{...s},o):c.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:c.jsx(Ae,{...s})},o)});return x.createElement(i,{className:K("button-wrapper",n),...r,children:a})};const zt=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return c.jsx("hr",{className:K(e,{"has-max-width":t}),style:n})},_u={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"},highlightSection:{range:[{height:200,width:674},{height:400,width:1348},{height:1e3,width:1e3},{height:2e3,width:2e3}],sizes:"(max-width: 500px) 674px, (max-width: 1024px) 1348px, (max-width: 1200px) 1000px, 2000px"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"}},rp=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:i}=e?_u[e]:_u.fallback;return{range:t&&t.length>0?t:r,sizes:n||i}},ip=({format:e,height:t,query:n,width:r})=>{let i=`w=${r}&h=${t}`;return i=e?`${i}&fm=${e}`:i,i=n?`${i}&${n}`:i,i},ja=({format:e,range:t,url:n,query:r})=>t.map(({height:i,width:a})=>`${n}?${ip({format:e,height:i,query:r,width:a})} ${a}w`).join(", ");const Cn=({image:e,className:t,testId:n})=>{const{description:r,height:i,type:a,color:s,query:o,url:l,width:u,loading:d,decoding:f,fetchPriority:h}=e,{range:p,sizes:v}=rp(e),m=ja({format:"avif",query:o,range:p,url:l}),b=ja({format:"webp",query:o,range:p,url:l}),g=ja({format:"",query:o,range:p,url:l});let y={};return s&&(y={"--color":s}),a&&a.includes("svg")?c.jsx("picture",{className:t,style:y,children:c.jsx("img",{src:l,alt:r,loading:d||"lazy",decoding:f||"async",fetchpriority:h||"auto",width:u,height:i,"data-testid":n||"image"})}):c.jsxs("picture",{className:t,style:y,children:[a!=="image/gif"&&c.jsx("source",{type:"image/avif",srcSet:m,sizes:v,"data-testid":"source"}),c.jsx("source",{type:"image/webp",srcSet:b,sizes:v,"data-testid":"source"}),c.jsx("img",{srcSet:g,sizes:v,src:l,alt:r,loading:d||"lazy",decoding:f||"async",fetchpriority:h||"auto",width:u,height:i,"data-testid":n||"image"})]})};const ap=({image:e,className:t="",testId:n})=>c.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&c.jsx(Cn,{image:{...e},className:"image"})}),Dn=({href:e,children:t,fallbackElement:n,meta:r,className:i="",onClick:a,gtmContext:s,gtmType:o,...l})=>{const{forceOnClick:u=!1}=r||{};if(e){const f={...l};return a&&(f.onClick=a),s&&(f["data-gtm-event-context"]=s),o&&(f["data-gtm-event-type"]=o),c.jsx("a",{href:e,className:K("gtm-trackable",i),...f,children:t})}const d={};return u&&(d.onClick=a),n?x.createElement(n,{children:t,className:i,...l,...d}):c.jsx(c.Fragment,{children:t})};const Ad=x.forwardRef(({className:e="",children:t},n)=>{const r=x.useRef(null),i=n||r;return c.jsx("aside",{ref:i,className:K("popover",e),"aria-live":"polite",children:t})}),br=({parent:e=document.body,children:t})=>typeof document=="object"?ld.createPortal(t,e):null,sp=Object.freeze(Object.defineProperty({__proto__:null,default:br},Symbol.toStringTag,{value:"Module"}));const op=({currentStep:e=1,steps:t=1})=>c.jsxs(c.Fragment,{children:[c.jsx(Me,{children:c.jsx(ie.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),c.jsx("div",{className:"progress-tracker",children:c.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const i=r+1;return c.jsxs("div",{className:"dot-wrapper",children:[c.jsx("div",{className:K("dot",{active:i===e,completed:i<e}),"data-testid":"progress-dot"}),c.jsx("div",{className:K("line",{active:i<e})})]},r)})})})]});const up=({elementId:e,offset:t=20})=>{const n=ie.useIntl(),r=()=>{const i=document.getElementById(e);if(!i)return;const a=document.getElementById("header");a&&window.scrollTo({top:i.offsetTop-a.clientHeight-t})};return c.jsx(Ae,{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 lp=({items:e,className:t="",...n})=>c.jsx("ul",{className:K("buckets",t),...n,children:e.map(({title:r,text:i,link:a,...s},o)=>c.jsx("li",{className:"bucket text-medium",children:c.jsxs("a",{href:a,...s,children:[c.jsx("p",{className:"title",children:r}),c.jsx("p",{children:i})]})},o))}),ku=300,Fu="ease-in-out";class cp{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:ku,easing:Fu}),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:ku,easing:Fu}),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 ma=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const i=ie.useIntl(),a=x.useRef(null);return x.useEffect(()=>{let s;return r&&(s=new cp(a.current)),()=>{r&&s&&s.cleanUp()}},[]),c.jsxs("details",{ref:a,className:K("collapsible-section",t,{"should-animate":r}),children:[c.jsx("summary",{children:e||i.formatMessage({id:"collapsibleSection_summary"})}),c.jsx("div",{className:"content",children:n})]})},Au={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},dp=e=>{let t=e;return Object.keys(Au).includes(e)&&(t=Au[e]),`url(${Gt}icons/${t}.svg)`};const Bu={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},Bd=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const i=ie.useIntl(),a=t?{"--custom-icon":dp(t)}:{},s=fa(`contentTypeLabel_${e}`)?i.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:c.jsx("small",{className:K("content-type-label text-small",e in Bu?Bu[e]:e,r,{"has-custom-icon":t}),style:a,"data-testid":"content-type-label",children:n||s})};const _t=({variant:e="primary",icon:t,styling:n={},className:r="",children:i,...a})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Gt}icons/${t}.svg)`}:{};return c.jsx("div",{className:K("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...a,children:i})};const Qt=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let i=n&&!!Object.keys(n).length;const a=typeof n=="object"&&"breakpoints"in n,s=wn(a);if(a&&typeof n=="object"&&typeof s=="number"){const f=Object.assign({},n.breakpoints),h=vd(Object.keys(f));i=bd(s,h,f)}const{breakpoints:o,text:l="",component:u,...d}=n;return c.jsx(_t,{variant:"subtle",className:K("empty-state-box",e,r),children:c.jsxs(c.Fragment,{children:[t&&typeof t=="string"?c.jsx(Zt,{options:{forceBlock:!0},children:t}):t,i&&typeof n=="object"&&(u||c.jsx(Ae,{...d,variant:n.variant?n.variant:"secondary",children:l}))]})})};const Os=({children:e,...t})=>c.jsx("p",{...t,children:e}),Td={q:Os,blockquote:Os};for(let e=1;e<=6;e++)Td[`h${e}`]={component:Os,props:{className:"title"}};const Sd=({type:e="default",className:t="",heading:n=!1,children:r,...i})=>c.jsxs("div",{...i,className:K("helper-text-box text-small",e,t),children:[n&&c.jsx("p",{className:"title",children:n}),typeof r=="string"?c.jsx(Zt,{options:{wrapper:x.Fragment,forceBlock:!0,overrides:Td},children:r}):c.jsx("p",{children:r})]});const jd=({id:e,className:t="",show:n=!1,hide:r=!1,text:i,markdownOptions:a,fadeStyle:s="default",children:o})=>{const l=ie.useIntl(),u=x.useRef(null);e||(e=Date.now().toString());const[d,f]=x.useState(""),[h,p]=x.useState("closed");x.useEffect(()=>{const b=u.current;if(b)return b.addEventListener("transitionend",v),()=>{b.removeEventListener("transitionend",v)}},[]),x.useEffect(()=>{if(!i||typeof i!="string")return;const b=i.split(`
35
+ Thank you for helping to protect the Apolitical community from abusive content.`,discussionFormCard_placeholder:"Create post",discussionFormCard_placeholder_long:"Write a post or ask a question...",discussionFormCard_overlay_title:"Discard post",discussionFormCard_overlay_text:"Are you sure you want to leave without posting? Changes you have made will not be saved.",discussionFormCard_overlay_cta_discard:"Discard",discussionFormCard_overlay_cta_continue:"Continue editing",discussion_form_postType_label:"Post type","discussion_form__postType_no-category":"Post",discussion_form_title:"Write your {action}",discussion_form_titleField_label:"Title",discussion_form_titleField_placeholder:"Write something...",discussion_form_titleField_error:"Please enter a title or a body for your post.",discussion_form_question_label:"Question",discussion_form_question_placeholder:"Question",discussion_form_option_label:"Options",discussion_form_option_placeholder:"Option {number}",discussion_form_option_cta:"Add option",discussion_form_multiplePollAnswers:"Allow multiple answers",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"Body",discussion_form_label_action:"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:"Create 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:"Share a question, insight, or announcement with the community",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_showAll:"Show all...",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_pin:"Pin post",discussion_moreMenu_unpin:"Unpin post",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_comments_loading:"... 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",profileModalLauncher_successMessage:"Your post has been created",profileModalLauncher_title:"Your profile is incomplete",profileModalLauncher_text:"A complete profile builds trust and amplifies your voice across the community. Ensure all your details are up to date including a photo and a bio.",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_fieldWrapper_characterLimit_info:"You can enter up 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_error_multipleInputs_same:"Please enter a unique value into each field",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",form_multipleInputs_label:"Input {number}",form_multipleInputs_filledInCount:"{number}/{total}",form_multipleInputs_filledInCount_aria:"{number} out of {total} available inputs have been filled in",form_multipleInputs_remove:"Remove this input",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 email addresses below",inviteForm_message_label:"Add an invitation note",inviteForm_message_placeholder:"Add a personal note to your invitation...",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",profileForm_image:"Upload photo",profileForm_name:"Full name",profileForm_name_placeholder:"What's your name, so people can recognise you?",profileForm_jobTitle:"Job title",profileForm_jobTitle_placeholder:"What's your current job title?",profileForm_organization:"Organisation",profileForm_organization_placeholder:"Where do you work?",profileForm_location:"Location",profileForm_location_placeholder:"Add your city",profileForm_location_error:"Please choose a location from the list.",profileForm_bio:"Bio",profileForm_bio_placeholder:"Tell us more about yourself...",profileForm_cta:"Save",profileForm_cta_submitting:"Saving...",profileForm_cta_submitted:"Saved",profileImageChange_cta_uploading:"Uploading image...",profileImageChange_cta_change:"Change photo",profileImageChange_cta_upload:"+ Add profile photo",profileImageChange_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.",publishArticleForm_title_label:"Title",publishArticleForm_title_placeholder:"Write a snappy title",publishArticleForm_subtitle_label:"Subtitle",publishArticleForm_subtitle_placeholder:"Your topic, in a nutshell",publishArticleForm_body_label:"Body",publishArticleForm_body_placeholder:"Type or paste your article here",publishArticleForm_tags_label:"Tags (select up to three)",publishArticleForm_cover_image_label:"Cover image",publishArticleForm__tags_topic_CitiesAndLocalGovernment:"Cities and local government",publishArticleForm__tags_topic_Climate:"Climate",publishArticleForm__tags_topic_DigitalAndData:"Digital, data and AI",publishArticleForm__tags_topic_Education:"Education",publishArticleForm__tags_topic_EquityJusticeAndInclusion:"Equity, justice and inclusion",publishArticleForm__tags_topic_HealthAndSocialCare:"Health and social care",publishArticleForm__tags_topic_Innovation:"Innovation",publishArticleForm__tags_topic_LeadershipAndSkills:"Leadership and skills",publishArticleForm__tags_topic_LifeInGovernment:"Life in government",publishArticleForm__tags_topic_Policymaking:"Policymaking",publishArticleForm__tags_topic_TransportAndInfrastructure:"Transport and infrastructure",publishArticleForm__tags_topic_WorkAndTheEconomy:"Work and the economy",publishArticleForm_tags_error_over_three:"You must select no more than three options.",publishArticleForm_tags_error_required:"Please select at least one option.",publishArticleForm_disclaimer:"Ready to publish? Before you do, consider the following: Have you thoroughly proofread your writing? Are you confident in your arguments? Have you included hyperlinks to the necessary resources to support your article?",publishArticleForm_cta_submit:"Publish article",publishArticleForm_cta_submitting:"Publishing...",publishArticleForm_cta_submitted:"Published!",publishArticleForm_aria_success:"Your article is being published. You will be redirected to your article in a moment.",publishArticleForm_error:"Sorry, something went wrong.",publishArticleForm_error_underMinLength:"Please add at least {length, plural, one {1 character} other {# characters}}.",publishArticleForm_error_loggedOut:"You need to be logged in to publish an article. Please log in and try again.",publishArticleForm_progressBar:"Your article is being published",publishArticleForm_selectImage_button:"Select a cover image",publishArticleForm_replaceImage_button:"Replace Image",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_heading_three:"Heading",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_link_enrichedUrl_aria:"Remove this preview for {title}",richTextEditor_link_enrichedUrl_aria_fallback:"the link",richTextEditor_link_enrichedUrl_aria_live:"The link preview has been removed from your post",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",richTextEditor_mention_fallback:"Can't find who you're looking for? Invite them to the community",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>",poll_instructions:"Select one{allowMultipleVotes, select, true { or more} other {}}",poll_num_votes:"{number, plural, one {# vote} other {# votes}}",poll_remove_vote_button:"Remove vote{number, plural, =0 {} one {} other {s}}",poll_aria_votes:"You have {number, plural, =0 {not voted on this poll} other {voted for:}}",replies_feed_missing_polls_vote_message:"Please vote above to view all the comments",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_insights:"Insights",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_london:"London address",footer_contact_london_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_washington:"Washington DC Address",footer_contact_washington_address:"1100 15th St NW{br}Washington, DC 20005{br}United States",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_communities:"Communities",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, data and AI",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_browserTooSmall:"Sorry, your device is too small to view this content properly. Please change to a different orientation or another device.",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",discussionFormModal_title:"Create a post",discussionFormModal_cta:"Create post",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 email addresses below.",inviteModal_cta:"Send",overlay_close:"Close",profileModal_title:"Update your profile",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",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",editSection_placeholder_description:"Add some details",editSection_placeholder_cta:"add",editSection_edit:"Edit",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_survey:"Skip past survey",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll",markdown_iframe_survey:"Survey"},Gh={...gr,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>"},Qh={...gr,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"},Jh={...gr,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>"},Xh=Object.freeze(Object.defineProperty({__proto__:null,en:gr,es:Gh,fr:Qh,pt:Jh},Symbol.toStringTag,{value:"Module"})),fa=(e,t=gr)=>e in t,Rt=(e,t,n,r,i={})=>{let a="";return fa(`${t}_${n}`)?a=e({id:`${t}_${n}`},i):a=e({id:t},{[r]:n,...i}),a},ep=(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 i=n.length-1;i>=0;i--){const a=Math.pow(10,(i+1)*3);if(a<=e){e=Math.round(e*t/a)/t,e===1e3&&i<n.length-1&&(e=1,i++),r=`${e}${n[i]}`;break}}return r},Oi=(e,t)=>x.Children.map(e,n=>Object.is(n,null)?n:x.cloneElement(n,{...t})),_d=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},tp=e=>{var a,s;const n=["name","organization","jobTitle","biography"].every(o=>{const l=e[o];return l!=null&&l!==""}),r=((a=e.image)==null?void 0:a.thumbnail)!==void 0,i=((s=e.location)==null?void 0:s.en)!==void 0;return n&&r&&i},np=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,Vr).replace(/{{id}}/g,Vr):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),kd=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var a;if(!n)return e;const i=e.match(Hr);if(!i)return e;for(const s of i){const o=s.replace(Hr,(d,f)=>f),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=l.error?l.error:((a=l==null?void 0:l.data)==null?void 0:a.name)||"",u.id=l.id||"",u.error=l.error;else{const d=l;if(d.startsWith(Ss))try{const f=d.replace(Ss,"");u.id=f,await r({id:f}).then(h=>{const{name:p,error:v}=h;u.name=v||p||"",u.error=v})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?np(e,u,t):s)}return e},po=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},Fd=e=>new URLSearchParams(window.location.search).get(e),Kr=(e="")=>e.replace(/\s+/g,"").length>0,Ps=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 Ae=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:a="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",screenreaderText:d=!1,children:f=!1,...h})=>{const v=wn(typeof t=="object"),{showTooltip:m,tooltipProps:b}=mo(!!u);if(typeof t=="object"&&typeof v=="number"){const k=Object.assign({},t),E=vd(Object.keys(k));t=bd(v,E,k)}!l&&u&&(u="");const g=[];typeof t=="string"&&g.push(t),r&&(g.push("icon"),typeof r=="object"?(g.push(r.icon),r.position?g.push(r.position):g.push("left"),r.hover&&g.push(`hover_${r.hover}`),r.animate&&(g.push("animate"),typeof r.animate=="string"&&g.push(r.animate))):(g.push(r),!r.includes("right")&&!r.includes("left")&&g.push("left")));const y={...h,className:K(e,o,g,{"no-text":!f,disabled:l,button:i,muted:n.muted,"full-width":n.fullWidth}),onClick:k=>{(!i||i[0]==="#")&&s&&(k.preventDefault(),k.stopPropagation()),s&&s(k)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};i&&(a="a",y.href=i);const C=x.createElement(a,y,f||(d?c.jsx(Me,{showOnFocus:!1,children:d}):null));return l&&u?c.jsxs("span",{className:"button-container",...b,children:[c.jsx(Ln,{isOpen:m,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),C]}):C},vr=({buttons:e,wrappers:t=[],className:n="",...r})=>{const i=e.length>1?"ul":"p",a=e.map((s,o)=>{var l;return i==="p"?c.jsx(Ae,{...s},o):c.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:c.jsx(Ae,{...s})},o)});return x.createElement(i,{className:K("button-wrapper",n),...r,children:a})};const zt=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return c.jsx("hr",{className:K(e,{"has-max-width":t}),style:n})},_u={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"},highlightSection:{range:[{height:200,width:674},{height:400,width:1348},{height:1e3,width:1e3},{height:2e3,width:2e3}],sizes:"(max-width: 500px) 674px, (max-width: 1024px) 1348px, (max-width: 1200px) 1000px, 2000px"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"}},rp=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:i}=e?_u[e]:_u.fallback;return{range:t&&t.length>0?t:r,sizes:n||i}},ip=({format:e,height:t,query:n,width:r})=>{let i=`w=${r}&h=${t}`;return i=e?`${i}&fm=${e}`:i,i=n?`${i}&${n}`:i,i},ja=({format:e,range:t,url:n,query:r})=>t.map(({height:i,width:a})=>`${n}?${ip({format:e,height:i,query:r,width:a})} ${a}w`).join(", ");const Cn=({image:e,className:t,testId:n})=>{const{description:r,height:i,type:a,color:s,query:o,url:l,width:u,loading:d,decoding:f,fetchPriority:h}=e,{range:p,sizes:v}=rp(e),m=ja({format:"avif",query:o,range:p,url:l}),b=ja({format:"webp",query:o,range:p,url:l}),g=ja({format:"",query:o,range:p,url:l});let y={};return s&&(y={"--color":s}),a&&a.includes("svg")?c.jsx("picture",{className:t,style:y,children:c.jsx("img",{src:l,alt:r,loading:d||"lazy",decoding:f||"async",fetchpriority:h||"auto",width:u,height:i,"data-testid":n||"image"})}):c.jsxs("picture",{className:t,style:y,children:[a!=="image/gif"&&c.jsx("source",{type:"image/avif",srcSet:m,sizes:v,"data-testid":"source"}),c.jsx("source",{type:"image/webp",srcSet:b,sizes:v,"data-testid":"source"}),c.jsx("img",{srcSet:g,sizes:v,src:l,alt:r,loading:d||"lazy",decoding:f||"async",fetchpriority:h||"auto",width:u,height:i,"data-testid":n||"image"})]})};const ap=({image:e,className:t="",testId:n})=>c.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&c.jsx(Cn,{image:{...e},className:"image"})}),Dn=({href:e,children:t,fallbackElement:n,meta:r,className:i="",onClick:a,gtmContext:s,gtmType:o,...l})=>{const{forceOnClick:u=!1}=r||{};if(e){const f={...l};return a&&(f.onClick=a),s&&(f["data-gtm-event-context"]=s),o&&(f["data-gtm-event-type"]=o),c.jsx("a",{href:e,className:K("gtm-trackable",i),...f,children:t})}const d={};return u&&(d.onClick=a),n?x.createElement(n,{children:t,className:i,...l,...d}):c.jsx(c.Fragment,{children:t})};const Ad=x.forwardRef(({className:e="",children:t},n)=>{const r=x.useRef(null),i=n||r;return c.jsx("aside",{ref:i,className:K("popover",e),"aria-live":"polite",children:t})}),br=({parent:e=document.body,children:t})=>typeof document=="object"?ld.createPortal(t,e):null,sp=Object.freeze(Object.defineProperty({__proto__:null,default:br},Symbol.toStringTag,{value:"Module"}));const op=({currentStep:e=1,steps:t=1})=>c.jsxs(c.Fragment,{children:[c.jsx(Me,{children:c.jsx(ie.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),c.jsx("div",{className:"progress-tracker",children:c.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const i=r+1;return c.jsxs("div",{className:"dot-wrapper",children:[c.jsx("div",{className:K("dot",{active:i===e,completed:i<e}),"data-testid":"progress-dot"}),c.jsx("div",{className:K("line",{active:i<e})})]},r)})})})]});const up=({elementId:e,offset:t=20})=>{const n=ie.useIntl(),r=()=>{const i=document.getElementById(e);if(!i)return;const a=document.getElementById("header");a&&window.scrollTo({top:i.offsetTop-a.clientHeight-t})};return c.jsx(Ae,{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 lp=({items:e,className:t="",...n})=>c.jsx("ul",{className:K("buckets",t),...n,children:e.map(({title:r,text:i,link:a,...s},o)=>c.jsx("li",{className:"bucket text-medium",children:c.jsxs("a",{href:a,...s,children:[c.jsx("p",{className:"title",children:r}),c.jsx("p",{children:i})]})},o))}),ku=300,Fu="ease-in-out";class cp{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:ku,easing:Fu}),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:ku,easing:Fu}),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 ma=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const i=ie.useIntl(),a=x.useRef(null);return x.useEffect(()=>{let s;return r&&(s=new cp(a.current)),()=>{r&&s&&s.cleanUp()}},[]),c.jsxs("details",{ref:a,className:K("collapsible-section",t,{"should-animate":r}),children:[c.jsx("summary",{children:e||i.formatMessage({id:"collapsibleSection_summary"})}),c.jsx("div",{className:"content",children:n})]})},Au={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},dp=e=>{let t=e;return Object.keys(Au).includes(e)&&(t=Au[e]),`url(${Gt}icons/${t}.svg)`};const Bu={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},Bd=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const i=ie.useIntl(),a=t?{"--custom-icon":dp(t)}:{},s=fa(`contentTypeLabel_${e}`)?i.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:c.jsx("small",{className:K("content-type-label text-small",e in Bu?Bu[e]:e,r,{"has-custom-icon":t}),style:a,"data-testid":"content-type-label",children:n||s})};const _t=({variant:e="primary",icon:t,styling:n={},className:r="",children:i,...a})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Gt}icons/${t}.svg)`}:{};return c.jsx("div",{className:K("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...a,children:i})};const Qt=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let i=n&&!!Object.keys(n).length;const a=typeof n=="object"&&"breakpoints"in n,s=wn(a);if(a&&typeof n=="object"&&typeof s=="number"){const f=Object.assign({},n.breakpoints),h=vd(Object.keys(f));i=bd(s,h,f)}const{breakpoints:o,text:l="",component:u,...d}=n;return c.jsx(_t,{variant:"subtle",className:K("empty-state-box",e,r),children:c.jsxs(c.Fragment,{children:[t&&typeof t=="string"?c.jsx(Zt,{options:{forceBlock:!0},children:t}):t,i&&typeof n=="object"&&(u||c.jsx(Ae,{...d,variant:n.variant?n.variant:"secondary",children:l}))]})})};const Os=({children:e,...t})=>c.jsx("p",{...t,children:e}),Td={q:Os,blockquote:Os};for(let e=1;e<=6;e++)Td[`h${e}`]={component:Os,props:{className:"title"}};const Sd=({type:e="default",className:t="",heading:n=!1,children:r,...i})=>c.jsxs("div",{...i,className:K("helper-text-box text-small",e,t),children:[n&&c.jsx("p",{className:"title",children:n}),typeof r=="string"?c.jsx(Zt,{options:{wrapper:x.Fragment,forceBlock:!0,overrides:Td},children:r}):c.jsx("p",{children:r})]});const jd=({id:e,className:t="",show:n=!1,hide:r=!1,text:i,markdownOptions:a,fadeStyle:s="default",children:o})=>{const l=ie.useIntl(),u=x.useRef(null);e||(e=Date.now().toString());const[d,f]=x.useState(""),[h,p]=x.useState("closed");x.useEffect(()=>{const b=u.current;if(b)return b.addEventListener("transitionend",v),()=>{b.removeEventListener("transitionend",v)}},[]),x.useEffect(()=>{if(!i||typeof i!="string")return;const b=i.split(`
36
36
  `);f(b.length<3?`${i.substring(0,400)}...`:b.slice(0,3).join(`
37
37
  `))},[i]),x.useEffect(()=>{h==="ready-to-close"&&p("closing")},[h]);const v=({propertyName:b})=>{b==="max-height"&&p(g=>g==="opening"?"open":g==="closing"?"closed":g)},m=["opening","open"].includes(h);return c.jsxs(_t,{variant:"subtle",className:K("hide-show-text-box",t),children:[c.jsx("div",{ref:u,id:e,className:K("content",h,s),children:i?c.jsxs(c.Fragment,{children:[c.jsx(Zt,{options:{forceBlock:!0,...a},children:h==="closed"?d:i}),h!=="closed"&&o]}):o}),c.jsx("p",{className:"cta",children:c.jsx(Ae,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:K({"rotate-180":m}),onClick:()=>{p(m?"ready-to-close":"opening")},"aria-expanded":m,"aria-controls":e,children:m?r||l.formatMessage({id:"hideShowTextBox_hide"}):n||l.formatMessage({id:"hideShowTextBox_show"})})})]})};const fp=({element:e="ul",layout:t="vertical",variant:n="default",items:r=[],styling:i={},className:a=""})=>{const{hasBorder:s=!1,zebraStriping:o=!1}=i;return x.createElement(e,{className:K("icon-bulleted-list text-medium",n,a,{"has-border":s,"has-zebra-stripes":o,[t]:e!=="dl"}),children:r.map((l,u)=>{const d={wrapper:x.Fragment,forceInline:!0},f={"--icon":`url(${Gt}icons/${l.icon}.svg)`};return e==="dl"?c.jsxs(x.Fragment,{children:[c.jsx("dt",{style:f,children:c.jsx(Zt,{options:d,children:l.dt||""})},`dt-${u}`),c.jsx("dd",{children:typeof l.text=="string"?c.jsx(Zt,{options:d,children:l.text}):l.text},`dd-${u}`)]},`dl-${u}`):c.jsx("li",{style:f,children:typeof l.text=="string"?c.jsx(Zt,{options:d,children:l.text}):l.text},u)})})},st=()=>x.Fragment,mp=({children:e})=>c.jsx(_t,{variant:"secondary",children:e}),hp=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?c.jsx("p",{className:"center",children:e}):c.jsx("div",{className:"center",children:e}),pp=["span","strong","h1","h2","h3","h4","h5","h6","p"],gp=({children:e})=>{const t=ie.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const a of x.Children.toArray(e))if(!(!a||typeof a=="string"||typeof a=="number"))if(x.isValidElement(a)&&a.type==="summary"){if(a.props&&a.props.children){for(const s of x.Children.toArray(a.props.children))if(!(!s||typeof s=="string"||typeof s=="number")&&x.isValidElement(s)){const o=s.type;if(pp.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(a);const i=n?n.toString():"";return c.jsx(ma,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:r.map(a=>a)})},vp=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return c.jsx(_t,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return c.jsx(_t,{variant:"primary",children:e});case"pink-textbox":return c.jsx(_t,{variant:"tertiary",children:e});case"content":return typeof e=="object"&&Object.keys(e||{}).length===1?c.jsx("p",{children:e}):e;default:return c.jsx("div",{...t,children:e})}return c.jsx("div",{...t,children:e})},St=({children:e})=>c.jsx(c.Fragment,{children:e}),go=x.createContext({badges:[],isLoading:!0});function Pd(){return x.useContext(go)}const Od=({children:e,badges:t})=>c.jsx(go.Provider,{value:t,children:e}),Md=({showDevTools:e=!0,children:t})=>{const n=new Re.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return c.jsxs(Re.QueryClientProvider,{client:n,children:[t,e&&c.jsx(Sh.ReactQueryDevtools,{initialIsOpen:!1})]})};var bp=x.createContext({client:Pi});function yp(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,a=x.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&&i&&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&&(Pi.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),Pi.init(r,i)),Pi)},[n,r]);return x.createElement(bp.Provider,{value:{client:a}},t)}const Nd=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?c.jsx(yp,{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}):c.jsx(c.Fragment,{children:e});var Id=(e=>(e.COMMUNITY_RANKING="community-ranking",e))(Id||{});const Rd=({children:e,locale:t,messages:n})=>{const r=t||"en",i={...Xh[r],...n||{}};return c.jsx(ie.IntlProvider,{locale:r,messages:i,children:e})},vo=x.createContext({}),Mi={en:"English",es:"Español",fr:"Français",pt:"Português"},it=x.createContext({isLoading:!0});function ha(){return x.useContext(it)}const $d=({children:e,user:t,updateDetails:n})=>c.jsx(it.Provider,{value:{...t,updateDetails:n},children:e}),bo=x.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),Ld=()=>x.useContext(bo),zd=({children:e})=>{const[t,n]=x.useState([]);x.useEffect(()=>{t.length>0?document.body.classList.add("has-overlay"):document.body.classList.remove("has-overlay")},[t]);const r=x.useCallback(a=>{n(s=>[...s,a])},[]),i=x.useCallback(a=>{n(s=>s.filter(o=>o!==a))},[]);return c.jsx(bo.Provider,{value:{registerOverlay:r,unregisterOverlay:i},children:e})},xp=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[i,a]=x.useState({isLoading:!0}),[s,o]=x.useState({badges:[],isLoading:!0}),l=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[u,d]=x.useState(l),f=h=>{localStorage.setItem("language",h),d(h)};return x.useEffect(()=>{e().then(h=>{Array.isArray(h)?(a({...h[0],isLoading:!1}),o({badges:h[1],isLoading:!1})):a({...h,isLoading:!1}),_d(5e3)}).catch(h=>{h.message===Cd&&window.location.pathname!=="/user-onboarding/logout"&&(window.location.href="/user-onboarding/logout"),a({isLoading:!1}),o({badges:[],isLoading:!1})})},[]),c.jsx(vo.Provider,{value:{language:u,updateLanguage:f},children:c.jsx(Rd,{locale:u,messages:n==null?void 0:n.messages,children:c.jsx(co.CookiesProvider,{children:c.jsx($d,{user:i,updateDetails:a,children:c.jsx(Od,{badges:s,children:c.jsx(zd,{children:c.jsx(Md,{showDevTools:r,children:c.jsx(Nd,{user:i,children:t})})})})})})})})},wp=e=>{const t=ie.useIntl(),n=Date.now().toString(),r=x.useContext(it);let i="default",a=e.src;a.includes("youtube")||a.includes("vimeo")?i="video":a.includes("riddle")||a.includes("sli.do")?i="poll":a.includes("padlet")?i="padlet":a.includes("surveysparrow")&&(i="survey",r!=null&&r.id&&(a=`${a}&user_id=${r.id}`));const s=`content-after-iframe-${n}`;return c.jsxs(c.Fragment,{children:[c.jsx(Me,{element:"a",href:`#${s}`,onClick:o=>{o.preventDefault(),o.stopPropagation();const l=document.getElementById(s);l==null||l.scrollIntoView({behavior:"smooth"}),l==null||l.focus()},children:t.formatMessage({id:`markdown_skip${i==="default"?"":`_${i}`}`})}),c.jsx("iframe",{...e,src:a,title:t.formatMessage({id:`markdown_iframe${i==="default"?"":`_${i}`}`})}),c.jsx("span",{id:s,tabIndex:0})]})},Tu=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},Cp=({children:e,...t})=>{const n=ie.useIntl();let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let i=e,a=!1;for(const o of x.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&x.isValidElement(o)){const l=o.type;if(["button","center","span","strong"].includes(l)&&o.props&&o.props.children&&o.props.children[0])for((l==="button"||Tu(o.props.children[0])==="button")&&(a=!0),i=o.props.children[0];i&&typeof i!="string"&&!(typeof i=="boolean"||typeof i=="number"||!x.isValidElement(i));)if(i.props&&i.props.children&&i.props.children[0])i=i.props.children[0],i&&Tu(i)==="button"&&(a=!0);else break}const s=`@${Vr}`;return i===s||Array.isArray(i)&&i[0]===s?(delete r.href,delete r.target,c.jsxs("span",{...r,className:"mention deleted-user",children:["@",n.formatMessage({id:"member_deleted"})]})):a?(r={...r,className:"button primary medium"},c.jsx("p",{className:"center",children:c.jsx(Ae,{variant:"primary",size:"medium",...r,children:i})})):c.jsx("a",{...r,children:i})},Ms=({children:e,...t})=>c.jsx("span",{className:K({url:t==null?void 0:t.href}),children:e});const Dp={default:{a:Cp,CollapsibleSection:ma,TextBox:_t,CaseStudy:mp,style:st,details:gp,div:vp,iframe:wp,center:hp,script:st},"text-only":{h1:st,h2:st,h3:st,h4:st,h5:st,h6:st,style:st,details:st,div:st,TextBox:st,CollapsibleSection:st,CaseStudy:st,blockquote:st,iframe:st,button:st}},On=({element:e="div",className:t="",options:n={},children:r,overrideType:i="default",styling:a={}})=>{if(!r)return null;const{highlightTitles:s=!1}=a;r=r.replace(/^<br\/?>/,"");const o={wrapper:x.Fragment,forceBlock:!0};let l=Dp[i];return n.overrides&&(l={...l,...n.overrides}),x.createElement(e,{className:K("markdown-text",t,{"highlight-titles":s}),children:c.jsx(Zt,{options:{...o,...n,overrides:l},children:r})})};const qd=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:i="",ctaButton:a})=>{const s=e?{"--max-width":`${e/16}rem`}:{};return c.jsxs("section",{className:K("page-heading",i),children:[c.jsxs("div",{className:K("content",{"has-max-width":e}),style:s,children:[c.jsxs("div",{className:K("content-wrapper",{"has-max-width":e}),children:[t&&t.text&&x.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&x.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),a&&c.jsx(Ae,{...a,className:K("cta-button","gtm-trackable"),"data-gtm-event-context":"CreateNewArticle","data-gtm-event-type":"create-article-click",children:a.text})]}),r]})};const Yt=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:i="",children:a,element:s="span",...o})=>{const l={"--icon":`url(${Gt}icons/${r}.svg)`},{showTooltip:u,tooltipProps:d}=mo(!!i),f={},h=i?typeof i=="string"?`tooltip-${window.btoa(i)}`:i.id:void 0,p=i?typeof i=="string"?i:i.text:void 0;i&&h&&(f["aria-describedby"]=h);const v=x.createElement(i?"button":s,{className:K("pill",e,t,n,{"has-icon":r}),style:l,children:a,...d,...f,...o});return i?x.createElement(s,{className:"pill-wrapper"},c.jsxs(c.Fragment,{children:[v,c.jsx(Ln,{id:h,isOpen:u,children:p})]})):v};const ur=({element:e="p",children:t=null,className:n="",...r})=>x.createElement(e,{...r,className:K("status-banner text-small",n),"aria-live":"assertive"},t),Ep={globe:"globe",heart:"heart_empty_thick",pencil:"pencil",star:"star_empty","speech-bubble":"speech-bubble_round"};const Ud=({slug:e})=>{const{badges:t}=Pd(),n=t==null?void 0:t.find(o=>o.slug===e);if(!n)return null;const{name:r,icon:i,colour:a,description:s}=n;return c.jsx(Yt,{className:K("user-badge",a==null?void 0:a.toLowerCase()),icon:i&&Ep[i],element:"li",tooltip:s,children:r})};var ut=(e=>(e.Communities="communities",e.Platform="platform",e))(ut||{});const Wd=({element:e="ul",userBadges:t,badgeOptions:n})=>{if(Object.keys(t).length!==0)return x.createElement(e,{className:"badges-list",children:(n==null?void 0:n.scopes)&&(n==null?void 0:n.scopes.map(r=>{var i,a;return(a=(i=t==null?void 0:t[r.scope])==null?void 0:i[r.area])==null?void 0:a.map((s,o)=>c.jsx(Ud,{slug:s},o))}))})};const _p=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const i=ie.useIntl(),{showText:a=!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,d={"--progress":`${t}%`};return c.jsx("span",{className:K(`progress-bar section-${u}`,s,r,{[o]:o!=="default",[l!=="default"?l:""]:l!=="default"}),style:d,children:x.createElement(a?"span":Me,{className:a?"text":"",children:n||i.formatMessage({id:"progressBar"},{number:t})})})},yo=x.memo(_p);const Pa="loadingBlock_",kp=({progress:e=0,steps:t=!1,className:n=""})=>{const r=ie.useIntl();t||(t={0:{text:r.formatMessage({id:`${Pa}loading`})},75:{text:r.formatMessage({id:`${Pa}almostDone`})},100:{text:r.formatMessage({id:`${Pa}complete`})}});let i=null;const a=Object.keys(t);for(let o=0;o<a.length&&!(e<parseInt(a[o]));o++)i=a[o];const s=i&&t[i].icon?{"--icon":`url(${Gt}icons/${t[i].icon}.svg)`}:{};return c.jsxs(_t,{className:K("loading-block",n,{"has-icon":i&&t[i].icon}),variant:"subtle",style:s,children:[i&&c.jsx("span",{className:"step",children:t[i].text}),c.jsx(yo,{progress:e})]})},Vd=x.memo(kp);const Nt=({element:e="div",className:t="",...n})=>c.jsx(da,{element:e,className:K("loading-placeholder",t),...n});const Ns={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"],member:["profile-picture","text","text"],"course-navigation":["button","button"],"course-lesson-page":["breadcrumb","course-navigation","text-page"],"course-lesson-quiz":["text-page","quiz-box"]},Hd=(e,t)=>e in Ns?c.jsx("div",{className:e,children:Ns[e].map((n,r)=>Hd(n,r))},t):c.jsx(Nt,{className:e},t),pa=({layout:e="overview-page",...t})=>c.jsx("div",{className:K("loading-state",e),...t,children:Ns[e].map((n,r)=>Hd(n,r))}),Kd=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):""},di=["#5AB6A3","#A2D7AF","#806056","#3962B3"],Fp=e=>{const t=Math.ceil(26/di.length),n=Kd(e).toLowerCase();if(n==="")return di[0];const r=n.charCodeAt(0)-96;for(let i=0;i<di.length;i++)if(r<=t*(i+1))return di[i]};const Su=256,un=({className:e="",src:t="",name:n,alt:r,width:i=Su,height:a=Su,showInitials:s=!0,...o})=>{const[l,u]=x.useState(!1),d=x.useRef(null),f=r??n;x.useEffect(()=>{const p=d.current;if(!p)return;const v=p.getContext("2d");if(!v)return;const m=i,b=a;typeof window<"u"&&window.devicePixelRatio&&(p.width=m*window.devicePixelRatio,p.height=b*window.devicePixelRatio,v.scale(window.devicePixelRatio,window.devicePixelRatio)),v.fillStyle=Fp(n),v.fillRect(0,0,m,b),v.font=`${m/3}px Arial`,v.textAlign="center",v.fillStyle="white",v.fillText(Kd(n),m/2,b/1.6)},[n]);let h=!1;return t&&t!==""&&!l&&(t.includes("http")||t.includes("//"))&&(h=!0),c.jsx("figure",{className:K("profile-picture",e,{error:l}),...o,children:h?c.jsx("img",{src:t,alt:f,onError:()=>{u(!0)},width:i,height:a}):s?c.jsx("canvas",{ref:d}):c.jsx("span",{className:"fallback"})})};var rt=(e=>(e.DISCUSSION_FORM_SUBMITTED="discussionFormSubmitted",e.DISCUSSION_POST_ADDED="discussionPostAdded",e.DISCUSSION_POST_CLICKED="discussionPostClicked",e.MEMBER_CLICKED="memberClicked",e))(rt||{});const ga=e=>e==="apolitical"?{image:`${Gt}logos/member_apolitical.svg`}:e==="community"||e==="deleted"||typeof e=="object"&&!e.name?{image:`${Gt}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.en||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail,badges:e.badges},Ap=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const i=e!=="",a=t!=="",s=n!=="";if(!i&&!a&&!s)return"";const o=`${e}${i&&a?` — ${t}`:t}`;let l=`${o}${(i||a)&&s?`, ${n}`:n}`;return l.length>r&&(l=o),l.length>r&&(l=sr(l,r)),l};const Bp=x.lazy(()=>Promise.resolve().then(()=>sp)),Tp=x.lazy(()=>Promise.resolve().then(()=>bk));let fi=null;const an=({element:e="div",member:t="community",alt:n="",additionalContent:r=!1,styling:i={},functions:a={},gtmContext:s="member",gtmType:o="member-click",className:l="",badges:u,...d})=>{var S,I,H,V,ae;const f=ie.useIntl(),{profile:h,...p}=a,{size:v="medium",variant:m="inline",isCondensed:b=!0,additionalContentNewLine:g=!1}=i,y=x.useContext(it),C=h&&y&&typeof y.id=="string",[k,E]=x.useState(!1),_=ga(t);_.name||(_.name=f.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:T,image:L}=_;let{url:P}=_;typeof t=="object"&&t.link!==void 0&&(t.link===!1?P=void 0:P=t.link);const z=Ap(_),M=r&&r.createdAt?js(r.createdAt):!1,A=r&&r.createdAt?ho(r.createdAt):"",F=!P&&C;return x.createElement(e,{...d,className:K("member text-medium",v,m,l,{"has-profile-link":C}),...p,children:c.jsxs(c.Fragment,{children:[c.jsxs(Dn,{href:P,className:K({"details-wrapper":F}),fallbackElement:F?"div":void 0,gtmType:o,gtmContext:s,meta:{forceOnClick:!0},onClick:X=>{if(X==null||X.preventDefault(),X==null||X.stopPropagation(),!P){F&&E(!0);return}fi&&clearTimeout(fi),fi=setTimeout(()=>{window.location.href=P},150);const D=new CustomEvent(rt.MEMBER_CLICKED,{detail:{link:P,timeout:fi}});document.dispatchEvent(D)},children:[c.jsx(un,{name:T,src:L,alt:n}),c.jsxs("div",{className:"details",children:[c.jsxs("div",{className:K("name",{"new-line":g}),"data-testid":"member-name",children:[c.jsx("span",{children:T}),(u==null?void 0:u.showBadges)&&(_==null?void 0:_.badges)&&c.jsx(Wd,{userBadges:_.badges,badgeOptions:u}),r&&c.jsxs("span",{className:K("additional-content",{"new-line":g}),children:[r.createdAt&&M&&!((S=r==null?void 0:r.customMessage)!=null&&S.text)&&c.jsx("span",{className:"date",title:A,"aria-label":A,"data-testid":"date",children:f.formatMessage({id:`dates_${M.path}`},{number:M.number})}),r.createdAt&&M&&((I=r==null?void 0:r.customMessage)==null?void 0:I.text)&&c.jsx("span",{children:f.formatMessage({id:(H=r.customMessage)==null?void 0:H.text},{time:f.formatMessage({id:`dates_${M.path}`},{number:M.number}),community:(ae=(V=r.customMessage)==null?void 0:V.link)==null?void 0:ae.text,link:X=>{var D,Q;return c.jsx("a",{href:`${(Q=(D=r.customMessage)==null?void 0:D.link)==null?void 0:Q.url}`,onClick:q=>q.stopPropagation(),children:X})}})}),r.didEdit&&c.jsx("em",{children:f.formatMessage({id:"discussion_edited"})})]})]}),z&&!g&&c.jsx("small",{className:K({"text-medium":v==="large"}),"data-testid":"member-details",children:b?z:c.jsxs(c.Fragment,{children:[_.role,_.organisation?` — ${_.organisation}`:c.jsx(c.Fragment,{}),c.jsx("span",{className:"location",children:_.country})]})})]})]}),z&&h&&C?c.jsxs(c.Fragment,{children:[c.jsx(Ae,{variant:"tertiary",size:"small",onClick:X=>{X.preventDefault(),X.stopPropagation(),E(!0)},"data-testid":"profile-button",children:f.formatMessage({id:"member_profile"})}),c.jsx(Bp,{children:c.jsx(Tp,{form:h,showModal:k,content:{title:f.formatMessage({id:"member_profile"})},functions:{onClose:()=>{E(!1)}},className:"in-portal"})})]}):c.jsx(c.Fragment,{})]})})},Sp=Object.freeze(Object.defineProperty({__proto__:null,default:an},Symbol.toStringTag,{value:"Module"}));const ju={small:24,medium:48},xo=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:i,showGap:a,showPlaceholders:s}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,multipleText:l,className:u="",...d})=>{const f=ie.useIntl();return!n||n.length===0?null:x.createElement(e,{...d,className:K("contributors",u,i,{"has-gap":a}),children:c.jsxs(c.Fragment,{children:[c.jsx("ul",{children:n.map((h,p)=>{let v,m="";if(p<o){const{name:b="",image:g=""}=ga(h);if(s)return c.jsx(Nt,{element:"li",className:"contributor"},p);v=c.jsx(un,{name:b,src:g,width:ju[i||"medium"],height:ju[i||"medium"]})}else if(p===o){const b=(t||n.length)-o;v=c.jsxs("small",{className:K({"large-number":b>99}),children:["+",ep(b,0)]}),m="number-left"}return v?c.jsx("li",{className:K("contributor",m),children:v},p):null})}),r&&c.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?f.formatMessage({id:`member_${n[0]}`}):sr(n[0].name||"",20):l||null})]})})};const wo=({element:e="section",children:t,className:n,variant:r,additionalContent:i,...a})=>{let s=typeof t=="string"?c.jsx("p",{children:t}):t;return i&&(s=c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"modal-content",children:typeof t=="string"?c.jsx("p",{children:t}):t}),c.jsx("div",{className:"modal-additional-content",children:typeof i=="string"?c.jsx("p",{children:i}):i})]})),x.createElement(e,{className:K("modal",n,{"success-section":r==="success"}),children:s,...a})};var Is={exports:{}},mi={exports:{}},$e={};/** @license React v16.13.1
38
38
  * react-is.production.min.js
@@ -162,4 +162,4 @@ ${p}${f?"1.":"-"} ${u}${h?`
162
162
 
163
163
  `.substring(0,i);return n+a+r}function i_(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}var a_={isHistory(e){return ot(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||vn.isOperationList(e.redos[0].operations))&&(e.undos.length===0||vn.isOperationList(e.undos[0].operations))}},vs=new WeakMap,bs=new WeakMap,nr={isHistoryEditor(e){return a_.isHistory(e.history)&&w.isEditor(e)},isMerging(e){return bs.get(e)},isSaving(e){return vs.get(e)},redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=nr.isMerging(e);bs.set(e,!1),t(),bs.set(e,n)},withoutSaving(e,t){var n=nr.isSaving(e);vs.set(e,!1),t(),vs.set(e,n)}},s_=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:r}=t,{redos:i}=r;if(i.length>0){var a=i[i.length-1];a.selectionBefore&&te.setSelection(t,a.selectionBefore),nr.withoutSaving(t,()=>{w.withoutNormalizing(t,()=>{for(var s of a.operations)t.apply(s)})}),r.redos.pop(),t.writeHistory("undos",a)}},t.undo=()=>{var{history:r}=t,{undos:i}=r;if(i.length>0){var a=i[i.length-1];nr.withoutSaving(t,()=>{w.withoutNormalizing(t,()=>{var s=a.operations.map(vn.inverse).reverse();for(var o of s)t.apply(o);a.selectionBefore&&te.setSelection(t,a.selectionBefore)})}),t.writeHistory("redos",a),r.undos.pop()}},t.apply=r=>{var{operations:i,history:a}=t,{undos:s}=a,o=s[s.length-1],l=o&&o.operations[o.operations.length-1],u=nr.isSaving(t),d=nr.isMerging(t);if(u==null&&(u=u_(r)),u){if(d==null&&(o==null?d=!1:i.length!==0?d=!0:d=o_(r,l)),o&&d)o.operations.push(r);else{var f={operations:[r],selectionBefore:t.selection};t.writeHistory("undos",f)}for(;s.length>100;)s.shift();a.redos=[]}n(r)},t.writeHistory=(r,i)=>{t.history[r].push(i)},t},o_=(e,t)=>!!(t&&e.type==="insert_text"&&t.type==="insert_text"&&e.offset===t.offset+t.text.length&&$.equals(e.path,t.path)||t&&e.type==="remove_text"&&t.type==="remove_text"&&e.offset+e.text.length===t.offset&&$.equals(e.path,t.path)),u_=(e,t)=>e.type!=="set_selection";const l_=(e,t)=>{const{apply:n}=e;try{e.apply=r=>{if(r.type==="remove_node"&&"type"in r.node&&r.node.type===Z.link){const i=r.node;if(i.link){const a=new CustomEvent("linkRemoved",{detail:{url:i.link}});window.dispatchEvent(a)}}n(r)}}catch(r){const i=r.message;t(`Error in withLinkRemovalListener: ${i}`)}return e};var c_=h_,d_=/^(?:\w+:)?\/\/(\S+)$/,f_=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,m_=/^[^\s\.]+\.\S{2,}$/;function h_(e){if(typeof e!="string")return!1;var t=e.match(d_);if(!t)return!1;var n=t[1];return n?!!(f_.test(n)||m_.test(n)):!1}const p_=$n(c_),g_=(e,t,n)=>{const{insertText:r,isInline:i}=e;try{e.isInline=a=>{const s=a;return[Z.link].includes(s.type)||i(a)},e.insertText=a=>{a&&p_(a)?su(e,a,t):r(a)}}catch(a){const s=a.message;n(`Error in withInlines: ${s}`)}return e},v_=(e,t)=>{const{isInline:n,isVoid:r,markableVoid:i}=e;try{e.isInline=a=>a.type===Z.mention?!0:n(a),e.isVoid=a=>a.type===Z.mention?!0:r(a),e.markableVoid=a=>a.type===Z.mention||i(a)}catch(a){const s=a.message;t(`Error in withMentions: ${s}`)}return e},b_=(e,t)=>{const{normalizeNode:n}=e;try{e.normalizeNode=([r,i])=>{if(r.type===Z.link&&le.string(r).trim()===""){te.removeNodes(e,{at:i});return}n([r,i])}}catch(r){const i=r.message;t(`Error in withoutEmptyLinks: ${i}`)}return e};const cu=({id:e="rich-text-editor",value:t,placeholder:n,maxLength:r=0,meta:i,functions:a,autoFocus:s,data:o,styling:l,...u})=>{const d=ie.useIntl(),f=Yh();typeof s>"u"&&(s=!0);const{isInOverlay:h=!1}=i||{},{listMembers:p,clickMentionFallback:v,onChange:m=()=>{},onChangeData:b=()=>{},getLinkPreview:g=()=>Promise.resolve({}),onMention:y=()=>{},reportError:C=N=>{console.error(N)}}=a||{},k=[{type:Z.paragraph,children:[{text:""}]}];t==="<br>"&&(t="");const E={editorKey:null,originalValue:t||"",initialValue:t?null:k,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,stringValue:"",lastKey:null,hasInteracted:!1,hasLoaded:!1,enrichedUrl:!1},[_,T]=x.useReducer(pr,E),{editorKey:L,originalValue:P,initialValue:z,stringValue:M,lastAnchor:A,lastKey:F,hasInteracted:S,hasLoaded:I,enrichedUrl:H,mentionPopover:V}=_,ae=async N=>{const O=await g(N);O.url&&T([{type:"enrichedUrl",value:O}])},X=`rte-${e}`,D=x.useCallback(N=>c.jsx(Jv,{...N}),[]),Q=x.useCallback(N=>c.jsx(Xv,{...N}),[]),q=x.useMemo(()=>l_(g_(v_(b_(s_($w(qx())),C),C),X,C),C),[]),B=N=>{if(!q||N!==X)return;const O=w.end(q,[]);te.select(q,O),re.focus(q)};x.useEffect(()=>{const N=O=>{var W;const U=O,ee=((W=U==null?void 0:U.detail)==null?void 0:W.id)||null;ee&&B(ee)};return window.addEventListener("focusEditor",N),()=>{window.removeEventListener("focusEditor",N)}},[]),x.useEffect(()=>{if(q.children.length>0&&!I){if(T([{type:"hasLoaded",value:!0}]),!s)return;B(X)}},[q.children.length,z]),x.useEffect(()=>{P&&(async()=>{let O=Pt(P);if(O.includes("<")){ni.prototype.escape=ee=>ee;const U=new ni;U.addRule("br",{filter:["br"],replacement:ee=>ee+`
164
164
 
165
- `}),O=U.turndown(O)}o&&o.mentions&&(O=await kd({text:O,template:`[${to}{{name}}]({{id}})`,mentions:o.mentions,listMembers:p||(()=>Promise.resolve([]))})),pE(O,U=>{const ee=[{type:"initialValue",value:U},{type:"editorKey",value:P.toString()}];o!=null&&o.link&&(ee.push({type:"enrichedUrl",value:o.link}),o.link.url&&ae(o.link.url)),T(ee),setTimeout(()=>{T([{type:"stringValue",value:Kc(q)}])},150)})})()},[P]),x.useEffect(()=>{if(H===void 0&&q){const O=bE(q);O&&ae(O)}const N=O=>{var W;const U=O,ee=((W=U==null?void 0:U.detail)==null?void 0:W.url)||null;ee&&H&&H.url===ee&&T([{type:"enrichedUrl",value:void 0}])};return window.addEventListener("linkRemoved",N),()=>{window.removeEventListener("linkRemoved",N)}},[H]),x.useEffect(()=>{if(t){Hr.lastIndex=0;const N=t.match(Hr);N&&N.length===1&&N[0].length===t.length&&!S&&T([{type:"originalValue",value:t}])}t!==""||!q||Wi(P,t)&&!S||(w.withoutNormalizing(q,()=>{te.delete(q,{at:{anchor:w.start(q,[]),focus:w.end(q,[])}}),te.deselect(q),q.children.length!==0&&te.unwrapNodes(q,{at:[0]}),te.insertNodes(q,k,{at:[0]})}),T([{type:"initialValue",value:k},{type:"lastAnchor",value:null},{type:"enrichedUrl",value:!1}]))},[t]),x.useEffect(()=>{b({link:H})},[H]),x.useEffect(()=>{M===""&&H&&T([{type:"enrichedUrl",value:void 0}])},[M]);const j=Wr(()=>{xE({editor:q,isShowing:V.show,numberOfUsers:V.numberOfUsers,listMembers:p,dispatch:T})},100);return z?c.jsx("div",{id:X,className:"rich-text-editor input text-medium",children:c.jsxs(cn.Provider,{value:{..._,id:X,isInOverlay:h,dispatch:T,onMention:y,reportError:C},children:[c.jsxs(Iw,{editor:q,initialValue:z,onChange:N=>{if(q.operations.some(U=>U.type!=="set_selection")){let U=CE(N);U==="<br>"&&(U=""),m(U,H),T([{type:"stringValue",value:Kc(q)}]),S||T([{type:"hasInteracted",value:!0}]),j(),f&&console.log({serialized:U,json:N})}},...u,children:[c.jsx(Aw,{className:"editor",renderElement:D,renderLeaf:Q,placeholder:n||d.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onPaste:async N=>{const O=H!==!1,U=N.clipboardData.getData("text");if((W=>{try{return new URL(W),!0}catch{return!1}})(U)){let W=U;if(U){const{full:ne}=po(U);W=ne}if(U&&g&&!O){const ne=await g(W);ne.url&&T([{type:"enrichedUrl",value:ne}])}}},onKeyDown:N=>{if(N.key==="Enter"){V.show&&(N.preventDefault(),N.stopPropagation(),zm(q,V,T,X));const{selection:O}=q;if(O){const U=G.isCollapsed(O),[ee,W]=w.node(q,O,{depth:1});let ne=ee,de=ne.type;const J=ne.children[0];if(J&&(J==null?void 0:J[Z.h3])===!0&&(N.stopPropagation(),N.preventDefault(),te.insertNodes(q,k)),J&&[Z.ol,Z.ul].includes(J.type)&&(ne=J,de=J.type),ne&&he.isElement(ne)&&de!==Z.paragraph){if(de===Z.blockquote&&!N.shiftKey){N.stopPropagation(),N.preventDefault(),te.insertNodes(q,k);return}if(U){const[ve,me]=w.parent(q,O,{edge:"end"}),Ee=ve.type;if([Z.ul,Z.ol].includes(de))if(N.stopPropagation(),N.preventDefault(),Ee===Z.li&&F==="Enter"){ve.children.length===1&&"text"in ve.children[0]&&ve.children[0].text===""&&te.removeNodes(q,{at:me}),te.insertNodes(q,k,{at:$.next(W)}),te.select(q,w.end(q,$.next(W)));return}else{const[Ce,ze]=gE(q,Z.li),We={type:Z.li,children:[{text:""}]};te.insertNodes(q,We,{at:$.next(ze)}),te.select(q,w.end(q,$.next(ze)))}}}}}else if(N.key==="Escape"){if(V.show){N.preventDefault(),N.stopPropagation(),T([{type:"mentionPopover",value:{...V,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(N.key)&&V.show){N.preventDefault(),N.stopPropagation();const{selectedUser:O,possibleUsers:U}=V;let ee=N.key==="ArrowUp"?O-1:O+1;ee<0&&(ee=U.length-1),ee>=U.length+1&&(ee=0),T([{type:"mentionPopover",value:{...V,selectedUser:ee}}])}T([{type:"lastKey",value:N.key}]),yE(N,q,T,C)},onBlur:()=>{q.selection&&T([{type:"lastAnchor",value:q.selection.anchor}])},onFocus:()=>{if(A){if(!$.isPath(A.path)||!le.has(q,A.path))return;const N=le.get(q,A.path);let O=0;if(ge.isText(N)?O=N.text.length:N.children&&(O=N.children.length),A.offset>O)return;try{te.select(q,{anchor:A,focus:A})}catch(U){const ee=U.message;C(`Error focusing editor: ${ee}`)}}}}),H?c.jsx(Oo,{data:H,variant:"condensed",onClick:()=>{T([{type:"enrichedUrl",value:!1}]);const N=new CustomEvent("ariaLive",{detail:{message:d.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_live"})}});document.dispatchEvent(N)},"aria-label":d.formatMessage({id:"richTextEditor_link_enrichedUrl_aria"},{title:H.title||d.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_fallback"})})}):c.jsx(c.Fragment,{}),c.jsx(PE,{styling:l==null?void 0:l.toolbar}),p?c.jsx(DE,{onFallbackClick:v}):c.jsx(c.Fragment,{})]},L),c.jsx(No,{id:`character-limit-${e}`,limit:r,valueLength:va(M)})]})}):c.jsx(c.Fragment,{})};const y_=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:a=!1,className:s=""})=>{const[o,l]=x.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);x.useEffect(()=>{r&&l(r)},[r]);const u=d=>{a||(l(d),i(d))};return c.jsxs("div",{className:K("toggle",s),onClick:d=>{d.preventDefault(),d.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[c.jsx("p",{children:t}),c.jsx("ul",{className:K("toggle-options",{disabled:a,on:o===n[1].value}),children:n.map(d=>{const f=`${e}-${d.value}`;return c.jsxs("li",{className:"hidden",children:[c.jsx("input",{type:"radio",id:f,name:e,value:d.value,checked:o===d.value,onChange:()=>u(d.value),disabled:a}),c.jsx("label",{htmlFor:f,children:d.label})]},f)})})]})};function nh({className:e="",userId:t,userName:n,src:r,uploadImage:i,button:a,callback:s}){const o=ie.useIntl(),l="profileImageChange_",[u,d]=x.useState(r),[f,h]=x.useState(!1),[p,v]=x.useState(!1),m=x.useRef(null),b=async k=>{h(!0),v(!1);try{const E=k.target.files&&k.target.files[0];if(!E||!t)throw h(!1),new Error("Image file or userID is missing");const _=await i({fileObject:E,userId:t}),T={thumbnail:_.thumbnailURL,full:_.originalURL};d(T),s(T)}catch{v(!0)}finally{h(!1)}h(!1)},{upload:g=o.formatMessage({id:`${l}cta_upload`}),change:y=o.formatMessage({id:`${l}cta_change`}),uploading:C=o.formatMessage({id:`${l}cta_uploading`})}=(a==null?void 0:a.text)||{};return c.jsxs("div",{className:K("profile-image-change-figure",e),children:[c.jsx(un,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),p&&c.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),c.jsx("input",{id:"file",type:"file",accept:"image/*",ref:m,onChange:b,hidden:!0,"data-testid":"file-input"}),c.jsx(Ae,{onClick:()=>m.current&&m.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:f,children:f?C:u?y:g})]})}const rh=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=e||{};return c.jsx(Xt,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}],autoComplete:"name"},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:i},functions:{onSuccess:t,onFailure:n},button:{className:"new"}})};const x_=({emails:e,setEmails:t,setIsDisabled:n})=>{const{formatMessage:r}=ie.useIntl();return c.jsx(Ph.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:r({id:"inviteForm_email_placeholder"}),emails:e,onChange:i=>{t(i),n(!i.length)},autoFocus:!1,getLabel:(i,a,s)=>c.jsxs("div",{className:"email text-medium",children:[c.jsx("div",{"data-tag-item":!0,children:i}),c.jsx(Ae,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{s(a),n(!e.length)},className:"remove-email-button",screenreaderText:r({id:"overlay_close"})})]},a)})},ih=({title:e,label:t,messagePlaceholder:n,ctaMessage:r,titleColor:i,labelColor:a,backgroundColor:s,onClose:o,reportError:l,sendInvites:u,initialFormStatus:d="NOT_SUBMITTED",gtm:f={context:"Form",event:"form-submit-click"},secondaryActionButton:h,meta:p})=>{const[v,m]=x.useState([]),[b,g]=x.useState(!0),[y,C]=x.useState(d),{formatMessage:k}=ie.useIntl(),E=async L=>{try{await u(v,L.message),m([]),C("SUCCESS")}catch(P){C("ERROR"),l(P)}},_=L=>{L.preventDefault(),C("NOT_SUBMITTED"),g(!0),m([])},T=L=>{L.preventDefault(),o(),C("CLOSED")};return y==="CLOSED"?null:y==="ERROR"||y==="SUCCESS"&&!(p!=null&&p.shouldHideDoneButtonOnSubmit)?c.jsxs("div",{className:"invite-form-wrapper",children:[c.jsx("div",{className:"content centred",children:y==="SUCCESS"?c.jsx("h2",{className:"success-title",children:k({id:"inviteForm_success"})}):c.jsxs("h2",{className:"error-title",children:[" ",k({id:"inviteForm_error"})]})}),c.jsx(zt,{}),c.jsx("div",{className:"footer",children:y==="SUCCESS"?c.jsxs(c.Fragment,{children:[c.jsx(Ae,{variant:"secondary",onClick:_,children:k({id:"inviteForm_ctaSendMoreInvites"})}),c.jsx(Ae,{onClick:T,children:k({id:"inviteForm_ctaDone"})})]}):c.jsx(Ae,{onClick:_,children:k({id:"inviteForm_ctaTryAgain"})})})]}):c.jsxs("div",{className:"invite-form-wrapper",style:{backgroundColor:s},children:[c.jsxs("div",{className:"content",children:[c.jsx("h2",{className:"title",style:{color:i},children:e}),c.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t})]}),c.jsx(Xt,{id:"invite-form",fields:[{component:x_,props:{emails:v,setEmails:m,setIsDisabled:g},required:!0},{id:"message",type:"textarea",label:k({id:"inviteForm_message_label"}),placeholder:n||k({id:"inviteForm_message_placeholder"})}],functions:{onSuccess:E},button:{text:r,size:"medium",disabled:b},gtm:f,meta:p,secondaryActionButton:h})]})},Ui=e=>e.map(t=>({condition:t})),Tt={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},w_=({functions:e,...t})=>{const{formatMessage:n}=ie.useIntl(),[r,i]=x.useState(null),[a,s]=x.useState(!1),[o,l]=x.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=p=>p[Tt.NEW_PASSWORD]!==p[Tt.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,d=p=>!Ps(p[Tt.NEW_PASSWORD]).isValid,f=[{"data-testid":Tt.NEW_PASSWORD,id:Tt.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:Ui(["required",d]),functions:{onChange:p=>l(Ps(p).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":Tt.CONFIRMED_PASSWORD,id:Tt.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:Ui(["required",u])}];t.isPasswordChange&&f.unshift({"data-testid":Tt.CURRENT_PASSWORD,id:Tt.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:Ui(["required"])}),a&&f.push({component:jf,props:{matchingRules:o}});const h={id:Tt.FORM_ID,fields:f,functions:{...e,onSuccess:async p=>(e.createPassword(p),e.onSuccess&&e.onSuccess(p)),onCatch:p=>i(p==null?void 0:p.statusCode),onFailure:(p,v)=>{(v.includes(Tt.NEW_PASSWORD)||v.includes(Tt.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return c.jsxs(c.Fragment,{children:[c.jsx(Xt,{...h}),r&&c.jsx(Qt,{variant:"error",text:r})]})};const ah=({isCreateProfile:e=!1,hooks:t,functions:n,meta:r={},gtm:i,...a})=>{var L;const s=ie.useIntl(),o="profileForm_",l=x.useContext(it),[u,d]=x.useState(l.image),[f,h]=x.useState(!1),{uploadImage:p=()=>{},onSuccess:v=async P=>{},onCancel:m=()=>{},onFailure:b=()=>{}}=n,{buildLocation:g,isValidPlace:y,predictPlaces:C}=t.useMaps(),{context:k="ProfileForm",event:E="profile-form-submit-click"}=i||{},_=[{id:"jobTitle",type:"text",label:s.formatMessage({id:`${o}jobTitle`}),placeholder:s.formatMessage({id:`${o}jobTitle_placeholder`}),value:l.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:s.formatMessage({id:`${o}organization`}),placeholder:s.formatMessage({id:`${o}organization_placeholder`}),value:l.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:s.formatMessage({id:`${o}location`}),placeholder:s.formatMessage({id:`${o}location_placeholder`}),value:(L=l.location)==null?void 0:L.en,validation:[{condition:"required"},{condition:({location:P})=>P&&!f?!1:!y(P),error:s.formatMessage({id:`${o}location_error`})}],functions:{onChange:()=>{f||h(!0)},onKeyInput:C}}],T=[{component:nh,props:{userName:l.name,userId:l.id,src:u,uploadImage:p,callback:d,button:{text:{upload:s.formatMessage({id:`${o}image`})}}}},{id:"name",type:"text",label:s.formatMessage({id:`${o}name`}),placeholder:s.formatMessage({id:`${o}name_placeholder`}),value:l.name,autoComplete:"name",validation:[{condition:"required"}]},..._,{id:"biography",type:"textarea",label:s.formatMessage({id:`${o}bio`}),placeholder:s.formatMessage({id:`${o}bio_placeholder`}),limit:1e3,value:l.biography},{component:zt}];return c.jsx(Xt,{id:"profile-details-form",fields:e?_:T,meta:{shouldShowCancelButton:!e,shouldReset:!1,shouldHide:!1,showRequiredLabels:e,...r},intlPath:o,gtm:{context:k,event:E},functions:{onSuccess:async P=>{try{const z={...P,image:u||null,location:f?await g(P==null?void 0:P.location):l.location,...e?{onboardingState:"completed"}:{}};l.updateDetails&&l.updateDetails(M=>({...M,...z})),await v(z)}catch{b()}},onCancel:m,onFailure:b},button:{size:"large",text:{default:s.formatMessage({id:`${o}cta`}),submitting:s.formatMessage({id:`${o}cta_submitting`}),submitted:s.formatMessage({id:`${o}cta_submitted`})}},...a})},C_=()=>{const e=ie.useIntl(),[t,n]=x.useState(0);return x.useEffect(()=>{const r=setInterval(()=>{n(i=>{if(i>=95)return clearInterval(r),95;const a=Math.round(Math.random()*10);return Math.min(i+a,95)})},800);return()=>{clearInterval(r)}},[]),c.jsx(Vd,{progress:t,steps:{0:{icon:"layers",text:e.formatMessage({id:"publishArticleForm_progressBar"})}}})};function D_({coverImage:e,setShowImagePicker:t}){return e&&e.url?c.jsx(Qt,{className:"cover-image-preview",text:c.jsx(Cn,{className:"cover-image",image:{description:e.description||"",height:e.height,width:e.width,url:e.url,color:e.color,type:"image/jpeg"}}),button:{component:c.jsx(Ae,{variant:"tertiary",onClick:()=>t(!0),children:c.jsx(ie.FormattedMessage,{id:"publishArticleForm_replaceImage_button"})})}}):c.jsx(Qt,{button:{component:c.jsx(Ae,{variant:"secondary",onClick:()=>t(!0),children:c.jsx(ie.FormattedMessage,{id:"publishArticleForm_selectImage_button"})})}})}var sh=(e=>(e.CitiesAndLocalGovernment="topic_CitiesAndLocalGovernment",e.Climate="topic_Climate",e.DigitalAndData="topic_DigitalAndData",e.Education="topic_Education",e.EquityJusticeAndInclusion="topic_EquityJusticeAndInclusion",e.HealthAndSocialCare="topic_HealthAndSocialCare",e.Innovation="topic_Innovation",e.LeadershipAndSkills="topic_LeadershipAndSkills",e.LifeInGovernment="topic_LifeInGovernment",e.Policymaking="topic_Policymaking",e.TransportAndInfrastructure="topic_TransportAndInfrastructure",e.WorkingAndTheEconomy="topic_WorkAndTheEconomy",e))(sh||{});let ys=null;const et="publishArticleForm_",td={},nd=10,E_=({id:e="publish-article-form",values:t=td,setShowImagePicker:n,functions:r,meta:i,gtm:a})=>{var P;const s=ie.useIntl(),o=x.useContext(it),{create:l,onSuccess:u=()=>{},onFailure:d=()=>{}}=r||{},{isInOverlay:f=!1}=i||{},[h,p]=x.useState(!1),[v,m]=x.useState(t.body||""),[b,g]=x.useState(!1),[y,C]=x.useState("");x.useEffect(()=>{Wi(t,td)||Kr(t.body)&&t.body!==v&&t.body!==void 0&&m(t.body)},[t.body]);const k=()=>{!o||!o.id?g(s.formatMessage({id:`${et}error_loggedOut`})):b&&g(!1)},E=z=>({condition:M=>{const A=M[z];return!A||typeof A!="string"?!0:A.length<nd},error:s.formatMessage({id:`${et}error_underMinLength`},{length:nd})}),_=!!v&&Kr(v),T=()=>c.jsxs(c.Fragment,{children:[c.jsx(zt,{}),c.jsx("p",{className:"text-medium",children:s.formatMessage({id:`${et}disclaimer`})})]}),L=[{id:"title",type:"textarea",value:t.title||"",limit:65,label:s.formatMessage({id:`${et}title_label`}),placeholder:s.formatMessage({id:`${et}title_placeholder`}),styling:{autosizeToFit:!0},functions:{onChange:k},validation:[{condition:"required"},E("title")]},{id:"subtitle",type:"textarea",value:t.subtitle,limit:115,label:s.formatMessage({id:`${et}subtitle_label`}),styling:{autosizeToFit:!0},placeholder:s.formatMessage({id:`${et}subtitle_placeholder`}),functions:{onChange:k},validation:[{condition:"required"},E("subtitle")]},{component:aa,props:{formID:e,label:{visible:s.formatMessage({id:`${et}body_label`})},showLabel:!0}},{component:cu,props:{id:`${e}-input`,value:v,placeholder:s.formatMessage({id:`${et}body_placeholder`}),meta:{isInOverlay:f},autoFocus:!1,functions:{onChange:z=>{m(z),k()}},styling:{toolbar:{showHeadingOption:!0}},"aria-invalid":!!b,"aria-errormessage":"error-message"}},{id:"tags",label:s.formatMessage({id:`${et}tags_label`}),type:"checkboxes",styling:{displayOptionsAsPills:!0},options:Object.values(sh).map(z=>({id:z,label:s.formatMessage({id:`${et}_tags_${z}`})})),multipleOptions:{limit:3},validation:[{condition:"required",error:s.formatMessage({id:`${et}tags_error_required`})},{condition:z=>{var M;return((M=z==null?void 0:z.tags)==null?void 0:M.length)>3},error:s.formatMessage({id:`${et}tags_error_over_three`})}]},{component:aa,props:{formID:e,label:{visible:s.formatMessage({id:`${et}cover_image_label`})},showLabel:!0}},{component:D_,props:{coverImage:t.coverImage||{},setShowImagePicker:n}}];return h?L.push({component:zt}):L.push({component:T}),c.jsxs("section",{className:"publish-article-form",children:[c.jsx(Xt,{id:e,meta:{shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,shouldScrollOnSuccess:!1},functions:{onSuccess:async z=>{if(!o||!o.id||!_)return;ys&&clearTimeout(ys),p(!0);const M={...z,body:v,coverImage:t.coverImage};try{l&&await l(M),ys=setTimeout(()=>{C(s.formatMessage({id:`${et}aria_success`})),u(M)},500)}catch{g(s.formatMessage({id:`${et}error`})),C(""),d()}},onFailure:d},fields:L,intlPath:et,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":a==null?void 0:a.context,"data-gtm-event-type":"publish-article-click",disabled:!o||!o.id||!_||!((P=t==null?void 0:t.coverImage)!=null&&P.url),text:{default:s.formatMessage({id:`${et}cta_submit`}),submitting:s.formatMessage({id:`${et}cta_submitting`}),submitted:s.formatMessage({id:`${et}cta_submitted`})},customOnSubmit:b?c.jsx(c.Fragment,{}):c.jsx(C_,{})},gtm:a}),b&&c.jsx(ur,{id:"error-message",className:"error",children:typeof b=="string"&&b.includes(" ")?b:s.formatMessage({id:`${et}error`})}),y&&c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:y})]})};const oh=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:a="form-submission"})=>{const{searchIsOpen:s=!0,isDesktopVersion:o=!1}=n||{},l=ie.useIntl(),u=x.useRef(null);or(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const d=f=>{f.preventDefault(),f.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return c.jsx("form",{onSubmit:d,className:K("search-form gtm-trackable",t),role:"search","data-gtm-event-context":i,"data-gtm-event-type":a,children:c.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:c.jsxs("p",{children:[c.jsx(Me,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),c.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:f=>{f.key==="Enter"&&d(f)}}),c.jsx("button",{className:"clear",onClick:f=>{f.preventDefault(),f.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:c.jsx(Me,{children:l.formatMessage({id:"search_clear"})})}),c.jsx("button",{className:"search",onClick:d,children:c.jsx(Me,{children:l.formatMessage({id:"search_cta"})})})]})})})},rd=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const i=e.current.value.toString().toLowerCase().trim(),a={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let s=Object.assign({},a);try{s=await t(i),s===void 0&&(s=a)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:o=!1,autoApproved:l=!1,exists:u}=s;let d="";return o?d=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?d=u.auth?"verify":"pending":d="exists":u.auth&&(d="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:i,boxType:d,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(i)}},{type:"validFields.email",value:!0}])},__=e=>{const t={};for(const n of e.entries())t[n[0]]=n[1];return{name:t.full_name.toString().trim(),email:t.email_address.toString().toLowerCase().trim(),jobTitle:t.job_title,organization:t.organization,bioLink:t.url,optIn:!0,expectation:t.expectation,page:window.location.pathname,"g-recaptcha-response":t["g-recaptcha-response"]}},k_=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:i,state:a})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const s=__(new FormData(e.form.current)),o=Object.assign(s,t);await n(o),localStorage.setItem("email",s.email),r&&r({...s,...a.values}),i([{type:"showSuccessMessage",value:!0}])},F_=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:i},refs:a,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:d}=s,f=(p,v)=>{p.current&&s.validFields[v]!==p.current.validity.valid&&o([{type:`validFields.${v}`,value:p.current.validity.valid}])},h=[{id:"full_name",type:"text",inputRef:a.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>f(a.name,"name"),onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:a.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{rd({ref:a.email,validateEmail:r,dispatch:o})},onChange:(p,v)=>{o([{type:"shouldDisableButton",value:!0}]),v&&v({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Ff,props:{email:d.email,type:d.boxType,resendVerificationCode:i}}];return s.shouldManuallyApprove&&(h.push({id:"job_title",type:"text",inputRef:a.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>f(a.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:a.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{f(a.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&h.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:p=>c.jsx("small",{children:p})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&h.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:p=>c.jsx("small",{className:"notes text-small",children:p})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),h.push({id:"terms",className:"text-small",type:"checkbox",inputRef:a.tc,label:u.formatMessage({id:"signup_terms"},{terms:p=>c.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:p}),privacy:p=>c.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:p})}),shownValue:"accepted",functions:{onChange:p=>{if(!p)return;const v=[];["name","email"].forEach(m=>{s.validFields[m]!==a[m].current.validity.valid&&(v.push({type:`validFields.${m}`,value:a[m].current.validity.valid}),m==="email"&&rd({ref:a.email,validateEmail:r,dispatch:o}))}),v.length&&o(v)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),h};const A_=({className:e=""})=>c.jsxs("div",{className:K("success-message",e),"data-testid":"success-message",children:[c.jsx("p",{className:"success-title",children:c.jsx(ie.FormattedMessage,{id:"signup_success_title"})}),c.jsx(ie.FormattedMessage,{id:"signup_success_text",values:{p:t=>c.jsx("p",{children:t})}})]});const B_={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},T_=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:i={},submitButton:a,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=ie.useIntl(),{title:u=!0,expectation:d=!1,url:f=!0,logInButton:h=!0,successMessage:p=!0}=i,v={title:u,expectation:d,url:f,logInButton:h,successMessage:p},[m,b]=x.useReducer(pr,B_),{validFields:g,emailDetails:y,shouldManuallyApprove:C,shouldDisableButton:k,showSuccessMessage:E,showError:_}=m,[T,L]=co.useCookies(["signup-this-session","functional-cookie-consent"]),P={form:x.createRef(),name:x.createRef(),email:x.createRef(),jobTitle:x.createRef(),organisation:x.createRef(),tc:x.createRef(),hiddenValidation:x.createRef()};x.useEffect(()=>{C===!0&&P.jobTitle.current&&P.jobTitle.current.focus()},[C]),x.useEffect(()=>{T["signup-this-session"]&&b([{type:"showSuccessMessage",value:!0}])},[T]),x.useEffect(()=>{E&&T["functional-cookie-consent"]&&L("signup-this-session","true",{path:"/",maxAge:3600})},[E]);const z=x.useMemo(()=>F_({placeholders:n,labels:t,shouldShow:v,functions:r,refs:P,state:m,dispatch:b,dataToSubmit:s,intl:l}),[s,r,l,P,v,m]),M=k?!0:C?!Object.values(g).every(A=>A===!0):!g.name||!g.email||["exists","pending","verify"].includes(y.boxType);return v.successMessage&&E?c.jsx(A_,{className:e}):c.jsxs("fieldset",{className:K("signup-form-fieldset",e),"data-testid":"signup-form",children:[v.title&&c.jsx("p",{className:"signup-title",children:c.jsx(ie.FormattedMessage,{id:"signup_title"})}),_&&c.jsx(Qt,{variant:"error",text:l.formatMessage({id:"signup_error"})}),c.jsx(Xt,{className:"signup-form",formRef:P.form,id:"sign-up-form",fields:z,intlPath:"signup",button:{variant:"primary",size:"medium",text:a||l.formatMessage({id:"signup_button_join"}),disabled:M?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:`/api/next-ui/login?returnTo=${window.location.pathname}`,"data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:v.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await k_({refs:P,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:b,state:m})},onCatch:A=>{r.handleError(A),b([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),c.jsx("button",{className:"validation-button",ref:P.hiddenValidation})]})};const kn=({children:e,className:t="",styling:n={},...r})=>{const{background:i="default",padding:a="none"}=n;return c.jsx("section",{className:K("full-width-section",t,{[i]:i!=="default",[a]:a!=="none"}),...r,children:e})};const S_=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(i=>{r.push({href:i.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable new","data-gtm-event-type":"download-click","data-gtm-event-context":i.eventContext||"Download",target:"_blank",children:i.text})}),c.jsx(kn,{className:K("download-section",n),styling:{background:"dark"},children:c.jsxs("div",{className:"content-default",children:[x.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),c.jsx(vr,{buttons:r})]})})};const lo="editSection_";function uh({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const j_=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:i,setShowModal:a})=>{const{formatMessage:s}=ie.useIntl();return c.jsxs(_t,{variant:"muted",icon:e,children:[c.jsx("p",{children:t||s({id:`${lo}placeholder_description`})}),i&&c.jsx("p",{children:c.jsx(Ae,{href:r,variant:"secondary",size:"small",onClick:()=>uh({href:r,setShowModal:a}),children:n||s({id:`${lo}placeholder_cta`})})})]})},P_=({children:e,className:t="",formProps:n,formComponent:r,href:i,title:a,showTitle:s=!0,modalTitle:o,placeholder:l,showDivider:u=!0})=>{const{formatMessage:d}=ie.useIntl(),[f,h]=x.useState(!1),p=()=>h(!1),v=!!n||!!r,m=typeof i=="string"||v;let b;return r&&(b=x.cloneElement(r,{functions:{...r.props.functions,onSuccess:async g=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(g)}finally{p()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),p()}}})),c.jsxs("section",{className:K("edit-section",t),children:[v&&c.jsx(ln,{title:o||`Edit ${a}`,isOpen:f,showDivider:!1,showIcon:!1,functions:{onClose:p},className:K("edit-section-modal"),children:b||(n?c.jsx(Xt,{...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 g=>{var y,C;(y=n==null?void 0:n.functions)!=null&&y.onSuccess&&await((C=n==null?void 0:n.functions)==null?void 0:C.onSuccess(g)),h(!1)},onCancel:p}}):c.jsx(c.Fragment,{}))}),c.jsxs("div",{className:K("edit-section-header",{"no-title":!s}),children:[s&&c.jsx("h2",{className:"edit-section-header-title",children:a}),m&&c.jsx(Ae,{href:i,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>uh({href:i,setShowModal:h}),children:d({id:`${lo}edit`})})]}),e||c.jsx(j_,{...l,href:i,setShowModal:h,showEditButton:m}),u&&c.jsx(zt,{})]})};const O_=({title:e=!1,text:t,logos:n=[],styling:r={},className:i=""})=>{const a=n.length;if(a===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 c.jsxs("div",{className:K("logos",i,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&x.createElement(s.element,{className:K("title",s.className)},s.text),t&&c.jsx("p",{children:t}),c.jsx("ul",{className:K({"two-col":a===2||a===4,"three-col":a===5||a<=10&&a%3===0}),children:n.map(({logo:d,nameOfBusiness:f,link:h=!1,description:p=!1},v)=>{if(!d||!d.url)return null;const m=c.jsx("img",{src:d.url,width:d.width||"auto",height:d.height||"auto",alt:f});return c.jsxs("li",{children:[c.jsx("p",{className:"img-wrapper",children:h?c.jsx("a",{href:h,target:"_blank",rel:"nofollow noreferrer noopener",children:m}):m}),p&&c.jsx("small",{children:p})]},window.btoa(`${d.url}_${v}`))})})]})};let xs;const ws="contactFooter_",M_=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=x.useRef(null),[r,i]=x.useState(0),[a,s]=x.useState(!1),o=()=>{n.current&&i(n.current.clientHeight)},l=()=>{a||(s(!0),clearTimeout(xs),xs=setTimeout(()=>{o(),s(!1)},500))};return x.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(xs),window.removeEventListener("resize",l)}),[]),c.jsx(kn,{id:"contactForm",className:"contact-footer",children:c.jsxs("div",{className:"inner-wrapper",children:[c.jsx("h2",{children:c.jsx(ie.FormattedMessage,{id:`${ws}title`})}),c.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:a?{}:{minHeight:r},children:[c.jsxs("aside",{children:[c.jsx("p",{children:c.jsx(ie.FormattedMessage,{id:`${ws}text`})}),c.jsx(Dn,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:c.jsx(ie.FormattedMessage,{id:`${ws}email`})})]}),c.jsx(rh,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},N_=({activeLink:e,profile:t,...n})=>c.jsx(kn,{children:c.jsx(_f,{layout:"1-3",children:c.jsxs(c.Fragment,{children:[c.jsx(Ef,{activeLink:e,profile:t}),c.jsx(qd,{...n})]})})});const Cs="cookieBanner_",Ds=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Es=new Date(Date.now()+12*30*24*60*60*1e3),lh=()=>{const e=ie.useIntl(),[t,n,r]=co.useCookies(Ds),[i,a]=x.useState(!t["apol-cookie-banner"]),s=()=>{Ds.forEach(d=>{n(d,!0,{path:"/",expires:Es,domain:d==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),a(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Es}),Ds.forEach(d=>{if(d==="apol-cookie-banner"){n(d,!0,{path:"/",expires:Es});return}r(d)}),a(!1)};if(!i)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(d=>{u.push({variant:d.href?"tertiary":"primary",href:d.href,onClick:d.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${d.gtmType}-click`,children:e.formatMessage({id:`${Cs}buttons_${d.id}`})})}),c.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[c.jsx("h6",{children:e.formatMessage({id:`${Cs}title`})}),c.jsx("p",{children:e.formatMessage({id:`${Cs}text`})}),c.jsx(vr,{buttons:u})]})},nn={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","insights","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-click"},insights:{href:"/learning-hub/global-insights/",gtmType:"insights-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:Qn["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Qn["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","washington","registered","berlin","support","business"],correspondence:{address:!0},washington:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:Qn.support,gtmType:"concierge-email-click"},business:{email:Qn.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 rr="footer_",oa="SiteFooter",id=({group:e})=>{const t=nn[e].order||[];let n=!1;return"text"in nn[e]&&(n=nn[e].text),c.jsxs(x.Fragment,{children:[c.jsx("p",{className:"pre-title",children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}`})}),Array.isArray(t)&&t.length>0&&c.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:a}=nn[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),c.jsx("li",{children:c.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":oa,"data-gtm-event-type":a,...s,children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&c.jsx("dl",{className:"text-medium",children:n.order.map(r=>c.jsxs(x.Fragment,{children:[c.jsx("dt",{children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}_${r}`})}),c.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&c.jsx("address",{children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}_${r}_address`,values:{br:c.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&c.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)},du=()=>c.jsx("div",{id:"footer",children:c.jsxs("div",{className:"wrapper",children:[c.jsx(da,{element:"hr"}),c.jsx(Mo,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":oa,"data-gtm-event-type":"logo-homepage-link"}),c.jsx("footer",{children:["platform","community","company","contact"].map(e=>c.jsxs("div",{className:"group",children:[c.jsx(id,{group:e}),Object.keys(nn[e]).includes("child")&&c.jsx(id,{group:nn[e].child})]},e))}),c.jsx("hr",{}),c.jsxs("div",{className:"sub-footer",children:[c.jsx("ul",{children:Array.isArray(nn.social.order)&&nn.social.order.map(e=>{const t=nn.social[e];return c.jsx("li",{className:e,children:c.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:c.jsx("span",{className:"hidden",children:c.jsx(ie.FormattedMessage,{id:`${rr}social_${e}`})})})},e)})}),c.jsx("small",{children:c.jsx(ie.FormattedMessage,{id:`${rr}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),Ue={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=a=>{const s=`logged${e?"In":"Out"}`;return t>=n[a][s]};let i={};return["navigation","search"].forEach(a=>{i[a]=r(a)}),i},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(i=>i===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:i=!1})=>{if(!i&&n[e]===t||!i&&e===Et.ACCOUNT&&t===!1&&n[Et.SITE]===!0)return;const a=Date.now();if(!i&&!t&&Ue.handlerCalled[e]&&a-Ue.handlerCalled[e]<500)return;Ue.handlerCalled[e]=a;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 Et.SITE:o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation .navigation-button"));break;case Et.SEARCH:o=document.querySelector("#header .toggle-search-button");break;case Et.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 i=cd(e[r],t);if(!(typeof i>"u")&&(!n||i[t]&&i[t].includes(n)||i.value&&i.value.includes(n)||i.toString().includes(n)))return e[r]}return e[0].children?Ue.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:i})=>{var l;if(!t.current||!t.current.children)return;const a=n?"desktop":"default";if(r[e][a]){(l=document.querySelector(`#header ul a[href="${r[e][a]}"]:last-child`))==null||l.focus();return}let s,o;switch(e){case Et.SITE:if(n){const u=Ue.findFirstChild(t.current.children,"className","has-submenu parent"),d=Ue.findFirstChild(u.children,"id",Et.SITE);s=Ue.findFirstChild(d.children,"href")}else s=Ue.findFirstChild(t.current.children,"href");break;case Et.ACCOUNT:if(o=Ue.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=Ue.findFirstChild(o.children,"href");break;default:return}s&&(i([{type:`focusElements.${e}.${a}`,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(Ue.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(Ue.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Ue.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Ue.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},ri={order:["home","communities","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},communities:{href:"/communities/",gtmType:"communities-click",onlyShow:"logged-in"},topics:{order:["explore","topics"],menuId:"site-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:{menuId:"account-navigation",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:"/api/next-ui/login",withReturnTo:!0},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},ua=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:i=()=>{},doTrack:a=null})=>{const s=ie.useIntl(),o=cd(ri,e);if(!o||o.onlyShow&&(o.onlyShow==="logged-in"&&!t||o.onlyShow==="logged-out"&&t))return null;const l="doTrack"in o,u=a===null?l?o.doTrack:!0:a,d=e.includes("buttons.");let f=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(f+=`_logged${t?"In":"Out"}`);let h=!1;if(o.href){let C=o.gtmType||`${e}-click`;if(C.includes(".")){const k=C.split("."),E=k[k.length-2];C=`${E==="topics"?`${E}-`:""}${k[k.length-1]}`}h={href:o.withReturnTo?`${o.href}?returnTo=${window.location.pathname}`:o.href},u&&(h={...h,className:"gtm-trackable","data-gtm-event-type":C,"data-gtm-event-context":"HeaderButtons"}),d&&(h={...h,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const p=o.order&&o.order[0]&&o[o.order[0]],v=p&&o[o.order[0]].order,m=h&&window.location.pathname===o.href;let b={},g={},y={};if(m&&(b={...b,"aria-current":"page"}),p){const C=o.menuId||e,k={onClick:E=>Ue.events.onClick(E,{id:C,callback:i,isOpen:r[C]}),onFocus:()=>Ue.events.onFocus({id:C}),onBlur:()=>Ue.events.onBlur({id:C,callback:i}),onMouseLeave:()=>Ue.events.onBlur({id:C,callback:i}),onMouseEnter:()=>Ue.events.onMouseEnter({id:C,callback:i})};g={...k,id:C===Et.SITE?Et.SITE:Et.ACCOUNT},n&&(v&&(y={...k,className:"navigation-button",onKeyPress:E=>{E.key==="Enter"&&Ue.events.onClick(E,{id:C,callback:i,isOpen:r[C]})},"aria-haspopup":!0,"aria-expanded":r[C],"aria-controls":C}),g={...g,hidden:C in r?!r[C]:!0}),v||(g={...g})}return c.jsxs("li",{className:K({[o.className]:o.className,"has-submenu":p,parent:v,active:m}),...b,children:[h?x.createElement(d?Ae:"a",h,s.formatMessage({id:f})):n&&o.order&&v?c.jsxs("button",{...y,children:[s.formatMessage({id:f}),c.jsx(Me,{children:s.formatMessage({id:`header_menu_${r[Et.SITE]?"hide":"show"}`})})]}):s.formatMessage({id:f}),o.order&&c.jsx("ul",{...g,children:o.order.map(C=>{if(!o[C])return null;const k={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:i,doTrack:l?u:null};return o[C].order?c.jsxs("li",{className:K({[o[C].className]:o[C].className}),children:[s.formatMessage({id:`${f}_${C}`}),c.jsx("ul",{children:o[C].order.map(E=>c.jsx(ua,{id:`${e}.${C}.${E}`,...k},E))})]},C):c.jsx(ua,{id:`${e}.${C}`,...k},C)})})]},e)};const I_={height:67,height_desktop:83};var Et=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(Et||{});const fu=({showNavigation:e=!0})=>{const t=ie.useIntl(),n=x.useContext(it),r=wn(!0,!0),i=n&&typeof n.id=="string",a=x.useMemo(()=>Ue.getIsDesktopVersion(i,r),[i,r]),[s,o]=x.useReducer(pr,{headerIsVisible:!0,menus:{"site-navigation":!1,search:!1,"account-navigation":!1},focusElements:{"site-navigation":{desktop:!1,default:!1},"account-navigation":{desktop:!1,default:!1}}}),{headerIsVisible:l,menus:u,focusElements:d}=s,f=x.useRef(s);x.useEffect(()=>{f.current=s},[s]),gd({scrollPosition:I_[`height${a.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const g=f.current.menus;!a&&g["site-navigation"]||Ue.shouldChangeHeaderIsVisible(!0,g,o)},scrollDown:()=>{const g=f.current.menus;!a&&g["site-navigation"]||Ue.shouldChangeHeaderIsVisible(!1,g,o)}}});const h=(g,y,C=!1)=>{Ue.handleMenus({id:g,value:y,menus:f.current.menus,dispatch:o,forceHandle:C})},p=x.useRef(null),v=g=>{g.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(y=>{f.current.menus[y]&&h(y,!1,!0)})};x.useEffect(()=>{var g;return(g=document.getElementById("header"))==null||g.addEventListener("keydown",v),()=>{var y;(y=document.getElementById("header"))==null||y.removeEventListener("keydown",v)}},[]),or(()=>{u["site-navigation"]&&Ue.autoFocus({menu:"site-navigation",navigationRef:p,isDesktopVersion:a.navigation,focusElements:d,dispatch:o})},[u["site-navigation"]]),or(()=>{u["account-navigation"]&&Ue.autoFocus({menu:"account-navigation",navigationRef:p,isDesktopVersion:a.navigation,focusElements:d,dispatch:o})},[u["account-navigation"]]);const m=c.jsxs(c.Fragment,{children:[!a.search&&c.jsx("button",{className:"search toggle-search-button",onClick:g=>{g.preventDefault(),g.stopPropagation(),h("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:c.jsx(Me,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),c.jsx(oh,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:a.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),b=c.jsxs(c.Fragment,{children:[!a.navigation&&c.jsx("button",{className:"menu-button gtm-trackable",onClick:g=>{g.preventDefault(),g.stopPropagation(),h("site-navigation",!u["site-navigation"])},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":u["site-navigation"],"aria-controls":"site-navigation",children:c.jsx(Me,{children:t.formatMessage({id:`header_menu_${u["site-navigation"]?"hide":"show"}`})})}),c.jsx("ul",{ref:p,id:"navigation",hidden:a.navigation||u["account-navigation"]?!1:!u["site-navigation"],"data-showing":!a.navigation&&u["account-navigation"]?"account":"default",children:ri.order.map(g=>c.jsx(ua,{id:g,isLoggedIn:i,isDesktopVersion:a.navigation,menus:{"site-navigation":u["site-navigation"],"account-navigation":u["account-navigation"]},callback:h},g))})]});return n&&n.isLoading?null:c.jsxs(c.Fragment,{children:[c.jsxs("nav",{id:"header",className:K({"logged-in":i,"logged-out":!i,visible:l}),children:[c.jsx(Me,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),c.jsx(Mo,{variant:"monochrome"}),e&&c.jsxs(c.Fragment,{children:[a.navigation?c.jsxs(c.Fragment,{children:[b,m]}):c.jsxs(c.Fragment,{children:[m,b]}),i?c.jsxs("button",{className:"account-button",onClick:g=>Ue.events.onClick(g,{id:"account-navigation",callback:h,isOpen:u["account-navigation"]}),onMouseEnter:()=>Ue.events.onMouseEnter({id:"account-navigation",callback:h}),onMouseLeave:()=>Ue.events.onBlur({id:"account-navigation",callback:h}),"aria-haspopup":"true","aria-expanded":u["account-navigation"],"aria-controls":"account-navigation",children:[c.jsx(Me,{children:t.formatMessage({id:`header_account_${u["account-navigation"]?"hide":"show"}`})}),c.jsx(un,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):c.jsx("ul",{className:"sign-in-buttons",children:ri.buttons.order.map(g=>c.jsx(ua,{id:`buttons.${g}`},g))})]})]}),c.jsx("hr",{id:"content-of-page"}),c.jsx("div",{className:K("overlay",{open:u["site-navigation"]||u["account-navigation"]||!a.search&&u.search})})]})};const R_=()=>{const e=ie.useIntl();return c.jsxs(c.Fragment,{children:[c.jsx(fu,{}),c.jsx("div",{id:"content",children:c.jsx(Qt,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),c.jsx(du,{})]})},ch=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:i={},styling:a={},className:s="",locale:o="en"})=>{const l=ie.useIntl(),{navigation:u=!0,footer:d=!0}=i,{background:f="default",variant:h="default",circle:p="default",modal:v="default"}=a,m=hd(),[b,g]=x.useState(""),y=T=>{const{detail:{message:L}}=T;g(L)};x.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",y),()=>{document.removeEventListener("ariaLive",y)}),[m]);const C=Oi(e,{locale:o}),k=Oi(t,{locale:o}),E=Oi(n,{locale:o}),_={};return f!=="default"&&(_[f]=!0),h!=="default"&&(_[h]=!0),p!=="default"&&(_[p]=!0),c.jsx(jh.ErrorBoundary,{onError:r,fallback:c.jsx(R_,{}),children:c.jsxs(x.Suspense,{fallback:null,children:[c.jsxs("div",{id:"wrapper",className:K(s,_,{"has-footer":d}),"data-too-small":l.formatMessage({id:"pageLayout_browserTooSmall"}),children:[c.jsx(fu,{showNavigation:u}),c.jsxs("main",{id:"content-wrapper",children:[k&&c.jsx("div",{className:K("additional-content prepended",{"large-modal":v==="large"}),children:k}),x.createElement(f==="bold"?wo:"div",{id:"content",children:C,className:K({"large-modal":v==="large"})})]}),E&&c.jsx("div",{className:"additional-content appended",children:E}),d&&c.jsx(du,{}),c.jsx(lh,{})]}),b&&c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:b})]})})},ad={default:"tags_",headerTopics:"header_topics_topics_"},_s={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"},$_={getTagDetails:e=>{if(e.includes("topic_")){if(e=_s.topic[e.replace("topic_","")],e){const t=ri.topics.topics[e].href;return t?{id:e,href:t,text:`${ad.headerTopics}${e}`}:null}return null}return _s[e]?(e=_s[e],{id:e,text:`${ad.default}${e}`}):null}};const L_=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:i="",gtmType:a="tag-click",gtmContext:s="tags"})=>{const o=ie.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const d=$_.getTagDetails(u);d&&l.push(d)}),l.length<1?null:c.jsx("ul",{className:K("tags text-small",t,i,{"one-line":n}),children:l.map(u=>{const d=o.formatMessage({id:u.text});return c.jsx("li",{children:u.href&&r?c.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":a,"data-gtm-event-context":s,children:d}):d},u.id)})})};const dh=25,z_=({members:{data:e=[],total:t=e.length},communitySlug:n,isMember:r=!1,hasNextPage:i=!1,loadNextPage:a=()=>{},profile:s,gtmContext:o="member",gtmType:l="member-click",showHeader:u=!0,showPlaceholders:d=!1,className:f=""})=>{const h=ie.useIntl(),p="membersList",v=x.useContext(it),[m,b]=x.useState(!1);return e.length===0&&!d?null:c.jsxs("div",{className:K("members-list",f),children:[u?c.jsxs("h1",{children:[h.formatMessage({id:p}),c.jsx("span",{className:"count",children:t})]}):c.jsx(c.Fragment,{}),c.jsxs("ul",{children:[r?c.jsxs("li",{children:[c.jsx(an,{member:v,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:ut.Communities,area:n||""},{scope:ut.Platform,area:"all"}]}}),c.jsx(Dn,{href:"/profiles/me",className:"text-small",onClick:g=>{g==null||g.preventDefault(),g==null||g.stopPropagation(),b(!0)},children:h.formatMessage({id:`${p}_profile`})})]}):c.jsx(c.Fragment,{}),e.map((g,y)=>v&&g.id===v.id?c.jsx(c.Fragment,{}):c.jsxs("li",{children:[c.jsx(an,{member:g,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:ut.Communities,area:n||""},{scope:ut.Platform,area:"all"}]}}),g.isAdmin&&c.jsx(Yt,{children:h.formatMessage({id:`${p}_admin`})})]},y)),d&&e.length===0&&t>0?[...new Array(Math.min(t,dh))].map((g,y)=>c.jsx("li",{children:c.jsx(pa,{layout:"member"})},y)):c.jsx(c.Fragment,{})]}),i&&c.jsx(ii,{hasNextPage:i,loadNextPage:a,icon:{icon:"arrow-down",position:"right"},gtmContext:o}),s?c.jsx(ka,{form:s,showModal:m,content:{title:h.formatMessage({id:`${p}_modal_title`})},functions:{onClose:()=>{b(!1)}}}):c.jsx(c.Fragment,{})]})},fh=z_,q_=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const i=ie.useIntl();return t?c.jsx("small",{children:Rt(i.formatMessage,`${e}explainer`,n,"action",{a:a=>c.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":r,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:a})})}):c.jsx(c.Fragment,{})},U_=({intlPath:e,type:t,...n})=>{const r=ie.useIntl();return c.jsx(aa,{label:{visible:r.formatMessage({id:`${e}label`}),screenreader:Rt(r.formatMessage,`${e}label_action`,t,"action")},...n})},sd=5,od=2,W_=e=>{var r;let t=0;const n=[];return(r=e==null?void 0:e["poll-options"])==null||r.forEach((i,a)=>{i!==""&&(t++,n.push({position:t,description:{en:i}}))}),{title:{en:e.title},options:n,settings:{allow_multiple_votes:e["multiple-answers"]||!1}}};let Gn=null;const Qe="discussion_form_",oi=({id:e,parentId:t,content:n={type:Be.Response,slugs:{}},userHasPermissions:r=!0,meta:i,placeholder:a,maxLength:s=0,buttons:o,forceShow:l={cancel:!1,error:!1},functions:u,data:d={},gtmContext:f="DiscussionForm"})=>{var Y,se,be;const h=ie.useIntl(),p=x.useContext(it),[v,m]=x.useState(n.type),[b,g]=x.useState(""),{isLoading:y=!1,isInWrapper:C=!1,isInOverlay:k=!1,isAutoFocused:E=!1,isEditing:_=!1,hasTitleField:T=!1,canBePrepopulated:L=!1,isPrepopulated:P=!1,showTitle:z=!1,showGuidelines:M=!0,showDivider:A=!1,showSuccessMessage:F=!0,showPostType:S=!1,postCategories:I=[]}=i||{},{onChange:H=()=>{},create:V=()=>{},createPoll:ae=()=>Promise,handleSaveEdit:X=()=>{},handleCancel:D=()=>{},callback:Q=()=>{},onMention:q=()=>{},listMembers:B=()=>Promise.resolve([]),clickMentionFallback:j=()=>{},getLinkPreview:N=()=>Promise.resolve({}),props:O={create:{projectNames:["questions-answers"]}}}=u,[U,ee]=x.useState({body:_&&_.text||P&&P.text||"",data:d!=null&&d.link?{link:d==null?void 0:d.link}:{}}),[W,ne]=x.useState(l.error||!1),de={status:!1,title:T&&T.text||"",polls:0},[J,ve]=x.useState(de);x.useEffect(()=>{L&&!_&&P&&P!==U.body&&ee(oe=>({...oe,body:P.text||""}))},[P]),x.useEffect(()=>{m(n.type)},[n.type]);const me=Wr((oe,ce)=>{ee(ke=>({...ke,body:oe,data:{link:ce}})),H({body:oe});let pe;!p||!p.id?pe=Rt(h.formatMessage,`${Qe}error_loggedOut`,v,"action"):r?s>0&&oe.length>=s&&(pe=`${Qe}error_tooLong`):pe=Rt(h.formatMessage,`${Qe}error_noPermission`,v,"action"),pe?ne(pe):W&&ne(!1)},50);let ye=`${v}-form`;if(v===Be.Response||v===Be.Reply){const oe=((Y=n.slugs)==null?void 0:Y.reply)||((se=n.slugs)==null?void 0:se.answer)||((be=n.slugs)==null?void 0:be.question)||"";oe&&(ye=`${ye}-${oe.slice(-15)}`)}e&&(ye=`${e}-${ye}`);const Ee=async oe=>{if(!p||!p.id||!r||Ke)throw new Error("You do not have permission to post.");Gn&&clearTimeout(Gn),ve(pe=>({...pe,status:"submitting"}));const ce=window.location.pathname;try{let pe;switch(v){case Be.Post:pe=await V({title:oe.title,content:oe.body,categories:oe.postType,data:oe.data});break;case Be.Poll:pe=await ae(W_(oe));break;case Be.Question:pe=await V({title:oe.body,authorId:p&&p.id,data:oe.data,...O==null?void 0:O.create});break;case Be.Response:pe=await V({questionSlug:n.slugs.question},{body:oe.body,authorId:p&&p.id,contentPath:ce,data:oe.data});break;case Be.Reply:pe=await V({questionSlug:n.slugs.question,answerSlug:n.slugs.answer},{body:oe.body,authorId:p&&p.id,contentPath:ce,data:oe.data});break;default:break}return await Zh(1e3),Q&&await Q(pe),Gn=setTimeout(()=>{ee({body:"",data:{}}),m(Be.Post),ve(qe=>({...qe,status:"submitted"})),g(Rt(h.formatMessage,`${Qe}success`,v,"action"));const ke=new Event(rt.DISCUSSION_FORM_SUBMITTED);document.dispatchEvent(ke),Ce()},850),pe}catch(pe){const ke=pe;let qe=`${Qe}error`;ke!=null&&ke.message.includes("entry already exists")&&(qe=Rt(h.formatMessage,`${Qe}error_alreadyExists`,v,"action")),ke!=null&&ke.message.includes("429")?qe=Rt(h.formatMessage,`${Qe}error_tooMany`,v,"action"):ke!=null&&ke.message.includes("400")&&(qe=`${Qe}error`),ne(qe),Ce()}},Ce=()=>{Gn=setTimeout(()=>{ne(!1),ve(de),g("")},5e3)},ze=Wr(async oe=>{const ce={...U,...oe};if(_){ve(pe=>({...pe,status:"submitting"})),X(ce);return}try{if(!await Ee(ce))throw Error("No response from handleSubmit")}catch{Gn&&clearTimeout(Gn)}},100);if(y)return c.jsx(Nt,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const We=!U.body||!Kr(U.body),He=!J.title||!Kr(J.title);let Ke=!1;v!==Be.Poll&&(Ke=We),T&&(Ke=Ke&&He);const Te=J.status==="submitting",Oe=[];v===Be.Poll?Oe.push({id:"poll-options",label:h.formatMessage({id:`${Qe}option_label`}),type:"multiple-inputs",element:"textarea",placeholder:h.formatMessage({id:`${Qe}option_placeholder`}),limit:100,multipleInputs:{showCount:!0,defaultInputs:od,maxInputs:sd,hasButton:{variant:"secondary",size:"small",styling:{muted:!0},icon:"plus",children:h.formatMessage({id:`${Qe}option_cta`})}},styling:{autosizeToFit:!0},functions:{onChange:oe=>{var pe;let ce=0;oe&&Array.isArray(oe)&&(ce=((pe=oe==null?void 0:oe.filter(ke=>ke!==""))==null?void 0:pe.length)||0),J.polls!==ce&&ve(ke=>({...ke,polls:ce})),H({polls:oe})}},validation:[{condition:"required"}]},{type:"checkbox",id:"multiple-answers",label:h.formatMessage({id:`${Qe}multiplePollAnswers`}),className:"text-medium"}):Oe.push({component:U_,props:{formID:ye,intlPath:Qe,showLabel:T!==!1,type:v}},{component:cu,props:{id:`${ye}-input`,value:J.status==="submitting"&&!W?"":U.body,placeholder:a||Rt(h.formatMessage,`${Qe}placeholder`,v,"action"),maxLength:s,meta:{isInOverlay:k},functions:{onChange:me,onChangeData:oe=>{ee(ce=>({...ce,data:oe}))},onMention:q,listMembers:B,clickMentionFallback:j,getLinkPreview:N},data:d,autoFocus:_!==!1||E&&!T,"aria-invalid":!!W,"aria-errormessage":"error-message"}},{component:q_,props:{intlPath:Qe,showGuidelines:M,type:v,gtmContext:f}}),A&&Oe.push({component:zt}),T&&Oe.unshift({id:"title",type:"textarea",value:T.text,limit:250,label:h.formatMessage({id:`${Qe}${v===Be.Poll?"question":"titleField"}_label`}),styling:{autosizeToFit:!0},placeholder:h.formatMessage({id:`${Qe}${v===Be.Poll?"question":"titleField"}_placeholder`}),functions:{onChange:oe=>{ve(ce=>({...ce,title:oe})),H({title:oe})}},validation:v===Be.Poll?[{condition:"required"}]:[]}),S&&Oe.unshift({id:"postType",type:"radio",value:"no-category",accessibilityOptions:{checkboxes:{navigateWithArrowKeys:!0}},styling:{displayOptionsAsPills:!0},label:h.formatMessage({id:`${Qe}postType_label`}),options:I.map(oe=>({id:oe.slug,label:oe.name})),validation:[{condition:"required"}],functions:{onChange:oe=>{H({postType:oe}),oe.includes(Be.Poll)?m(Be.Poll):v!==Be.Post&&m(Be.Post)}}});let we=!p||!p.id||!r||Te;if(v===Be.Poll){const oe=J.polls;we=we||He||oe<od||oe>sd}else we=we||Ke,_&&(T?we=we||U.body===_.text&&J.title===T.text:we=we||U.body===_.text);return c.jsxs(c.Fragment,{children:[c.jsxs(Xt,{id:ye,className:K("discussion-card discussion-form",{"no-styling":C&&_}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:_&&!Te||l.cancel},functions:{onSuccess:async oe=>{await ze(oe)},onCancel:D},fields:Oe,intlPath:Qe,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":f,"data-gtm-event-type":`${_?"save":"submit"}-${v}-click`,"data-testid":"save-button",disabled:we,text:{default:!_&&(o!=null&&o.submit)?o==null?void 0:o.submit:h.formatMessage({id:`${Qe}${_?"save":"post"}`}),submitting:h.formatMessage({id:`${Qe}${_?"saving":"posting"}`})}},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":f,"data-gtm-event-type":`cancel-${v}-click`,disabled:!l.cancel&&(!p||!p.id||!U.body),text:o!=null&&o.cancel?o==null?void 0:o.cancel:h.formatMessage({id:`${Qe}cancel`})},gtm:{context:f,event:`${v}-form`},"data-testid":`discussion-${v}-form`,children:[z&&!_&&v===Be.Question&&c.jsx("h2",{children:Rt(h.formatMessage,`${Qe}title`,v,"action")}),c.jsx(an,{member:p?{...p,link:!1}:"community",gtmContext:f,gtmType:"profile-click",badges:{showBadges:!0,scopes:[{scope:ut.Communities,area:t||""},{scope:ut.Platform,area:"all"}]}})]}),J.status==="submitted"&&F&&c.jsx(ur,{className:"success","data-testid":"success",children:Rt(h.formatMessage,`${Qe}success`,v,"action")}),W&&c.jsx(ur,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof W=="string"?W.includes(" ")?W:h.formatMessage({id:W},{action:h.formatMessage({id:`discussion_action_${v}`}),maxLength:s}):W}),b&&c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:b})]})},V_=Object.freeze(Object.defineProperty({__proto__:null,default:oi},Symbol.toStringTag,{value:"Module"}));const H_={showForm:!1},_a=x.createContext(H_),mh=({children:e})=>{const[t,n]=x.useState({showForm:!1});return c.jsx(_a.Provider,{value:{...t,updateConversation:n},children:e})};function K_({author:e,originalAuthorId:t,createdAt:n,contentData:r,content:i,gtmContext:a,badges:s}){var f;const o="discussion_",l=ie.useIntl(),u=(f=i==null?void 0:i.componentProps)==null?void 0:f.member.additionalContent,d=u?u.customMessage:void 0;return c.jsxs("div",{className:"author-section",children:[c.jsx(an,{member:e,additionalContent:{createdAt:n,didEdit:r.didEdit,customMessage:d},className:K({highlighted:typeof e!="string"&&e.id===t}),styling:{additionalContentNewLine:!!d},gtmContext:a,gtmType:"profile-click",badges:s}),i.pinned&&c.jsx(Yt,{variant:"naked",size:"xlarge",icon:"pin",children:c.jsx(Me,{children:l.formatMessage({id:`${o}pinned_post`})})})]})}const ks=({children:e,class:t,...n})=>{const r={...n,class:K("subtle",t)};return c.jsx("blockquote",{...r,children:e})};function Z_({content:e}){var t;return!e||!((t=e.categories)!=null&&t.length)?c.jsx(c.Fragment,{}):c.jsx("ul",{className:"categories-list",children:e.categories.map(n=>!n.slug||!n.name?c.jsx(c.Fragment,{}):c.jsx(Yt,{size:"small",element:"li",children:n.name},n.slug))})}var la=(e=>(e.Always="always",e.AfterVoting="after-voting",e))(la||{});const Y_=(e,t,n)=>n===void 0?0:e.some(i=>i.hasUserVoted)?t?e.findIndex(i=>!i.hasUserVoted):e.findIndex(i=>i.hasUserVoted):0,G_=(e,t,n,r=0)=>{if(!e)return{nextElement:null,nextIndex:0};let i=n==="next"?e.nextElementSibling:e.previousElementSibling,a=r+(n==="next"?1:-1);for(;i;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}const s=e.parentElement;if(s)for(i=n==="next"?s.firstElementChild:s.lastElementChild,a=n==="next"?0:s.childElementCount-1;i&&i!==e;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}return{nextElement:null,nextIndex:0}};const Q_=({user:e,option:t,optionIndex:n,totalPollVotes:r=0,allowMultipleVotes:i=!1,showResults:a=!1,hasVotedOnPoll:s=!1,isTabbable:o=!1,functions:l})=>{var b;const[u,d]=x.useState(t.hasUserVoted);let f=0,h={};const p=(i||!s)&&!t.hasUserVoted;a&&(f=Math.round(t.numVotes/r*100)||0,h={"--vote-perc":`${f}%`});const v=g=>{g.stopPropagation(),p&&(l==null||l.createVote(t),d(!0))},m={htmlFor:t.id,className:K({"can-vote":p}),tabIndex:o&&p?0:-1,"data-testid":"poll-option-label","data-gtm-event-type":"poll-option-click","data-gtm-event-context":"PollOption","aria-selected":t.hasUserVoted,onClick:v,onKeyDown:g=>{var y;if(g.code!=="Tab")switch(g.code){case"Enter":case"Space":g.preventDefault(),g.stopPropagation(),v(g),d(!0);break;case"ArrowUp":case"ArrowDown":g.stopPropagation(),g.preventDefault();const C=g.code==="ArrowUp"?"prev":"next",{nextElement:k,nextIndex:E}=G_(g.currentTarget.parentElement,"selected",C,n);k&&((y=k.querySelector("label"))==null||y.focus(),l==null||l.setTabbableOption(E));break}}};return c.jsxs("li",{"data-testid":"poll-option",style:h,className:K("poll-option text-small",{selected:t.hasUserVoted}),children:[c.jsx("label",{...m,children:c.jsx("span",{children:t.label})}),a&&c.jsxs("div",{className:"vote-details",children:[t.hasUserVoted&&c.jsx(un,{className:"author-profile-picture",name:e.name,src:(b=e==null?void 0:e.image)==null?void 0:b.thumbnail}),c.jsxs("p",{className:"vote-perc text-medium","data-testid":"vote-perc",children:[f,"%"]})]}),c.jsx("input",{type:i?"radio":"checkbox",id:t.id,name:t.id,checked:u,tabIndex:-1})]})};const hh=({title:e,options:t,settings:n,functions:r})=>{const i="poll_",a=ie.useIntl(),s=x.useContext(it),{showRemoveVote:o=!1,allowMultipleVotes:l=!1,resultsVisibility:u=la.AfterVoting}=n||{},[d,f]=x.useState(Y_(t,l,s==null?void 0:s.id)),h=t.reduce((g,y)=>g+y.numVotes,0),p=t.filter(g=>g.hasUserVoted).length,v=t.filter(g=>g.hasUserVoted),m=x.useCallback(async g=>{await r.createVote({reactionId:g.id})},[]),b=x.useCallback(async()=>{t.forEach(async g=>{g.hasUserVoted&&g.userVote&&r.removeVote({reactionId:g.userVote.id})})},[t]);return c.jsxs("div",{className:"poll-wrapper",children:[c.jsx("p",{className:"poll-title",children:e}),c.jsxs("aside",{className:"poll-info",children:[c.jsx("p",{className:"poll-instructions","data-testid":"poll-instructions",children:c.jsx("small",{children:a.formatMessage({id:`${i}instructions`},{allowMultipleVotes:l})})}),c.jsx("p",{className:"poll-num-votes",children:c.jsx("small",{"data-testid":"poll-total-votes",children:a.formatMessage({id:`${i}num_votes`},{number:h})})}),o&&c.jsx("p",{className:"poll-remove-vote",children:c.jsx(Ae,{variant:"tertiary",onClick:b,"data-testid":"remove-votes-button",disabled:p===0,children:c.jsx("small",{children:a.formatMessage({id:`${i}remove_vote_button`},{number:p})})})})]}),t&&c.jsx("form",{children:c.jsx("fieldset",{children:c.jsx("ul",{className:"poll-options",children:t==null?void 0:t.map((g,y)=>c.jsx(Q_,{isTabbable:d===y,user:s,option:g,optionIndex:y,totalPollVotes:h,showResults:u==la.Always||!!p,allowMultipleVotes:l,hasVotedOnPoll:!!p,functions:{createVote:m,setTabbableOption:f}},g.id))})})}),c.jsxs(Me,{"aria-live":"polite",children:[a.formatMessage({id:`${i}aria_votes`},{number:p}),!!p&&c.jsx("ul",{children:v.map(g=>c.jsx("li",{children:g.label}))})]})]})};function J_({content:e,contentData:t,functions:n}){return c.jsx(hh,{title:t.title,options:(e==null?void 0:e.pollOptions)||[],settings:(e==null?void 0:e.pollSettings)||{},functions:{createVote:n.createVote,removeVote:n.removeVote}})}function X_({links:e={},contentData:t,postCutOff:n,content:r}){var i;return c.jsxs(c.Fragment,{children:[e.post?c.jsxs("a",{href:e.post,children:[(t==null?void 0:t.title)&&c.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),t.postBody.length>n?c.jsx(jd,{text:t.postBody,markdownOptions:{overrides:{a:Ms,blockquote:{component:ks}}}}):c.jsx(On,{options:{overrides:{a:Ms,blockquote:{component:ks}}},children:t.postBody})]}):c.jsxs(c.Fragment,{children:[(t==null?void 0:t.title)&&c.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),c.jsx(On,{options:{wrapper:r.type===Be.Question?"h1":x.Fragment,forceWrapper:r.type===Be.Question,forceInline:r.type===Be.Question,forceBlock:r.type!==Be.Question,overrides:{blockquote:{component:ks}}},children:t.postBody})]}),(i=t.data)!=null&&i.link?c.jsx(Oo,{data:t.data.link}):c.jsx(c.Fragment,{})]})}const It="discussion_",ek=195;let Ti=null;const ui=({element:e="div",content:t,userHasPermissions:n=!0,userHasOwnerPermissions:r=!1,isLoading:i=!1,originalAuthorId:a,forceHide:s,functions:o,links:l={},className:u,gtmContext:d="DiscussionAnswer",children:f,isTruncated:h=!1,setFocus:p=!1,isCommunity:v=!1,badges:m,basePath:b,parentId:g,locale:y="en"})=>{var Oe,we,Y,se,be,oe;const C=ie.useIntl(),k=x.useContext(_a),E=x.useContext(it),{createContent:_=async()=>{},deleteContent:T=async()=>{},updateContent:L=async()=>{}}=o.content||{},{createLike:P=()=>{},deleteLike:z=()=>{},listLikes:M=async()=>({})}=o.likes||{},{openComments:A=()=>{}}=o.comments||{},{listMembers:F=()=>Promise.resolve([]),clickMentionFallback:S=()=>{}}=o.form||{},{createVote:I=()=>{},removeVote:H=()=>{},removePoll:V=()=>{}}=o.polls||{},{author:ae,createdAt:X,id:D,likes:Q=0,userLiked:q,comments:B=0,data:j}=t,N=uv(t.title,y),O=E&&E.id&&typeof ae!="string"&&ae.id&&ae.id===E.id||!1,U=O&&(!t.createdAt||Hh(t.createdAt,10,"seconds")),ee=x.useRef(null),[W,ne]=x.useState({title:t.body!==N&&N||"",body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:"",data:t&&t.data||{}}),[de,J]=x.useState(!1),[ve,me]=x.useState(U?"highlighted":"default"),[ye,Ee]=x.useState("");x.useEffect(()=>{const ce=ee.current;if(!(!ce||ve==="default"))return document.addEventListener(rt.DISCUSSION_FORM_SUBMITTED,Ce),ce.addEventListener("transitionend",ze),()=>{document.removeEventListener(rt.DISCUSSION_FORM_SUBMITTED,Ce),ce.removeEventListener("transitionend",ze)}},[]),x.useEffect(()=>{ne(ce=>({...ce,title:t&&N||"",body:t&&t.body||"",didEdit:t&&t.isEdited||!1,data:t&&t.data||{}}))},[t.isEdited]),x.useEffect(()=>{(async()=>{const pe=await jo(W.body,h,j==null?void 0:j.mentions,F);ne(ke=>({...ke,postBody:pe}))})()},[W.body,j==null?void 0:j.mentions]);const Ce=()=>{setTimeout(()=>{me("fading")},1e3)},ze=({propertyName:ce})=>{ce==="background-color"&&me(pe=>(pe==="default"&&(document.removeEventListener(rt.DISCUSSION_FORM_SUBMITTED,Ce),ee.current&&ee.current.removeEventListener("transitionend",ze)),pe==="fading"?"default":pe))};if(i||!t||t.type===Be.Answer&&(!t.slugs||!t.slugs.question)||W.postBody===""&&t.title==="")return c.jsx(Nt,{className:"discussion-card"});const We=async({title:ce,body:pe,data:ke})=>{ce||(ce=""),pe||(pe=""),Ee("");try{if(!Wi(ce,W.title)||!Wi(pe,W.body)){const qe=t.type===Be.Question?{title:pe}:{title:ce,body:pe,data:ke};await L(Ls(t.slugs),qe)}ne(qe=>({...qe,title:ce||"",body:pe||"",data:{...qe.data,...ke},isEditing:!1,didEdit:!0}))}catch{Ee(`${It}form_error`)}},He=()=>{if(k&&k.updateConversation){const ce={showForm:!0},pe=t.author;pe&&pe.id&&(v&&(ce.prepopulateForm=`@{{${pe.id}}}`),ce.mentionData={id:pe.id,name:pe.name}),k.updateConversation(ce)}setTimeout(()=>{var At,pt,tt;const pe=`reply-form-${(t.type===Be.Answer?t.slug:((At=t.slugs)==null?void 0:At.reply)||((pt=t.slugs)==null?void 0:pt.answer)||((tt=t.slugs)==null?void 0:tt.question)||"").toLowerCase().slice(-15)}`,ke=document.getElementById(pe),qe=document.getElementById(`${pe}-input`);qe&&qe.focus(),ke&&ke.scrollIntoView({behavior:"smooth"})},0)},Ke=async()=>{J(!1);try{t.type===Be.Poll?(await V(),window.location.href=`${b}/${g}`):await T(Ls(t.slugs))}catch{Ee("delete-error")}},Te=[];return n&&O&&(t.type!==Be.Poll&&Te.push({text:C.formatMessage({id:`${It}moreMenu_edit`}),onClick:()=>ne(ce=>({...ce,isEditing:!0})),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`}),Te.push({text:C.formatMessage({id:`${It}moreMenu_delete`}),onClick:ce=>{ce.preventDefault(),ce.stopPropagation(),J(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`delete-${t.type}-click`,...sf(`delete-${t.slug}-modal`,de)})),r&&o.pins&&Te.push({text:C.formatMessage({id:`${It}moreMenu_${t.pinned?"unpin":"pin"}`}),onClick:t.pinned?o.pins.deletePin:o.pins.createPin,icon:t.pinned?"unpin":"pin",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`}),p&&((Oe=ee==null?void 0:ee.current)==null||Oe.focus(),(we=ee==null?void 0:ee.current)==null||we.scrollIntoView({behavior:"smooth"})),x.createElement(e,{className:K("discussion-post",u,{[ve]:!u||!u.includes("highlighted-text-box"),"has-link":l.post&&!W.isEditing,"is-pinned":(t==null?void 0:t.pinned)||!1}),ref:ee,tabIndex:p?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${d}-post-click`,onClick:ce=>{if(!l.post||W.isEditing||t.type===Be.Poll&&ov(ce,["poll-options","poll-info"],"discussion-post"))return;ce.preventDefault(),ce.stopPropagation(),Ti&&clearTimeout(Ti),Ti=setTimeout(()=>{window.location.href=l.post},150);const pe=new CustomEvent(rt.DISCUSSION_POST_CLICKED,{detail:{link:l.post,timeout:Ti}});document.dispatchEvent(pe)},children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{id:D||t.slug,className:K("discussion-card text-medium",t.type,{editing:W.isEditing,"has-link":l.post&&!W.isEditing}),children:[!W.isEditing&&c.jsx(K_,{author:ae,originalAuthorId:a,createdAt:X,contentData:{didEdit:W.didEdit},content:t,gtmContext:d,badges:m}),W.isEditing?c.jsx(oi,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:i,isInWrapper:!0,hasTitleField:W.title!==""?{text:W.title}:!1,isEditing:{text:W.body,categories:[]},canBePrepopulated:v,isPrepopulated:!1},maxLength:t.type===Be.Question?250:5e4,forceShow:{error:ye!==""&&ye!=="delete-error"?C.formatMessage({id:ye},{action:C.formatMessage({id:`${It}action_${t.type}`})}):!1},functions:{create:_,handleSaveEdit:We,handleCancel:()=>{Ee(""),ne(ce=>({...ce,isEditing:!1}))},listMembers:F,clickMentionFallback:S},gtmContext:`${d}Form`,data:j}):c.jsxs(c.Fragment,{children:[t.type===Be.Poll?c.jsx(J_,{content:t,contentData:W,functions:{createVote:I,removeVote:H}}):c.jsx(X_,{links:l,contentData:W,postCutOff:ek,content:t}),c.jsx(Z_,{content:t})]}),!W.isEditing&&!(s!=null&&s.actionBar)&&c.jsx(wf,{className:t.type,gtmContext:d,contentType:t.type,likes:s!=null&&s.likes?!1:{count:Q||0,userLiked:q||!1,canLike:n??!0,peopleWhoLiked:t.peopleWhoLiked,activityId:t.id||t.slug,content:{slugs:t.slugs||{},slug:t.slug},functions:{createLike:P,deleteLike:z,listLikes:M},basePath:b,parentId:g},comments:!(s!=null&&s.comments)&&([Be.Question,Be.Post].includes(t.type)||l.comments)?{count:B||0,functions:{onClick:()=>{l!=null&&l.comments&&(window.location.href=l.comments),typeof A=="function"&&A()}}}:!1,replies:t.type==="answer"||t.type==="reply"?{canReply:n??!0,functions:{onClick:He}}:!1,shareLink:{url:`${window.location.origin}${(Y=t.slugs)==null?void 0:Y.question}/${(se=t.slugs)==null?void 0:se.answer}${(be=t.slugs)!=null&&be.reply?`#${(oe=t.slugs)==null?void 0:oe.reply}`:""}`},moreMenu:{options:Te,contentSlug:t.slug,reportData:{contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}}})]}),f,c.jsx(ln,{id:`delete-${t.slug}-modal`,isOpen:de,functions:{onOpen:()=>{},onClose:()=>J(!1)},forceShow:{error:ye==="delete-error"?C.formatMessage({id:"${intlPath}delete_error"},{action:C.formatMessage({id:`${It}action_${t.type}`})}):!1},title:C.formatMessage({id:`${It}delete_title`},{action:C.formatMessage({id:`${It}action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>J(!1),children:C.formatMessage({id:`${It}delete_cancel`})},{variant:"primary",className:"destructive",onClick:Ke,children:C.formatMessage({id:`${It}delete_delete`})}],gtmContext:`${(t.type||"").charAt(0).toUpperCase()}${(t.type||"").slice(1)}:${t.slug}`,children:c.jsx(ie.FormattedMessage,{id:"discussion_delete_text",values:{p:ce=>c.jsx("p",{children:ce}),action:C.formatMessage({id:`${It}action_${t.type}`})}})})]})})};const tk=x.lazy(()=>Promise.resolve().then(()=>pk)),nk=65,ph=({forceShow:e,form:t,className:n})=>{const r=ie.useIntl(),i="discussionFormCard_",a="DiscardDraftModal",o=x.useContext(it)||"community",l=ga(o);l.name||(l.name=r.formatMessage({id:`member_${typeof o=="string"?o:"community"}`}));const u=wn(!0,!1),d=u?u<768:0,{modal:f=!1}=e||{},[h,p]=x.useState({form:f||Fd("showPost")==="true"||!1,warning:!1}),[v,m]=x.useState({showCachedText:!1});x.useEffect(()=>{if(!v.showCachedText)return;(async()=>{const C=await jo(v.title||v.body||"",nk,v.mentions);m(k=>({...k,prettifiedText:C}))})()},[v.showCachedText,v.title,v.body]);const b=y=>{if(!v.showCachedText||typeof h.warning=="string")return;let C;if("detail"in y&&y.detail.link)y.detail.timeout&&clearTimeout(y.detail.timeout),C=y.detail.link;else{const k=y;k.preventDefault(),k.stopPropagation();const _=k.target.closest("a");C=_&&_.getAttribute("href")}p(k=>({...k,warning:C||!1}))};x.useEffect(()=>{if(!v.showCachedText){document.removeEventListener(rt.DISCUSSION_POST_CLICKED,b),document.removeEventListener(rt.MEMBER_CLICKED,b),document.removeEventListener("click",b);return}return document.addEventListener(rt.DISCUSSION_POST_CLICKED,b),document.addEventListener(rt.MEMBER_CLICKED,b),document.addEventListener("click",b),()=>{document.removeEventListener(rt.DISCUSSION_POST_CLICKED,b),document.removeEventListener(rt.MEMBER_CLICKED,b),document.removeEventListener("click",b)}},[v.showCachedText]),x.useEffect(()=>{const y=C=>{if(!(!v.showCachedText||h.warning!==!1))return C.preventDefault(),C.returnValue=""};return window.addEventListener("beforeunload",y,{capture:!0}),()=>{window.removeEventListener("beforeunload",y,{capture:!0})}},[v.showCachedText,h.warning]);let g=r.formatMessage({id:`${i}placeholder${d?"":"_long"}`});return v.showCachedText&&(v.title||v.body)&&(g=v.prettifiedText||g),c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:K("discussion-form-card",n),onClick:y=>{y.preventDefault(),y.stopPropagation(),p(C=>({...C,form:!0}))},"data-testid":"discussion-form-card",children:[c.jsx(un,{name:l.name,src:l.image,alt:""}),c.jsx(On,{className:K("input",{placeholder:!v.showCachedText}),element:"span",options:{forceInline:!0,overrides:{a:St,blockquote:St,br:St,em:St,li:St,ol:St,p:St,s:St,span:St,strong:St,ul:St}},children:g})]}),c.jsxs(br,{children:[c.jsx(tk,{showModal:h.form,functions:{cacheText:m,onClose:()=>{p(y=>({...y,form:!1}))}},form:t,cachedText:v,className:"in-portal"}),c.jsx(ln,{id:t.id?`${t.id}-warning`:"discussion-form-card-warning",className:"in-portal",isOpen:h.warning!==!1,functions:{onClose:()=>{p(y=>({...y,warning:!1}))}},title:r.formatMessage({id:`${i}overlay_title`}),buttons:[{variant:"secondary",children:r.formatMessage({id:`${i}overlay_cta_discard`}),onClick:y=>{y.preventDefault(),y.stopPropagation(),typeof h.warning=="string"&&(window.location.href=h.warning)},"data-gtm-event-type":"discard-click","data-gtm-event-context":a},{variant:"primary",children:r.formatMessage({id:`${i}overlay_cta_continue`}),onClick:()=>{p({form:!0,warning:!1})},"data-gtm-event-type":"continue-editing-click","data-gtm-event-context":a}],children:c.jsx("p",{children:r.formatMessage({id:`${i}overlay_text`})})})]})]})},rk=x.lazy(()=>Promise.resolve().then(()=>V_)),mu=({isCard:e=!1,form:t,parentId:n,categories:r,membershipRequiredToPost:{isMember:i,required:a,join:s,leave:o,notMemberStateText:l},locale:u=_o})=>{if(a&&!i)return c.jsx(Qt,{text:l,button:{breakpoints:{mobile:!0,901:!1},component:c.jsx(Eo,{isShort:!0,functions:{join:s,leave:o}})}});const{content:d,functions:f,meta:h,...p}=t,v={content:{type:(d==null?void 0:d.type)||"reply",slugs:(d==null?void 0:d.slugs)||{}},functions:{...f,create:(f==null?void 0:f.create)||(()=>{})},parentId:n,meta:{...h,isEditing:(h==null?void 0:h.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1,postCategories:[{name:"Post",slug:"no-category"},...r||[]]},...p,id:`add-post-${p.id||""}`};return e?c.jsx(ph,{form:v}):c.jsx(rk,{...v})},hu=({form:e})=>{const t=x.useContext(it),n=ie.useIntl(),[r,i]=x.useState(!1),a=()=>{tp(t)||i(!0)};x.useEffect(()=>(document.addEventListener(rt.DISCUSSION_POST_ADDED,a),()=>{document.removeEventListener(rt.DISCUSSION_POST_ADDED,a)}));const s={};return["successMessage","title","text"].forEach(o=>{s[o]=n.formatMessage({id:`profileModalLauncher_${o}`})}),c.jsx(ka,{form:e,showModal:r,functions:{onClose:()=>{i(!1)}},content:s})};const Fs="discussion_responses_",gh=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=ie.useIntl();return t=parseInt(t),c.jsxs("div",{className:"responses-heading",children:[c.jsx("h4",{children:r.formatMessage({id:`${Fs}title`},{action:r.formatMessage({id:`${Fs}${e}`}),count:t})}),!n&&t===0&&c.jsx("p",{children:Rt(r.formatMessage,`${Fs}empty`,e,e)})]})};const vh=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:i})=>{const a=ie.useIntl(),s=x.useContext(_a),o=Oi(i,{element:"li"});if(s.prepopulateForm&&(r!=null&&r.meta)&&(r.meta.isPrepopulated={text:s.prepopulateForm},s.mentionData)){const l=r.data||{};l.mentions||(l.mentions={});const u=s.mentionData.id||"1";l.mentions[u]={created_at:"",updated_at:"",id:u,data:s.mentionData},r.data=l,r.meta.isAutoFocused=!0}return c.jsxs("div",{className:K("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&c.jsx("ul",{className:"thread",children:o}),!e&&c.jsx(ii,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:a.formatMessage({id:"discussion_thread_loadMore"}),error:a.formatMessage({id:"loadMore_error"})}}),r&&s.showForm&&c.jsx(oi,{...r})]})};function ik(e){var n,r;let t=!1;return(r=(n=e.latest_reactions)==null?void 0:n["poll-option"])==null||r.forEach(i=>{var a,s;(s=(a=i.own_children)==null?void 0:a["poll-vote"])!=null&&s.length&&(t=!0)}),t}function ak({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=Re.useMutation({mutationFn:e,onMutate:({reactionId:o})=>t(l=>(uf({activity:l,reactionId:o,user:a}),l)),onError:n,onSuccess:(o,{reactionId:l},u)=>{u&&lf({activity:u,reactionId:l,correctReactionId:o.body.id,user:a}),r.setQueryData(i,u)}});return s}function sk({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Re.useMutation({mutationFn:e,onMutate:({content:i,title:a})=>t(s=>(s&&(i!=null&&(s.content=i),a!=null&&(s.title=a)),s)),onError:n});return r}function ok({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=Re.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Qi({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Qi({activity:l,reaction:s}),r.setQueryData(i,l)}});return a}function uk({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=Re.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Ji({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Ji({activity:l,reaction:s}),r.setQueryData(i,l)}});return a}function lk({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,isFetching:a}=Re.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:i,isFetching:a}}function ck({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=Re.useMutation({mutationFn:e,onMutate:({reactionId:a})=>t(s=>(cf({activity:s,reactionId:a}),s)),onError:n});return i}function dk({queryFns:{read:e,edit:t,like:n,unlike:r,pin:i,unpin:a,createVote:s,removeVote:o},queryKey:l}){const u=Re.useQueryClient(),d=ha(),f={queryClient:u,queryKey:l},h={mutationHandlers:{error:ko(f),mutate:Fo(f)},user:d,...f},p=sk({...h,mutationFn:t}),v=ok({...h,mutationFn:n}),m=fk({...h,mutationFn:r}),b=uk({...h,mutationFn:i}),g=mk({...h,mutationFn:a}),y=ak({...h,mutationFn:s}),C=ck({...h,mutationFn:o}),{activity:k,...E}=lk({queryKey:l,queryFn:e});return{activity:k,mutations:{edit:p,like:v,unlike:m,pin:b,unpin:g,createVote:y,removeVote:C},user:d,...E}}function fk({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=Re.useMutation({mutationFn:e,onMutate:a=>t(s=>(s&&df({activity:s,user:r}),s)),onError:n});return i}function mk({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=Re.useMutation({mutationFn:e,onMutate:a=>(console.log("unpin"),t(s=>(s&&ff({activity:s,user:r}),s))),onError:n});return i}const hk=({basePath:e,parentId:t,activityId:n,isMember:r,isOwner:i,functions:{activities:{remove:a,...s},likes:o,reactions:l,form:u,join:d,leave:f,polls:h},profile:p,categories:v,locale:m=_o})=>{var q,B,j,N,O,U,ee,W,ne,de,J,ve;const b=ie.useIntl(),g={...s,...h},{activity:y,error:C,isLoading:k,mutations:{edit:E,like:_,unlike:T,pin:L,unpin:P,createVote:z,removeVote:M}}=dk({queryFns:g,queryKey:[e,t,n]});if(k)return c.jsx(Nt,{style:{height:"400px"}});if(C||!y)return c.jsx(Qt,{variant:"error",text:b.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:A,verb:F,latest_reactions:S,mentioned_users:I,additional_data:H}=y,V=(((q=S==null?void 0:S.like)==null?void 0:q.length)||0)>0,ae=(((B=A==null?void 0:A.like)==null?void 0:B.length)||0)>0,X=ae?A==null?void 0:A.like[0].id:"",D=V?(j=S==null?void 0:S.like)==null?void 0:j.map(me=>{var ye,Ee,Ce;return{id:(ye=me==null?void 0:me.user)==null?void 0:ye.id,name:(Ce=(Ee=me==null?void 0:me.user)==null?void 0:Ee.data)==null?void 0:Ce.name}}):!1,Q=y==null?void 0:y.actor;return c.jsxs("section",{className:"activity-section",children:[c.jsx(ui,{className:"highlighted-text-box subtle",isCommunity:!0,content:{id:n,type:F,title:y==null?void 0:y.title,body:y==null?void 0:y.content,categories:Po((y==null?void 0:y.categories)||[],v||[]),createdAt:(y==null?void 0:y.time)||"",slugs:{question:`${e}/${t}`,answer:y==null?void 0:y.id},slug:n,author:xr(Q),userLiked:ae,likes:((N=y==null?void 0:y.reaction_counts)==null?void 0:N.like)||0,comments:(y==null?void 0:y.total_replies)||0,peopleWhoLiked:D,data:{mentions:I,...H||{}},pinned:((O=y==null?void 0:y.reaction_counts)==null?void 0:O.pin)&&((U=y==null?void 0:y.reaction_counts)==null?void 0:U.pin)>0||!1,pollOptions:of(y,m),pollSettings:{showRemoveVote:(ee=y==null?void 0:y.settings)==null?void 0:ee.show_remove_vote,allowMultipleVotes:(W=y==null?void 0:y.settings)==null?void 0:W.allow_multiple_votes,deadlineAt:(ne=y==null?void 0:y.settings)==null?void 0:ne.deadline_at,hideParticipants:(de=y==null?void 0:y.settings)==null?void 0:de.hide_participants,numberOfWinners:(J=y==null?void 0:y.settings)==null?void 0:J.number_of_winners,resultsVisibility:(ve=y==null?void 0:y.settings)==null?void 0:ve.results_visibility}},originalAuthorId:Q==null?void 0:Q.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:a,updateContent:(me,{title:ye,body:Ee})=>E({title:ye,content:Ee})},likes:{createLike:()=>_({activityId:n}),deleteLike:()=>T({activityId:n,reactionId:X}),listLikes:me=>o.list({activityId:n,...me})},comments:{openComments:()=>{}},pins:{createPin:()=>L({activityId:n}),deletePin:()=>{var me;return P({activityId:n,reactionId:(me=S==null?void 0:S.pin)==null?void 0:me[0].id})}},polls:{createVote:({reactionId:me})=>z({reactionId:me}),removeVote:({reactionId:me})=>M({reactionId:me}),removePoll:()=>h.removePoll({activityId:n})},form:u},styling:{showShareLinkButton:!0},userHasPermissions:r,userHasOwnerPermissions:i,badges:{showBadges:!0,scopes:[{scope:ut.Communities,area:t||""},{scope:ut.Platform,area:"all"}]},basePath:e,parentId:t},n),c.jsx(vf,{basePath:e,parentId:t,activityId:n,showReplies:F===Be.Poll?ik(y):!0,activityTotalReplies:(y==null?void 0:y.total_replies)||0,isMember:r,functions:{reactions:l,likes:o,form:u,join:d,leave:f},profile:p})]})};const bh=({showModal:e=!0,functions:t,form:n,cachedText:r,className:i})=>{const a=ie.useIntl(),s="discussionFormModal_",{onClose:o=()=>{},cacheText:l=()=>{}}=t,{data:u,meta:d,functions:f}=n,{title:h="",body:p="",mentions:v}=r||{},m="discussion-form-modal";return c.jsx(ln,{id:m,title:a.formatMessage({id:`${s}title`}),isOpen:e,functions:{onClose:()=>{(h!==""||p!=="")&&l(b=>({...b,showCachedText:!0})),o()}},className:K("discussion-form-modal",i),children:c.jsx(oi,{...n,data:{...u,mentions:v||(u==null?void 0:u.mentions)},meta:{...d,isAutoFocused:!0,isInOverlay:`${m}-overlay`,hasTitleField:{text:h},isPrepopulated:{text:p||(d==null?void 0:d.isPrepopulated)!==!1&&(d==null?void 0:d.isPrepopulated.text)||""},showGuidelines:!1,showDivider:!0,showPostType:!0},buttons:{submit:a.formatMessage({id:`${s}cta`})},functions:{...f,onChange:b=>{l(g=>({...g,...b}))},onMention:({id:b,name:g}={})=>{if(!b||!g)return;const y=v||{};y[b]={created_at:"",updated_at:"",id:b,data:{name:g}},l(C=>({...C,mentions:y}))},create:async b=>{o(),f.create&&await f.create(b),l({showCachedText:!1})},createPoll:async b=>{const g=()=>{o(),l({showCachedText:!1})};if(f.createPoll)try{const y=await f.createPoll(b);return new Promise(C=>(g(),C(y)))}catch{return new Promise((C,k)=>k())}else return g(),new Promise(y=>y({}))},handleSaveEdit:async b=>{o(),f.handleSaveEdit&&await f.handleSaveEdit(b),l({showCachedText:!1})}}})})},pk=Object.freeze(Object.defineProperty({__proto__:null,default:bh},Symbol.toStringTag,{value:"Module"}));const gk=({className:e,showModal:t=!0,title:n,messagePlaceholder:r,formTitle:i,formLabel:a,ctaMessage:s,showIcon:o,onClose:l,reportError:u=()=>{},sendInvites:d})=>{const f=ie.useIntl();return i||(i=f.formatMessage({id:"inviteModal_formTitle"})),a||(a=f.formatMessage({id:"inviteModal_formLabel"})),s||(s=f.formatMessage({id:"inviteModal_cta"})),c.jsx(ln,{id:"invite-user-modal",title:n,isOpen:t,showDivider:!1,showIcon:o,functions:{onClose:l},className:K("invite-modal",e,{success:!!n}),children:c.jsx(ih,{title:i,label:a,messagePlaceholder:r,ctaMessage:s,onClose:l,sendInvites:d,reportError:u})})};const vk=({showModal:e=!0,content:{successMessage:t,title:n,text:r}={},functions:i,form:a,className:s})=>{const o=ie.useIntl(),[l,u]=x.useState(Fd("showProfile")==="true"||e);x.useEffect(()=>{u(e)},[e]);const{onClose:d=()=>{}}=i;return c.jsx(ln,{id:"profile-form-modal",title:t||n||o.formatMessage({id:"profileModal_title"}),isOpen:l,showDivider:!t,functions:{onClose:d},className:K("profile-modal",s,{success:!!t}),maxWidth:700,children:c.jsxs(c.Fragment,{children:[t&&n||r?c.jsxs("div",{className:"intro",children:[t&&n?c.jsx("h3",{children:n}):"",r?c.jsx("p",{children:r}):""]}):null,c.jsx(ah,{...a,meta:{shouldShowCancelButton:!1},functions:{...(a==null?void 0:a.functions)||{},onSuccess:async f=>{var h;try{(h=a==null?void 0:a.functions)!=null&&h.onSuccess&&await a.functions.onSuccess(f)}finally{d()}}}})]})})},ka=vk,bk=Object.freeze(Object.defineProperty({__proto__:null,default:ka},Symbol.toStringTag,{value:"Module"}));const yk=({members:e})=>{const[t,n]=x.useState(!1),r=i=>{const{fullName:a,jobTitle:s,organisation:o,photo:l}=i||{};return c.jsxs(c.Fragment,{children:[c.jsx(un,{name:a,src:l}),c.jsx("p",{children:a}),c.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return c.jsxs("div",{className:"directory-wrapper",children:[c.jsx("ul",{className:"directory",children:e.map(i=>c.jsx("li",{children:c.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),n(i)},children:r(i)})},i.fullName))}),c.jsx(ln,{isOpen:t!==!1,children:t===!1?"":c.jsxs(c.Fragment,{children:[r(t),c.jsx(On,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const xk=({author:e,authorCite:t,content:n,member:r,className:i=""})=>c.jsxs("blockquote",{className:K("testimonial-block",i),children:[c.jsx(Zt,{className:"testimonial",children:n}),r?c.jsx(an,{member:r,styling:{size:"large"}}):c.jsxs(c.Fragment,{children:[e&&c.jsx("p",{className:K("author",{"text-small":!i.includes("new")}),children:e}),t&&c.jsx("p",{className:K("author-cite",{"text-small":!i.includes("new")}),children:c.jsx("cite",{children:t})})]})]}),wk=x.memo(xk);const Ck=({items:e=[],selector:t="",className:n=""})=>{const r=ie.useIntl(),[i,a]=x.useState(e);return x.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,d)=>{s+=`${d>0?", ":""}${t} h${d+1}`});const l=Array.from(document.querySelectorAll(s)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));a(l)},[]),i&&i.length>0&&c.jsxs(_t,{variant:"subtle",className:K("table-of-contents",n),children:[c.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),c.jsx("nav",{children:c.jsx("ul",{children:i.map(({id:s,text:o})=>c.jsx("li",{children:c.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const Fa=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:i=""})=>{const a=ie.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=d=>{const f=d/60,h=Math.floor(f),p=(f-h)*60,v=Math.round(p),m=`${a.formatMessage({id:`${s}hours`},{time:h})}${h>0&&v>0?", ":""}${a.formatMessage({id:`${s}minutes`},{time:v})}`;return{text:`${h>0?`${a.formatMessage({id:`${s}hours_short`},{time:h})} `:""}${v>0?a.formatMessage({id:`${s}minutes_short`},{time:v}):""}`,ariaText:m}};let{text:l,ariaText:u}=o(e);if(t){const{text:d,ariaText:f}=o(e+t);l=a.formatMessage({id:`${s}range`},{early:l,late:d}),u=a.formatMessage({id:`${s}range_aria`},{early:u,late:f})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),c.jsx("span",{className:K("time-to-complete",i),"aria-label":u,children:l})};const Dk=({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",c.jsx(Cn,{...n,className:K("banner",e),image:{...t,aspect:"banner"}})):null;const Ek=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],_k=({className:e="",content:t,image:n,variant:r,spacing:i="normal",styling:a,hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:l})=>{var v,m;const u={imageFullWidth:!0,...a};r||(r=u.imageFullWidth?"default":"light");const d=["eyebrow","title","text"],f={eyebrow:"small",title:"h1",text:"p"},h={};d.forEach(b=>{if(!t[b]){h[b]=!1;return}if(!s[b]){if(typeof t[b]=="object"){h[b]=t[b];const{text:g,element:y}=t[b];if(y&&Ek.includes(y.toLowerCase()))return;h[b]={text:g,element:f[b]};return}h[b]={text:t[b],element:f[b]}}});const p=o&&o.text&&o.link;return p&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=b=>{b.preventDefault(),b.stopPropagation();const g=document.getElementById(o.link.substring(1));g&&g.scrollIntoView({behavior:"smooth"})}),c.jsx(kn,{className:K("banner-section",r,i,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":p,"has-extra-spacing":r!=="subtle"&&i==="normal"&&h.eyebrow&&h.title}),children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"content-wrapper",children:[d.map(b=>{if(h[b]&&typeof h[b]=="object"){const{text:g,element:y=""}=h[b];return b==="text"?c.jsx(On,{overrideType:"text-only",className:"text",children:g},b):x.createElement(y,{key:b,className:b},g)}return null}),l,p&&c.jsx(Ae,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:K({new:r==="subtle",[(v=o.props)==null?void 0:v.className]:(m=o.props)==null?void 0:m.className}),children:o.text})]}),n&&c.jsx(Cn,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},kk=x.memo(_k);const Fk=({image:e,variant:t="default",children:n,className:r=""})=>{const i={};return e&&(i["--image"]=`url(${e})`),c.jsx(kn,{className:K("custom-content-banner",t,r,{"has-image":e}),style:i,children:c.jsx("div",{className:"content-slim",children:n})})};const Ak=({alignImage:e="left",className:t,content:n,image:r})=>{const i=typeof n=="string"?c.jsx(On,{children:n}):n;return c.jsxs(kn,{className:K("highlight-section",t),children:[r&&c.jsx("div",{className:K("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:c.jsx(Cn,{image:{...r,description:"",query:"q=85",aspect:"highlightSection"}})}),c.jsx("div",{className:K("highlight-container highlight-content-wrapper",{"no-image":!r}),children:c.jsx("div",{className:K("highlight-content",{"highlight-content-right":e==="left"}),children:r?i:c.jsx("div",{className:"content-default",children:i})})})]})},Bk=x.memo(Ak);const Tk=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:i})=>!n&&!r?null:c.jsxs("aside",{className:K("marketing-block",e),children:[n&&c.jsx("p",{className:"title",children:n}),r&&c.jsx("p",{children:r}),t&&c.jsx(Ae,{variant:t.variant||"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":i,"data-gtm-event-type":"learn-more-click",children:t.text})]}),Sk=({type:e,data:t})=>{const n=ie.useIntl(),{answers:r,createdAt:i,dateHasPassed:a,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:d}=t;if(e==="question"){const f=i&&js(i);return c.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),i&&c.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:f?n.formatMessage({id:`dates_${f.path}`},{number:f.number}):0})]})]})}if(d&&!a||s)return c.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):ho(d)});if(o)return c.jsx(Yt,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const f=u&&js(u);return c.jsxs("ul",{className:"details",children:[l&&c.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&c.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:f?n.formatMessage({id:`dates_${f.path}`},{number:f.number}):0})})]})}return null},jk={title:66,text:3e3,secondaryText:1e3,partner:34},ca={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"}},Pk=({data:e,cta:t,link:n,gtmContext:r})=>{var m,b;const i=ie.useIntl(),[a,s]=x.useState({loading:!1,registered:e.registered||!1});x.useEffect(()=>{e.registered&&s(g=>({...g,registered:!0}))},[e.registered]);const{customLinkText:o,startDate:l,dateHasPassed:u,pill:d,slug:f}=e,h=e.contentType;let p="";if((m=ca[h])!=null&&m.gtmEvent&&(p=ca[h].gtmEvent),l&&u)return n?c.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${p}-click`,children:o||i.formatMessage({id:"card_watch"})}):null;if(h==="people")return n?c.jsx(Ae,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${p}-click`,children:o||i.formatMessage({id:"card_cta_people"})}):null;const v=["communityPage","microcourse","event"];if(t&&t.onClick&&v.includes(h)&&d!=="premium"){const g=a.loading||a.registered||((b=e==null?void 0:e.members)==null?void 0:b.isMember),y=async C=>{if(C.preventDefault(),C.stopPropagation(),!(g||!t||!t.onClick)){s(k=>({...k,loading:!0}));try{const k=await t.onClick(e);s(k==="success"?()=>({registered:!0,loading:!1}):E=>({...E,loading:!1}))}catch{s(E=>({...E,loading:!1}))}}};return c.jsx("p",{className:K("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:c.jsx(Ae,{onClick:y,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:g,"data-gtm-event-context":`${r}Page-${h}: ${f}`,"data-gtm-event-type":`${r}-${h}-register-click`,"data-testid":"in-card-button",children:o||i.formatMessage({id:`card_cta_${h}${g?`_${a.loading?"loading":"done"}`:""}`})})})}return null};function Ok({buildMemberData:e,communitySlug:t}){const n=ie.useIntl(),r=x.useContext(it),[i,a]=x.useState({count:"...",isMember:!1,memberType:""});return x.useEffect(()=>{e(t,typeof(r==null?void 0:r.id)<"u").then(s=>{if(!s)return;const{membersCount:o,role:l="",pagination:u}=s;let d=0;o?d=o:u!=null&&u.total&&(d=u==null?void 0:u.total),a({count:d.toString(),isMember:!!l,memberType:l})})},[t,e]),c.jsxs("span",{className:"member-information",children:[i.isMember&&c.jsx(Yt,{size:"small",variant:"registered",icon:(i==null?void 0:i.memberType)==="owner"?"user":"tick",children:n.formatMessage({id:`card_member_type_${i.memberType}`})}),c.jsx("span",{className:"label member-count",children:n.formatMessage({id:"card_member_count"},{count:i.count})})]})}const pu=({id:e="",className:t="",buildCardData:n,buildMemberData:r,card:i,cta:a,gtmContext:s="Carousel",handleCardClick:o,meta:l})=>{var F,S;const u=ie.useIntl(),d=x.useContext(it),f=!!(d!=null&&d.id),{isTabbable:h=!0,setFocus:p=!1}=l||{},v=x.useRef(null),[m,b]=x.useState({data:null,isLoading:!0});x.useEffect(()=>{n(i,f).then(I=>{b({data:I,isLoading:!1})}).catch(()=>b(I=>({...I,isLoading:!1})))},[i,f,n]);const{data:g,isLoading:y}=m;if(y||!g)return c.jsx(Nt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});o&&!a&&(a={text:u.formatMessage({id:`card_cta_${i.contentType}`}),onClick:o});const{contentType:C}=g;if(!C||!ca[C])return c.jsx(Nt,{element:"li",className:"card-wrapper"});const{basePath:k="",className:E,length:_,gtmEvent:T}=ca[C];let L=h&&g.slug?`${k}${g.slug}`:!1;h&&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")&&(L=g.slug);const P=I=>{L&&(I.preventDefault(),I.stopPropagation(),window.location.href=L)},z={...jk,..._};let M={className:"card"},A={};return L&&(A={href:L,className:"gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${T}-click`,"data-testid":"link"},g.openInNewTab&&(A.target="_blank"),M={onClick:P,className:"card gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${T}-click`}),p&&(M={...M,tabIndex:"0"},(F=v==null?void 0:v.current)==null||F.focus(),(S=v==null?void 0:v.current)==null||S.scrollIntoView({behavior:"smooth"})),c.jsx("li",{className:K("card-wrapper text-medium",E,t,{"has-link":L,"no-link":!L,"has-image":g.banner}),"data-testid":`${C}-card`,children:c.jsxs("div",{...M,ref:v,children:[c.jsx(Bd,{className:"card-label",contentType:C,customIcon:g.isPrivate?"lock-locked":g.customIcon,customLabel:g.customLabel}),C==="communityPage"&&(g==null?void 0:g.createdAt)&&Kh(g==null?void 0:g.createdAt,60)&&c.jsx(Yt,{size:"small",variant:"information","data-testid":"new-community",children:u.formatMessage({id:"card_new"})}),g.startDate&&!g.isOngoingEvent&&c.jsx(Yt,{size:"small",variant:g.dateHasPassed?"default":"information","data-testid":"date",children:g.dateHasPassed?u.formatMessage({id:"card_ended"}):Ed(g.startDate)}),g.banner?c.jsxs("p",{className:"img",children:[g.registered&&c.jsx(Yt,{size:"small",variant:"registered",children:u.formatMessage({id:"card_registered"})}),c.jsx(Cn,{image:{...g.banner,description:""}})]}):E==="people"?c.jsx(un,{name:g.title||"",src:g.profile,"data-testid":"people-profile-picture"}):null,g.contributors&&c.jsx(xo,{contributors:{data:g.contributors},styling:{size:"small",showGap:E!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(C)?u.formatMessage({id:`card_contributors_${C}`}):void 0,"data-testid":"contributors"}),g.partner&&c.jsx("p",{className:"partners","data-testid":"partners",children:g.partner.length>1?u.formatMessage({id:"card_partner"},{partner:g.partner[0],number:g.partner.length-1}):sr(g.partner[0],z.partner)}),["title","text","secondaryText"].map(I=>{const H=g[I];if(!H)return null;const V=yd(I),ae={key:I,className:V,"data-testid":V},X={wrapper:"p",forceWrapper:!0,forceInline:!0},D=sr(H,z[I]);return["title","text"].includes(I)&&L?(X.wrapper="a",c.jsx("p",{...ae,children:c.jsx(Zt,{options:X,...A,children:D})})):c.jsx(Zt,{options:X,...ae,children:D})}),i.contentType==="communityPage"&&(i.slug||g.slug)&&r&&c.jsx(Ok,{communitySlug:i.slug||g.slug,buildMemberData:r}),c.jsx(Sk,{type:E||"",data:g}),c.jsx(Pk,{data:g,cta:a,link:L||"",gtmContext:s})]})})};const yh=({cards:e,cardTypes:t,className:n="",...r})=>c.jsx("ul",{className:K("card-block",n),children:e.map((i,a)=>{const s=i.slug?`${i.slug}-${t[a]}`:`${t[a]}-${a}`;return c.jsx(pu,{id:s,card:{...i,contentType:t[a]},meta:{setFocus:a===(r==null?void 0:r.focusCardIndex)},...r},s)})}),Mk=(e,t,n,r)=>{const i=t*n<=e,a=e<t*(n+1),s=r.includes(Math.floor(e/t));return{inView:i&&a,isLoaded:s}},Nk=({id:e,title:t})=>{const n=ie.useIntl();if(!t||!t.text)return null;const{text:r,element:i="h2",variant:a="default",size:s="medium",link:o}=t;return x.createElement(i,{className:K("title",a,s,{"highlighted-title":a==="highlighted"}),children:c.jsxs(c.Fragment,{children:[r,o&&c.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 As={fourCards:1024,threeCards:769,twoCards:480};let Si=null,Bs=null;const Ik=({id:e,cards:t,cardTypes:n,buildCardData:r,title:i,className:a,gtmContext:s,...o})=>{const l=ie.useIntl(),u="carousel_pagination_",[d,f]=x.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:h,isLoading:p}=d,[v,m]=x.useState({currentPage:0,loadedPages:[0]}),{currentPage:b,loadedPages:g}=v,[y,C]=x.useState(""),k=t.length,E=Math.ceil(k/h),_=x.useRef(null),T=wn(!0,!0,_==null?void 0:_.current);x.useEffect(()=>{let F=1;T&&(T>=As.fourCards?F=4:T>=As.threeCards?F=3:T>=As.twoCards&&(F=2),F>k&&(F=k)),f(S=>({...S,cardsPerPage:F,isLoading:!1}))},[T,k]);const L=(F="next")=>{Bs&&clearTimeout(Bs);let S=b;if(typeof F=="string")if(F==="next")if(b<E-1)S=b+1;else return;else if(b>0)S=b-1;else return;else S=F;C(""),m(H=>({...H,currentPage:S,loadedPages:[...new Set([...g,S])]}));const I=()=>{const H=S*d.cardsPerPage,V=H+d.cardsPerPage;return t.slice(H,V).length};Bs=setTimeout(()=>{C(l.formatMessage({id:`${u}ariaLive${typeof F=="string"?"":"_slide"}`},{direction:l.formatMessage({id:`${u}${typeof F=="string"?F:"next"}`}),slide:typeof F=="string"?1:F+1,count:I()}))},500)},P=F=>{Si=F.touches[0].clientX},z=F=>{if(Si===null)return;const S=F.touches[0].clientX,I=Si-S;I>5?L("next"):I<-5&&L("previous"),Si=null},M={"--width":`${T||0}px`,"--total-cards":k,"--cards-per-page":h,"--page":b};if(p)return c.jsx(pa,{layout:`carousel${i?"-with-title":""}`});const A=(F,S)=>{var H;let I=null;return(H=F==null?void 0:F.sys)!=null&&H.id?I=`card-${F.sys.id}`:F!=null&&F.slug?I=`card-${F.slug}`:[n[S],F.contentType].includes("customCard")&&(I=`card-${window.btoa(`${F.title} ${F.createdAt}`)}-${S}`),I};return c.jsxs("section",{ref:_,className:K("carousel-wrapper",a),"data-testid":"carousel",children:[c.jsx(Nk,{id:e,title:i}),c.jsx("ul",{className:"carousel",onTouchStart:P,onTouchMove:z,style:M,"data-testid":"carousel-list",children:t.map((F,S)=>{let I=A(F,S);const{inView:H,isLoaded:V}=Mk(S,h,b,g);return I&&(H||V)?c.jsx(pu,{id:I,card:{...F,contentType:n[S]},buildCardData:r,gtmContext:s,meta:{isTabbable:H},...o},I):(I=I||`${e}-card-${S}`,c.jsx(Nt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},I))})}),E<=1?null:c.jsxs(c.Fragment,{children:[c.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[c.jsx("li",{className:"arrow previous",children:c.jsx(Ae,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:F=>{F.preventDefault(),F.stopPropagation(),L("previous")},screenreaderText:l.formatMessage({id:`${u}previousSlide`}),disabled:b<=0})}),[...Array(E)].map((F,S)=>c.jsx("li",{"data-testid":"carousel-controls-button",children:c.jsx("button",{className:K("page-indicator",{selected:S===b}),onClick:I=>{I.preventDefault(),I.stopPropagation(),L(S)},children:c.jsx(Me,{showOnFocus:!1,children:l.formatMessage({id:`${u}slide`},{number:S+1,total:E})})})},`page-indicator-${S}`)),c.jsx("li",{className:"arrow next",children:c.jsx(Ae,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:F=>{F.preventDefault(),F.stopPropagation(),L("next")},screenreaderText:l.formatMessage({id:`${u}nextSlide`}),disabled:b>=E-1})})]}),c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:y})]})]})},Rk=({carousels:e=[],isLoading:t,title:n,className:r="",...i})=>!e||!e.length?null:e.map(({title:a,viewAllUrl:s,cards:o,cardsTypes:l},u)=>{const d=a?window.btoa(a):`carousel-${u}`,f=u===e.length-1;return t?c.jsxs(x.Fragment,{children:[c.jsx(pa,{layout:`carousel${a?"-with-title":""}`,"data-testid":"carousel-placeholder"}),f?null:c.jsx(zt,{})]},`placeholder-${d}`):c.jsxs(x.Fragment,{children:[c.jsx(Ik,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:a,link:s},...i}),f?null:c.jsx(zt,{})]},`carousel-${d}`)});const $k=({element:e="div",className:t="",card:n,gtmContext:r="NarrowCard"})=>{const{banner:i,title:a,text:s,isPrivate:o,slug:l}=n;let u={};return l&&(u={onClick:f=>{l&&(f.preventDefault(),f.stopPropagation(),window.location.href=l)},tabIndex:"0","data-gtm-event-context":`${r}-NarrowCard`,"data-gtm-event-type":`${r}-click`}),x.createElement(e,{className:K("narrow-card",t,{"has-link":l,"gtm-trackable":l,"no-link":!l}),...u,children:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:K("img",{private:o,"no-image":!i}),children:i&&c.jsx(Cn,{image:i})}),c.jsxs("div",{className:"content",children:[a&&c.jsx("p",{className:"title text-medium",children:a}),s&&c.jsx("p",{className:"text text-medium",children:s})]})]})})};const Lk=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:i=!0},graph:a,styling:s={},className:o=""})=>{const l=ie.useIntl();let u=i?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:d=!1}=s;return x.createElement(e,{className:K("course-progression",o,{"highlight-percentage":d,"has-circle-graph":a==="circle"}),children:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:f=>c.jsx("strong",{children:f}),number:u})}),u<100&&i&&c.jsx(Fa,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})}),c.jsx(yo,{progress:u,styling:{layout:a||"bar",size:a&&a==="circle"?"small":"default"}})]})})};const xh=({element:e="span",sectionId:t,subsectionId:n,title:r,className:i=""})=>x.createElement(e,{className:K("lesson-name",i),"data-number":`${t}.${n}`,children:r});const wh=({size:e="default",completionTime:t,icon:n,optional:r,type:i,children:a})=>{const s=ie.useIntl(),o=fa(`lessonType_${i}`)?s.formatMessage({id:`lessonType_${i}`}):wd(i||"");return c.jsxs("small",{className:K("content-type",{[e]:e!=="default"}),children:[c.jsx("span",{className:K("type",n),children:o})," ",t>0&&!r&&c.jsx(Fa,{time:t})," ",a?c.jsx("span",{className:"additional",children:a}):null]})};const zk=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:i,sectionId:a,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:d})=>{const f=ie.useIntl(),h="courseStructure_",p=u.toLowerCase().includes("course conclusion");return c.jsxs(ma,{className:"course-structure",label:c.jsxs(c.Fragment,{children:[c.jsxs("small",{children:[f.formatMessage({id:`${h}section${p?"_end":""}`},{number:a})," ",!r&&s>=0&&c.jsx("span",{className:"time",children:i&&l===0?f.formatMessage({id:`${h}time_completed`}):c.jsx(Fa,{time:s,appendedText:i?f.formatMessage({id:`${h}time_left`}):""})})]}),c.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[c.jsx("p",{children:n}),c.jsx("ol",{children:e&&e.length>0&&e.map(({completed:v,completionTime:m,contentType:b,icon:g,image:y,isIntroduction:C,optional:k,slug:E,subsectionId:_,title:T,type:L})=>{const P=i&&t||C,z={};return y&&(z.style={"--image":`url(${y})`}),c.jsx("li",{className:K({article:b===jr.ARTICLE,discussion:b===jr.DISCUSSION,quiz:b===jr.QUIZ,completed:v&&b===jr.ARTICLE,locked:!P}),...z,children:c.jsx(Dn,{href:P?`/microcourses/en/${o}/${E}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${xd(T)}`,gtmType:"article-click",children:c.jsxs(c.Fragment,{children:[c.jsx(xh,{sectionId:a,subsectionId:_,title:T,className:"course-title"})," ",c.jsx(wh,{completionTime:m,icon:g,optional:k,type:L,children:d&&d[E]&&c.jsx("span",{className:"quiz-score",children:`${d[E]}%`})})]})})},E)})})]})};const qk=({isComplete:e=!1,onClick:t,...n})=>{const r=ie.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),c.jsx(Ae,{...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:K("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})},Uk=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:i}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:i}}),ud=[{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 ji="notFoundError_",Wk=()=>{const e=ie.useIntl(),t=[];return ud.forEach((n,r)=>{n.title=e.formatMessage({id:`${ji}post_${r+1}`}),t.push("solutionArticle")}),c.jsxs(ch,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:c.jsxs(kn,{children:[c.jsx(yh,{cards:ud,cardTypes:t,buildCardData:n=>new Promise((r,i)=>{r(n)})}),c.jsx(Ae,{href:"/solution-articles/",children:e.formatMessage({id:`${ji}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[c.jsx("h1",{children:e.formatMessage({id:`${ji}title`})}),c.jsx("p",{children:e.formatMessage({id:`${ji}text`})})]})};exports.ASSETS_BUCKET=Gt;exports.ActionBar=wf;exports.ActionButton=Zr;exports.ActivitiesFeed=lv;exports.ActivitySection=hk;exports.ActivityType=yr;exports.AddPost=mu;exports.Badge=Ud;exports.BadgeScope=ut;exports.Badges=Wd;exports.BadgesContext=go;exports.BadgesProvider=Od;exports.Banner=Dk;exports.BannerSection=kk;exports.Breadcrumbs=Bv;exports.Buckets=lp;exports.Button=Ae;exports.ButtonWrapper=vr;exports.COURSE_CONTENT_TYPES=jr;exports.CacheProvider=Md;exports.Card=pu;exports.CardBlock=yh;exports.Carousel=Rk;exports.CharacterLimit=No;exports.Checkbox=Io;exports.CollapsibleSection=ma;exports.Columns=_f;exports.CommunityDetails=Bg;exports.ContactFooter=M_;exports.ContactForm=rh;exports.ContentTypeLabel=Bd;exports.Contributors=xo;exports.ConversationContext=_a;exports.CookieBanner=lh;exports.CourseProgression=Lk;exports.CourseStructure=zk;exports.CustomContentBanner=Fk;exports.CustomEvents=rt;exports.DELETED_USER_ID=Vr;exports.Directory=yk;exports.DiscussionContentType=Be;exports.DiscussionConversation=mh;exports.DiscussionForm=oi;exports.DiscussionFormCard=ph;exports.DiscussionFormModal=bh;exports.DiscussionPost=ui;exports.DiscussionThread=vh;exports.Divider=zt;exports.DownloadSection=S_;exports.EMAILS=Qn;exports.EditSection=P_;exports.EmailHelperTextBox=Ff;exports.EmptyStateBox=Qt;exports.EnrichedUrl=Oo;exports.FeatureFlags=Id;exports.Filters=Cf;exports.FlagsProvider=Nd;exports.Footer=du;exports.Form=Xt;exports.Formatting=Z;exports.Fragment=St;exports.FullWidthSection=kn;exports.GET_STREAM_USER_PREFIX=Ss;exports.GlobalProviders=xp;exports.Header=fu;exports.HelperTextBox=Sd;exports.HiddenFromScreenReaders=da;exports.HideShowTextBox=jd;exports.HighlightSection=Bk;exports.HighlightedTextBox=_t;exports.INVALID_TOKEN=Cd;exports.IconBulletedList=fp;exports.ImageContainer=ap;exports.IntlProvider=Rd;exports.InviteForm=ih;exports.InviteModal=gk;exports.JoinButton=Eo;exports.Label=aa;exports.LanguageContext=vo;exports.LanguageSwitcher=Sv;exports.LessonName=xh;exports.LessonType=wh;exports.LikesButton=pf;exports.LikesFeed=bf;exports.LikesModal=yf;exports.Link=Dn;exports.LoadMore=ii;exports.LoadingBlock=Vd;exports.LoadingPlaceholder=Nt;exports.LoadingState=pa;exports.Logo=Mo;exports.LogoSection=O_;exports.MEMBERS_PER_PAGE=dh;exports.MENTION_REGEX=Dd;exports.MarkCompleteButton=qk;exports.MarkdownText=On;exports.MarketingBlock=Tk;exports.Marks=Kt;exports.Member=an;exports.MembersList=fh;exports.Modal=wo;exports.MoreMenu=Df;exports.NUMBER_OF_COUNTRIES=Wh;exports.NUMBER_OF_USERS=Uh;exports.NarrowCard=$k;exports.NavigationMenu=Ef;exports.NotFoundError=Wk;exports.Overlay=ln;exports.OverlayContext=bo;exports.OverlayProvider=zd;exports.PageHeading=qd;exports.PageLayout=ch;exports.PasswordForm=w_;exports.PasswordRules=jf;exports.Pill=Yt;exports.Poll=hh;exports.Popover=Ad;exports.Portal=br;exports.ProfileForm=ah;exports.ProfileImageChange=nh;exports.ProfileModal=ka;exports.ProfileModalLauncher=hu;exports.ProfilePicture=un;exports.ProgressBar=yo;exports.ProgressTracker=op;exports.PublishArticleForm=E_;exports.Rating=Yv;exports.RepliesFeed=vf;exports.ResponsesHeading=gh;exports.ResponsiveImage=Cn;exports.ResultsVisibility=la;exports.ReturnToNavButton=up;exports.RichTextEditor=cu;exports.SearchForm=oh;exports.ShareLink=xf;exports.ShareLinks=Iv;exports.SignupForm=T_;exports.Span=Ms;exports.StatusBanner=ur;exports.TableOfContents=Ck;exports.Tabs=Rv;exports.Tags=L_;exports.TestimonialBlock=wk;exports.TimeToComplete=Fa;exports.Toggle=y_;exports.Tooltip=Ln;exports.TopLevelPage=N_;exports.UUID_V4_REGEX=Hr;exports.UserContext=it;exports.UserProvider=$d;exports.VisuallyHidden=Me;exports.addAriaProps=sf;exports.basicReducer=pr;exports.camelCaseToDashCase=yd;exports.checkIntlPathExists=fa;exports.enrichPostCategories=Po;exports.generateConditions=Ui;exports.generateCssIcon=Vh;exports.getAuthorData=xr;exports.getCharacterLimitProps=kf;exports.getLongDate=ho;exports.getMember=ga;exports.getPostBody=jo;exports.getShortDate=Ed;exports.getValueLength=va;exports.headerData=ri;exports.likesResponseMock=Fv;exports.mapGetStreamData=Uk;exports.pageReady=_d;exports.passwordValidator=Ps;exports.repliesFeedMock=cv;exports.supportedLanguages=Mi;exports.toCamelCase=xd;exports.toCapitalisedCase=qh;exports.toSentenceCase=wd;exports.transformSlugs=Ls;exports.useAutoResize=md;exports.useBadges=Pd;exports.useCurrentPath=hd;exports.useEffectAfterMount=or;exports.useElementWidth=wn;exports.useOverlay=Ld;exports.useScrollListener=gd;exports.useScrollToHash=fo;exports.useTooltips=mo;exports.useUser=ha;
165
+ `}),O=U.turndown(O)}o&&o.mentions&&(O=await kd({text:O,template:`[${to}{{name}}]({{id}})`,mentions:o.mentions,listMembers:p||(()=>Promise.resolve([]))})),pE(O,U=>{const ee=[{type:"initialValue",value:U},{type:"editorKey",value:P.toString()}];o!=null&&o.link&&(ee.push({type:"enrichedUrl",value:o.link}),o.link.url&&ae(o.link.url)),T(ee),setTimeout(()=>{T([{type:"stringValue",value:Kc(q)}])},150)})})()},[P]),x.useEffect(()=>{if(H===void 0&&q){const O=bE(q);O&&ae(O)}const N=O=>{var W;const U=O,ee=((W=U==null?void 0:U.detail)==null?void 0:W.url)||null;ee&&H&&H.url===ee&&T([{type:"enrichedUrl",value:void 0}])};return window.addEventListener("linkRemoved",N),()=>{window.removeEventListener("linkRemoved",N)}},[H]),x.useEffect(()=>{if(t){Hr.lastIndex=0;const N=t.match(Hr);N&&N.length===1&&N[0].length===t.length&&!S&&T([{type:"originalValue",value:t}])}t!==""||!q||Wi(P,t)&&!S||(w.withoutNormalizing(q,()=>{te.delete(q,{at:{anchor:w.start(q,[]),focus:w.end(q,[])}}),te.deselect(q),q.children.length!==0&&te.unwrapNodes(q,{at:[0]}),te.insertNodes(q,k,{at:[0]})}),T([{type:"initialValue",value:k},{type:"lastAnchor",value:null},{type:"enrichedUrl",value:!1}]))},[t]),x.useEffect(()=>{b({link:H})},[H]),x.useEffect(()=>{M===""&&H&&T([{type:"enrichedUrl",value:void 0}])},[M]);const j=Wr(()=>{xE({editor:q,isShowing:V.show,numberOfUsers:V.numberOfUsers,listMembers:p,dispatch:T})},100);return z?c.jsx("div",{id:X,className:"rich-text-editor input text-medium",children:c.jsxs(cn.Provider,{value:{..._,id:X,isInOverlay:h,dispatch:T,onMention:y,reportError:C},children:[c.jsxs(Iw,{editor:q,initialValue:z,onChange:N=>{if(q.operations.some(U=>U.type!=="set_selection")){let U=CE(N);U==="<br>"&&(U=""),m(U,H),T([{type:"stringValue",value:Kc(q)}]),S||T([{type:"hasInteracted",value:!0}]),j(),f&&console.log({serialized:U,json:N})}},...u,children:[c.jsx(Aw,{className:"editor",renderElement:D,renderLeaf:Q,placeholder:n||d.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onPaste:async N=>{const O=H!==!1,U=N.clipboardData.getData("text");if((W=>{try{return new URL(W),!0}catch{return!1}})(U)){let W=U;if(U){const{full:ne}=po(U);W=ne}if(U&&g&&!O){const ne=await g(W);ne.url&&T([{type:"enrichedUrl",value:ne}])}}},onKeyDown:N=>{if(N.key==="Enter"){V.show&&(N.preventDefault(),N.stopPropagation(),zm(q,V,T,X));const{selection:O}=q;if(O){const U=G.isCollapsed(O),[ee,W]=w.node(q,O,{depth:1});let ne=ee,de=ne.type;const J=ne.children[0];if(J&&(J==null?void 0:J[Z.h3])===!0&&(N.stopPropagation(),N.preventDefault(),te.insertNodes(q,k)),J&&[Z.ol,Z.ul].includes(J.type)&&(ne=J,de=J.type),ne&&he.isElement(ne)&&de!==Z.paragraph){if(de===Z.blockquote&&!N.shiftKey){N.stopPropagation(),N.preventDefault(),te.insertNodes(q,k);return}if(U){const[ve,me]=w.parent(q,O,{edge:"end"}),Ee=ve.type;if([Z.ul,Z.ol].includes(de))if(N.stopPropagation(),N.preventDefault(),Ee===Z.li&&F==="Enter"){ve.children.length===1&&"text"in ve.children[0]&&ve.children[0].text===""&&te.removeNodes(q,{at:me}),te.insertNodes(q,k,{at:$.next(W)}),te.select(q,w.end(q,$.next(W)));return}else{const[Ce,ze]=gE(q,Z.li),We={type:Z.li,children:[{text:""}]};te.insertNodes(q,We,{at:$.next(ze)}),te.select(q,w.end(q,$.next(ze)))}}}}}else if(N.key==="Escape"){if(V.show){N.preventDefault(),N.stopPropagation(),T([{type:"mentionPopover",value:{...V,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(N.key)&&V.show){N.preventDefault(),N.stopPropagation();const{selectedUser:O,possibleUsers:U}=V;let ee=N.key==="ArrowUp"?O-1:O+1;ee<0&&(ee=U.length-1),ee>=U.length+1&&(ee=0),T([{type:"mentionPopover",value:{...V,selectedUser:ee}}])}T([{type:"lastKey",value:N.key}]),yE(N,q,T,C)},onBlur:()=>{q.selection&&T([{type:"lastAnchor",value:q.selection.anchor}])},onFocus:()=>{if(A){if(!$.isPath(A.path)||!le.has(q,A.path))return;const N=le.get(q,A.path);let O=0;if(ge.isText(N)?O=N.text.length:N.children&&(O=N.children.length),A.offset>O)return;try{te.select(q,{anchor:A,focus:A})}catch(U){const ee=U.message;C(`Error focusing editor: ${ee}`)}}}}),H?c.jsx(Oo,{data:H,variant:"condensed",onClick:()=>{T([{type:"enrichedUrl",value:!1}]);const N=new CustomEvent("ariaLive",{detail:{message:d.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_live"})}});document.dispatchEvent(N)},"aria-label":d.formatMessage({id:"richTextEditor_link_enrichedUrl_aria"},{title:H.title||d.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_fallback"})})}):c.jsx(c.Fragment,{}),c.jsx(PE,{styling:l==null?void 0:l.toolbar}),p?c.jsx(DE,{onFallbackClick:v}):c.jsx(c.Fragment,{})]},L),c.jsx(No,{id:`character-limit-${e}`,limit:r,valueLength:va(M)})]})}):c.jsx(c.Fragment,{})};const y_=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:a=!1,className:s=""})=>{const[o,l]=x.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);x.useEffect(()=>{r&&l(r)},[r]);const u=d=>{a||(l(d),i(d))};return c.jsxs("div",{className:K("toggle",s),onClick:d=>{d.preventDefault(),d.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[c.jsx("p",{children:t}),c.jsx("ul",{className:K("toggle-options",{disabled:a,on:o===n[1].value}),children:n.map(d=>{const f=`${e}-${d.value}`;return c.jsxs("li",{className:"hidden",children:[c.jsx("input",{type:"radio",id:f,name:e,value:d.value,checked:o===d.value,onChange:()=>u(d.value),disabled:a}),c.jsx("label",{htmlFor:f,children:d.label})]},f)})})]})};function nh({className:e="",userId:t,userName:n,src:r,uploadImage:i,button:a,callback:s}){const o=ie.useIntl(),l="profileImageChange_",[u,d]=x.useState(r),[f,h]=x.useState(!1),[p,v]=x.useState(!1),m=x.useRef(null),b=async k=>{h(!0),v(!1);try{const E=k.target.files&&k.target.files[0];if(!E||!t)throw h(!1),new Error("Image file or userID is missing");const _=await i({fileObject:E,userId:t}),T={thumbnail:_.thumbnailURL,full:_.originalURL};d(T),s(T)}catch{v(!0)}finally{h(!1)}h(!1)},{upload:g=o.formatMessage({id:`${l}cta_upload`}),change:y=o.formatMessage({id:`${l}cta_change`}),uploading:C=o.formatMessage({id:`${l}cta_uploading`})}=(a==null?void 0:a.text)||{};return c.jsxs("div",{className:K("profile-image-change-figure",e),children:[c.jsx(un,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),p&&c.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),c.jsx("input",{id:"file",type:"file",accept:"image/*",ref:m,onChange:b,hidden:!0,"data-testid":"file-input"}),c.jsx(Ae,{onClick:()=>m.current&&m.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:f,children:f?C:u?y:g})]})}const rh=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=e||{};return c.jsx(Xt,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}],autoComplete:"name"},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:i},functions:{onSuccess:t,onFailure:n},button:{className:"new"}})};const x_=({emails:e,setEmails:t,setIsDisabled:n})=>{const{formatMessage:r}=ie.useIntl();return c.jsx(Ph.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:r({id:"inviteForm_email_placeholder"}),emails:e,onChange:i=>{t(i),n(!i.length)},autoFocus:!1,getLabel:(i,a,s)=>c.jsxs("div",{className:"email text-medium",children:[c.jsx("div",{"data-tag-item":!0,children:i}),c.jsx(Ae,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{s(a),n(!e.length)},className:"remove-email-button",screenreaderText:r({id:"overlay_close"})})]},a)})},ih=({title:e,label:t,messagePlaceholder:n,ctaMessage:r,titleColor:i,labelColor:a,backgroundColor:s,onClose:o,reportError:l,sendInvites:u,initialFormStatus:d="NOT_SUBMITTED",gtm:f={context:"Form",event:"form-submit-click"},secondaryActionButton:h,meta:p})=>{const[v,m]=x.useState([]),[b,g]=x.useState(!0),[y,C]=x.useState(d),{formatMessage:k}=ie.useIntl(),E=async L=>{try{await u(v,L.message),m([]),C("SUCCESS")}catch(P){C("ERROR"),l(P)}},_=L=>{L.preventDefault(),C("NOT_SUBMITTED"),g(!0),m([])},T=L=>{L.preventDefault(),o(),C("CLOSED")};return y==="CLOSED"?null:y==="ERROR"||y==="SUCCESS"&&!(p!=null&&p.shouldHideDoneButtonOnSubmit)?c.jsxs("div",{className:"invite-form-wrapper",children:[c.jsx("div",{className:"content centred",children:y==="SUCCESS"?c.jsx("h2",{className:"success-title",children:k({id:"inviteForm_success"})}):c.jsxs("h2",{className:"error-title",children:[" ",k({id:"inviteForm_error"})]})}),c.jsx(zt,{}),c.jsx("div",{className:"footer",children:y==="SUCCESS"?c.jsxs(c.Fragment,{children:[c.jsx(Ae,{variant:"secondary",onClick:_,children:k({id:"inviteForm_ctaSendMoreInvites"})}),c.jsx(Ae,{onClick:T,children:k({id:"inviteForm_ctaDone"})})]}):c.jsx(Ae,{onClick:_,children:k({id:"inviteForm_ctaTryAgain"})})})]}):c.jsxs("div",{className:"invite-form-wrapper",style:{backgroundColor:s},children:[c.jsxs("div",{className:"content",children:[c.jsx("h2",{className:"title",style:{color:i},children:e}),c.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t})]}),c.jsx(Xt,{id:"invite-form",fields:[{component:x_,props:{emails:v,setEmails:m,setIsDisabled:g},required:!0},{id:"message",type:"textarea",label:k({id:"inviteForm_message_label"}),placeholder:n||k({id:"inviteForm_message_placeholder"})}],functions:{onSuccess:E},button:{text:r,size:"medium",disabled:b},gtm:f,meta:p,secondaryActionButton:h})]})},Ui=e=>e.map(t=>({condition:t})),Tt={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},w_=({functions:e,...t})=>{const{formatMessage:n}=ie.useIntl(),[r,i]=x.useState(null),[a,s]=x.useState(!1),[o,l]=x.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=p=>p[Tt.NEW_PASSWORD]!==p[Tt.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,d=p=>!Ps(p[Tt.NEW_PASSWORD]).isValid,f=[{"data-testid":Tt.NEW_PASSWORD,id:Tt.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:Ui(["required",d]),functions:{onChange:p=>l(Ps(p).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":Tt.CONFIRMED_PASSWORD,id:Tt.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:Ui(["required",u])}];t.isPasswordChange&&f.unshift({"data-testid":Tt.CURRENT_PASSWORD,id:Tt.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:Ui(["required"])}),a&&f.push({component:jf,props:{matchingRules:o}});const h={id:Tt.FORM_ID,fields:f,functions:{...e,onSuccess:async p=>(e.createPassword(p),e.onSuccess&&e.onSuccess(p)),onCatch:p=>i(p==null?void 0:p.statusCode),onFailure:(p,v)=>{(v.includes(Tt.NEW_PASSWORD)||v.includes(Tt.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return c.jsxs(c.Fragment,{children:[c.jsx(Xt,{...h}),r&&c.jsx(Qt,{variant:"error",text:r})]})};const ah=({isCreateProfile:e=!1,hooks:t,functions:n,meta:r={},gtm:i,...a})=>{var L;const s=ie.useIntl(),o="profileForm_",l=x.useContext(it),[u,d]=x.useState(l.image),[f,h]=x.useState(!1),{uploadImage:p=()=>{},onSuccess:v=async P=>{},onCancel:m=()=>{},onFailure:b=()=>{}}=n,{buildLocation:g,isValidPlace:y,predictPlaces:C}=t.useMaps(),{context:k="ProfileForm",event:E="profile-form-submit-click"}=i||{},_=[{id:"jobTitle",type:"text",label:s.formatMessage({id:`${o}jobTitle`}),placeholder:s.formatMessage({id:`${o}jobTitle_placeholder`}),value:l.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:s.formatMessage({id:`${o}organization`}),placeholder:s.formatMessage({id:`${o}organization_placeholder`}),value:l.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:s.formatMessage({id:`${o}location`}),placeholder:s.formatMessage({id:`${o}location_placeholder`}),value:(L=l.location)==null?void 0:L.en,validation:[{condition:"required"},{condition:({location:P})=>P&&!f?!1:!y(P),error:s.formatMessage({id:`${o}location_error`})}],functions:{onChange:()=>{f||h(!0)},onKeyInput:C}}],T=[{component:nh,props:{userName:l.name,userId:l.id,src:u,uploadImage:p,callback:d,button:{text:{upload:s.formatMessage({id:`${o}image`})}}}},{id:"name",type:"text",label:s.formatMessage({id:`${o}name`}),placeholder:s.formatMessage({id:`${o}name_placeholder`}),value:l.name,autoComplete:"name",validation:[{condition:"required"}]},..._,{id:"biography",type:"textarea",label:s.formatMessage({id:`${o}bio`}),placeholder:s.formatMessage({id:`${o}bio_placeholder`}),limit:1e3,value:l.biography},{component:zt}];return c.jsx(Xt,{id:"profile-details-form",fields:e?_:T,meta:{shouldShowCancelButton:!e,shouldReset:!1,shouldHide:!1,showRequiredLabels:e,...r},intlPath:o,gtm:{context:k,event:E},functions:{onSuccess:async P=>{try{const z={...P,image:u||null,location:f?await g(P==null?void 0:P.location):l.location,...e?{onboardingState:"completed"}:{}};l.updateDetails&&l.updateDetails(M=>({...M,...z})),await v(z)}catch{b()}},onCancel:m,onFailure:b},button:{size:"large",text:{default:s.formatMessage({id:`${o}cta`}),submitting:s.formatMessage({id:`${o}cta_submitting`}),submitted:s.formatMessage({id:`${o}cta_submitted`})}},...a})},C_=()=>{const e=ie.useIntl(),[t,n]=x.useState(0);return x.useEffect(()=>{const r=setInterval(()=>{n(i=>{if(i>=95)return clearInterval(r),95;const a=Math.round(Math.random()*10);return Math.min(i+a,95)})},800);return()=>{clearInterval(r)}},[]),c.jsx(Vd,{progress:t,steps:{0:{icon:"layers",text:e.formatMessage({id:"publishArticleForm_progressBar"})}}})};function D_({coverImage:e,setShowImagePicker:t}){return e&&e.url?c.jsx(Qt,{className:"cover-image-preview",text:c.jsx(Cn,{className:"cover-image",image:{description:e.description||"",height:e.height,width:e.width,url:e.url,color:e.color,type:"image/jpeg"}}),button:{component:c.jsx(Ae,{variant:"tertiary",onClick:()=>t(!0),children:c.jsx(ie.FormattedMessage,{id:"publishArticleForm_replaceImage_button"})})}}):c.jsx(Qt,{button:{component:c.jsx(Ae,{variant:"secondary",onClick:()=>t(!0),children:c.jsx(ie.FormattedMessage,{id:"publishArticleForm_selectImage_button"})})}})}var sh=(e=>(e.CitiesAndLocalGovernment="topic_CitiesAndLocalGovernment",e.Climate="topic_Climate",e.DigitalAndData="topic_DigitalAndData",e.Education="topic_Education",e.EquityJusticeAndInclusion="topic_EquityJusticeAndInclusion",e.HealthAndSocialCare="topic_HealthAndSocialCare",e.Innovation="topic_Innovation",e.LeadershipAndSkills="topic_LeadershipAndSkills",e.LifeInGovernment="topic_LifeInGovernment",e.Policymaking="topic_Policymaking",e.TransportAndInfrastructure="topic_TransportAndInfrastructure",e.WorkingAndTheEconomy="topic_WorkAndTheEconomy",e))(sh||{});let ys=null;const et="publishArticleForm_",td={},nd=10,E_=({id:e="publish-article-form",values:t=td,setShowImagePicker:n,functions:r,meta:i,gtm:a})=>{var P;const s=ie.useIntl(),o=x.useContext(it),{create:l,onSuccess:u=()=>{},onFailure:d=()=>{}}=r||{},{isInOverlay:f=!1}=i||{},[h,p]=x.useState(!1),[v,m]=x.useState(t.body||""),[b,g]=x.useState(!1),[y,C]=x.useState("");x.useEffect(()=>{Wi(t,td)||Kr(t.body)&&t.body!==v&&t.body!==void 0&&m(t.body)},[t.body]);const k=()=>{!o||!o.id?g(s.formatMessage({id:`${et}error_loggedOut`})):b&&g(!1)},E=z=>({condition:M=>{const A=M[z];return!A||typeof A!="string"?!0:A.length<nd},error:s.formatMessage({id:`${et}error_underMinLength`},{length:nd})}),_=!!v&&Kr(v),T=()=>c.jsxs(c.Fragment,{children:[c.jsx(zt,{}),c.jsx("p",{className:"text-medium",children:s.formatMessage({id:`${et}disclaimer`})})]}),L=[{id:"title",type:"textarea",value:t.title||"",limit:65,label:s.formatMessage({id:`${et}title_label`}),placeholder:s.formatMessage({id:`${et}title_placeholder`}),styling:{autosizeToFit:!0},functions:{onChange:k},validation:[{condition:"required"},E("title")]},{id:"subtitle",type:"textarea",value:t.subtitle,limit:115,label:s.formatMessage({id:`${et}subtitle_label`}),styling:{autosizeToFit:!0},placeholder:s.formatMessage({id:`${et}subtitle_placeholder`}),functions:{onChange:k},validation:[{condition:"required"},E("subtitle")]},{component:aa,props:{formID:e,label:{visible:s.formatMessage({id:`${et}body_label`})},showLabel:!0}},{component:cu,props:{id:`${e}-input`,value:v,placeholder:s.formatMessage({id:`${et}body_placeholder`}),meta:{isInOverlay:f},autoFocus:!1,functions:{onChange:z=>{m(z),k()}},styling:{toolbar:{showHeadingOption:!0}},"aria-invalid":!!b,"aria-errormessage":"error-message"}},{id:"tags",label:s.formatMessage({id:`${et}tags_label`}),type:"checkboxes",styling:{displayOptionsAsPills:!0},options:Object.values(sh).map(z=>({id:z,label:s.formatMessage({id:`${et}_tags_${z}`})})),multipleOptions:{limit:3},validation:[{condition:"required",error:s.formatMessage({id:`${et}tags_error_required`})},{condition:z=>{var M;return((M=z==null?void 0:z.tags)==null?void 0:M.length)>3},error:s.formatMessage({id:`${et}tags_error_over_three`})}]},{component:aa,props:{formID:e,label:{visible:s.formatMessage({id:`${et}cover_image_label`})},showLabel:!0}},{component:D_,props:{coverImage:t.coverImage||{},setShowImagePicker:n}}];return h?L.push({component:zt}):L.push({component:T}),c.jsxs("section",{className:"publish-article-form",children:[c.jsx(Xt,{id:e,meta:{shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,shouldScrollOnSuccess:!1},functions:{onSuccess:async z=>{if(!o||!o.id||!_)return;ys&&clearTimeout(ys),p(!0);const M={...z,body:v,coverImage:t.coverImage};try{l&&await l(M),ys=setTimeout(()=>{C(s.formatMessage({id:`${et}aria_success`})),u(M)},500)}catch{g(s.formatMessage({id:`${et}error`})),C(""),d()}},onFailure:d},fields:L,intlPath:et,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":a==null?void 0:a.context,"data-gtm-event-type":"publish-article-click",disabled:!o||!o.id||!_||!((P=t==null?void 0:t.coverImage)!=null&&P.url),text:{default:s.formatMessage({id:`${et}cta_submit`}),submitting:s.formatMessage({id:`${et}cta_submitting`}),submitted:s.formatMessage({id:`${et}cta_submitted`})},customOnSubmit:b?c.jsx(c.Fragment,{}):c.jsx(C_,{})},gtm:a}),b&&c.jsx(ur,{id:"error-message",className:"error",children:typeof b=="string"&&b.includes(" ")?b:s.formatMessage({id:`${et}error`})}),y&&c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:y})]})};const oh=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:a="form-submission"})=>{const{searchIsOpen:s=!0,isDesktopVersion:o=!1}=n||{},l=ie.useIntl(),u=x.useRef(null);or(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const d=f=>{f.preventDefault(),f.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return c.jsx("form",{onSubmit:d,className:K("search-form gtm-trackable",t),role:"search","data-gtm-event-context":i,"data-gtm-event-type":a,children:c.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:c.jsxs("p",{children:[c.jsx(Me,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),c.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:f=>{f.key==="Enter"&&d(f)}}),c.jsx("button",{className:"clear",onClick:f=>{f.preventDefault(),f.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:c.jsx(Me,{children:l.formatMessage({id:"search_clear"})})}),c.jsx("button",{className:"search",onClick:d,children:c.jsx(Me,{children:l.formatMessage({id:"search_cta"})})})]})})})},rd=async({ref:e,validateEmail:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const i=e.current.value.toString().toLowerCase().trim(),a={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let s=Object.assign({},a);try{s=await t(i),s===void 0&&(s=a)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:o=!1,autoApproved:l=!1,exists:u}=s;let d="";return o?d=l?"gov":"nonGov":u.registration?u.engagement&&!u.user?d=u.auth?"verify":"pending":d="exists":u.auth&&(d="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!l},{type:"emailDetails",value:{email:i,boxType:d,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(i)}},{type:"validFields.email",value:!0}])},__=e=>{const t={};for(const n of e.entries())t[n[0]]=n[1];return{name:t.full_name.toString().trim(),email:t.email_address.toString().toLowerCase().trim(),jobTitle:t.job_title,organization:t.organization,bioLink:t.url,optIn:!0,expectation:t.expectation,page:window.location.pathname,"g-recaptcha-response":t["g-recaptcha-response"]}},k_=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:i,state:a})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const s=__(new FormData(e.form.current)),o=Object.assign(s,t);await n(o),localStorage.setItem("email",s.email),r&&r({...s,...a.values}),i([{type:"showSuccessMessage",value:!0}])},F_=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:i},refs:a,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:d}=s,f=(p,v)=>{p.current&&s.validFields[v]!==p.current.validity.valid&&o([{type:`validFields.${v}`,value:p.current.validity.valid}])},h=[{id:"full_name",type:"text",inputRef:a.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>f(a.name,"name"),onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:a.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{rd({ref:a.email,validateEmail:r,dispatch:o})},onChange:(p,v)=>{o([{type:"shouldDisableButton",value:!0}]),v&&v({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Ff,props:{email:d.email,type:d.boxType,resendVerificationCode:i}}];return s.shouldManuallyApprove&&(h.push({id:"job_title",type:"text",inputRef:a.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>f(a.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:a.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{f(a.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&h.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:p=>c.jsx("small",{children:p})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&h.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:p=>c.jsx("small",{className:"notes text-small",children:p})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),h.push({id:"terms",className:"text-small",type:"checkbox",inputRef:a.tc,label:u.formatMessage({id:"signup_terms"},{terms:p=>c.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:p}),privacy:p=>c.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:p})}),shownValue:"accepted",functions:{onChange:p=>{if(!p)return;const v=[];["name","email"].forEach(m=>{s.validFields[m]!==a[m].current.validity.valid&&(v.push({type:`validFields.${m}`,value:a[m].current.validity.valid}),m==="email"&&rd({ref:a.email,validateEmail:r,dispatch:o}))}),v.length&&o(v)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),h};const A_=({className:e=""})=>c.jsxs("div",{className:K("success-message",e),"data-testid":"success-message",children:[c.jsx("p",{className:"success-title",children:c.jsx(ie.FormattedMessage,{id:"signup_success_title"})}),c.jsx(ie.FormattedMessage,{id:"signup_success_text",values:{p:t=>c.jsx("p",{children:t})}})]});const B_={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},T_=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:i={},submitButton:a,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=ie.useIntl(),{title:u=!0,expectation:d=!1,url:f=!0,logInButton:h=!0,successMessage:p=!0}=i,v={title:u,expectation:d,url:f,logInButton:h,successMessage:p},[m,b]=x.useReducer(pr,B_),{validFields:g,emailDetails:y,shouldManuallyApprove:C,shouldDisableButton:k,showSuccessMessage:E,showError:_}=m,[T,L]=co.useCookies(["signup-this-session","functional-cookie-consent"]),P={form:x.createRef(),name:x.createRef(),email:x.createRef(),jobTitle:x.createRef(),organisation:x.createRef(),tc:x.createRef(),hiddenValidation:x.createRef()};x.useEffect(()=>{C===!0&&P.jobTitle.current&&P.jobTitle.current.focus()},[C]),x.useEffect(()=>{T["signup-this-session"]&&b([{type:"showSuccessMessage",value:!0}])},[T]),x.useEffect(()=>{E&&T["functional-cookie-consent"]&&L("signup-this-session","true",{path:"/",maxAge:3600})},[E]);const z=x.useMemo(()=>F_({placeholders:n,labels:t,shouldShow:v,functions:r,refs:P,state:m,dispatch:b,dataToSubmit:s,intl:l}),[s,r,l,P,v,m]),M=k?!0:C?!Object.values(g).every(A=>A===!0):!g.name||!g.email||["exists","pending","verify"].includes(y.boxType);return v.successMessage&&E?c.jsx(A_,{className:e}):c.jsxs("fieldset",{className:K("signup-form-fieldset",e),"data-testid":"signup-form",children:[v.title&&c.jsx("p",{className:"signup-title",children:c.jsx(ie.FormattedMessage,{id:"signup_title"})}),_&&c.jsx(Qt,{variant:"error",text:l.formatMessage({id:"signup_error"})}),c.jsx(Xt,{className:"signup-form",formRef:P.form,id:"sign-up-form",fields:z,intlPath:"signup",button:{variant:"primary",size:"medium",text:a||l.formatMessage({id:"signup_button_join"}),disabled:M?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:`/api/next-ui/login?returnTo=${window.location.pathname}`,"data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:v.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await k_({refs:P,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:b,state:m})},onCatch:A=>{r.handleError(A),b([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),c.jsx("button",{className:"validation-button",ref:P.hiddenValidation})]})};const kn=({children:e,className:t="",styling:n={},...r})=>{const{background:i="default",padding:a="none"}=n;return c.jsx("section",{className:K("full-width-section",t,{[i]:i!=="default",[a]:a!=="none"}),...r,children:e})};const S_=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(i=>{r.push({href:i.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable new","data-gtm-event-type":"download-click","data-gtm-event-context":i.eventContext||"Download",target:"_blank",children:i.text})}),c.jsx(kn,{className:K("download-section",n),styling:{background:"dark"},children:c.jsxs("div",{className:"content-default",children:[x.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),c.jsx(vr,{buttons:r})]})})};const lo="editSection_";function uh({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const j_=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:i,setShowModal:a})=>{const{formatMessage:s}=ie.useIntl();return c.jsxs(_t,{variant:"muted",icon:e,children:[c.jsx("p",{children:t||s({id:`${lo}placeholder_description`})}),i&&c.jsx("p",{children:c.jsx(Ae,{href:r,variant:"secondary",size:"small",onClick:()=>uh({href:r,setShowModal:a}),children:n||s({id:`${lo}placeholder_cta`})})})]})},P_=({children:e,className:t="",formProps:n,formComponent:r,href:i,title:a,showTitle:s=!0,modalTitle:o,placeholder:l,showDivider:u=!0})=>{const{formatMessage:d}=ie.useIntl(),[f,h]=x.useState(!1),p=()=>h(!1),v=!!n||!!r,m=typeof i=="string"||v;let b;return r&&(b=x.cloneElement(r,{functions:{...r.props.functions,onSuccess:async g=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(g)}finally{p()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),p()}}})),c.jsxs("section",{className:K("edit-section",t),children:[v&&c.jsx(ln,{title:o||`Edit ${a}`,isOpen:f,showDivider:!1,showIcon:!1,functions:{onClose:p},className:K("edit-section-modal"),children:b||(n?c.jsx(Xt,{...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 g=>{var y,C;(y=n==null?void 0:n.functions)!=null&&y.onSuccess&&await((C=n==null?void 0:n.functions)==null?void 0:C.onSuccess(g)),h(!1)},onCancel:p}}):c.jsx(c.Fragment,{}))}),c.jsxs("div",{className:K("edit-section-header",{"no-title":!s}),children:[s&&c.jsx("h2",{className:"edit-section-header-title",children:a}),m&&c.jsx(Ae,{href:i,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>uh({href:i,setShowModal:h}),children:d({id:`${lo}edit`})})]}),e||c.jsx(j_,{...l,href:i,setShowModal:h,showEditButton:m}),u&&c.jsx(zt,{})]})};const O_=({title:e=!1,text:t,logos:n=[],styling:r={},className:i=""})=>{const a=n.length;if(a===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 c.jsxs("div",{className:K("logos",i,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&x.createElement(s.element,{className:K("title",s.className)},s.text),t&&c.jsx("p",{children:t}),c.jsx("ul",{className:K({"two-col":a===2||a===4,"three-col":a===5||a<=10&&a%3===0}),children:n.map(({logo:d,nameOfBusiness:f,link:h=!1,description:p=!1},v)=>{if(!d||!d.url)return null;const m=c.jsx("img",{src:d.url,width:d.width||"auto",height:d.height||"auto",alt:f});return c.jsxs("li",{children:[c.jsx("p",{className:"img-wrapper",children:h?c.jsx("a",{href:h,target:"_blank",rel:"nofollow noreferrer noopener",children:m}):m}),p&&c.jsx("small",{children:p})]},window.btoa(`${d.url}_${v}`))})})]})};let xs;const ws="contactFooter_",M_=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=x.useRef(null),[r,i]=x.useState(0),[a,s]=x.useState(!1),o=()=>{n.current&&i(n.current.clientHeight)},l=()=>{a||(s(!0),clearTimeout(xs),xs=setTimeout(()=>{o(),s(!1)},500))};return x.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(xs),window.removeEventListener("resize",l)}),[]),c.jsx(kn,{id:"contactForm",className:"contact-footer",children:c.jsxs("div",{className:"inner-wrapper",children:[c.jsx("h2",{children:c.jsx(ie.FormattedMessage,{id:`${ws}title`})}),c.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:a?{}:{minHeight:r},children:[c.jsxs("aside",{children:[c.jsx("p",{children:c.jsx(ie.FormattedMessage,{id:`${ws}text`})}),c.jsx(Dn,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:c.jsx(ie.FormattedMessage,{id:`${ws}email`})})]}),c.jsx(rh,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},N_=({activeLink:e,profile:t,...n})=>c.jsx(kn,{children:c.jsx(_f,{layout:"1-3",children:c.jsxs(c.Fragment,{children:[c.jsx(Ef,{activeLink:e,profile:t}),c.jsx(qd,{...n})]})})});const Cs="cookieBanner_",Ds=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Es=new Date(Date.now()+12*30*24*60*60*1e3),lh=()=>{const e=ie.useIntl(),[t,n,r]=co.useCookies(Ds),[i,a]=x.useState(!t["apol-cookie-banner"]),s=()=>{Ds.forEach(d=>{n(d,!0,{path:"/",expires:Es,domain:d==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),a(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Es}),Ds.forEach(d=>{if(d==="apol-cookie-banner"){n(d,!0,{path:"/",expires:Es});return}r(d)}),a(!1)};if(!i)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(d=>{u.push({variant:d.href?"tertiary":"primary",href:d.href,onClick:d.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${d.gtmType}-click`,children:e.formatMessage({id:`${Cs}buttons_${d.id}`})})}),c.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[c.jsx("h6",{children:e.formatMessage({id:`${Cs}title`})}),c.jsx("p",{children:e.formatMessage({id:`${Cs}text`})}),c.jsx(vr,{buttons:u})]})},nn={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","insights","story","team","careers","partner","contact"],news:{href:"/learning-hub/updates/",gtmType:"news-click"},insights:{href:"/learning-hub/global-insights/",gtmType:"insights-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:Qn["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Qn["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["london","washington","berlin","registered","support","business"],london:{address:!0},washington:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:Qn.support,gtmType:"concierge-email-click"},business:{email:Qn.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 rr="footer_",oa="SiteFooter",id=({group:e})=>{const t=nn[e].order||[];let n=!1;return"text"in nn[e]&&(n=nn[e].text),c.jsxs(x.Fragment,{children:[c.jsx("p",{className:"pre-title",children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}`})}),Array.isArray(t)&&t.length>0&&c.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:a}=nn[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),c.jsx("li",{children:c.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":oa,"data-gtm-event-type":a,...s,children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&c.jsx("dl",{className:"text-medium",children:n.order.map(r=>c.jsxs(x.Fragment,{children:[c.jsx("dt",{children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}_${r}`})}),c.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&c.jsx("address",{children:c.jsx(ie.FormattedMessage,{id:`${rr}${e}_${r}_address`,values:{br:c.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&c.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)},du=()=>c.jsx("div",{id:"footer",children:c.jsxs("div",{className:"wrapper",children:[c.jsx(da,{element:"hr"}),c.jsx(Mo,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":oa,"data-gtm-event-type":"logo-homepage-link"}),c.jsx("footer",{children:["platform","community","company","contact"].map(e=>c.jsxs("div",{className:"group",children:[c.jsx(id,{group:e}),Object.keys(nn[e]).includes("child")&&c.jsx(id,{group:nn[e].child})]},e))}),c.jsx("hr",{}),c.jsxs("div",{className:"sub-footer",children:[c.jsx("ul",{children:Array.isArray(nn.social.order)&&nn.social.order.map(e=>{const t=nn.social[e];return c.jsx("li",{className:e,children:c.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:c.jsx("span",{className:"hidden",children:c.jsx(ie.FormattedMessage,{id:`${rr}social_${e}`})})})},e)})}),c.jsx("small",{children:c.jsx(ie.FormattedMessage,{id:`${rr}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),Ue={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=a=>{const s=`logged${e?"In":"Out"}`;return t>=n[a][s]};let i={};return["navigation","search"].forEach(a=>{i[a]=r(a)}),i},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(i=>i===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:i=!1})=>{if(!i&&n[e]===t||!i&&e===Et.ACCOUNT&&t===!1&&n[Et.SITE]===!0)return;const a=Date.now();if(!i&&!t&&Ue.handlerCalled[e]&&a-Ue.handlerCalled[e]<500)return;Ue.handlerCalled[e]=a;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 Et.SITE:o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation .navigation-button"));break;case Et.SEARCH:o=document.querySelector("#header .toggle-search-button");break;case Et.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 i=cd(e[r],t);if(!(typeof i>"u")&&(!n||i[t]&&i[t].includes(n)||i.value&&i.value.includes(n)||i.toString().includes(n)))return e[r]}return e[0].children?Ue.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:i})=>{var l;if(!t.current||!t.current.children)return;const a=n?"desktop":"default";if(r[e][a]){(l=document.querySelector(`#header ul a[href="${r[e][a]}"]:last-child`))==null||l.focus();return}let s,o;switch(e){case Et.SITE:if(n){const u=Ue.findFirstChild(t.current.children,"className","has-submenu parent"),d=Ue.findFirstChild(u.children,"id",Et.SITE);s=Ue.findFirstChild(d.children,"href")}else s=Ue.findFirstChild(t.current.children,"href");break;case Et.ACCOUNT:if(o=Ue.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=Ue.findFirstChild(o.children,"href");break;default:return}s&&(i([{type:`focusElements.${e}.${a}`,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(Ue.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(Ue.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Ue.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Ue.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},ri={order:["home","communities","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},communities:{href:"/communities/",gtmType:"communities-click",onlyShow:"logged-in"},topics:{order:["explore","topics"],menuId:"site-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:{menuId:"account-navigation",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:"/api/next-ui/login",withReturnTo:!0},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},ua=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:i=()=>{},doTrack:a=null})=>{const s=ie.useIntl(),o=cd(ri,e);if(!o||o.onlyShow&&(o.onlyShow==="logged-in"&&!t||o.onlyShow==="logged-out"&&t))return null;const l="doTrack"in o,u=a===null?l?o.doTrack:!0:a,d=e.includes("buttons.");let f=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(f+=`_logged${t?"In":"Out"}`);let h=!1;if(o.href){let C=o.gtmType||`${e}-click`;if(C.includes(".")){const k=C.split("."),E=k[k.length-2];C=`${E==="topics"?`${E}-`:""}${k[k.length-1]}`}h={href:o.withReturnTo?`${o.href}?returnTo=${window.location.pathname}`:o.href},u&&(h={...h,className:"gtm-trackable","data-gtm-event-type":C,"data-gtm-event-context":"HeaderButtons"}),d&&(h={...h,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const p=o.order&&o.order[0]&&o[o.order[0]],v=p&&o[o.order[0]].order,m=h&&window.location.pathname===o.href;let b={},g={},y={};if(m&&(b={...b,"aria-current":"page"}),p){const C=o.menuId||e,k={onClick:E=>Ue.events.onClick(E,{id:C,callback:i,isOpen:r[C]}),onFocus:()=>Ue.events.onFocus({id:C}),onBlur:()=>Ue.events.onBlur({id:C,callback:i}),onMouseLeave:()=>Ue.events.onBlur({id:C,callback:i}),onMouseEnter:()=>Ue.events.onMouseEnter({id:C,callback:i})};g={...k,id:C===Et.SITE?Et.SITE:Et.ACCOUNT},n&&(v&&(y={...k,className:"navigation-button",onKeyPress:E=>{E.key==="Enter"&&Ue.events.onClick(E,{id:C,callback:i,isOpen:r[C]})},"aria-haspopup":!0,"aria-expanded":r[C],"aria-controls":C}),g={...g,hidden:C in r?!r[C]:!0}),v||(g={...g})}return c.jsxs("li",{className:K({[o.className]:o.className,"has-submenu":p,parent:v,active:m}),...b,children:[h?x.createElement(d?Ae:"a",h,s.formatMessage({id:f})):n&&o.order&&v?c.jsxs("button",{...y,children:[s.formatMessage({id:f}),c.jsx(Me,{children:s.formatMessage({id:`header_menu_${r[Et.SITE]?"hide":"show"}`})})]}):s.formatMessage({id:f}),o.order&&c.jsx("ul",{...g,children:o.order.map(C=>{if(!o[C])return null;const k={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:i,doTrack:l?u:null};return o[C].order?c.jsxs("li",{className:K({[o[C].className]:o[C].className}),children:[s.formatMessage({id:`${f}_${C}`}),c.jsx("ul",{children:o[C].order.map(E=>c.jsx(ua,{id:`${e}.${C}.${E}`,...k},E))})]},C):c.jsx(ua,{id:`${e}.${C}`,...k},C)})})]},e)};const I_={height:67,height_desktop:83};var Et=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(Et||{});const fu=({showNavigation:e=!0})=>{const t=ie.useIntl(),n=x.useContext(it),r=wn(!0,!0),i=n&&typeof n.id=="string",a=x.useMemo(()=>Ue.getIsDesktopVersion(i,r),[i,r]),[s,o]=x.useReducer(pr,{headerIsVisible:!0,menus:{"site-navigation":!1,search:!1,"account-navigation":!1},focusElements:{"site-navigation":{desktop:!1,default:!1},"account-navigation":{desktop:!1,default:!1}}}),{headerIsVisible:l,menus:u,focusElements:d}=s,f=x.useRef(s);x.useEffect(()=>{f.current=s},[s]),gd({scrollPosition:I_[`height${a.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const g=f.current.menus;!a&&g["site-navigation"]||Ue.shouldChangeHeaderIsVisible(!0,g,o)},scrollDown:()=>{const g=f.current.menus;!a&&g["site-navigation"]||Ue.shouldChangeHeaderIsVisible(!1,g,o)}}});const h=(g,y,C=!1)=>{Ue.handleMenus({id:g,value:y,menus:f.current.menus,dispatch:o,forceHandle:C})},p=x.useRef(null),v=g=>{g.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(y=>{f.current.menus[y]&&h(y,!1,!0)})};x.useEffect(()=>{var g;return(g=document.getElementById("header"))==null||g.addEventListener("keydown",v),()=>{var y;(y=document.getElementById("header"))==null||y.removeEventListener("keydown",v)}},[]),or(()=>{u["site-navigation"]&&Ue.autoFocus({menu:"site-navigation",navigationRef:p,isDesktopVersion:a.navigation,focusElements:d,dispatch:o})},[u["site-navigation"]]),or(()=>{u["account-navigation"]&&Ue.autoFocus({menu:"account-navigation",navigationRef:p,isDesktopVersion:a.navigation,focusElements:d,dispatch:o})},[u["account-navigation"]]);const m=c.jsxs(c.Fragment,{children:[!a.search&&c.jsx("button",{className:"search toggle-search-button",onClick:g=>{g.preventDefault(),g.stopPropagation(),h("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:c.jsx(Me,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),c.jsx(oh,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:a.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),b=c.jsxs(c.Fragment,{children:[!a.navigation&&c.jsx("button",{className:"menu-button gtm-trackable",onClick:g=>{g.preventDefault(),g.stopPropagation(),h("site-navigation",!u["site-navigation"])},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":u["site-navigation"],"aria-controls":"site-navigation",children:c.jsx(Me,{children:t.formatMessage({id:`header_menu_${u["site-navigation"]?"hide":"show"}`})})}),c.jsx("ul",{ref:p,id:"navigation",hidden:a.navigation||u["account-navigation"]?!1:!u["site-navigation"],"data-showing":!a.navigation&&u["account-navigation"]?"account":"default",children:ri.order.map(g=>c.jsx(ua,{id:g,isLoggedIn:i,isDesktopVersion:a.navigation,menus:{"site-navigation":u["site-navigation"],"account-navigation":u["account-navigation"]},callback:h},g))})]});return n&&n.isLoading?null:c.jsxs(c.Fragment,{children:[c.jsxs("nav",{id:"header",className:K({"logged-in":i,"logged-out":!i,visible:l}),children:[c.jsx(Me,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),c.jsx(Mo,{variant:"monochrome"}),e&&c.jsxs(c.Fragment,{children:[a.navigation?c.jsxs(c.Fragment,{children:[b,m]}):c.jsxs(c.Fragment,{children:[m,b]}),i?c.jsxs("button",{className:"account-button",onClick:g=>Ue.events.onClick(g,{id:"account-navigation",callback:h,isOpen:u["account-navigation"]}),onMouseEnter:()=>Ue.events.onMouseEnter({id:"account-navigation",callback:h}),onMouseLeave:()=>Ue.events.onBlur({id:"account-navigation",callback:h}),"aria-haspopup":"true","aria-expanded":u["account-navigation"],"aria-controls":"account-navigation",children:[c.jsx(Me,{children:t.formatMessage({id:`header_account_${u["account-navigation"]?"hide":"show"}`})}),c.jsx(un,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):c.jsx("ul",{className:"sign-in-buttons",children:ri.buttons.order.map(g=>c.jsx(ua,{id:`buttons.${g}`},g))})]})]}),c.jsx("hr",{id:"content-of-page"}),c.jsx("div",{className:K("overlay",{open:u["site-navigation"]||u["account-navigation"]||!a.search&&u.search})})]})};const R_=()=>{const e=ie.useIntl();return c.jsxs(c.Fragment,{children:[c.jsx(fu,{}),c.jsx("div",{id:"content",children:c.jsx(Qt,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),c.jsx(du,{})]})},ch=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:i={},styling:a={},className:s="",locale:o="en"})=>{const l=ie.useIntl(),{navigation:u=!0,footer:d=!0}=i,{background:f="default",variant:h="default",circle:p="default",modal:v="default"}=a,m=hd(),[b,g]=x.useState(""),y=T=>{const{detail:{message:L}}=T;g(L)};x.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",y),()=>{document.removeEventListener("ariaLive",y)}),[m]);const C=Oi(e,{locale:o}),k=Oi(t,{locale:o}),E=Oi(n,{locale:o}),_={};return f!=="default"&&(_[f]=!0),h!=="default"&&(_[h]=!0),p!=="default"&&(_[p]=!0),c.jsx(jh.ErrorBoundary,{onError:r,fallback:c.jsx(R_,{}),children:c.jsxs(x.Suspense,{fallback:null,children:[c.jsxs("div",{id:"wrapper",className:K(s,_,{"has-footer":d}),"data-too-small":l.formatMessage({id:"pageLayout_browserTooSmall"}),children:[c.jsx(fu,{showNavigation:u}),c.jsxs("main",{id:"content-wrapper",children:[k&&c.jsx("div",{className:K("additional-content prepended",{"large-modal":v==="large"}),children:k}),x.createElement(f==="bold"?wo:"div",{id:"content",children:C,className:K({"large-modal":v==="large"})})]}),E&&c.jsx("div",{className:"additional-content appended",children:E}),d&&c.jsx(du,{}),c.jsx(lh,{})]}),b&&c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:b})]})})},ad={default:"tags_",headerTopics:"header_topics_topics_"},_s={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"},$_={getTagDetails:e=>{if(e.includes("topic_")){if(e=_s.topic[e.replace("topic_","")],e){const t=ri.topics.topics[e].href;return t?{id:e,href:t,text:`${ad.headerTopics}${e}`}:null}return null}return _s[e]?(e=_s[e],{id:e,text:`${ad.default}${e}`}):null}};const L_=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:i="",gtmType:a="tag-click",gtmContext:s="tags"})=>{const o=ie.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const d=$_.getTagDetails(u);d&&l.push(d)}),l.length<1?null:c.jsx("ul",{className:K("tags text-small",t,i,{"one-line":n}),children:l.map(u=>{const d=o.formatMessage({id:u.text});return c.jsx("li",{children:u.href&&r?c.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":a,"data-gtm-event-context":s,children:d}):d},u.id)})})};const dh=25,z_=({members:{data:e=[],total:t=e.length},communitySlug:n,isMember:r=!1,hasNextPage:i=!1,loadNextPage:a=()=>{},profile:s,gtmContext:o="member",gtmType:l="member-click",showHeader:u=!0,showPlaceholders:d=!1,className:f=""})=>{const h=ie.useIntl(),p="membersList",v=x.useContext(it),[m,b]=x.useState(!1);return e.length===0&&!d?null:c.jsxs("div",{className:K("members-list",f),children:[u?c.jsxs("h1",{children:[h.formatMessage({id:p}),c.jsx("span",{className:"count",children:t})]}):c.jsx(c.Fragment,{}),c.jsxs("ul",{children:[r?c.jsxs("li",{children:[c.jsx(an,{member:v,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:ut.Communities,area:n||""},{scope:ut.Platform,area:"all"}]}}),c.jsx(Dn,{href:"/profiles/me",className:"text-small",onClick:g=>{g==null||g.preventDefault(),g==null||g.stopPropagation(),b(!0)},children:h.formatMessage({id:`${p}_profile`})})]}):c.jsx(c.Fragment,{}),e.map((g,y)=>v&&g.id===v.id?c.jsx(c.Fragment,{}):c.jsxs("li",{children:[c.jsx(an,{member:g,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:ut.Communities,area:n||""},{scope:ut.Platform,area:"all"}]}}),g.isAdmin&&c.jsx(Yt,{children:h.formatMessage({id:`${p}_admin`})})]},y)),d&&e.length===0&&t>0?[...new Array(Math.min(t,dh))].map((g,y)=>c.jsx("li",{children:c.jsx(pa,{layout:"member"})},y)):c.jsx(c.Fragment,{})]}),i&&c.jsx(ii,{hasNextPage:i,loadNextPage:a,icon:{icon:"arrow-down",position:"right"},gtmContext:o}),s?c.jsx(ka,{form:s,showModal:m,content:{title:h.formatMessage({id:`${p}_modal_title`})},functions:{onClose:()=>{b(!1)}}}):c.jsx(c.Fragment,{})]})},fh=z_,q_=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const i=ie.useIntl();return t?c.jsx("small",{children:Rt(i.formatMessage,`${e}explainer`,n,"action",{a:a=>c.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":r,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:a})})}):c.jsx(c.Fragment,{})},U_=({intlPath:e,type:t,...n})=>{const r=ie.useIntl();return c.jsx(aa,{label:{visible:r.formatMessage({id:`${e}label`}),screenreader:Rt(r.formatMessage,`${e}label_action`,t,"action")},...n})},sd=5,od=2,W_=e=>{var r;let t=0;const n=[];return(r=e==null?void 0:e["poll-options"])==null||r.forEach((i,a)=>{i!==""&&(t++,n.push({position:t,description:{en:i}}))}),{title:{en:e.title},options:n,settings:{allow_multiple_votes:e["multiple-answers"]||!1}}};let Gn=null;const Qe="discussion_form_",oi=({id:e,parentId:t,content:n={type:Be.Response,slugs:{}},userHasPermissions:r=!0,meta:i,placeholder:a,maxLength:s=0,buttons:o,forceShow:l={cancel:!1,error:!1},functions:u,data:d={},gtmContext:f="DiscussionForm"})=>{var Y,se,be;const h=ie.useIntl(),p=x.useContext(it),[v,m]=x.useState(n.type),[b,g]=x.useState(""),{isLoading:y=!1,isInWrapper:C=!1,isInOverlay:k=!1,isAutoFocused:E=!1,isEditing:_=!1,hasTitleField:T=!1,canBePrepopulated:L=!1,isPrepopulated:P=!1,showTitle:z=!1,showGuidelines:M=!0,showDivider:A=!1,showSuccessMessage:F=!0,showPostType:S=!1,postCategories:I=[]}=i||{},{onChange:H=()=>{},create:V=()=>{},createPoll:ae=()=>Promise,handleSaveEdit:X=()=>{},handleCancel:D=()=>{},callback:Q=()=>{},onMention:q=()=>{},listMembers:B=()=>Promise.resolve([]),clickMentionFallback:j=()=>{},getLinkPreview:N=()=>Promise.resolve({}),props:O={create:{projectNames:["questions-answers"]}}}=u,[U,ee]=x.useState({body:_&&_.text||P&&P.text||"",data:d!=null&&d.link?{link:d==null?void 0:d.link}:{}}),[W,ne]=x.useState(l.error||!1),de={status:!1,title:T&&T.text||"",polls:0},[J,ve]=x.useState(de);x.useEffect(()=>{L&&!_&&P&&P!==U.body&&ee(oe=>({...oe,body:P.text||""}))},[P]),x.useEffect(()=>{m(n.type)},[n.type]);const me=Wr((oe,ce)=>{ee(ke=>({...ke,body:oe,data:{link:ce}})),H({body:oe});let pe;!p||!p.id?pe=Rt(h.formatMessage,`${Qe}error_loggedOut`,v,"action"):r?s>0&&oe.length>=s&&(pe=`${Qe}error_tooLong`):pe=Rt(h.formatMessage,`${Qe}error_noPermission`,v,"action"),pe?ne(pe):W&&ne(!1)},50);let ye=`${v}-form`;if(v===Be.Response||v===Be.Reply){const oe=((Y=n.slugs)==null?void 0:Y.reply)||((se=n.slugs)==null?void 0:se.answer)||((be=n.slugs)==null?void 0:be.question)||"";oe&&(ye=`${ye}-${oe.slice(-15)}`)}e&&(ye=`${e}-${ye}`);const Ee=async oe=>{if(!p||!p.id||!r||Ke)throw new Error("You do not have permission to post.");Gn&&clearTimeout(Gn),ve(pe=>({...pe,status:"submitting"}));const ce=window.location.pathname;try{let pe;switch(v){case Be.Post:pe=await V({title:oe.title,content:oe.body,categories:oe.postType,data:oe.data});break;case Be.Poll:pe=await ae(W_(oe));break;case Be.Question:pe=await V({title:oe.body,authorId:p&&p.id,data:oe.data,...O==null?void 0:O.create});break;case Be.Response:pe=await V({questionSlug:n.slugs.question},{body:oe.body,authorId:p&&p.id,contentPath:ce,data:oe.data});break;case Be.Reply:pe=await V({questionSlug:n.slugs.question,answerSlug:n.slugs.answer},{body:oe.body,authorId:p&&p.id,contentPath:ce,data:oe.data});break;default:break}return await Zh(1e3),Q&&await Q(pe),Gn=setTimeout(()=>{ee({body:"",data:{}}),m(Be.Post),ve(qe=>({...qe,status:"submitted"})),g(Rt(h.formatMessage,`${Qe}success`,v,"action"));const ke=new Event(rt.DISCUSSION_FORM_SUBMITTED);document.dispatchEvent(ke),Ce()},850),pe}catch(pe){const ke=pe;let qe=`${Qe}error`;ke!=null&&ke.message.includes("entry already exists")&&(qe=Rt(h.formatMessage,`${Qe}error_alreadyExists`,v,"action")),ke!=null&&ke.message.includes("429")?qe=Rt(h.formatMessage,`${Qe}error_tooMany`,v,"action"):ke!=null&&ke.message.includes("400")&&(qe=`${Qe}error`),ne(qe),Ce()}},Ce=()=>{Gn=setTimeout(()=>{ne(!1),ve(de),g("")},5e3)},ze=Wr(async oe=>{const ce={...U,...oe};if(_){ve(pe=>({...pe,status:"submitting"})),X(ce);return}try{if(!await Ee(ce))throw Error("No response from handleSubmit")}catch{Gn&&clearTimeout(Gn)}},100);if(y)return c.jsx(Nt,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const We=!U.body||!Kr(U.body),He=!J.title||!Kr(J.title);let Ke=!1;v!==Be.Poll&&(Ke=We),T&&(Ke=Ke&&He);const Te=J.status==="submitting",Oe=[];v===Be.Poll?Oe.push({id:"poll-options",label:h.formatMessage({id:`${Qe}option_label`}),type:"multiple-inputs",element:"textarea",placeholder:h.formatMessage({id:`${Qe}option_placeholder`}),limit:100,multipleInputs:{showCount:!0,defaultInputs:od,maxInputs:sd,hasButton:{variant:"secondary",size:"small",styling:{muted:!0},icon:"plus",children:h.formatMessage({id:`${Qe}option_cta`})}},styling:{autosizeToFit:!0},functions:{onChange:oe=>{var pe;let ce=0;oe&&Array.isArray(oe)&&(ce=((pe=oe==null?void 0:oe.filter(ke=>ke!==""))==null?void 0:pe.length)||0),J.polls!==ce&&ve(ke=>({...ke,polls:ce})),H({polls:oe})}},validation:[{condition:"required"}]},{type:"checkbox",id:"multiple-answers",label:h.formatMessage({id:`${Qe}multiplePollAnswers`}),className:"text-medium"}):Oe.push({component:U_,props:{formID:ye,intlPath:Qe,showLabel:T!==!1,type:v}},{component:cu,props:{id:`${ye}-input`,value:J.status==="submitting"&&!W?"":U.body,placeholder:a||Rt(h.formatMessage,`${Qe}placeholder`,v,"action"),maxLength:s,meta:{isInOverlay:k},functions:{onChange:me,onChangeData:oe=>{ee(ce=>({...ce,data:oe}))},onMention:q,listMembers:B,clickMentionFallback:j,getLinkPreview:N},data:d,autoFocus:_!==!1||E&&!T,"aria-invalid":!!W,"aria-errormessage":"error-message"}},{component:q_,props:{intlPath:Qe,showGuidelines:M,type:v,gtmContext:f}}),A&&Oe.push({component:zt}),T&&Oe.unshift({id:"title",type:"textarea",value:T.text,limit:250,label:h.formatMessage({id:`${Qe}${v===Be.Poll?"question":"titleField"}_label`}),styling:{autosizeToFit:!0},placeholder:h.formatMessage({id:`${Qe}${v===Be.Poll?"question":"titleField"}_placeholder`}),functions:{onChange:oe=>{ve(ce=>({...ce,title:oe})),H({title:oe})}},validation:v===Be.Poll?[{condition:"required"}]:[]}),S&&Oe.unshift({id:"postType",type:"radio",value:"no-category",accessibilityOptions:{checkboxes:{navigateWithArrowKeys:!0}},styling:{displayOptionsAsPills:!0},label:h.formatMessage({id:`${Qe}postType_label`}),options:I.map(oe=>({id:oe.slug,label:oe.name})),validation:[{condition:"required"}],functions:{onChange:oe=>{H({postType:oe}),oe.includes(Be.Poll)?m(Be.Poll):v!==Be.Post&&m(Be.Post)}}});let we=!p||!p.id||!r||Te;if(v===Be.Poll){const oe=J.polls;we=we||He||oe<od||oe>sd}else we=we||Ke,_&&(T?we=we||U.body===_.text&&J.title===T.text:we=we||U.body===_.text);return c.jsxs(c.Fragment,{children:[c.jsxs(Xt,{id:ye,className:K("discussion-card discussion-form",{"no-styling":C&&_}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:_&&!Te||l.cancel},functions:{onSuccess:async oe=>{await ze(oe)},onCancel:D},fields:Oe,intlPath:Qe,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":f,"data-gtm-event-type":`${_?"save":"submit"}-${v}-click`,"data-testid":"save-button",disabled:we,text:{default:!_&&(o!=null&&o.submit)?o==null?void 0:o.submit:h.formatMessage({id:`${Qe}${_?"save":"post"}`}),submitting:h.formatMessage({id:`${Qe}${_?"saving":"posting"}`})}},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":f,"data-gtm-event-type":`cancel-${v}-click`,disabled:!l.cancel&&(!p||!p.id||!U.body),text:o!=null&&o.cancel?o==null?void 0:o.cancel:h.formatMessage({id:`${Qe}cancel`})},gtm:{context:f,event:`${v}-form`},"data-testid":`discussion-${v}-form`,children:[z&&!_&&v===Be.Question&&c.jsx("h2",{children:Rt(h.formatMessage,`${Qe}title`,v,"action")}),c.jsx(an,{member:p?{...p,link:!1}:"community",gtmContext:f,gtmType:"profile-click",badges:{showBadges:!0,scopes:[{scope:ut.Communities,area:t||""},{scope:ut.Platform,area:"all"}]}})]}),J.status==="submitted"&&F&&c.jsx(ur,{className:"success","data-testid":"success",children:Rt(h.formatMessage,`${Qe}success`,v,"action")}),W&&c.jsx(ur,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof W=="string"?W.includes(" ")?W:h.formatMessage({id:W},{action:h.formatMessage({id:`discussion_action_${v}`}),maxLength:s}):W}),b&&c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:b})]})},V_=Object.freeze(Object.defineProperty({__proto__:null,default:oi},Symbol.toStringTag,{value:"Module"}));const H_={showForm:!1},_a=x.createContext(H_),mh=({children:e})=>{const[t,n]=x.useState({showForm:!1});return c.jsx(_a.Provider,{value:{...t,updateConversation:n},children:e})};function K_({author:e,originalAuthorId:t,createdAt:n,contentData:r,content:i,gtmContext:a,badges:s}){var f;const o="discussion_",l=ie.useIntl(),u=(f=i==null?void 0:i.componentProps)==null?void 0:f.member.additionalContent,d=u?u.customMessage:void 0;return c.jsxs("div",{className:"author-section",children:[c.jsx(an,{member:e,additionalContent:{createdAt:n,didEdit:r.didEdit,customMessage:d},className:K({highlighted:typeof e!="string"&&e.id===t}),styling:{additionalContentNewLine:!!d},gtmContext:a,gtmType:"profile-click",badges:s}),i.pinned&&c.jsx(Yt,{variant:"naked",size:"xlarge",icon:"pin",children:c.jsx(Me,{children:l.formatMessage({id:`${o}pinned_post`})})})]})}const ks=({children:e,class:t,...n})=>{const r={...n,class:K("subtle",t)};return c.jsx("blockquote",{...r,children:e})};function Z_({content:e}){var t;return!e||!((t=e.categories)!=null&&t.length)?c.jsx(c.Fragment,{}):c.jsx("ul",{className:"categories-list",children:e.categories.map(n=>!n.slug||!n.name?c.jsx(c.Fragment,{}):c.jsx(Yt,{size:"small",element:"li",children:n.name},n.slug))})}var la=(e=>(e.Always="always",e.AfterVoting="after-voting",e))(la||{});const Y_=(e,t,n)=>n===void 0?0:e.some(i=>i.hasUserVoted)?t?e.findIndex(i=>!i.hasUserVoted):e.findIndex(i=>i.hasUserVoted):0,G_=(e,t,n,r=0)=>{if(!e)return{nextElement:null,nextIndex:0};let i=n==="next"?e.nextElementSibling:e.previousElementSibling,a=r+(n==="next"?1:-1);for(;i;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}const s=e.parentElement;if(s)for(i=n==="next"?s.firstElementChild:s.lastElementChild,a=n==="next"?0:s.childElementCount-1;i&&i!==e;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}return{nextElement:null,nextIndex:0}};const Q_=({user:e,option:t,optionIndex:n,totalPollVotes:r=0,allowMultipleVotes:i=!1,showResults:a=!1,hasVotedOnPoll:s=!1,isTabbable:o=!1,functions:l})=>{var b;const[u,d]=x.useState(t.hasUserVoted);let f=0,h={};const p=(i||!s)&&!t.hasUserVoted;a&&(f=Math.round(t.numVotes/r*100)||0,h={"--vote-perc":`${f}%`});const v=g=>{g.stopPropagation(),p&&(l==null||l.createVote(t),d(!0))},m={htmlFor:t.id,className:K({"can-vote":p}),tabIndex:o&&p?0:-1,"data-testid":"poll-option-label","data-gtm-event-type":"poll-option-click","data-gtm-event-context":"PollOption","aria-selected":t.hasUserVoted,onClick:v,onKeyDown:g=>{var y;if(g.code!=="Tab")switch(g.code){case"Enter":case"Space":g.preventDefault(),g.stopPropagation(),v(g),d(!0);break;case"ArrowUp":case"ArrowDown":g.stopPropagation(),g.preventDefault();const C=g.code==="ArrowUp"?"prev":"next",{nextElement:k,nextIndex:E}=G_(g.currentTarget.parentElement,"selected",C,n);k&&((y=k.querySelector("label"))==null||y.focus(),l==null||l.setTabbableOption(E));break}}};return c.jsxs("li",{"data-testid":"poll-option",style:h,className:K("poll-option text-small",{selected:t.hasUserVoted}),children:[c.jsx("label",{...m,children:c.jsx("span",{children:t.label})}),a&&c.jsxs("div",{className:"vote-details",children:[t.hasUserVoted&&c.jsx(un,{className:"author-profile-picture",name:e.name,src:(b=e==null?void 0:e.image)==null?void 0:b.thumbnail}),c.jsxs("p",{className:"vote-perc text-medium","data-testid":"vote-perc",children:[f,"%"]})]}),c.jsx("input",{type:i?"radio":"checkbox",id:t.id,name:t.id,checked:u,tabIndex:-1})]})};const hh=({title:e,options:t,settings:n,functions:r})=>{const i="poll_",a=ie.useIntl(),s=x.useContext(it),{showRemoveVote:o=!1,allowMultipleVotes:l=!1,resultsVisibility:u=la.AfterVoting}=n||{},[d,f]=x.useState(Y_(t,l,s==null?void 0:s.id)),h=t.reduce((g,y)=>g+y.numVotes,0),p=t.filter(g=>g.hasUserVoted).length,v=t.filter(g=>g.hasUserVoted),m=x.useCallback(async g=>{await r.createVote({reactionId:g.id})},[]),b=x.useCallback(async()=>{t.forEach(async g=>{g.hasUserVoted&&g.userVote&&r.removeVote({reactionId:g.userVote.id})})},[t]);return c.jsxs("div",{className:"poll-wrapper",children:[c.jsx("p",{className:"poll-title",children:e}),c.jsxs("aside",{className:"poll-info",children:[c.jsx("p",{className:"poll-instructions","data-testid":"poll-instructions",children:c.jsx("small",{children:a.formatMessage({id:`${i}instructions`},{allowMultipleVotes:l})})}),c.jsx("p",{className:"poll-num-votes",children:c.jsx("small",{"data-testid":"poll-total-votes",children:a.formatMessage({id:`${i}num_votes`},{number:h})})}),o&&c.jsx("p",{className:"poll-remove-vote",children:c.jsx(Ae,{variant:"tertiary",onClick:b,"data-testid":"remove-votes-button",disabled:p===0,children:c.jsx("small",{children:a.formatMessage({id:`${i}remove_vote_button`},{number:p})})})})]}),t&&c.jsx("form",{children:c.jsx("fieldset",{children:c.jsx("ul",{className:"poll-options",children:t==null?void 0:t.map((g,y)=>c.jsx(Q_,{isTabbable:d===y,user:s,option:g,optionIndex:y,totalPollVotes:h,showResults:u==la.Always||!!p,allowMultipleVotes:l,hasVotedOnPoll:!!p,functions:{createVote:m,setTabbableOption:f}},g.id))})})}),c.jsxs(Me,{"aria-live":"polite",children:[a.formatMessage({id:`${i}aria_votes`},{number:p}),!!p&&c.jsx("ul",{children:v.map(g=>c.jsx("li",{children:g.label}))})]})]})};function J_({content:e,contentData:t,functions:n}){return c.jsx(hh,{title:t.title,options:(e==null?void 0:e.pollOptions)||[],settings:(e==null?void 0:e.pollSettings)||{},functions:{createVote:n.createVote,removeVote:n.removeVote}})}function X_({links:e={},contentData:t,postCutOff:n,content:r}){var i;return c.jsxs(c.Fragment,{children:[e.post?c.jsxs("a",{href:e.post,children:[(t==null?void 0:t.title)&&c.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),t.postBody.length>n?c.jsx(jd,{text:t.postBody,markdownOptions:{overrides:{a:Ms,blockquote:{component:ks}}}}):c.jsx(On,{options:{overrides:{a:Ms,blockquote:{component:ks}}},children:t.postBody})]}):c.jsxs(c.Fragment,{children:[(t==null?void 0:t.title)&&c.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),c.jsx(On,{options:{wrapper:r.type===Be.Question?"h1":x.Fragment,forceWrapper:r.type===Be.Question,forceInline:r.type===Be.Question,forceBlock:r.type!==Be.Question,overrides:{blockquote:{component:ks}}},children:t.postBody})]}),(i=t.data)!=null&&i.link?c.jsx(Oo,{data:t.data.link}):c.jsx(c.Fragment,{})]})}const It="discussion_",ek=195;let Ti=null;const ui=({element:e="div",content:t,userHasPermissions:n=!0,userHasOwnerPermissions:r=!1,isLoading:i=!1,originalAuthorId:a,forceHide:s,functions:o,links:l={},className:u,gtmContext:d="DiscussionAnswer",children:f,isTruncated:h=!1,setFocus:p=!1,isCommunity:v=!1,badges:m,basePath:b,parentId:g,locale:y="en"})=>{var Oe,we,Y,se,be,oe;const C=ie.useIntl(),k=x.useContext(_a),E=x.useContext(it),{createContent:_=async()=>{},deleteContent:T=async()=>{},updateContent:L=async()=>{}}=o.content||{},{createLike:P=()=>{},deleteLike:z=()=>{},listLikes:M=async()=>({})}=o.likes||{},{openComments:A=()=>{}}=o.comments||{},{listMembers:F=()=>Promise.resolve([]),clickMentionFallback:S=()=>{}}=o.form||{},{createVote:I=()=>{},removeVote:H=()=>{},removePoll:V=()=>{}}=o.polls||{},{author:ae,createdAt:X,id:D,likes:Q=0,userLiked:q,comments:B=0,data:j}=t,N=uv(t.title,y),O=E&&E.id&&typeof ae!="string"&&ae.id&&ae.id===E.id||!1,U=O&&(!t.createdAt||Hh(t.createdAt,10,"seconds")),ee=x.useRef(null),[W,ne]=x.useState({title:t.body!==N&&N||"",body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:"",data:t&&t.data||{}}),[de,J]=x.useState(!1),[ve,me]=x.useState(U?"highlighted":"default"),[ye,Ee]=x.useState("");x.useEffect(()=>{const ce=ee.current;if(!(!ce||ve==="default"))return document.addEventListener(rt.DISCUSSION_FORM_SUBMITTED,Ce),ce.addEventListener("transitionend",ze),()=>{document.removeEventListener(rt.DISCUSSION_FORM_SUBMITTED,Ce),ce.removeEventListener("transitionend",ze)}},[]),x.useEffect(()=>{ne(ce=>({...ce,title:t&&N||"",body:t&&t.body||"",didEdit:t&&t.isEdited||!1,data:t&&t.data||{}}))},[t.isEdited]),x.useEffect(()=>{(async()=>{const pe=await jo(W.body,h,j==null?void 0:j.mentions,F);ne(ke=>({...ke,postBody:pe}))})()},[W.body,j==null?void 0:j.mentions]);const Ce=()=>{setTimeout(()=>{me("fading")},1e3)},ze=({propertyName:ce})=>{ce==="background-color"&&me(pe=>(pe==="default"&&(document.removeEventListener(rt.DISCUSSION_FORM_SUBMITTED,Ce),ee.current&&ee.current.removeEventListener("transitionend",ze)),pe==="fading"?"default":pe))};if(i||!t||t.type===Be.Answer&&(!t.slugs||!t.slugs.question)||W.postBody===""&&t.title==="")return c.jsx(Nt,{className:"discussion-card"});const We=async({title:ce,body:pe,data:ke})=>{ce||(ce=""),pe||(pe=""),Ee("");try{if(!Wi(ce,W.title)||!Wi(pe,W.body)){const qe=t.type===Be.Question?{title:pe}:{title:ce,body:pe,data:ke};await L(Ls(t.slugs),qe)}ne(qe=>({...qe,title:ce||"",body:pe||"",data:{...qe.data,...ke},isEditing:!1,didEdit:!0}))}catch{Ee(`${It}form_error`)}},He=()=>{if(k&&k.updateConversation){const ce={showForm:!0},pe=t.author;pe&&pe.id&&(v&&(ce.prepopulateForm=`@{{${pe.id}}}`),ce.mentionData={id:pe.id,name:pe.name}),k.updateConversation(ce)}setTimeout(()=>{var At,pt,tt;const pe=`reply-form-${(t.type===Be.Answer?t.slug:((At=t.slugs)==null?void 0:At.reply)||((pt=t.slugs)==null?void 0:pt.answer)||((tt=t.slugs)==null?void 0:tt.question)||"").toLowerCase().slice(-15)}`,ke=document.getElementById(pe),qe=document.getElementById(`${pe}-input`);qe&&qe.focus(),ke&&ke.scrollIntoView({behavior:"smooth"})},0)},Ke=async()=>{J(!1);try{t.type===Be.Poll?(await V(),window.location.href=`${b}/${g}`):await T(Ls(t.slugs))}catch{Ee("delete-error")}},Te=[];return n&&O&&(t.type!==Be.Poll&&Te.push({text:C.formatMessage({id:`${It}moreMenu_edit`}),onClick:()=>ne(ce=>({...ce,isEditing:!0})),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`}),Te.push({text:C.formatMessage({id:`${It}moreMenu_delete`}),onClick:ce=>{ce.preventDefault(),ce.stopPropagation(),J(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`delete-${t.type}-click`,...sf(`delete-${t.slug}-modal`,de)})),r&&o.pins&&Te.push({text:C.formatMessage({id:`${It}moreMenu_${t.pinned?"unpin":"pin"}`}),onClick:t.pinned?o.pins.deletePin:o.pins.createPin,icon:t.pinned?"unpin":"pin",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`}),p&&((Oe=ee==null?void 0:ee.current)==null||Oe.focus(),(we=ee==null?void 0:ee.current)==null||we.scrollIntoView({behavior:"smooth"})),x.createElement(e,{className:K("discussion-post",u,{[ve]:!u||!u.includes("highlighted-text-box"),"has-link":l.post&&!W.isEditing,"is-pinned":(t==null?void 0:t.pinned)||!1}),ref:ee,tabIndex:p?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${d}-post-click`,onClick:ce=>{if(!l.post||W.isEditing||t.type===Be.Poll&&ov(ce,["poll-options","poll-info"],"discussion-post"))return;ce.preventDefault(),ce.stopPropagation(),Ti&&clearTimeout(Ti),Ti=setTimeout(()=>{window.location.href=l.post},150);const pe=new CustomEvent(rt.DISCUSSION_POST_CLICKED,{detail:{link:l.post,timeout:Ti}});document.dispatchEvent(pe)},children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{id:D||t.slug,className:K("discussion-card text-medium",t.type,{editing:W.isEditing,"has-link":l.post&&!W.isEditing}),children:[!W.isEditing&&c.jsx(K_,{author:ae,originalAuthorId:a,createdAt:X,contentData:{didEdit:W.didEdit},content:t,gtmContext:d,badges:m}),W.isEditing?c.jsx(oi,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:i,isInWrapper:!0,hasTitleField:W.title!==""?{text:W.title}:!1,isEditing:{text:W.body,categories:[]},canBePrepopulated:v,isPrepopulated:!1},maxLength:t.type===Be.Question?250:5e4,forceShow:{error:ye!==""&&ye!=="delete-error"?C.formatMessage({id:ye},{action:C.formatMessage({id:`${It}action_${t.type}`})}):!1},functions:{create:_,handleSaveEdit:We,handleCancel:()=>{Ee(""),ne(ce=>({...ce,isEditing:!1}))},listMembers:F,clickMentionFallback:S},gtmContext:`${d}Form`,data:j}):c.jsxs(c.Fragment,{children:[t.type===Be.Poll?c.jsx(J_,{content:t,contentData:W,functions:{createVote:I,removeVote:H}}):c.jsx(X_,{links:l,contentData:W,postCutOff:ek,content:t}),c.jsx(Z_,{content:t})]}),!W.isEditing&&!(s!=null&&s.actionBar)&&c.jsx(wf,{className:t.type,gtmContext:d,contentType:t.type,likes:s!=null&&s.likes?!1:{count:Q||0,userLiked:q||!1,canLike:n??!0,peopleWhoLiked:t.peopleWhoLiked,activityId:t.id||t.slug,content:{slugs:t.slugs||{},slug:t.slug},functions:{createLike:P,deleteLike:z,listLikes:M},basePath:b,parentId:g},comments:!(s!=null&&s.comments)&&([Be.Question,Be.Post].includes(t.type)||l.comments)?{count:B||0,functions:{onClick:()=>{l!=null&&l.comments&&(window.location.href=l.comments),typeof A=="function"&&A()}}}:!1,replies:t.type==="answer"||t.type==="reply"?{canReply:n??!0,functions:{onClick:He}}:!1,shareLink:{url:`${window.location.origin}${(Y=t.slugs)==null?void 0:Y.question}/${(se=t.slugs)==null?void 0:se.answer}${(be=t.slugs)!=null&&be.reply?`#${(oe=t.slugs)==null?void 0:oe.reply}`:""}`},moreMenu:{options:Te,contentSlug:t.slug,reportData:{contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}}})]}),f,c.jsx(ln,{id:`delete-${t.slug}-modal`,isOpen:de,functions:{onOpen:()=>{},onClose:()=>J(!1)},forceShow:{error:ye==="delete-error"?C.formatMessage({id:"${intlPath}delete_error"},{action:C.formatMessage({id:`${It}action_${t.type}`})}):!1},title:C.formatMessage({id:`${It}delete_title`},{action:C.formatMessage({id:`${It}action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>J(!1),children:C.formatMessage({id:`${It}delete_cancel`})},{variant:"primary",className:"destructive",onClick:Ke,children:C.formatMessage({id:`${It}delete_delete`})}],gtmContext:`${(t.type||"").charAt(0).toUpperCase()}${(t.type||"").slice(1)}:${t.slug}`,children:c.jsx(ie.FormattedMessage,{id:"discussion_delete_text",values:{p:ce=>c.jsx("p",{children:ce}),action:C.formatMessage({id:`${It}action_${t.type}`})}})})]})})};const tk=x.lazy(()=>Promise.resolve().then(()=>pk)),nk=65,ph=({forceShow:e,form:t,className:n})=>{const r=ie.useIntl(),i="discussionFormCard_",a="DiscardDraftModal",o=x.useContext(it)||"community",l=ga(o);l.name||(l.name=r.formatMessage({id:`member_${typeof o=="string"?o:"community"}`}));const u=wn(!0,!1),d=u?u<768:0,{modal:f=!1}=e||{},[h,p]=x.useState({form:f||Fd("showPost")==="true"||!1,warning:!1}),[v,m]=x.useState({showCachedText:!1});x.useEffect(()=>{if(!v.showCachedText)return;(async()=>{const C=await jo(v.title||v.body||"",nk,v.mentions);m(k=>({...k,prettifiedText:C}))})()},[v.showCachedText,v.title,v.body]);const b=y=>{if(!v.showCachedText||typeof h.warning=="string")return;let C;if("detail"in y&&y.detail.link)y.detail.timeout&&clearTimeout(y.detail.timeout),C=y.detail.link;else{const k=y;k.preventDefault(),k.stopPropagation();const _=k.target.closest("a");C=_&&_.getAttribute("href")}p(k=>({...k,warning:C||!1}))};x.useEffect(()=>{if(!v.showCachedText){document.removeEventListener(rt.DISCUSSION_POST_CLICKED,b),document.removeEventListener(rt.MEMBER_CLICKED,b),document.removeEventListener("click",b);return}return document.addEventListener(rt.DISCUSSION_POST_CLICKED,b),document.addEventListener(rt.MEMBER_CLICKED,b),document.addEventListener("click",b),()=>{document.removeEventListener(rt.DISCUSSION_POST_CLICKED,b),document.removeEventListener(rt.MEMBER_CLICKED,b),document.removeEventListener("click",b)}},[v.showCachedText]),x.useEffect(()=>{const y=C=>{if(!(!v.showCachedText||h.warning!==!1))return C.preventDefault(),C.returnValue=""};return window.addEventListener("beforeunload",y,{capture:!0}),()=>{window.removeEventListener("beforeunload",y,{capture:!0})}},[v.showCachedText,h.warning]);let g=r.formatMessage({id:`${i}placeholder${d?"":"_long"}`});return v.showCachedText&&(v.title||v.body)&&(g=v.prettifiedText||g),c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:K("discussion-form-card",n),onClick:y=>{y.preventDefault(),y.stopPropagation(),p(C=>({...C,form:!0}))},"data-testid":"discussion-form-card",children:[c.jsx(un,{name:l.name,src:l.image,alt:""}),c.jsx(On,{className:K("input",{placeholder:!v.showCachedText}),element:"span",options:{forceInline:!0,overrides:{a:St,blockquote:St,br:St,em:St,li:St,ol:St,p:St,s:St,span:St,strong:St,ul:St}},children:g})]}),c.jsxs(br,{children:[c.jsx(tk,{showModal:h.form,functions:{cacheText:m,onClose:()=>{p(y=>({...y,form:!1}))}},form:t,cachedText:v,className:"in-portal"}),c.jsx(ln,{id:t.id?`${t.id}-warning`:"discussion-form-card-warning",className:"in-portal",isOpen:h.warning!==!1,functions:{onClose:()=>{p(y=>({...y,warning:!1}))}},title:r.formatMessage({id:`${i}overlay_title`}),buttons:[{variant:"secondary",children:r.formatMessage({id:`${i}overlay_cta_discard`}),onClick:y=>{y.preventDefault(),y.stopPropagation(),typeof h.warning=="string"&&(window.location.href=h.warning)},"data-gtm-event-type":"discard-click","data-gtm-event-context":a},{variant:"primary",children:r.formatMessage({id:`${i}overlay_cta_continue`}),onClick:()=>{p({form:!0,warning:!1})},"data-gtm-event-type":"continue-editing-click","data-gtm-event-context":a}],children:c.jsx("p",{children:r.formatMessage({id:`${i}overlay_text`})})})]})]})},rk=x.lazy(()=>Promise.resolve().then(()=>V_)),mu=({isCard:e=!1,form:t,parentId:n,categories:r,membershipRequiredToPost:{isMember:i,required:a,join:s,leave:o,notMemberStateText:l},locale:u=_o})=>{if(a&&!i)return c.jsx(Qt,{text:l,button:{breakpoints:{mobile:!0,901:!1},component:c.jsx(Eo,{isShort:!0,functions:{join:s,leave:o}})}});const{content:d,functions:f,meta:h,...p}=t,v={content:{type:(d==null?void 0:d.type)||"reply",slugs:(d==null?void 0:d.slugs)||{}},functions:{...f,create:(f==null?void 0:f.create)||(()=>{})},parentId:n,meta:{...h,isEditing:(h==null?void 0:h.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1,postCategories:[{name:"Post",slug:"no-category"},...r||[]]},...p,id:`add-post-${p.id||""}`};return e?c.jsx(ph,{form:v}):c.jsx(rk,{...v})},hu=({form:e})=>{const t=x.useContext(it),n=ie.useIntl(),[r,i]=x.useState(!1),a=()=>{tp(t)||i(!0)};x.useEffect(()=>(document.addEventListener(rt.DISCUSSION_POST_ADDED,a),()=>{document.removeEventListener(rt.DISCUSSION_POST_ADDED,a)}));const s={};return["successMessage","title","text"].forEach(o=>{s[o]=n.formatMessage({id:`profileModalLauncher_${o}`})}),c.jsx(ka,{form:e,showModal:r,functions:{onClose:()=>{i(!1)}},content:s})};const Fs="discussion_responses_",gh=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=ie.useIntl();return t=parseInt(t),c.jsxs("div",{className:"responses-heading",children:[c.jsx("h4",{children:r.formatMessage({id:`${Fs}title`},{action:r.formatMessage({id:`${Fs}${e}`}),count:t})}),!n&&t===0&&c.jsx("p",{children:Rt(r.formatMessage,`${Fs}empty`,e,e)})]})};const vh=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:i})=>{const a=ie.useIntl(),s=x.useContext(_a),o=Oi(i,{element:"li"});if(s.prepopulateForm&&(r!=null&&r.meta)&&(r.meta.isPrepopulated={text:s.prepopulateForm},s.mentionData)){const l=r.data||{};l.mentions||(l.mentions={});const u=s.mentionData.id||"1";l.mentions[u]={created_at:"",updated_at:"",id:u,data:s.mentionData},r.data=l,r.meta.isAutoFocused=!0}return c.jsxs("div",{className:K("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&c.jsx("ul",{className:"thread",children:o}),!e&&c.jsx(ii,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:a.formatMessage({id:"discussion_thread_loadMore"}),error:a.formatMessage({id:"loadMore_error"})}}),r&&s.showForm&&c.jsx(oi,{...r})]})};function ik(e){var n,r;let t=!1;return(r=(n=e.latest_reactions)==null?void 0:n["poll-option"])==null||r.forEach(i=>{var a,s;(s=(a=i.own_children)==null?void 0:a["poll-vote"])!=null&&s.length&&(t=!0)}),t}function ak({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=Re.useMutation({mutationFn:e,onMutate:({reactionId:o})=>t(l=>(uf({activity:l,reactionId:o,user:a}),l)),onError:n,onSuccess:(o,{reactionId:l},u)=>{u&&lf({activity:u,reactionId:l,correctReactionId:o.body.id,user:a}),r.setQueryData(i,u)}});return s}function sk({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=Re.useMutation({mutationFn:e,onMutate:({content:i,title:a})=>t(s=>(s&&(i!=null&&(s.content=i),a!=null&&(s.title=a)),s)),onError:n});return r}function ok({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=Re.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Qi({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Qi({activity:l,reaction:s}),r.setQueryData(i,l)}});return a}function uk({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=Re.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Ji({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Ji({activity:l,reaction:s}),r.setQueryData(i,l)}});return a}function lk({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,isFetching:a}=Re.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:i,isFetching:a}}function ck({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=Re.useMutation({mutationFn:e,onMutate:({reactionId:a})=>t(s=>(cf({activity:s,reactionId:a}),s)),onError:n});return i}function dk({queryFns:{read:e,edit:t,like:n,unlike:r,pin:i,unpin:a,createVote:s,removeVote:o},queryKey:l}){const u=Re.useQueryClient(),d=ha(),f={queryClient:u,queryKey:l},h={mutationHandlers:{error:ko(f),mutate:Fo(f)},user:d,...f},p=sk({...h,mutationFn:t}),v=ok({...h,mutationFn:n}),m=fk({...h,mutationFn:r}),b=uk({...h,mutationFn:i}),g=mk({...h,mutationFn:a}),y=ak({...h,mutationFn:s}),C=ck({...h,mutationFn:o}),{activity:k,...E}=lk({queryKey:l,queryFn:e});return{activity:k,mutations:{edit:p,like:v,unlike:m,pin:b,unpin:g,createVote:y,removeVote:C},user:d,...E}}function fk({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=Re.useMutation({mutationFn:e,onMutate:a=>t(s=>(s&&df({activity:s,user:r}),s)),onError:n});return i}function mk({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=Re.useMutation({mutationFn:e,onMutate:a=>(console.log("unpin"),t(s=>(s&&ff({activity:s,user:r}),s))),onError:n});return i}const hk=({basePath:e,parentId:t,activityId:n,isMember:r,isOwner:i,functions:{activities:{remove:a,...s},likes:o,reactions:l,form:u,join:d,leave:f,polls:h},profile:p,categories:v,locale:m=_o})=>{var q,B,j,N,O,U,ee,W,ne,de,J,ve;const b=ie.useIntl(),g={...s,...h},{activity:y,error:C,isLoading:k,mutations:{edit:E,like:_,unlike:T,pin:L,unpin:P,createVote:z,removeVote:M}}=dk({queryFns:g,queryKey:[e,t,n]});if(k)return c.jsx(Nt,{style:{height:"400px"}});if(C||!y)return c.jsx(Qt,{variant:"error",text:b.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:A,verb:F,latest_reactions:S,mentioned_users:I,additional_data:H}=y,V=(((q=S==null?void 0:S.like)==null?void 0:q.length)||0)>0,ae=(((B=A==null?void 0:A.like)==null?void 0:B.length)||0)>0,X=ae?A==null?void 0:A.like[0].id:"",D=V?(j=S==null?void 0:S.like)==null?void 0:j.map(me=>{var ye,Ee,Ce;return{id:(ye=me==null?void 0:me.user)==null?void 0:ye.id,name:(Ce=(Ee=me==null?void 0:me.user)==null?void 0:Ee.data)==null?void 0:Ce.name}}):!1,Q=y==null?void 0:y.actor;return c.jsxs("section",{className:"activity-section",children:[c.jsx(ui,{className:"highlighted-text-box subtle",isCommunity:!0,content:{id:n,type:F,title:y==null?void 0:y.title,body:y==null?void 0:y.content,categories:Po((y==null?void 0:y.categories)||[],v||[]),createdAt:(y==null?void 0:y.time)||"",slugs:{question:`${e}/${t}`,answer:y==null?void 0:y.id},slug:n,author:xr(Q),userLiked:ae,likes:((N=y==null?void 0:y.reaction_counts)==null?void 0:N.like)||0,comments:(y==null?void 0:y.total_replies)||0,peopleWhoLiked:D,data:{mentions:I,...H||{}},pinned:((O=y==null?void 0:y.reaction_counts)==null?void 0:O.pin)&&((U=y==null?void 0:y.reaction_counts)==null?void 0:U.pin)>0||!1,pollOptions:of(y,m),pollSettings:{showRemoveVote:(ee=y==null?void 0:y.settings)==null?void 0:ee.show_remove_vote,allowMultipleVotes:(W=y==null?void 0:y.settings)==null?void 0:W.allow_multiple_votes,deadlineAt:(ne=y==null?void 0:y.settings)==null?void 0:ne.deadline_at,hideParticipants:(de=y==null?void 0:y.settings)==null?void 0:de.hide_participants,numberOfWinners:(J=y==null?void 0:y.settings)==null?void 0:J.number_of_winners,resultsVisibility:(ve=y==null?void 0:y.settings)==null?void 0:ve.results_visibility}},originalAuthorId:Q==null?void 0:Q.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:a,updateContent:(me,{title:ye,body:Ee})=>E({title:ye,content:Ee})},likes:{createLike:()=>_({activityId:n}),deleteLike:()=>T({activityId:n,reactionId:X}),listLikes:me=>o.list({activityId:n,...me})},comments:{openComments:()=>{}},pins:{createPin:()=>L({activityId:n}),deletePin:()=>{var me;return P({activityId:n,reactionId:(me=S==null?void 0:S.pin)==null?void 0:me[0].id})}},polls:{createVote:({reactionId:me})=>z({reactionId:me}),removeVote:({reactionId:me})=>M({reactionId:me}),removePoll:()=>h.removePoll({activityId:n})},form:u},styling:{showShareLinkButton:!0},userHasPermissions:r,userHasOwnerPermissions:i,badges:{showBadges:!0,scopes:[{scope:ut.Communities,area:t||""},{scope:ut.Platform,area:"all"}]},basePath:e,parentId:t},n),c.jsx(vf,{basePath:e,parentId:t,activityId:n,showReplies:F===Be.Poll?ik(y):!0,activityTotalReplies:(y==null?void 0:y.total_replies)||0,isMember:r,functions:{reactions:l,likes:o,form:u,join:d,leave:f},profile:p})]})};const bh=({showModal:e=!0,functions:t,form:n,cachedText:r,className:i})=>{const a=ie.useIntl(),s="discussionFormModal_",{onClose:o=()=>{},cacheText:l=()=>{}}=t,{data:u,meta:d,functions:f}=n,{title:h="",body:p="",mentions:v}=r||{},m="discussion-form-modal";return c.jsx(ln,{id:m,title:a.formatMessage({id:`${s}title`}),isOpen:e,functions:{onClose:()=>{(h!==""||p!=="")&&l(b=>({...b,showCachedText:!0})),o()}},className:K("discussion-form-modal",i),children:c.jsx(oi,{...n,data:{...u,mentions:v||(u==null?void 0:u.mentions)},meta:{...d,isAutoFocused:!0,isInOverlay:`${m}-overlay`,hasTitleField:{text:h},isPrepopulated:{text:p||(d==null?void 0:d.isPrepopulated)!==!1&&(d==null?void 0:d.isPrepopulated.text)||""},showGuidelines:!1,showDivider:!0,showPostType:!0},buttons:{submit:a.formatMessage({id:`${s}cta`})},functions:{...f,onChange:b=>{l(g=>({...g,...b}))},onMention:({id:b,name:g}={})=>{if(!b||!g)return;const y=v||{};y[b]={created_at:"",updated_at:"",id:b,data:{name:g}},l(C=>({...C,mentions:y}))},create:async b=>{o(),f.create&&await f.create(b),l({showCachedText:!1})},createPoll:async b=>{const g=()=>{o(),l({showCachedText:!1})};if(f.createPoll)try{const y=await f.createPoll(b);return new Promise(C=>(g(),C(y)))}catch{return new Promise((C,k)=>k())}else return g(),new Promise(y=>y({}))},handleSaveEdit:async b=>{o(),f.handleSaveEdit&&await f.handleSaveEdit(b),l({showCachedText:!1})}}})})},pk=Object.freeze(Object.defineProperty({__proto__:null,default:bh},Symbol.toStringTag,{value:"Module"}));const gk=({className:e,showModal:t=!0,title:n,messagePlaceholder:r,formTitle:i,formLabel:a,ctaMessage:s,showIcon:o,onClose:l,reportError:u=()=>{},sendInvites:d})=>{const f=ie.useIntl();return i||(i=f.formatMessage({id:"inviteModal_formTitle"})),a||(a=f.formatMessage({id:"inviteModal_formLabel"})),s||(s=f.formatMessage({id:"inviteModal_cta"})),c.jsx(ln,{id:"invite-user-modal",title:n,isOpen:t,showDivider:!1,showIcon:o,functions:{onClose:l},className:K("invite-modal",e,{success:!!n}),children:c.jsx(ih,{title:i,label:a,messagePlaceholder:r,ctaMessage:s,onClose:l,sendInvites:d,reportError:u})})};const vk=({showModal:e=!0,content:{successMessage:t,title:n,text:r}={},functions:i,form:a,className:s})=>{const o=ie.useIntl(),[l,u]=x.useState(Fd("showProfile")==="true"||e);x.useEffect(()=>{u(e)},[e]);const{onClose:d=()=>{}}=i;return c.jsx(ln,{id:"profile-form-modal",title:t||n||o.formatMessage({id:"profileModal_title"}),isOpen:l,showDivider:!t,functions:{onClose:d},className:K("profile-modal",s,{success:!!t}),maxWidth:700,children:c.jsxs(c.Fragment,{children:[t&&n||r?c.jsxs("div",{className:"intro",children:[t&&n?c.jsx("h3",{children:n}):"",r?c.jsx("p",{children:r}):""]}):null,c.jsx(ah,{...a,meta:{shouldShowCancelButton:!1},functions:{...(a==null?void 0:a.functions)||{},onSuccess:async f=>{var h;try{(h=a==null?void 0:a.functions)!=null&&h.onSuccess&&await a.functions.onSuccess(f)}finally{d()}}}})]})})},ka=vk,bk=Object.freeze(Object.defineProperty({__proto__:null,default:ka},Symbol.toStringTag,{value:"Module"}));const yk=({members:e})=>{const[t,n]=x.useState(!1),r=i=>{const{fullName:a,jobTitle:s,organisation:o,photo:l}=i||{};return c.jsxs(c.Fragment,{children:[c.jsx(un,{name:a,src:l}),c.jsx("p",{children:a}),c.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return c.jsxs("div",{className:"directory-wrapper",children:[c.jsx("ul",{className:"directory",children:e.map(i=>c.jsx("li",{children:c.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),n(i)},children:r(i)})},i.fullName))}),c.jsx(ln,{isOpen:t!==!1,children:t===!1?"":c.jsxs(c.Fragment,{children:[r(t),c.jsx(On,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const xk=({author:e,authorCite:t,content:n,member:r,className:i=""})=>c.jsxs("blockquote",{className:K("testimonial-block",i),children:[c.jsx(Zt,{className:"testimonial",children:n}),r?c.jsx(an,{member:r,styling:{size:"large"}}):c.jsxs(c.Fragment,{children:[e&&c.jsx("p",{className:K("author",{"text-small":!i.includes("new")}),children:e}),t&&c.jsx("p",{className:K("author-cite",{"text-small":!i.includes("new")}),children:c.jsx("cite",{children:t})})]})]}),wk=x.memo(xk);const Ck=({items:e=[],selector:t="",className:n=""})=>{const r=ie.useIntl(),[i,a]=x.useState(e);return x.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,d)=>{s+=`${d>0?", ":""}${t} h${d+1}`});const l=Array.from(document.querySelectorAll(s)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));a(l)},[]),i&&i.length>0&&c.jsxs(_t,{variant:"subtle",className:K("table-of-contents",n),children:[c.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),c.jsx("nav",{children:c.jsx("ul",{children:i.map(({id:s,text:o})=>c.jsx("li",{children:c.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const Fa=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:i=""})=>{const a=ie.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=d=>{const f=d/60,h=Math.floor(f),p=(f-h)*60,v=Math.round(p),m=`${a.formatMessage({id:`${s}hours`},{time:h})}${h>0&&v>0?", ":""}${a.formatMessage({id:`${s}minutes`},{time:v})}`;return{text:`${h>0?`${a.formatMessage({id:`${s}hours_short`},{time:h})} `:""}${v>0?a.formatMessage({id:`${s}minutes_short`},{time:v}):""}`,ariaText:m}};let{text:l,ariaText:u}=o(e);if(t){const{text:d,ariaText:f}=o(e+t);l=a.formatMessage({id:`${s}range`},{early:l,late:d}),u=a.formatMessage({id:`${s}range_aria`},{early:u,late:f})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),c.jsx("span",{className:K("time-to-complete",i),"aria-label":u,children:l})};const Dk=({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",c.jsx(Cn,{...n,className:K("banner",e),image:{...t,aspect:"banner"}})):null;const Ek=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],_k=({className:e="",content:t,image:n,variant:r,spacing:i="normal",styling:a,hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:l})=>{var v,m;const u={imageFullWidth:!0,...a};r||(r=u.imageFullWidth?"default":"light");const d=["eyebrow","title","text"],f={eyebrow:"small",title:"h1",text:"p"},h={};d.forEach(b=>{if(!t[b]){h[b]=!1;return}if(!s[b]){if(typeof t[b]=="object"){h[b]=t[b];const{text:g,element:y}=t[b];if(y&&Ek.includes(y.toLowerCase()))return;h[b]={text:g,element:f[b]};return}h[b]={text:t[b],element:f[b]}}});const p=o&&o.text&&o.link;return p&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=b=>{b.preventDefault(),b.stopPropagation();const g=document.getElementById(o.link.substring(1));g&&g.scrollIntoView({behavior:"smooth"})}),c.jsx(kn,{className:K("banner-section",r,i,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":p,"has-extra-spacing":r!=="subtle"&&i==="normal"&&h.eyebrow&&h.title}),children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"content-wrapper",children:[d.map(b=>{if(h[b]&&typeof h[b]=="object"){const{text:g,element:y=""}=h[b];return b==="text"?c.jsx(On,{overrideType:"text-only",className:"text",children:g},b):x.createElement(y,{key:b,className:b},g)}return null}),l,p&&c.jsx(Ae,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:K({new:r==="subtle",[(v=o.props)==null?void 0:v.className]:(m=o.props)==null?void 0:m.className}),children:o.text})]}),n&&c.jsx(Cn,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},kk=x.memo(_k);const Fk=({image:e,variant:t="default",children:n,className:r=""})=>{const i={};return e&&(i["--image"]=`url(${e})`),c.jsx(kn,{className:K("custom-content-banner",t,r,{"has-image":e}),style:i,children:c.jsx("div",{className:"content-slim",children:n})})};const Ak=({alignImage:e="left",className:t,content:n,image:r})=>{const i=typeof n=="string"?c.jsx(On,{children:n}):n;return c.jsxs(kn,{className:K("highlight-section",t),children:[r&&c.jsx("div",{className:K("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:c.jsx(Cn,{image:{...r,description:"",query:"q=85",aspect:"highlightSection"}})}),c.jsx("div",{className:K("highlight-container highlight-content-wrapper",{"no-image":!r}),children:c.jsx("div",{className:K("highlight-content",{"highlight-content-right":e==="left"}),children:r?i:c.jsx("div",{className:"content-default",children:i})})})]})},Bk=x.memo(Ak);const Tk=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:i})=>!n&&!r?null:c.jsxs("aside",{className:K("marketing-block",e),children:[n&&c.jsx("p",{className:"title",children:n}),r&&c.jsx("p",{children:r}),t&&c.jsx(Ae,{variant:t.variant||"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":i,"data-gtm-event-type":"learn-more-click",children:t.text})]}),Sk=({type:e,data:t})=>{const n=ie.useIntl(),{answers:r,createdAt:i,dateHasPassed:a,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:d}=t;if(e==="question"){const f=i&&js(i);return c.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),i&&c.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:f?n.formatMessage({id:`dates_${f.path}`},{number:f.number}):0})]})]})}if(d&&!a||s)return c.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):ho(d)});if(o)return c.jsx(Yt,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const f=u&&js(u);return c.jsxs("ul",{className:"details",children:[l&&c.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&c.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:f?n.formatMessage({id:`dates_${f.path}`},{number:f.number}):0})})]})}return null},jk={title:66,text:3e3,secondaryText:1e3,partner:34},ca={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"}},Pk=({data:e,cta:t,link:n,gtmContext:r})=>{var m,b;const i=ie.useIntl(),[a,s]=x.useState({loading:!1,registered:e.registered||!1});x.useEffect(()=>{e.registered&&s(g=>({...g,registered:!0}))},[e.registered]);const{customLinkText:o,startDate:l,dateHasPassed:u,pill:d,slug:f}=e,h=e.contentType;let p="";if((m=ca[h])!=null&&m.gtmEvent&&(p=ca[h].gtmEvent),l&&u)return n?c.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${p}-click`,children:o||i.formatMessage({id:"card_watch"})}):null;if(h==="people")return n?c.jsx(Ae,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${p}-click`,children:o||i.formatMessage({id:"card_cta_people"})}):null;const v=["communityPage","microcourse","event"];if(t&&t.onClick&&v.includes(h)&&d!=="premium"){const g=a.loading||a.registered||((b=e==null?void 0:e.members)==null?void 0:b.isMember),y=async C=>{if(C.preventDefault(),C.stopPropagation(),!(g||!t||!t.onClick)){s(k=>({...k,loading:!0}));try{const k=await t.onClick(e);s(k==="success"?()=>({registered:!0,loading:!1}):E=>({...E,loading:!1}))}catch{s(E=>({...E,loading:!1}))}}};return c.jsx("p",{className:K("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:c.jsx(Ae,{onClick:y,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:g,"data-gtm-event-context":`${r}Page-${h}: ${f}`,"data-gtm-event-type":`${r}-${h}-register-click`,"data-testid":"in-card-button",children:o||i.formatMessage({id:`card_cta_${h}${g?`_${a.loading?"loading":"done"}`:""}`})})})}return null};function Ok({buildMemberData:e,communitySlug:t}){const n=ie.useIntl(),r=x.useContext(it),[i,a]=x.useState({count:"...",isMember:!1,memberType:""});return x.useEffect(()=>{e(t,typeof(r==null?void 0:r.id)<"u").then(s=>{if(!s)return;const{membersCount:o,role:l="",pagination:u}=s;let d=0;o?d=o:u!=null&&u.total&&(d=u==null?void 0:u.total),a({count:d.toString(),isMember:!!l,memberType:l})})},[t,e]),c.jsxs("span",{className:"member-information",children:[i.isMember&&c.jsx(Yt,{size:"small",variant:"registered",icon:(i==null?void 0:i.memberType)==="owner"?"user":"tick",children:n.formatMessage({id:`card_member_type_${i.memberType}`})}),c.jsx("span",{className:"label member-count",children:n.formatMessage({id:"card_member_count"},{count:i.count})})]})}const pu=({id:e="",className:t="",buildCardData:n,buildMemberData:r,card:i,cta:a,gtmContext:s="Carousel",handleCardClick:o,meta:l})=>{var F,S;const u=ie.useIntl(),d=x.useContext(it),f=!!(d!=null&&d.id),{isTabbable:h=!0,setFocus:p=!1}=l||{},v=x.useRef(null),[m,b]=x.useState({data:null,isLoading:!0});x.useEffect(()=>{n(i,f).then(I=>{b({data:I,isLoading:!1})}).catch(()=>b(I=>({...I,isLoading:!1})))},[i,f,n]);const{data:g,isLoading:y}=m;if(y||!g)return c.jsx(Nt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});o&&!a&&(a={text:u.formatMessage({id:`card_cta_${i.contentType}`}),onClick:o});const{contentType:C}=g;if(!C||!ca[C])return c.jsx(Nt,{element:"li",className:"card-wrapper"});const{basePath:k="",className:E,length:_,gtmEvent:T}=ca[C];let L=h&&g.slug?`${k}${g.slug}`:!1;h&&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")&&(L=g.slug);const P=I=>{L&&(I.preventDefault(),I.stopPropagation(),window.location.href=L)},z={...jk,..._};let M={className:"card"},A={};return L&&(A={href:L,className:"gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${T}-click`,"data-testid":"link"},g.openInNewTab&&(A.target="_blank"),M={onClick:P,className:"card gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${T}-click`}),p&&(M={...M,tabIndex:"0"},(F=v==null?void 0:v.current)==null||F.focus(),(S=v==null?void 0:v.current)==null||S.scrollIntoView({behavior:"smooth"})),c.jsx("li",{className:K("card-wrapper text-medium",E,t,{"has-link":L,"no-link":!L,"has-image":g.banner}),"data-testid":`${C}-card`,children:c.jsxs("div",{...M,ref:v,children:[c.jsx(Bd,{className:"card-label",contentType:C,customIcon:g.isPrivate?"lock-locked":g.customIcon,customLabel:g.customLabel}),C==="communityPage"&&(g==null?void 0:g.createdAt)&&Kh(g==null?void 0:g.createdAt,60)&&c.jsx(Yt,{size:"small",variant:"information","data-testid":"new-community",children:u.formatMessage({id:"card_new"})}),g.startDate&&!g.isOngoingEvent&&c.jsx(Yt,{size:"small",variant:g.dateHasPassed?"default":"information","data-testid":"date",children:g.dateHasPassed?u.formatMessage({id:"card_ended"}):Ed(g.startDate)}),g.banner?c.jsxs("p",{className:"img",children:[g.registered&&c.jsx(Yt,{size:"small",variant:"registered",children:u.formatMessage({id:"card_registered"})}),c.jsx(Cn,{image:{...g.banner,description:""}})]}):E==="people"?c.jsx(un,{name:g.title||"",src:g.profile,"data-testid":"people-profile-picture"}):null,g.contributors&&c.jsx(xo,{contributors:{data:g.contributors},styling:{size:"small",showGap:E!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(C)?u.formatMessage({id:`card_contributors_${C}`}):void 0,"data-testid":"contributors"}),g.partner&&c.jsx("p",{className:"partners","data-testid":"partners",children:g.partner.length>1?u.formatMessage({id:"card_partner"},{partner:g.partner[0],number:g.partner.length-1}):sr(g.partner[0],z.partner)}),["title","text","secondaryText"].map(I=>{const H=g[I];if(!H)return null;const V=yd(I),ae={key:I,className:V,"data-testid":V},X={wrapper:"p",forceWrapper:!0,forceInline:!0},D=sr(H,z[I]);return["title","text"].includes(I)&&L?(X.wrapper="a",c.jsx("p",{...ae,children:c.jsx(Zt,{options:X,...A,children:D})})):c.jsx(Zt,{options:X,...ae,children:D})}),i.contentType==="communityPage"&&(i.slug||g.slug)&&r&&c.jsx(Ok,{communitySlug:i.slug||g.slug,buildMemberData:r}),c.jsx(Sk,{type:E||"",data:g}),c.jsx(Pk,{data:g,cta:a,link:L||"",gtmContext:s})]})})};const yh=({cards:e,cardTypes:t,className:n="",...r})=>c.jsx("ul",{className:K("card-block",n),children:e.map((i,a)=>{const s=i.slug?`${i.slug}-${t[a]}`:`${t[a]}-${a}`;return c.jsx(pu,{id:s,card:{...i,contentType:t[a]},meta:{setFocus:a===(r==null?void 0:r.focusCardIndex)},...r},s)})}),Mk=(e,t,n,r)=>{const i=t*n<=e,a=e<t*(n+1),s=r.includes(Math.floor(e/t));return{inView:i&&a,isLoaded:s}},Nk=({id:e,title:t})=>{const n=ie.useIntl();if(!t||!t.text)return null;const{text:r,element:i="h2",variant:a="default",size:s="medium",link:o}=t;return x.createElement(i,{className:K("title",a,s,{"highlighted-title":a==="highlighted"}),children:c.jsxs(c.Fragment,{children:[r,o&&c.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 As={fourCards:1024,threeCards:769,twoCards:480};let Si=null,Bs=null;const Ik=({id:e,cards:t,cardTypes:n,buildCardData:r,title:i,className:a,gtmContext:s,...o})=>{const l=ie.useIntl(),u="carousel_pagination_",[d,f]=x.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:h,isLoading:p}=d,[v,m]=x.useState({currentPage:0,loadedPages:[0]}),{currentPage:b,loadedPages:g}=v,[y,C]=x.useState(""),k=t.length,E=Math.ceil(k/h),_=x.useRef(null),T=wn(!0,!0,_==null?void 0:_.current);x.useEffect(()=>{let F=1;T&&(T>=As.fourCards?F=4:T>=As.threeCards?F=3:T>=As.twoCards&&(F=2),F>k&&(F=k)),f(S=>({...S,cardsPerPage:F,isLoading:!1}))},[T,k]);const L=(F="next")=>{Bs&&clearTimeout(Bs);let S=b;if(typeof F=="string")if(F==="next")if(b<E-1)S=b+1;else return;else if(b>0)S=b-1;else return;else S=F;C(""),m(H=>({...H,currentPage:S,loadedPages:[...new Set([...g,S])]}));const I=()=>{const H=S*d.cardsPerPage,V=H+d.cardsPerPage;return t.slice(H,V).length};Bs=setTimeout(()=>{C(l.formatMessage({id:`${u}ariaLive${typeof F=="string"?"":"_slide"}`},{direction:l.formatMessage({id:`${u}${typeof F=="string"?F:"next"}`}),slide:typeof F=="string"?1:F+1,count:I()}))},500)},P=F=>{Si=F.touches[0].clientX},z=F=>{if(Si===null)return;const S=F.touches[0].clientX,I=Si-S;I>5?L("next"):I<-5&&L("previous"),Si=null},M={"--width":`${T||0}px`,"--total-cards":k,"--cards-per-page":h,"--page":b};if(p)return c.jsx(pa,{layout:`carousel${i?"-with-title":""}`});const A=(F,S)=>{var H;let I=null;return(H=F==null?void 0:F.sys)!=null&&H.id?I=`card-${F.sys.id}`:F!=null&&F.slug?I=`card-${F.slug}`:[n[S],F.contentType].includes("customCard")&&(I=`card-${window.btoa(`${F.title} ${F.createdAt}`)}-${S}`),I};return c.jsxs("section",{ref:_,className:K("carousel-wrapper",a),"data-testid":"carousel",children:[c.jsx(Nk,{id:e,title:i}),c.jsx("ul",{className:"carousel",onTouchStart:P,onTouchMove:z,style:M,"data-testid":"carousel-list",children:t.map((F,S)=>{let I=A(F,S);const{inView:H,isLoaded:V}=Mk(S,h,b,g);return I&&(H||V)?c.jsx(pu,{id:I,card:{...F,contentType:n[S]},buildCardData:r,gtmContext:s,meta:{isTabbable:H},...o},I):(I=I||`${e}-card-${S}`,c.jsx(Nt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},I))})}),E<=1?null:c.jsxs(c.Fragment,{children:[c.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[c.jsx("li",{className:"arrow previous",children:c.jsx(Ae,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:F=>{F.preventDefault(),F.stopPropagation(),L("previous")},screenreaderText:l.formatMessage({id:`${u}previousSlide`}),disabled:b<=0})}),[...Array(E)].map((F,S)=>c.jsx("li",{"data-testid":"carousel-controls-button",children:c.jsx("button",{className:K("page-indicator",{selected:S===b}),onClick:I=>{I.preventDefault(),I.stopPropagation(),L(S)},children:c.jsx(Me,{showOnFocus:!1,children:l.formatMessage({id:`${u}slide`},{number:S+1,total:E})})})},`page-indicator-${S}`)),c.jsx("li",{className:"arrow next",children:c.jsx(Ae,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:F=>{F.preventDefault(),F.stopPropagation(),L("next")},screenreaderText:l.formatMessage({id:`${u}nextSlide`}),disabled:b>=E-1})})]}),c.jsx(Me,{"aria-live":"polite",showOnFocus:!1,children:y})]})]})},Rk=({carousels:e=[],isLoading:t,title:n,className:r="",...i})=>!e||!e.length?null:e.map(({title:a,viewAllUrl:s,cards:o,cardsTypes:l},u)=>{const d=a?window.btoa(a):`carousel-${u}`,f=u===e.length-1;return t?c.jsxs(x.Fragment,{children:[c.jsx(pa,{layout:`carousel${a?"-with-title":""}`,"data-testid":"carousel-placeholder"}),f?null:c.jsx(zt,{})]},`placeholder-${d}`):c.jsxs(x.Fragment,{children:[c.jsx(Ik,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:a,link:s},...i}),f?null:c.jsx(zt,{})]},`carousel-${d}`)});const $k=({element:e="div",className:t="",card:n,gtmContext:r="NarrowCard"})=>{const{banner:i,title:a,text:s,isPrivate:o,slug:l}=n;let u={};return l&&(u={onClick:f=>{l&&(f.preventDefault(),f.stopPropagation(),window.location.href=l)},tabIndex:"0","data-gtm-event-context":`${r}-NarrowCard`,"data-gtm-event-type":`${r}-click`}),x.createElement(e,{className:K("narrow-card",t,{"has-link":l,"gtm-trackable":l,"no-link":!l}),...u,children:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:K("img",{private:o,"no-image":!i}),children:i&&c.jsx(Cn,{image:i})}),c.jsxs("div",{className:"content",children:[a&&c.jsx("p",{className:"title text-medium",children:a}),s&&c.jsx("p",{className:"text text-medium",children:s})]})]})})};const Lk=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:i=!0},graph:a,styling:s={},className:o=""})=>{const l=ie.useIntl();let u=i?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:d=!1}=s;return x.createElement(e,{className:K("course-progression",o,{"highlight-percentage":d,"has-circle-graph":a==="circle"}),children:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:f=>c.jsx("strong",{children:f}),number:u})}),u<100&&i&&c.jsx(Fa,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})}),c.jsx(yo,{progress:u,styling:{layout:a||"bar",size:a&&a==="circle"?"small":"default"}})]})})};const xh=({element:e="span",sectionId:t,subsectionId:n,title:r,className:i=""})=>x.createElement(e,{className:K("lesson-name",i),"data-number":`${t}.${n}`,children:r});const wh=({size:e="default",completionTime:t,icon:n,optional:r,type:i,children:a})=>{const s=ie.useIntl(),o=fa(`lessonType_${i}`)?s.formatMessage({id:`lessonType_${i}`}):wd(i||"");return c.jsxs("small",{className:K("content-type",{[e]:e!=="default"}),children:[c.jsx("span",{className:K("type",n),children:o})," ",t>0&&!r&&c.jsx(Fa,{time:t})," ",a?c.jsx("span",{className:"additional",children:a}):null]})};const zk=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:i,sectionId:a,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:d})=>{const f=ie.useIntl(),h="courseStructure_",p=u.toLowerCase().includes("course conclusion");return c.jsxs(ma,{className:"course-structure",label:c.jsxs(c.Fragment,{children:[c.jsxs("small",{children:[f.formatMessage({id:`${h}section${p?"_end":""}`},{number:a})," ",!r&&s>=0&&c.jsx("span",{className:"time",children:i&&l===0?f.formatMessage({id:`${h}time_completed`}):c.jsx(Fa,{time:s,appendedText:i?f.formatMessage({id:`${h}time_left`}):""})})]}),c.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[c.jsx("p",{children:n}),c.jsx("ol",{children:e&&e.length>0&&e.map(({completed:v,completionTime:m,contentType:b,icon:g,image:y,isIntroduction:C,optional:k,slug:E,subsectionId:_,title:T,type:L})=>{const P=i&&t||C,z={};return y&&(z.style={"--image":`url(${y})`}),c.jsx("li",{className:K({article:b===jr.ARTICLE,discussion:b===jr.DISCUSSION,quiz:b===jr.QUIZ,completed:v&&b===jr.ARTICLE,locked:!P}),...z,children:c.jsx(Dn,{href:P?`/microcourses/en/${o}/${E}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${xd(T)}`,gtmType:"article-click",children:c.jsxs(c.Fragment,{children:[c.jsx(xh,{sectionId:a,subsectionId:_,title:T,className:"course-title"})," ",c.jsx(wh,{completionTime:m,icon:g,optional:k,type:L,children:d&&d[E]&&c.jsx("span",{className:"quiz-score",children:`${d[E]}%`})})]})})},E)})})]})};const qk=({isComplete:e=!1,onClick:t,...n})=>{const r=ie.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),c.jsx(Ae,{...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:K("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})},Uk=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:i}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:i}}),ud=[{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 ji="notFoundError_",Wk=()=>{const e=ie.useIntl(),t=[];return ud.forEach((n,r)=>{n.title=e.formatMessage({id:`${ji}post_${r+1}`}),t.push("solutionArticle")}),c.jsxs(ch,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:c.jsxs(kn,{children:[c.jsx(yh,{cards:ud,cardTypes:t,buildCardData:n=>new Promise((r,i)=>{r(n)})}),c.jsx(Ae,{href:"/solution-articles/",children:e.formatMessage({id:`${ji}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[c.jsx("h1",{children:e.formatMessage({id:`${ji}title`})}),c.jsx("p",{children:e.formatMessage({id:`${ji}text`})})]})};exports.ASSETS_BUCKET=Gt;exports.ActionBar=wf;exports.ActionButton=Zr;exports.ActivitiesFeed=lv;exports.ActivitySection=hk;exports.ActivityType=yr;exports.AddPost=mu;exports.Badge=Ud;exports.BadgeScope=ut;exports.Badges=Wd;exports.BadgesContext=go;exports.BadgesProvider=Od;exports.Banner=Dk;exports.BannerSection=kk;exports.Breadcrumbs=Bv;exports.Buckets=lp;exports.Button=Ae;exports.ButtonWrapper=vr;exports.COURSE_CONTENT_TYPES=jr;exports.CacheProvider=Md;exports.Card=pu;exports.CardBlock=yh;exports.Carousel=Rk;exports.CharacterLimit=No;exports.Checkbox=Io;exports.CollapsibleSection=ma;exports.Columns=_f;exports.CommunityDetails=Bg;exports.ContactFooter=M_;exports.ContactForm=rh;exports.ContentTypeLabel=Bd;exports.Contributors=xo;exports.ConversationContext=_a;exports.CookieBanner=lh;exports.CourseProgression=Lk;exports.CourseStructure=zk;exports.CustomContentBanner=Fk;exports.CustomEvents=rt;exports.DELETED_USER_ID=Vr;exports.Directory=yk;exports.DiscussionContentType=Be;exports.DiscussionConversation=mh;exports.DiscussionForm=oi;exports.DiscussionFormCard=ph;exports.DiscussionFormModal=bh;exports.DiscussionPost=ui;exports.DiscussionThread=vh;exports.Divider=zt;exports.DownloadSection=S_;exports.EMAILS=Qn;exports.EditSection=P_;exports.EmailHelperTextBox=Ff;exports.EmptyStateBox=Qt;exports.EnrichedUrl=Oo;exports.FeatureFlags=Id;exports.Filters=Cf;exports.FlagsProvider=Nd;exports.Footer=du;exports.Form=Xt;exports.Formatting=Z;exports.Fragment=St;exports.FullWidthSection=kn;exports.GET_STREAM_USER_PREFIX=Ss;exports.GlobalProviders=xp;exports.Header=fu;exports.HelperTextBox=Sd;exports.HiddenFromScreenReaders=da;exports.HideShowTextBox=jd;exports.HighlightSection=Bk;exports.HighlightedTextBox=_t;exports.INVALID_TOKEN=Cd;exports.IconBulletedList=fp;exports.ImageContainer=ap;exports.IntlProvider=Rd;exports.InviteForm=ih;exports.InviteModal=gk;exports.JoinButton=Eo;exports.Label=aa;exports.LanguageContext=vo;exports.LanguageSwitcher=Sv;exports.LessonName=xh;exports.LessonType=wh;exports.LikesButton=pf;exports.LikesFeed=bf;exports.LikesModal=yf;exports.Link=Dn;exports.LoadMore=ii;exports.LoadingBlock=Vd;exports.LoadingPlaceholder=Nt;exports.LoadingState=pa;exports.Logo=Mo;exports.LogoSection=O_;exports.MEMBERS_PER_PAGE=dh;exports.MENTION_REGEX=Dd;exports.MarkCompleteButton=qk;exports.MarkdownText=On;exports.MarketingBlock=Tk;exports.Marks=Kt;exports.Member=an;exports.MembersList=fh;exports.Modal=wo;exports.MoreMenu=Df;exports.NUMBER_OF_COUNTRIES=Wh;exports.NUMBER_OF_USERS=Uh;exports.NarrowCard=$k;exports.NavigationMenu=Ef;exports.NotFoundError=Wk;exports.Overlay=ln;exports.OverlayContext=bo;exports.OverlayProvider=zd;exports.PageHeading=qd;exports.PageLayout=ch;exports.PasswordForm=w_;exports.PasswordRules=jf;exports.Pill=Yt;exports.Poll=hh;exports.Popover=Ad;exports.Portal=br;exports.ProfileForm=ah;exports.ProfileImageChange=nh;exports.ProfileModal=ka;exports.ProfileModalLauncher=hu;exports.ProfilePicture=un;exports.ProgressBar=yo;exports.ProgressTracker=op;exports.PublishArticleForm=E_;exports.Rating=Yv;exports.RepliesFeed=vf;exports.ResponsesHeading=gh;exports.ResponsiveImage=Cn;exports.ResultsVisibility=la;exports.ReturnToNavButton=up;exports.RichTextEditor=cu;exports.SearchForm=oh;exports.ShareLink=xf;exports.ShareLinks=Iv;exports.SignupForm=T_;exports.Span=Ms;exports.StatusBanner=ur;exports.TableOfContents=Ck;exports.Tabs=Rv;exports.Tags=L_;exports.TestimonialBlock=wk;exports.TimeToComplete=Fa;exports.Toggle=y_;exports.Tooltip=Ln;exports.TopLevelPage=N_;exports.UUID_V4_REGEX=Hr;exports.UserContext=it;exports.UserProvider=$d;exports.VisuallyHidden=Me;exports.addAriaProps=sf;exports.basicReducer=pr;exports.camelCaseToDashCase=yd;exports.checkIntlPathExists=fa;exports.enrichPostCategories=Po;exports.generateConditions=Ui;exports.generateCssIcon=Vh;exports.getAuthorData=xr;exports.getCharacterLimitProps=kf;exports.getLongDate=ho;exports.getMember=ga;exports.getPostBody=jo;exports.getShortDate=Ed;exports.getValueLength=va;exports.headerData=ri;exports.likesResponseMock=Fv;exports.mapGetStreamData=Uk;exports.pageReady=_d;exports.passwordValidator=Ps;exports.repliesFeedMock=cv;exports.supportedLanguages=Mi;exports.toCamelCase=xd;exports.toCapitalisedCase=qh;exports.toSentenceCase=wd;exports.transformSlugs=Ls;exports.useAutoResize=md;exports.useBadges=Pd;exports.useCurrentPath=hd;exports.useEffectAfterMount=or;exports.useElementWidth=wn;exports.useOverlay=Ld;exports.useScrollListener=gd;exports.useScrollToHash=fo;exports.useTooltips=mo;exports.useUser=ha;
package/index.mjs CHANGED
@@ -1500,8 +1500,8 @@ Thank you for helping to protect the Apolitical community from abusive content.`
1500
1500
  footer_legal_dataProtection: "Data protection officer",
1501
1501
  footer_legal_euDataProtection: "EU data protection officer",
1502
1502
  footer_contact: "Contact",
1503
- footer_contact_correspondence: "Correspondence address",
1504
- footer_contact_correspondence_address: "251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",
1503
+ footer_contact_london: "London address",
1504
+ footer_contact_london_address: "251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",
1505
1505
  footer_contact_registered: "Registered address",
1506
1506
  footer_contact_registered_address: "20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",
1507
1507
  footer_contact_berlin: "Berlin address",
@@ -25905,14 +25905,14 @@ const Ds = "cookieBanner_", Cs = [
25905
25905
  contact: {
25906
25906
  text: {
25907
25907
  order: [
25908
- "correspondence",
25908
+ "london",
25909
25909
  "washington",
25910
- "registered",
25911
25910
  "berlin",
25911
+ "registered",
25912
25912
  "support",
25913
25913
  "business"
25914
25914
  ],
25915
- correspondence: { address: !0 },
25915
+ london: { address: !0 },
25916
25916
  washington: { address: !0 },
25917
25917
  registered: { address: !0 },
25918
25918
  berlin: { address: !0 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "7.0.4-ac.0",
3
+ "version": "7.0.5",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {