@apolitical/component-library 5.0.4-jc.0 → 5.0.4
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/general/buttons/button/button.d.ts +0 -1
- package/index.js +2 -2
- package/index.mjs +6 -11
- package/package.json +1 -1
- package/sections/full-width-section/full-width-section.d.ts +0 -2
- package/style.css +1 -1
- package/styles/variables/colors/_colors.scss +0 -2
- package/styles/variables/colors/theme/_base.scss +1 -1
- package/styles/variables/colors/theme/_layout.scss +1 -1
package/index.js
CHANGED
|
@@ -32,7 +32,7 @@ Check the top-level render call using <`+ce+">.")}return oe}}function Go(O,oe){{
|
|
|
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:"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_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_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:"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_more:"and {number} more...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_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_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_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their email addresses below",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",inputAutocomplete_placeholder:"Start typing...",passwordRules_unmatched_text:"Passwords do not match",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",passwordRules_currentPassword_label:"Current password",passwordRules_newPassword_label:"New password",passwordRules_confirmPassword_label:"Confirm new password",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.",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",richTextEditor_placeholder:"Write something...",richTextEditor_toolbar:"Formatting options",richTextEditor_bold:"Bold",richTextEditor_italic:"Italic",richTextEditor_strikeThrough:"Strikethrough",richTextEditor_link:"Link",richTextEditor_link_text:"Text:",richTextEditor_link_text_aria:"Text to be linked:",richTextEditor_link_url:"Link:",richTextEditor_link_placeholder:"Type or paste URL",richTextEditor_link_error_required:"Please enter a URL to link to",richTextEditor_link_open:"Open: {link}",richTextEditor_link_open_text:"Opens in a new window",richTextEditor_link_edit:"Edit",richTextEditor_link_remove:"Remove",richTextEditor_link_button:"Add link",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",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>",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_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_explore_communities:"Communities",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital and data",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",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:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll"},um={...sr,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>"},lm={...sr,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"},cm={...sr,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>"},dm=Object.freeze(Object.defineProperty({__proto__:null,en:sr,es:um,fr:lm,pt:cm},Symbol.toStringTag,{value:"Module"})),Ja=(e,t=sr)=>e in t,Tt=(e,t,n,r,a={})=>{let i="";return Ja(`${t}_${n}`)?i=e({id:`${t}_${n}`},a):i=e({id:t},{[r]:n,...a}),i},fm=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let a=n.length-1;a>=0;a--){const i=Math.pow(10,(a+1)*3);if(i<=e){e=Math.round(e*t/i)/t,e===1e3&&a<n.length-1&&(e=1,a++),r=`${e}${n[a]}`;break}}return r},Da=(e,t)=>y.Children.map(e,n=>Object.is(n,null)?n:y.cloneElement(n,{...t})),Jc=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},hm=e=>{var i,s,o;const n=["name","organization","jobTitle","biography"].every(l=>{const u=e[l];return u!=null&&u!==""}),r=((i=e.image)==null?void 0:i.thumbnail)!==void 0,a=((s=e.location)==null?void 0:s.en)!==void 0||((o=e.location)==null?void 0:o.country)!==void 0;return n&&r&&a},mm=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,Sr).replace(/{{id}}/g,Sr):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),Xc=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var i;if(!n)return e;const a=e.match(jr);if(!a)return e;for(const s of a){const o=s.replace(jr,(d,h)=>h),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=l.error?l.error:((i=l==null?void 0:l.data)==null?void 0:i.name)||"",u.id=l.id||"",u.error=l.error;else{const d=l;if(d.startsWith(vs))try{const h=d.replace(vs,"");u.id=h,await r({id:h}).then(p=>{const{name:m,error:g}=p;u.name=g||m||"",u.error=g})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?mm(e,u,t):s)}return e},ed=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},td=e=>new URLSearchParams(window.location.search).get(e),ru=(e="")=>e.replace(/\s+/g,"").length>0,ys=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 Ee=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1,new:!1},icon:r=!1,href:a=!1,element:i="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",screenreaderText:d=!1,children:h=!1,...p})=>{const g=Mn(typeof t=="object"),{showTooltip:f,tooltipProps:b}=Qs(!!u);if(typeof t=="object"&&typeof g=="number"){const _=Object.assign({},t),x=Uc(Object.keys(_));t=Hc(g,x,_)}!l&&u&&(u="");const v=[];typeof t=="string"&&v.push(t),r&&(v.push("icon"),typeof r=="object"?(v.push(r.icon),r.position?v.push(r.position):v.push("left"),r.hover&&v.push(`hover_${r.hover}`),r.animate&&(v.push("animate"),typeof r.animate=="string"&&v.push(r.animate))):(v.push(r),!r.includes("right")&&!r.includes("left")&&v.push("left")));const w={...p,className:Y(e,o,v,{"no-text":!h,disabled:l,button:a,new:n.new,muted:n.muted,"full-width":n.fullWidth}),onClick:_=>{(!a||a[0]==="#")&&s&&(_.preventDefault(),_.stopPropagation()),s&&s(_)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};a&&(i="a",w.href=a);const A=y.createElement(i,w,h||(d?c.jsx(Ne,{showOnFocus:!1,children:d}):null));return l&&u?c.jsxs("span",{className:"button-container",...b,children:[c.jsx(Nn,{isOpen:f,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),A]}):A},or=({buttons:e,wrappers:t=[],className:n="",...r})=>{const a=e.length>1?"ul":"p",i=e.map((s,o)=>{var l;return a==="p"?c.jsx(Ee,{...s},o):c.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:c.jsx(Ee,{...s})},o)});return y.createElement(a,{className:Y("button-wrapper",n),...r,children:i})};const Wt=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return c.jsx("hr",{className:Y(e,{"has-max-width":t}),style:n})},au={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"}},pm=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:a}=e?au[e]:au.fallback;return{range:t&&t.length>0?t:r,sizes:n||a}},gm=({format:e,height:t,query:n,width:r})=>{let a=`w=${r}&h=${t}`;return a=e?`${a}&fm=${e}`:a,a=n?`${a}&${n}`:a,a},bi=({format:e,range:t,url:n,query:r})=>t.map(({height:a,width:i})=>`${n}?${gm({format:e,height:a,query:r,width:i})} ${i}w`).join(", ");const ur=({image:e,className:t,testId:n})=>{const{description:r,height:a,type:i,query:s,url:o,width:l,loading:u,decoding:d,fetchPriority:h}=e,{range:p,sizes:m}=pm(e),g=bi({format:"avif",query:s,range:p,url:o}),f=bi({format:"webp",query:s,range:p,url:o}),b=bi({format:"",query:s,range:p,url:o});return i&&i.includes("svg")?c.jsx("picture",{className:t,children:c.jsx("img",{src:o,alt:r,loading:u||"lazy",decoding:d||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})}):c.jsxs("picture",{className:t,children:[i!=="image/gif"&&c.jsx("source",{type:"image/avif",srcSet:g,sizes:m,"data-testid":"source"}),c.jsx("source",{type:"image/webp",srcSet:f,sizes:m,"data-testid":"source"}),c.jsx("img",{srcSet:b,sizes:m,src:o,alt:r,loading:u||"lazy",decoding:d||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})]})};const vm=({image:e,className:t="",testId:n})=>c.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&c.jsx(ur,{image:{...e},className:"image"})}),fn=({href:e,children:t,fallbackElement:n,className:r="",onClick:a,gtmContext:i,gtmType:s,...o})=>{if(e){const l={...o};return a&&(l.onClick=a),i&&(l["data-gtm-event-context"]=i),s&&(l["data-gtm-event-type"]=s),c.jsx("a",{href:e,className:Y("gtm-trackable",r),...l,children:t})}return n?y.createElement(n,{children:t,className:r,...o}):c.jsx(c.Fragment,{children:t})};const nd=y.forwardRef(({className:e="",children:t},n)=>{const r=y.useRef(null),a=n||r;return c.jsx("aside",{ref:a,className:Y("popover",e),"aria-live":"polite",children:t})}),Ur=({parent:e=document.body,children:t})=>typeof document=="object"?Nc.createPortal(t,e):null,bm=Object.freeze(Object.defineProperty({__proto__:null,default:Ur},Symbol.toStringTag,{value:"Module"}));const ym=({currentStep:e=1,steps:t=1})=>c.jsxs(c.Fragment,{children:[c.jsx(Ne,{children:c.jsx(se.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 a=r+1;return c.jsxs("div",{className:"dot-wrapper",children:[c.jsx("div",{className:Y("dot",{active:a===e,completed:a<e}),"data-testid":"progress-dot"}),c.jsx("div",{className:Y("line",{active:a<e})})]},r)})})})]});const Dm=({elementId:e,offset:t=20})=>{const n=se.useIntl(),r=()=>{const a=document.getElementById(e);if(!a)return;const i=document.getElementById("header");i&&window.scrollTo({top:a.offsetTop-i.clientHeight-t})};return c.jsx(Ee,{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 Cm=({items:e,className:t="",...n})=>c.jsx("ul",{className:Y("buckets",t),...n,children:e.map(({title:r,text:a,link:i,...s},o)=>c.jsx("li",{className:"bucket text-medium",children:c.jsxs("a",{href:i,...s,children:[c.jsx("p",{className:"title",children:r}),c.jsx("p",{children:a})]})},o))}),iu=300,su="ease-in-out";class xm{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:iu,easing:su}),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:iu,easing:su}),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 Xa=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const a=se.useIntl(),i=y.useRef(null);return y.useEffect(()=>{let s;return r&&(s=new xm(i.current)),()=>{r&&s&&s.cleanUp()}},[]),c.jsxs("details",{ref:i,className:Y("collapsible-section",t,{"should-animate":r}),children:[c.jsx("summary",{children:e||a.formatMessage({id:"collapsibleSection_summary"})}),c.jsx("div",{className:"content",children:n})]})},ou={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},wm=e=>{let t=e;return Object.keys(ou).includes(e)&&(t=ou[e]),`url(${qt}icons/${t}.svg)`};const uu={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},rd=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const a=se.useIntl(),i=t?{"--custom-icon":wm(t)}:{},s=Ja(`contentTypeLabel_${e}`)?a.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:c.jsx("small",{className:Y("content-type-label text-small",e in uu?uu[e]:e,r,{"has-custom-icon":t}),style:i,"data-testid":"content-type-label",children:n||s})};const Ot=({variant:e="primary",icon:t,styling:n={},className:r="",children:a,...i})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${qt}icons/${t}.svg)`}:{};return c.jsx("div",{className:Y("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...i,children:a})};const hn=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let a=n&&!!Object.keys(n).length;const i=typeof n=="object"&&"breakpoints"in n,s=Mn(i);if(i&&typeof n=="object"&&typeof s=="number"){const h=Object.assign({},n.breakpoints),p=Uc(Object.keys(h));a=Hc(s,p,h)}const{breakpoints:o,text:l="",component:u,...d}=n;return c.jsx(Ot,{variant:"subtle",className:Y("empty-state-box",e,r),children:c.jsxs(c.Fragment,{children:[t&&typeof t=="string"?c.jsx(zt,{options:{forceBlock:!0},children:t}):t,a&&typeof n=="object"&&(u||c.jsx(Ee,{...d,variant:n.variant?n.variant:"secondary",children:l}))]})})};const Ds=({children:e,...t})=>c.jsx("p",{...t,children:e}),ad={q:Ds,blockquote:Ds};for(let e=1;e<=6;e++)ad[`h${e}`]={component:Ds,props:{className:"title"}};const id=({type:e="default",className:t="",heading:n=!1,children:r,...a})=>c.jsxs("div",{...a,className:Y("helper-text-box text-small",e,t),children:[n&&c.jsx("p",{className:"title",children:n}),typeof r=="string"?c.jsx(zt,{options:{wrapper:y.Fragment,forceBlock:!0,overrides:ad},children:r}):c.jsx("p",{children:r})]});const sd=({id:e,className:t="",show:n=!1,hide:r=!1,text:a,markdownOptions:i,fadeStyle:s="default",children:o})=>{const l=se.useIntl(),u=y.useRef(null);e||(e=Date.now().toString());const[d,h]=y.useState(""),[p,m]=y.useState("closed");y.useEffect(()=>{const b=u.current;if(b)return b.addEventListener("transitionend",g),()=>{b.removeEventListener("transitionend",g)}},[]),y.useEffect(()=>{if(!a||typeof a!="string")return;const b=a.split(`
|
|
35
|
+
Thank you for helping to protect the Apolitical community from abusive content.`,discussionFormCard_placeholder:"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_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_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:"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_more:"and {number} more...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_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_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_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their email addresses below",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",inputAutocomplete_placeholder:"Start typing...",passwordRules_unmatched_text:"Passwords do not match",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",passwordRules_currentPassword_label:"Current password",passwordRules_newPassword_label:"New password",passwordRules_confirmPassword_label:"Confirm new password",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.",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",richTextEditor_placeholder:"Write something...",richTextEditor_toolbar:"Formatting options",richTextEditor_bold:"Bold",richTextEditor_italic:"Italic",richTextEditor_strikeThrough:"Strikethrough",richTextEditor_link:"Link",richTextEditor_link_text:"Text:",richTextEditor_link_text_aria:"Text to be linked:",richTextEditor_link_url:"Link:",richTextEditor_link_placeholder:"Type or paste URL",richTextEditor_link_error_required:"Please enter a URL to link to",richTextEditor_link_open:"Open: {link}",richTextEditor_link_open_text:"Opens in a new window",richTextEditor_link_edit:"Edit",richTextEditor_link_remove:"Remove",richTextEditor_link_button:"Add link",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",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>",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_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_explore_communities:"Communities",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital and data",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",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:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll"},um={...sr,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>"},lm={...sr,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"},cm={...sr,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>"},dm=Object.freeze(Object.defineProperty({__proto__:null,en:sr,es:um,fr:lm,pt:cm},Symbol.toStringTag,{value:"Module"})),Ja=(e,t=sr)=>e in t,Tt=(e,t,n,r,a={})=>{let i="";return Ja(`${t}_${n}`)?i=e({id:`${t}_${n}`},a):i=e({id:t},{[r]:n,...a}),i},fm=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let a=n.length-1;a>=0;a--){const i=Math.pow(10,(a+1)*3);if(i<=e){e=Math.round(e*t/i)/t,e===1e3&&a<n.length-1&&(e=1,a++),r=`${e}${n[a]}`;break}}return r},Da=(e,t)=>y.Children.map(e,n=>Object.is(n,null)?n:y.cloneElement(n,{...t})),Jc=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},hm=e=>{var i,s,o;const n=["name","organization","jobTitle","biography"].every(l=>{const u=e[l];return u!=null&&u!==""}),r=((i=e.image)==null?void 0:i.thumbnail)!==void 0,a=((s=e.location)==null?void 0:s.en)!==void 0||((o=e.location)==null?void 0:o.country)!==void 0;return n&&r&&a},mm=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,Sr).replace(/{{id}}/g,Sr):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),Xc=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var i;if(!n)return e;const a=e.match(jr);if(!a)return e;for(const s of a){const o=s.replace(jr,(d,h)=>h),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=l.error?l.error:((i=l==null?void 0:l.data)==null?void 0:i.name)||"",u.id=l.id||"",u.error=l.error;else{const d=l;if(d.startsWith(vs))try{const h=d.replace(vs,"");u.id=h,await r({id:h}).then(p=>{const{name:m,error:g}=p;u.name=g||m||"",u.error=g})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?mm(e,u,t):s)}return e},ed=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},td=e=>new URLSearchParams(window.location.search).get(e),ru=(e="")=>e.replace(/\s+/g,"").length>0,ys=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 Ee=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:a=!1,element:i="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",screenreaderText:d=!1,children:h=!1,...p})=>{const g=Mn(typeof t=="object"),{showTooltip:f,tooltipProps:b}=Qs(!!u);if(typeof t=="object"&&typeof g=="number"){const _=Object.assign({},t),x=Uc(Object.keys(_));t=Hc(g,x,_)}!l&&u&&(u="");const v=[];typeof t=="string"&&v.push(t),r&&(v.push("icon"),typeof r=="object"?(v.push(r.icon),r.position?v.push(r.position):v.push("left"),r.hover&&v.push(`hover_${r.hover}`),r.animate&&(v.push("animate"),typeof r.animate=="string"&&v.push(r.animate))):(v.push(r),!r.includes("right")&&!r.includes("left")&&v.push("left"))),n.muted&&v.push("muted"),n.fullWidth&&v.push("full-width");const w={...p,className:Y(e,o,v,{"no-text":!h,disabled:l,button:a}),onClick:_=>{(!a||a[0]==="#")&&s&&(_.preventDefault(),_.stopPropagation()),s&&s(_)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};a&&(i="a",w.href=a);const A=y.createElement(i,w,h||(d?c.jsx(Ne,{showOnFocus:!1,children:d}):null));return l&&u?c.jsxs("span",{className:"button-container",...b,children:[c.jsx(Nn,{isOpen:f,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),A]}):A},or=({buttons:e,wrappers:t=[],className:n="",...r})=>{const a=e.length>1?"ul":"p",i=e.map((s,o)=>{var l;return a==="p"?c.jsx(Ee,{...s},o):c.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:c.jsx(Ee,{...s})},o)});return y.createElement(a,{className:Y("button-wrapper",n),...r,children:i})};const Wt=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return c.jsx("hr",{className:Y(e,{"has-max-width":t}),style:n})},au={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"}},pm=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:a}=e?au[e]:au.fallback;return{range:t&&t.length>0?t:r,sizes:n||a}},gm=({format:e,height:t,query:n,width:r})=>{let a=`w=${r}&h=${t}`;return a=e?`${a}&fm=${e}`:a,a=n?`${a}&${n}`:a,a},bi=({format:e,range:t,url:n,query:r})=>t.map(({height:a,width:i})=>`${n}?${gm({format:e,height:a,query:r,width:i})} ${i}w`).join(", ");const ur=({image:e,className:t,testId:n})=>{const{description:r,height:a,type:i,query:s,url:o,width:l,loading:u,decoding:d,fetchPriority:h}=e,{range:p,sizes:m}=pm(e),g=bi({format:"avif",query:s,range:p,url:o}),f=bi({format:"webp",query:s,range:p,url:o}),b=bi({format:"",query:s,range:p,url:o});return i&&i.includes("svg")?c.jsx("picture",{className:t,children:c.jsx("img",{src:o,alt:r,loading:u||"lazy",decoding:d||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})}):c.jsxs("picture",{className:t,children:[i!=="image/gif"&&c.jsx("source",{type:"image/avif",srcSet:g,sizes:m,"data-testid":"source"}),c.jsx("source",{type:"image/webp",srcSet:f,sizes:m,"data-testid":"source"}),c.jsx("img",{srcSet:b,sizes:m,src:o,alt:r,loading:u||"lazy",decoding:d||"async",fetchpriority:h||"auto",width:l,height:a,"data-testid":n||"image"})]})};const vm=({image:e,className:t="",testId:n})=>c.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&c.jsx(ur,{image:{...e},className:"image"})}),fn=({href:e,children:t,fallbackElement:n,className:r="",onClick:a,gtmContext:i,gtmType:s,...o})=>{if(e){const l={...o};return a&&(l.onClick=a),i&&(l["data-gtm-event-context"]=i),s&&(l["data-gtm-event-type"]=s),c.jsx("a",{href:e,className:Y("gtm-trackable",r),...l,children:t})}return n?y.createElement(n,{children:t,className:r,...o}):c.jsx(c.Fragment,{children:t})};const nd=y.forwardRef(({className:e="",children:t},n)=>{const r=y.useRef(null),a=n||r;return c.jsx("aside",{ref:a,className:Y("popover",e),"aria-live":"polite",children:t})}),Ur=({parent:e=document.body,children:t})=>typeof document=="object"?Nc.createPortal(t,e):null,bm=Object.freeze(Object.defineProperty({__proto__:null,default:Ur},Symbol.toStringTag,{value:"Module"}));const ym=({currentStep:e=1,steps:t=1})=>c.jsxs(c.Fragment,{children:[c.jsx(Ne,{children:c.jsx(se.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 a=r+1;return c.jsxs("div",{className:"dot-wrapper",children:[c.jsx("div",{className:Y("dot",{active:a===e,completed:a<e}),"data-testid":"progress-dot"}),c.jsx("div",{className:Y("line",{active:a<e})})]},r)})})})]});const Dm=({elementId:e,offset:t=20})=>{const n=se.useIntl(),r=()=>{const a=document.getElementById(e);if(!a)return;const i=document.getElementById("header");i&&window.scrollTo({top:a.offsetTop-i.clientHeight-t})};return c.jsx(Ee,{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 Cm=({items:e,className:t="",...n})=>c.jsx("ul",{className:Y("buckets",t),...n,children:e.map(({title:r,text:a,link:i,...s},o)=>c.jsx("li",{className:"bucket text-medium",children:c.jsxs("a",{href:i,...s,children:[c.jsx("p",{className:"title",children:r}),c.jsx("p",{children:a})]})},o))}),iu=300,su="ease-in-out";class xm{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:iu,easing:su}),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:iu,easing:su}),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 Xa=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const a=se.useIntl(),i=y.useRef(null);return y.useEffect(()=>{let s;return r&&(s=new xm(i.current)),()=>{r&&s&&s.cleanUp()}},[]),c.jsxs("details",{ref:i,className:Y("collapsible-section",t,{"should-animate":r}),children:[c.jsx("summary",{children:e||a.formatMessage({id:"collapsibleSection_summary"})}),c.jsx("div",{className:"content",children:n})]})},ou={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},wm=e=>{let t=e;return Object.keys(ou).includes(e)&&(t=ou[e]),`url(${qt}icons/${t}.svg)`};const uu={customCard:"custom",microcourse:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},rd=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const a=se.useIntl(),i=t?{"--custom-icon":wm(t)}:{},s=Ja(`contentTypeLabel_${e}`)?a.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:c.jsx("small",{className:Y("content-type-label text-small",e in uu?uu[e]:e,r,{"has-custom-icon":t}),style:i,"data-testid":"content-type-label",children:n||s})};const Ot=({variant:e="primary",icon:t,styling:n={},className:r="",children:a,...i})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${qt}icons/${t}.svg)`}:{};return c.jsx("div",{className:Y("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...i,children:a})};const hn=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let a=n&&!!Object.keys(n).length;const i=typeof n=="object"&&"breakpoints"in n,s=Mn(i);if(i&&typeof n=="object"&&typeof s=="number"){const h=Object.assign({},n.breakpoints),p=Uc(Object.keys(h));a=Hc(s,p,h)}const{breakpoints:o,text:l="",component:u,...d}=n;return c.jsx(Ot,{variant:"subtle",className:Y("empty-state-box",e,r),children:c.jsxs(c.Fragment,{children:[t&&typeof t=="string"?c.jsx(zt,{options:{forceBlock:!0},children:t}):t,a&&typeof n=="object"&&(u||c.jsx(Ee,{...d,variant:n.variant?n.variant:"secondary",children:l}))]})})};const Ds=({children:e,...t})=>c.jsx("p",{...t,children:e}),ad={q:Ds,blockquote:Ds};for(let e=1;e<=6;e++)ad[`h${e}`]={component:Ds,props:{className:"title"}};const id=({type:e="default",className:t="",heading:n=!1,children:r,...a})=>c.jsxs("div",{...a,className:Y("helper-text-box text-small",e,t),children:[n&&c.jsx("p",{className:"title",children:n}),typeof r=="string"?c.jsx(zt,{options:{wrapper:y.Fragment,forceBlock:!0,overrides:ad},children:r}):c.jsx("p",{children:r})]});const sd=({id:e,className:t="",show:n=!1,hide:r=!1,text:a,markdownOptions:i,fadeStyle:s="default",children:o})=>{const l=se.useIntl(),u=y.useRef(null);e||(e=Date.now().toString());const[d,h]=y.useState(""),[p,m]=y.useState("closed");y.useEffect(()=>{const b=u.current;if(b)return b.addEventListener("transitionend",g),()=>{b.removeEventListener("transitionend",g)}},[]),y.useEffect(()=>{if(!a||typeof a!="string")return;const b=a.split(`
|
|
36
36
|
`);h(b.length<3?`${a.substring(0,400)}...`:b.slice(0,3).join(`
|
|
37
37
|
`))},[a]),y.useEffect(()=>{p==="ready-to-close"&&m("closing")},[p]);const g=({propertyName:b})=>{b==="max-height"&&m(v=>v==="opening"?"open":v==="closing"?"closed":v)},f=["opening","open"].includes(p);return c.jsxs(Ot,{variant:"subtle",className:Y("hide-show-text-box",t),children:[c.jsx("div",{ref:u,id:e,className:Y("content",p,s),children:a?c.jsxs(c.Fragment,{children:[c.jsx(zt,{options:{forceBlock:!0,...i},children:p==="closed"?d:a}),p!=="closed"&&o]}):o}),c.jsx("p",{className:"cta",children:c.jsx(Ee,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:Y({"rotate-180":f}),onClick:()=>{m(f?"ready-to-close":"opening")},"aria-expanded":f,"aria-controls":e,children:f?r||l.formatMessage({id:"hideShowTextBox_hide"}):n||l.formatMessage({id:"hideShowTextBox_show"})})})]})};const Em=({element:e="ul",layout:t="vertical",variant:n="default",items:r=[],styling:a={},className:i=""})=>{const{hasBorder:s=!1,zebraStriping:o=!1}=a;return y.createElement(e,{className:Y("icon-bulleted-list text-medium",n,i,{"has-border":s,"has-zebra-stripes":o,[t]:e!=="dl"}),children:r.map((l,u)=>{const d={wrapper:y.Fragment,forceInline:!0},h={"--icon":`url(${qt}icons/${l.icon}.svg)`};return e==="dl"?c.jsxs(y.Fragment,{children:[c.jsx("dt",{style:h,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:h,children:typeof l.text=="string"?c.jsx(zt,{options:d,children:l.text}):l.text},u)})})},at=()=>y.Fragment,_m=({children:e})=>c.jsx(Ot,{variant:"secondary",children:e}),km=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?c.jsx("p",{className:"center",children:e}):c.jsx("div",{className:"center",children:e}),Fm=["span","strong","h1","h2","h3","h4","h5","h6","p"],Bm=({children:e})=>{const t=se.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const i of y.Children.toArray(e))if(!(!i||typeof i=="string"||typeof i=="number"))if(y.isValidElement(i)&&i.type==="summary"){if(i.props&&i.props.children){for(const s of y.Children.toArray(i.props.children))if(!(!s||typeof s=="string"||typeof s=="number")&&y.isValidElement(s)){const o=s.type;if(Fm.includes(o)){for(n=s.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(i);const a=n?n.toString():"";return c.jsx(Xa,{label:a,className:["Sources","Resources"].includes(a)?"discrete-links":"",children:r.map(i=>i)})},Am=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return c.jsx(Ot,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return c.jsx(Ot,{variant:"primary",children:e});case"pink-textbox":return c.jsx(Ot,{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})},Et=({children:e})=>c.jsx(c.Fragment,{children:e}),Tm=e=>{const t=se.useIntl(),n=Date.now().toString();let r="default";const a=e.src;a.includes("youtube")||a.includes("vimeo")?r="video":a.includes("riddle")||a.includes("sli.do")?r="poll":a.includes("padlet")&&(r="padlet");const i=`content-after-iframe-${n}`;return c.jsxs(c.Fragment,{children:[c.jsx(Ne,{element:"a",href:`#${i}`,onClick:s=>{s.preventDefault(),s.stopPropagation();const o=document.getElementById(i);o==null||o.scrollIntoView({behavior:"smooth"}),o==null||o.focus()},children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})}),c.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),c.jsx("span",{id:i,tabIndex:0})]})},lu=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},Sm=({children:e,...t})=>{const n=se.useIntl();let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let a=e,i=!1;for(const o of y.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&y.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"||lu(o.props.children[0])==="button")&&(i=!0),a=o.props.children[0];a&&typeof a!="string"&&!(typeof a=="boolean"||typeof a=="number"||!y.isValidElement(a));)if(a.props&&a.props.children&&a.props.children[0])a=a.props.children[0],a&&lu(a)==="button"&&(i=!0);else break}const s=`@${Sr}`;return a===s||Array.isArray(a)&&a[0]===s?(delete r.href,delete r.target,c.jsxs("span",{...r,className:"mention deleted-user",children:["@",n.formatMessage({id:"member_deleted"})]})):i?(r={...r,className:"button primary medium"},c.jsx("p",{className:"center",children:c.jsx(Ee,{variant:"primary",size:"medium",...r,children:a})})):c.jsx("a",{...r,children:a})},Cs=({children:e,...t})=>c.jsx("span",{className:Y({url:t==null?void 0:t.href}),children:e});const jm={default:{a:Sm,CollapsibleSection:Xa,TextBox:Ot,CaseStudy:_m,style:at,details:Bm,div:Am,iframe:Tm,center:km},"text-only":{h1:at,h2:at,h3:at,h4:at,h5:at,h6:at,style:at,details:at,div:at,TextBox:at,CollapsibleSection:at,CaseStudy:at,blockquote:at,iframe:at,button:at}},Bn=({element:e="div",className:t="",options:n={},children:r,overrideType:a="default",styling:i={}})=>{if(!r)return null;const{highlightTitles:s=!1}=i;r=r.replace(/^<br\/?>/,"");const o={wrapper:y.Fragment,forceBlock:!0};let l=jm[a];return n.overrides&&(l={...l,...n.overrides}),y.createElement(e,{className:Y("markdown-text",t,{"highlight-titles":s}),children:c.jsx(zt,{options:{...o,...n,overrides:l},children:r})})};const od=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:a=""})=>{const i=e?{"--max-width":`${e/16}rem`}:{};return c.jsxs("section",{className:Y("page-heading",a),children:[c.jsxs("div",{className:Y("content",{"has-max-width":e}),style:i,children:[t&&t.text&&y.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&y.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),r]})};const Gt=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:a="",children:i,element:s="span",...o})=>{const l={"--icon":`url(${qt}icons/${r}.svg)`},{showTooltip:u,tooltipProps:d}=Qs(!!a),h=y.createElement(s,{className:Y("pill",e,t,n,{"has-icon":r}),style:l,children:i,...d,...o});return a?c.jsxs("span",{className:"pill-wrapper",children:[h,c.jsx(Nn,{isOpen:u,accessibility:{readToScreenreadersWhenClosed:!0},children:a})]}):h};const Or=({element:e="p",children:t=null,className:n="",...r})=>y.createElement(e,{...r,className:Y("status-banner text-small",n),"aria-live":"assertive"},t);const Om=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const a=se.useIntl(),{showText:i=!1,layout:s="bar",size:o="default",color:l="default"}=e,u=t>75?100:t>50?75:t>25?50:t>5?25:0,d={"--progress":`${t}%`};return c.jsx("span",{className:Y(`progress-bar section-${u}`,s,r,{[o]:o!=="default",[l!=="default"?l:""]:l!=="default"}),style:d,children:y.createElement(i?"span":Ne,{className:i?"text":"",children:n||a.formatMessage({id:"progressBar"},{number:t})})})},Xs=y.memo(Om);const yi="loadingBlock_",Pm=({progress:e=0,steps:t=!1,className:n=""})=>{const r=se.useIntl();t||(t={0:{text:r.formatMessage({id:`${yi}loading`})},75:{text:r.formatMessage({id:`${yi}almostDone`})},100:{text:r.formatMessage({id:`${yi}complete`})}});let a=null;const i=Object.keys(t);for(let o=0;o<i.length&&!(e<parseInt(i[o]));o++)a=i[o];const s=a&&t[a].icon?{"--icon":`url(${qt}icons/${t[a].icon}.svg)`}:{};return c.jsxs(Ot,{className:Y("loading-block",n,{"has-icon":a&&t[a].icon}),variant:"subtle",style:s,children:[a&&c.jsx("span",{className:"step",children:t[a].text}),c.jsx(Xs,{progress:e})]})},Mm=y.memo(Pm);const Bt=({element:e="div",className:t="",...n})=>c.jsx(Qa,{element:e,className:Y("loading-placeholder",t),...n});const xs={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],heading:["title"],cards:["card","card","card","card"],carousel:["cards","controls"],"carousel-with-title":["title","cards","controls"],answers:["text","text","text"],"text-page":["title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"form-with-answers":["question","subtitle","form","answers","answers","answers","answers","answers"],"general-website-page":["banner","text-page"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"],"course-navigation":["button","button"],"course-lesson-page":["breadcrumb","course-navigation","text-page"],"course-lesson-quiz":["text-page","quiz-box"]},ud=(e,t)=>e in xs?c.jsx("div",{className:e,children:xs[e].map((n,r)=>ud(n,r))},t):c.jsx(Bt,{className:e},t),eo=({layout:e="overview-page",...t})=>c.jsx("div",{className:Y("loading-state",e),...t,children:xs[e].map((n,r)=>ud(n,r))}),ld=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):""},Qr=["#5AB6A3","#A2D7AF","#806056","#3962B3"],Nm=e=>{const t=Math.ceil(26/Qr.length),n=ld(e).toLowerCase();if(n==="")return Qr[0];const r=n.charCodeAt(0)-96;for(let a=0;a<Qr.length;a++)if(r<=t*(a+1))return Qr[a]};const cu=256,mn=({className:e="",src:t="",name:n,alt:r,width:a=cu,height:i=cu,showInitials:s=!0,...o})=>{const[l,u]=y.useState(!1),d=y.useRef(null),h=r??n;y.useEffect(()=>{const m=d.current;if(!m)return;const g=m.getContext("2d");if(!g)return;const f=a,b=i;typeof window<"u"&&window.devicePixelRatio&&(m.width=f*window.devicePixelRatio,m.height=b*window.devicePixelRatio,g.scale(window.devicePixelRatio,window.devicePixelRatio)),g.fillStyle=Nm(n),g.fillRect(0,0,f,b),g.font=`${f/3}px Arial`,g.textAlign="center",g.fillStyle="white",g.fillText(ld(n),f/2,b/1.6)},[n]);let p=!1;return t&&t!==""&&!l&&(t.includes("http")||t.includes("//"))&&(p=!0),c.jsx("figure",{className:Y("profile-picture",e,{error:l}),...o,children:p?c.jsx("img",{src:t,alt:h,onError:()=>{u(!0)},width:a,height:i}):s?c.jsx("canvas",{ref:d}):c.jsx("span",{className:"fallback"})})},to=y.createContext({badges:[],isLoading:!0});function cd(){return y.useContext(to)}const dd=({children:e,badges:t})=>c.jsx(to.Provider,{value:t,children:e}),fd=({showDevTools:e=!0,children:t})=>{const n=new qe.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return c.jsxs(qe.QueryClientProvider,{client:n,children:[t,e&&c.jsx(Vh.ReactQueryDevtools,{initialIsOpen:!1})]})};var hd=y.createContext({client:ya});function Im(e){var t=e.children,n=e.client,r=e.apiKey,a=e.options,i=y.useMemo(function(){return n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&a&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n||(r&&(ya.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),ya.init(r,a)),ya)},[n,r]);return y.createElement(hd.Provider,{value:{client:i}},t)}var Rm=function(){var e=y.useContext(hd).client;return e};function $m(e){var t=Rm(),n=y.useState(),r=n[0],a=n[1];return y.useEffect(function(){return t.onFeatureFlags(function(){a(t.getFeatureFlagPayload(e))})},[t,e]),r}const md=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?c.jsx(Im,{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 no=(e=>(e.COMMUNITY_RANKING="community-ranking",e))(no||{});const pd=({children:e,locale:t,messages:n})=>{const r=t||"en",a={...dm[r],...n||{}};return c.jsx(se.IntlProvider,{locale:r,messages:a,children:e})},ro=y.createContext({}),Ca={en:"English",es:"Español",fr:"Français",pt:"Português"},gt=y.createContext({isLoading:!0});function ei(){return y.useContext(gt)}const gd=({children:e,user:t,updateDetails:n})=>c.jsx(gt.Provider,{value:{...t,updateDetails:n},children:e}),ao=y.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),vd=()=>y.useContext(ao),bd=({children:e})=>{const[t,n]=y.useState([]);y.useEffect(()=>{t.length>0?document.body.classList.add("has-overlay"):document.body.classList.remove("has-overlay")},[t]);const r=y.useCallback(i=>{n(s=>[...s,i])},[]),a=y.useCallback(i=>{n(s=>s.filter(o=>o!==i))},[]);return c.jsx(ao.Provider,{value:{registerOverlay:r,unregisterOverlay:a},children:e})},Lm=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[a,i]=y.useState({isLoading:!0}),[s,o]=y.useState({badges:[],isLoading:!0}),l=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[u,d]=y.useState(l),h=p=>{localStorage.setItem("language",p),d(p)};return y.useEffect(()=>{e().then(p=>{Array.isArray(p)?(i({...p[0],isLoading:!1}),o({badges:p[1],isLoading:!1})):i({...p,isLoading:!1}),Jc(5e3)}).catch(p=>{p.message===Yc&&window.location.pathname!=="/user-onboarding/logout"&&(window.location.href="/user-onboarding/logout"),i({isLoading:!1}),o({badges:[],isLoading:!1})})},[]),c.jsx(ro.Provider,{value:{language:u,updateLanguage:h},children:c.jsx(pd,{locale:u,messages:n==null?void 0:n.messages,children:c.jsx(Ys.CookiesProvider,{children:c.jsx(gd,{user:a,updateDetails:i,children:c.jsx(dd,{badges:s,children:c.jsx(bd,{children:c.jsx(fd,{showDevTools:r,children:c.jsx(md,{user:a,children:t})})})})})})})})};var Xe=(e=>(e.DISCUSSION_FORM_SUBMITTED="discussionFormSubmitted",e.DISCUSSION_POST_ADDED="discussionPostAdded",e.DISCUSSION_POST_CLICKED="discussionPostClicked",e.MEMBER_CLICKED="memberClicked",e))(Xe||{});const ti=e=>e==="apolitical"?{image:`${qt}logos/member_apolitical.svg`}:e==="community"||e==="deleted"||typeof e=="object"&&!e.name?{image:`${qt}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.country||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail,badges:e.badges},zm=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const a=e!=="",i=t!=="",s=n!=="";if(!a&&!i&&!s)return"";const o=`${e}${a&&i?` — ${t}`:t}`;let l=`${o}${(a||i)&&s?`, ${n}`:n}`;return l.length>r&&(l=o),l.length>r&&(l=er(l,r)),l};const qm={globe:"globe",heart:"heart_empty_thick",pencil:"pencil",star:"star_empty","speech-bubble":"speech-bubble_round"};const Wm=({slug:e})=>{const{badges:t}=cd(),n=t==null?void 0:t.find(o=>o.slug===e);if(!n)return null;const{name:r,icon:a,colour:i,description:s}=n;return c.jsx(Gt,{className:Y("user-badge",i==null?void 0:i.toLowerCase()),icon:a&&qm[a],element:"li",tooltip:s,children:r})};const Um=({element:e="ul",userBadges:t,badgeOptions:n})=>{if(Object.keys(t).length!==0)return y.createElement(e,{className:"badges-list",children:(n==null?void 0:n.scopes)&&(n==null?void 0:n.scopes.map(r=>{var a,i;return(i=(a=t==null?void 0:t[r.scope])==null?void 0:a[r.area])==null?void 0:i.map((s,o)=>c.jsx(Wm,{slug:s},o))}))})},Hm=y.lazy(()=>Promise.resolve().then(()=>bm)),Vm=y.lazy(()=>Promise.resolve().then(()=>a_));let Jr=null;const Qt=({element:e="div",member:t="community",alt:n="",additionalContent:r=!1,styling:a={},functions:i={},gtmContext:s="member",gtmType:o="member-click",className:l="",badges:u,...d})=>{const h=se.useIntl(),{profile:p,...m}=i,{size:g="medium",variant:f="inline",isCondensed:b=!0}=a,v=y.useContext(gt),w=p&&v&&typeof v.id=="string",[A,_]=y.useState(!1),x=ti(t);x.name||(x.name=h.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:T,image:S}=x;let{url:z}=x;typeof t=="object"&&t.link!==void 0&&(t.link===!1?z=void 0:z=t.link);const M=zm(x),q=r&&r.createdAt?bs(r.createdAt):!1,I=r&&r.createdAt?Js(r.createdAt):"";return y.createElement(e,{...d,className:Y("member text-medium",g,f,l,{"has-profile-link":w}),...m,children:c.jsxs(c.Fragment,{children:[c.jsxs(fn,{href:z,gtmType:o,gtmContext:s,onClick:B=>{if(B==null||B.preventDefault(),B==null||B.stopPropagation(),!z)return;Jr&&clearTimeout(Jr),Jr=setTimeout(()=>{window.location.href=z},150);const E=new CustomEvent(Xe.MEMBER_CLICKED,{detail:{link:z,timeout:Jr}});document.dispatchEvent(E)},children:[c.jsx(mn,{name:T,src:S,alt:n}),c.jsxs("div",{className:"details",children:[c.jsxs("div",{className:"name","data-testid":"member-name",children:[T,(u==null?void 0:u.showBadges)&&(x==null?void 0:x.badges)&&c.jsx(Um,{userBadges:x.badges,badgeOptions:u}),r&&c.jsxs("span",{className:"additional-content",children:[r.createdAt&&q&&c.jsx("span",{className:"date",title:I,"aria-label":I,"data-testid":"date",children:h.formatMessage({id:`dates_${q.path}`},{number:q.number})}),r.didEdit&&c.jsx("em",{children:h.formatMessage({id:"discussion_edited"})})]})]}),M&&c.jsx("small",{className:Y({"text-medium":g==="large"}),"data-testid":"member-details",children:b?M:c.jsxs(c.Fragment,{children:[x.role,x.organisation?` — ${x.organisation}`:c.jsx(c.Fragment,{}),c.jsx("span",{className:"location",children:x.country})]})})]})]}),M&&p&&w?c.jsxs(c.Fragment,{children:[c.jsx(Ee,{variant:"tertiary",size:"small",onClick:B=>{B.preventDefault(),B.stopPropagation(),_(!0)},"data-testid":"profile-button",children:h.formatMessage({id:"member_profile"})}),c.jsx(Hm,{children:c.jsx(Vm,{form:p,showModal:A,content:{title:h.formatMessage({id:"member_profile"})},functions:{onClose:()=>{_(!1)}},className:"in-portal"})})]}):c.jsx(c.Fragment,{})]})})},Km=Object.freeze(Object.defineProperty({__proto__:null,default:Qt},Symbol.toStringTag,{value:"Module"}));const du={small:24,medium:48},io=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:a,showGap:i,showPlaceholders:s}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,multipleText:l,className:u="",...d})=>{const h=se.useIntl();return!n||n.length===0?null:y.createElement(e,{...d,className:Y("contributors",u,a,{"has-gap":i}),children:c.jsxs(c.Fragment,{children:[c.jsx("ul",{children:n.map((p,m)=>{let g,f="";if(m<o){const{name:b="",image:v=""}=ti(p);if(s)return c.jsx(Bt,{element:"li",className:"contributor"},m);g=c.jsx(mn,{name:b,src:v,width:du[a||"medium"],height:du[a||"medium"]})}else if(m===o){const b=(t||n.length)-o;g=c.jsxs("small",{className:Y({"large-number":b>99}),children:["+",fm(b,0)]}),f="number-left"}return g?c.jsx("li",{className:Y("contributor",f),children:g},m):null})}),r&&c.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?h.formatMessage({id:`member_${n[0]}`}):er(n[0].name||"",20):l||null})]})})};const so=({element:e="section",children:t,className:n,...r})=>y.createElement(e,{className:Y("modal",n),children:typeof t=="string"?c.jsx("p",{children:t}):t,...r});var ws={exports:{}},Xr={exports:{}},Pe={};/** @license React v16.13.1
|
|
38
38
|
* react-is.production.min.js
|
|
@@ -160,6 +160,6 @@ ${m}${h?"1.":"-"} ${u}${p?`
|
|
|
160
160
|
`;case o[K.hr]:return`---
|
|
161
161
|
`;default:return u}}function Un(e,t){const n=e.trim(),r=n,a=`${t}${r}${wc(t)}`;if(r.length===e.length)return a;const i=t+r+wc(t);return e.replace(n,i)}const wc=e=>e.split("").reverse().join(""),mw=e=>e.map(t=>ih(t)).join("").trim();const pw=({onFallbackClick:e=()=>{}})=>{const t=se.useIntl(),n=In(),{dispatch:r,isInOverlay:a,mentionPopover:i,id:s,onMention:o}=y.useContext(nn),{show:l,selectedUser:u,possibleUsers:d}=i,h=zf(n,"mention-popover",`toolbar-${s}`);if(!l)return c.jsx(c.Fragment,{});const p=ah(a);return c.jsx(Ur,{parent:p,children:c.jsx(nd,{ref:h,className:"mention-popover",onKeyDown:m=>{m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),r([{type:"showMentionPopover",value:!1}]))},children:c.jsxs("ul",{children:[d.map(({userId:m,user:g},f)=>c.jsx(Qt,{element:"li",className:Y({selected:f===u}),member:{id:m,...g,link:!1},functions:{onClick:b=>{b.preventDefault(),b.stopPropagation();const v={...i,selectedUser:f};r([{type:"mentionPopover",value:v}]),rh(n,v,r,s),o&&o({id:m||"",name:g.name||""})}}},m)),c.jsx(Qt,{element:"li",className:Y("fallback",{selected:d.length===u}),member:{id:"0",name:t.formatMessage({id:"richTextEditor_mention_fallback"}),image:{thumbnail:`${qt}icons/invite-user.svg`},link:!1},functions:{onClick:m=>{m.preventDefault(),m.stopPropagation(),e(),r([{type:"mentionPopover",value:{show:!1,selectedUser:0,possibleUsers:[],position:null}}])}}})]})})})},Io=({id:e,active:t,hasDivider:n=!1,callback:r,className:a="",children:i,"aria-pressed":s,...o})=>{const l=se.useIntl(),u=In(),{id:d,tabbableOption:h,setFocus:p,openTooltip:m,dispatch:g}=y.useContext(nn),f={};return e!==h&&(f.tabIndex=-1),s!==null&&(f["aria-pressed"]=typeof s=="boolean"?s:t),c.jsxs("li",{id:`${d}-${e}`,className:Y(e,{"has-divider":n}),onMouseEnter:()=>{g([{type:"openTooltip",value:e}])},onMouseLeave:()=>{g([{type:"openTooltip",value:null}])},onFocus:()=>{g([{type:"openTooltip",value:e}])},onBlur:b=>{b.stopPropagation();const v=[{type:"openTooltip",value:null}];u.selection&&v.push({type:"lastAnchor",value:u.selection.anchor}),g(v)},contentEditable:!1,children:[c.jsxs("button",{...o,...f,className:Y(e,a,{active:t}),onClick:b=>{b.stopPropagation(),b.preventDefault()},onMouseDown:b=>{b.stopPropagation(),b.preventDefault(),r()},onKeyDown:b=>{var v,w,A,_;if(b.key!=="Tab")switch(b.key){case"Enter":b.stopPropagation(),b.preventDefault(),r();break;case"ArrowLeft":case"ArrowRight":b.stopPropagation(),b.preventDefault();const x=b.currentTarget.closest("li");let T=x==null?void 0:x.nextElementSibling;if(b.key==="ArrowLeft"){const M=x==null?void 0:x.previousElementSibling;M?T=M:T=(v=x==null?void 0:x.parentElement)==null?void 0:v.lastElementChild}else T||(T=(w=x==null?void 0:x.parentElement)==null?void 0:w.firstElementChild);const S=T==null?void 0:T.className.split(" ")[0];S&&(p(S),(A=T==null?void 0:T.querySelector("button"))==null||A.focus());break;default:const z=b.currentTarget.closest("fieldset");if(z){(_=z==null?void 0:z.previousElementSibling)==null||_.focus();break}}},children:[c.jsx(Ne,{showOnFocus:!1,children:l.formatMessage({id:`richTextEditor_${e}`})}),c.jsx(Nn,{id:`tooltip-${e}`,styling:{extraPadding:!1,hasPointer:"bottom"},isOpen:m===e,accessibility:{"aria-hidden":!0},children:l.formatMessage({id:`richTextEditor_${e}`})})]}),i]})},Ec=[K.ol,K.ul],sh=(e,t)=>{const{selection:n}=e;if(!n)return!1;const[r]=Array.from(D.nodes(e,{at:D.unhangRange(e,n),match:a=>{const i=a;return!D.isEditor(a)&&de.isElement(a)&&i.type===t}}));return!!r},gw=e=>{const[t]=D.nodes(e,{match:n=>n.type===K.blockquote});return!!t},oh=(e,t,n)=>{try{const r=gw(e),a=sh(e,t),i=Ec.includes(t);Q.unwrapNodes(e,{match:l=>{const u=l;return!D.isEditor(u)&&de.isElement(u)&&Ec.includes(u.type)},split:!0});const o={type:a?K.paragraph:i?K.li:t};if(Q.setNodes(e,o),i)if(a){const{selection:l}=e;if(!l)return;const[u,d]=D.parent(e,l,{edge:"end"});Array.from(D.nodes(e,{at:d,match:p=>{const m=p;return!D.isEditor(p)&&de.isElement(p)&&m.type===K.li}})).forEach(([p,m])=>{ue.string(p).trim()===""&&Q.removeNodes(e,{at:m})})}else{if(r){const u={type:K.blockquote,children:[]};Q.wrapNodes(e,u)}const l={type:t,children:[]};Q.wrapNodes(e,l)}}catch(r){const a=r.message;n(`Error toggling block: ${a}`)}},vw=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=y.useContext(nn),a=In(),i=sh(a,e);return c.jsx(Io,{id:e,active:i,hasDivider:t,callback:()=>{oh(a,e,r),n(i?null:e)}})},Ar=e=>{const[t]=D.nodes(e,{match:n=>{const r=n;return!D.isEditor(n)&&de.isElement(n)&&r.type===K.link}});return!!t},bw=(e,t,n,r)=>{e.selection&&Ro(e,t,n,r)},yw=(e,t,n,r)=>{const{selection:a}=e;if(a&&V.isCollapsed(a)){const[s]=D.nodes(e,{match:o=>{const l=o;return!D.isEditor(o)&&de.isElement(o)&&l.type===K.link}});if(s){const[o,l]=s,u={link:t};Q.setNodes(e,u,{at:l}),No(n)}}else Ro(e,t,n,r)},Ro=(e,t,n,r=a=>{console.error(a)})=>{try{Ar(e)&&uh(e);const{selection:a}=e,i=a&&V.isCollapsed(a),s={type:K.link,link:t,children:i?[{text:t}]:[]};i?(Q.insertNodes(e,s),Q.move(e,{distance:1,unit:"offset"})):(Q.wrapNodes(e,s,{split:!0}),Q.collapse(e,{edge:"end"}),Q.insertNodes(e,{text:""}),Q.move(e,{distance:1,unit:"offset"})),No(n)}catch(a){const i=a.message;r(`Error in wrapLink: ${i}`)}},uh=e=>{Q.unwrapNodes(e,{match:t=>{const n=t;return!D.isEditor(t)&&de.isElement(t)&&n.type===K.link}})};let es=null;const Dw=()=>{const e=se.useIntl(),t="richTextEditor_link_",{id:n,showLinkEditor:r,isInOverlay:a,dispatch:i,reportError:s}=y.useContext(nn),o=In(),l=OD(o),u=(l==null?void 0:l.text)||cw(o),[d,h]=y.useState(Ar(o)),p=zf(o,"link-editor",`${n}-link`),m=y.useRef(null);y.useEffect(()=>{var w;!d&&r&&((w=m.current)==null||w.focus())},[d]),y.useEffect(()=>{es&&clearTimeout(es),es=setTimeout(()=>{h(Ar(o))},500)},[o.selection]);const g=[],f=["open","edit","remove"].map(w=>{const A={variant:"tertiary",size:"small",children:e.formatMessage({id:`${t}${w}`},{link:l==null?void 0:l.pretty})};switch(g.push({className:w}),w){case"open":A.href=(l==null?void 0:l.full)||"",A.onClick=_=>{_.preventDefault(),_.stopPropagation(),window.open((l==null?void 0:l.full)||"","_blank"),i([{type:"showLinkEditor",value:!1}])},A.children=c.jsxs(c.Fragment,{children:[A.children,c.jsx(Ne,{children:e.formatMessage({id:`${t}${w}_text`})})]});break;case"edit":A.onClick=()=>{h(!1)};break;case"remove":A.onClick=()=>{const _=[{type:"showLinkEditor",value:!1}];Ar(o)&&(uh(o),_.push({type:"lastAnchor",value:null})),i(_)};break}return A}),b=[{id:"url",type:"url",inputRef:m,label:e.formatMessage({id:`${t}url`}),placeholder:e.formatMessage({id:`${t}placeholder`}),value:(l==null?void 0:l.full)||"",validation:[{condition:"required",error:e.formatMessage({id:`${t}error_required`})},{condition:"valid-url"}],submitOnEnter:!0,autoFocus:!0,functions:{onChange:()=>{},onKeyDown:w=>{if(w.key==="Tab"){if(!o)return;w.preventDefault(),w.stopPropagation();const A=D.end(o,[]);Q.select(o,A),ne.focus(o)}}}}];u&&b.unshift({component:()=>c.jsxs("p",{children:[c.jsx("strong",{"aria-label":e.formatMessage({id:`${t}text_aria`}),children:e.formatMessage({id:`${t}text`})})," ",u]})});const v=ah(a);return c.jsx(Ur,{parent:v,children:c.jsx(Nn,{ref:p,id:`${n}-link-editor`,className:"link-editor",isOpen:r,styling:{extraPadding:!1,hasForm:!d},functions:{onBlur:()=>{i([{type:"showLinkEditor",value:!1}])}},callbacks:{onOpen:()=>{setTimeout(()=>{var w;return(w=m.current)==null?void 0:w.focus()})}},children:d?c.jsx(or,{wrappers:g,buttons:f}):c.jsx(en,{element:"fieldset",id:`${n}-link-editor`,className:Y({"show-labels":u}),meta:{shouldReset:!0,showRequiredLabels:!1},functions:{onSuccess:async w=>{setTimeout(()=>{const A=[{type:"showLinkEditor",value:!1}];if(w.url){const{full:_}=ed(w.url);l!=null&&l.full?yw(o,_,n,s):bw(o,_,n,s),A.push({type:"lastAnchor",value:null})}i(A)})}},fields:b,button:{text:e.formatMessage({id:`${t}button`}),variant:"tertiary",size:"small"}})})})},Cw=()=>{const e=In(),{setFocus:t,dispatch:n}=y.useContext(nn),[r,a]=y.useState(!1);return y.useEffect(()=>{a(Ar(e))},[e.selection]),c.jsx(Io,{id:"link",active:r,hasDivider:!0,callback:()=>{n([{type:"showLinkEditor",value:!0}]),t(r?null:"link"),a(!0)},"aria-pressed":null})},xw=e=>[K.bold,K.italic,K.strikethrough].includes(e),lh=(e,t)=>{const n=D.marks(e);return n?n[t]===!0:!1},ch=(e,t,n)=>{try{lh(e,t)?D.removeMark(e,t):D.addMark(e,t,!0)}catch(r){const a=r.message;n(`Error toggling mark: ${a}`)}},ww=({format:e,hasDivider:t=!1})=>{const{setFocus:n,reportError:r}=y.useContext(nn),a=In(),i=lh(a,e);return c.jsx(Io,{id:e,active:i,hasDivider:t,callback:()=>{ch(a,e,r),n(i?null:e)}})},Wa=[K.bold,K.italic,K.strikethrough],Ew=[K.ol,K.ul,K.blockquote];const _w=({...e})=>{const t=se.useIntl(),{id:n}=y.useContext(nn);return c.jsxs(c.Fragment,{children:[c.jsxs("fieldset",{id:`toolbar-${n}`,className:"toolbar",...e,children:[c.jsx(Ne,{element:"legend",showOnFocus:!1,children:t.formatMessage({id:"richTextEditor_toolbar"})}),c.jsxs("ul",{children:[Wa.map((r,a)=>c.jsx(ww,{format:r,hasDivider:a===Wa.length-1},r)),c.jsx(Cw,{}),Ew.map((r,a)=>c.jsx(vw,{format:r,hasDivider:a===1},r))]})]}),c.jsx(Dw,{})]})};var kw=Tw,Fw=/^(?:\w+:)?\/\/(\S+)$/,Bw=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,Aw=/^[^\s\.]+\.\S{2,}$/;function Tw(e){if(typeof e!="string")return!1;var t=e.match(Fw);if(!t)return!1;var n=t[1];return n?!!(Bw.test(n)||Aw.test(n)):!1}const Sw=Pn(kw),jw=(e,t,n)=>{const{insertText:r,isInline:a}=e;try{e.isInline=i=>{const s=i;return[K.link].includes(s.type)||a(i)},e.insertText=i=>{i&&Sw(i)?Ro(e,i,t):r(i)}}catch(i){const s=i.message;n(`Error in withInlines: ${s}`)}return e},Ow=(e,t)=>{const{isInline:n,isVoid:r,markableVoid:a}=e;try{e.isInline=i=>i.type===K.mention?!0:n(i),e.isVoid=i=>i.type===K.mention?!0:r(i),e.markableVoid=i=>i.type===K.mention||a(i)}catch(i){const s=i.message;t(`Error in withMentions: ${s}`)}return e},Pw=(e,t)=>{const{normalizeNode:n}=e;try{e.normalizeNode=([r,a])=>{if(r.type===K.link&&ue.string(r).trim()===""){Q.removeNodes(e,{at:a});return}n([r,a])}}catch(r){const a=r.message;t(`Error in withoutEmptyLinks: ${a}`)}return e};const dh=({id:e="rich-text-editor",value:t,placeholder:n,maxLength:r=0,meta:a,functions:i,autoFocus:s,data:o,...l})=>{const u=se.useIntl(),d=om();typeof s>"u"&&(s=!0);const{isInOverlay:h=!1}=a||{},{listMembers:p,clickMentionFallback:m,onChange:g=()=>{},onMention:f=()=>{},reportError:b=L=>{console.error(L)}}=i||{},v=[{type:K.paragraph,children:[{text:""}]}];t==="<br>"&&(t="");const w={editorKey:null,originalValue:t||"",initialValue:t?null:v,tabbableOption:Wa[0],openTooltip:null,showLinkEditor:!1,mentionPopover:{show:!1,selectedUser:0,possibleUsers:[],position:null,numberOfUsers:null},lastAnchor:null,stringValue:"",lastKey:null,hasInteracted:!1,hasLoaded:!1},[A,_]=y.useReducer(Wr,w),{editorKey:x,originalValue:T,initialValue:S,stringValue:z,lastAnchor:M,lastKey:q,hasInteracted:I,hasLoaded:B,mentionPopover:E}=A,j=L=>{const J=L||Wa[0];L&&_([{type:"tabbableOption",value:J}])},N=`rte-${e}`,W=y.useCallback(L=>c.jsx(SD,{...L}),[]),H=y.useCallback(L=>c.jsx(jD,{...L}),[]),G=y.useMemo(()=>jw(Ow(Pw(bb(AD(gb())),b),b),N,b),[]);y.useEffect(()=>{if(!t)return;jr.lastIndex=0;const L=t.match(jr);!L||L.length>1||L[0].length!==t.length||I||_([{type:"originalValue",value:t}])},[t]);const ae=L=>{if(!G||L!==N)return;const J=D.end(G,[]);Q.select(G,J),ne.focus(G)};y.useEffect(()=>{const L=J=>{var $;const k=J,F=(($=k==null?void 0:k.detail)==null?void 0:$.id)||null;F&&ae(F)};return window.addEventListener("focusEditor",L),()=>{window.removeEventListener("focusEditor",L)}},[]),y.useEffect(()=>{if(G.children.length>0&&!B){if(_([{type:"hasLoaded",value:!0}]),!s)return;ae(N)}},[G.children.length,S]),y.useEffect(()=>{T&&(async()=>{let J=wn(T);if(J.includes("<")){Pr.prototype.escape=F=>F;const k=new Pr;k.addRule("br",{filter:["br"],replacement:F=>F+`
|
|
162
162
|
|
|
163
|
-
`}),J=k.turndown(J)}o&&o.mentions&&(J=await Xc({text:J,template:`[${zs}{{name}}]({{id}})`,mentions:o.mentions,listMembers:p||(()=>Promise.resolve([]))})),uw(J,k=>{_([{type:"initialValue",value:k},{type:"editorKey",value:T.toString()}]),setTimeout(()=>{_([{type:"stringValue",value:Dc(G)}])},150)})})()},[T]),y.useEffect(()=>{t!==""||!G||ps(T,t)&&!I||(D.withoutNormalizing(G,()=>{Q.delete(G,{at:{anchor:D.start(G,[]),focus:D.end(G,[])}}),Q.deselect(G),G.children.length!==0&&Q.unwrapNodes(G,{at:[0]}),Q.insertNodes(G,v,{at:[0]})}),_([{type:"initialValue",value:v},{type:"lastAnchor",value:null}]))},[t]);const C=zc(()=>{fw({editor:G,isShowing:E.show,numberOfUsers:E.numberOfUsers,listMembers:p,dispatch:_})},100);return S?c.jsx("div",{id:N,className:"rich-text-editor",children:c.jsxs(nn.Provider,{value:{...A,id:N,isInOverlay:h,setFocus:j,dispatch:_,onMention:f,reportError:b},children:[c.jsxs(FD,{editor:G,initialValue:S,onChange:L=>{if(G.operations.some(k=>k.type!=="set_selection")){const k=mw(L);g(k),_([{type:"stringValue",value:Dc(G)}]),I||_([{type:"hasInteracted",value:!0}]),C(),d&&console.log({serialized:k,json:L})}},...l,children:[c.jsx(bD,{className:"input",renderElement:W,renderLeaf:H,placeholder:n||u.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onKeyDown:L=>{if(L.key==="Enter"){E.show&&(L.preventDefault(),L.stopPropagation(),rh(G,E,_,N));const{selection:J}=G;if(J){const k=V.isCollapsed(J),[F,$]=D.node(G,J,{depth:1});let R=F,U=R.type;const re=R.children[0];if(re&&[K.ol,K.ul].includes(re.type)&&(R=re,U=re.type),R&&de.isElement(R)&&U!==K.paragraph){if(U===K.blockquote&&!L.shiftKey){L.stopPropagation(),L.preventDefault(),Q.insertNodes(G,v);return}if(k){const[ee,ie]=D.parent(G,J,{edge:"end"}),X=ee.type;if([K.ul,K.ol].includes(U))if(L.stopPropagation(),L.preventDefault(),X===K.li&&q==="Enter"){ee.children.length===1&&"text"in ee.children[0]&&ee.children[0].text===""&&Q.removeNodes(G,{at:ie}),Q.insertNodes(G,v,{at:P.next($)}),Q.select(G,D.end(G,P.next($)));return}else{const[ve,pe]=lw(G,K.li),_e={type:K.li,children:[{text:""}]};Q.insertNodes(G,_e,{at:P.next(pe)}),Q.select(G,D.end(G,P.next(pe)))}}}}}else if(L.key==="Escape"){if(E.show){L.preventDefault(),L.stopPropagation(),_([{type:"mentionPopover",value:{...E,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(L.key)&&E.show){L.preventDefault(),L.stopPropagation();const{selectedUser:J,possibleUsers:k}=E;let F=L.key==="ArrowUp"?J-1:J+1;F<0&&(F=k.length-1),F>=k.length+1&&(F=0),_([{type:"mentionPopover",value:{...E,selectedUser:F}}])}_([{type:"lastKey",value:L.key}]),dw(L,G,_,b)},onBlur:()=>{G.selection&&_([{type:"lastAnchor",value:G.selection.anchor}])},onFocus:()=>{if(M){if(!P.isPath(M.path)||!ue.has(G,M.path))return;const L=ue.get(G,M.path);let J=0;if(he.isText(L)?J=L.text.length:L.children&&(J=L.children.length),M.offset>J)return;try{Q.select(G,{anchor:M,focus:M})}catch(k){const F=k.message;b(`Error focusing editor: ${F}`)}}}}),c.jsx(_w,{}),p?c.jsx(pw,{onFallbackClick:m}):null]},x),c.jsx(fo,{id:`character-limit-${e}`,limit:r,valueLength:ni(z)})]})}):c.jsx(c.Fragment,{})};const Mw=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:a=()=>{}},isDisabled:i=!1,className:s=""})=>{const[o,l]=y.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);y.useEffect(()=>{r&&l(r)},[r]);const u=d=>{i||(l(d),a(d))};return c.jsxs("div",{className:Y("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:Y("toggle-options",{disabled:i,on:o===n[1].value}),children:n.map(d=>{const h=`${e}-${d.value}`;return c.jsxs("li",{className:"hidden",children:[c.jsx("input",{type:"radio",id:h,name:e,value:d.value,checked:o===d.value,onChange:()=>u(d.value),disabled:i}),c.jsx("label",{htmlFor:h,children:d.label})]},h)})})]})};function fh({className:e="",userId:t,userName:n,src:r,uploadImage:a,button:i,callback:s}){const o=se.useIntl(),l="profileImageChange_",[u,d]=y.useState(r),[h,p]=y.useState(!1),[m,g]=y.useState(!1),f=y.useRef(null),b=async _=>{p(!0),g(!1);try{const x=_.target.files&&_.target.files[0];if(!x||!t)throw p(!1),new Error("Image file or userID is missing");const T=await a({fileObject:x,userId:t}),S={thumbnail:T.thumbnailURL,full:T.originalURL};d(S),s(S)}catch{g(!0)}finally{p(!1)}p(!1)},{upload:v=o.formatMessage({id:`${l}cta_upload`}),change:w=o.formatMessage({id:`${l}cta_change`}),uploading:A=o.formatMessage({id:`${l}cta_uploading`})}=(i==null?void 0:i.text)||{};return c.jsxs("div",{className:Y("profile-image-change-figure",e),children:[c.jsx(mn,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),m&&c.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),c.jsx("input",{id:"file",type:"file",accept:"image/*",ref:f,onChange:b,hidden:!0,"data-testid":"file-input"}),c.jsx(Ee,{onClick:()=>f.current&&f.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:h,children:h?A:u?w:v})]})}const hh=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:a="contact-form-submit-click"}=e||{};return c.jsx(en,{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:a},functions:{onSuccess:t,onFailure:n},button:{styling:{new:!0}}})};const mh=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:a,backgroundColor:i,onClose:s,reportError:o,sendInvites:l,initialFormStatus:u="NOT_SUBMITTED"})=>{const[d,h]=y.useState([]),[p,m]=y.useState(!0),[g,f]=y.useState(u),{formatMessage:b}=se.useIntl(),v=async _=>{_.preventDefault();try{await l(d),h([]),f("SUCCESS")}catch(x){f("ERROR"),o(x)}},w=_=>{_.preventDefault(),f("NOT_SUBMITTED"),m(!0),h([])},A=_=>{_.preventDefault(),s(),f("CLOSED")};return g==="CLOSED"?null:g==="ERROR"||g==="SUCCESS"?c.jsxs("div",{className:"invite-form-wrapper",children:[c.jsx("div",{className:"content centred",children:g==="SUCCESS"?c.jsx("h2",{className:"success-title",children:b({id:"inviteForm_success"})}):c.jsxs("h2",{className:"error-title",children:[" ",b({id:"inviteForm_error"})]})}),c.jsx(Wt,{}),c.jsx("div",{className:"footer",children:g==="SUCCESS"?c.jsxs(c.Fragment,{children:[c.jsx(Ee,{variant:"secondary",onClick:w,children:b({id:"inviteForm_ctaSendMoreInvites"})}),c.jsx(Ee,{onClick:A,children:b({id:"inviteForm_ctaDone"})})]}):c.jsx(Ee,{onClick:w,children:b({id:"inviteForm_ctaTryAgain"})})})]}):c.jsx("div",{className:"invite-form-wrapper",children:c.jsxs("form",{style:{backgroundColor:i},onSubmit:v,className:Y("invite-form gtm-trackable"),children:[c.jsxs("fieldset",{className:"content",children:[c.jsx("h2",{className:"title",style:{color:r},children:e}),c.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t}),c.jsx(Kh.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:b({id:"inviteForm_email_placeholder"}),emails:d,onChange:_=>{h(_),m(!_.length)},autoFocus:!1,getLabel:(_,x,T)=>c.jsxs("div",{className:"email text-medium",children:[c.jsx("div",{"data-tag-item":!0,children:_}),c.jsx(Ee,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{T(x),m(!d.length)},className:"remove-email-button",screenreaderText:b({id:"overlay_close"})})]},x)})]}),c.jsx(Wt,{}),c.jsx("fieldset",{className:"footer",children:c.jsx(Ee,{className:"sendEmailsButton",disabled:p,children:n})})]})})},Aa=e=>e.map(t=>({condition:t})),wt={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},Nw=({functions:e,...t})=>{const{formatMessage:n}=se.useIntl(),[r,a]=y.useState(null),[i,s]=y.useState(!1),[o,l]=y.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=m=>m[wt.NEW_PASSWORD]!==m[wt.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,d=m=>!ys(m[wt.NEW_PASSWORD]).isValid,h=[{"data-testid":wt.NEW_PASSWORD,id:wt.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:Aa(["required",d]),functions:{onChange:m=>l(ys(m).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":wt.CONFIRMED_PASSWORD,id:wt.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:Aa(["required",u])}];t.isPasswordChange&&h.unshift({"data-testid":wt.CURRENT_PASSWORD,id:wt.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:Aa(["required"])}),i&&h.push({component:Ld,props:{matchingRules:o}});const p={id:wt.FORM_ID,fields:h,functions:{...e,onSuccess:async m=>(e.createPassword(m),e.onSuccess&&e.onSuccess(m)),onCatch:m=>a(m==null?void 0:m.statusCode),onFailure:(m,g)=>{(g.includes(wt.NEW_PASSWORD)||g.includes(wt.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return c.jsxs(c.Fragment,{children:[c.jsx(en,{...p}),r&&c.jsx(hn,{variant:"error",text:r})]})};const ph=({hooks:e,functions:t,meta:n={},gtm:r})=>{var _,x;const a=se.useIntl(),i="profileForm_",s=y.useContext(gt),[o,l]=y.useState(s.image),[u,d]=y.useState(!1),{uploadImage:h,onSuccess:p=async T=>{},onCancel:m=()=>{},onFailure:g=()=>{}}=t,{buildLocation:f,isValidPlace:b,predictPlaces:v}=e.useMaps(),{context:w="ProfileForm",event:A="profile-form-submit-click"}=r||{};return c.jsx(en,{id:"profile-details-form",fields:[{component:fh,props:{userName:s.name,userId:s.id,src:o,uploadImage:h,callback:l,button:{text:{upload:a.formatMessage({id:`${i}image`})}}}},{id:"name",type:"text",label:a.formatMessage({id:`${i}name`}),placeholder:a.formatMessage({id:`${i}name_placeholder`}),value:s.name,autoComplete:"name",validation:[{condition:"required"}]},{id:"jobTitle",type:"text",label:a.formatMessage({id:`${i}jobTitle`}),placeholder:a.formatMessage({id:`${i}jobTitle_placeholder`}),value:s.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:a.formatMessage({id:`${i}organization`}),placeholder:a.formatMessage({id:`${i}organization_placeholder`}),value:s.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:a.formatMessage({id:`${i}location`}),placeholder:a.formatMessage({id:`${i}location_placeholder`}),value:((_=s.location)==null?void 0:_.en)||((x=s.location)==null?void 0:x.country),validation:[{condition:"required"},{condition:({location:T})=>T&&!u?!1:!b(T),error:a.formatMessage({id:`${i}location_error`})}],functions:{onChange:()=>{u||d(!0)},onKeyInput:v}},{id:"biography",type:"textarea",label:a.formatMessage({id:`${i}bio`}),placeholder:a.formatMessage({id:`${i}bio_placeholder`}),limit:1e3,value:s.biography},{component:Wt}],meta:{shouldShowCancelButton:!0,shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,...n},intlPath:i,gtm:{context:w,event:A},functions:{onSuccess:async T=>{try{const S={...T,image:o||null,location:u?await f(T==null?void 0:T.location):s.location};s.updateDetails&&s.updateDetails(z=>({...z,...S})),await p(S)}catch{g()}},onCancel:m,onFailure:g},button:{size:"large",text:{default:a.formatMessage({id:`${i}cta`}),submitting:a.formatMessage({id:`${i}cta_submitting`}),submitted:a.formatMessage({id:`${i}cta_submitted`})}}})};const gh=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:a="search-bar",gtmEvent:i="form-submission"})=>{const{searchIsOpen:s=!0,isDesktopVersion:o=!1}=n||{},l=se.useIntl(),u=y.useRef(null);Fn(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const d=h=>{h.preventDefault(),h.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:Y("search-form gtm-trackable",t),role:"search","data-gtm-event-context":a,"data-gtm-event-type":i,children:c.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:c.jsxs("p",{children:[c.jsx(Ne,{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:h=>{h.key==="Enter"&&d(h)}}),c.jsx("button",{className:"clear",onClick:h=>{h.preventDefault(),h.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:c.jsx(Ne,{children:l.formatMessage({id:"search_clear"})})}),c.jsx("button",{className:"search",onClick:d,children:c.jsx(Ne,{children:l.formatMessage({id:"search_cta"})})})]})})})},_c=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 a=e.current.value.toString().toLowerCase().trim(),i={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let s=Object.assign({},i);try{s=await t(a),s===void 0&&(s=i)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:a,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:a,boxType:d,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(a)}},{type:"validFields.email",value:!0}])},Iw=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"]}},Rw=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:a,state:i})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const s=Iw(new FormData(e.form.current)),o=Object.assign(s,t);await n(o),localStorage.setItem("email",s.email),r&&r({...s,...i.values}),a([{type:"showSuccessMessage",value:!0}])},$w=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:a},refs:i,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:d}=s,h=(m,g)=>{m.current&&s.validFields[g]!==m.current.validity.valid&&o([{type:`validFields.${g}`,value:m.current.validity.valid}])},p=[{id:"full_name",type:"text",inputRef:i.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>h(i.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:i.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{_c({ref:i.email,validateEmail:r,dispatch:o})},onChange:(m,g)=>{o([{type:"shouldDisableButton",value:!0}]),g&&g({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:Md,props:{email:d.email,type:d.boxType,resendVerificationCode:a}}];return s.shouldManuallyApprove&&(p.push({id:"job_title",type:"text",inputRef:i.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>h(i.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:i.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{h(i.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&p.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:m=>c.jsx("small",{children:m})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&p.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:m=>c.jsx("small",{className:"notes text-small",children:m})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),p.push({id:"terms",className:"text-small",type:"checkbox",inputRef:i.tc,label:u.formatMessage({id:"signup_terms"},{terms:m=>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:m}),privacy:m=>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:m})}),shownValue:"accepted",functions:{onChange:m=>{if(!m)return;const g=[];["name","email"].forEach(f=>{s.validFields[f]!==i[f].current.validity.valid&&(g.push({type:`validFields.${f}`,value:i[f].current.validity.valid}),f==="email"&&_c({ref:i.email,validateEmail:r,dispatch:o}))}),g.length&&o(g)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),p};const Lw=({className:e=""})=>c.jsxs("div",{className:Y("success-message",e),"data-testid":"success-message",children:[c.jsx("p",{className:"success-title",children:c.jsx(se.FormattedMessage,{id:"signup_success_title"})}),c.jsx(se.FormattedMessage,{id:"signup_success_text",values:{p:t=>c.jsx("p",{children:t})}})]});const zw={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},qw=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:a={},submitButton:i,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=se.useIntl(),{title:u=!0,expectation:d=!1,url:h=!0,logInButton:p=!0,successMessage:m=!0}=a,g={title:u,expectation:d,url:h,logInButton:p,successMessage:m},[f,b]=y.useReducer(Wr,zw),{validFields:v,emailDetails:w,shouldManuallyApprove:A,shouldDisableButton:_,showSuccessMessage:x,showError:T}=f,[S,z]=Ys.useCookies(["signup-this-session","functional-cookie-consent"]),M={form:y.createRef(),name:y.createRef(),email:y.createRef(),jobTitle:y.createRef(),organisation:y.createRef(),tc:y.createRef(),hiddenValidation:y.createRef()};y.useEffect(()=>{A===!0&&M.jobTitle.current&&M.jobTitle.current.focus()},[A]),y.useEffect(()=>{S["signup-this-session"]&&b([{type:"showSuccessMessage",value:!0}])},[S]),y.useEffect(()=>{x&&S["functional-cookie-consent"]&&z("signup-this-session","true",{path:"/",maxAge:3600})},[x]);const q=y.useMemo(()=>$w({placeholders:n,labels:t,shouldShow:g,functions:r,refs:M,state:f,dispatch:b,dataToSubmit:s,intl:l}),[s,r,l,M,g,f]),I=_?!0:A?!Object.values(v).every(B=>B===!0):!v.name||!v.email||["exists","pending","verify"].includes(w.boxType);return g.successMessage&&x?c.jsx(Lw,{className:e}):c.jsxs("fieldset",{className:Y("signup-form-fieldset",e),"data-testid":"signup-form",children:[g.title&&c.jsx("p",{className:"signup-title",children:c.jsx(se.FormattedMessage,{id:"signup_title"})}),T&&c.jsx(hn,{variant:"error",text:l.formatMessage({id:"signup_error"})}),c.jsx(en,{className:"signup-form",formRef:M.form,id:"sign-up-form",fields:q,intlPath:"signup",button:{variant:"primary",size:"medium",text:i||l.formatMessage({id:"signup_button_join"}),disabled:I?{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","data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:g.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await Rw({refs:M,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:b,state:f})},onCatch:B=>{r.handleError(B),b([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),c.jsx("button",{className:"validation-button",ref:M.hiddenValidation})]})};const bn=({children:e,className:t="",styling:n={},...r})=>{const{background:a="default",padding:i="none"}=n;return c.jsx("section",{className:Y("full-width-section",t,{[a]:a!=="default",[i]:i!=="none"}),...r,children:e})};const Ww=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(a=>{r.push({href:a.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable","data-gtm-event-type":"download-click","data-gtm-event-context":a.eventContext||"Download",target:"_blank",children:a.text})}),c.jsx(bn,{className:Y("download-section",n),children:c.jsxs("div",{className:"content-default",children:[y.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),c.jsx(or,{buttons:r})]})})};const Zs="editSection_";function vh({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const Uw=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:a,setShowModal:i})=>{const{formatMessage:s}=se.useIntl();return c.jsxs(Ot,{variant:"muted",icon:e,children:[c.jsx("p",{children:t||s({id:`${Zs}placeholder_description`})}),a&&c.jsx("p",{children:c.jsx(Ee,{href:r,variant:"secondary",size:"small",onClick:()=>vh({href:r,setShowModal:i}),children:n||s({id:`${Zs}placeholder_cta`})})})]})},Hw=({children:e,className:t="",formProps:n,formComponent:r,href:a,title:i,showTitle:s=!0,modalTitle:o,placeholder:l,showDivider:u=!0})=>{const{formatMessage:d}=se.useIntl(),[h,p]=y.useState(!1),m=()=>p(!1),g=!!n||!!r,f=typeof a=="string"||g;let b;return r&&(b=y.cloneElement(r,{functions:{...r.props.functions,onSuccess:async v=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(v)}finally{m()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),m()}}})),c.jsxs("section",{className:Y("edit-section",t),children:[g&&c.jsx(pn,{title:o||`Edit ${i}`,isOpen:h,showDivider:!1,showIcon:!1,functions:{onClose:m},className:Y("edit-section-modal"),children:b||(n?c.jsx(en,{...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 v=>{var w,A;(w=n==null?void 0:n.functions)!=null&&w.onSuccess&&await((A=n==null?void 0:n.functions)==null?void 0:A.onSuccess(v)),p(!1)},onCancel:m}}):c.jsx(c.Fragment,{}))}),c.jsxs("div",{className:Y("edit-section-header",{"no-title":!s}),children:[s&&c.jsx("h2",{className:"edit-section-header-title",children:i}),f&&c.jsx(Ee,{href:a,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>vh({href:a,setShowModal:p}),children:d({id:`${Zs}edit`})})]}),e||c.jsx(Uw,{...l,href:a,setShowModal:p,showEditButton:f}),u&&c.jsx(Wt,{})]})};const Vw=({title:e=!1,text:t,logos:n=[],styling:r={},className:a=""})=>{const i=n.length;if(i===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return c.jsxs("div",{className:Y("logos",a,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&y.createElement(s.element,{className:Y("title",s.className)},s.text),t&&c.jsx("p",{children:t}),c.jsx("ul",{className:Y({"two-col":i===2||i===4,"three-col":i===5||i<=10&&i%3===0}),children:n.map(({logo:d,nameOfBusiness:h,link:p=!1,description:m=!1},g)=>{if(!d||!d.url)return null;const f=c.jsx("img",{src:d.url,width:d.width||"auto",height:d.height||"auto",alt:h});return c.jsxs("li",{children:[c.jsx("p",{className:"img-wrapper",children:p?c.jsx("a",{href:p,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),m&&c.jsx("small",{children:m})]},window.btoa(`${d.url}_${g}`))})})]})};let ts;const ns="contactFooter_",Kw=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=y.useRef(null),[r,a]=y.useState(0),[i,s]=y.useState(!1),o=()=>{n.current&&a(n.current.clientHeight)},l=()=>{i||(s(!0),clearTimeout(ts),ts=setTimeout(()=>{o(),s(!1)},500))};return y.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(ts),window.removeEventListener("resize",l)}),[]),c.jsx(bn,{id:"contactForm",className:"contact-footer",children:c.jsxs("div",{className:"inner-wrapper",children:[c.jsx("h2",{children:c.jsx(se.FormattedMessage,{id:`${ns}title`})}),c.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:i?{}:{minHeight:r},children:[c.jsxs("aside",{children:[c.jsx("p",{children:c.jsx(se.FormattedMessage,{id:`${ns}text`})}),c.jsx(fn,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:c.jsx(se.FormattedMessage,{id:`${ns}email`})})]}),c.jsx(hh,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},Zw=({activeLink:e,profile:t,...n})=>c.jsx(bn,{children:c.jsx(Od,{layout:"1-3",children:c.jsxs(c.Fragment,{children:[c.jsx(jd,{activeLink:e,profile:t}),c.jsx(od,{...n})]})})});const rs="cookieBanner_",as=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],is=new Date(Date.now()+12*30*24*60*60*1e3),bh=()=>{const e=se.useIntl(),[t,n,r]=Ys.useCookies(as),[a,i]=y.useState(!t["apol-cookie-banner"]),s=()=>{as.forEach(d=>{n(d,!0,{path:"/",expires:is,domain:d==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),i(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:is}),as.forEach(d=>{if(d==="apol-cookie-banner"){n(d,!0,{path:"/",expires:is});return}r(d)}),i(!1)};if(!a)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,gtmType:"accepted-all"}],u=[];return l.forEach(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:`${rs}buttons_${d.id}`})})}),c.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[c.jsx("h6",{children:e.formatMessage({id:`${rs}title`})}),c.jsx("p",{children:e.formatMessage({id:`${rs}text`})}),c.jsx(or,{buttons:u})]})},Zt={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:Hn["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Hn["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:Hn.support,gtmType:"concierge-email-click"},business:{email:Hn.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 Qn="footer_",Ua="SiteFooter",kc=({group:e})=>{const t=Zt[e].order||[];let n=!1;return"text"in Zt[e]&&(n=Zt[e].text),c.jsxs(y.Fragment,{children:[c.jsx("p",{className:"pre-title",children:c.jsx(se.FormattedMessage,{id:`${Qn}${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:a,gtmType:i}=Zt[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),c.jsx("li",{children:c.jsx("a",{href:a,className:"gtm-trackable","data-gtm-event-context":Ua,"data-gtm-event-type":i,...s,children:c.jsx(se.FormattedMessage,{id:`${Qn}${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(y.Fragment,{children:[c.jsx("dt",{children:c.jsx(se.FormattedMessage,{id:`${Qn}${e}_${r}`})}),c.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&c.jsx("address",{children:c.jsx(se.FormattedMessage,{id:`${Qn}${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":Ua,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},$o=()=>c.jsx("div",{id:"footer",children:c.jsxs("div",{className:"wrapper",children:[c.jsx(Qa,{element:"hr"}),c.jsx(co,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Ua,"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(kc,{group:e}),Object.keys(Zt[e]).includes("child")&&c.jsx(kc,{group:Zt[e].child})]},e))}),c.jsx("hr",{}),c.jsxs("div",{className:"sub-footer",children:[c.jsx("ul",{children:Array.isArray(Zt.social.order)&&Zt.social.order.map(e=>{const t=Zt.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":Ua,"data-gtm-event-type":"social-click",children:c.jsx("span",{className:"hidden",children:c.jsx(se.FormattedMessage,{id:`${Qn}social_${e}`})})})},e)})}),c.jsx("small",{children:c.jsx(se.FormattedMessage,{id:`${Qn}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),Ie={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=i=>{const s=`logged${e?"In":"Out"}`;return t>=n[i][s]};let a={};return["navigation","search"].forEach(i=>{a[i]=r(i)}),a},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(a=>a===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:a=!1})=>{if(!a&&n[e]===t||!a&&e===yt.ACCOUNT&&t===!1&&n[yt.SITE]===!0)return;const i=Date.now();if(!a&&!t&&Ie.handlerCalled[e]&&i-Ie.handlerCalled[e]<500)return;Ie.handlerCalled[e]=i;let s=[{type:`menus.${e}`,value:t}];if(t===!0)Object.keys(n).forEach(o=>{o===e||n[o]===!1||s.push({type:`menus.${o}`,value:!1})});else{let o=null;switch(e){case yt.SITE:o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation .navigation-button"));break;case yt.SEARCH:o=document.querySelector("#header .toggle-search-button");break;case yt.ACCOUNT:o=document.querySelector("#header .account-button");break;default:return}o&&o.focus()}r(s)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const a=Ic(e[r],t);if(!(typeof a>"u")&&(!n||a[t]&&a[t].includes(n)||a.value&&a.value.includes(n)||a.toString().includes(n)))return e[r]}return e[0].children?Ie.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:a})=>{var l;if(!t.current||!t.current.children)return;const i=n?"desktop":"default";if(r[e][i]){(l=document.querySelector(`#header ul a[href="${r[e][i]}"]:last-child`))==null||l.focus();return}let s,o;switch(e){case yt.SITE:if(n){const u=Ie.findFirstChild(t.current.children,"className","has-submenu parent"),d=Ie.findFirstChild(u.children,"id",yt.SITE);s=Ie.findFirstChild(d.children,"href")}else s=Ie.findFirstChild(t.current.children,"href");break;case yt.ACCOUNT:if(o=Ie.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=Ie.findFirstChild(o.children,"href");break;default:return}s&&(a([{type:`focusElements.${e}.${i}`,value:s.attributes.href.value}]),s.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(Ie.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(Ie.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Ie.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Ie.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},qr={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},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"},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},Ha=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:a=()=>{},doTrack:i=null})=>{const s=se.useIntl(),o=Ic(qr,e);if(!o||o.onlyShow&&(o.onlyShow==="logged-in"&&!t||o.onlyShow==="logged-out"&&t))return null;const l="doTrack"in o,u=i===null?l?o.doTrack:!0:i,d=e.includes("buttons.");let h=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(h+=`_logged${t?"In":"Out"}`);let p=!1;if(o.href){let A=o.gtmType||`${e}-click`;if(A.includes(".")){const _=A.split("."),x=_[_.length-2];A=`${x==="topics"?`${x}-`:""}${_[_.length-1]}`}p={href:o.href},u&&(p={...p,className:"gtm-trackable","data-gtm-event-type":A,"data-gtm-event-context":"HeaderButtons"}),d&&(p={...p,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const m=o.order&&o.order[0]&&o[o.order[0]],g=m&&o[o.order[0]].order,f=p&&window.location.pathname===o.href;let b={},v={},w={};if(f&&(b={...b,"aria-current":"page"}),m){const A=o.menuId||e,_={onClick:x=>Ie.events.onClick(x,{id:A,callback:a,isOpen:r[A]}),onFocus:()=>Ie.events.onFocus({id:A}),onBlur:()=>Ie.events.onBlur({id:A,callback:a}),onMouseLeave:()=>Ie.events.onBlur({id:A,callback:a}),onMouseEnter:()=>Ie.events.onMouseEnter({id:A,callback:a})};v={..._,id:A===yt.SITE?yt.SITE:yt.ACCOUNT},n&&(g&&(w={..._,className:"navigation-button",onKeyPress:x=>{x.key==="Enter"&&Ie.events.onClick(x,{id:A,callback:a,isOpen:r[A]})},"aria-haspopup":!0,"aria-expanded":r[A],"aria-controls":A}),v={...v,hidden:A in r?!r[A]:!0}),g||(v={...v})}return c.jsxs("li",{className:Y({[o.className]:o.className,"has-submenu":m,parent:g,active:f}),...b,children:[p?y.createElement(d?Ee:"a",p,s.formatMessage({id:h})):n&&o.order&&g?c.jsxs("button",{...w,children:[s.formatMessage({id:h}),c.jsx(Ne,{children:s.formatMessage({id:`header_menu_${r[yt.SITE]?"hide":"show"}`})})]}):s.formatMessage({id:h}),o.order&&c.jsx("ul",{...v,children:o.order.map(A=>{if(!o[A])return null;const _={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:a,doTrack:l?u:null};return o[A].order?c.jsxs("li",{className:Y({[o[A].className]:o[A].className}),children:[s.formatMessage({id:`${h}_${A}`}),c.jsx("ul",{children:o[A].order.map(x=>c.jsx(Ha,{id:`${e}.${A}.${x}`,..._},x))})]},A):c.jsx(Ha,{id:`${e}.${A}`,..._},A)})})]},e)};const Yw={height:67,height_desktop:83};var yt=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(yt||{});const Lo=({showNavigation:e=!0})=>{const t=se.useIntl(),n=y.useContext(gt),r=Mn(!0,!0),a=n&&typeof n.id=="string",i=y.useMemo(()=>Ie.getIsDesktopVersion(a,r),[a,r]),[s,o]=y.useReducer(Wr,{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,h=y.useRef(s);y.useEffect(()=>{h.current=s},[s]),Wc({scrollPosition:Yw[`height${i.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const v=h.current.menus;!i&&v["site-navigation"]||Ie.shouldChangeHeaderIsVisible(!0,v,o)},scrollDown:()=>{const v=h.current.menus;!i&&v["site-navigation"]||Ie.shouldChangeHeaderIsVisible(!1,v,o)}}});const p=(v,w,A=!1)=>{Ie.handleMenus({id:v,value:w,menus:h.current.menus,dispatch:o,forceHandle:A})},m=y.useRef(null),g=v=>{v.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(w=>{h.current.menus[w]&&p(w,!1,!0)})};y.useEffect(()=>{var v;return(v=document.getElementById("header"))==null||v.addEventListener("keydown",g),()=>{var w;(w=document.getElementById("header"))==null||w.removeEventListener("keydown",g)}},[]),Fn(()=>{u["site-navigation"]&&Ie.autoFocus({menu:"site-navigation",navigationRef:m,isDesktopVersion:i.navigation,focusElements:d,dispatch:o})},[u["site-navigation"]]),Fn(()=>{u["account-navigation"]&&Ie.autoFocus({menu:"account-navigation",navigationRef:m,isDesktopVersion:i.navigation,focusElements:d,dispatch:o})},[u["account-navigation"]]);const f=c.jsxs(c.Fragment,{children:[!i.search&&c.jsx("button",{className:"search toggle-search-button",onClick:v=>{v.preventDefault(),v.stopPropagation(),p("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:c.jsx(Ne,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),c.jsx(gh,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),b=c.jsxs(c.Fragment,{children:[!i.navigation&&c.jsx("button",{className:"menu-button gtm-trackable",onClick:v=>{v.preventDefault(),v.stopPropagation(),p("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(Ne,{children:t.formatMessage({id:`header_menu_${u["site-navigation"]?"hide":"show"}`})})}),c.jsx("ul",{ref:m,id:"navigation",hidden:i.navigation||u["account-navigation"]?!1:!u["site-navigation"],"data-showing":!i.navigation&&u["account-navigation"]?"account":"default",children:qr.order.map(v=>c.jsx(Ha,{id:v,isLoggedIn:a,isDesktopVersion:i.navigation,menus:{"site-navigation":u["site-navigation"],"account-navigation":u["account-navigation"]},callback:p},v))})]});return n&&n.isLoading?null:c.jsxs(c.Fragment,{children:[c.jsxs("nav",{id:"header",className:Y({"logged-in":a,"logged-out":!a,visible:l}),children:[c.jsx(Ne,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),c.jsx(co,{variant:"monochrome"}),e&&c.jsxs(c.Fragment,{children:[i.navigation?c.jsxs(c.Fragment,{children:[b,f]}):c.jsxs(c.Fragment,{children:[f,b]}),a?c.jsxs("button",{className:"account-button",onClick:v=>Ie.events.onClick(v,{id:"account-navigation",callback:p,isOpen:u["account-navigation"]}),onMouseEnter:()=>Ie.events.onMouseEnter({id:"account-navigation",callback:p}),onMouseLeave:()=>Ie.events.onBlur({id:"account-navigation",callback:p}),"aria-haspopup":"true","aria-expanded":u["account-navigation"],"aria-controls":"account-navigation",children:[c.jsx(Ne,{children:t.formatMessage({id:`header_account_${u["account-navigation"]?"hide":"show"}`})}),c.jsx(mn,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):c.jsx("ul",{className:"sign-in-buttons",children:qr.buttons.order.map(v=>c.jsx(Ha,{id:`buttons.${v}`},v))})]})]}),c.jsx("hr",{id:"content-of-page"}),c.jsx("div",{className:Y("overlay",{open:u["site-navigation"]||u["account-navigation"]||!i.search&&u.search})})]})};const Gw=()=>{const e=se.useIntl();return c.jsxs(c.Fragment,{children:[c.jsx(Lo,{}),c.jsx("div",{id:"content",children:c.jsx(hn,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),c.jsx($o,{})]})},yh=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:a={},styling:i={},className:s="",locale:o="en"})=>{const{navigation:l=!0,footer:u=!0}=a,{background:d="default",variant:h="default",circle:p="default",modal:m="default"}=i,g=Lc(),[f,b]=y.useState(""),v=T=>{const{detail:{message:S}}=T;b(S)};y.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",v),()=>{document.removeEventListener("ariaLive",v)}),[g]);const w=Da(e,{locale:o}),A=Da(t,{locale:o}),_=Da(n,{locale:o}),x={};return d!=="default"&&(x[d]=!0),h!=="default"&&(x[h]=!0),p!=="default"&&(x[p]=!0),c.jsx(Zh.ErrorBoundary,{onError:r,fallback:c.jsx(Gw,{}),children:c.jsxs(y.Suspense,{fallback:null,children:[c.jsxs("div",{id:"wrapper",className:Y(s,x,{"has-footer":u}),children:[c.jsx(Lo,{showNavigation:l}),c.jsxs("main",{id:"content-wrapper",children:[A&&c.jsx("div",{className:Y("additional-content prepended",{"large-modal":m==="large"}),children:A}),y.createElement(d==="bold"?so:"div",{id:"content",children:w,className:Y({"large-modal":m==="large"})})]}),_&&c.jsx("div",{className:"additional-content appended",children:_}),u&&c.jsx($o,{}),c.jsx(bh,{})]}),f&&c.jsx(Ne,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:f})]})})},Fc={default:"tags_",headerTopics:"header_topics_topics_"},ss={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"},Qw={getTagDetails:e=>{if(e.includes("topic_")){if(e=ss.topic[e.replace("topic_","")],e){const t=qr.topics.topics[e].href;return t?{id:e,href:t,text:`${Fc.headerTopics}${e}`}:null}return null}return ss[e]?(e=ss[e],{id:e,text:`${Fc.default}${e}`}):null}};const Jw=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:a="",gtmType:i="tag-click",gtmContext:s="tags"})=>{const o=se.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const d=Qw.getTagDetails(u);d&&l.push(d)}),l.length<1?null:c.jsx("ul",{className:Y("tags text-small",t,a,{"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":i,"data-gtm-event-context":s,children:d}):d},u.id)})})};var ct=(e=>(e.COMMUNITIES="communities",e.PLATFORM="platform",e))(ct||{});const Xw=({members:{data:e=[],total:t=e.length},communitySlug:n,isMember:r=!1,hasNextPage:a=!1,loadNextPage:i=()=>{},profile:s,gtmContext:o="member",gtmType:l="member-click",className:u=""})=>{const d=se.useIntl(),h="membersList",p=y.useContext(gt),[m,g]=y.useState(!1);return e.length===0?null:c.jsxs("div",{className:Y("members-list",u),children:[c.jsxs("h1",{children:[d.formatMessage({id:h}),c.jsx("span",{className:"count",children:t})]}),c.jsxs("ul",{children:[r?c.jsxs("li",{children:[c.jsx(Qt,{member:p,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:ct.COMMUNITIES,area:n||""},{scope:ct.PLATFORM,area:"all"}]}}),c.jsx(fn,{href:"/profiles/me",className:"text-small",onClick:f=>{f==null||f.preventDefault(),f==null||f.stopPropagation(),g(!0)},children:d.formatMessage({id:`${h}_profile`})})]}):c.jsx(c.Fragment,{}),e.map((f,b)=>c.jsxs("li",{children:[c.jsx(Qt,{member:f,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:ct.COMMUNITIES,area:n||""},{scope:ct.PLATFORM,area:"all"}]}}),f.isAdmin&&c.jsx(Gt,{children:d.formatMessage({id:`${h}_admin`})})]},b))]}),a&&c.jsx(Hr,{hasNextPage:a,loadNextPage:i,icon:{icon:"arrow-down",position:"right"},gtmContext:o}),s?c.jsx(fi,{form:s,showModal:m,content:{title:d.formatMessage({id:`${h}_modal_title`})},functions:{onClose:()=>{g(!1)}}}):c.jsx(c.Fragment,{})]})},eE={showForm:!1},ci=y.createContext(eE),Dh=({children:e})=>{const[t,n]=y.useState({showForm:!1});return c.jsx(ci.Provider,{value:{...t,updateConversation:n},children:e})},Bc=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},di=e=>{var t,n,r,a,i,s;return e&&!e.error?{id:e==null?void 0:e.id,name:(t=e==null?void 0:e.data)==null?void 0:t.name,organization:(n=e==null?void 0:e.data)==null?void 0:n.organization,jobTitle:(r=e==null?void 0:e.data)==null?void 0:r.jobTitle,location:(a=e==null?void 0:e.data)==null?void 0:a.location,image:{thumbnail:((i=e==null?void 0:e.data)==null?void 0:i.thumbnail)||void 0},badges:(s=e==null?void 0:e.data)==null?void 0:s.badges}:"deleted"},tE=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const a=se.useIntl();return t?c.jsx("small",{children:Tt(a.formatMessage,`${e}explainer`,n,"action",{a:i=>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:i})})}):c.jsx(c.Fragment,{})},nE=({formID:e,intlPath:t,showLabel:n,type:r})=>{const a=se.useIntl();return n?c.jsx("label",{htmlFor:`${e}-input`,className:"text-small",onClick:i=>{i.preventDefault(),i.stopPropagation();const s=new CustomEvent("focusEditor",{detail:{id:`rte-${e}-input`}});window.dispatchEvent(s)},children:a.formatMessage({id:`${t}label`})}):c.jsx(Ne,{element:"label",showOnFocus:!1,htmlFor:`${e}-input`,children:Tt(a.formatMessage,`${t}label_action`,r,"action")})};let pa=null;const Je="discussion_form_",Kr=({id:e,parentId:t,content:n={type:"response",slugs:{}},userHasPermissions:r=!0,meta:a,placeholder:i,maxLength:s=0,buttons:o,forceShow:l={cancel:!1,error:!1},isCommunity:u=!1,functions:d,data:h={},gtmContext:p="DiscussionForm"})=>{var Te,Ve,We;const m=se.useIntl(),g=y.useContext(gt),[f,b]=y.useState(""),{isLoading:v=!1,isInWrapper:w=!1,isInOverlay:A=!1,isAutoFocused:_=!1,isEditing:x=!1,hasTitleField:T=!1,isPrepopulated:S=!1,showTitle:z=!1,showGuidelines:M=!0,showDivider:q=!1,showSuccessMessage:I=!0}=a||{},{onChange:B=()=>{},create:E=()=>{},handleSaveEdit:j=()=>{},handleCancel:N=()=>{},callback:W=()=>{},onMention:H=()=>{},listMembers:G=()=>Promise.resolve([]),clickMentionFallback:ae=()=>{},props:C={create:{projectNames:["questions-answers"]}}}=d,[L,J]=y.useState({title:T&&T.text||"",body:x&&x.text||S&&S.text||""}),[k,F]=y.useState(l.error||!1),[$,R]=y.useState(!1);if(y.useEffect(()=>{u&&!x&&S&&S!==L.body&&J({...L,body:S.text||""})},[S]),v)return c.jsx(Bt,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const U=Be=>{J({...L,body:Be}),B({body:Be});let Se;!g||!g.id?Se=Tt(m.formatMessage,`${Je}error_loggedOut`,n.type,"action"):r?s>0&&Be.length>=s&&(Se=`${Je}error_tooLong`):Se=Tt(m.formatMessage,`${Je}error_noPermission`,n.type,"action"),Se?F(Se):k&&F(!1)};let re=`${n.type}-form`;if(n.type==="response"||n.type==="reply"){const Be=((Te=n.slugs)==null?void 0:Te.reply)||((Ve=n.slugs)==null?void 0:Ve.answer)||((We=n.slugs)==null?void 0:We.question)||"";Be&&(re=`${re}-${Be.slice(-15)}`)}e&&(re=`${e}-${re}`);const ee=async()=>{if(!g||!g.id||!r||ve)return;pa&&clearTimeout(pa),R("submitting");const Be=window.location.pathname;try{let Se;switch(n.type){case"post":Se=await E({title:L.title,content:L.body});break;case"question":Se=await E({title:L.body,authorId:g&&g.id,...C==null?void 0:C.create});break;case"response":Se=await E({questionSlug:n.slugs.question},{body:L.body,authorId:g&&g.id,contentPath:Be});break;case"reply":Se=await E({questionSlug:n.slugs.question,answerSlug:n.slugs.answer},{body:L.body,authorId:g&&g.id,contentPath:Be});break;default:break}await sm(1e3),W&&await W(Se),pa=setTimeout(()=>{J({title:"",body:""}),R("submitted"),b(Tt(m.formatMessage,`${Je}success`,n.type,"action"));const De=new Event(Xe.DISCUSSION_FORM_SUBMITTED);document.dispatchEvent(De),ie()},500)}catch(Se){const De=Se;let Re=`${Je}error`;De!=null&&De.message.includes("entry already exists")&&(Re=Tt(m.formatMessage,`${Je}error_alreadyExists`,n.type,"action")),De!=null&&De.message.includes("429")?Re=Tt(m.formatMessage,`${Je}error_tooMany`,n.type,"action"):De!=null&&De.message.includes("400")&&(Re=`${Je}error`),F(Re),ie()}},ie=()=>{pa=setTimeout(()=>{F(!1),R(!1),b("")},5e3)},fe=!L.title||!ru(L.title),X=!L.body||!ru(L.body);let ve=X;T&&(ve=fe&&X);const pe=$==="submitting",_e=[{component:nE,props:{formID:re,intlPath:Je,showLabel:T!==!1,type:n.type}},{component:dh,props:{id:`${re}-input`,value:$==="submitting"&&!k?"":L.body,placeholder:i||Tt(m.formatMessage,`${Je}placeholder`,n.type,"action"),maxLength:s,meta:{isInOverlay:A},functions:{onChange:U,onMention:H,listMembers:G,clickMentionFallback:ae},data:h,autoFocus:x!==!1||_&&!T,"aria-invalid":!!k,"aria-errormessage":"error-message"}},{component:tE,props:{intlPath:Je,showGuidelines:M,type:n.type,gtmContext:p}}];q&&_e.push({component:Wt}),T&&_e.unshift({id:"title",type:"text",value:T.text,limit:250,autoFocus:_,label:m.formatMessage({id:`${Je}titleField_label`}),placeholder:m.formatMessage({id:`${Je}titleField_placeholder`}),functions:{onChange:Be=>{J({...L,title:Be}),B({title:Be})}},validation:[{condition:()=>ve,error:m.formatMessage({id:`${Je}titleField_error`})}]});let Fe=!g||!g.id||!r||ve||pe;return x&&(T?Fe=Fe||L.body===x.text&&L.title===T.text:Fe=Fe||L.body===x.text),c.jsxs(c.Fragment,{children:[c.jsxs(en,{id:re,className:Y("discussion-card discussion-form",{"no-styling":w&&x}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:x&&!pe||l.cancel},functions:{onSuccess:async()=>{if(x){R("submitting"),j(L);return}await ee()},onCancel:N},fields:_e,intlPath:Je,button:{variant:"primary",size:{mobile:"small",600:"medium"},className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`${x?"save":"submit"}-${n.type}-click`,"data-testid":"save-button",disabled:Fe,text:{default:!x&&(o!=null&&o.submit)?o==null?void 0:o.submit:m.formatMessage({id:`${Je}${x?"save":"post"}`}),submitting:m.formatMessage({id:`${Je}${x?"saving":"posting"}`})}},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`cancel-${n.type}-click`,disabled:!l.cancel&&(!g||!g.id||!L.body),text:o!=null&&o.cancel?o==null?void 0:o.cancel:m.formatMessage({id:`${Je}cancel`})},gtm:{context:p,event:`${n.type}-form`},"data-testid":`discussion-${n.type}-form`,children:[z&&!x&&["question"].includes(n.type)&&c.jsx("h2",{children:Tt(m.formatMessage,`${Je}title`,n.type,"action")}),c.jsx(Qt,{member:g?{...g,link:!1}:"community",gtmContext:p,gtmType:"profile-click",badges:{showBadges:!0,scopes:[{scope:ct.COMMUNITIES,area:t||""},{scope:ct.PLATFORM,area:"all"}]}})]}),$==="submitted"&&I&&c.jsx(Or,{className:"success","data-testid":"success",children:Tt(m.formatMessage,`${Je}success`,n.type,"action")}),k&&c.jsx(Or,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof k=="string"?k.includes(" ")?k:m.formatMessage({id:k},{action:m.formatMessage({id:`discussion_action_${n.type}`}),maxLength:s}):k}),f&&c.jsx(Ne,{"aria-live":"polite",showOnFocus:!1,children:f})]})},rE=Object.freeze(Object.defineProperty({__proto__:null,default:Kr},Symbol.toStringTag,{value:"Module"})),aE=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),iE=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);const Va=({icon:e,className:t="",...n})=>c.jsx(Ee,{className:Y("discussion-button",t),variant:"tertiary",icon:e,...n});let Tr=!1;const os=()=>{Tr!==!1&&(clearTimeout(Tr),Tr=!1)},us=5;let ls=null;const Ch=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:a=!1,content:i={type:"reply",slugs:{}},canLike:s=!0,functions:{createLike:o=()=>{},deleteLike:l=()=>{}}={}})=>{const u=se.useIntl(),d={numberOfLikes:t,userLikedContent:a,ignoreInteractions:!1,showLikers:!1,tabbableLink:0},[h,p]=y.useReducer(Wr,d),{numberOfLikes:m,userLikedContent:g,ignoreInteractions:f,showLikers:b,tabbableLink:v}=h;y.useEffect(()=>{p([{type:"userLikedContent",value:a}])},[a]);const w=y.useMemo(()=>iE(n,us),[n]),A=S=>{if(S.preventDefault(),S.stopPropagation(),p([{type:"showLikers",value:!1}]),Tr)return os(),!1;if(os(),f||!s)return!1;Tr=setTimeout(_,350)},_=async()=>{if(os(),f||!s)return!1;let S=g?m-1:m+1;S<0&&(S=0),p([{type:"ignoreInteractions",value:!0},{type:"numberOfLikes",value:S},{type:"userLikedContent",value:!g}]);try{if(i&&i.slugs){const z=aE(i.slugs);g?await l(z):await o({...z,payload:{contentPath:window.location.pathname}})}}catch{p([{type:"numberOfLikes",value:t},{type:"userLikedContent",value:a}])}finally{p([{type:"ignoreInteractions",value:!1}])}},x=()=>{ls=setTimeout(()=>{p([{type:"showLikers",value:!1}])},500)},T=()=>{ls&&clearTimeout(ls)};return y.createElement(e,{className:"likes-wrapper",onKeyDown:S=>{S.key==="Escape"&&p([{type:"showLikers",value:!1}])},onMouseEnter:()=>{T(),p([{type:"showLikers",value:!0}])},onMouseLeave:()=>{x()}},c.jsxs(c.Fragment,{children:[c.jsx(Va,{className:Y("discussion-button text-medium action-button",{"show-spinner":f,"is-liked":g,disabled:!s}),icon:{icon:g?"heart":"heart_empty",animate:"bounce"},disabled:!s,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${i.type}-click`,onClick:A,screenreaderText:s?u.formatMessage({id:`discussion_likes_${g?"unlike":"like"}`},{action:u.formatMessage({id:`discussion_action_${i.type}`})}):!1,"aria-pressed":g,children:c.jsx("span",{"data-testid":"number-of-likes",className:"number-of-likes",children:u.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:m})})}),n&&c.jsxs(c.Fragment,{children:[c.jsx(Ne,{"data-testid":"like-a11y-button",element:"button",className:"tertiary small icon navigation_arrow",onFocus:()=>{T()},onBlur:()=>x,onClick:S=>{var M;S.preventDefault(),S.stopPropagation(),T(),p([{type:"showLikers",value:!0}]);const z=(M=S.currentTarget.nextSibling)==null?void 0:M.childNodes[0];if(z){const q=z.querySelector("li:first-child a");q&&(p([{type:"tabbableLink",value:0}]),setTimeout(()=>{q.focus()},100))}},onKeyDown:S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),x())},"aria-expanded":b,"aria-controls":`likes-tooltip-${i.slug}`,children:c.jsx(Ne,{showOnFocus:!1,children:u.formatMessage({id:"discussion_likes_show"},{action:i.type})})}),c.jsx(Nn,{id:`likes-tooltip-${i.slug}`,isOpen:b,isLoading:n.length===0,children:n.length&&c.jsxs("ul",{children:[w.map((S,z)=>{if(typeof S=="string")return null;const M={};return v!==z&&(M.tabIndex=-1),c.jsx("li",{"data-index":z,children:c.jsx(fn,{href:S.id?`/profiles/${S.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onClick:q=>q==null?void 0:q.stopPropagation(),onFocus:()=>T(),onKeyDown:q=>{var N,W,H,G;if(!q||!["ArrowUp","ArrowDown"].includes(q.key||""))return;q.stopPropagation(),q.preventDefault();const I=q.key==="ArrowUp"?"up":"down",B=(N=q.currentTarget)==null?void 0:N.parentElement;let E=B==null?void 0:B.nextElementSibling;if(I==="up"){const ae=B==null?void 0:B.previousElementSibling;ae?E=ae:(E=(W=B==null?void 0:B.parentElement)==null?void 0:W.lastElementChild,(E==null?void 0:E.getAttribute("data-index"))==="-1"&&(E=E==null?void 0:E.previousElementSibling))}else(!E||(E==null?void 0:E.getAttribute("data-index"))==="-1")&&(E=(H=B==null?void 0:B.parentElement)==null?void 0:H.firstElementChild);if(!E)return;const j=(E==null?void 0:E.getAttribute("data-index"))||"0";p([{type:"tabbableLink",value:j}]),(G=E==null?void 0:E.querySelector("a"))==null||G.focus()},...M,children:S.name?S.name:c.jsx("span",{className:"deleted-user",children:u.formatMessage({id:"member_deleted"})})})},S.id||window.btoa(S.name||""))}),t>us&&c.jsx("li",{"data-index":"-1",children:u.formatMessage({id:"discussion_likes_more"},{number:t-us})})]})})]})]}))},cs=({children:e,class:t,...n})=>{const r={...n,class:Y("subtle",t)};return c.jsx("blockquote",{...r,children:e})},sE=280,zo=async(e,t,n,r=()=>Promise.resolve([]))=>{let a=t?er(e,typeof t=="number"?t:sE):e;a=a.trim();const i=`<br>
|
|
163
|
+
`}),J=k.turndown(J)}o&&o.mentions&&(J=await Xc({text:J,template:`[${zs}{{name}}]({{id}})`,mentions:o.mentions,listMembers:p||(()=>Promise.resolve([]))})),uw(J,k=>{_([{type:"initialValue",value:k},{type:"editorKey",value:T.toString()}]),setTimeout(()=>{_([{type:"stringValue",value:Dc(G)}])},150)})})()},[T]),y.useEffect(()=>{t!==""||!G||ps(T,t)&&!I||(D.withoutNormalizing(G,()=>{Q.delete(G,{at:{anchor:D.start(G,[]),focus:D.end(G,[])}}),Q.deselect(G),G.children.length!==0&&Q.unwrapNodes(G,{at:[0]}),Q.insertNodes(G,v,{at:[0]})}),_([{type:"initialValue",value:v},{type:"lastAnchor",value:null}]))},[t]);const C=zc(()=>{fw({editor:G,isShowing:E.show,numberOfUsers:E.numberOfUsers,listMembers:p,dispatch:_})},100);return S?c.jsx("div",{id:N,className:"rich-text-editor",children:c.jsxs(nn.Provider,{value:{...A,id:N,isInOverlay:h,setFocus:j,dispatch:_,onMention:f,reportError:b},children:[c.jsxs(FD,{editor:G,initialValue:S,onChange:L=>{if(G.operations.some(k=>k.type!=="set_selection")){const k=mw(L);g(k),_([{type:"stringValue",value:Dc(G)}]),I||_([{type:"hasInteracted",value:!0}]),C(),d&&console.log({serialized:k,json:L})}},...l,children:[c.jsx(bD,{className:"input",renderElement:W,renderLeaf:H,placeholder:n||u.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onKeyDown:L=>{if(L.key==="Enter"){E.show&&(L.preventDefault(),L.stopPropagation(),rh(G,E,_,N));const{selection:J}=G;if(J){const k=V.isCollapsed(J),[F,$]=D.node(G,J,{depth:1});let R=F,U=R.type;const re=R.children[0];if(re&&[K.ol,K.ul].includes(re.type)&&(R=re,U=re.type),R&&de.isElement(R)&&U!==K.paragraph){if(U===K.blockquote&&!L.shiftKey){L.stopPropagation(),L.preventDefault(),Q.insertNodes(G,v);return}if(k){const[ee,ie]=D.parent(G,J,{edge:"end"}),X=ee.type;if([K.ul,K.ol].includes(U))if(L.stopPropagation(),L.preventDefault(),X===K.li&&q==="Enter"){ee.children.length===1&&"text"in ee.children[0]&&ee.children[0].text===""&&Q.removeNodes(G,{at:ie}),Q.insertNodes(G,v,{at:P.next($)}),Q.select(G,D.end(G,P.next($)));return}else{const[ve,pe]=lw(G,K.li),_e={type:K.li,children:[{text:""}]};Q.insertNodes(G,_e,{at:P.next(pe)}),Q.select(G,D.end(G,P.next(pe)))}}}}}else if(L.key==="Escape"){if(E.show){L.preventDefault(),L.stopPropagation(),_([{type:"mentionPopover",value:{...E,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(L.key)&&E.show){L.preventDefault(),L.stopPropagation();const{selectedUser:J,possibleUsers:k}=E;let F=L.key==="ArrowUp"?J-1:J+1;F<0&&(F=k.length-1),F>=k.length+1&&(F=0),_([{type:"mentionPopover",value:{...E,selectedUser:F}}])}_([{type:"lastKey",value:L.key}]),dw(L,G,_,b)},onBlur:()=>{G.selection&&_([{type:"lastAnchor",value:G.selection.anchor}])},onFocus:()=>{if(M){if(!P.isPath(M.path)||!ue.has(G,M.path))return;const L=ue.get(G,M.path);let J=0;if(he.isText(L)?J=L.text.length:L.children&&(J=L.children.length),M.offset>J)return;try{Q.select(G,{anchor:M,focus:M})}catch(k){const F=k.message;b(`Error focusing editor: ${F}`)}}}}),c.jsx(_w,{}),p?c.jsx(pw,{onFallbackClick:m}):null]},x),c.jsx(fo,{id:`character-limit-${e}`,limit:r,valueLength:ni(z)})]})}):c.jsx(c.Fragment,{})};const Mw=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:a=()=>{}},isDisabled:i=!1,className:s=""})=>{const[o,l]=y.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);y.useEffect(()=>{r&&l(r)},[r]);const u=d=>{i||(l(d),a(d))};return c.jsxs("div",{className:Y("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:Y("toggle-options",{disabled:i,on:o===n[1].value}),children:n.map(d=>{const h=`${e}-${d.value}`;return c.jsxs("li",{className:"hidden",children:[c.jsx("input",{type:"radio",id:h,name:e,value:d.value,checked:o===d.value,onChange:()=>u(d.value),disabled:i}),c.jsx("label",{htmlFor:h,children:d.label})]},h)})})]})};function fh({className:e="",userId:t,userName:n,src:r,uploadImage:a,button:i,callback:s}){const o=se.useIntl(),l="profileImageChange_",[u,d]=y.useState(r),[h,p]=y.useState(!1),[m,g]=y.useState(!1),f=y.useRef(null),b=async _=>{p(!0),g(!1);try{const x=_.target.files&&_.target.files[0];if(!x||!t)throw p(!1),new Error("Image file or userID is missing");const T=await a({fileObject:x,userId:t}),S={thumbnail:T.thumbnailURL,full:T.originalURL};d(S),s(S)}catch{g(!0)}finally{p(!1)}p(!1)},{upload:v=o.formatMessage({id:`${l}cta_upload`}),change:w=o.formatMessage({id:`${l}cta_change`}),uploading:A=o.formatMessage({id:`${l}cta_uploading`})}=(i==null?void 0:i.text)||{};return c.jsxs("div",{className:Y("profile-image-change-figure",e),children:[c.jsx(mn,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),m&&c.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),c.jsx("input",{id:"file",type:"file",accept:"image/*",ref:f,onChange:b,hidden:!0,"data-testid":"file-input"}),c.jsx(Ee,{onClick:()=>f.current&&f.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:h,children:h?A:u?w:v})]})}const hh=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:a="contact-form-submit-click"}=e||{};return c.jsx(en,{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:a},functions:{onSuccess:t,onFailure:n}})};const mh=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:a,backgroundColor:i,onClose:s,reportError:o,sendInvites:l,initialFormStatus:u="NOT_SUBMITTED"})=>{const[d,h]=y.useState([]),[p,m]=y.useState(!0),[g,f]=y.useState(u),{formatMessage:b}=se.useIntl(),v=async _=>{_.preventDefault();try{await l(d),h([]),f("SUCCESS")}catch(x){f("ERROR"),o(x)}},w=_=>{_.preventDefault(),f("NOT_SUBMITTED"),m(!0),h([])},A=_=>{_.preventDefault(),s(),f("CLOSED")};return g==="CLOSED"?null:g==="ERROR"||g==="SUCCESS"?c.jsxs("div",{className:"invite-form-wrapper",children:[c.jsx("div",{className:"content centred",children:g==="SUCCESS"?c.jsx("h2",{className:"success-title",children:b({id:"inviteForm_success"})}):c.jsxs("h2",{className:"error-title",children:[" ",b({id:"inviteForm_error"})]})}),c.jsx(Wt,{}),c.jsx("div",{className:"footer",children:g==="SUCCESS"?c.jsxs(c.Fragment,{children:[c.jsx(Ee,{variant:"secondary",onClick:w,children:b({id:"inviteForm_ctaSendMoreInvites"})}),c.jsx(Ee,{onClick:A,children:b({id:"inviteForm_ctaDone"})})]}):c.jsx(Ee,{onClick:w,children:b({id:"inviteForm_ctaTryAgain"})})})]}):c.jsx("div",{className:"invite-form-wrapper",children:c.jsxs("form",{style:{backgroundColor:i},onSubmit:v,className:Y("invite-form gtm-trackable"),children:[c.jsxs("fieldset",{className:"content",children:[c.jsx("h2",{className:"title",style:{color:r},children:e}),c.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t}),c.jsx(Kh.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:b({id:"inviteForm_email_placeholder"}),emails:d,onChange:_=>{h(_),m(!_.length)},autoFocus:!1,getLabel:(_,x,T)=>c.jsxs("div",{className:"email text-medium",children:[c.jsx("div",{"data-tag-item":!0,children:_}),c.jsx(Ee,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{T(x),m(!d.length)},className:"remove-email-button",screenreaderText:b({id:"overlay_close"})})]},x)})]}),c.jsx(Wt,{}),c.jsx("fieldset",{className:"footer",children:c.jsx(Ee,{className:"sendEmailsButton",disabled:p,children:n})})]})})},Aa=e=>e.map(t=>({condition:t})),wt={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},Nw=({functions:e,...t})=>{const{formatMessage:n}=se.useIntl(),[r,a]=y.useState(null),[i,s]=y.useState(!1),[o,l]=y.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=m=>m[wt.NEW_PASSWORD]!==m[wt.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,d=m=>!ys(m[wt.NEW_PASSWORD]).isValid,h=[{"data-testid":wt.NEW_PASSWORD,id:wt.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:Aa(["required",d]),functions:{onChange:m=>l(ys(m).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":wt.CONFIRMED_PASSWORD,id:wt.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:Aa(["required",u])}];t.isPasswordChange&&h.unshift({"data-testid":wt.CURRENT_PASSWORD,id:wt.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:Aa(["required"])}),i&&h.push({component:Ld,props:{matchingRules:o}});const p={id:wt.FORM_ID,fields:h,functions:{...e,onSuccess:async m=>(e.createPassword(m),e.onSuccess&&e.onSuccess(m)),onCatch:m=>a(m==null?void 0:m.statusCode),onFailure:(m,g)=>{(g.includes(wt.NEW_PASSWORD)||g.includes(wt.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return c.jsxs(c.Fragment,{children:[c.jsx(en,{...p}),r&&c.jsx(hn,{variant:"error",text:r})]})};const ph=({hooks:e,functions:t,meta:n={},gtm:r})=>{var _,x;const a=se.useIntl(),i="profileForm_",s=y.useContext(gt),[o,l]=y.useState(s.image),[u,d]=y.useState(!1),{uploadImage:h,onSuccess:p=async T=>{},onCancel:m=()=>{},onFailure:g=()=>{}}=t,{buildLocation:f,isValidPlace:b,predictPlaces:v}=e.useMaps(),{context:w="ProfileForm",event:A="profile-form-submit-click"}=r||{};return c.jsx(en,{id:"profile-details-form",fields:[{component:fh,props:{userName:s.name,userId:s.id,src:o,uploadImage:h,callback:l,button:{text:{upload:a.formatMessage({id:`${i}image`})}}}},{id:"name",type:"text",label:a.formatMessage({id:`${i}name`}),placeholder:a.formatMessage({id:`${i}name_placeholder`}),value:s.name,autoComplete:"name",validation:[{condition:"required"}]},{id:"jobTitle",type:"text",label:a.formatMessage({id:`${i}jobTitle`}),placeholder:a.formatMessage({id:`${i}jobTitle_placeholder`}),value:s.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:a.formatMessage({id:`${i}organization`}),placeholder:a.formatMessage({id:`${i}organization_placeholder`}),value:s.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:a.formatMessage({id:`${i}location`}),placeholder:a.formatMessage({id:`${i}location_placeholder`}),value:((_=s.location)==null?void 0:_.en)||((x=s.location)==null?void 0:x.country),validation:[{condition:"required"},{condition:({location:T})=>T&&!u?!1:!b(T),error:a.formatMessage({id:`${i}location_error`})}],functions:{onChange:()=>{u||d(!0)},onKeyInput:v}},{id:"biography",type:"textarea",label:a.formatMessage({id:`${i}bio`}),placeholder:a.formatMessage({id:`${i}bio_placeholder`}),limit:1e3,value:s.biography},{component:Wt}],meta:{shouldShowCancelButton:!0,shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,...n},intlPath:i,gtm:{context:w,event:A},functions:{onSuccess:async T=>{try{const S={...T,image:o||null,location:u?await f(T==null?void 0:T.location):s.location};s.updateDetails&&s.updateDetails(z=>({...z,...S})),await p(S)}catch{g()}},onCancel:m,onFailure:g},button:{size:"large",text:{default:a.formatMessage({id:`${i}cta`}),submitting:a.formatMessage({id:`${i}cta_submitting`}),submitted:a.formatMessage({id:`${i}cta_submitted`})}}})};const gh=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:a="search-bar",gtmEvent:i="form-submission"})=>{const{searchIsOpen:s=!0,isDesktopVersion:o=!1}=n||{},l=se.useIntl(),u=y.useRef(null);Fn(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const d=h=>{h.preventDefault(),h.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:Y("search-form gtm-trackable",t),role:"search","data-gtm-event-context":a,"data-gtm-event-type":i,children:c.jsx("fieldset",{id:`${e}-form`,hidden:n?!s:!1,children:c.jsxs("p",{children:[c.jsx(Ne,{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:h=>{h.key==="Enter"&&d(h)}}),c.jsx("button",{className:"clear",onClick:h=>{h.preventDefault(),h.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:c.jsx(Ne,{children:l.formatMessage({id:"search_clear"})})}),c.jsx("button",{className:"search",onClick:d,children:c.jsx(Ne,{children:l.formatMessage({id:"search_cta"})})})]})})})},_c=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 a=e.current.value.toString().toLowerCase().trim(),i={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let s=Object.assign({},i);try{s=await t(a),s===void 0&&(s=i)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:a,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:a,boxType:d,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(a)}},{type:"validFields.email",value:!0}])},Iw=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"]}},Rw=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:a,state:i})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const s=Iw(new FormData(e.form.current)),o=Object.assign(s,t);await n(o),localStorage.setItem("email",s.email),r&&r({...s,...i.values}),a([{type:"showSuccessMessage",value:!0}])},$w=({shouldShow:e,placeholders:t,labels:n,functions:{validateEmail:r,resendVerificationCode:a},refs:i,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:d}=s,h=(m,g)=>{m.current&&s.validFields[g]!==m.current.validity.valid&&o([{type:`validFields.${g}`,value:m.current.validity.valid}])},p=[{id:"full_name",type:"text",inputRef:i.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>h(i.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:i.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{_c({ref:i.email,validateEmail:r,dispatch:o})},onChange:(m,g)=>{o([{type:"shouldDisableButton",value:!0}]),g&&g({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:Md,props:{email:d.email,type:d.boxType,resendVerificationCode:a}}];return s.shouldManuallyApprove&&(p.push({id:"job_title",type:"text",inputRef:i.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>h(i.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:i.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{h(i.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&p.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:m=>c.jsx("small",{children:m})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&p.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:m=>c.jsx("small",{className:"notes text-small",children:m})}),placeholder:(t==null?void 0:t.expectation)||u.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),p.push({id:"terms",className:"text-small",type:"checkbox",inputRef:i.tc,label:u.formatMessage({id:"signup_terms"},{terms:m=>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:m}),privacy:m=>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:m})}),shownValue:"accepted",functions:{onChange:m=>{if(!m)return;const g=[];["name","email"].forEach(f=>{s.validFields[f]!==i[f].current.validity.valid&&(g.push({type:`validFields.${f}`,value:i[f].current.validity.valid}),f==="email"&&_c({ref:i.email,validateEmail:r,dispatch:o}))}),g.length&&o(g)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),p};const Lw=({className:e=""})=>c.jsxs("div",{className:Y("success-message",e),"data-testid":"success-message",children:[c.jsx("p",{className:"success-title",children:c.jsx(se.FormattedMessage,{id:"signup_success_title"})}),c.jsx(se.FormattedMessage,{id:"signup_success_text",values:{p:t=>c.jsx("p",{children:t})}})]});const zw={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},qw=({className:e="",labels:t={},placeholders:n={},functions:r={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:a={},submitButton:i,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=se.useIntl(),{title:u=!0,expectation:d=!1,url:h=!0,logInButton:p=!0,successMessage:m=!0}=a,g={title:u,expectation:d,url:h,logInButton:p,successMessage:m},[f,b]=y.useReducer(Wr,zw),{validFields:v,emailDetails:w,shouldManuallyApprove:A,shouldDisableButton:_,showSuccessMessage:x,showError:T}=f,[S,z]=Ys.useCookies(["signup-this-session","functional-cookie-consent"]),M={form:y.createRef(),name:y.createRef(),email:y.createRef(),jobTitle:y.createRef(),organisation:y.createRef(),tc:y.createRef(),hiddenValidation:y.createRef()};y.useEffect(()=>{A===!0&&M.jobTitle.current&&M.jobTitle.current.focus()},[A]),y.useEffect(()=>{S["signup-this-session"]&&b([{type:"showSuccessMessage",value:!0}])},[S]),y.useEffect(()=>{x&&S["functional-cookie-consent"]&&z("signup-this-session","true",{path:"/",maxAge:3600})},[x]);const q=y.useMemo(()=>$w({placeholders:n,labels:t,shouldShow:g,functions:r,refs:M,state:f,dispatch:b,dataToSubmit:s,intl:l}),[s,r,l,M,g,f]),I=_?!0:A?!Object.values(v).every(B=>B===!0):!v.name||!v.email||["exists","pending","verify"].includes(w.boxType);return g.successMessage&&x?c.jsx(Lw,{className:e}):c.jsxs("fieldset",{className:Y("signup-form-fieldset",e),"data-testid":"signup-form",children:[g.title&&c.jsx("p",{className:"signup-title",children:c.jsx(se.FormattedMessage,{id:"signup_title"})}),T&&c.jsx(hn,{variant:"error",text:l.formatMessage({id:"signup_error"})}),c.jsx(en,{className:"signup-form",formRef:M.form,id:"sign-up-form",fields:q,intlPath:"signup",button:{variant:"primary",size:"medium",text:i||l.formatMessage({id:"signup_button_join"}),disabled:I?{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","data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:g.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await Rw({refs:M,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:b,state:f})},onCatch:B=>{r.handleError(B),b([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),c.jsx("button",{className:"validation-button",ref:M.hiddenValidation})]})};const bn=({children:e,className:t="",styling:n={},...r})=>{const{background:a="default"}=n;return c.jsx("section",{className:Y("full-width-section",t,{[a]:a!=="default"}),...r,children:e})};const Ww=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(a=>{r.push({href:a.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable","data-gtm-event-type":"download-click","data-gtm-event-context":a.eventContext||"Download",target:"_blank",children:a.text})}),c.jsx(bn,{className:Y("download-section",n),children:c.jsxs("div",{className:"content-default",children:[y.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),c.jsx(or,{buttons:r})]})})};const Zs="editSection_";function vh({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const Uw=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:a,setShowModal:i})=>{const{formatMessage:s}=se.useIntl();return c.jsxs(Ot,{variant:"muted",icon:e,children:[c.jsx("p",{children:t||s({id:`${Zs}placeholder_description`})}),a&&c.jsx("p",{children:c.jsx(Ee,{href:r,variant:"secondary",size:"small",onClick:()=>vh({href:r,setShowModal:i}),children:n||s({id:`${Zs}placeholder_cta`})})})]})},Hw=({children:e,className:t="",formProps:n,formComponent:r,href:a,title:i,showTitle:s=!0,modalTitle:o,placeholder:l,showDivider:u=!0})=>{const{formatMessage:d}=se.useIntl(),[h,p]=y.useState(!1),m=()=>p(!1),g=!!n||!!r,f=typeof a=="string"||g;let b;return r&&(b=y.cloneElement(r,{functions:{...r.props.functions,onSuccess:async v=>{try{r.props.functions.onSuccess&&await r.props.functions.onSuccess(v)}finally{m()}},onCancel:()=>{r.props.functions.onCancel&&r.props.functions.onCancel(),m()}}})),c.jsxs("section",{className:Y("edit-section",t),children:[g&&c.jsx(pn,{title:o||`Edit ${i}`,isOpen:h,showDivider:!1,showIcon:!1,functions:{onClose:m},className:Y("edit-section-modal"),children:b||(n?c.jsx(en,{...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 v=>{var w,A;(w=n==null?void 0:n.functions)!=null&&w.onSuccess&&await((A=n==null?void 0:n.functions)==null?void 0:A.onSuccess(v)),p(!1)},onCancel:m}}):c.jsx(c.Fragment,{}))}),c.jsxs("div",{className:Y("edit-section-header",{"no-title":!s}),children:[s&&c.jsx("h2",{className:"edit-section-header-title",children:i}),f&&c.jsx(Ee,{href:a,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>vh({href:a,setShowModal:p}),children:d({id:`${Zs}edit`})})]}),e||c.jsx(Uw,{...l,href:a,setShowModal:p,showEditButton:f}),u&&c.jsx(Wt,{})]})};const Vw=({title:e=!1,text:t,logos:n=[],styling:r={},className:a=""})=>{const i=n.length;if(i===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return c.jsxs("div",{className:Y("logos",a,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&y.createElement(s.element,{className:Y("title",s.className)},s.text),t&&c.jsx("p",{children:t}),c.jsx("ul",{className:Y({"two-col":i===2||i===4,"three-col":i===5||i<=10&&i%3===0}),children:n.map(({logo:d,nameOfBusiness:h,link:p=!1,description:m=!1},g)=>{if(!d||!d.url)return null;const f=c.jsx("img",{src:d.url,width:d.width||"auto",height:d.height||"auto",alt:h});return c.jsxs("li",{children:[c.jsx("p",{className:"img-wrapper",children:p?c.jsx("a",{href:p,target:"_blank",rel:"nofollow noreferrer noopener",children:f}):f}),m&&c.jsx("small",{children:m})]},window.btoa(`${d.url}_${g}`))})})]})};let ts;const ns="contactFooter_",Kw=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=y.useRef(null),[r,a]=y.useState(0),[i,s]=y.useState(!1),o=()=>{n.current&&a(n.current.clientHeight)},l=()=>{i||(s(!0),clearTimeout(ts),ts=setTimeout(()=>{o(),s(!1)},500))};return y.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(ts),window.removeEventListener("resize",l)}),[]),c.jsx(bn,{id:"contactForm",className:"contact-footer",children:c.jsxs("div",{className:"inner-wrapper",children:[c.jsx("h2",{children:c.jsx(se.FormattedMessage,{id:`${ns}title`})}),c.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:i?{}:{minHeight:r},children:[c.jsxs("aside",{children:[c.jsx("p",{children:c.jsx(se.FormattedMessage,{id:`${ns}text`})}),c.jsx(fn,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:c.jsx(se.FormattedMessage,{id:`${ns}email`})})]}),c.jsx(hh,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},Zw=({activeLink:e,profile:t,...n})=>c.jsx(bn,{children:c.jsx(Od,{layout:"1-3",children:c.jsxs(c.Fragment,{children:[c.jsx(jd,{activeLink:e,profile:t}),c.jsx(od,{...n})]})})});const rs="cookieBanner_",as=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],is=new Date(Date.now()+12*30*24*60*60*1e3),bh=()=>{const e=se.useIntl(),[t,n,r]=Ys.useCookies(as),[a,i]=y.useState(!t["apol-cookie-banner"]),s=()=>{as.forEach(d=>{n(d,!0,{path:"/",expires:is,domain:d==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),i(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:is}),as.forEach(d=>{if(d==="apol-cookie-banner"){n(d,!0,{path:"/",expires:is});return}r(d)}),i(!1)};if(!a)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,gtmType:"accepted-all"}],u=[];return l.forEach(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:`${rs}buttons_${d.id}`})})}),c.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[c.jsx("h6",{children:e.formatMessage({id:`${rs}title`})}),c.jsx("p",{children:e.formatMessage({id:`${rs}text`})}),c.jsx(or,{buttons:u})]})},Zt={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:Hn["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Hn["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:Hn.support,gtmType:"concierge-email-click"},business:{email:Hn.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 Qn="footer_",Ua="SiteFooter",kc=({group:e})=>{const t=Zt[e].order||[];let n=!1;return"text"in Zt[e]&&(n=Zt[e].text),c.jsxs(y.Fragment,{children:[c.jsx("p",{className:"pre-title",children:c.jsx(se.FormattedMessage,{id:`${Qn}${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:a,gtmType:i}=Zt[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),c.jsx("li",{children:c.jsx("a",{href:a,className:"gtm-trackable","data-gtm-event-context":Ua,"data-gtm-event-type":i,...s,children:c.jsx(se.FormattedMessage,{id:`${Qn}${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(y.Fragment,{children:[c.jsx("dt",{children:c.jsx(se.FormattedMessage,{id:`${Qn}${e}_${r}`})}),c.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&c.jsx("address",{children:c.jsx(se.FormattedMessage,{id:`${Qn}${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":Ua,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},$o=()=>c.jsx("div",{id:"footer",children:c.jsxs("div",{className:"wrapper",children:[c.jsx(Qa,{element:"hr"}),c.jsx(co,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Ua,"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(kc,{group:e}),Object.keys(Zt[e]).includes("child")&&c.jsx(kc,{group:Zt[e].child})]},e))}),c.jsx("hr",{}),c.jsxs("div",{className:"sub-footer",children:[c.jsx("ul",{children:Array.isArray(Zt.social.order)&&Zt.social.order.map(e=>{const t=Zt.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":Ua,"data-gtm-event-type":"social-click",children:c.jsx("span",{className:"hidden",children:c.jsx(se.FormattedMessage,{id:`${Qn}social_${e}`})})})},e)})}),c.jsx("small",{children:c.jsx(se.FormattedMessage,{id:`${Qn}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),Ie={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=i=>{const s=`logged${e?"In":"Out"}`;return t>=n[i][s]};let a={};return["navigation","search"].forEach(i=>{a[i]=r(i)}),a},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(a=>a===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:a=!1})=>{if(!a&&n[e]===t||!a&&e===yt.ACCOUNT&&t===!1&&n[yt.SITE]===!0)return;const i=Date.now();if(!a&&!t&&Ie.handlerCalled[e]&&i-Ie.handlerCalled[e]<500)return;Ie.handlerCalled[e]=i;let s=[{type:`menus.${e}`,value:t}];if(t===!0)Object.keys(n).forEach(o=>{o===e||n[o]===!1||s.push({type:`menus.${o}`,value:!1})});else{let o=null;switch(e){case yt.SITE:o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation .navigation-button"));break;case yt.SEARCH:o=document.querySelector("#header .toggle-search-button");break;case yt.ACCOUNT:o=document.querySelector("#header .account-button");break;default:return}o&&o.focus()}r(s)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const a=Ic(e[r],t);if(!(typeof a>"u")&&(!n||a[t]&&a[t].includes(n)||a.value&&a.value.includes(n)||a.toString().includes(n)))return e[r]}return e[0].children?Ie.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:a})=>{var l;if(!t.current||!t.current.children)return;const i=n?"desktop":"default";if(r[e][i]){(l=document.querySelector(`#header ul a[href="${r[e][i]}"]:last-child`))==null||l.focus();return}let s,o;switch(e){case yt.SITE:if(n){const u=Ie.findFirstChild(t.current.children,"className","has-submenu parent"),d=Ie.findFirstChild(u.children,"id",yt.SITE);s=Ie.findFirstChild(d.children,"href")}else s=Ie.findFirstChild(t.current.children,"href");break;case yt.ACCOUNT:if(o=Ie.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=Ie.findFirstChild(o.children,"href");break;default:return}s&&(a([{type:`focusElements.${e}.${i}`,value:s.attributes.href.value}]),s.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(Ie.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(Ie.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Ie.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Ie.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},qr={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},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"},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},Ha=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:a=()=>{},doTrack:i=null})=>{const s=se.useIntl(),o=Ic(qr,e);if(!o||o.onlyShow&&(o.onlyShow==="logged-in"&&!t||o.onlyShow==="logged-out"&&t))return null;const l="doTrack"in o,u=i===null?l?o.doTrack:!0:i,d=e.includes("buttons.");let h=`header_${e.replaceAll(".","_")}`;o.hasVariantText&&(h+=`_logged${t?"In":"Out"}`);let p=!1;if(o.href){let A=o.gtmType||`${e}-click`;if(A.includes(".")){const _=A.split("."),x=_[_.length-2];A=`${x==="topics"?`${x}-`:""}${_[_.length-1]}`}p={href:o.href},u&&(p={...p,className:"gtm-trackable","data-gtm-event-type":A,"data-gtm-event-context":"HeaderButtons"}),d&&(p={...p,variant:"secondary",size:{mobile:"small",881:"large"},...o.props||{}})}const m=o.order&&o.order[0]&&o[o.order[0]],g=m&&o[o.order[0]].order,f=p&&window.location.pathname===o.href;let b={},v={},w={};if(f&&(b={...b,"aria-current":"page"}),m){const A=o.menuId||e,_={onClick:x=>Ie.events.onClick(x,{id:A,callback:a,isOpen:r[A]}),onFocus:()=>Ie.events.onFocus({id:A}),onBlur:()=>Ie.events.onBlur({id:A,callback:a}),onMouseLeave:()=>Ie.events.onBlur({id:A,callback:a}),onMouseEnter:()=>Ie.events.onMouseEnter({id:A,callback:a})};v={..._,id:A===yt.SITE?yt.SITE:yt.ACCOUNT},n&&(g&&(w={..._,className:"navigation-button",onKeyPress:x=>{x.key==="Enter"&&Ie.events.onClick(x,{id:A,callback:a,isOpen:r[A]})},"aria-haspopup":!0,"aria-expanded":r[A],"aria-controls":A}),v={...v,hidden:A in r?!r[A]:!0}),g||(v={...v})}return c.jsxs("li",{className:Y({[o.className]:o.className,"has-submenu":m,parent:g,active:f}),...b,children:[p?y.createElement(d?Ee:"a",p,s.formatMessage({id:h})):n&&o.order&&g?c.jsxs("button",{...w,children:[s.formatMessage({id:h}),c.jsx(Ne,{children:s.formatMessage({id:`header_menu_${r[yt.SITE]?"hide":"show"}`})})]}):s.formatMessage({id:h}),o.order&&c.jsx("ul",{...v,children:o.order.map(A=>{if(!o[A])return null;const _={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:a,doTrack:l?u:null};return o[A].order?c.jsxs("li",{className:Y({[o[A].className]:o[A].className}),children:[s.formatMessage({id:`${h}_${A}`}),c.jsx("ul",{children:o[A].order.map(x=>c.jsx(Ha,{id:`${e}.${A}.${x}`,..._},x))})]},A):c.jsx(Ha,{id:`${e}.${A}`,..._},A)})})]},e)};const Yw={height:67,height_desktop:83};var yt=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(yt||{});const Lo=({showNavigation:e=!0})=>{const t=se.useIntl(),n=y.useContext(gt),r=Mn(!0,!0),a=n&&typeof n.id=="string",i=y.useMemo(()=>Ie.getIsDesktopVersion(a,r),[a,r]),[s,o]=y.useReducer(Wr,{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,h=y.useRef(s);y.useEffect(()=>{h.current=s},[s]),Wc({scrollPosition:Yw[`height${i.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const v=h.current.menus;!i&&v["site-navigation"]||Ie.shouldChangeHeaderIsVisible(!0,v,o)},scrollDown:()=>{const v=h.current.menus;!i&&v["site-navigation"]||Ie.shouldChangeHeaderIsVisible(!1,v,o)}}});const p=(v,w,A=!1)=>{Ie.handleMenus({id:v,value:w,menus:h.current.menus,dispatch:o,forceHandle:A})},m=y.useRef(null),g=v=>{v.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(w=>{h.current.menus[w]&&p(w,!1,!0)})};y.useEffect(()=>{var v;return(v=document.getElementById("header"))==null||v.addEventListener("keydown",g),()=>{var w;(w=document.getElementById("header"))==null||w.removeEventListener("keydown",g)}},[]),Fn(()=>{u["site-navigation"]&&Ie.autoFocus({menu:"site-navigation",navigationRef:m,isDesktopVersion:i.navigation,focusElements:d,dispatch:o})},[u["site-navigation"]]),Fn(()=>{u["account-navigation"]&&Ie.autoFocus({menu:"account-navigation",navigationRef:m,isDesktopVersion:i.navigation,focusElements:d,dispatch:o})},[u["account-navigation"]]);const f=c.jsxs(c.Fragment,{children:[!i.search&&c.jsx("button",{className:"search toggle-search-button",onClick:v=>{v.preventDefault(),v.stopPropagation(),p("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:c.jsx(Ne,{children:t.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),c.jsx(gh,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),b=c.jsxs(c.Fragment,{children:[!i.navigation&&c.jsx("button",{className:"menu-button gtm-trackable",onClick:v=>{v.preventDefault(),v.stopPropagation(),p("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(Ne,{children:t.formatMessage({id:`header_menu_${u["site-navigation"]?"hide":"show"}`})})}),c.jsx("ul",{ref:m,id:"navigation",hidden:i.navigation||u["account-navigation"]?!1:!u["site-navigation"],"data-showing":!i.navigation&&u["account-navigation"]?"account":"default",children:qr.order.map(v=>c.jsx(Ha,{id:v,isLoggedIn:a,isDesktopVersion:i.navigation,menus:{"site-navigation":u["site-navigation"],"account-navigation":u["account-navigation"]},callback:p},v))})]});return n&&n.isLoading?null:c.jsxs(c.Fragment,{children:[c.jsxs("nav",{id:"header",className:Y({"logged-in":a,"logged-out":!a,visible:l}),children:[c.jsx(Ne,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),c.jsx(co,{variant:"monochrome"}),e&&c.jsxs(c.Fragment,{children:[i.navigation?c.jsxs(c.Fragment,{children:[b,f]}):c.jsxs(c.Fragment,{children:[f,b]}),a?c.jsxs("button",{className:"account-button",onClick:v=>Ie.events.onClick(v,{id:"account-navigation",callback:p,isOpen:u["account-navigation"]}),onMouseEnter:()=>Ie.events.onMouseEnter({id:"account-navigation",callback:p}),onMouseLeave:()=>Ie.events.onBlur({id:"account-navigation",callback:p}),"aria-haspopup":"true","aria-expanded":u["account-navigation"],"aria-controls":"account-navigation",children:[c.jsx(Ne,{children:t.formatMessage({id:`header_account_${u["account-navigation"]?"hide":"show"}`})}),c.jsx(mn,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):c.jsx("ul",{className:"sign-in-buttons",children:qr.buttons.order.map(v=>c.jsx(Ha,{id:`buttons.${v}`},v))})]})]}),c.jsx("hr",{id:"content-of-page"}),c.jsx("div",{className:Y("overlay",{open:u["site-navigation"]||u["account-navigation"]||!i.search&&u.search})})]})};const Gw=()=>{const e=se.useIntl();return c.jsxs(c.Fragment,{children:[c.jsx(Lo,{}),c.jsx("div",{id:"content",children:c.jsx(hn,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),c.jsx($o,{})]})},yh=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:a={},styling:i={},className:s="",locale:o="en"})=>{const{navigation:l=!0,footer:u=!0}=a,{background:d="default",variant:h="default",circle:p="default",modal:m="default"}=i,g=Lc(),[f,b]=y.useState(""),v=T=>{const{detail:{message:S}}=T;b(S)};y.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",v),()=>{document.removeEventListener("ariaLive",v)}),[g]);const w=Da(e,{locale:o}),A=Da(t,{locale:o}),_=Da(n,{locale:o}),x={};return d!=="default"&&(x[d]=!0),h!=="default"&&(x[h]=!0),p!=="default"&&(x[p]=!0),c.jsx(Zh.ErrorBoundary,{onError:r,fallback:c.jsx(Gw,{}),children:c.jsxs(y.Suspense,{fallback:null,children:[c.jsxs("div",{id:"wrapper",className:Y(s,x,{"has-footer":u}),children:[c.jsx(Lo,{showNavigation:l}),c.jsxs("main",{id:"content-wrapper",children:[A&&c.jsx("div",{className:Y("additional-content prepended",{"large-modal":m==="large"}),children:A}),y.createElement(d==="bold"?so:"div",{id:"content",children:w,className:Y({"large-modal":m==="large"})})]}),_&&c.jsx("div",{className:"additional-content appended",children:_}),u&&c.jsx($o,{}),c.jsx(bh,{})]}),f&&c.jsx(Ne,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:f})]})})},Fc={default:"tags_",headerTopics:"header_topics_topics_"},ss={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"},Qw={getTagDetails:e=>{if(e.includes("topic_")){if(e=ss.topic[e.replace("topic_","")],e){const t=qr.topics.topics[e].href;return t?{id:e,href:t,text:`${Fc.headerTopics}${e}`}:null}return null}return ss[e]?(e=ss[e],{id:e,text:`${Fc.default}${e}`}):null}};const Jw=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:a="",gtmType:i="tag-click",gtmContext:s="tags"})=>{const o=se.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const d=Qw.getTagDetails(u);d&&l.push(d)}),l.length<1?null:c.jsx("ul",{className:Y("tags text-small",t,a,{"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":i,"data-gtm-event-context":s,children:d}):d},u.id)})})};var ct=(e=>(e.COMMUNITIES="communities",e.PLATFORM="platform",e))(ct||{});const Xw=({members:{data:e=[],total:t=e.length},communitySlug:n,isMember:r=!1,hasNextPage:a=!1,loadNextPage:i=()=>{},profile:s,gtmContext:o="member",gtmType:l="member-click",className:u=""})=>{const d=se.useIntl(),h="membersList",p=y.useContext(gt),[m,g]=y.useState(!1);return e.length===0?null:c.jsxs("div",{className:Y("members-list",u),children:[c.jsxs("h1",{children:[d.formatMessage({id:h}),c.jsx("span",{className:"count",children:t})]}),c.jsxs("ul",{children:[r?c.jsxs("li",{children:[c.jsx(Qt,{member:p,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:ct.COMMUNITIES,area:n||""},{scope:ct.PLATFORM,area:"all"}]}}),c.jsx(fn,{href:"/profiles/me",className:"text-small",onClick:f=>{f==null||f.preventDefault(),f==null||f.stopPropagation(),g(!0)},children:d.formatMessage({id:`${h}_profile`})})]}):c.jsx(c.Fragment,{}),e.map((f,b)=>c.jsxs("li",{children:[c.jsx(Qt,{member:f,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:ct.COMMUNITIES,area:n||""},{scope:ct.PLATFORM,area:"all"}]}}),f.isAdmin&&c.jsx(Gt,{children:d.formatMessage({id:`${h}_admin`})})]},b))]}),a&&c.jsx(Hr,{hasNextPage:a,loadNextPage:i,icon:{icon:"arrow-down",position:"right"},gtmContext:o}),s?c.jsx(fi,{form:s,showModal:m,content:{title:d.formatMessage({id:`${h}_modal_title`})},functions:{onClose:()=>{g(!1)}}}):c.jsx(c.Fragment,{})]})},eE={showForm:!1},ci=y.createContext(eE),Dh=({children:e})=>{const[t,n]=y.useState({showForm:!1});return c.jsx(ci.Provider,{value:{...t,updateConversation:n},children:e})},Bc=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},di=e=>{var t,n,r,a,i,s;return e&&!e.error?{id:e==null?void 0:e.id,name:(t=e==null?void 0:e.data)==null?void 0:t.name,organization:(n=e==null?void 0:e.data)==null?void 0:n.organization,jobTitle:(r=e==null?void 0:e.data)==null?void 0:r.jobTitle,location:(a=e==null?void 0:e.data)==null?void 0:a.location,image:{thumbnail:((i=e==null?void 0:e.data)==null?void 0:i.thumbnail)||void 0},badges:(s=e==null?void 0:e.data)==null?void 0:s.badges}:"deleted"},tE=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const a=se.useIntl();return t?c.jsx("small",{children:Tt(a.formatMessage,`${e}explainer`,n,"action",{a:i=>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:i})})}):c.jsx(c.Fragment,{})},nE=({formID:e,intlPath:t,showLabel:n,type:r})=>{const a=se.useIntl();return n?c.jsx("label",{htmlFor:`${e}-input`,className:"text-small",onClick:i=>{i.preventDefault(),i.stopPropagation();const s=new CustomEvent("focusEditor",{detail:{id:`rte-${e}-input`}});window.dispatchEvent(s)},children:a.formatMessage({id:`${t}label`})}):c.jsx(Ne,{element:"label",showOnFocus:!1,htmlFor:`${e}-input`,children:Tt(a.formatMessage,`${t}label_action`,r,"action")})};let pa=null;const Je="discussion_form_",Kr=({id:e,parentId:t,content:n={type:"response",slugs:{}},userHasPermissions:r=!0,meta:a,placeholder:i,maxLength:s=0,buttons:o,forceShow:l={cancel:!1,error:!1},isCommunity:u=!1,functions:d,data:h={},gtmContext:p="DiscussionForm"})=>{var Te,Ve,We;const m=se.useIntl(),g=y.useContext(gt),[f,b]=y.useState(""),{isLoading:v=!1,isInWrapper:w=!1,isInOverlay:A=!1,isAutoFocused:_=!1,isEditing:x=!1,hasTitleField:T=!1,isPrepopulated:S=!1,showTitle:z=!1,showGuidelines:M=!0,showDivider:q=!1,showSuccessMessage:I=!0}=a||{},{onChange:B=()=>{},create:E=()=>{},handleSaveEdit:j=()=>{},handleCancel:N=()=>{},callback:W=()=>{},onMention:H=()=>{},listMembers:G=()=>Promise.resolve([]),clickMentionFallback:ae=()=>{},props:C={create:{projectNames:["questions-answers"]}}}=d,[L,J]=y.useState({title:T&&T.text||"",body:x&&x.text||S&&S.text||""}),[k,F]=y.useState(l.error||!1),[$,R]=y.useState(!1);if(y.useEffect(()=>{u&&!x&&S&&S!==L.body&&J({...L,body:S.text||""})},[S]),v)return c.jsx(Bt,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const U=Be=>{J({...L,body:Be}),B({body:Be});let Se;!g||!g.id?Se=Tt(m.formatMessage,`${Je}error_loggedOut`,n.type,"action"):r?s>0&&Be.length>=s&&(Se=`${Je}error_tooLong`):Se=Tt(m.formatMessage,`${Je}error_noPermission`,n.type,"action"),Se?F(Se):k&&F(!1)};let re=`${n.type}-form`;if(n.type==="response"||n.type==="reply"){const Be=((Te=n.slugs)==null?void 0:Te.reply)||((Ve=n.slugs)==null?void 0:Ve.answer)||((We=n.slugs)==null?void 0:We.question)||"";Be&&(re=`${re}-${Be.slice(-15)}`)}e&&(re=`${e}-${re}`);const ee=async()=>{if(!g||!g.id||!r||ve)return;pa&&clearTimeout(pa),R("submitting");const Be=window.location.pathname;try{let Se;switch(n.type){case"post":Se=await E({title:L.title,content:L.body});break;case"question":Se=await E({title:L.body,authorId:g&&g.id,...C==null?void 0:C.create});break;case"response":Se=await E({questionSlug:n.slugs.question},{body:L.body,authorId:g&&g.id,contentPath:Be});break;case"reply":Se=await E({questionSlug:n.slugs.question,answerSlug:n.slugs.answer},{body:L.body,authorId:g&&g.id,contentPath:Be});break;default:break}await sm(1e3),W&&await W(Se),pa=setTimeout(()=>{J({title:"",body:""}),R("submitted"),b(Tt(m.formatMessage,`${Je}success`,n.type,"action"));const De=new Event(Xe.DISCUSSION_FORM_SUBMITTED);document.dispatchEvent(De),ie()},500)}catch(Se){const De=Se;let Re=`${Je}error`;De!=null&&De.message.includes("entry already exists")&&(Re=Tt(m.formatMessage,`${Je}error_alreadyExists`,n.type,"action")),De!=null&&De.message.includes("429")?Re=Tt(m.formatMessage,`${Je}error_tooMany`,n.type,"action"):De!=null&&De.message.includes("400")&&(Re=`${Je}error`),F(Re),ie()}},ie=()=>{pa=setTimeout(()=>{F(!1),R(!1),b("")},5e3)},fe=!L.title||!ru(L.title),X=!L.body||!ru(L.body);let ve=X;T&&(ve=fe&&X);const pe=$==="submitting",_e=[{component:nE,props:{formID:re,intlPath:Je,showLabel:T!==!1,type:n.type}},{component:dh,props:{id:`${re}-input`,value:$==="submitting"&&!k?"":L.body,placeholder:i||Tt(m.formatMessage,`${Je}placeholder`,n.type,"action"),maxLength:s,meta:{isInOverlay:A},functions:{onChange:U,onMention:H,listMembers:G,clickMentionFallback:ae},data:h,autoFocus:x!==!1||_&&!T,"aria-invalid":!!k,"aria-errormessage":"error-message"}},{component:tE,props:{intlPath:Je,showGuidelines:M,type:n.type,gtmContext:p}}];q&&_e.push({component:Wt}),T&&_e.unshift({id:"title",type:"text",value:T.text,limit:250,autoFocus:_,label:m.formatMessage({id:`${Je}titleField_label`}),placeholder:m.formatMessage({id:`${Je}titleField_placeholder`}),functions:{onChange:Be=>{J({...L,title:Be}),B({title:Be})}},validation:[{condition:()=>ve,error:m.formatMessage({id:`${Je}titleField_error`})}]});let Fe=!g||!g.id||!r||ve||pe;return x&&(T?Fe=Fe||L.body===x.text&&L.title===T.text:Fe=Fe||L.body===x.text),c.jsxs(c.Fragment,{children:[c.jsxs(en,{id:re,className:Y("discussion-card discussion-form",{"no-styling":w&&x}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:x&&!pe||l.cancel},functions:{onSuccess:async()=>{if(x){R("submitting"),j(L);return}await ee()},onCancel:N},fields:_e,intlPath:Je,button:{variant:"primary",size:{mobile:"small",600:"medium"},className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`${x?"save":"submit"}-${n.type}-click`,"data-testid":"save-button",disabled:Fe,text:{default:!x&&(o!=null&&o.submit)?o==null?void 0:o.submit:m.formatMessage({id:`${Je}${x?"save":"post"}`}),submitting:m.formatMessage({id:`${Je}${x?"saving":"posting"}`})}},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`cancel-${n.type}-click`,disabled:!l.cancel&&(!g||!g.id||!L.body),text:o!=null&&o.cancel?o==null?void 0:o.cancel:m.formatMessage({id:`${Je}cancel`})},gtm:{context:p,event:`${n.type}-form`},"data-testid":`discussion-${n.type}-form`,children:[z&&!x&&["question"].includes(n.type)&&c.jsx("h2",{children:Tt(m.formatMessage,`${Je}title`,n.type,"action")}),c.jsx(Qt,{member:g?{...g,link:!1}:"community",gtmContext:p,gtmType:"profile-click",badges:{showBadges:!0,scopes:[{scope:ct.COMMUNITIES,area:t||""},{scope:ct.PLATFORM,area:"all"}]}})]}),$==="submitted"&&I&&c.jsx(Or,{className:"success","data-testid":"success",children:Tt(m.formatMessage,`${Je}success`,n.type,"action")}),k&&c.jsx(Or,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof k=="string"?k.includes(" ")?k:m.formatMessage({id:k},{action:m.formatMessage({id:`discussion_action_${n.type}`}),maxLength:s}):k}),f&&c.jsx(Ne,{"aria-live":"polite",showOnFocus:!1,children:f})]})},rE=Object.freeze(Object.defineProperty({__proto__:null,default:Kr},Symbol.toStringTag,{value:"Module"})),aE=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),iE=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);const Va=({icon:e,className:t="",...n})=>c.jsx(Ee,{className:Y("discussion-button",t),variant:"tertiary",icon:e,...n});let Tr=!1;const os=()=>{Tr!==!1&&(clearTimeout(Tr),Tr=!1)},us=5;let ls=null;const Ch=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:a=!1,content:i={type:"reply",slugs:{}},canLike:s=!0,functions:{createLike:o=()=>{},deleteLike:l=()=>{}}={}})=>{const u=se.useIntl(),d={numberOfLikes:t,userLikedContent:a,ignoreInteractions:!1,showLikers:!1,tabbableLink:0},[h,p]=y.useReducer(Wr,d),{numberOfLikes:m,userLikedContent:g,ignoreInteractions:f,showLikers:b,tabbableLink:v}=h;y.useEffect(()=>{p([{type:"userLikedContent",value:a}])},[a]);const w=y.useMemo(()=>iE(n,us),[n]),A=S=>{if(S.preventDefault(),S.stopPropagation(),p([{type:"showLikers",value:!1}]),Tr)return os(),!1;if(os(),f||!s)return!1;Tr=setTimeout(_,350)},_=async()=>{if(os(),f||!s)return!1;let S=g?m-1:m+1;S<0&&(S=0),p([{type:"ignoreInteractions",value:!0},{type:"numberOfLikes",value:S},{type:"userLikedContent",value:!g}]);try{if(i&&i.slugs){const z=aE(i.slugs);g?await l(z):await o({...z,payload:{contentPath:window.location.pathname}})}}catch{p([{type:"numberOfLikes",value:t},{type:"userLikedContent",value:a}])}finally{p([{type:"ignoreInteractions",value:!1}])}},x=()=>{ls=setTimeout(()=>{p([{type:"showLikers",value:!1}])},500)},T=()=>{ls&&clearTimeout(ls)};return y.createElement(e,{className:"likes-wrapper",onKeyDown:S=>{S.key==="Escape"&&p([{type:"showLikers",value:!1}])},onMouseEnter:()=>{T(),p([{type:"showLikers",value:!0}])},onMouseLeave:()=>{x()}},c.jsxs(c.Fragment,{children:[c.jsx(Va,{className:Y("discussion-button text-medium action-button",{"show-spinner":f,"is-liked":g,disabled:!s}),icon:{icon:g?"heart":"heart_empty",animate:"bounce"},disabled:!s,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${i.type}-click`,onClick:A,screenreaderText:s?u.formatMessage({id:`discussion_likes_${g?"unlike":"like"}`},{action:u.formatMessage({id:`discussion_action_${i.type}`})}):!1,"aria-pressed":g,children:c.jsx("span",{"data-testid":"number-of-likes",className:"number-of-likes",children:u.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:m})})}),n&&c.jsxs(c.Fragment,{children:[c.jsx(Ne,{"data-testid":"like-a11y-button",element:"button",className:"tertiary small icon navigation_arrow",onFocus:()=>{T()},onBlur:()=>x,onClick:S=>{var M;S.preventDefault(),S.stopPropagation(),T(),p([{type:"showLikers",value:!0}]);const z=(M=S.currentTarget.nextSibling)==null?void 0:M.childNodes[0];if(z){const q=z.querySelector("li:first-child a");q&&(p([{type:"tabbableLink",value:0}]),setTimeout(()=>{q.focus()},100))}},onKeyDown:S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),x())},"aria-expanded":b,"aria-controls":`likes-tooltip-${i.slug}`,children:c.jsx(Ne,{showOnFocus:!1,children:u.formatMessage({id:"discussion_likes_show"},{action:i.type})})}),c.jsx(Nn,{id:`likes-tooltip-${i.slug}`,isOpen:b,isLoading:n.length===0,children:n.length&&c.jsxs("ul",{children:[w.map((S,z)=>{if(typeof S=="string")return null;const M={};return v!==z&&(M.tabIndex=-1),c.jsx("li",{"data-index":z,children:c.jsx(fn,{href:S.id?`/profiles/${S.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onClick:q=>q==null?void 0:q.stopPropagation(),onFocus:()=>T(),onKeyDown:q=>{var N,W,H,G;if(!q||!["ArrowUp","ArrowDown"].includes(q.key||""))return;q.stopPropagation(),q.preventDefault();const I=q.key==="ArrowUp"?"up":"down",B=(N=q.currentTarget)==null?void 0:N.parentElement;let E=B==null?void 0:B.nextElementSibling;if(I==="up"){const ae=B==null?void 0:B.previousElementSibling;ae?E=ae:(E=(W=B==null?void 0:B.parentElement)==null?void 0:W.lastElementChild,(E==null?void 0:E.getAttribute("data-index"))==="-1"&&(E=E==null?void 0:E.previousElementSibling))}else(!E||(E==null?void 0:E.getAttribute("data-index"))==="-1")&&(E=(H=B==null?void 0:B.parentElement)==null?void 0:H.firstElementChild);if(!E)return;const j=(E==null?void 0:E.getAttribute("data-index"))||"0";p([{type:"tabbableLink",value:j}]),(G=E==null?void 0:E.querySelector("a"))==null||G.focus()},...M,children:S.name?S.name:c.jsx("span",{className:"deleted-user",children:u.formatMessage({id:"member_deleted"})})})},S.id||window.btoa(S.name||""))}),t>us&&c.jsx("li",{"data-index":"-1",children:u.formatMessage({id:"discussion_likes_more"},{number:t-us})})]})})]})]}))},cs=({children:e,class:t,...n})=>{const r={...n,class:Y("subtle",t)};return c.jsx("blockquote",{...r,children:e})},sE=280,zo=async(e,t,n,r=()=>Promise.resolve([]))=>{let a=t?er(e,typeof t=="number"?t:sE):e;a=a.trim();const i=`<br>
|
|
164
164
|
|
|
165
165
|
`;return a.slice(0,i.length)===i&&(a=a.slice(i.length)),n?await Xc({text:a,template:"[@{{name}}](/profiles/{{id}})",mentions:n,listMembers:r}):a};const oE=3e3,uE=({url:e,gtm:t={context:"ShareLink",event:"copy-link-click"}})=>{const n=se.useIntl(),r="discussion_share_copy_link",[a,i]=y.useState({isOpen:!1,isCopied:!1});return c.jsxs("li",{className:"share-link-wrapper",children:[c.jsx(Va,{className:"gtm-trackable",icon:{icon:"link_chain"},onMouseOver:()=>i({...a,isOpen:!0}),onFocus:()=>i({...a,isOpen:!0}),onMouseOut:()=>i({isOpen:!1,isCopied:!1}),onBlur:()=>i({isOpen:!1,isCopied:!1}),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{i({isOpen:!0,isCopied:!0});const s=new CustomEvent("ariaLive",{detail:{message:n.formatMessage({id:`${r}_success`})}});document.dispatchEvent(s),setTimeout(()=>{i({isOpen:!1,isCopied:!1})},oE)})},"data-gtm-event-context":t.context,"data-gtm-event-type":t.event,screenreaderText:n.formatMessage({id:r})}),c.jsx(Nn,{className:Y({copied:a.isCopied}),isOpen:a.isOpen,styling:{hasPointer:"bottom",extraPadding:!1},children:n.formatMessage({id:`${r}${a.isCopied?"_success":""}`})})]})},Nt="discussion_",lE=195;let ga=null;const Zr=({element:e="div",content:t,userHasPermissions:n=!0,userHasOwnerPermissions:r=!1,isLoading:a=!1,originalAuthorId:i,forceHide:s={actionBar:!1,comments:!1,likes:!1},functions:o,links:l={},className:u,gtmContext:d="DiscussionAnswer",children:h,isTruncated:p=!1,styling:{showShareLinkButton:m=!1}={},setFocus:g=!1,isCommunity:f=!1,badges:b})=>{var Ve,We,Be,Se,De,Re,ze,Z;const v=se.useIntl(),w=y.useContext(gt),A=y.useContext(ci),{createContent:_=async()=>{},deleteContent:x=async()=>{},updateContent:T=async()=>{}}=o.content||{},{createLike:S=()=>{},deleteLike:z=()=>{}}=o.likes||{},{openComments:M=()=>{}}=o.comments||{},{listMembers:q=()=>Promise.resolve([]),clickMentionFallback:I=()=>{}}=o.mentions||{},{author:B,canLike:E,createdAt:j,id:N,likes:W=0,userLiked:H,comments:G=0,mentions:ae}=t,C=w&&w.id&&typeof B!="string"&&B.id&&B.id===w.id||!1,L=typeof E=="boolean"?E:!0,J=C&&(!t.createdAt||am(t.createdAt,10,"seconds")),k=y.useRef(null),[F,$]=y.useState({title:t&&t.body!==t.title&&t.title||"",body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:""}),[R,U]=y.useState(!1),[re,ee]=y.useState(J?"highlighted":"default"),[ie,fe]=y.useState("");y.useEffect(()=>{const te=k.current;if(!(!te||re==="default"))return document.addEventListener(Xe.DISCUSSION_FORM_SUBMITTED,X),te.addEventListener("transitionend",ve),()=>{document.removeEventListener(Xe.DISCUSSION_FORM_SUBMITTED,X),te.removeEventListener("transitionend",ve)}},[]),y.useEffect(()=>{$({...F,title:t&&t.title||"",body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),y.useEffect(()=>{(async()=>{const le=await zo(F.body,p,ae,q);$({...F,postBody:le})})()},[F.body,ae]);const X=()=>{setTimeout(()=>{ee("fading")},1e3)},ve=({propertyName:te})=>{te==="background-color"&&ee(le=>(le==="default"&&(document.removeEventListener(Xe.DISCUSSION_FORM_SUBMITTED,X),k.current&&k.current.removeEventListener("transitionend",ve)),le==="fading"?"default":le))};if(a||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question)||F.postBody===""&&t.title==="")return c.jsx(Bt,{className:"discussion-card"});const pe=async({title:te,body:le})=>{te||(te=""),le||(le=""),fe("");try{if(!ps(te,F.title)||!ps(le,F.body)){const me=t.type==="question"?{title:le}:{title:te,body:le};await T(Bc(t.slugs),me)}$({...F,title:te,body:le,isEditing:!1,didEdit:!0})}catch{fe(`${Nt}form_error`)}},_e=()=>{if(A&&A.updateConversation){const te={showForm:!0},le=t.author;le&&le.id&&(f&&(te.prepopulateForm=`@{{${le.id}}}`),te.mentionData={id:le.id,name:le.name}),A.updateConversation(te)}setTimeout(()=>{var Ze,Ye,rt;const le=`reply-form-${(t.type==="answer"?t.slug:((Ze=t.slugs)==null?void 0:Ze.reply)||((Ye=t.slugs)==null?void 0:Ye.answer)||((rt=t.slugs)==null?void 0:rt.question)||"").toLowerCase().slice(-15)}`,me=document.getElementById(le),xe=document.getElementById(`${le}-input`);xe&&xe.focus(),me&&me.scrollIntoView({behavior:"smooth"})},0)},Fe=async()=>{U(!1);try{await x(Bc(t.slugs))}catch{fe("delete-error")}},Te=[{text:v.formatMessage({id:`${Nt}moreMenu_report`}),onClick:te=>{te.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(v.formatMessage({id:`${Nt}report_subject`}))}&body=${encodeURI(v.formatMessage({id:`${Nt}report_body`},{contentType:t.type||"",contentSlug:t.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}))}`,icon:"flag"}];return n&&C&&Te.push({text:v.formatMessage({id:`${Nt}moreMenu_edit`}),onClick:()=>$({...F,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`edit-${t.type}-click`},{text:v.formatMessage({id:`${Nt}moreMenu_delete`}),onClick:te=>{te.preventDefault(),te.stopPropagation(),U(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":d,"data-gtm-event-type":`delete-${t.type}-click`,...Td(`delete-${t.slug}-modal`,R)}),r&&o.pins&&Te.push({text:v.formatMessage({id:`${Nt}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`}),g&&((Ve=k==null?void 0:k.current)==null||Ve.focus(),(We=k==null?void 0:k.current)==null||We.scrollIntoView({behavior:"smooth"})),y.createElement(e,{className:Y("discussion-post",u,{[re]:!u||!u.includes("highlighted-text-box"),"has-link":l.post&&!F.isEditing,"is-pinned":(t==null?void 0:t.pinned)||!1}),ref:k,tabIndex:g?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${d}-post-click`,onClick:te=>{if(!l.post||F.isEditing)return;te.preventDefault(),te.stopPropagation(),ga&&clearTimeout(ga),ga=setTimeout(()=>{window.location.href=l.post},150);const le=new CustomEvent(Xe.DISCUSSION_POST_CLICKED,{detail:{link:l.post,timeout:ga}});document.dispatchEvent(le)},children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{id:N||t.slug,className:Y("discussion-card",t.type,{editing:F.isEditing,"has-link":l.post&&!F.isEditing}),children:[!F.isEditing&&c.jsxs("div",{className:"author-section",children:[c.jsx(Qt,{member:B,additionalContent:{createdAt:j,didEdit:F.didEdit},className:typeof B!="string"&&B.id===i?"highlighted":"",gtmContext:d,gtmType:"profile-click",badges:b}),t.pinned&&c.jsx(Gt,{variant:"naked",size:"xlarge",icon:"pin",children:c.jsx(Ne,{children:"Pinned Post"})})]}),F.isEditing?c.jsx(Kr,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:a,isInWrapper:!0,hasTitleField:F.title!==""?{text:F.title}:!1,isEditing:{text:F.body},isPrepopulated:!1},isCommunity:f,maxLength:t.type==="question"?250:5e4,forceShow:{error:ie!==""&&ie!=="delete-error"?v.formatMessage({id:ie},{action:v.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:_,handleSaveEdit:pe,handleCancel:()=>{fe(""),$({...F,isEditing:!1})},listMembers:q,clickMentionFallback:I},gtmContext:`${d}Form`,data:{mentions:t.mentions}}):l.post?c.jsxs("a",{href:l.post,children:[(F==null?void 0:F.title)&&c.jsx("p",{className:"content-title",children:F==null?void 0:F.title}),F.postBody.length>lE?c.jsx(sd,{text:F.postBody,markdownOptions:{overrides:{a:Cs,blockquote:{component:cs}}}}):c.jsx(Bn,{options:{overrides:{a:Cs,blockquote:{component:cs}}},children:F.postBody})]}):c.jsxs(c.Fragment,{children:[(F==null?void 0:F.title)&&c.jsx("p",{className:"content-title",children:F==null?void 0:F.title}),c.jsx(Bn,{options:{wrapper:t.type==="question"?"h1":y.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question",overrides:{blockquote:{component:cs}}},children:F.postBody})]}),!F.isEditing&&!(s!=null&&s.actionBar)&&c.jsxs("ul",{className:Y("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[!s.likes&&c.jsx(Ch,{element:"li",likes:W,isShort:!1,userLiked:H,content:{type:t.type,slugs:t.slugs,slug:t.slug},canLike:L,peopleWhoLiked:t.peopleWhoLiked,functions:{createLike:S,deleteLike:z}}),!s.comments&&(["question","post"].includes(t.type)||l.comments)&&c.jsx("li",{children:c.jsx(Va,{onClick:te=>{te.preventDefault(),te.stopPropagation(),l.comments&&(window.location.href=l.comments),typeof M=="function"&&M()},icon:{icon:"speech-bubble_square"},"data-gtm-event-context":d,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:v.formatMessage({id:`${Nt}comments_screenReader`},{count:G}),children:v.formatMessage({id:`${Nt}comments`},{count:G})})}),(t.type==="answer"||t.type==="reply")&&c.jsx("li",{children:c.jsx(Va,{styling:{muted:!0},onClick:_e,icon:{icon:"speech-bubble_square"},children:v.formatMessage({id:`${Nt}reply`})})}),m&&c.jsx(uE,{url:(Be=t.slugs)!=null&&Be.reply?`${window.location.origin}${(Se=t.slugs)==null?void 0:Se.question}/${(De=t.slugs)==null?void 0:De.answer}#${(Re=t.slugs)==null?void 0:Re.reply}`:`${window.location.origin}${(ze=t.slugs)==null?void 0:ze.question}/${(Z=t.slugs)==null?void 0:Z.answer}`,gtm:{context:d,event:`copy-link-${t.type}-click`}}),c.jsx(Sd,{element:"li",id:`more-${t.slug}`,options:Te})]})]}),h,c.jsx(pn,{id:`delete-${t.slug}-modal`,isOpen:R,functions:{onOpen:()=>{},onClose:()=>U(!1)},forceShow:{error:ie==="delete-error"?v.formatMessage({id:"discussion_delete_error"},{action:v.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:v.formatMessage({id:"discussion_delete_title"},{action:v.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>U(!1),children:v.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:Fe,children:v.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:c.jsx(se.FormattedMessage,{id:"discussion_delete_text",values:{p:te=>c.jsx("p",{children:te}),action:v.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const cE=y.lazy(()=>Promise.resolve().then(()=>n_)),dE=65,xh=({forceShow:e,form:t,className:n})=>{const r=se.useIntl(),a="discussionFormCard_",i="DiscardDraftModal",o=y.useContext(gt)||"community",l=ti(o);l.name||(l.name=r.formatMessage({id:`member_${typeof o=="string"?o:"community"}`}));const{modal:u=!1}=e||{},[d,h]=y.useState({form:u||td("showPost")==="true"||!1,warning:!1}),[p,m]=y.useState({showCachedText:!1});y.useEffect(()=>{if(!p.showCachedText)return;(async()=>{const v=await zo(p.title||p.body||"",dE,p.mentions);m(w=>({...w,prettifiedText:v}))})()},[p.showCachedText,p.title,p.body]);const g=b=>{if(!p.showCachedText||typeof d.warning=="string")return;let v;if("detail"in b&&b.detail.link)b.detail.timeout&&clearTimeout(b.detail.timeout),v=b.detail.link;else{const w=b;w.preventDefault(),w.stopPropagation();const _=w.target.closest("a");v=_&&_.getAttribute("href")}h(w=>({...w,warning:v||!1}))};y.useEffect(()=>{if(!p.showCachedText){document.removeEventListener(Xe.DISCUSSION_POST_CLICKED,g),document.removeEventListener(Xe.MEMBER_CLICKED,g),document.removeEventListener("click",g);return}return document.addEventListener(Xe.DISCUSSION_POST_CLICKED,g),document.addEventListener(Xe.MEMBER_CLICKED,g),document.addEventListener("click",g),()=>{document.removeEventListener(Xe.DISCUSSION_POST_CLICKED,g),document.removeEventListener(Xe.MEMBER_CLICKED,g),document.removeEventListener("click",g)}},[p.showCachedText]),y.useEffect(()=>{const b=v=>{if(!(!p.showCachedText||d.warning!==!1))return v.preventDefault(),v.returnValue=""};return window.addEventListener("beforeunload",b,{capture:!0}),()=>{window.removeEventListener("beforeunload",b,{capture:!0})}},[p.showCachedText,d.warning]);let f=r.formatMessage({id:`${a}placeholder`});return p.showCachedText&&(p.title||p.body)&&(f=p.prettifiedText||f),c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:Y("discussion-form-card",n),onClick:b=>{b.preventDefault(),b.stopPropagation(),h(v=>({...v,form:!0}))},"data-testid":"discussion-form-card",children:[c.jsx(mn,{name:l.name,src:l.image,alt:""}),c.jsx(Bn,{className:Y("input",{placeholder:!p.showCachedText}),element:"span",options:{forceInline:!0,overrides:{a:Et,blockquote:Et,br:Et,em:Et,li:Et,ol:Et,p:Et,s:Et,span:Et,strong:Et,ul:Et}},children:f})]}),c.jsxs(Ur,{children:[c.jsx(cE,{showModal:d.form,functions:{cacheText:m,onClose:()=>{h(b=>({...b,form:!1}))}},form:t,cachedText:p,className:"in-portal"}),c.jsx(pn,{id:t.id?`${t.id}-warning`:"discussion-form-card-warning",className:"in-portal",isOpen:d.warning!==!1,functions:{onClose:()=>{h(b=>({...b,warning:!1}))}},title:r.formatMessage({id:`${a}overlay_title`}),buttons:[{variant:"secondary",children:r.formatMessage({id:`${a}overlay_cta_discard`}),onClick:b=>{b.preventDefault(),b.stopPropagation(),typeof d.warning=="string"&&(window.location.href=d.warning)},"data-gtm-event-type":"discard-click","data-gtm-event-context":i},{variant:"primary",children:r.formatMessage({id:`${a}overlay_cta_continue`}),onClick:()=>{h({form:!0,warning:!1})},"data-gtm-event-type":"continue-editing-click","data-gtm-event-context":i}],children:c.jsx("p",{children:r.formatMessage({id:`${a}overlay_text`})})})]})]})},fE=y.lazy(()=>Promise.resolve().then(()=>rE)),qo=({isCard:e=!1,form:t,parentId:n,membershipRequiredToPost:{isMember:r,required:a,join:i,leave:s,notMemberStateText:o}})=>{if(a&&!r)return c.jsx(hn,{text:o,button:{breakpoints:{mobile:!0,901:!1},component:c.jsx(lo,{isShort:!0,functions:{join:i,leave:s}})}});const{content:l,functions:u,meta:d,...h}=t,p={content:{type:(l==null?void 0:l.type)||"reply",slugs:(l==null?void 0:l.slugs)||{}},functions:{...u,create:(u==null?void 0:u.create)||(()=>{})},parentId:n,meta:{...d,isEditing:(d==null?void 0:d.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1},...h,id:`add-post-${h.id||""}`};return e?c.jsx(xh,{form:p}):c.jsx(fE,{...p})},Wo=({form:e})=>{const t=y.useContext(gt),n=se.useIntl(),[r,a]=y.useState(!1),i=()=>{hm(t)||a(!0)};y.useEffect(()=>(document.addEventListener(Xe.DISCUSSION_POST_ADDED,i),()=>{document.removeEventListener(Xe.DISCUSSION_POST_ADDED,i)}));const s={};return["successMessage","title","text"].forEach(o=>{s[o]=n.formatMessage({id:`profileModalLauncher_${o}`})}),c.jsx(fi,{form:e,showModal:r,functions:{onClose:()=>{a(!1)}},content:s})};const ds="discussion_responses_",wh=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=se.useIntl();return t=parseInt(t),c.jsxs("div",{className:"responses-heading",children:[c.jsx("h4",{children:r.formatMessage({id:`${ds}title`},{action:r.formatMessage({id:`${ds}${e}`}),count:t})}),!n&&t===0&&c.jsx("p",{children:Tt(r.formatMessage,`${ds}empty`,e,e)})]})};const Eh=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:a})=>{const i=se.useIntl(),s=y.useContext(ci),o=Da(a,{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:Y("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&c.jsx("ul",{className:"thread",children:o}),!e&&c.jsx(Hr,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:i.formatMessage({id:"discussion_thread_loadMore"}),error:i.formatMessage({id:"loadMore_error"})}}),r&&s.showForm&&c.jsx(Kr,{...r})]})},hE="post",mE="reply",_h="00000000-0000-0000-0000-000000000000";function Uo({queryClient:e,queryKey:t}){function n(r,a,i){e.setQueryData(t,i)}return n}function Ho({queryClient:e,queryKey:t}){async function n(r){await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);return e.setQueryData(t,r),a}return n}function pE(){return{latest_reactions:{like:[],reply:[]},reaction_counts:{like:0,reply:0},own_reactions:{like:[],reply:[]}}}function gE(){return{latest_children:{like:[],reply:[]},children_counts:{like:0,reply:0},own_children:{like:[],reply:[]}}}function kh(e){const{id:t="",name:n="",organization:r="",jobTitle:a="",image:i={}}=e,{thumbnail:s=""}=i;return{id:t,data:{name:n,organization:r,jobTitle:a,thumbnail:s}}}function vE({title:e,content:t}){return{title:e,content:t,id:_h,time:new Date().toISOString(),verb:hE}}function Ac({activity:e,user:t}){return{...e,actor:kh(t),...pE()}}function Ka({activity:e,reaction:t}){var n,r,a;t?(e.latest_reactions={...e.latest_reactions||{},like:[...((r=e.latest_reactions)==null?void 0:r.like)||[],t]},e.own_reactions={...e.own_reactions||{},like:[...((a=e.own_reactions)==null?void 0:a.like)||[],t]}):e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like+1:1}}function Fh({activity:e,user:t}){var n,r,a;e.reaction_counts={...e.reaction_counts||{},like:(n=e.reaction_counts)!=null&&n.like?e.reaction_counts.like-1:0},t!=null&&t.id&&(e.latest_reactions={...e.latest_reactions||{},like:(((r=e.latest_reactions)==null?void 0:r.like)||[]).filter(({user_id:i})=>i!==t.id)},e.own_reactions={...e.own_reactions||{},like:(((a=e.own_reactions)==null?void 0:a.like)||[]).filter(({user_id:i})=>i!==t.id)})}function Za({activity:e,reaction:t}){var n,r,a;t?(e.latest_reactions={...e.latest_reactions||{},pin:[...((r=e.latest_reactions)==null?void 0:r.pin)||[],t]},e.own_reactions={...e.own_reactions||{},pin:[...((a=e.own_reactions)==null?void 0:a.pin)||[],t]}):e.reaction_counts={...e.reaction_counts||{},pin:(n=e.reaction_counts)!=null&&n.pin?e.reaction_counts.pin+1:1}}function Bh({activity:e}){var t;e.reaction_counts={...e.reaction_counts||{},pin:(t=e.reaction_counts)!=null&&t.pin?e.reaction_counts.pin-1:0},e.latest_reactions={...e.latest_reactions||{},pin:[]},e.own_reactions={...e.own_reactions||{},pin:[]}}function bE({activityId:e,replyId:t,content:n}){return{activity_id:e,data:{content:n},id:_h,kind:mE,parent:t||""}}function Tc({reply:e,user:t}){const n=kh(t);return{...e,user_id:n.id,user:n,...gE()}}function Sc({reply:e,reaction:t}){var n,r,a;t?(e.latest_children={...e.latest_children||{},like:[...((r=e.latest_children)==null?void 0:r.like)||[],t]},e.own_children={...e.own_children||{},like:[...((a=e.own_children)==null?void 0:a.like)||[],t]}):e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like+1:1}}function yE({reply:e,user:t}){var n,r,a;e.children_counts={...e.children_counts||{},like:(n=e.children_counts)!=null&&n.like?e.children_counts.like-1:0},t!=null&&t.id&&(e.latest_children={...e.latest_children||{},like:(((r=e.latest_children)==null?void 0:r.like)||[]).filter(({user_id:i})=>i!==t.id)},e.own_children={...e.own_children||{},like:(((a=e.own_children)==null?void 0:a.like)||[]).filter(({user_id:i})=>i!==t.id)})}const Ah=(e,t)=>{const n=new CustomEvent(Xe.DISCUSSION_POST_ADDED,{detail:{id:e,type:t}});document.dispatchEvent(n)};let jc,fs=0;const Th=()=>{y.useEffect(()=>(document.addEventListener(Xe.DISCUSSION_POST_ADDED,e),()=>{document.removeEventListener(Xe.DISCUSSION_POST_ADDED,e)}),[]);const e=t=>{const{id:n,type:r}=t.detail;if(!n||!r||r==="activity")return;clearTimeout(jc);const a=document.getElementById(n);if(a){a.scrollIntoView({behavior:"smooth",block:"start"}),fs=0;return}fs++,!(fs>10)&&(jc=setTimeout(()=>{e(t)},50))}},ir=Object.freeze({id:"some-user-id-1",name:"some user name 1",organization:"some user organization 1",jobTitle:"some user job title 1",image:{thumbnail:"https://some-user-thumbnail.com/avatar1.png"},isLoading:!1}),Ut=Object.freeze({id:"some-user-id-2",name:"some user name 2",organization:"some user organization 2",jobTitle:"some user job title 2",image:{thumbnail:"https://some-user-thumbnail.com/avatar2.png"},isLoading:!1}),Vo=Object.freeze({actor:`SU:${ir.id}`,content:"some content 1",duration:"5.53ms",feed_id:"some-feed-id-1",foreign_id:"post:some-foriegn-id-1",id:"some-activity-id-1",object:"comment",time:"2023-11-24T17:52:36.162000",verb:"post"}),DE=Object.freeze({actor:`SU:${Ut.id}`,content:"some content 2",duration:"5.53ms",feed_id:"some-feed-id-2",foreign_id:"post:some-foriegn-id-2",id:"some-activity-id-2",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"}),CE=Object.freeze({actor:`SU:${ir.id}`,content:"some content 3",duration:"5.53ms",feed_id:"some-feed-id-3",foreign_id:"post:some-foriegn-id-3",id:"some-activity-id-3",object:"comment",time:"2023-11-24T17:56:36.162000",verb:"post"}),xE=Object.freeze({actor:`SU:${Ut.id}`,content:"some content 4",duration:"5.53ms",feed_id:"some-feed-id-4",foreign_id:"post:some-foriegn-id-4",id:"some-activity-id-4",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"});Object.freeze({id:"some-reaction-id-1",activity_id:Vo.id,kind:"like",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:Ut.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:Ut.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({id:"some-reaction-id-1",activity_id:Vo.id,kind:"pin",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:Ut.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:Ut.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-1",user_id:Ut.id,user:{id:Ut.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Vo.id,data:{content:"Some content 1..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-2",user_id:ir.id,user:{id:ir.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:DE.id,data:{content:"Some content 2..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:Ut.id,user:{id:Ut.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:CE.id,data:{content:"Some content 3..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:ir.id,user:{id:ir.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:xE.id,data:{content:"Some content 4..."},parent:"",latest_children:{},children_counts:{}});function wE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=qe.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Ac({activity:vE(o),user:i});return Oc(u,l)}),onError:n,onSuccess:(o,l,u)=>{const d=Ac({activity:o,user:i});r.setQueryData(a,Oc(d,u,!0)),setTimeout(()=>{Ah(d.id,"activity")},0)}});return s}function EE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=qe.useMutation({mutationFn:e,onMutate:({activityId:a,content:i})=>t(s=>{const o=On(a,s);return o&&(o.content=i),s}),onError:n});return r}function _E({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i,pin:s,unpin:o},queryKey:l,rankingMethod:u}){const d=qe.useQueryClient(),h=ei(),p={queryClient:d,queryKey:l},m={mutationHandlers:{error:Uo(p),mutate:Ho(p)},user:h,...p},g=wE({...m,mutationFn:e}),f=EE({...m,mutationFn:t}),b=kE({...m,mutationFn:n}),v=AE({...m,mutationFn:a}),w=TE({...m,mutationFn:i}),A=BE({...m,mutationFn:s}),_=SE({...m,mutationFn:o}),{activities:x,...T}=FE({queryKey:l,queryFn:r,rankingMethod:u});return{activities:x,mutations:{create:g,edit:f,remove:v,like:b,unlike:w,pin:A,unpin:_},user:h,...T}}function kE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=qe.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=On(s,o);return l&&Ka({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=On(o,l);u&&Ka({activity:u,reaction:s}),r.setQueryData(a,l)}});return i}function FE({queryFn:e,queryKey:t,rankingMethod:n}){const{data:r,error:a,isLoading:i,hasNextPage:s,fetchNextPage:o}=qe.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:`ranking=${n}`,getNextPageParam:l=>l!=null&&l.next?`${l==null?void 0:l.next}&ranking=${n}`:null});return{activities:OE(r),error:a,isLoading:i,hasNextPage:s,fetchNextPage:o}}function BE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=qe.useMutation({mutationFn:e,onMutate:({activityId:s})=>t(o=>{const l=On(s,o);return l&&Za({activity:l}),o}),onError:n,onSuccess:(s,{activityId:o},l)=>{const u=On(o,l);u&&Za({activity:u,reaction:s}),r.setQueryData(a,l)}});return i}function AE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=qe.useMutation({mutationFn:e,onMutate:({activityId:a})=>t(i=>jE(a,i)),onError:n});return r}function TE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=qe.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(s=>{const o=On(i,s);return o&&Fh({activity:o,user:r}),s}),onError:n});return a}function SE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=qe.useMutation({mutationFn:e,onMutate:({activityId:i})=>t(s=>{const o=On(i,s);return o&&Bh({activity:o,user:r}),s}),onError:n});return a}function Oc(e,t,n=!1){return t?(n?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t):{pages:[{next:"",results:[e]}],pageParams:[""]}}function On(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function jE(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:a})=>a===e);if(r!==-1){n.splice(r,1);break}}return t}function OE(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,{results:r})=>[...n,...r],[]))||[]}const PE=({basePath:e,parentId:t,isMember:n,isOwner:r,functions:{activities:a,mentions:i,join:s,leave:o},profile:l})=>{const u=$m(no.COMMUNITY_RANKING),d=se.useIntl(),[h,p]=y.useState("community_feed_live"),[m,g]=y.useState([{id:"recent_with_pin",label:"recent"},{id:"community_feed_live",label:"popular"}]),{activities:f,error:b,fetchNextPage:v,hasNextPage:w,isLoading:A,mutations:{create:_,edit:x,remove:T,like:S,unlike:z,pin:M,unpin:q}}=_E({queryKey:[e,t,"activities",h],queryFns:a,rankingMethod:h});y.useEffect(()=>{u&&g(m.concat(u))},[u]);const[I,B]=y.useState(null),E=()=>{B(f.length),v()};return Th(),b?c.jsx(hn,{variant:"error",text:b.message}):c.jsxs("section",{children:[c.jsx(qo,{isCard:!0,parentId:t,form:{content:{type:"post",slugs:{}},functions:{create:_,...i},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:s,leave:o,notMemberStateText:d.formatMessage({id:"community_joinToPost"})}}),c.jsx(en,{className:"activities-feed-sorting-form",fields:[{id:"feed-sorting",label:d.formatMessage({id:"activitiesFeed_sorting_label"}),type:"select",options:m.map(({id:j,label:N})=>({id:j,label:d.formatMessage({id:`activitiesFeed_rankingMethod_${N}`})})),initialValue:h,functions:{onChange:j=>{p(j);const N=m.find(H=>H.id===j);if(!N)return;const W=new CustomEvent("ariaLive",{detail:{message:d.formatMessage({id:"community_sortSuccess"},{order:d.formatMessage({id:`activitiesFeed_rankingMethod_${N.label}`})})}});document.dispatchEvent(W)}},gtm:{context:"Community Sorting",event:"community-sorting-click"}}],button:{hideButton:!0},functions:{onCatch:()=>{},onFailure:()=>{},onSuccess:async()=>{},onCancel:()=>{}},id:"activities-feed-sorting-form"}),f==null?void 0:f.map((j,N)=>{var $,R,U;const{id:W,own_reactions:H,latest_reactions:G,reaction_counts:ae,mentioned_users:C}=j,L=((($=G==null?void 0:G.like)==null?void 0:$.length)||0)>0,J=(((R=H==null?void 0:H.like)==null?void 0:R.length)||0)>0,k=J?H==null?void 0:H.like[0].id:"",F=L?(U=G==null?void 0:G.like)==null?void 0:U.map(re=>{var ee,ie,fe;return{id:(ee=re==null?void 0:re.user)==null?void 0:ee.id,name:(fe=(ie=re==null?void 0:re.user)==null?void 0:ie.data)==null?void 0:fe.name}}):!1;return c.jsx(y.Fragment,{children:c.jsx(Zr,{content:{type:"post",title:j==null?void 0:j.title,body:j==null?void 0:j.content,canLike:n,createdAt:(j==null?void 0:j.time)||"",slugs:{question:`${e}/${t}`,answer:W},slug:W,author:di(j==null?void 0:j.actor),userLiked:J,likes:(ae==null?void 0:ae.like)||0,comments:(ae==null?void 0:ae.reply)||0,peopleWhoLiked:F,mentions:C,pinned:(ae==null?void 0:ae.pin)&&(ae==null?void 0:ae.pin)>0||!1},links:{post:`${e}/${t}/${W}`,comments:`${e}/${t}/${W}`},gtmContext:"community",functions:{content:{createContent:()=>null,deleteContent:()=>T({activityId:W}),updateContent:(re,{body:ee})=>x({activityId:W,content:ee})},likes:{createLike:()=>S({activityId:W}),deleteLike:()=>z({activityId:W,reactionId:k})},comments:{openComments:()=>null},pins:{createPin:()=>M({activityId:W}),deletePin:()=>q({activityId:W,reactionId:G==null?void 0:G.pin[0].id})},mentions:i},isTruncated:!0,styling:{showShareLinkButton:!0},setFocus:N===I,userHasOwnerPermissions:r,badges:{showBadges:!0,scopes:[{scope:ct.COMMUNITIES,area:t||""},{scope:ct.PLATFORM,area:"all"}]}})},W)}),!A&&c.jsx(Hr,{hasNextPage:w,loadNextPage:E,icon:{icon:"arrow-down",position:"right"},messages:{button:d.formatMessage({id:"loadMore_button"}),error:d.formatMessage({id:"loadMore_error"})}}),c.jsx(Wo,{form:l})]})},ME={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester",badges:{communities:{"community-slug":["orange-badge","badge-with-heart"]}}}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 16 (edited)..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 14..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 3..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 2..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 1..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 13..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 12..."},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"};function NE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a,user:i}){const{mutate:s}=qe.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Tc({reply:bE(o),user:i});return Pc(u,l,{replace:!1,append:(o==null?void 0:o.replyId)!==void 0})}),onError:n,onSuccess:(o,l,u)=>{const d=Tc({reply:o,user:i});r.setQueryData(a,Pc(d,u,{replace:!0,append:(l==null?void 0:l.replyId)!==void 0})),setTimeout(()=>{Ah(d.id,"reply")},0)}});return s}function IE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=qe.useMutation({mutationFn:e,onMutate:({replyId:a,content:i})=>t(s=>{const o=Ya(a,s);return o&&(o.data.content=i),s}),onError:n});return r}function Sh({queryFns:{create:e,edit:t,like:n,list:r,remove:a,unlike:i},queryKey:s}){const o=qe.useQueryClient(),l=ei(),u={queryClient:o,queryKey:s},d={mutationHandlers:{error:Uo(u),mutate:Ho(u)},user:l,...u},h=NE({...d,mutationFn:e}),p=IE({...d,mutationFn:t}),m=RE({...d,mutationFn:n}),g=LE({...d,mutationFn:a}),f=zE({...d,mutationFn:i}),{replies:b,...v}=$E({queryKey:s,queryFn:r});return{replies:b,mutations:{create:h,edit:p,remove:g,like:m,unlike:f},user:l,...v}}function RE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=qe.useMutation({mutationFn:e,onMutate:({replyId:s})=>t(o=>{const l=Ya(s,o);return l&&Sc({reply:l}),o}),onError:n,onSuccess:(s,{replyId:o},l)=>{const u=Ya(o,l);u&&Sc({reply:u,reaction:s}),r.setQueryData(a,l)}});return i}function $E({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}=qe.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:u=>(u==null?void 0:u.next)||null}),o=VE(n),l=`${o.length||0}${i?"+":""}`;return{replies:o,repliesCount:l,error:r,isLoading:a,hasNextPage:i,fetchNextPage:s}}function LE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=qe.useMutation({mutationFn:e,onMutate:({replyId:a})=>t(i=>HE(a,i)),onError:n});return r}function zE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=qe.useMutation({mutationFn:e,onMutate:({replyId:i})=>t(s=>{const o=Ya(i,s);return o&&yE({reply:o,user:r}),s}),onError:n});return a}function qE(e){return{pages:[{next:"",results:[e]}],pageParams:[""]}}function WE(e,t,n){const r=t.pages.length-1,a=t.pages[r].results.length-1;return n!=null&&n.replace?t.pages[r].results[a]=e:t.pages[r].results.push(e),t}function UE(e,t,n){return n!=null&&n.replace?t.pages[0].results[0]=e:t.pages[0].results=[e,...t.pages[0].results],t}function Pc(e,t,n){return t?n!=null&&n.append?WE(e,t,n):UE(e,t,n):qE(e)}function Ya(e,t){if(t)for(const{results:n}of t.pages){const r=n.find(({id:a})=>a===e);if(r)return r}}function HE(e,t){for(const{results:n}of t.pages){const r=n.findIndex(({id:a})=>a===e);if(r!==-1){n.splice(r,1);break}}return t}function VE(e){var t;return((t=e==null?void 0:e.pages)==null?void 0:t.reduce((n,r)=>[...n,...r==null?void 0:r.results],[]))||[]}const KE=({basePath:e,parentId:t,activityId:n,replyId:r,isMember:a,functions:i})=>{const s=se.useIntl(),o=3,{replies:l,fetchNextPage:u,hasNextPage:d,isLoading:h,mutations:{create:p,edit:m,like:g,remove:f,unlike:b},user:v}=Sh({queryKey:[e,t,n,r,"replies"],queryFns:{...i,list:_=>i.list({..._,reactionId:r})}});Gs([h]);const[w,A]=y.useState(!0);return c.jsxs(c.Fragment,{children:[(l==null?void 0:l.length)>=o&&c.jsx(Ee,{className:"nested-replies-show-toggle",variant:"secondary",size:"small",icon:{icon:`arrow_corner-${w?"up_left":"down_right"}`,position:"left"},onClick:()=>A(!w),children:s.formatMessage({id:`discussion_thread_${w?"hide":"show"}`},{count:l==null?void 0:l.length})}),w&&c.jsx(Eh,{loadMore:{isLoading:h,hasNextPage:d,loadNextPage:()=>u()},form:{parentId:t,content:{type:"reply",slugs:{question:`${e}/${t}`,answer:n,reply:r}},functions:{create:(_,{body:x})=>p({activityId:n,replyId:r,content:x}),listMembers:i.listMembers,clickMentionFallback:i.clickMentionFallback},meta:{isEditing:!1,isAutoFocused:!0,isPrepopulated:!1,showSuccessMessage:!1}},children:l&&l.length>0?l==null?void 0:l.map(_=>{var H,G,ae,C,L,J,k;const{id:x,own_children:T,latest_children:S,children_counts:z,data:{mentioned_users:M}}=_,I=(((H=T==null?void 0:T.like)==null?void 0:H.length)||0)>0?(G=T==null?void 0:T.like)==null?void 0:G.find(F=>{var $;return(($=F==null?void 0:F.user)==null?void 0:$.id)===(v==null?void 0:v.id)}):!1,B=I?I==null?void 0:I.id:"",E=!!I,N=(((ae=S==null?void 0:S.like)==null?void 0:ae.length)||0)>0?(C=S==null?void 0:S.like)==null?void 0:C.map(F=>{var $,R,U;return{id:($=F==null?void 0:F.user)==null?void 0:$.id,name:(U=(R=F==null?void 0:F.user)==null?void 0:R.data)==null?void 0:U.name}}):!1,W=typeof _.data.content=="string"?(L=_==null?void 0:_.data)==null?void 0:L.content:((k=(J=_==null?void 0:_.data)==null?void 0:J.content)==null?void 0:k.text)||"";return c.jsx(Zr,{isCommunity:!0,content:{id:x,type:"reply",body:W,canLike:a,createdAt:_==null?void 0:_.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:_==null?void 0:_.parent},slug:"",author:di(_==null?void 0:_.user),userLiked:E,likes:(z==null?void 0:z.like)||0,peopleWhoLiked:N,mentions:M},functions:{content:{createContent:()=>null,deleteContent:()=>f({replyId:x}),updateContent:(F,{body:$})=>m({replyId:x,content:$})},likes:{createLike:()=>g({replyId:x}),deleteLike:()=>b({replyId:x,reactionId:B})},comments:{},mentions:{listMembers:i.listMembers,clickMentionFallback:i.clickMentionFallback}},styling:{showShareLinkButton:!0},badges:{showBadges:!0,scopes:[{scope:ct.COMMUNITIES,area:t||""},{scope:ct.PLATFORM,area:"all"}]}},x)}):null})]})};const jh=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{reactions:a,mentions:i,join:s,leave:o},profile:l})=>{const u=se.useIntl(),{replies:d,repliesCount:h,fetchNextPage:p,hasNextPage:m,isLoading:g,mutations:{create:f,edit:b,like:v,remove:w,unlike:A},user:_}=Sh({queryKey:[e,t,n,"replies"],queryFns:a}),x=()=>{S(d.length),p()},[T,S]=y.useState(null);return Gs([g]),Th(),c.jsxs("section",{className:"replies-feed",children:[c.jsx(wh,{type:"comment",responses:h,isLoading:g}),c.jsx(qo,{form:{content:{type:"reply",slugs:{}},functions:{create:(z,{body:M})=>f({activityId:n,content:M}),...i},meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1},placeholder:u.formatMessage({id:"discussion_responses_placeholder"})},parentId:t,membershipRequiredToPost:{isMember:r,required:!0,join:s,leave:o,notMemberStateText:u.formatMessage({id:"community_joinToPost"})}}),d==null?void 0:d.map((z,M)=>{var J,k,F,$,R,U,re;const{id:q,own_children:I,latest_children:B,children_counts:E,data:{mentioned_users:j}}=z,W=(((J=I==null?void 0:I.like)==null?void 0:J.length)||0)>0?(k=I==null?void 0:I.like)==null?void 0:k.find(ee=>{var ie;return((ie=ee==null?void 0:ee.user)==null?void 0:ie.id)===(_==null?void 0:_.id)}):!1,H=W?W==null?void 0:W.id:"",G=!!W,C=(((F=B==null?void 0:B.like)==null?void 0:F.length)||0)>0?($=B==null?void 0:B.like)==null?void 0:$.map(ee=>{var ie,fe,X;return{id:(ie=ee==null?void 0:ee.user)==null?void 0:ie.id,name:(X=(fe=ee==null?void 0:ee.user)==null?void 0:fe.data)==null?void 0:X.name}}):!1,L=typeof z.data.content=="string"?(R=z==null?void 0:z.data)==null?void 0:R.content:((re=(U=z==null?void 0:z.data)==null?void 0:U.content)==null?void 0:re.text)||"";return c.jsx(Dh,{children:c.jsx(Zr,{isCommunity:!0,content:{id:q,type:"reply",body:L,canLike:r,createdAt:z==null?void 0:z.created_at,slugs:{question:`${e}/${t}`,answer:n,reply:q},slug:q,author:di(z==null?void 0:z.user),userLiked:G,likes:(E==null?void 0:E.like)||0,peopleWhoLiked:C,mentions:j},functions:{content:{createContent:()=>null,deleteContent:()=>w({replyId:q}),updateContent:(ee,{body:ie})=>b({replyId:q,content:ie})},likes:{createLike:()=>v({replyId:q}),deleteLike:()=>A({replyId:q,reactionId:H})},comments:{},mentions:i},badges:{showBadges:!0,scopes:[{scope:ct.COMMUNITIES,area:t||""},{scope:ct.PLATFORM,area:"all"}]},children:c.jsx(KE,{basePath:e,parentId:t,activityId:n,replyId:q,isMember:r,functions:{...a,...i}}),styling:{showShareLinkButton:!0},setFocus:M===T},q)},q)}),!g&&c.jsx(Hr,{hasNextPage:m,loadNextPage:x,icon:{icon:"arrow-down",position:"right"},messages:{button:u.formatMessage({id:"loadMore_button"}),error:u.formatMessage({id:"loadMore_error"})}}),c.jsx(Wo,{form:l})]})};function ZE({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=qe.useMutation({mutationFn:e,onMutate:({content:a,title:i})=>t(s=>(s&&(a!=null&&(s.content=a),i!=null&&(s.title=i)),s)),onError:n});return r}function YE({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:a,isFetching:i}=qe.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:a,isFetching:i}}function GE({queryFns:{read:e,edit:t,like:n,unlike:r,pin:a,unpin:i},queryKey:s}){const o=qe.useQueryClient(),l=ei(),u={queryClient:o,queryKey:s},d={mutationHandlers:{error:Uo(u),mutate:Ho(u)},user:l,...u},h=ZE({...d,mutationFn:t}),p=QE({...d,mutationFn:n}),m=JE({...d,mutationFn:r}),g=XE({...d,mutationFn:a}),f=e_({...d,mutationFn:i}),{activity:b,...v}=YE({queryKey:s,queryFn:e});return{activity:b,mutations:{edit:h,like:p,unlike:m,pin:g,unpin:f},user:l,...v}}function QE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=qe.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Ka({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Ka({activity:l,reaction:s}),r.setQueryData(a,l)}});return i}function JE({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=qe.useMutation({mutationFn:e,onMutate:i=>t(s=>(s&&Fh({activity:s,user:r}),s)),onError:n});return a}function XE({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:a}){const{mutate:i}=qe.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Za({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Za({activity:l,reaction:s}),r.setQueryData(a,l)}});return i}function e_({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:a}=qe.useMutation({mutationFn:e,onMutate:i=>(console.log("unpin"),t(s=>(s&&Bh({activity:s,user:r}),s))),onError:n});return a}const t_=({basePath:e,parentId:t,activityId:n,isMember:r,isOwner:a,functions:{activities:{remove:i,...s},reactions:o,mentions:l,join:u,leave:d},profile:h})=>{var E,j,N,W,H,G,ae;const p=se.useIntl(),{activity:m,error:g,isLoading:f,mutations:{edit:b,like:v,unlike:w,pin:A,unpin:_}}=GE({queryFns:s,queryKey:[e,t,n]});if(f)return c.jsx(Bt,{style:{height:"400px"}});if(g||!m)return c.jsx(hn,{variant:"error",text:p.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:x,latest_reactions:T,mentioned_users:S}=m,z=(((E=T==null?void 0:T.like)==null?void 0:E.length)||0)>0,M=(((j=x==null?void 0:x.like)==null?void 0:j.length)||0)>0,q=M?x==null?void 0:x.like[0].id:"",I=z?(N=T==null?void 0:T.like)==null?void 0:N.map(C=>{var L,J,k;return{id:(L=C==null?void 0:C.user)==null?void 0:L.id,name:(k=(J=C==null?void 0:C.user)==null?void 0:J.data)==null?void 0:k.name}}):!1,B=m==null?void 0:m.actor;return c.jsxs("section",{className:"activity-section",children:[c.jsx(Zr,{className:"highlighted-text-box subtle",isCommunity:!0,content:{id:n,type:"post",title:m==null?void 0:m.title,body:m==null?void 0:m.content,canLike:r,createdAt:(m==null?void 0:m.time)||"",slugs:{question:`${e}/${t}`,answer:m==null?void 0:m.id},slug:n,author:di(B),userLiked:M,likes:((W=m==null?void 0:m.reaction_counts)==null?void 0:W.like)||0,comments:((H=m==null?void 0:m.reaction_counts)==null?void 0:H.reply)||0,peopleWhoLiked:I,mentions:S,pinned:((G=m==null?void 0:m.reaction_counts)==null?void 0:G.pin)&&((ae=m==null?void 0:m.reaction_counts)==null?void 0:ae.pin)>0||!1},originalAuthorId:B==null?void 0:B.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:i,updateContent:(C,{title:L,body:J})=>b({title:L,content:J})},likes:{createLike:()=>v({activityId:n}),deleteLike:()=>w({activityId:n,reactionId:q})},comments:{openComments:()=>{}},pins:{createPin:()=>A({activityId:n}),deletePin:()=>{var C;return _({activityId:n,reactionId:(C=T==null?void 0:T.pin)==null?void 0:C[0].id})}},mentions:l},styling:{showShareLinkButton:!0},userHasOwnerPermissions:a,badges:{showBadges:!0,scopes:[{scope:ct.COMMUNITIES,area:t||""},{scope:ct.PLATFORM,area:"all"}]}},n),c.jsx(jh,{basePath:e,parentId:t,activityId:n,isMember:r,functions:{reactions:o,mentions:l,join:u,leave:d},profile:h})]})};const Oh=({showModal:e=!0,functions:t,form:n,cachedText:r,className:a})=>{const i=se.useIntl(),s="discussionFormModal_",{onClose:o=()=>{},cacheText:l=()=>{}}=t,{data:u,meta:d,functions:h}=n,{title:p="",body:m="",mentions:g}=r||{},f="discussion-form-modal";return c.jsx(pn,{id:f,title:i.formatMessage({id:`${s}title`}),isOpen:e,functions:{onClose:()=>{(p!==""||m!=="")&&l(b=>({...b,showCachedText:!0})),o()}},className:Y("discussion-form-modal",a),children:c.jsx(Kr,{...n,data:{...u,mentions:g||(u==null?void 0:u.mentions)},meta:{...d,isAutoFocused:!0,isInOverlay:`${f}-overlay`,hasTitleField:{text:p},isPrepopulated:{text:m||(d==null?void 0:d.isPrepopulated)!==!1&&(d==null?void 0:d.isPrepopulated.text)||""},showGuidelines:!1,showDivider:!0},buttons:{submit:i.formatMessage({id:`${s}cta`})},functions:{...h,onChange:b=>{l(v=>({...v,...b}))},onMention:({id:b,name:v}={})=>{if(!b||!v)return;const w=g||{};w[b]={created_at:"",updated_at:"",id:b,data:{name:v}},l(A=>({...A,mentions:w}))},create:async b=>{o(),h.create&&await h.create(b),l({showCachedText:!1})},handleSaveEdit:async b=>{o(),h.handleSaveEdit&&await h.handleSaveEdit(b),l({showCachedText:!1})}}})})},n_=Object.freeze(Object.defineProperty({__proto__:null,default:Oh},Symbol.toStringTag,{value:"Module"}));const r_=({className:e,showModal:t=!0,title:n,formTitle:r,formLabel:a,ctaMessage:i,showIcon:s,onClose:o,reportError:l=()=>{},sendInvites:u})=>{const d=se.useIntl();return r||(r=d.formatMessage({id:"inviteModal_formTitle"})),a||(a=d.formatMessage({id:"inviteModal_formLabel"})),i||(i=d.formatMessage({id:"inviteModal_cta"})),c.jsx(pn,{id:"invite-user-modal",title:n,isOpen:t,showDivider:!1,showIcon:s,functions:{onClose:o},className:Y("invite-modal",e,{success:!!n}),children:c.jsx(mh,{title:r,label:a,ctaMessage:i,onClose:o,sendInvites:u,reportError:l})})};const fi=({showModal:e=!0,content:{successMessage:t,title:n,text:r}={},functions:a,form:i,className:s})=>{const o=se.useIntl(),[l,u]=y.useState(td("showProfile")==="true"||e);y.useEffect(()=>{u(e)},[e]);const{onClose:d=()=>{}}=a;return c.jsx(pn,{id:"profile-form-modal",title:t||n||o.formatMessage({id:"profileModal_title"}),isOpen:l,showDivider:!t,functions:{onClose:d},className:Y("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(ph,{...i,meta:{shouldShowCancelButton:!1},functions:{...(i==null?void 0:i.functions)||{},onSuccess:async h=>{var p;try{(p=i==null?void 0:i.functions)!=null&&p.onSuccess&&await i.functions.onSuccess(h)}finally{d()}}}})]})})},a_=Object.freeze(Object.defineProperty({__proto__:null,default:fi},Symbol.toStringTag,{value:"Module"}));const i_=({members:e})=>{const[t,n]=y.useState(!1),r=a=>{const{fullName:i,jobTitle:s,organisation:o,photo:l}=a||{};return c.jsxs(c.Fragment,{children:[c.jsx(mn,{name:i,src:l}),c.jsx("p",{children:i}),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(a=>c.jsx("li",{children:c.jsx("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),n(a)},children:r(a)})},a.fullName))}),c.jsx(pn,{isOpen:t!==!1,children:t===!1?"":c.jsxs(c.Fragment,{children:[r(t),c.jsx(Bn,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const s_=({author:e,authorCite:t,content:n,member:r,className:a=""})=>c.jsxs("blockquote",{className:Y("testimonial-block",a),children:[c.jsx(zt,{className:"testimonial",children:n}),r?c.jsx(Qt,{member:r,styling:{size:"large"}}):c.jsxs(c.Fragment,{children:[e&&c.jsx("p",{className:Y("author",{"text-small":!a.includes("new")}),children:e}),t&&c.jsx("p",{className:Y("author-cite",{"text-small":!a.includes("new")}),children:c.jsx("cite",{children:t})})]})]}),o_=y.memo(s_);const u_=({items:e=[],selector:t="",className:n=""})=>{const r=se.useIntl(),[a,i]=y.useState(e);return y.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||""}));i(l)},[]),a&&a.length>0&&c.jsxs(Ot,{variant:"subtle",className:Y("table-of-contents",n),children:[c.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),c.jsx("nav",{children:c.jsx("ul",{children:a.map(({id:s,text:o})=>c.jsx("li",{children:c.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const hi=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:a=""})=>{const i=se.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=d=>{const h=d/60,p=Math.floor(h),m=(h-p)*60,g=Math.round(m),f=`${i.formatMessage({id:`${s}hours`},{time:p})}${p>0&&g>0?", ":""}${i.formatMessage({id:`${s}minutes`},{time:g})}`;return{text:`${p>0?`${i.formatMessage({id:`${s}hours_short`},{time:p})} `:""}${g>0?i.formatMessage({id:`${s}minutes_short`},{time:g}):""}`,ariaText:f}};let{text:l,ariaText:u}=o(e);if(t){const{text:d,ariaText:h}=o(e+t);l=i.formatMessage({id:`${s}range`},{early:l,late:d}),u=i.formatMessage({id:`${s}range_aria`},{early:u,late:h})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),c.jsx("span",{className:Y("time-to-complete",a),"aria-label":u,children:l})};const l_=({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(ur,{...n,className:Y("banner",e),image:{...t,aspect:"banner"}})):null;const c_=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],d_=({className:e="",content:t,image:n,variant:r,spacing:a="normal",styling:i,hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:l})=>{var g,f;const u={imageFullWidth:!0,...i};r||(r=u.imageFullWidth?"default":"light");const d=["eyebrow","title","text"],h={eyebrow:"small",title:"h1",text:"p"},p={};d.forEach(b=>{if(!t[b]){p[b]=!1;return}if(!s[b]){if(typeof t[b]=="object"){p[b]=t[b];const{text:v,element:w}=t[b];if(w&&c_.includes(w.toLowerCase()))return;p[b]={text:v,element:h[b]};return}p[b]={text:t[b],element:h[b]}}});const m=o&&o.text&&o.link;return m&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=b=>{b.preventDefault(),b.stopPropagation();const v=document.getElementById(o.link.substring(1));v&&v.scrollIntoView({behavior:"smooth"})}),c.jsx(bn,{className:Y("banner-section",r,a,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":m,"has-extra-spacing":r!=="subtle"&&a==="normal"&&p.eyebrow&&p.title}),children:c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"content-wrapper",children:[d.map(b=>{if(p[b]&&typeof p[b]=="object"){const{text:v,element:w=""}=p[b];return b==="text"?c.jsx(Bn,{overrideType:"text-only",className:"text",children:v},b):y.createElement(w,{key:b,className:b},v)}return null}),l,m&&c.jsx(Ee,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:Y({new:r==="subtle",[(g=o.props)==null?void 0:g.className]:(f=o.props)==null?void 0:f.className}),children:o.text})]}),n&&c.jsx(ur,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},f_=y.memo(d_);const h_=({image:e,variant:t="default",children:n,className:r=""})=>{const a={};return e&&(a["--image"]=`url(${e})`),c.jsx(bn,{className:Y("custom-content-banner",t,r,{"has-image":e}),style:a,children:c.jsx("div",{className:"content-slim",children:n})})};const m_=({alignImage:e="left",className:t,content:n,image:r})=>{const a=typeof n=="string"?c.jsx(Bn,{children:n}):n;return c.jsxs(bn,{className:Y("highlight-section",t),children:[r&&c.jsx("div",{className:Y("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:c.jsx(ur,{image:{...r,description:""}})}),c.jsx("div",{className:Y("highlight-container highlight-content-wrapper",{"no-image":!r}),children:c.jsx("div",{className:Y("highlight-content",{"highlight-content-right":e==="left"}),children:r?a:c.jsx("div",{className:"content-default",children:a})})})]})},p_=y.memo(m_);const g_=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:a})=>!n&&!r?null:c.jsxs("aside",{className:Y("marketing-block",e),children:[n&&c.jsx("p",{className:"title",children:n}),r&&c.jsx("p",{children:r}),t&&c.jsx(Ee,{variant:"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":a,"data-gtm-event-type":"learn-more-click",children:t.text})]}),v_=({type:e,data:t})=>{const n=se.useIntl(),{answers:r,createdAt:a,dateHasPassed:i,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:d}=t;if(e==="question"){const h=a&&bs(a);return c.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),a&&c.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})]})]})}if(d&&!i||s)return c.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):Js(d)});if(o)return c.jsx(Gt,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const h=u&&bs(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:h?n.formatMessage({id:`dates_${h.path}`},{number:h.number}):0})})]})}return null},b_={title:66,text:3e3,secondaryText:1e3,partner:34},Ga={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"}},y_=({data:e,cta:t,link:n,gtmContext:r})=>{var f,b;const a=se.useIntl(),[i,s]=y.useState({loading:!1,registered:e.registered||!1});y.useEffect(()=>{e.registered&&s(v=>({...v,registered:!0}))},[e.registered]);const{customLinkText:o,startDate:l,dateHasPassed:u,pill:d,slug:h}=e,p=e.contentType;let m="";if((f=Ga[p])!=null&&f.gtmEvent&&(m=Ga[p].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":`${m}-click`,children:o||a.formatMessage({id:"card_watch"})}):null;if(p==="people")return n?c.jsx(Ee,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${m}-click`,children:o||a.formatMessage({id:"card_cta_people"})}):null;const g=["communityPage","microcourse","event"];if(t&&t.onClick&&g.includes(p)&&d!=="premium"){const v=i.loading||i.registered||((b=e==null?void 0:e.members)==null?void 0:b.isMember),w=async A=>{if(A.preventDefault(),A.stopPropagation(),!(v||!t||!t.onClick)){s(_=>({..._,loading:!0}));try{const _=await t.onClick(e);s(_==="success"?()=>({registered:!0,loading:!1}):x=>({...x,loading:!1}))}catch{s(x=>({...x,loading:!1}))}}};return c.jsx("p",{className:Y("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:c.jsx(Ee,{onClick:w,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:v,"data-gtm-event-context":`${r}Page-${p}: ${h}`,"data-gtm-event-type":`${r}-${p}-register-click`,"data-testid":"in-card-button",children:o||a.formatMessage({id:`card_cta_${p}${v?`_${i.loading?"loading":"done"}`:""}`})})})}return null};function D_({buildMemberData:e,communitySlug:t}){const n=se.useIntl(),[r,a]=y.useState({count:"...",isMember:!1,memberType:""});return y.useEffect(()=>{e(t).then(i=>{if(!i)return;const{membersCount:s,role:o=""}=i;a({count:s==null?void 0:s.toString(),isMember:!!o,memberType:o})})},[t,e]),c.jsxs("span",{className:"member-information",children:[r.isMember&&c.jsx(Gt,{size:"small",variant:"registered",icon:(r==null?void 0:r.memberType)==="owner"?"user":"tick",children:n.formatMessage({id:`card_member_type_${r.memberType}`})}),c.jsx("span",{className:"label member-count",children:n.formatMessage({id:"card_member_count"},{count:r.count})})]})}const Ko=({id:e="",className:t="",buildCardData:n,buildMemberData:r,card:a,cta:i,gtmContext:s="Carousel",handleCardClick:o,setFocus:l=!1})=>{var I,B;const u=se.useIntl(),d=y.useContext(gt),h=!!(d!=null&&d.id),p=y.useRef(null),[m,g]=y.useState({data:null,isLoading:!0});y.useEffect(()=>{n(a,h).then(E=>{g({data:E,isLoading:!1})}).catch(()=>g(E=>({...E,isLoading:!1})))},[a,h,n]);const{data:f,isLoading:b}=m;if(b||!f)return c.jsx(Bt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});o&&!i&&(i={text:u.formatMessage({id:`card_cta_${a.contentType}`}),onClick:o});const{contentType:v}=f;if(!v||!Ga[v])return c.jsx(Bt,{element:"li",className:"card-wrapper"});const{basePath:w="",className:A,length:_,gtmEvent:x}=Ga[v];let T=f.slug?`${w}${f.slug}`:!1;f.slug&&(f.slug.slice(0,4)==="http"||f.slug.slice(0,2)==="//"||f.slug.slice(0,6)==="mailto"||f.slug.slice(0,3)==="tel")&&(T=f.slug);const S=E=>{T&&(E.preventDefault(),E.stopPropagation(),window.location.href=T)},z={...b_,..._};let M={className:"card"},q={};return T&&(q={href:T,className:"gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${x}-click`,"data-testid":"link"},f.openInNewTab&&(q.target="_blank"),M={onClick:S,className:"card gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${x}-click`}),l&&(M={...M,tabIndex:"0"},(I=p==null?void 0:p.current)==null||I.focus(),(B=p==null?void 0:p.current)==null||B.scrollIntoView({behavior:"smooth"})),c.jsx("li",{className:Y("card-wrapper text-medium",A,t,{"has-link":T,"no-link":!T,"has-image":f.banner}),"data-testid":`${v}-card`,children:c.jsxs("div",{...M,ref:p,children:[c.jsx(rd,{className:"card-label",contentType:v,customIcon:f.isPrivate?"lock-locked":f.customIcon,customLabel:f.customLabel}),v==="communityPage"&&(f==null?void 0:f.createdAt)&&im(f==null?void 0:f.createdAt,60)&&c.jsx(Gt,{size:"small",variant:"information","data-testid":"new-community",children:u.formatMessage({id:"card_new"})}),f.startDate&&!f.isOngoingEvent&&c.jsx(Gt,{size:"small",variant:f.dateHasPassed?"default":"information","data-testid":"date",children:f.dateHasPassed?u.formatMessage({id:"card_ended"}):Qc(f.startDate)}),f.banner?c.jsxs("p",{className:"img",children:[f.registered&&c.jsx(Gt,{size:"small",variant:"registered",children:u.formatMessage({id:"card_registered"})}),c.jsx(ur,{image:{...f.banner,description:""}})]}):A==="people"?c.jsx(mn,{name:f.title||"",src:f.profile,"data-testid":"people-profile-picture"}):null,f.contributors&&c.jsx(io,{contributors:{data:f.contributors},styling:{size:"small",showGap:A!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(v)?u.formatMessage({id:`card_contributors_${v}`}):void 0,"data-testid":"contributors"}),f.partner&&c.jsx("p",{className:"partners","data-testid":"partners",children:f.partner.length>1?u.formatMessage({id:"card_partner"},{partner:f.partner[0],number:f.partner.length-1}):er(f.partner[0],z.partner)}),["title","text","secondaryText"].map(E=>{const j=f[E];if(!j)return null;const N=Vc(E),W={key:E,className:N,"data-testid":N},H={wrapper:"p",forceWrapper:!0,forceInline:!0},G=er(j,z[E]);return["title","text"].includes(E)&&T?(H.wrapper="a",c.jsx("p",{...W,children:c.jsx(zt,{options:H,...q,children:G})})):c.jsx(zt,{options:H,...W,children:G})}),a.contentType==="communityPage"&&(a.slug||f.slug)&&r&&c.jsx(D_,{communitySlug:a.slug||f.slug,buildMemberData:r}),c.jsx(v_,{type:A||"",data:f}),c.jsx(y_,{data:f,cta:i,link:T||"",gtmContext:s})]})})};const Ph=({cards:e,cardTypes:t,className:n="",...r})=>c.jsx("ul",{className:Y("card-block",n),children:e.map((a,i)=>{const s=a.slug?`${a.slug}-${t[i]}`:`${t[i]}-${i}`;return c.jsx(Ko,{id:s,card:{...a,contentType:t[i]},setFocus:i===(r==null?void 0:r.focusCardIndex),...r},s)})}),C_=(e,t,n,r)=>{const a=t*n<=e,i=e<t*(n+1),s=r.includes(Math.floor(e/t));return a&&i||s},x_=({id:e,title:t})=>{const n=se.useIntl();if(!t||!t.text)return null;const{text:r,element:a="h2",variant:i="default",size:s="medium",link:o}=t;return y.createElement(a,{className:Y("title",i,s,{"highlighted-title":i==="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 hs={fourCards:1024,threeCards:769,twoCards:480};let va=null,ms=null;const w_=({id:e,cards:t,cardTypes:n,buildCardData:r,title:a,className:i,gtmContext:s,...o})=>{const l=se.useIntl(),u="carousel_pagination_",[d,h]=y.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:p,isLoading:m}=d,[g,f]=y.useState({currentPage:0,loadedPages:[0]}),{currentPage:b,loadedPages:v}=g,[w,A]=y.useState(""),_=t.length,x=Math.ceil(_/p),T=y.useRef(null),S=Mn(!0,!0,T==null?void 0:T.current);y.useEffect(()=>{let E=1;S&&(S>=hs.fourCards?E=4:S>=hs.threeCards?E=3:S>=hs.twoCards&&(E=2),E>_&&(E=_)),h(j=>({...j,cardsPerPage:E,isLoading:!1}))},[S,_]);const z=(E="next")=>{ms&&clearTimeout(ms);let j=b;if(typeof E=="string")if(E==="next")if(b<x-1)j=b+1;else return;else if(b>0)j=b-1;else return;else j=E;A(""),f(W=>({...W,currentPage:j,loadedPages:[...new Set([...v,j])]}));const N=()=>{const W=j*d.cardsPerPage,H=W+d.cardsPerPage;return t.slice(W,H).length};ms=setTimeout(()=>{A(l.formatMessage({id:`${u}ariaLive${typeof E=="string"?"":"_slide"}`},{direction:l.formatMessage({id:`${u}${typeof E=="string"?E:"next"}`}),slide:typeof E=="string"?1:E+1,count:N()}))},500)},M=E=>{va=E.touches[0].clientX},q=E=>{if(va===null)return;const j=E.touches[0].clientX,N=va-j;N>5?z("next"):N<-5&&z("previous"),va=null},I={"--width":`${S||0}px`,"--total-cards":_,"--cards-per-page":p,"--page":b};if(m)return c.jsx(eo,{layout:`carousel${a?"-with-title":""}`});const B=(E,j)=>{var W;let N=null;return(W=E==null?void 0:E.sys)!=null&&W.id?N=`card-${E.sys.id}`:E!=null&&E.slug?N=`card-${E.slug}`:[n[j],E.contentType].includes("customCard")&&(N=`card-${window.btoa(`${E.title} ${E.createdAt}`)}-${j}`),N};return c.jsxs("section",{ref:T,className:Y("carousel-wrapper",i),"data-testid":"carousel",children:[c.jsx(x_,{id:e,title:a}),c.jsx("ul",{className:"carousel",onTouchStart:M,onTouchMove:q,style:I,"data-testid":"carousel-list",children:t.map((E,j)=>{let N=B(E,j);return N&&C_(j,p,b,v)?c.jsx(Ko,{id:N,card:{...E,contentType:n[j]},buildCardData:r,gtmContext:s,...o},N):(N=N||`${e}-card-${j}`,c.jsx(Bt,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},N))})}),x<=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(Ee,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:E=>{E.preventDefault(),E.stopPropagation(),z("previous")},screenreaderText:l.formatMessage({id:`${u}previousSlide`}),disabled:b<=0})}),[...Array(x)].map((E,j)=>c.jsx("li",{"data-testid":"carousel-controls-button",children:c.jsx("button",{className:Y("page-indicator",{selected:j===b}),onClick:N=>{N.preventDefault(),N.stopPropagation(),z(j)},children:c.jsx(Ne,{showOnFocus:!1,children:l.formatMessage({id:`${u}slide`},{number:j+1,total:x})})})},`page-indicator-${j}`)),c.jsx("li",{className:"arrow next",children:c.jsx(Ee,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:E=>{E.preventDefault(),E.stopPropagation(),z("next")},screenreaderText:l.formatMessage({id:`${u}nextSlide`}),disabled:b>=x-1})})]}),c.jsx(Ne,{"aria-live":w===""?"off":"polite",showOnFocus:!1,children:w})]})]})},E_=({carousels:e=[],isLoading:t,title:n,className:r="",...a})=>!e||!e.length?null:e.map(({title:i,viewAllUrl:s,cards:o,cardsTypes:l},u)=>{const d=i?window.btoa(i):`carousel-${u}`,h=u===e.length-1;return t?c.jsxs(y.Fragment,{children:[c.jsx(eo,{layout:`carousel${i?"-with-title":""}`,"data-testid":"carousel-placeholder"}),h?null:c.jsx(Wt,{})]},`placeholder-${d}`):c.jsxs(y.Fragment,{children:[c.jsx(w_,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:i,link:s},...a}),h?null:c.jsx(Wt,{})]},`carousel-${d}`)});const __=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:a=!0},graph:i,styling:s={},className:o=""})=>{const l=se.useIntl();let u=a?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:d=!1}=s;return y.createElement(e,{className:Y("course-progression",o,{"highlight-percentage":d,"has-circle-graph":i==="circle"}),children:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:h=>c.jsx("strong",{children:h}),number:u})}),u<100&&a&&c.jsx(hi,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})}),c.jsx(Xs,{progress:u,styling:{layout:i||"bar",size:i&&i==="circle"?"small":"default"}})]})})};const Mh=({element:e="span",sectionId:t,subsectionId:n,title:r,className:a=""})=>y.createElement(e,{className:Y("lesson-name",a),"data-number":`${t}.${n}`,children:r});const Nh=({size:e="default",completionTime:t,icon:n,optional:r,type:a,children:i})=>{const s=se.useIntl(),o=Ja(`lessonType_${a}`)?s.formatMessage({id:`lessonType_${a}`}):Zc(a||"");return c.jsxs("small",{className:Y("content-type",{[e]:e!=="default"}),children:[c.jsx("span",{className:Y("type",n),children:o})," ",t>0&&!r&&c.jsx(hi,{time:t})," ",i?c.jsx("span",{className:"additional",children:i}):null]})};const k_=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:a,sectionId:i,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:d})=>{const h=se.useIntl(),p="courseStructure_",m=u.toLowerCase().includes("course conclusion");return c.jsxs(Xa,{className:"course-structure",label:c.jsxs(c.Fragment,{children:[c.jsxs("small",{children:[h.formatMessage({id:`${p}section${m?"_end":""}`},{number:i})," ",!r&&s>=0&&c.jsx("span",{className:"time",children:a&&l===0?h.formatMessage({id:`${p}time_completed`}):c.jsx(hi,{time:s,appendedText:a?h.formatMessage({id:`${p}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:g,completionTime:f,contentType:b,icon:v,image:w,isIntroduction:A,optional:_,slug:x,subsectionId:T,title:S,type:z})=>{const M=a&&t||A,q={};return w&&(q.style={"--image":`url(${w})`}),c.jsx("li",{className:Y({article:b===Dr.ARTICLE,discussion:b===Dr.DISCUSSION,quiz:b===Dr.QUIZ,completed:g&&b===Dr.ARTICLE,locked:!M}),...q,children:c.jsx(fn,{href:M?`/microcourses/en/${o}/${x}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${Kc(S)}`,gtmType:"article-click",children:c.jsxs(c.Fragment,{children:[c.jsx(Mh,{sectionId:i,subsectionId:T,title:S,className:"course-title"})," ",c.jsx(Nh,{completionTime:f,icon:v,optional:_,type:z,children:d&&d[x]&&c.jsx("span",{className:"quiz-score",children:`${d[x]}%`})})]})})},x)})})]})};const F_=({isComplete:e=!1,onClick:t,...n})=>{const r=se.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),c.jsx(Ee,{...n,variant:"tertiary",icon:e?{icon:"check-inside-circle_no-overlap_inverted"}:{icon:"check-inside-circle_no-overlap",hover:"check-inside-circle_no-overlap_inverted"},onClick:t,className:Y("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})},B_=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:a}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:a}}),Mc=[{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 ba="notFoundError_",A_=()=>{const e=se.useIntl(),t=[];return Mc.forEach((n,r)=>{n.title=e.formatMessage({id:`${ba}post_${r+1}`}),t.push("solutionArticle")}),c.jsxs(yh,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:c.jsxs(bn,{children:[c.jsx(Ph,{cards:Mc,cardTypes:t,buildCardData:n=>new Promise((r,a)=>{r(n)})}),c.jsx(Ee,{href:"/solution-articles/",children:e.formatMessage({id:`${ba}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[c.jsx("h1",{children:e.formatMessage({id:`${ba}title`})}),c.jsx("p",{children:e.formatMessage({id:`${ba}text`})})]})};exports.ASSETS_BUCKET=qt;exports.ActivitiesFeed=PE;exports.ActivitySection=t_;exports.AddPost=qo;exports.BadgesContext=to;exports.BadgesProvider=dd;exports.Banner=l_;exports.BannerSection=f_;exports.Breadcrumbs=Vp;exports.Buckets=Cm;exports.Button=Ee;exports.ButtonWrapper=or;exports.COURSE_CONTENT_TYPES=Dr;exports.CacheProvider=fd;exports.Card=Ko;exports.CardBlock=Ph;exports.Carousel=E_;exports.CharacterLimit=fo;exports.CollapsibleSection=Xa;exports.Columns=Od;exports.CommunityDetails=Hp;exports.ContactFooter=Kw;exports.ContactForm=hh;exports.ContentTypeLabel=rd;exports.Contributors=io;exports.ConversationContext=ci;exports.CookieBanner=bh;exports.CourseProgression=__;exports.CourseStructure=k_;exports.CustomContentBanner=h_;exports.CustomEvents=Xe;exports.DELETED_USER_ID=Sr;exports.Directory=i_;exports.DiscussionConversation=Dh;exports.DiscussionForm=Kr;exports.DiscussionFormCard=xh;exports.DiscussionFormModal=Oh;exports.DiscussionLikes=Ch;exports.DiscussionPost=Zr;exports.DiscussionThread=Eh;exports.Divider=Wt;exports.DownloadSection=Ww;exports.EMAILS=Hn;exports.EditSection=Hw;exports.EmailHelperTextBox=Md;exports.EmptyStateBox=hn;exports.FeatureFlags=no;exports.Filters=Kp;exports.FlagsProvider=md;exports.Footer=$o;exports.Form=en;exports.Formatting=K;exports.Fragment=Et;exports.FullWidthSection=bn;exports.GET_STREAM_USER_PREFIX=vs;exports.GlobalProviders=Lm;exports.Header=Lo;exports.HelperTextBox=id;exports.HiddenFromScreenReaders=Qa;exports.HideShowTextBox=sd;exports.HighlightSection=p_;exports.HighlightedTextBox=Ot;exports.INVALID_TOKEN=Yc;exports.IconBulletedList=Em;exports.ImageContainer=vm;exports.IntlProvider=pd;exports.InviteForm=mh;exports.InviteModal=r_;exports.JoinButton=lo;exports.LanguageContext=ro;exports.LanguageSwitcher=Yp;exports.LessonName=Mh;exports.LessonType=Nh;exports.Link=fn;exports.LoadMore=Hr;exports.LoadingBlock=Mm;exports.LoadingPlaceholder=Bt;exports.LoadingState=eo;exports.Logo=co;exports.LogoSection=Vw;exports.MENTION_REGEX=Gc;exports.MarkCompleteButton=F_;exports.MarkdownText=Bn;exports.MarketingBlock=g_;exports.Marks=Lt;exports.Member=Qt;exports.MembersList=Xw;exports.Modal=so;exports.MoreMenu=Sd;exports.NUMBER_OF_COUNTRIES=nm;exports.NUMBER_OF_USERS=tm;exports.NavigationMenu=jd;exports.NotFoundError=A_;exports.Overlay=pn;exports.OverlayContext=ao;exports.OverlayProvider=bd;exports.PageHeading=od;exports.PageLayout=yh;exports.PasswordForm=Nw;exports.PasswordRules=Ld;exports.Pill=Gt;exports.Popover=nd;exports.Portal=Ur;exports.ProfileForm=ph;exports.ProfileImageChange=fh;exports.ProfileModal=fi;exports.ProfileModalLauncher=Wo;exports.ProfilePicture=mn;exports.ProgressBar=Xs;exports.ProgressTracker=ym;exports.Rating=mg;exports.RepliesFeed=jh;exports.ResponsesHeading=wh;exports.ResponsiveImage=ur;exports.ReturnToNavButton=Dm;exports.RichTextEditor=dh;exports.SearchForm=gh;exports.ShareLinks=tg;exports.SignupForm=qw;exports.Span=Cs;exports.StatusBanner=Or;exports.TableOfContents=u_;exports.Tabs=ng;exports.Tags=Jw;exports.TestimonialBlock=o_;exports.TimeToComplete=hi;exports.Toggle=Mw;exports.Tooltip=Nn;exports.TopLevelPage=Zw;exports.UUID_V4_REGEX=jr;exports.UserContext=gt;exports.UserProvider=gd;exports.VisuallyHidden=Ne;exports.addAriaProps=Td;exports.basicReducer=Wr;exports.camelCaseToDashCase=Vc;exports.checkIntlPathExists=Ja;exports.generateConditions=Aa;exports.generateCssIcon=rm;exports.getCharacterLimitProps=Pd;exports.getLongDate=Js;exports.getMember=ti;exports.getPostBody=zo;exports.getShortDate=Qc;exports.getValueLength=ni;exports.headerData=qr;exports.mapGetStreamData=B_;exports.pageReady=Jc;exports.passwordValidator=ys;exports.repliesFeedMock=ME;exports.supportedLanguages=Ca;exports.toCamelCase=Kc;exports.toCapitalisedCase=em;exports.toSentenceCase=Zc;exports.useBadges=cd;exports.useCurrentPath=Lc;exports.useEffectAfterMount=Fn;exports.useElementWidth=Mn;exports.useOverlay=vd;exports.useScrollListener=Wc;exports.useScrollToHash=Gs;exports.useTooltips=Qs;exports.useUser=ei;
|