@apolitical/component-library 10.1.16-dg.0 → 10.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -28,7 +28,7 @@ React keys must be passed directly to JSX without using spread:
28
28
 
29
29
  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.
30
30
 
31
- Thank you for helping to protect the Apolitical community from abusive content.`,discussionFormCard_placeholder:"Create post",discussionFormCard_placeholder_long:"Write a post or ask a question...",discussionFormCard_overlay_title:"Discard post",discussionFormCard_overlay_text:"Are you sure you want to leave without posting? Changes you have made will not be saved.",discussionFormCard_overlay_cta_discard:"Discard",discussionFormCard_overlay_cta_continue:"Continue editing",discussion_form_postType_label:"Post type","discussion_form__postType_no-category":"Post",discussion_form_isAnonymous_label:"Post anonymously",discussion_form_isAnonymous_tooltip_content:"Your name, job title and profile picture will be hidden from other users. Only moderators can see your identity.",discussion_form_member_anonymous_infoMsg:"Your identity will be hidden",discussion_form_title:"Write your {action}",discussion_form_titleField_label:"Title",discussion_form_titleField_placeholder:"Write something...",discussion_form_titleField_error:"Please enter a title or a body for your post.",discussion_form_question_label:"Question",discussion_form_question_placeholder:"Question",discussion_form_option_label:"Options",discussion_form_option_placeholder:"Option {number}",discussion_form_option_cta:"Add option",discussion_form_multiplePollAnswers:"Allow multiple answers",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"Body",discussion_form_label_action:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Create post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Share a question, insight, or announcement with the community",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_showAll:"Show all...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_pin:"Pin post",discussion_moreMenu_unpin:"Unpin post",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments_loading:"... comments",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_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_translation_seeOriginal:"See original",discussion_translation_translate:"Translate to {locale}",discussion_translation_translate_loading:"Translating to {locale}",discussion_translation_translated:"AI translated from {originalLocale}",discussion_translation_translate_error:"There was an error. Please try again.",discussion_translation_coming_soon:"Translation coming soon",discussion_thread_loadMore:"Load more replies",profileModalLauncher_successMessage:"Your post has been created",profileModalLauncher_title:"Your profile is incomplete",profileModalLauncher_text:"A complete profile builds trust and amplifies your voice across the community. Ensure all your details are up to date including a photo and a bio.",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_fieldWrapper_characterLimit_aria_default:"You have {remaining, plural, =0 {no characters} one {1 character} other {# characters}} remaining.",form_fieldWrapper_characterLimit_aria_over:"You are {over, plural, one {1 character} other {# characters}} over the limit. Please shorten your text to {limit} characters.",form_fieldWrapper_characterLimit_info:"You can enter up to {limit} characters",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_error_multipleInputs_same:"Please enter a unique value into each field",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",form_multipleInputs_label:"Input {number}",form_multipleInputs_filledInCount:"{number}/{total}",form_multipleInputs_filledInCount_aria:"{number} out of {total} available inputs have been filled in",form_multipleInputs_remove:"Remove this input",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their email addresses below",inviteForm_message_label:"Add an invitation note",inviteForm_message_placeholder:"Add a personal note to your invitation...",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",inputAutocomplete_placeholder:"Start typing...",passwordRules_unmatched_text:"Passwords do not match",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",passwordRules_currentPassword_label:"Current password",passwordRules_newPassword_label:"New password",passwordRules_confirmPassword_label:"Confirm new password",profileForm_image:"Upload photo",profileForm_name:"Full name",profileForm_name_placeholder:"What's your name, so people can recognise you?",profileForm_jobTitle:"Job title",profileForm_jobTitle_placeholder:"What's your current job title?",profileForm_organization:"Organisation",profileForm_organization_placeholder:"Where do you work?",profileForm_location:"Location",profileForm_location_placeholder:"Add your city",profileForm_location_error:"Please choose a location from the list.",profileForm_bio:"Bio",profileForm_bio_placeholder:"Tell us more about yourself...",profileForm_cta:"Save",profileForm_cta_submitting:"Saving...",profileForm_cta_submitted:"Saved",profileImageChange_cta_uploading:"Uploading image...",profileImageChange_cta_change:"Change photo",profileImageChange_cta_upload:"+ Add profile photo",profileImageChange_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",publishArticleForm_title_label:"Title",publishArticleForm_title_placeholder:"Write a snappy title",publishArticleForm_subtitle_label:"Subtitle",publishArticleForm_subtitle_placeholder:"Your topic, in a nutshell",publishArticleForm_body_label:"Body",publishArticleForm_body_placeholder:"Type or paste your article here",publishArticleForm_tags_label:"Tags (select up to three)",publishArticleForm_cover_image_label:"Cover image",publishArticleForm__tags_topic_CitiesAndLocalGovernment:"Cities and local government",publishArticleForm__tags_topic_Climate:"Energy and climate",publishArticleForm__tags_topic_DigitalAndData:"Digital, data and AI",publishArticleForm__tags_topic_Education:"Education",publishArticleForm__tags_topic_EquityJusticeAndInclusion:"Inclusion",publishArticleForm__tags_topic_HealthAndSocialCare:"Health and social care",publishArticleForm__tags_topic_Innovation:"Innovation",publishArticleForm__tags_topic_LeadershipAndSkills:"Leadership and skills",publishArticleForm__tags_topic_LifeInGovernment:"Life in government",publishArticleForm__tags_topic_Policymaking:"Policymaking",publishArticleForm__tags_topic_TransportAndInfrastructure:"Transport and infrastructure",publishArticleForm__tags_topic_WorkAndTheEconomy:"Work and the economy",publishArticleForm_tags_error_over_three:"You must select no more than three options.",publishArticleForm_tags_error_required:"Please select at least one option.",publishArticleForm_disclaimer:"Ready to publish? Before you do, consider the following: Have you thoroughly proofread your writing? Are you confident in your arguments? Have you included hyperlinks to the necessary resources to support your article?",publishArticleForm_cta_submit:"Publish article",publishArticleForm_cta_submit_edit:"Save",publishArticleForm_cta_submitting:"Publishing...",publishArticleForm_cta_submitting_edit:"Saving...",publishArticleForm_cta_submitted:"Published!",publishArticleForm_cta_submitted_edit:"Saved!",publishArticleForm_aria_success:"Your article is being published. You will be redirected to your article in a moment.",publishArticleForm_aria_success_edit:"Your article is being saved. You will be redirected to your article in a moment.",publishArticleForm_error:"Sorry, something went wrong.",publishArticleForm_error_underMinLength:"Please add at least {length, plural, one {1 character} other {# characters}}.",publishArticleForm_error_loggedOut:"You need to be logged in to publish an article. Please log in and try again.",publishArticleForm_progressBar:"Your article is being published",publishArticleForm_selectImage_button:"Select a cover image",publishArticleForm_replaceImage_button:"Replace Image",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",richTextEditor_placeholder:"Write something...",richTextEditor_toolbar:"Formatting options",richTextEditor_bold:"Bold",richTextEditor_heading_three:"Heading",richTextEditor_italic:"Italic",richTextEditor_strikeThrough:"Strikethrough",richTextEditor_link:"Link",richTextEditor_link_text:"Text:",richTextEditor_link_text_aria:"Text to be linked:",richTextEditor_link_url:"Link:",richTextEditor_link_placeholder:"Type or paste URL",richTextEditor_link_error_required:"Please enter a URL to link to",richTextEditor_link_open:"Open: {link}",richTextEditor_link_open_text:"Opens in a new window",richTextEditor_link_edit:"Edit",richTextEditor_link_remove:"Remove",richTextEditor_link_button:"Add link",richTextEditor_link_enrichedUrl_aria:"Remove this preview for {title}",richTextEditor_link_enrichedUrl_aria_fallback:"the link",richTextEditor_link_enrichedUrl_aria_live:"The link preview has been removed from your post",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",richTextEditor_mention_fallback:"Can't find who you're looking for? Invite them to the community",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",showpassword_show:"Show",showpassword_hide:"Hide",showpassword_aria_show:"Your password is hidden. Click to show.",showpassword_aria_hide:"Your password is visible. Click to hide.",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",poll_instructions:"Select one{allowMultipleVotes, select, true { or more} other {}}",poll_num_votes:"{number, plural, one {# vote} other {# votes}}",poll_remove_vote_button:"Remove vote{number, plural, =0 {} one {} other {s}}",poll_aria_votes:"You have {number, plural, =0 {not voted on this poll} other {voted for:}}",replies_feed_missing_polls_vote_message:"Please vote above to view all the comments",tableOfContents:"Table of contents",timeToComplete_hours:"{time, plural, =0 {} one {1 hour} other {# hours}}",timeToComplete_hours_short:"{time}h",timeToComplete_minutes:"{time, plural, =0 {} one {1 minute} other {# minutes}}",timeToComplete_minutes_short:"{time}m",timeToComplete_range:"{early} - {late}",timeToComplete_range_aria:"between {early} and {late}",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",progressTracker:"Step {current} of {total}",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_platform_communities:"Communities",footer_community:"Community",footer_community_support:"Support FAQ",footer_community_post:"Post on Apolitical",footer_community_join:"Who can join",footer_community_guidelines:"Guidelines & values",footer_company:"Company",footer_company_news:"News",footer_company_insights:"Insights",footer_company_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_ai:"AI principles",footer_legal_trust:"Trust",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_london:"London address",footer_contact_london_address:"Church House Westminster{br}Deans Yard{br}London, SW1P 3NZ{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_washington:"Washington DC Address",footer_contact_washington_address:"1100 15th St NW{br}Washington, DC 20005{br}United States",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_language_switcher:"Change language",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_communities:"Communities",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_explore_communities:"Communities",header_topics_topics:"Topics",header_topics_topics_climate:"Energy and climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital, data and AI",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"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",header_language_unavailable_en:"This page is only available in English. <link>Learn more →</link>",header_language_unavailable_vi:"Trang này chỉ có sẵn bằng tiếng Anh. <link>Tìm hiểu thêm →</link>","header_language_unavailable_sr-Cyrl":"Ова страница је доступна само на енглеском. <link>Сазнајте више →</link>",header_language_unavailable_de:"Diese Seite ist nur auf Englisch verfügbar. <link>Mehr erfahren →</link>","header_language_unavailable_fr-CA":"Cette page est uniquement disponible en anglais. <link>En savoir plus →</link>",header_language_unavailable_ko:"이 페이지는 영어로만 제공됩니다. <link>자세히 알아보기 →</link>",header_language_unavailable_it:"Questa pagina è disponibile solo in inglese. <link>Scopri di più →</link>",header_language_unavailable_pl:"Ta strona jest dostępna tylko w języku angielskim. <link>Dowiedz się więcej →</link>",header_language_unavailable_ja:"このページは英語でのみ利用可能です。<link>詳細はこちら →</link>",header_language_unavailable_ar:"هذه الصفحة متوفرة باللغة الإنجليزية فقط. <link>اعرف المزيد →</link>",header_language_unavailable_es:"Esta página sólo está disponible en inglés. <link>Más información →</link>",header_language_unavailable_fr:"Cette page est uniquement disponible en anglais. <link>En savoir plus →</link>",header_language_unavailable_pt:"Esta página está disponível apenas em inglês. <link>Saiba mais →</link>",header_language_unavailable_id:"Halaman ini tidak tersedia dalam bahasa yang dipilih. <link>Pelajari lebih lanjut →</link>","header_language_unavailable_pt-BR":"Esta página não está disponível no idioma selecionado. <link>Saiba mais →</link>","header_language_unavailable_es-419":"Esta página sólo está disponible en inglés. <link>Más información →</link>",pageLayout_browserTooSmall:"Sorry, your device is too small to view this content properly. Please change to a different orientation or another device.",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",discussionFormModal_title:"Create a post",discussionFormModal_cta:"Create post",inviteModal_title:"You’re registered",inviteModal_formTitle:"Know someone who might like to join this workshop?",inviteModal_formLabel:"Invite your colleagues by typing or pasting their email addresses below.",inviteModal_cta:"Send",overlay_close:"Close",profileModal_title:"Update your profile",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_links_communities:"Communities",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",editSection_placeholder_description:"Add some details",editSection_placeholder_cta:"add",editSection_edit:"Edit",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",contentTypeLabel_event:"Event",contentTypeLabel_learningHub:"Programme",contentTypeLabel_listPage:"List",contentTypeLabel_microcourse:"Course",contentTypeLabel_qaQuestion:"Q&A",contentTypeLabel_solutionArticle:"Article",contentTypeLabel_communityPage:"Community",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip_survey:"Skip past survey",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll",markdown_iframe_survey:"Survey",member_connection_accept:"Accept",member_connection_cancel:"Cancel Request",member_connection_connect:"Connect",member_connection_connected:"Connected",member_connection_pending:"Pending",member_connection_remove:"Remove Connection",member_connection_requested:"Requested",member_show_email_hide:"Email visible only to connections",member_show_email_private:"Private profile email hidden",member_show_email_show:"Show contact info",member_show_email_tooltip:"Copy email address",member_show_email_tooltip_copied:"Email copied to clipboard",member_show_email_tooltip_mine:"Visible only to your connections",member_show_email_tooltip_private:"The privacy setting for this profile is private"},Ix={...Vt,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>"},Px={...Vt,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"},Rx={...Vt,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>"},Fx={...Vt,languageSwitcher_label:"Saya ingin membaca artikel ini dalam...",languageSwitcher_translation_original:"bahasa asli",languageSwitcher_translation_human:"diterjemahkan oleh manusia",languageSwitcher_translation_machine:"diterjemahkan oleh mesin",languageSwitcher_disclaimer:"Konten ini telah diterjemahkan secara otomatis dan terkadang mungkin terdapat kesalahan dalam penerjemahan gender atau terjemahan langsung lainnya. Kami sedang berusaha memperbaiki hal ini, tetapi jika Anda menemukan kesalahan, mohon beri tahu kami di <link>{email}</link>"},Bx={...Vt,languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traduzido por humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, podem ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos trabalhando para resolver isso, mas se você perceber algo errado, por favor nos avise em <link>{email}</link>"},Mx={...Vt,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>"},Lx={...Vt,languageSwitcher_label:"أود قراءة هذه المقالة بـ...",languageSwitcher_translation_original:"اللغة الأصلية",languageSwitcher_translation_human:"مترجمة بواسطة إنسان",languageSwitcher_translation_machine:"مترجمة آلياً",languageSwitcher_disclaimer:"تمت ترجمة هذا المحتوى تلقائياً وقد يحتوي على أخطاء في النوع أو ترجمات حرفية أخرى. نحن نحاول معالجة هذه المشكلة، ولكن في الوقت الحالي، إذا لاحظت خطأً مهماً، يرجى إعلامنا على <link>{email}</link>",collapsibleSection_summary:"اقرأ المزيد"},$x={...Vt,languageSwitcher_label:"この記事を以下の言語で読みたい...",languageSwitcher_translation_original:"原文",languageSwitcher_translation_human:"人による翻訳",languageSwitcher_translation_machine:"機械翻訳",languageSwitcher_disclaimer:"このコンテンツは自動的に翻訳されており、性別の誤りや直訳などが含まれている可能性があります。現在、これらの問題の解決に取り組んでいますが、重大な誤りにお気づきの場合は、<link>{email}</link> までご連絡ください。",collapsibleSection_summary:"もっと読む"},jx={...Vt,languageSwitcher_label:"Chciał(a)bym przeczytać ten artykuł w...",languageSwitcher_translation_original:"język oryginalny",languageSwitcher_translation_human:"przetłumaczone przez człowieka",languageSwitcher_translation_machine:"przetłumaczone maszynowo",languageSwitcher_disclaimer:"Treść została przetłumaczona automatycznie i może zawierać błędy związane z rodzajem gramatycznym lub inne dosłowne tłumaczenia. Pracujemy nad ich poprawą, ale jeśli zauważysz poważny błąd, daj nam znać na adres <link>{email}</link>",collapsibleSection_summary:"Czytaj więcej"},Hx={...Vt,languageSwitcher_label:"Vorrei leggere questo articolo in...",languageSwitcher_translation_original:"lingua originale",languageSwitcher_translation_human:"tradotto da un essere umano",languageSwitcher_translation_machine:"tradotto automaticamente",languageSwitcher_disclaimer:"Questo contenuto è stato tradotto automaticamente e potrebbe contenere errori di genere o altre traduzioni letterali. Stiamo lavorando per risolvere questi problemi, ma se noti un errore importante, faccelo sapere a <link>{email}</link>",collapsibleSection_summary:"Scopri di più"},Ux={...Vt,languageSwitcher_label:"Желео бих да читам овај чланак на...",languageSwitcher_translation_original:"оригиналном језику",languageSwitcher_translation_human:"превео човек",languageSwitcher_translation_machine:"машински превод",languageSwitcher_disclaimer:"Овај садржај је аутоматски преведен и може садржати грешке у роду или друге дословне преводе. Трудимо се да решимо овај проблем, али у међувремену, ако приметите озбиљну грешку, јавите нам на <link>{email}</link>",collapsibleSection_summary:"Сазнајте више"},zx={...Vt,languageSwitcher_label:"이 기사를 다음 언어로 읽고 싶습니다...",languageSwitcher_translation_original:"원본 언어",languageSwitcher_translation_human:"사람이 번역함",languageSwitcher_translation_machine:"기계 번역",languageSwitcher_disclaimer:"이 콘텐츠는 자동으로 번역되었으며, 성별 오류나 직역 등 부정확한 부분이 포함될 수 있습니다. 저희는 이 문제를 해결하기 위해 노력하고 있으며, 중요한 오류를 발견하셨다면 <link>{email}</link>로 알려주세요.",collapsibleSection_summary:"자세히 보기"},qx={...Vt,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"},Wx={...Vt,languageSwitcher_label:"Ich möchte diesen Artikel lesen auf...",languageSwitcher_translation_original:"Originalsprache",languageSwitcher_translation_human:"von einem Menschen übersetzt",languageSwitcher_translation_machine:"maschinell übersetzt",languageSwitcher_disclaimer:"Dieser Inhalt wurde automatisch übersetzt und kann Fehler bei der Geschlechtszuordnung oder andere Ungenauigkeiten enthalten. Wir arbeiten daran, diese Probleme zu beheben. Wenn Ihnen ein schwerwiegender Fehler auffällt, informieren Sie uns bitte unter <link>{email}</link>.",collapsibleSection_summary:"Mehr erfahren"},Vx={...Vt,languageSwitcher_label:"Tôi muốn đọc bài viết này bằng...",languageSwitcher_translation_original:"ngôn ngữ gốc",languageSwitcher_translation_human:"bản dịch do con người thực hiện",languageSwitcher_translation_machine:"bản dịch tự động",languageSwitcher_disclaimer:"Nội dung này được dịch tự động và có thể chứa một số lỗi về ngữ pháp hoặc cách diễn đạt. Chúng tôi đang nỗ lực cải thiện, nhưng nếu bạn phát hiện lỗi nghiêm trọng, vui lòng thông báo cho chúng tôi tại <link>{email}</link>",collapsibleSection_summary:"Tìm hiểu thêm"},Zc=(e,t=Vt)=>e in t,wr=(e,t,n,r,i={})=>{let a="";return Zc(`${t}_${n}`)?a=e({id:`${t}_${n}`},i):a=e({id:t},{[r]:n,...i}),a},Kx=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let i=n.length-1;i>=0;i--){const a=Math.pow(10,(i+1)*3);if(a<=e){e=Math.round(e*t/a)/t,e===1e3&&i<n.length-1&&(e=1,i++),r=`${e}${n[i]}`;break}}return r},Ku=(e,t)=>E.Children.map(e,n=>Object.is(n,null)||!E.isValidElement(n)?n:E.cloneElement(n,t)),O4=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},Gx=e=>{var a,s;const n=["name","organization","jobTitle","biography"].every(o=>{const l=e[o];return l!=null&&l!==""}),r=((a=e.image)==null?void 0:a.thumbnail)!==void 0,i=((s=e.location)==null?void 0:s.en)!==void 0;return n&&r&&i},Yx=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,al).replace(/{{id}}/g,al):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),N4=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var a;if(!n)return e;const i=e.match(Aa);if(!i)return e;for(const s of i){const o=s.replace(Aa,(c,d)=>d),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=l.error?l.error:((a=l==null?void 0:l.data)==null?void 0:a.name)||"",u.id=l.id||"",u.error=l.error;else{const c=l;if(c.startsWith(ih))try{const d=c.replace(ih,"");u.id=d,await r({id:d}).then(f=>{const{name:m,error:g}=f;u.name=g||m||"",u.error=g})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?Yx(e,u,t):s)}return e},vm=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},Qc=e=>typeof window>"u"?null:new URLSearchParams(window.location.search).get(e),sl=(e="")=>e.replace(/\s+/g,"").length>0,sh=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}}};function mi(e){return window!=null&&window.btoa?window.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode("0x"+n))):(console.error("window.btoa is not supported"),e)}const Ra=()=>{const{id:e}=E.useContext(Pt);if(!e)return wa.DEFAULT_LOCALE;const t=D4(mm);return t||wa.DEFAULT_LOCALE},Xc=()=>{const{id:e}=E.useContext(Pt),[t,n]=E.useState(void 0);return E.useEffect(()=>{if(!e){n("/home/");return}const r=D4(mm);if(r){n(`/${r}`);return}n(`/${wa.DEFAULT_LOCALE}`)},[e]),t},I4=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[i,a]=E.useState({current:0,past:0})||[!1,()=>{}],[s,o]=E.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];E.useEffect(()=>(l(),window.addEventListener("scroll",u),()=>{u.flush(),window.removeEventListener("scroll",u)}),[]);const l=()=>{const c=window.scrollY,d=i.current,f=c-d,m=f>0?"down":"up";if(a({current:c,past:d}),m==="down"){c>=e+t.down&&!s.scrollDown&&(!s.scrollUp||f>t.up)&&(n(),o({scrollUp:!1,scrollDown:!0}));return}Math.abs(f)>=t.up&&!s.scrollUp&&(r(),o({scrollUp:!0,scrollDown:!1}))},u=b4(()=>{l()},250);return i},ym=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=E.useRef(!1);Ss(()=>{if(window&&window.location&&window.location.hash){if(n.current)return;const r=document.getElementById(window.location.hash.replace("#",""));r&&(r.scrollIntoView(t?{behavior:"smooth"}:null),n.current=!0)}},e)},Em=(e=!1)=>{if(!e)return{showTooltip:!1,tooltipProps:{}};const[t,n]=E.useState(!1);return{showTooltip:t,tooltipProps:{onClick:()=>n(!0),onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation(),n(!t))},onMouseOver:()=>n(!0),onMouseOut:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1)}}};const ig={},Zx=E.forwardRef(({id:e,styling:t={},isOpen:n=!1,isLoading:r=!1,children:i,className:a="",functions:s={},callbacks:o={},accessibility:l={},...u},c)=>{const d=le.useIntl(),[f]=E.useState(e||Date.now().toString()),m=E.useRef(null),g=c||m,[p,y]=E.useState(n?"open":"hidden"),{extraPadding:v=!0,hasPointer:T=!1,hasForm:_=!1}=t,{onOpen:C=()=>{},onClose:w=()=>{}}=o,{readToScreenreadersWhenClosed:x=!1,...S}=l,N=ig[f];E.useEffect(()=>{const L=g==null?void 0:g.current;if(L)return L.addEventListener("transitionend",B),()=>{L.removeEventListener("transitionend",B)}},[]),E.useEffect(()=>{if(p!=="open")return;const L=O=>{O.key==="Escape"&&(O.stopPropagation(),O.preventDefault(),y("closed"))};return document.addEventListener("keyup",L),()=>{document.removeEventListener("keyup",L)}},[p]);const B=({propertyName:L})=>{L==="opacity"&&(N!==!1&&clearTimeout(N),y(O=>(O==="open"?C():O==="closed"&&w(),O==="opening"?"open":O==="closing"?"closed":O==="closed"?"hidden":O)))};Ss(()=>{N!==!1&&clearTimeout(N);let L="open";n?y("opening"):(y("closing"),L="hidden"),ig[f||""]=setTimeout(()=>{y(L)},300)},[n]);const $={"aria-live":"polite",...u,...S};s&&s.onBlur&&($.onBlur=s.onBlur);const F={className:"content"};return x?F.className=te("content",{hidden:p==="hidden"}):F.hidden=p==="hidden",h.jsx("aside",{ref:g,id:f,className:te("tooltip text-medium",p,a,{loading:r,"extra-padding":v,"has-pointer":T,bottom:T==="bottom","has-form":_}),...$,children:h.jsx("div",{...F,children:r?h.jsx("p",{children:d.formatMessage({id:"tooltip_loading"})}):typeof i=="string"?h.jsx("p",{children:i}):i})})}),pi=E.memo(Zx);const Ie=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:a="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",forceTooltip:c=!1,screenreaderText:d=!1,children:f=!1,...m})=>{const p=Wi(typeof t=="object"),{showTooltip:y,tooltipProps:v}=Em(!!u);if(typeof t=="object"&&typeof p=="number"){const w=Object.assign({},t),x=T4(Object.keys(w));t=_4(p,x,w)}!l&&u&&!c&&(u="");const T=[];typeof t=="string"&&T.push(t),r&&(T.push("icon"),typeof r=="object"?(T.push(r.icon),r.position?T.push(r.position):T.push("left"),r.hover&&T.push(`hover_${r.hover}`),r.animate&&(T.push("animate"),typeof r.animate=="string"&&T.push(r.animate))):(T.push(r),!r.includes("right")&&!r.includes("left")&&T.push("left")));const _={...m,className:te(e,o,T,{"no-text":!f,disabled:l,button:i,muted:n.muted,"full-width":n.fullWidth}),onClick:w=>{(!i||i[0]==="#")&&s&&(w.preventDefault(),w.stopPropagation()),s&&s(w)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};i&&(a="a",_.href=i);const C=E.createElement(a,_,f||(d?h.jsx(ot,{showOnFocus:!1,children:d}):null));return c||l&&u?h.jsxs("span",{className:"button-container",...v,children:[h.jsx(pi,{isOpen:y,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),C]}):C},Hs=({buttons:e,wrappers:t=[],className:n="",...r})=>{const i=e.length>1?"ul":"p",a=e.map((s,o)=>{var l;return i==="p"?h.jsx(Ie,{...s},o):h.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:h.jsx(Ie,{...s})},o)});return E.createElement(i,{className:te("button-wrapper",n),...r,children:a})};const pr=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return h.jsx("hr",{className:te(e,{"has-max-width":t}),style:n})},ag={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},highlightSection:{range:[{height:200,width:674},{height:400,width:1348},{height:1e3,width:1e3},{height:2e3,width:2e3}],sizes:"(max-width: 500px) 674px, (max-width: 1024px) 1348px, (max-width: 1200px) 1000px, 2000px"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"}},Qx=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:i}=e?ag[e]:ag.fallback;return{range:t&&t.length>0?t:r,sizes:n||i}},Xx=({format:e,height:t,query:n,width:r})=>{let i=`w=${r}&h=${t}`;return i=e?`${i}&fm=${e}`:i,i=n?`${i}&${n}`:i,i},q1=({format:e,range:t,url:n,query:r})=>t.map(({height:i,width:a})=>`${n}?${Xx({format:e,height:i,query:r,width:a})} ${a}w`).join(", ");const Vi=({image:e,className:t,testId:n})=>{const{description:r,height:i,type:a,color:s,query:o,url:l,width:u,loading:c,decoding:d,fetchPriority:f}=e,{range:m,sizes:g}=Qx(e),p=q1({format:"avif",query:o,range:m,url:l}),y=q1({format:"webp",query:o,range:m,url:l}),v=q1({format:"",query:o,range:m,url:l});let T={};return s&&(T={"--color":s}),a&&a.includes("svg")?h.jsx("picture",{className:t,style:T,children:h.jsx("img",{src:l,alt:r,loading:c||"lazy",decoding:d||"async",fetchpriority:f||"auto",width:u,height:i,"data-testid":n||"image"})}):h.jsxs("picture",{className:t,style:T,children:[a!=="image/gif"&&h.jsx("source",{type:"image/avif",srcSet:p,sizes:g,"data-testid":"source"}),h.jsx("source",{type:"image/webp",srcSet:y,sizes:g,"data-testid":"source"}),h.jsx("img",{srcSet:v,sizes:g,src:l,alt:r,loading:c||"lazy",decoding:d||"async",fetchpriority:f||"auto",width:u,height:i,"data-testid":n||"image"})]})};const Jx=({image:e,className:t="",testId:n})=>h.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&h.jsx(Vi,{image:{...e},className:"image"})}),Ki=({href:e,children:t,fallbackElement:n,meta:r,className:i="",onClick:a,gtmContext:s,gtmType:o,...l})=>{const{forceOnClick:u=!1}=r||{};if(e){const d={...l};return a&&(d.onClick=a),s&&(d["data-gtm-event-context"]=s),o&&(d["data-gtm-event-type"]=o),h.jsx("a",{href:e,className:te("gtm-trackable",i),...d,children:t})}const c={};return u&&(c.onClick=a),n?E.createElement(n,{children:t,className:i,...l,...c}):h.jsx(h.Fragment,{children:t})};const P4=E.forwardRef(({className:e="",children:t},n)=>{const r=E.useRef(null),i=n||r;return h.jsx("aside",{ref:i,className:te("popover",e),"aria-live":"polite",children:t})}),Us=({parent:e=document.body,children:t})=>typeof document=="object"?Gc.createPortal(t,e):null,e7=Object.freeze(Object.defineProperty({__proto__:null,default:Us},Symbol.toStringTag,{value:"Module"}));const t7=({currentStep:e=1,steps:t=1})=>h.jsxs(h.Fragment,{children:[h.jsx(ot,{children:h.jsx(le.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),h.jsx("div",{className:"progress-tracker",children:h.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const i=r+1;return h.jsxs("div",{className:"dot-wrapper",children:[h.jsx("div",{className:te("dot",{active:i===e,completed:i<e}),"data-testid":"progress-dot"}),h.jsx("div",{className:te("line",{active:i<e})})]},r)})})})]});const n7=({elementId:e,offset:t=20})=>{const n=le.useIntl(),r=()=>{const i=document.getElementById(e);if(!i)return;const a=document.getElementById("header");a&&window.scrollTo({top:i.offsetTop-a.clientHeight-t})};return h.jsx(Ie,{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 r7=({items:e,className:t="",...n})=>h.jsx("ul",{className:te("buckets",t),...n,children:e.map(({title:r,text:i,link:a,...s},o)=>h.jsx("li",{className:"bucket text-medium",children:h.jsxs("a",{href:a,...s,children:[h.jsx("p",{className:"title",children:r}),h.jsx("p",{children:i})]})},o))}),sg=300,og="ease-in-out";class i7{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:sg,easing:og}),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:sg,easing:og}),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 Jc=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const i=le.useIntl(),a=E.useRef(null);return E.useEffect(()=>{let s;return r&&(s=new i7(a.current)),()=>{r&&s&&s.cleanUp()}},[]),h.jsxs("details",{ref:a,className:te("collapsible-section",t,{"should-animate":r}),children:[h.jsx("summary",{children:e||i.formatMessage({id:"collapsibleSection_summary"})}),h.jsx("div",{className:"content",children:n})]})},lg={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},a7=e=>{let t=e;return Object.keys(lg).includes(e)&&(t=lg[e]),`url(${Yn}icons/${t}.svg)`};const ug={customCard:"custom",microcourse:"course",courseJourney:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},R4=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const i=le.useIntl(),a=t?{"--custom-icon":a7(t)}:{},s=Zc(`contentTypeLabel_${e}`)?i.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:h.jsx("small",{className:te("content-type-label text-small",e in ug?ug[e]:e,r,{"has-custom-icon":t}),style:a,"data-testid":"content-type-label",children:n||s})};const In=({variant:e="primary",icon:t,styling:n={},className:r="",children:i,...a})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Yn}icons/${t}.svg)`}:{};return h.jsx("div",{className:te("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...a,children:i})};const Lr=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let i=n&&!!Object.keys(n).length;const a=typeof n=="object"&&"breakpoints"in n,s=Wi(a);if(a&&typeof n=="object"&&typeof s=="number"){const d=Object.assign({},n.breakpoints),f=T4(Object.keys(d));i=_4(s,f,d)}const{breakpoints:o,text:l="",component:u,...c}=n;return h.jsx(In,{variant:"subtle",className:te("empty-state-box",e,r),children:h.jsxs(h.Fragment,{children:[t&&typeof t=="string"?h.jsx(Ir,{options:{forceBlock:!0},children:t}):t,i&&typeof n=="object"&&(u||h.jsx(Ie,{...c,variant:n.variant?n.variant:"secondary",children:l}))]})})};const oh=({children:e,...t})=>h.jsx("p",{...t,children:e}),F4={q:oh,blockquote:oh};for(let e=1;e<=6;e++)F4[`h${e}`]={component:oh,props:{className:"title"}};const B4=({type:e="default",className:t="",heading:n=!1,children:r,...i})=>h.jsxs("div",{...i,className:te("helper-text-box text-small",e,t),children:[n&&h.jsx("p",{className:"title",children:n}),typeof r=="string"?h.jsx(Ir,{options:{wrapper:E.Fragment,forceBlock:!0,overrides:F4},children:r}):h.jsx("p",{children:r})]});const M4=({id:e,className:t="",show:n=!1,hide:r=!1,text:i,markdownOptions:a,fadeStyle:s="default",children:o})=>{const l=le.useIntl(),u=E.useRef(null);e||(e=Date.now().toString());const[c,d]=E.useState(""),[f,m]=E.useState("closed");E.useEffect(()=>{const y=u.current;if(y)return y.addEventListener("transitionend",g),()=>{y.removeEventListener("transitionend",g)}},[]),E.useEffect(()=>{if(!i||typeof i!="string")return;const y=i.split(`
31
+ Thank you for helping to protect the Apolitical community from abusive content.`,discussionFormCard_placeholder:"Create post",discussionFormCard_placeholder_long:"Write a post or ask a question...",discussionFormCard_overlay_title:"Discard post",discussionFormCard_overlay_text:"Are you sure you want to leave without posting? Changes you have made will not be saved.",discussionFormCard_overlay_cta_discard:"Discard",discussionFormCard_overlay_cta_continue:"Continue editing",discussion_form_postType_label:"Post type","discussion_form__postType_no-category":"Post",discussion_form_isAnonymous_label:"Post anonymously",discussion_form_isAnonymous_tooltip_content:"Your name, job title and profile picture will be hidden from other users. Only moderators can see your identity.",discussion_form_member_anonymous_infoMsg:"Your identity will be hidden",discussion_form_title:"Write your {action}",discussion_form_titleField_label:"Title",discussion_form_titleField_placeholder:"Write something...",discussion_form_titleField_error:"Please enter a title or a body for your post.",discussion_form_question_label:"Question",discussion_form_question_placeholder:"Question",discussion_form_option_label:"Options",discussion_form_option_placeholder:"Option {number}",discussion_form_option_cta:"Add option",discussion_form_multiplePollAnswers:"Allow multiple answers",discussion_form_placeholder:"Write a {action}...",discussion_form_label:"Body",discussion_form_label_action:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Create post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Share a question, insight, or announcement with the community",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_showAll:"Show all...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_likes_show:"Show who liked this {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_pin:"Pin post",discussion_moreMenu_unpin:"Unpin post",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments_loading:"... comments",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_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_translation_seeOriginal:"See original",discussion_translation_translate:"Translate to {locale}",discussion_translation_translate_loading:"Translating to {locale}",discussion_translation_translated:"AI translated from {originalLocale}",discussion_translation_translate_error:"There was an error. Please try again.",discussion_translation_coming_soon:"Translation coming soon",discussion_thread_loadMore:"Load more replies",profileModalLauncher_successMessage:"Your post has been created",profileModalLauncher_title:"Your profile is incomplete",profileModalLauncher_text:"A complete profile builds trust and amplifies your voice across the community. Ensure all your details are up to date including a photo and a bio.",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_fieldWrapper_characterLimit_aria_default:"You have {remaining, plural, =0 {no characters} one {1 character} other {# characters}} remaining.",form_fieldWrapper_characterLimit_aria_over:"You are {over, plural, one {1 character} other {# characters}} over the limit. Please shorten your text to {limit} characters.",form_fieldWrapper_characterLimit_info:"You can enter up to {limit} characters",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_error_multipleInputs_same:"Please enter a unique value into each field",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",form_multipleInputs_label:"Input {number}",form_multipleInputs_filledInCount:"{number}/{total}",form_multipleInputs_filledInCount_aria:"{number} out of {total} available inputs have been filled in",form_multipleInputs_remove:"Remove this input",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their email addresses below",inviteForm_message_label:"Add an invitation note",inviteForm_message_placeholder:"Add a personal note to your invitation...",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",inputAutocomplete_placeholder:"Start typing...",passwordRules_unmatched_text:"Passwords do not match",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",passwordRules_currentPassword_label:"Current password",passwordRules_newPassword_label:"New password",passwordRules_confirmPassword_label:"Confirm new password",profileForm_image:"Upload photo",profileForm_name:"Full name",profileForm_name_placeholder:"What's your name, so people can recognise you?",profileForm_jobTitle:"Job title",profileForm_jobTitle_placeholder:"What's your current job title?",profileForm_organization:"Organisation",profileForm_organization_placeholder:"Where do you work?",profileForm_location:"Location",profileForm_location_placeholder:"Add your city",profileForm_location_error:"Please choose a location from the list.",profileForm_bio:"Bio",profileForm_bio_placeholder:"Tell us more about yourself...",profileForm_cta:"Save",profileForm_cta_submitting:"Saving...",profileForm_cta_submitted:"Saved",profileImageChange_cta_uploading:"Uploading image...",profileImageChange_cta_change:"Change photo",profileImageChange_cta_upload:"+ Add profile photo",profileImageChange_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",publishArticleForm_title_label:"Title",publishArticleForm_title_placeholder:"Write a snappy title",publishArticleForm_subtitle_label:"Subtitle",publishArticleForm_subtitle_placeholder:"Your topic, in a nutshell",publishArticleForm_body_label:"Body",publishArticleForm_body_placeholder:"Type or paste your article here",publishArticleForm_tags_label:"Tags (select up to three)",publishArticleForm_cover_image_label:"Cover image",publishArticleForm__tags_topic_CitiesAndLocalGovernment:"Cities and local government",publishArticleForm__tags_topic_Climate:"Energy and climate",publishArticleForm__tags_topic_DigitalAndData:"Digital, data and AI",publishArticleForm__tags_topic_Education:"Education",publishArticleForm__tags_topic_EquityJusticeAndInclusion:"Inclusion",publishArticleForm__tags_topic_HealthAndSocialCare:"Health and social care",publishArticleForm__tags_topic_Innovation:"Innovation",publishArticleForm__tags_topic_LeadershipAndSkills:"Leadership and skills",publishArticleForm__tags_topic_LifeInGovernment:"Life in government",publishArticleForm__tags_topic_Policymaking:"Policymaking",publishArticleForm__tags_topic_TransportAndInfrastructure:"Transport and infrastructure",publishArticleForm__tags_topic_WorkAndTheEconomy:"Work and the economy",publishArticleForm_tags_error_over_three:"You must select no more than three options.",publishArticleForm_tags_error_required:"Please select at least one option.",publishArticleForm_disclaimer:"Ready to publish? Before you do, consider the following: Have you thoroughly proofread your writing? Are you confident in your arguments? Have you included hyperlinks to the necessary resources to support your article?",publishArticleForm_cta_submit:"Publish article",publishArticleForm_cta_submit_edit:"Save",publishArticleForm_cta_submitting:"Publishing...",publishArticleForm_cta_submitting_edit:"Saving...",publishArticleForm_cta_submitted:"Published!",publishArticleForm_cta_submitted_edit:"Saved!",publishArticleForm_aria_success:"Your article is being published. You will be redirected to your article in a moment.",publishArticleForm_aria_success_edit:"Your article is being saved. You will be redirected to your article in a moment.",publishArticleForm_error:"Sorry, something went wrong.",publishArticleForm_error_underMinLength:"Please add at least {length, plural, one {1 character} other {# characters}}.",publishArticleForm_error_loggedOut:"You need to be logged in to publish an article. Please log in and try again.",publishArticleForm_progressBar:"Your article is being published",publishArticleForm_selectImage_button:"Select a cover image",publishArticleForm_replaceImage_button:"Replace Image",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",richTextEditor_placeholder:"Write something...",richTextEditor_toolbar:"Formatting options",richTextEditor_bold:"Bold",richTextEditor_heading_three:"Heading",richTextEditor_italic:"Italic",richTextEditor_strikeThrough:"Strikethrough",richTextEditor_link:"Link",richTextEditor_link_text:"Text:",richTextEditor_link_text_aria:"Text to be linked:",richTextEditor_link_url:"Link:",richTextEditor_link_placeholder:"Type or paste URL",richTextEditor_link_error_required:"Please enter a URL to link to",richTextEditor_link_open:"Open: {link}",richTextEditor_link_open_text:"Opens in a new window",richTextEditor_link_edit:"Edit",richTextEditor_link_remove:"Remove",richTextEditor_link_button:"Add link",richTextEditor_link_enrichedUrl_aria:"Remove this preview for {title}",richTextEditor_link_enrichedUrl_aria_fallback:"the link",richTextEditor_link_enrichedUrl_aria_live:"The link preview has been removed from your post",richTextEditor_ol_list:"Numbered list",richTextEditor_ul_list:"Bullet-point list",richTextEditor_block_quote:"Quote",richTextEditor_mention_fallback:"Can't find who you're looking for? Invite them to the community",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",showpassword_show:"Show",showpassword_hide:"Hide",showpassword_aria_show:"Your password is hidden. Click to show.",showpassword_aria_hide:"Your password is visible. Click to hide.",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",poll_instructions:"Select one{allowMultipleVotes, select, true { or more} other {}}",poll_num_votes:"{number, plural, one {# vote} other {# votes}}",poll_remove_vote_button:"Remove vote{number, plural, =0 {} one {} other {s}}",poll_aria_votes:"You have {number, plural, =0 {not voted on this poll} other {voted for:}}",replies_feed_missing_polls_vote_message:"Please vote above to view all the comments",tableOfContents:"Table of contents",timeToComplete_hours:"{time, plural, =0 {} one {1 hour} other {# hours}}",timeToComplete_hours_short:"{time}h",timeToComplete_minutes:"{time, plural, =0 {} one {1 minute} other {# minutes}}",timeToComplete_minutes_short:"{time}m",timeToComplete_range:"{early} - {late}",timeToComplete_range_aria:"between {early} and {late}",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",progressTracker:"Step {current} of {total}",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_platform_communities:"Communities",footer_community:"Community",footer_community_support:"Support FAQ",footer_community_post:"Post on Apolitical",footer_community_join:"Who can join",footer_community_guidelines:"Guidelines & values",footer_company:"Company",footer_company_news:"News",footer_company_insights:"Insights",footer_company_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_ai:"AI principles",footer_legal_trust:"Trust",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_london:"London address",footer_contact_london_address:"Church House Westminster{br}Deans Yard{br}London, SW1P 3NZ{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_washington:"Washington DC Address",footer_contact_washington_address:"1100 15th St NW{br}Washington, DC 20005{br}United States",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",header_skip:"Skip to main content",header_language_switcher:"Change language",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_communities:"Communities",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_explore_communities:"Communities",header_topics_topics:"Topics",header_topics_topics_climate:"Energy and climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital, data and AI",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"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",header_language_unavailable_en:"This page is only available in English. <link>Learn more →</link>",header_language_unavailable_vi:"Trang này chỉ có sẵn bằng tiếng Anh. <link>Tìm hiểu thêm →</link>","header_language_unavailable_sr-Cyrl":"Ова страница је доступна само на енглеском. <link>Сазнајте више →</link>",header_language_unavailable_de:"Diese Seite ist nur auf Englisch verfügbar. <link>Mehr erfahren →</link>","header_language_unavailable_fr-CA":"Cette page est uniquement disponible en anglais. <link>En savoir plus →</link>",header_language_unavailable_ko:"이 페이지는 영어로만 제공됩니다. <link>자세히 알아보기 →</link>",header_language_unavailable_it:"Questa pagina è disponibile solo in inglese. <link>Scopri di più →</link>",header_language_unavailable_pl:"Ta strona jest dostępna tylko w języku angielskim. <link>Dowiedz się więcej →</link>",header_language_unavailable_ja:"このページは英語でのみ利用可能です。<link>詳細はこちら →</link>",header_language_unavailable_ar:"هذه الصفحة متوفرة باللغة الإنجليزية فقط. <link>اعرف المزيد →</link>",header_language_unavailable_es:"Esta página sólo está disponible en inglés. <link>Más información →</link>",header_language_unavailable_fr:"Cette page est uniquement disponible en anglais. <link>En savoir plus →</link>",header_language_unavailable_pt:"Esta página está disponível apenas em inglês. <link>Saiba mais →</link>",header_language_unavailable_id:"Halaman ini tidak tersedia dalam bahasa yang dipilih. <link>Pelajari lebih lanjut →</link>","header_language_unavailable_pt-BR":"Esta página não está disponível no idioma selecionado. <link>Saiba mais →</link>","header_language_unavailable_es-419":"Esta página sólo está disponible en inglés. <link>Más información →</link>",pageLayout_browserTooSmall:"Sorry, your device is too small to view this content properly. Please change to a different orientation or another device.",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",discussionFormModal_title:"Create a post",discussionFormModal_cta:"Create post",inviteModal_title:"You’re registered",inviteModal_formTitle:"Know someone who might like to join this workshop?",inviteModal_formLabel:"Invite your colleagues by typing or pasting their email addresses below.",inviteModal_cta:"Send",overlay_close:"Close",profileModal_title:"Update your profile",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_links_communities:"Communities",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",editSection_placeholder_description:"Add some details",editSection_placeholder_cta:"add",editSection_edit:"Edit",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",contentTypeLabel_event:"Event",contentTypeLabel_learningHub:"Programme",contentTypeLabel_listPage:"List",contentTypeLabel_microcourse:"Course",contentTypeLabel_qaQuestion:"Q&A",contentTypeLabel_solutionArticle:"Article",contentTypeLabel_communityPage:"Community",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip_survey:"Skip past survey",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll",markdown_iframe_survey:"Survey",member_connection_accept:"Accept",member_connection_cancel:"Cancel Request",member_connection_connect:"Connect",member_connection_connected:"Connected",member_connection_pending:"Pending",member_connection_remove:"Remove Connection",member_connection_requested:"Requested",member_show_email_hide:"Email visible only to connections",member_show_email_private:"Private profile email hidden",member_show_email_show:"Show contact info",member_show_email_tooltip:"Copy email address",member_show_email_tooltip_copied:"Email copied to clipboard",member_show_email_tooltip_mine:"Visible only to your connections",member_show_email_tooltip_private:"The privacy setting for this profile is private"},Ix={...Vt,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>"},Px={...Vt,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"},Rx={...Vt,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>"},Fx={...Vt,languageSwitcher_label:"Saya ingin membaca artikel ini dalam...",languageSwitcher_translation_original:"bahasa asli",languageSwitcher_translation_human:"diterjemahkan oleh manusia",languageSwitcher_translation_machine:"diterjemahkan oleh mesin",languageSwitcher_disclaimer:"Konten ini telah diterjemahkan secara otomatis dan terkadang mungkin terdapat kesalahan dalam penerjemahan gender atau terjemahan langsung lainnya. Kami sedang berusaha memperbaiki hal ini, tetapi jika Anda menemukan kesalahan, mohon beri tahu kami di <link>{email}</link>"},Bx={...Vt,languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traduzido por humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, podem ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos trabalhando para resolver isso, mas se você perceber algo errado, por favor nos avise em <link>{email}</link>"},Mx={...Vt,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>"},Lx={...Vt,languageSwitcher_label:"أود قراءة هذه المقالة بـ...",languageSwitcher_translation_original:"اللغة الأصلية",languageSwitcher_translation_human:"مترجمة بواسطة إنسان",languageSwitcher_translation_machine:"مترجمة آلياً",languageSwitcher_disclaimer:"تمت ترجمة هذا المحتوى تلقائياً وقد يحتوي على أخطاء في النوع أو ترجمات حرفية أخرى. نحن نحاول معالجة هذه المشكلة، ولكن في الوقت الحالي، إذا لاحظت خطأً مهماً، يرجى إعلامنا على <link>{email}</link>",collapsibleSection_summary:"اقرأ المزيد"},$x={...Vt,languageSwitcher_label:"この記事を以下の言語で読みたい...",languageSwitcher_translation_original:"原文",languageSwitcher_translation_human:"人による翻訳",languageSwitcher_translation_machine:"機械翻訳",languageSwitcher_disclaimer:"このコンテンツは自動的に翻訳されており、性別の誤りや直訳などが含まれている可能性があります。現在、これらの問題の解決に取り組んでいますが、重大な誤りにお気づきの場合は、<link>{email}</link> までご連絡ください。",collapsibleSection_summary:"もっと読む"},jx={...Vt,languageSwitcher_label:"Chciał(a)bym przeczytać ten artykuł w...",languageSwitcher_translation_original:"język oryginalny",languageSwitcher_translation_human:"przetłumaczone przez człowieka",languageSwitcher_translation_machine:"przetłumaczone maszynowo",languageSwitcher_disclaimer:"Treść została przetłumaczona automatycznie i może zawierać błędy związane z rodzajem gramatycznym lub inne dosłowne tłumaczenia. Pracujemy nad ich poprawą, ale jeśli zauważysz poważny błąd, daj nam znać na adres <link>{email}</link>",collapsibleSection_summary:"Czytaj więcej"},Hx={...Vt,languageSwitcher_label:"Vorrei leggere questo articolo in...",languageSwitcher_translation_original:"lingua originale",languageSwitcher_translation_human:"tradotto da un essere umano",languageSwitcher_translation_machine:"tradotto automaticamente",languageSwitcher_disclaimer:"Questo contenuto è stato tradotto automaticamente e potrebbe contenere errori di genere o altre traduzioni letterali. Stiamo lavorando per risolvere questi problemi, ma se noti un errore importante, faccelo sapere a <link>{email}</link>",collapsibleSection_summary:"Scopri di più"},Ux={...Vt,languageSwitcher_label:"Желео бих да читам овај чланак на...",languageSwitcher_translation_original:"оригиналном језику",languageSwitcher_translation_human:"превео човек",languageSwitcher_translation_machine:"машински превод",languageSwitcher_disclaimer:"Овај садржај је аутоматски преведен и може садржати грешке у роду или друге дословне преводе. Трудимо се да решимо овај проблем, али у међувремену, ако приметите озбиљну грешку, јавите нам на <link>{email}</link>",collapsibleSection_summary:"Сазнајте више"},zx={...Vt,languageSwitcher_label:"이 기사를 다음 언어로 읽고 싶습니다...",languageSwitcher_translation_original:"원본 언어",languageSwitcher_translation_human:"사람이 번역함",languageSwitcher_translation_machine:"기계 번역",languageSwitcher_disclaimer:"이 콘텐츠는 자동으로 번역되었으며, 성별 오류나 직역 등 부정확한 부분이 포함될 수 있습니다. 저희는 이 문제를 해결하기 위해 노력하고 있으며, 중요한 오류를 발견하셨다면 <link>{email}</link>로 알려주세요.",collapsibleSection_summary:"자세히 보기"},qx={...Vt,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"},Wx={...Vt,languageSwitcher_label:"Ich möchte diesen Artikel lesen auf...",languageSwitcher_translation_original:"Originalsprache",languageSwitcher_translation_human:"von einem Menschen übersetzt",languageSwitcher_translation_machine:"maschinell übersetzt",languageSwitcher_disclaimer:"Dieser Inhalt wurde automatisch übersetzt und kann Fehler bei der Geschlechtszuordnung oder andere Ungenauigkeiten enthalten. Wir arbeiten daran, diese Probleme zu beheben. Wenn Ihnen ein schwerwiegender Fehler auffällt, informieren Sie uns bitte unter <link>{email}</link>.",collapsibleSection_summary:"Mehr erfahren"},Vx={...Vt,languageSwitcher_label:"Tôi muốn đọc bài viết này bằng...",languageSwitcher_translation_original:"ngôn ngữ gốc",languageSwitcher_translation_human:"bản dịch do con người thực hiện",languageSwitcher_translation_machine:"bản dịch tự động",languageSwitcher_disclaimer:"Nội dung này được dịch tự động và có thể chứa một số lỗi về ngữ pháp hoặc cách diễn đạt. Chúng tôi đang nỗ lực cải thiện, nhưng nếu bạn phát hiện lỗi nghiêm trọng, vui lòng thông báo cho chúng tôi tại <link>{email}</link>",collapsibleSection_summary:"Tìm hiểu thêm"},Zc=(e,t=Vt)=>e in t,wr=(e,t,n,r,i={})=>{let a="";return Zc(`${t}_${n}`)?a=e({id:`${t}_${n}`},i):a=e({id:t},{[r]:n,...i}),a},Kx=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let i=n.length-1;i>=0;i--){const a=Math.pow(10,(i+1)*3);if(a<=e){e=Math.round(e*t/a)/t,e===1e3&&i<n.length-1&&(e=1,i++),r=`${e}${n[i]}`;break}}return r},Ku=(e,t)=>E.Children.map(e,n=>Object.is(n,null)||!E.isValidElement(n)?n:E.cloneElement(n,t)),O4=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},Gx=e=>{var a,s;const n=["name","organization","jobTitle","biography"].every(o=>{const l=e[o];return l!=null&&l!==""}),r=((a=e.image)==null?void 0:a.thumbnail)!==void 0,i=((s=e.location)==null?void 0:s.en)!==void 0;return n&&r&&i},Yx=(e,t,n)=>!t.id||!t.name?"":t.error?n.replace(/{{name}}/g,al).replace(/{{id}}/g,al):n.replace(/{{name}}/g,t.name).replace(/{{id}}/g,t.id),N4=async({text:e,template:t,mentions:n,listMembers:r=()=>Promise.resolve([])})=>{var a;if(!n)return e;const i=e.match(Aa);if(!i)return e;for(const s of i){const o=s.replace(Aa,(c,d)=>d),l=n[o];if(!l)continue;const u={};if(typeof l=="object")u.name=l.error?l.error:((a=l==null?void 0:l.data)==null?void 0:a.name)||"",u.id=l.id||"",u.error=l.error;else{const c=l;if(c.startsWith(ih))try{const d=c.replace(ih,"");u.id=d,await r({id:d}).then(f=>{const{name:m,error:g}=f;u.name=g||m||"",u.error=g})}catch{e.replace(s,"@");continue}else continue}e=e.replace(s,u.name?Yx(e,u,t):s)}return e},vm=e=>{const t=e.startsWith("http")?e:`https://${e}`,r=new URL(t).hostname;return{full:t,pretty:r}},Qc=e=>typeof window>"u"?null:new URLSearchParams(window.location.search).get(e),sl=(e="")=>e.replace(/\s+/g,"").length>0,sh=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}}};function mi(e){return window!=null&&window.btoa?window.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode("0x"+n))):(console.error("window.btoa is not supported"),e)}const Ra=()=>{const{id:e}=E.useContext(Pt);if(!e)return wa.DEFAULT_LOCALE;const t=D4(mm);return t||wa.DEFAULT_LOCALE},Xc=()=>{const{id:e}=E.useContext(Pt),[t,n]=E.useState(void 0);return E.useEffect(()=>{if(!e){n("/home/");return}const r=D4(mm);if(r){n(`/${r}`);return}n(`/${wa.DEFAULT_LOCALE}`)},[e]),t},I4=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[i,a]=E.useState({current:0,past:0})||[!1,()=>{}],[s,o]=E.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];E.useEffect(()=>(l(),window.addEventListener("scroll",u),()=>{u.flush(),window.removeEventListener("scroll",u)}),[]);const l=()=>{const c=window.scrollY,d=i.current,f=c-d,m=f>0?"down":"up";if(a({current:c,past:d}),m==="down"){c>=e+t.down&&!s.scrollDown&&(!s.scrollUp||f>t.up)&&(n(),o({scrollUp:!1,scrollDown:!0}));return}Math.abs(f)>=t.up&&!s.scrollUp&&(r(),o({scrollUp:!0,scrollDown:!1}))},u=b4(()=>{l()},250);return i},ym=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=E.useRef(!1);Ss(()=>{if(window&&window.location&&window.location.hash){if(n.current)return;const r=document.getElementById(window.location.hash.replace("#",""));r&&(r.scrollIntoView(t?{behavior:"smooth"}:null),n.current=!0)}},e)},Em=(e=!1)=>{if(!e)return{showTooltip:!1,tooltipProps:{}};const[t,n]=E.useState(!1);return{showTooltip:t,tooltipProps:{onClick:()=>n(!0),onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation(),n(!t))},onMouseOver:()=>n(!0),onMouseOut:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1)}}};const ig={},Zx=E.forwardRef(({id:e,styling:t={},isOpen:n=!1,isLoading:r=!1,children:i,className:a="",functions:s={},callbacks:o={},accessibility:l={},...u},c)=>{const d=le.useIntl(),[f]=E.useState(e||Date.now().toString()),m=E.useRef(null),g=c||m,[p,y]=E.useState(n?"open":"hidden"),{extraPadding:v=!0,hasPointer:T=!1,hasForm:_=!1}=t,{onOpen:C=()=>{},onClose:w=()=>{}}=o,{readToScreenreadersWhenClosed:x=!1,...S}=l,N=ig[f];E.useEffect(()=>{const L=g==null?void 0:g.current;if(L)return L.addEventListener("transitionend",B),()=>{L.removeEventListener("transitionend",B)}},[]),E.useEffect(()=>{if(p!=="open")return;const L=O=>{O.key==="Escape"&&(O.stopPropagation(),O.preventDefault(),y("closed"))};return document.addEventListener("keyup",L),()=>{document.removeEventListener("keyup",L)}},[p]);const B=({propertyName:L})=>{L==="opacity"&&(N!==!1&&clearTimeout(N),y(O=>(O==="open"?C():O==="closed"&&w(),O==="opening"?"open":O==="closing"?"closed":O==="closed"?"hidden":O)))};Ss(()=>{N!==!1&&clearTimeout(N);let L="open";n?y("opening"):(y("closing"),L="hidden"),ig[f||""]=setTimeout(()=>{y(L)},300)},[n]);const $={"aria-live":"polite",...u,...S};s&&s.onBlur&&($.onBlur=s.onBlur);const F={className:"content"};return x?F.className=te("content",{hidden:p==="hidden"}):F.hidden=p==="hidden",h.jsx("aside",{ref:g,id:f,className:te("tooltip text-medium",p,a,{loading:r,"extra-padding":v,"has-pointer":T,bottom:T==="bottom","has-form":_}),...$,children:h.jsx("div",{...F,children:r?h.jsx("p",{children:d.formatMessage({id:"tooltip_loading"})}):typeof i=="string"?h.jsx("p",{children:i}):i})})}),pi=E.memo(Zx);const Ie=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:a="button",onClick:s=!1,className:o="",disabled:l=!1,tooltip:u="",forceTooltip:c=!1,screenreaderText:d=!1,children:f=!1,...m})=>{const p=Wi(typeof t=="object"),{showTooltip:y,tooltipProps:v}=Em(!!u);if(typeof t=="object"&&typeof p=="number"){const w=Object.assign({},t),x=T4(Object.keys(w));t=_4(p,x,w)}!l&&u&&!c&&(u="");const T=[];typeof t=="string"&&T.push(t),r&&(T.push("icon"),typeof r=="object"?(T.push(r.icon),r.position?T.push(r.position):T.push("left"),r.hover&&T.push(`hover_${r.hover}`),r.animate&&(T.push("animate"),typeof r.animate=="string"&&T.push(r.animate))):(T.push(r),!r.includes("right")&&!r.includes("left")&&T.push("left")));const _={...m,className:te(e,o,T,{"no-text":!f,disabled:l,button:i,muted:n.muted,"full-width":n.fullWidth}),onClick:w=>{(!i||i[0]==="#")&&s&&(w.preventDefault(),w.stopPropagation()),s&&s(w)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};i&&(a="a",_.href=i);const C=E.createElement(a,_,f||(d?h.jsx(ot,{showOnFocus:!1,children:d}):null));return c||l&&u?h.jsxs("span",{className:"button-container",...v,children:[h.jsx(pi,{isOpen:y,accessibility:{readToScreenreadersWhenClosed:!0},children:u}),C]}):C},Hs=({buttons:e,wrappers:t=[],className:n="",...r})=>{const i=e.length>1?"ul":"p",a=e.map((s,o)=>{var l;return i==="p"?h.jsx(Ie,{...s},o):h.jsx("li",{className:((l=t[o])==null?void 0:l.className)||"",children:h.jsx(Ie,{...s})},o)});return E.createElement(i,{className:te("button-wrapper",n),...r,children:a})};const pr=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return h.jsx("hr",{className:te(e,{"has-max-width":t}),style:n})},ag={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},highlightSection:{range:[{height:200,width:674},{height:400,width:1348},{height:1e3,width:1e3},{height:2e3,width:2e3}],sizes:"(max-width: 500px) 674px, (max-width: 1024px) 1348px, (max-width: 1200px) 1000px, 2000px"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"}},Qx=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:i}=e?ag[e]:ag.fallback;return{range:t&&t.length>0?t:r,sizes:n||i}},Xx=({format:e,height:t,query:n,width:r})=>{let i=`w=${r}&h=${t}`;return i=e?`${i}&fm=${e}`:i,i=n?`${i}&${n}`:i,i},q1=({format:e,range:t,url:n,query:r})=>t.map(({height:i,width:a})=>`${n}?${Xx({format:e,height:i,query:r,width:a})} ${a}w`).join(", ");const Vi=({image:e,className:t,testId:n})=>{const{description:r,height:i,type:a,color:s,query:o,url:l,width:u,loading:c,decoding:d,fetchPriority:f}=e,{range:m,sizes:g}=Qx(e),p=q1({format:"avif",query:o,range:m,url:l}),y=q1({format:"webp",query:o,range:m,url:l}),v=q1({format:"",query:o,range:m,url:l});let T={};return s&&(T={"--color":s}),a&&a.includes("svg")?h.jsx("picture",{className:te("responsive-image",t),style:T,children:h.jsx("img",{src:l,alt:r,loading:c||"lazy",decoding:d||"async",fetchpriority:f||"auto",width:u,height:i,"data-testid":n||"image"})}):h.jsxs("picture",{className:te("responsive-image",t),style:T,children:[a!=="image/gif"&&h.jsx("source",{type:"image/avif",srcSet:p,sizes:g,"data-testid":"source"}),h.jsx("source",{type:"image/webp",srcSet:y,sizes:g,"data-testid":"source"}),h.jsx("img",{srcSet:v,sizes:g,src:l,alt:r,loading:c||"lazy",decoding:d||"async",fetchpriority:f||"auto",width:u,height:i,"data-testid":n||"image"})]})};const Jx=({image:e,className:t="",testId:n})=>h.jsx("div",{className:`image-container ${t}`,"data-testid":n||"image-container",children:e&&h.jsx(Vi,{image:{...e},className:"image"})}),Ki=({href:e,children:t,fallbackElement:n,meta:r,className:i="",onClick:a,gtmContext:s,gtmType:o,...l})=>{const{forceOnClick:u=!1}=r||{};if(e){const d={...l};return a&&(d.onClick=a),s&&(d["data-gtm-event-context"]=s),o&&(d["data-gtm-event-type"]=o),h.jsx("a",{href:e,className:te("gtm-trackable",i),...d,children:t})}const c={};return u&&(c.onClick=a),n?E.createElement(n,{children:t,className:i,...l,...c}):h.jsx(h.Fragment,{children:t})};const P4=E.forwardRef(({className:e="",children:t},n)=>{const r=E.useRef(null),i=n||r;return h.jsx("aside",{ref:i,className:te("popover",e),"aria-live":"polite",children:t})}),Us=({parent:e=document.body,children:t})=>typeof document=="object"?Gc.createPortal(t,e):null,e7=Object.freeze(Object.defineProperty({__proto__:null,default:Us},Symbol.toStringTag,{value:"Module"}));const t7=({currentStep:e=1,steps:t=1})=>h.jsxs(h.Fragment,{children:[h.jsx(ot,{children:h.jsx(le.FormattedMessage,{id:"progressTracker",values:{current:e,total:t}})}),h.jsx("div",{className:"progress-tracker",children:h.jsx("div",{className:"dots-wrapper",children:new Array(t).fill("").map((n,r)=>{const i=r+1;return h.jsxs("div",{className:"dot-wrapper",children:[h.jsx("div",{className:te("dot",{active:i===e,completed:i<e}),"data-testid":"progress-dot"}),h.jsx("div",{className:te("line",{active:i<e})})]},r)})})})]});const n7=({elementId:e,offset:t=20})=>{const n=le.useIntl(),r=()=>{const i=document.getElementById(e);if(!i)return;const a=document.getElementById("header");a&&window.scrollTo({top:i.offsetTop-a.clientHeight-t})};return h.jsx(Ie,{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 r7=({items:e,className:t="",...n})=>h.jsx("ul",{className:te("buckets",t),...n,children:e.map(({title:r,text:i,link:a,...s},o)=>h.jsx("li",{className:"bucket text-medium",children:h.jsxs("a",{href:a,...s,children:[h.jsx("p",{className:"title",children:r}),h.jsx("p",{children:i})]})},o))}),sg=300,og="ease-in-out";class i7{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:sg,easing:og}),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:sg,easing:og}),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 Jc=({label:e=!1,className:t="",children:n,shouldAnimate:r=!1})=>{const i=le.useIntl(),a=E.useRef(null);return E.useEffect(()=>{let s;return r&&(s=new i7(a.current)),()=>{r&&s&&s.cleanUp()}},[]),h.jsxs("details",{ref:a,className:te("collapsible-section",t,{"should-animate":r}),children:[h.jsx("summary",{children:e||i.formatMessage({id:"collapsibleSection_summary"})}),h.jsx("div",{className:"content",children:n})]})},lg={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},a7=e=>{let t=e;return Object.keys(lg).includes(e)&&(t=lg[e]),`url(${Yn}icons/${t}.svg)`};const ug={customCard:"custom",microcourse:"course",courseJourney:"course",solutionArticle:"article",qaQuestion:"question",listPage:"list",learningHub:"learning-hub",communityPage:"communityPage"},R4=({contentType:e,customIcon:t,customLabel:n,className:r=""})=>{const i=le.useIntl(),a=t?{"--custom-icon":a7(t)}:{},s=Zc(`contentTypeLabel_${e}`)?i.formatMessage({id:`contentTypeLabel_${e}`}):!1;return!n&&!s?null:h.jsx("small",{className:te("content-type-label text-small",e in ug?ug[e]:e,r,{"has-custom-icon":t}),style:a,"data-testid":"content-type-label",children:n||s})};const In=({variant:e="primary",icon:t,styling:n={},className:r="",children:i,...a})=>{const{showHighlight:s=!1,background:o="default"}=n,l=t?{"--icon":`url(${Yn}icons/${t}.svg)`}:{};return h.jsx("div",{className:te("highlighted-text-box",e,r,{"has-icon":t,"show-highlight":s,[o]:o!=="default"}),style:l,...a,children:i})};const Lr=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let i=n&&!!Object.keys(n).length;const a=typeof n=="object"&&"breakpoints"in n,s=Wi(a);if(a&&typeof n=="object"&&typeof s=="number"){const d=Object.assign({},n.breakpoints),f=T4(Object.keys(d));i=_4(s,f,d)}const{breakpoints:o,text:l="",component:u,...c}=n;return h.jsx(In,{variant:"subtle",className:te("empty-state-box",e,r),children:h.jsxs(h.Fragment,{children:[t&&typeof t=="string"?h.jsx(Ir,{options:{forceBlock:!0},children:t}):t,i&&typeof n=="object"&&(u||h.jsx(Ie,{...c,variant:n.variant?n.variant:"secondary",children:l}))]})})};const oh=({children:e,...t})=>h.jsx("p",{...t,children:e}),F4={q:oh,blockquote:oh};for(let e=1;e<=6;e++)F4[`h${e}`]={component:oh,props:{className:"title"}};const B4=({type:e="default",className:t="",heading:n=!1,children:r,...i})=>h.jsxs("div",{...i,className:te("helper-text-box text-small",e,t),children:[n&&h.jsx("p",{className:"title",children:n}),typeof r=="string"?h.jsx(Ir,{options:{wrapper:E.Fragment,forceBlock:!0,overrides:F4},children:r}):h.jsx("p",{children:r})]});const M4=({id:e,className:t="",show:n=!1,hide:r=!1,text:i,markdownOptions:a,fadeStyle:s="default",children:o})=>{const l=le.useIntl(),u=E.useRef(null);e||(e=Date.now().toString());const[c,d]=E.useState(""),[f,m]=E.useState("closed");E.useEffect(()=>{const y=u.current;if(y)return y.addEventListener("transitionend",g),()=>{y.removeEventListener("transitionend",g)}},[]),E.useEffect(()=>{if(!i||typeof i!="string")return;const y=i.split(`
32
32
  `);d(y.length<3?`${i.substring(0,400)}...`:y.slice(0,3).join(`
33
33
  `))},[i]),E.useEffect(()=>{f==="ready-to-close"&&m("closing")},[f]);const g=({propertyName:y})=>{y==="max-height"&&m(v=>v==="opening"?"open":v==="closing"?"closed":v)},p=["opening","open"].includes(f);return h.jsxs(In,{variant:"subtle",className:te("hide-show-text-box",t),children:[h.jsx("div",{ref:u,id:e,className:te("content",f,s),children:i?h.jsxs(h.Fragment,{children:[h.jsx(Ir,{options:{forceBlock:!0,...a},children:f==="closed"?c:i}),f!=="closed"&&o]}):o}),h.jsx("p",{className:"cta",children:h.jsx(Ie,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:te({"rotate-180":p}),onClick:()=>{m(p?"ready-to-close":"opening")},"aria-expanded":p,"aria-controls":e,children:p?r||l.formatMessage({id:"hideShowTextBox_hide"}):n||l.formatMessage({id:"hideShowTextBox_show"})})})]})};const s7=({element:e="ul",layout:t="vertical",variant:n="default",items:r=[],styling:i={},className:a=""})=>{const{hasBorder:s=!1,zebraStriping:o=!1}=i;return E.createElement(e,{className:te("icon-bulleted-list text-medium",n,a,{"has-border":s,"has-zebra-stripes":o,[t]:e!=="dl"}),children:r.map((l,u)=>{const c={wrapper:E.Fragment,forceInline:!0},d={"--icon":`url(${Yn}icons/${l.icon}.svg)`};return e==="dl"?h.jsxs(E.Fragment,{children:[h.jsx("dt",{style:d,children:h.jsx(Ir,{options:c,children:l.dt||""})},`dt-${u}`),h.jsx("dd",{children:typeof l.text=="string"?h.jsx(Ir,{options:c,children:l.text}):l.text},`dd-${u}`)]},`dl-${u}`):h.jsx("li",{style:d,children:typeof l.text=="string"?h.jsx(Ir,{options:c,children:l.text}):l.text},u)})})},Gt=()=>E.Fragment,o7=({children:e})=>h.jsx(In,{variant:"secondary",children:e}),l7=({children:e})=>typeof e=="object"&&Object.keys(e||{}).length===1?h.jsx("p",{className:"center",children:e}):h.jsx("div",{className:"center",children:e}),u7=["span","strong","h1","h2","h3","h4","h5","h6","p"],c7=({children:e})=>{const t=le.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const a of E.Children.toArray(e))if(!(!a||typeof a=="string"||typeof a=="number"))if(E.isValidElement(a)&&a.type==="summary"){if(a.props&&a.props.children){for(const s of E.Children.toArray(a.props.children))if(!(!s||typeof s=="string"||typeof s=="number")&&E.isValidElement(s)){const o=s.type;if(u7.includes(o)){for(n=s.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(a);const i=n?n.toString():"";return h.jsx(Jc,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:r.map(a=>a)})},d7=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return h.jsx(In,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return h.jsx(In,{variant:"primary",children:e});case"pink-textbox":return h.jsx(In,{variant:"tertiary",children:e});case"content":return typeof e=="object"&&Object.keys(e||{}).length===1?h.jsx("p",{children:e}):e;default:return h.jsx("div",{...t,children:e})}return h.jsx("div",{...t,children:e})},Hn=({children:e})=>h.jsx(h.Fragment,{children:e}),bm=E.createContext({badges:[],isLoading:!0});function L4(){return E.useContext(bm)}const $4=({children:e,badges:t})=>h.jsx(bm.Provider,{value:t,children:e}),j4=({showDevTools:e=!0,children:t})=>{const n=new ft.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return h.jsxs(ft.QueryClientProvider,{client:n,children:[t,e&&h.jsx(mx.ReactQueryDevtools,{initialIsOpen:!1})]})};var Tm=E.createContext({client:rs});function H4(e,t,n){if(n===void 0&&(n=new WeakMap),e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var a=0,s=r;a<s.length;a++){var o=s[a];if(!i.includes(o)||!H4(e[o],t[o],n))return!1}return!0}function f7(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,a=E.useRef(null),s=E.useMemo(function(){return n?(r&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),i&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),n):(r||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),rs)},[n,r,JSON.stringify(i)]);return E.useEffect(function(){if(!n){var o=a.current;o?(r!==o.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),i&&!H4(i,o.options)&&rs.set_config(i),a.current={apiKey:r,options:i??{}}):(rs.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),rs.init(r,i),a.current={apiKey:r,options:i??{}})}},[n,r,JSON.stringify(i)]),E.createElement(Tm.Provider,{value:{client:s}},t)}var h7=function(){var e=E.useContext(Tm).client;return e};function us(e){var t=h7(),n=E.useState(function(){return t.isFeatureEnabled(e)}),r=n[0],i=n[1];return E.useEffect(function(){return t.onFeatureFlags(function(){i(t.isFeatureEnabled(e))})},[t,e]),r}var lh=function(e,t){return lh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},lh(e,t)};function m7(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");lh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var W1=function(e){return typeof e=="function"},p7={componentStack:null,exceptionEvent:null,error:null},g7={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(e){m7(t,e);function t(n){var r=e.call(this,n)||this;return r.state=p7,r}return t.prototype.componentDidCatch=function(n,r){var i=this.props.additionalProperties,a;W1(i)?a=i(n):typeof i=="object"&&(a=i);var s=this.context.client,o=s.captureException(n,a),l=r.componentStack;this.setState({error:n,componentStack:l,exceptionEvent:o})},t.prototype.render=function(){var n=this.props,r=n.children,i=n.fallback,a=this.state;if(a.componentStack==null)return W1(r)?r():r;var s=W1(i)?E.createElement(i,{error:a.error,componentStack:a.componentStack,exceptionEvent:a.exceptionEvent}):i;return E.isValidElement(s)?s:(console.warn(g7.INVALID_FALLBACK),E.createElement(E.Fragment,null))},t.contextType=Tm,t})(E.Component);const U4=({children:e,user:t,disableSessionRecording:n=!1})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?h.jsx(f7,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id},disable_session_recording:n,session_recording:{maskAllInputs:!0,maskTextSelector:"*",maskTextFn:(r,i)=>(i==null?void 0:i.dataset.phunmask)==="true"?r:"*".repeat((r||"").trim().length)}},children:e}):h.jsx(h.Fragment,{children:e});var z4=(e=>(e.COMMUNITY_RANKING="community-ranking",e))(z4||{});const v7={en:Vt,es:Ix,fr:Px,pt:Rx,id:Fx,"pt-BR":Bx,"es-419":Mx,vi:Vx,"sr-Cyrl":Ux,de:Wx,"fr-CA":qx,ko:zx,it:Hx,pl:jx,ja:$x,ar:Lx},q4=({children:e,locale:t,messages:n})=>{const r=t||wa.DEFAULT_LOCALE,i={...v7[r],...n||{}};return h.jsx(le.IntlProvider,{locale:r,messages:i,children:e})},_m=E.createContext({}),Pt=E.createContext({isLoading:!0});function e1(){return E.useContext(Pt)}const W4=({children:e,user:t,updateDetails:n})=>h.jsx(Pt.Provider,{value:{...t,updateDetails:n},children:e}),Cm=E.createContext({registerOverlay:()=>{},unregisterOverlay:()=>{}}),V4=()=>E.useContext(Cm),K4=({children:e})=>{const[t,n]=E.useState([]);E.useEffect(()=>{t.length>0?document.body.classList.add("has-overlay"):document.body.classList.remove("has-overlay")},[t]);const r=E.useCallback(a=>{n(s=>[...s,a])},[]),i=E.useCallback(a=>{n(s=>s.filter(o=>o!==a))},[]);return h.jsx(Cm.Provider,{value:{registerOverlay:r,unregisterOverlay:i},children:e})},y7=({bootstrap:e,children:t,intl:n,showDevTools:r})=>{const[i,a]=E.useState({isLoading:!0}),[s,o]=E.useState({badges:[],isLoading:!0}),l=(n==null?void 0:n.locale)||localStorage.getItem("language")||"en",[u,c]=E.useState(l),d=f=>{localStorage.setItem("language",f),c(f)};return E.useEffect(()=>{e().then(f=>{Array.isArray(f)?(a({...f[0],isLoading:!1}),o({badges:f[1],isLoading:!1})):a({...f,isLoading:!1}),O4(5e3)}).catch(f=>{f.message===A4&&window.location.pathname!=="/logout"&&(window.location.href="/logout"),a({isLoading:!1}),o({badges:[],isLoading:!1})})},[]),h.jsx(_m.Provider,{value:{language:u,updateLanguage:d},children:h.jsx(q4,{locale:u,messages:n==null?void 0:n.messages,children:h.jsx(hm.CookiesProvider,{children:h.jsx(W4,{user:i,updateDetails:a,children:h.jsx($4,{badges:s,children:h.jsx(K4,{children:h.jsx(j4,{showDevTools:r,children:h.jsx(U4,{user:i,children:t})})})})})})})})},E7=e=>{const t=le.useIntl(),n=Date.now().toString(),r=E.useContext(Pt);let i="default",a=e.src;a.includes("youtube")||a.includes("vimeo")?i="video":a.includes("riddle")||a.includes("sli.do")?i="poll":a.includes("padlet")?i="padlet":a.includes("surveysparrow")&&(i="survey",r!=null&&r.id&&(a=`${a}&user_id=${r.id}`));const s=`content-after-iframe-${n}`;return h.jsxs(h.Fragment,{children:[h.jsx(ot,{element:"a",href:`#${s}`,onClick:o=>{o.preventDefault(),o.stopPropagation();const l=document.getElementById(s);l==null||l.scrollIntoView({behavior:"smooth"}),l==null||l.focus()},children:t.formatMessage({id:`markdown_skip${i==="default"?"":`_${i}`}`})}),h.jsx("iframe",{...e,src:a,title:t.formatMessage({id:`markdown_iframe${i==="default"?"":`_${i}`}`})}),h.jsx("span",{id:s,tabIndex:0})]})},cg=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},b7=({children:e,...t})=>{const n=le.useIntl();let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let i=e,a=!1;for(const o of E.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&E.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"||cg(o.props.children[0])==="button")&&(a=!0),i=o.props.children[0];i&&typeof i!="string"&&!(typeof i=="boolean"||typeof i=="number"||!E.isValidElement(i));)if(i.props&&i.props.children&&i.props.children[0])i=i.props.children[0],i&&cg(i)==="button"&&(a=!0);else break}const s=`@${al}`;return i===s||Array.isArray(i)&&i[0]===s?(delete r.href,delete r.target,h.jsxs("span",{...r,className:"mention deleted-user",children:["@",n.formatMessage({id:"member_deleted"})]})):a?(r={...r,className:"button primary medium"},h.jsx("p",{className:"center",children:h.jsx(Ie,{variant:"primary",size:"medium",...r,children:i})})):h.jsx("a",{...r,children:i})},uh=({children:e,...t})=>h.jsx("span",{className:te({url:t==null?void 0:t.href}),children:e});const T7={default:{a:b7,CollapsibleSection:Jc,TextBox:In,CaseStudy:o7,style:Gt,details:c7,div:d7,iframe:E7,center:l7,script:Gt},"text-only":{h1:Gt,h2:Gt,h3:Gt,h4:Gt,h5:Gt,h6:Gt,style:Gt,details:Gt,div:Gt,TextBox:Gt,CollapsibleSection:Gt,CaseStudy:Gt,blockquote:Gt,iframe:Gt,button:Gt}},Sa=({element:e="div",className:t="",options:n={},children:r,overrideType:i="default",styling:a={}})=>{if(!r)return null;const{highlightTitles:s=!1}=a;r=r.replace(/^<br\/?>/,"");const o={wrapper:E.Fragment,forceBlock:!0};let l=T7[i];return n.overrides&&(l={...l,...n.overrides}),E.createElement(e,{className:te("markdown-text",t,{"highlight-titles":s}),children:h.jsx(Ir,{options:{...o,...n,overrides:l},children:r})})};const G4=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:i="",ctaButton:a})=>{const s=e?{"--max-width":`${e/16}rem`}:{};return h.jsxs("section",{className:te("page-heading",i),children:[h.jsxs("div",{className:te("content",{"has-max-width":e}),style:s,children:[h.jsxs("div",{className:te("content-wrapper",{"has-max-width":e}),children:[t&&t.text&&E.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&E.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),a&&h.jsx(Ie,{...a,className:te("cta-button","gtm-trackable"),"data-gtm-event-context":"CreateNewArticle","data-gtm-event-type":"create-article-click",children:a.text})]}),r]})};const Pr=({size:e="medium",variant:t="default",className:n="",icon:r,tooltip:i="",children:a,element:s="span",...o})=>{const l={"--icon":`url(${Yn}icons/${r}.svg)`},{showTooltip:u,tooltipProps:c}=Em(!!i),d={},f=i?typeof i=="string"?`tooltip-${mi(i)}`:i.id:void 0,m=i?typeof i=="string"?i:i.text:void 0;i&&f&&(d["aria-describedby"]=f);const g=E.createElement(i?"button":s,{className:te("pill",e,t,n,{"has-icon":r}),style:l,children:a,...c,...d,...o});return i?E.createElement(s,{className:"pill-wrapper"},h.jsxs(h.Fragment,{children:[g,h.jsx(pi,{id:f,isOpen:u,children:m})]})):g};const ks=({element:e="p",children:t=null,className:n="",...r})=>E.createElement(e,{...r,className:te("status-banner text-small",n),"aria-live":"assertive"},t),_7={globe:"globe",heart:"heart_empty_thick",pencil:"pencil",star:"star_empty","speech-bubble":"speech-bubble_round"};const C7=e=>e.toLowerCase().replace(/\s+/g,"-"),Y4=({slug:e})=>{const t=le.useIntl(),n="badgeName",{badges:r}=L4(),i=r==null?void 0:r.find(d=>d.slug===e);if(!i)return null;const{name:a,icon:s,colour:o,description:l}=i,u=C7(a),c=t.formatMessage({id:`${n}_${u}`,defaultMessage:a});return h.jsx(Pr,{className:te("user-badge",o==null?void 0:o.toLowerCase()),icon:s&&_7[s],element:"li",tooltip:l,children:c})};var nn=(e=>(e.Communities="communities",e.Platform="platform",e))(nn||{});const Z4=({userBadges:e,badgeOptions:{scopes:t}})=>{if(Object.keys(e).length===0||!t)return;const n=t.flatMap(r=>{var i;return(i=e==null?void 0:e[r.scope])==null?void 0:i[r.area]}).filter(Boolean);return h.jsx("ul",{className:"badges-list",children:n.map((r,i)=>h.jsx(Y4,{slug:r},`${i}-${r}`))})};var xm=(e=>(e.Accepted="accepted",e.Cancelled="cancelled",e.Declined="declined",e.Pending="pending",e.Removed="removed",e))(xm||{}),wm=(e=>(e.In="in",e.Out="out",e))(wm||{});const{In:x7,Out:dg}=wm,{Pending:V1,Accepted:fg,Cancelled:w7,Removed:A7}=xm,Q4=({functions:e,connection:t={status:null,direction:null},disableConnect:n=!1,meta:{topLevelButton:r=!1}={},...i})=>{const{formatMessage:a}=le.useIntl(),{status:s,direction:o}=t,{onAccept:l,onCancel:u,onRemove:c,onRequest:d}=e,[f,m]=E.useState(!1),[g,p]=E.useState(s),[y,v]=E.useState(o);E.useEffect(()=>{p(s),v(o)},[s,o]);const T=async(_,C)=>{try{m(!0),await _()&&(C!=null&&C.status&&p(C.status),C!=null&&C.direction&&v(C.direction))}finally{m(!1)}};return g===V1&&y===dg?h.jsx(Ie,{onClick:async()=>{await T(l,{status:fg})},disabled:f,variant:r?"primary":"secondary",size:"small",icon:{icon:"user-plus"},...i,children:a({id:"member_connection_accept"})}):g===V1&&y===x7?h.jsxs("div",{className:"connection-cta-wrapper",children:[h.jsx("span",{className:"button secondary connection-cta pending small icon clock left",...i,children:a({id:"member_connection_pending"})}),u&&h.jsx(Fc,{options:[{onClick:async()=>{await T(u,{status:w7})},text:a({id:"member_connection_cancel"})}]})]}):g===fg?h.jsxs("div",{className:"connection-cta-wrapper",children:[h.jsx("span",{className:"button secondary connection-cta connected small icon tick left",...i,children:a({id:"member_connection_connected"})}),c&&h.jsx(Fc,{options:[{onClick:async()=>{await T(c,{status:A7})},text:a({id:"member_connection_remove"})}]})]}):!g&&d&&!n?h.jsx(Ie,{onClick:async()=>{await T(d,{status:V1,direction:dg})},variant:r?"primary":"secondary",size:"small",disabled:f,icon:{icon:"user-plus"},...i,children:a({id:"member_connection_connect"})}):h.jsx(h.Fragment,{})};const S7=({styling:e={},progress:t=0,text:n=!1,className:r=""})=>{const i=le.useIntl(),{showText:a=!1,layout:s="bar",size:o="default",color:l="default"}=e,u=t>75?100:t>50?75:t>25?50:t>5?25:0,c={"--progress":`${t}%`};return h.jsx("span",{className:te(`progress-bar section-${u}`,s,r,{[o]:o!=="default",[l!=="default"?l:""]:l!=="default"}),style:c,children:E.createElement(a?"span":ot,{className:a?"text":"",children:n||i.formatMessage({id:"progressBar"},{number:t})})})},Am=E.memo(S7);const K1="loadingBlock_",k7=({progress:e=0,steps:t=!1,className:n=""})=>{const r=le.useIntl();t||(t={0:{text:r.formatMessage({id:`${K1}loading`})},75:{text:r.formatMessage({id:`${K1}almostDone`})},100:{text:r.formatMessage({id:`${K1}complete`})}});let i=null;const a=Object.keys(t);for(let o=0;o<a.length&&!(e<parseInt(a[o]));o++)i=a[o];const s=i&&t[i].icon?{"--icon":`url(${Yn}icons/${t[i].icon}.svg)`}:{};return h.jsxs(In,{className:te("loading-block",n,{"has-icon":i&&t[i].icon}),variant:"subtle",style:s,children:[i&&h.jsx("span",{className:"step",children:t[i].text}),h.jsx(Am,{progress:e})]})},X4=E.memo(k7);const Jn=({element:e="div",className:t="",...n})=>h.jsx(Yc,{element:e,className:te("loading-placeholder",t),...n});const ch={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],heading:["title"],cards:["card","card","card","card"],carousel:["cards","controls"],"carousel-with-title":["title","cards","controls"],answers:["text","text","text"],"text-page":["title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"form-with-answers":["question","subtitle","form","answers","answers","answers","answers","answers"],"general-website-page":["banner","text-page"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"],member:["profile-picture","text","text"],"course-navigation":["button","button"],"course-lesson-page":["breadcrumb","course-navigation","text-page"],"course-lesson-quiz":["text-page","quiz-box"]},J4=(e,t)=>e in ch?h.jsx("div",{className:e,children:ch[e].map((n,r)=>J4(n,r))},t):h.jsx(Jn,{className:e},t),t1=({layout:e="overview-page",...t})=>h.jsx("div",{className:te("loading-state",e),...t,children:ch[e].map((n,r)=>J4(n,r))}),eb=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):""},Ul=["#5AB6A3","#A2D7AF","#806056","#3962B3"],D7=e=>{const t=Math.ceil(26/Ul.length),n=eb(e).toLowerCase();if(n==="")return Ul[0];const r=n.charCodeAt(0)-96;for(let i=0;i<Ul.length;i++)if(r<=t*(i+1))return Ul[i]};const hg=256,gi=({className:e="",src:t="",name:n,alt:r,width:i=hg,height:a=hg,showInitials:s=!0,...o})=>{const[l,u]=E.useState(!1),c=E.useRef(null),d=r??n;E.useEffect(()=>{const m=c.current;if(!m)return;const g=m.getContext("2d");if(!g)return;const p=i,y=a;typeof window<"u"&&window.devicePixelRatio&&(m.width=p*window.devicePixelRatio,m.height=y*window.devicePixelRatio,g.scale(window.devicePixelRatio,window.devicePixelRatio)),g.fillStyle=D7(n),g.fillRect(0,0,p,y),g.font=`${p/3}px Arial`,g.textAlign="center",g.fillStyle="white",g.fillText(eb(n),p/2,y/1.6)},[n]);let f=!1;return t&&t!==""&&!l&&(t.includes("http")||t.includes("//"))&&(f=!0),h.jsx("figure",{className:te("profile-picture","ph-no-capture",e,{error:l}),...o,children:f?h.jsx("img",{src:t,alt:d,onError:()=>{u(!0)},width:i,height:a}):s?h.jsx("canvas",{ref:c}):h.jsx("span",{className:"fallback"})})};var Ut=(e=>(e.DISCUSSION_FORM_SUBMITTED="discussionFormSubmitted",e.DISCUSSION_POST_ADDED="discussionPostAdded",e.DISCUSSION_POST_CLICKED="discussionPostClicked",e.MEMBER_CLICKED="memberClicked",e))(Ut||{});const n1=e=>e==="anonymous"?{image:`${Yn}logos/member_anonymous.png`}:e==="apolitical"?{image:`${Yn}logos/member_apolitical.svg`}:e==="community"||e==="deleted"||typeof e=="object"&&!e.name?{image:`${Yn}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.en||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail,badges:e.badges},O7=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const i=e!=="",a=t!=="",s=n!=="";if(!i&&!a&&!s)return"";const o=`${e}${i&&a?` — ${t}`:t}`;let l=`${o}${(i||a)&&s?`, ${n}`:n}`;return l.length>r&&(l=o),l.length>r&&(l=rl(l,r)),l};const N7=E.lazy(()=>Promise.resolve().then(()=>e7)),I7=E.lazy(()=>Promise.resolve().then(()=>Uie));let zl=null;const li=({element:e="div",member:t="community",alt:n="",additionalContent:r=!1,styling:i={},functions:a={},gtmContext:s="member",gtmType:o="member-click",className:l="",badges:u,connection:c,...d})=>{var U,D,X,Z,k,b;const f=le.useIntl(),{profile:m,connections:g,...p}=a,{size:y="medium",variant:v="inline",isCondensed:T=!0,additionalContentNewLine:_=!1}=i,C=E.useContext(Pt),w=m&&C&&typeof C.id=="string",[x,S]=E.useState(!1),N=n1(t);N.name||(N.name=f.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:B,image:$}=N;let{url:F}=N;typeof t=="object"&&t.link!==void 0&&(t.link===!1?F=void 0:F=t.link);const L=O7(N),O=r&&r.createdAt?ah(r.createdAt):!1,P=r&&r.createdAt?gm(r.createdAt):"",M=!F&&w;return E.createElement(e,{...d,className:te("member text-medium",y,v,l,{"has-profile-link":w}),...p,children:h.jsxs(h.Fragment,{children:[h.jsxs(Ki,{href:F,className:te({"details-wrapper":M}),fallbackElement:M?"div":void 0,gtmType:o,gtmContext:s,meta:{forceOnClick:!0},onClick:q=>{if(q==null||q.preventDefault(),q==null||q.stopPropagation(),!F){M&&S(!0);return}zl&&clearTimeout(zl),zl=setTimeout(()=>{window.location.href=F},150);const R=new CustomEvent(Ut.MEMBER_CLICKED,{detail:{link:F,timeout:zl}});document.dispatchEvent(R)},children:[h.jsx(gi,{name:B,src:$,alt:n}),h.jsxs("div",{className:"details",children:[h.jsxs("div",{className:te("name",{"new-line":_}),"data-testid":"member-name",children:[h.jsx("span",{children:B}),(u==null?void 0:u.showBadges)&&(N==null?void 0:N.badges)&&h.jsx(Z4,{userBadges:N.badges,badgeOptions:u}),r&&h.jsxs("span",{className:te("additional-content",{"new-line":_}),children:[r.createdAt&&O&&!((U=r==null?void 0:r.customMessage)!=null&&U.text)&&h.jsx("span",{className:"date",title:P,"aria-label":P,"data-testid":"date",children:f.formatMessage({id:`dates_${O.path}`},{number:O.number})}),r.createdAt&&O&&((D=r==null?void 0:r.customMessage)==null?void 0:D.text)&&h.jsx("span",{children:f.formatMessage({id:O.path==="now"?(X=r.customMessage)==null?void 0:X.nowText:(Z=r.customMessage)==null?void 0:Z.text},{time:f.formatMessage({id:`dates_${O.path}`},{number:O.number}),community:(b=(k=r.customMessage)==null?void 0:k.link)==null?void 0:b.text,link:q=>{var R,j;return h.jsx("a",{href:`${(j=(R=r.customMessage)==null?void 0:R.link)==null?void 0:j.url}`,onClick:H=>H.stopPropagation(),children:q})}})}),r.didEdit&&h.jsx("em",{children:f.formatMessage({id:"discussion_edited"})})]})]}),L&&!_&&h.jsx("small",{className:te({"text-medium":y==="large"}),"data-testid":"member-details",children:T?L:h.jsxs(h.Fragment,{children:[N.role,N.organisation?` — ${N.organisation}`:h.jsx(h.Fragment,{}),h.jsx("span",{className:"location",children:N.country})]})})]})]}),g&&h.jsx(Q4,{connection:c,functions:g}),L&&m&&w?h.jsxs(h.Fragment,{children:[h.jsx(Ie,{variant:"tertiary",size:"small",onClick:q=>{q.preventDefault(),q.stopPropagation(),S(!0)},"data-testid":"profile-button",children:f.formatMessage({id:"member_profile"})}),h.jsx(N7,{children:h.jsx(I7,{form:m,showModal:x,content:{title:f.formatMessage({id:"member_profile"})},functions:{onClose:()=>{S(!1)}},className:"in-portal"})})]}):h.jsx(h.Fragment,{})]})})},P7=Object.freeze(Object.defineProperty({__proto__:null,default:li},Symbol.toStringTag,{value:"Module"}));const mg={small:24,medium:48},Sm=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:i,showGap:a,showPlaceholders:s}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:o=2,multipleText:l,className:u="",...c})=>{const d=le.useIntl();return!n||n.length===0?null:E.createElement(e,{...c,className:te("contributors",u,i,{"has-gap":a}),children:h.jsxs(h.Fragment,{children:[h.jsx("ul",{children:n.map((f,m)=>{let g,p="";if(m<o){const{name:y="",image:v=""}=n1(f);if(s)return h.jsx(Jn,{element:"li",className:"contributor"},m);g=h.jsx(gi,{name:y,src:v,width:mg[i||"medium"],height:mg[i||"medium"]})}else if(m===o){const y=(t||n.length)-o;g=h.jsxs("small",{className:te({"large-number":y>99}),children:["+",Kx(y,0)]}),p="number-left"}return g?h.jsx("li",{className:te("contributor",p),children:g},m):null})}),r&&h.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?d.formatMessage({id:`member_${n[0]}`}):rl(n[0].name||"",20):l||null})]})})};const km=({element:e="section",children:t,className:n,variant:r,additionalContent:i,...a})=>{let s=typeof t=="string"?h.jsx("p",{children:t}):t;return i&&(s=h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"modal-content",children:typeof t=="string"?h.jsx("p",{children:t}):t}),h.jsx("div",{className:"modal-additional-content",children:typeof i=="string"?h.jsx("p",{children:i}):i})]})),E.createElement(e,{className:te("modal",n,{"success-section":r==="success"}),children:s,...a})};var Dm={exports:{}};/*!
34
34
  * tabbable 6.4.0
@@ -139,7 +139,7 @@ ${m}${d?"1.":"-"} ${u}${f?`
139
139
 
140
140
  `}),z=Y.turndown(z)}o&&o.mentions&&(z=await N4({text:z,template:`[${Dh}{{name}}]({{id}})`,mentions:o.mentions,listMembers:m||(()=>Promise.resolve([]))})),PP(z,Y=>{const re=[{type:"initialValue",value:Y},{type:"editorKey",value:B.toString()}];o!=null&&o.link&&(re.push({type:"enrichedUrl",value:o.link}),o.link.url&&X(o.link.url)),S(re),setTimeout(()=>{S([{type:"stringValue",value:b9(q)}])},150)})})()},[B]),E.useEffect(()=>{if(U===void 0&&q){const z=BP(q);z&&X(z)}const H=z=>{var Q;const Y=z,re=((Q=Y==null?void 0:Y.detail)==null?void 0:Q.url)||null;re&&U&&U.url===re&&S([{type:"enrichedUrl",value:void 0}])};return window.addEventListener("linkRemoved",H),()=>{window.removeEventListener("linkRemoved",H)}},[U]),E.useEffect(()=>{if(t){Aa.lastIndex=0;const H=t.match(Aa);H&&H.length===1&&H[0].length===t.length&&!P&&S([{type:"originalValue",value:t}])}t!==""||!q||vc(B,t)&&!P||(I.withoutNormalizing(q,()=>{oe.delete(q,{at:{anchor:I.start(q,[]),focus:I.end(q,[])}}),oe.deselect(q),q.children.length!==0&&oe.unwrapNodes(q,{at:[0]}),oe.insertNodes(q,C,{at:[0]})}),S([{type:"initialValue",value:C},{type:"lastAnchor",value:null},{type:"enrichedUrl",value:!1}]))},[t]),E.useEffect(()=>{y({link:U})},[U]),E.useEffect(()=>{F===""&&U&&S([{type:"enrichedUrl",value:void 0}])},[F]);const j=il(()=>{LP({editor:q,isShowing:D.show,numberOfUsers:D.numberOfUsers,listMembers:m,dispatch:S})},100);return $?h.jsx("div",{id:Z,className:"rich-text-editor input text-medium",children:h.jsxs(yi.Provider,{value:{...x,id:Z,isInOverlay:f,dispatch:S,onMention:T,reportError:_},children:[h.jsxs(nN,{editor:q,initialValue:$,onChange:H=>{if(q.operations.some(Y=>Y.type!=="set_selection")){let Y=jP(H);Y==="<br>"&&(Y=""),p(Y,U),S([{type:"stringValue",value:b9(q)}]),P||S([{type:"hasInteracted",value:!0}]),j(),d&&console.log({serialized:Y,json:H})}},...u,children:[h.jsx(KO,{className:"editor",renderElement:k,renderLeaf:b,placeholder:n||c.formatMessage({id:"richTextEditor_placeholder"}),autoFocus:s,tabIndex:0,onPaste:async H=>{const z=U!==!1,Y=H.clipboardData.getData("text");if((Q=>{try{return new URL(Q),!0}catch{return!1}})(Y)){let Q=Y;if(Y){const{full:G}=vm(Y);Q=G}if(Y&&v&&!z){const G=await v(Q);G.url&&S([{type:"enrichedUrl",value:G}])}}},onKeyDown:H=>{if(H.key==="Enter"){D.show&&(H.preventDefault(),H.stopPropagation(),HT(q,D,S,Z));const{selection:z}=q;if(z){const Y=ie.isCollapsed(z),[re,Q]=I.node(q,z,{depth:1});let G=re,se=G.type;const ae=G.children[0];if(se===ne.h3){H.preventDefault(),H.stopPropagation();const be=I.start(q,Q),Ce=I.end(q,Q),Pe=Ge.equals(z.anchor,be),je=Ge.equals(z.anchor,Ce);if(Pe)oe.insertNodes(q,C,{at:Q});else if(je)oe.insertNodes(q,C,{at:V.next(Q)}),oe.select(q,I.end(q,V.next(Q)));else{const Fe=z.anchor,[,Be]=I.parent(q,z);oe.splitNodes(q,{at:Fe}),oe.setNodes(q,{type:ne.paragraph},{at:V.next(Be)})}return}if(ae&&[ne.ol,ne.ul].includes(ae.type)&&(G=ae,se=ae.type),G&&_e.isElement(G)&&se!==ne.paragraph){if(se===ne.blockquote&&!H.shiftKey){H.stopPropagation(),H.preventDefault(),oe.insertNodes(q,C);return}if(Y){const[be,Ce]=I.parent(q,z,{edge:"end"}),je=be.type;if([ne.ul,ne.ol].includes(se))if(H.stopPropagation(),H.preventDefault(),je===ne.li&&O==="Enter"){be.children.length===1&&"text"in be.children[0]&&be.children[0].text===""&&oe.removeNodes(q,{at:Ce}),oe.insertNodes(q,C,{at:V.next(Q)}),oe.select(q,I.end(q,V.next(Q)));return}else{const[Fe,Be]=RP(q,ne.li),Qe={type:ne.li,children:[{text:""}]};oe.insertNodes(q,Qe,{at:V.next(Be)}),oe.select(q,I.end(q,V.next(Be)))}}}}}else if(H.key==="Escape"){if(D.show){H.preventDefault(),H.stopPropagation(),S([{type:"mentionPopover",value:{...D,show:!1}}]);return}}else if(["ArrowUp","ArrowDown"].includes(H.key)&&D.show){H.preventDefault(),H.stopPropagation();const{selectedUser:z,possibleUsers:Y}=D;let re=H.key==="ArrowUp"?z-1:z+1;re<0&&(re=Y.length-1),re>=Y.length+1&&(re=0),S([{type:"mentionPopover",value:{...D,selectedUser:re}}])}S([{type:"lastKey",value:H.key}]),MP(H,q,S,_)},onBlur:()=>{q.selection&&S([{type:"lastAnchor",value:q.selection.anchor}])},onFocus:()=>{if(L){if(!V.isPath(L.path)||!he.has(q,L.path))return;const H=he.get(q,L.path);let z=0;if(xe.isText(H)?z=H.text.length:H.children&&(z=H.children.length),L.offset>z)return;try{oe.select(q,{anchor:L,focus:L})}catch(Y){const re=Y.message;_(`Error focusing editor: ${re}`)}}}}),U?h.jsx(gp,{data:U,variant:"condensed",onClick:()=>{S([{type:"enrichedUrl",value:!1}]);const H=new CustomEvent("ariaLive",{detail:{message:c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_live"})}});document.dispatchEvent(H)},"aria-label":c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria"},{title:U.title||c.formatMessage({id:"richTextEditor_link_enrichedUrl_aria_fallback"})})}):h.jsx(h.Fragment,{}),h.jsx(QP,{styling:l==null?void 0:l.toolbar}),m?h.jsx(HP,{onFallbackClick:g}):h.jsx(h.Fragment,{})]},N),h.jsx(jm,{id:`character-limit-${e}`,limit:r,valueLength:r1(F)})]})}):h.jsx(h.Fragment,{})};const n_=({id:e="form-toggle",label:t,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:a=!1,className:s=""})=>{const[o,l]=E.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);E.useEffect(()=>{r&&l(r)},[r]);const u=c=>{a||(l(c),i(c))};return h.jsxs("div",{className:te("toggle",s),onClick:c=>{c.preventDefault(),c.stopPropagation(),u(o===n[0].value?n[1].value:n[0].value)},children:[h.jsx("p",{children:t}),h.jsx("ul",{className:te("toggle-options",{disabled:a,on:o===n[1].value}),children:n.map(c=>{const d=`${e}-${c.value}`;return h.jsxs("li",{className:"hidden",children:[h.jsx("input",{type:"radio",id:d,name:e,value:c.value,checked:o===c.value,onChange:()=>u(c.value),disabled:a}),h.jsx("label",{htmlFor:d,children:c.label})]},d)})})]})};function r_({className:e="",userId:t,userName:n,src:r,uploadImage:i,button:a,callback:s}){const o=le.useIntl(),l="profileImageChange_",[u,c]=E.useState(r),[d,f]=E.useState(!1),[m,g]=E.useState(!1),p=E.useRef(null),y=async C=>{f(!0),g(!1);try{const w=C.target.files&&C.target.files[0];if(!w||!t)throw f(!1),new Error("Image file or userID is missing");const x=await i({fileObject:w,userId:t}),S={thumbnail:x.thumbnailURL,full:x.originalURL};c(S),s(S)}catch{g(!0)}finally{f(!1)}f(!1)},{upload:v=o.formatMessage({id:`${l}cta_upload`}),change:T=o.formatMessage({id:`${l}cta_change`}),uploading:_=o.formatMessage({id:`${l}cta_uploading`})}=(a==null?void 0:a.text)||{};return h.jsxs("div",{className:te("profile-image-change-figure",e),children:[h.jsx(gi,{className:"profile-image-change-picture",name:n,src:u==null?void 0:u.thumbnail,showInitials:!1,alt:"","data-testid":"profile-picture"}),m&&h.jsx("p",{className:"error text-small",children:o.formatMessage({id:`${l}error`})}),h.jsx("input",{id:"file",type:"file",accept:"image/*",ref:p,onChange:y,hidden:!0,"data-testid":"file-input"}),h.jsx(Ie,{onClick:()=>p.current&&p.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${u?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:d,children:d?_:u?T:v})]})}const i_=({gtm:e,functions:{onSuccess:t=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=e||{};return h.jsx(vr,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}],autoComplete:"name"},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:i},functions:{onSuccess:t,onFailure:n},button:{className:"new"}})};const MR=({emails:e,setEmails:t,setIsDisabled:n})=>{const{formatMessage:r}=le.useIntl();return h.jsx(gx.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:r({id:"inviteForm_email_placeholder"}),emails:e,onChange:i=>{t(i),n(!i.length)},autoFocus:!1,getLabel:(i,a,s)=>h.jsxs("div",{className:"email text-medium",children:[h.jsx("div",{"data-tag-item":!0,children:i}),h.jsx(Ie,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{s(a),n(!e.length)},className:"remove-email-button",screenreaderText:r({id:"overlay_close"})})]},a)})},a_=({title:e,label:t,messagePlaceholder:n,ctaMessage:r,titleColor:i,labelColor:a,backgroundColor:s,onClose:o,reportError:l,sendInvites:u,initialFormStatus:c="NOT_SUBMITTED",gtm:d={context:"Form",event:"form-submit-click"},secondaryActionButton:f,meta:m})=>{const[g,p]=E.useState([]),[y,v]=E.useState(!0),[T,_]=E.useState(c),{formatMessage:C}=le.useIntl(),w=async N=>{try{await u(g,N.message),p([]),_("SUCCESS")}catch(B){_("ERROR"),l(B)}},x=N=>{N.preventDefault(),_("NOT_SUBMITTED"),v(!0),p([])},S=N=>{N.preventDefault(),o(),_("CLOSED")};return T==="CLOSED"?null:T==="ERROR"||T==="SUCCESS"&&!(m!=null&&m.shouldHideDoneButtonOnSubmit)?h.jsxs("div",{className:"invite-form-wrapper",children:[h.jsx("div",{className:"content centred",children:T==="SUCCESS"?h.jsx("h2",{className:"success-title",children:C({id:"inviteForm_success"})}):h.jsxs("h2",{className:"error-title",children:[" ",C({id:"inviteForm_error"})]})}),h.jsx(pr,{}),h.jsx("div",{className:"footer",children:T==="SUCCESS"?h.jsxs(h.Fragment,{children:[h.jsx(Ie,{variant:"secondary",onClick:x,children:C({id:"inviteForm_ctaSendMoreInvites"})}),h.jsx(Ie,{onClick:S,children:C({id:"inviteForm_ctaDone"})})]}):h.jsx(Ie,{onClick:x,children:C({id:"inviteForm_ctaTryAgain"})})})]}):h.jsxs("div",{className:"invite-form-wrapper",style:{backgroundColor:s},children:[h.jsxs("div",{className:"content",children:[h.jsx("h2",{className:"title",style:{color:i},children:e}),h.jsx("label",{htmlFor:"email-input",className:"label",style:{color:a},children:t})]}),h.jsx(vr,{id:"invite-form",fields:[{component:MR,props:{emails:g,setEmails:p,setIsDisabled:v},required:!0},{id:"message",type:"textarea",label:C({id:"inviteForm_message_label"}),placeholder:n||C({id:"inviteForm_message_placeholder"})}],functions:{onSuccess:w},button:{text:r,size:"medium",disabled:y},gtm:d,meta:m,secondaryActionButton:f})]})},nc=e=>e.map(t=>({condition:t}));const Mn={FORM_ID:"manage-account-password-change",NEW_PASSWORD:"newPassword",CONFIRMED_PASSWORD:"confirmedPassword",CURRENT_PASSWORD:"oldPassword"},LR=({functions:e,...t})=>{const{formatMessage:n}=le.useIntl(),[r,i]=E.useState(null),[a,s]=E.useState(!1),[o,l]=E.useState({isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1}),u=m=>m[Mn.NEW_PASSWORD]!==m[Mn.CONFIRMED_PASSWORD]?n({id:"passwordRules_unmatched_text"}):null,c=m=>!sh(m[Mn.NEW_PASSWORD]).isValid,d=[{"data-testid":Mn.NEW_PASSWORD,id:Mn.NEW_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_newPassword_label"}),validation:nc(["required",c]),functions:{onChange:m=>l(sh(m).matchingRules),onFocus:()=>s(!0),onBlur:()=>s(!1)}},{"data-testid":Mn.CONFIRMED_PASSWORD,id:Mn.CONFIRMED_PASSWORD,type:"password",autoComplete:"new-password",placeholder:"",label:n({id:"passwordRules_confirmPassword_label"}),validation:nc(["required",u])}];t.isPasswordChange&&d.unshift({"data-testid":Mn.CURRENT_PASSWORD,id:Mn.CURRENT_PASSWORD,type:"password",autoComplete:"current-password",placeholder:"",label:n({id:"passwordRules_currentPassword_label"}),validation:nc(["required"])}),a&&d.push({component:Nb,props:{matchingRules:o}});const f={id:Mn.FORM_ID,fields:d,functions:{...e,onSuccess:async m=>(e.createPassword(m),e.onSuccess&&e.onSuccess(m)),onCatch:m=>i(m==null?void 0:m.statusCode),onFailure:(m,g)=>{(g.includes(Mn.NEW_PASSWORD)||g.includes(Mn.CONFIRMED_PASSWORD))&&s(!0)}},meta:{shouldReset:!0},...t};return h.jsxs(h.Fragment,{children:[h.jsx(vr,{...f}),r&&h.jsx(Lr,{variant:"error",text:r})]})};const s_=({isCreateProfile:e=!1,hooks:t,functions:n,meta:r={},gtm:i,...a})=>{var N;const s=le.useIntl(),o="profileForm_",l=E.useContext(Pt),[u,c]=E.useState(l.image),[d,f]=E.useState(!1),{uploadImage:m=()=>{},onSuccess:g=async B=>{},onCancel:p=()=>{},onFailure:y=()=>{}}=n,{buildLocation:v,isValidPlace:T,predictPlaces:_}=t.useMaps(),{context:C="ProfileForm",event:w="profile-form-submit-click"}=i||{},x=[{id:"jobTitle",type:"text",label:s.formatMessage({id:`${o}jobTitle`}),placeholder:s.formatMessage({id:`${o}jobTitle_placeholder`}),value:l.jobTitle,validation:[{condition:"required"}]},{id:"organization",type:"text",label:s.formatMessage({id:`${o}organization`}),placeholder:s.formatMessage({id:`${o}organization_placeholder`}),value:l.organization,validation:[{condition:"required"}]},{id:"location",type:"autocomplete",label:s.formatMessage({id:`${o}location`}),placeholder:s.formatMessage({id:`${o}location_placeholder`}),value:(N=l.location)==null?void 0:N.en,validation:[{condition:"required"},{condition:({location:B})=>B&&!d?!1:!T(B),error:s.formatMessage({id:`${o}location_error`})}],functions:{onChange:()=>{d||f(!0)},onKeyInput:_}}],S=[{component:r_,props:{userName:l.name,userId:l.id,src:u,uploadImage:m,callback:c,button:{text:{upload:s.formatMessage({id:`${o}image`})}}}},{id:"name",type:"text",label:s.formatMessage({id:`${o}name`}),placeholder:s.formatMessage({id:`${o}name_placeholder`}),value:l.name,autoComplete:"name",validation:[{condition:"required"}]},...x,{id:"biography",type:"textarea",label:s.formatMessage({id:`${o}bio`}),placeholder:s.formatMessage({id:`${o}bio_placeholder`}),limit:1e3,value:l.biography},{component:pr}];return h.jsx(vr,{id:"profile-details-form",fields:e?x:S,meta:{shouldShowCancelButton:!e,shouldReset:!1,shouldHide:!1,showRequiredLabels:e,...r},intlPath:o,gtm:{context:C,event:w},functions:{onSuccess:async B=>{try{const $={...B,image:u||null,location:d?await v(B==null?void 0:B.location):l.location,...e?{onboardingState:"completed"}:{}};l.updateDetails&&l.updateDetails(F=>({...F,...$})),await g($)}catch{y()}},onCancel:p,onFailure:y},button:{size:"large",text:{default:s.formatMessage({id:`${o}cta`}),submitting:s.formatMessage({id:`${o}cta_submitting`}),submitted:s.formatMessage({id:`${o}cta_submitted`})}},...a})},$R=()=>{const e=le.useIntl(),[t,n]=E.useState(0);return E.useEffect(()=>{const r=setInterval(()=>{n(i=>{if(i>=95)return clearInterval(r),95;const a=Math.round(Math.random()*10);return Math.min(i+a,95)})},800);return()=>{clearInterval(r)}},[]),h.jsx(X4,{progress:t,steps:{0:{icon:"layers",text:e.formatMessage({id:"publishArticleForm_progressBar"})}}})};function jR({coverImage:e,setShowImagePicker:t}){return e&&e.url?h.jsx(Lr,{className:"cover-image-preview",text:h.jsx(Vi,{className:"cover-image",image:{description:e.description||"",height:e.height,width:e.width,url:e.url,color:e.color,type:"image/jpeg"}}),button:{component:h.jsx(Ie,{variant:"tertiary",onClick:()=>t(!0),children:h.jsx(le.FormattedMessage,{id:"publishArticleForm_replaceImage_button"})})}}):h.jsx(Lr,{button:{component:h.jsx(Ie,{variant:"secondary",onClick:()=>t(!0),children:h.jsx(le.FormattedMessage,{id:"publishArticleForm_selectImage_button"})})}})}var o_=(e=>(e.CitiesAndLocalGovernment="topic_CitiesAndLocalGovernment",e.Climate="topic_Climate",e.DigitalAndData="topic_DigitalAndData",e.Education="topic_Education",e.EquityJusticeAndInclusion="topic_EquityJusticeAndInclusion",e.HealthAndSocialCare="topic_HealthAndSocialCare",e.Innovation="topic_Innovation",e.LeadershipAndSkills="topic_LeadershipAndSkills",e.LifeInGovernment="topic_LifeInGovernment",e.Policymaking="topic_Policymaking",e.TransportAndInfrastructure="topic_TransportAndInfrastructure",e.WorkingAndTheEconomy="topic_WorkAndTheEconomy",e))(o_||{});let Dd=null;const Bt="publishArticleForm_",S9={},k9=10,HR=({id:e="publish-article-form",values:t=S9,setShowImagePicker:n,functions:r,meta:i,gtm:a,isEditMode:s=!1})=>{var F;const o=le.useIntl(),l=E.useContext(Pt),{create:u,edit:c,onSuccess:d=()=>{},onFailure:f=()=>{}}=r||{},{isInOverlay:m=!1}=i||{},[g,p]=E.useState(!1),[y,v]=E.useState(t.body||""),[T,_]=E.useState(!1),[C,w]=E.useState("");E.useEffect(()=>{vc(t,S9)||sl(t.body)&&t.body!==y&&t.body!==void 0&&v(t.body)},[t.body]);const x=()=>{!l||!l.id?_(o.formatMessage({id:`${Bt}error_loggedOut`})):T&&_(!1)},S=L=>({condition:O=>{const P=O[L];return!P||typeof P!="string"?!0:P.length<k9},error:o.formatMessage({id:`${Bt}error_underMinLength`},{length:k9})}),N=!!y&&sl(y),B=()=>h.jsxs(h.Fragment,{children:[h.jsx(pr,{}),h.jsx("p",{className:"text-medium",children:o.formatMessage({id:`${Bt}disclaimer`})})]}),$=[{id:"title",type:"textarea",value:t.title||"",limit:65,label:o.formatMessage({id:`${Bt}title_label`}),placeholder:o.formatMessage({id:`${Bt}title_placeholder`}),styling:{autosizeToFit:!0},functions:{onChange:x},validation:[{condition:"required"},S("title")]},{id:"subtitle",type:"textarea",value:t.subtitle,limit:115,label:o.formatMessage({id:`${Bt}subtitle_label`}),styling:{autosizeToFit:!0},placeholder:o.formatMessage({id:`${Bt}subtitle_placeholder`}),functions:{onChange:x},validation:[{condition:"required"},S("subtitle")]},{component:Pc,props:{formID:e,label:{visible:o.formatMessage({id:`${Bt}body_label`})},showLabel:!0}},{component:mp,props:{id:`${e}-input`,value:y,placeholder:o.formatMessage({id:`${Bt}body_placeholder`}),meta:{isInOverlay:m},autoFocus:!1,functions:{onChange:L=>{v(L),x()}},styling:{toolbar:{showHeadingOption:!0}},"aria-invalid":!!T,"aria-errormessage":"error-message"}},{id:"tags",label:o.formatMessage({id:`${Bt}tags_label`}),type:"checkboxes",styling:{displayOptionsAsPills:!0},options:Object.values(o_).map(L=>({id:L,label:o.formatMessage({id:`${Bt}_tags_${L}`})})),value:t.tags||[],multipleOptions:{limit:3},validation:[{condition:"required",error:o.formatMessage({id:`${Bt}tags_error_required`})},{condition:L=>{var O;return((O=L==null?void 0:L.tags)==null?void 0:O.length)>3},error:o.formatMessage({id:`${Bt}tags_error_over_three`})}]},{component:Pc,props:{formID:e,label:{visible:o.formatMessage({id:`${Bt}cover_image_label`})},showLabel:!0}},{component:jR,props:{coverImage:t.coverImage||{},setShowImagePicker:n}}];return g?$.push({component:pr}):$.push({component:B}),h.jsxs("section",{className:"publish-article-form",children:[h.jsx(vr,{id:e,meta:{shouldReset:!1,shouldHide:!1,showRequiredLabels:!1,shouldScrollOnSuccess:!1},functions:{onSuccess:async L=>{if(!l||!l.id||!N)return;Dd&&clearTimeout(Dd),p(!0);const O={...L,body:y,coverImage:t.coverImage};try{s&&c?await c(O):u&&await u(O),Dd=setTimeout(()=>{w(o.formatMessage({id:`${Bt}aria_success${s?"_edit":""}`})),d(O)},500)}catch{_(o.formatMessage({id:`${Bt}error`})),w(""),f()}},onFailure:f},fields:$,intlPath:Bt,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":a==null?void 0:a.context,"data-gtm-event-type":"publish-article-click",disabled:!l||!l.id||!N||!((F=t==null?void 0:t.coverImage)!=null&&F.url),text:{default:o.formatMessage({id:`${Bt}cta_submit${s?"_edit":""}`}),submitting:o.formatMessage({id:`${Bt}cta_submitting${s?"_edit":""}`}),submitted:o.formatMessage({id:`${Bt}cta_submitted${s?"_edit":""}`})},customOnSubmit:T?h.jsx(h.Fragment,{}):h.jsx($R,{})},gtm:a}),T&&h.jsx(ks,{id:"error-message",className:"error",children:typeof T=="string"&&T.includes(" ")?T:o.formatMessage({id:`${Bt}error`})}),C&&h.jsx(ot,{"aria-live":"polite",showOnFocus:!1,children:C})]})};var Un,UR=Un={_regexEscape:/([\.\*\+\^\$\[\]\\\(\)\|\{\}\,\-\:\?])/g,_regexParseLocale:/^([a-zA-Z]*)([_\-a-zA-Z]*)$/,_escapeRegExpPattern:function(e){return typeof e!="string"?e:e.replace(Un._regexEscape,"\\$1")},_toLowerCase:function(e,t){return typeof e!="string"?t&&e:e.toLowerCase()},_toUpperCase:function(e,t){return typeof e!="string"?t&&e:e.toUpperCase()},_trim:function(e,t,n){var r=[],i,a=function(l){r.push("^"+l+"+|"+l+"+$")};if(typeof t=="boolean"&&(n=t,t=null),typeof e!="string")return n&&e;if(Array.isArray(t)&&t.map(function(l){var u=Un._escapeRegExpPattern(l);a(u)}),typeof t=="string"){var s=Un._escapeRegExpPattern(t);a(s)}t||a("\\s");var o="("+r.join("|")+")";for(i=new RegExp(o,"g");e.match(i);)e=e.replace(i,"");return e},_parseLocale:function(e){var t=Un._regexParseLocale.exec(e),n,r,i;if(!(!e||!t))return t[2]=Un._trim(t[2],["-","_"]),r=Un._toLowerCase(t[1]),i=Un._toUpperCase(t[2])||i,n={lang:r,countryCode:i},n},isRtlLang:function(e){var t=Un._parseLocale(e);if(t)return Un._BIDI_RTL_LANGS.indexOf(t.lang)>=0},getLangDir:function(e){return Un.isRtlLang(e)?"rtl":"ltr"}};Object.defineProperty(Un,"_BIDI_RTL_LANGS",{value:["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","prs","ps","sd","ug","ur","yi"],writable:!1,enumerable:!0,configurable:!1});var zR=UR,D9=zR,qR={isRtlLang:D9.isRtlLang,getLangDir:D9.getLangDir};const l_=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:a="form-submission"})=>{const{searchIsOpen:s=!0,isDesktopVersion:o=!1}=n||{},l=le.useIntl(),u=E.useRef(null),c=qR.getLangDir(l.locale)||"ltr";Ss(()=>{!n||o||!s||u.current&&u.current.focus()},[s]);const d=f=>{f.preventDefault(),f.stopPropagation(),!(!u.current||!u.current.value||u.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(u.current.value)}`)};return h.jsx("form",{onSubmit:d,className:te("search-form gtm-trackable",t),role:"search","data-gtm-event-context":i,"data-gtm-event-type":a,children:h.jsx("fieldset",{id:`${e}-form`,hidden:n&&!o?!s:!1,children:h.jsxs("p",{children:[h.jsx(ot,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),h.jsx("input",{ref:u,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:f=>{f.key==="Enter"&&d(f)}}),h.jsx("button",{className:"clear",onClick:f=>{f.preventDefault(),f.stopPropagation(),u.current&&u.current.value&&(u.current.value="")},children:h.jsx(ot,{children:l.formatMessage({id:"search_clear"})})}),h.jsx("button",{className:`search ${c}`,onClick:d,children:h.jsx(ot,{children:l.formatMessage({id:"search_cta"})})})]})})})},O9=async({ref:e,readAccount:t,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!e.current.validity.valid||!r.test(e.current.value))return n([{type:"validFields.email",value:!1}]);const i=e.current.value.toString().toLowerCase().trim(),a=Qc("ref"),s={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let o=Object.assign({},s);try{o=await t(i,a),o===void 0&&(o=s)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:l=!1,autoApproved:u=!1,exists:c}=o;let d="";return l?d=u?"gov":"nonGov":c.registration?c.engagement&&!c.user?d=c.auth?"verify":"pending":d="exists":c.auth&&(d="exists"),n([{type:"shouldDisableButton",value:!1},{type:"shouldManuallyApprove",value:!u},{type:"emailDetails",value:{email:i,boxType:d,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(i)}},{type:"validFields.email",value:!0}])},WR=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"]}},VR=async({refs:e,dataToSubmit:t,createAccount:n,onSuccess:r,dispatch:i,state:a})=>{if(!e.form||!e.form.current)throw new Error("No refs.form");if(!e.form.current.checkValidity()){e.hiddenValidation&&e.hiddenValidation.current&&e.hiddenValidation.current.click();return}const s=WR(new FormData(e.form.current)),o=Object.assign(s,t);await n(o),sessionStorage.setItem(pm.SESSION_STORAGE.EMAIL,s.email),r&&r({...s,...a.values}),i([{type:"showSuccessMessage",value:!0}])},KR=({shouldShow:e,placeholders:t,labels:n,functions:{readAccount:r,resendVerificationCode:i},refs:a,state:s,dispatch:o,dataToSubmit:l,intl:u})=>{const{emailDetails:c}=s,d=(m,g)=>{m.current&&s.validFields[g]!==m.current.validity.valid&&o([{type:`validFields.${g}`,value:m.current.validity.valid}])},f=[{id:"full_name",type:"text",inputRef:a.name,placeholder:u.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>d(a.name,"name"),onFocus:()=>o([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:a.email,placeholder:u.formatMessage({id:"signup_email_address_placeholder"}),"aria-describedby":"email-helper-textbox",functions:{onBlur:()=>{O9({ref:a.email,readAccount: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:wb,props:{email:c.email,type:c.boxType,resendVerificationCode:i}}];return s.shouldManuallyApprove&&(f.push({id:"job_title",type:"text",inputRef:a.jobTitle,placeholder:u.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>d(a.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:a.organisation,placeholder:u.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{d(a.organisation,"organisation")}},validation:[{condition:"required"}],autoComplete:"organization","data-testid":"signup-org-input"}),e.url&&f.push({id:"url",type:"text",label:u.formatMessage({id:"signup_url"},{small:m=>h.jsx("small",{children:m})}),placeholder:u.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),e.expectation&&f.push({id:"expectation",className:"expectation",type:"text",label:(n==null?void 0:n.expectation)||u.formatMessage({id:"signup_expectation"},{small:m=>h.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"}),f.push({id:"terms",className:"text-small",type:"checkbox",inputRef:a.tc,label:u.formatMessage({id:"signup_terms"},{terms:m=>h.jsx("a",{href:"/pages/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:m}),privacy:m=>h.jsx("a",{href:"/pages/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(p=>{s.validFields[p]!==a[p].current.validity.valid&&(g.push({type:`validFields.${p}`,value:a[p].current.validity.valid}),p==="email"&&O9({ref:a.email,readAccount:r,dispatch:o}))}),g.length&&o(g)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),f};const GR=({className:e=""})=>h.jsxs("div",{className:te("success-message",e),"data-testid":"success-message",children:[h.jsx("p",{className:"success-title",children:h.jsx(le.FormattedMessage,{id:"signup_success_title"})}),h.jsx(le.FormattedMessage,{id:"signup_success_text",values:{p:t=>h.jsx("p",{children:t})}})]});const YR={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,shouldDisableButton:!0,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},ZR=({className:e="",labels:t={},placeholders:n={},functions:r={readAccount:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>Promise.resolve()},shouldShow:i={},submitButton:a,dataToSubmit:s={ref:"sign-up-form"},...o})=>{const l=le.useIntl(),u=window.location.pathname.includes("/signup")?"/login":`/login?returnTo=${window.location.pathname+window.location.search}`,{title:c=!0,expectation:d=!1,url:f=!0,logInButton:m=!0,successMessage:g=!0}=i,p={title:c,expectation:d,url:f,logInButton:m,successMessage:g},[y,v]=E.useReducer(js,YR),{validFields:T,emailDetails:_,shouldManuallyApprove:C,shouldDisableButton:w,showSuccessMessage:x,showError:S}=y,[N,B]=hm.useCookies(["signup-this-session","functional-cookie-consent"]),$={form:E.createRef(),name:E.createRef(),email:E.createRef(),jobTitle:E.createRef(),organisation:E.createRef(),tc:E.createRef(),hiddenValidation:E.createRef()};E.useEffect(()=>{C===!0&&$.jobTitle.current&&$.jobTitle.current.focus()},[C]),E.useEffect(()=>{N["signup-this-session"]&&v([{type:"showSuccessMessage",value:!0}])},[N]),E.useEffect(()=>{x&&N["functional-cookie-consent"]&&B("signup-this-session","true",{path:"/",maxAge:3600})},[x]);const F=E.useMemo(()=>KR({placeholders:n,labels:t,shouldShow:p,functions:r,refs:$,state:y,dispatch:v,dataToSubmit:s,intl:l}),[s,r,l,$,p,y]),L=w?!0:C?!Object.values(T).every(O=>O===!0):!T.name||!T.email||["exists","pending","verify"].includes(_.boxType);return p.successMessage&&x?h.jsx(GR,{className:e}):h.jsxs("fieldset",{className:te("signup-form-fieldset",e),"data-testid":"signup-form",children:[p.title&&h.jsx("p",{className:"signup-title",children:h.jsx(le.FormattedMessage,{id:"signup_title"})}),S&&h.jsx(Lr,{variant:"error",text:l.formatMessage({id:"signup_error"})}),h.jsx(vr,{className:"signup-form",formRef:$.form,id:"sign-up-form",fields:F,intlPath:"signup",button:{variant:"primary",size:"medium",text:a||l.formatMessage({id:"signup_button_join"}),disabled:L?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},secondaryActionButton:{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:u,"data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",text:l.formatMessage({id:"signup_button_login"})},meta:{shouldReset:!1,showRequiredLabels:!1,shouldShowCancelButton:p.logInButton},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{await VR({refs:$,dataToSubmit:s,createAccount:r.createAccount,onSuccess:r.onSuccess,dispatch:v,state:y})},onCatch:O=>{r.handleError(O),v([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),h.jsx("button",{className:"validation-button",ref:$.hiddenValidation})]})};function QR({parentId:e,isMember:t,formFunctions:n,leave:r,join:i,meta:a}){const s=le.useIntl();return h.jsx(R0,{form:{content:{type:ze.Reply,slugs:{}},functions:n,meta:{isEditing:!1,isAutoFocused:!1,isPrepopulated:!1,showSuccessMessage:!1,...a},placeholder:s.formatMessage({id:"discussion_responses_placeholder"})},parentId:e,membershipRequiredToPost:{isMember:t,required:!0,join:i,leave:r,notMemberStateText:s.formatMessage({id:"community_joinToPost"})}})}function XR({hasNextPage:e,fetchNextPage:t,setFocusReplyIndex:n,totalReplies:r}){const i=le.useIntl(),a=()=>{n(r),t()};return h.jsx(wl,{hasNextPage:e,loadNextPage:a,icon:{icon:"arrow-down",position:"right"},messages:{button:i.formatMessage({id:"loadMore_button"}),error:i.formatMessage({id:"loadMore_error"})}})}function JR({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=ft.useMutation({mutationFn:e,onMutate:o=>t(l=>{const u=Ag({reply:B6(o),user:a});return Os(u,l,{replace:!1,append:(o==null?void 0:o.replyId)!==void 0})}),onError:n,onSuccess:(o,l,u)=>{const c=Ag({reply:o,user:a});r.setQueryData(i,Os(c,u,{replace:!0,append:(l==null?void 0:l.replyId)!==void 0})),setTimeout(()=>{Mm(c.id,"reply")},0)}});return s}function eF({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=ft.useMutation({mutationFn:e,onMutate:({replyId:i,content:a})=>t(s=>{const o=_n(i,s);return o&&(o.data.content=a),s}),onError:n});return r}function tF({replies:e,user:t,replyType:n,currentLocale:r}){return!e||!(t!=null&&t.id)?[]:e.map(({id:i,own_children:a,latest_children:s,children_counts:o,data:l,created_at:u,parent:c,...d})=>{var x,S,N,B,$,F,L,O,P,M,U,D,X;const f=(((x=a==null?void 0:a.like)==null?void 0:x.length)||0)>0,m=(((S=s==null?void 0:s.like)==null?void 0:S.length)||0)>0,g=f?(N=a==null?void 0:a.like)==null?void 0:N.find(Z=>{var k;return((k=Z==null?void 0:Z.user)==null?void 0:k.id)===(t==null?void 0:t.id)}):!1,p=typeof g=="object"?(g==null?void 0:g.id)??"":"",y=m?(B=s==null?void 0:s.like)==null?void 0:B.map(Z=>{var k,b,q;return{id:(k=Z==null?void 0:Z.user)==null?void 0:k.id,name:(q=(b=Z==null?void 0:Z.user)==null?void 0:b.data)==null?void 0:q.name}}):!1,v=(O=(L=(F=($=l==null?void 0:l.payload)==null?void 0:$.data)==null?void 0:F.translations)==null?void 0:L[r])==null?void 0:O.body,T=(M=(P=l==null?void 0:l.payload)==null?void 0:P.data)==null?void 0:M.original,_=!!v,C=(T==null?void 0:T.locale)===r,w=v||(T==null?void 0:T.body);return{user:d==null?void 0:d.user,body:n===Ft.Courses?Tb({payload:(U=l==null?void 0:l.payload)==null?void 0:U.data,currentLocale:r,originalLocale:l==null?void 0:l.locale}):w||"",locale:l==null?void 0:l.locale,createdAt:u,data:{...nF(l),translationInfo:{hasTranslation:_,isOriginalPost:C,currentBody:w,currentLocale:r,originalBody:T==null?void 0:T.body,originalLocale:T==null?void 0:T.locale}},likeId:p,liked:m,likes:(o==null?void 0:o.like)||0,peopleWhoLiked:y,replyId:i,parent:c,userLiked:!!g,payloadId:(D=l==null?void 0:l.payload)==null?void 0:D.id,payloadCollection:(X=l==null?void 0:l.payload)==null?void 0:X.collection}})}function nF(e){if(!e||!e.mentioned_users)return{};const t=e==null?void 0:e.mentioned_users,n=(e==null?void 0:e.additional_data)||{};return{mentions:t,...n}}function pp({queryFns:{create:e,edit:t,like:n,list:r,remove:i,unlike:a},queryKey:s,type:o=Ft.Communities}){const l=ft.useQueryClient(),u=e1(),c=Ra(),d={queryClient:l,queryKey:s},f={mutationHandlers:{error:Im(d),mutate:Pm(d)},user:u,...d},m=JR({...f,mutationFn:e}),g=eF({...f,mutationFn:t}),p=rF({...f,mutationFn:n}),y=aF({...f,mutationFn:i}),v=sF({...f,mutationFn:a}),{replies:T,..._}=iF({queryKey:s,queryFn:r});return{replies:tF({replies:T,user:u,replyType:o,currentLocale:c}),mutations:{create:m,edit:g,remove:y,like:p,unlike:v},user:u,..._}}function rF({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=ft.useMutation({mutationFn:e,onMutate:({replyId:s})=>t(o=>{const l=_n(s,o);return l&&Sg({reply:l}),o}),onError:n,onSuccess:(s,{replyId:o},l)=>{const u=_n(o,l);u&&Sg({reply:u,reaction:s}),r.setQueryData(i,l)}});return a}function iF({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,hasNextPage:a,fetchNextPage:s}=ft.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:o=>(o==null?void 0:o.next)||null});return{replies:Bm(n),error:r,isLoading:i,hasNextPage:a,fetchNextPage:s}}function aF({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=ft.useMutation({mutationFn:e,onMutate:({replyId:i})=>t(a=>Eb(i,a)),onError:n});return r}function sF({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=ft.useMutation({mutationFn:e,onMutate:({replyId:a})=>t(s=>{const o=_n(a,s);return o&&M6({reply:o,user:r}),s}),onError:n});return i}const oF=({activityId:e,basePath:t,isMember:n,parentId:r,replyId:i,functions:{reactions:a,form:s,likes:o},type:l=Ft.Communities})=>{const u=le.useIntl(),c=3,{replies:d,fetchNextPage:f,hasNextPage:m,isLoading:g,mutations:{create:p,edit:y,like:v,remove:T,unlike:_}}=pp({queryKey:[t,r,e,i,"replies"],queryFns:{...a,list:x=>a.list({...x,reactionId:i})},type:l});ym([g]);const[C,w]=E.useState(!0);return h.jsxs(h.Fragment,{children:[(d==null?void 0:d.length)>=c&&h.jsx(Ie,{className:"nested-replies-show-toggle",variant:"secondary",size:"small",styling:{muted:!0},icon:{icon:`arrow_corner-${C?"up_left":"down_right"}`,position:"left"},onClick:()=>w(!C),children:u.formatMessage({id:`discussion_thread_${C?"hide":"show"}`},{count:d==null?void 0:d.length})}),C&&h.jsx(sx,{loadMore:{isLoading:g,hasNextPage:m,loadNextPage:()=>f()},form:{parentId:r,content:{type:ze.Reply,slugs:{question:`${t}/${r}`,answer:e,reply:i}},functions:{create:(x,{body:S})=>p({activityId:e,replyId:i,content:S}),...s},meta:{isEditing:!1,isAutoFocused:!0,isPrepopulated:!1,showSuccessMessage:!1}},children:d&&d.length>0?d==null?void 0:d.map(({replyId:x,likes:S,data:N,body:B,createdAt:$,userLiked:F,peopleWhoLiked:L,parent:O,user:P,likeId:M})=>h.jsx($l,{isCommunity:!0,content:{id:x,type:ze.Reply,body:B,createdAt:$,slugs:{question:`${t}/${r}`,answer:e,reply:O},slug:"",author:_l(P),userLiked:F,likes:S,peopleWhoLiked:l===Ft.Courses?!1:L,data:N},forceHide:{shareLink:l===Ft.Courses},userHasPermissions:n,functions:{content:{createContent:()=>null,deleteContent:()=>T({replyId:x}),updateContent:(U,{body:D})=>y({replyId:x,content:D})},likes:{createLike:()=>v({replyId:x}),deleteLike:()=>_({replyId:x,reactionId:M}),listLikes:U=>o.list({replyId:x,...U})},comments:{},form:s},styling:{showShareLinkButton:!0},badges:{showBadges:!0,scopes:[{scope:nn.Communities,area:r||""},{scope:nn.Platform,area:"all"}]},disableMentions:l===Ft.Courses,basePath:t,parentId:r},x)):null})]})};function lF({formFns:e,activityId:t,basePath:n,focus:r,isMember:i,parentId:a,reply:s,type:o=Ft.Communities}){const{body:l,data:u,likeId:c,likes:d,peopleWhoLiked:f,replyId:m,createdAt:g,user:p,userLiked:y}=s,{edit:v,like:T,remove:_,unlike:C}=e.mutations;return h.jsx(nx,{children:h.jsx($l,{isCommunity:!0,content:{id:m,type:ze.Reply,body:l,createdAt:g,slugs:{question:`${n}/${a}`,answer:t,reply:m},slug:m,author:_l(p),userLiked:y,likes:d,peopleWhoLiked:o===Ft.Courses?!1:f,data:u},userHasPermissions:i,functions:{content:{createContent:()=>null,deleteContent:()=>_({replyId:m}),updateContent:(w,{body:x})=>v({replyId:m,content:x})},likes:{createLike:()=>T({replyId:m}),deleteLike:()=>C({replyId:m,reactionId:c}),listLikes:w=>e.likes.list({replyId:m,...w})},comments:{},form:e.form},forceHide:{shareLink:o===Ft.Courses},badges:{showBadges:!0,scopes:[{scope:nn.Communities,area:a||""},{scope:nn.Platform,area:"all"}]},translation:{isTranslatable:!0,onTranslate:async({payloadId:w,payloadCollection:x})=>({body:"Translated body"})},disableMentions:o===Ft.Courses,children:h.jsx(oF,{basePath:n,parentId:a,activityId:t,replyId:m,isMember:i,functions:e,type:o}),styling:{showShareLinkButton:!0},setFocus:r,basePath:n,parentId:a},m)},m)}const iu="ALL",u_=({activityId:e,basePath:t,parentId:n,activityTotalReplies:r,isMember:i,functions:{form:a,join:s,leave:o,likes:l,reactions:u},profile:c,showReplies:d,type:f=Ft.Communities,repliesFilters:m})=>{const g=le.useIntl(),p=Ra(),{fetchNextPage:y,hasNextPage:v,isLoading:T,replies:_,mutations:{create:C,remove:w,edit:x,like:S,unlike:N}}=pp({queryKey:[t,n,e,"replies"],queryFns:u,type:f}),[B,$]=E.useState(f===Ft.Courses&&p||iu),[F,L]=E.useState([]),O=E.useMemo(()=>_,[JSON.stringify(_)]);E.useEffect(()=>{if(!O)return;const D=!B||B===iu||f!==Ft.Courses?O:O.filter(X=>X.locale===B);L(D)},[O,B]);const[P,M]=E.useState(null);ym([T]),Lm();const U={create:(D,X)=>{const{body:Z}=X;C({activityId:e,content:Z})},...a};return h.jsxs("section",{className:"replies-feed",children:[h.jsx(ax,{type:"comment",responses:r,isLoading:T}),d?h.jsxs(h.Fragment,{children:[h.jsx(QR,{parentId:n,isMember:i,join:s,leave:o,formFunctions:U,meta:{isAutoFocused:f===Ft.Courses||!1}}),f===Ft.Courses&&(m==null?void 0:m.isEnabled)&&h.jsxs("section",{className:"replies-feed-language-switcher",style:{display:"flex"},children:[h.jsx(vr,{id:"replies-feed-language-switcher",fields:[{id:"language",label:!1,type:"select",initialValue:B,options:[{id:iu,label:g.formatMessage({id:"activitySection_language_switcher_all_languages_option"})},...(m==null?void 0:m.options)||[]],functions:{onChange:D=>$(D)}}],functions:{},button:{hideButton:!0}}),h.jsx(Ie,{icon:"info-inside-circle",variant:"tertiary",className:"language-switcher-info-button",tooltip:g.formatMessage({id:"activitySection_language_switcher_info"}),forceTooltip:!0,children:h.jsx(ot,{children:g.formatMessage({id:"activitySection_language_switcher_info"})})})]}),F==null?void 0:F.map((D,X)=>h.jsx(lF,{activityId:e,basePath:t,focus:P===X,formFns:{form:a,likes:l,reactions:u,mutations:{remove:w,edit:x,like:S,unlike:N}},isMember:i,parentId:n,reply:D,type:f},D.replyId)),T?h.jsx(h.Fragment,{children:" "}):h.jsx(XR,{hasNextPage:v,fetchNextPage:y,setFocusReplyIndex:M,totalReplies:_.length})]}):h.jsx(In,{children:h.jsx(le.FormattedMessage,{id:"replies_feed_missing_polls_vote_message"})}),h.jsx(F0,{form:c})]})};function uF({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,hasNextPage:a,fetchNextPage:s,refetch:o}=ft.useInfiniteQuery({queryKey:t,queryFn:e,initialPageParam:{next:""},getNextPageParam:c=>(c==null?void 0:c.next)||null}),l=Bm(n),u=`${l.length||0}${a?"+":""}`;return{likes:l,likesCount:u,error:r,isLoading:i,hasNextPage:a,fetchNextPage:s,refetch:o}}function cF({queryFns:{list:e},queryKey:t}){const{likes:n,...r}=uF({queryKey:t,queryFn:e});return{likes:n,...r}}function c_({basePath:e,parentId:t,activityId:n,likeCount:r,functions:i}){const{likes:a,fetchNextPage:s,hasNextPage:o,refetch:l}=cF({queryKey:[e,t,n,"likes"],queryFns:i.likes});E.useEffect(()=>{l()},[l]);const u=a.map(({user:c})=>c).map(c=>c?_l(c):void 0).filter(c=>c&&typeof c!="string");return h.jsx("section",{className:"likes-feed",children:h.jsx(X3,{members:{data:u,total:r},showHeader:!1,showPlaceholders:!0,communitySlug:t,hasNextPage:o&&u.length<r,loadNextPage:s})})}const d_=({showModal:e=!0,functions:{onClose:t,likes:n},likeCount:r,className:i,...a})=>{const s=le.useIntl();return h.jsx(vi,{id:"likes-modal",title:s.formatMessage({id:"discussion_likes"},{number:r}),isOpen:e,functions:{onClose:t},className:te("profile-modal in-portal",i,{open:e}),maxWidth:600,children:h.jsx(c_,{...a,likeCount:r??0,functions:{likes:n}})})},dF=Object.freeze(Object.defineProperty({__proto__:null,default:d_},Symbol.toStringTag,{value:"Module"})),fF={results:[{created_at:"2024-05-16T13:17:45.940899Z",updated_at:"2024-05-16T13:17:45.940899Z",id:"ab4b7ab0-f4fe-469f-a8e7-5a52b3e55333",user_id:"9ed21585-63be-4446-96ce-3e703820eb73",user:{id:"1234",data:{name:"Han Solo",thumbnail:"https://placehold.co/400x400",jobTitle:"Smuggler",organization:"Rebel Alliance",badges:{communities:{"endor-alumni":["blue-badge"]}}}},kind:"like",activity_id:"869e5a90-0eba-11ef-8080-80017b714aaf",data:{mentioned_users:null},parent:"",latest_children:{},children_counts:{}},{created_at:"2024-05-16T13:17:45.940899Z",updated_at:"2024-05-16T13:17:45.940899Z",id:"db4b7ab0-f4fe-469f-a8e7-5a52b3e55373",user_id:"9ed21585-63be-4446-96ce-3e703820eb73",user:{created_at:"2023-08-22T11:56:10.585365Z",updated_at:"2024-03-13T11:31:49.447916Z",id:"9ed21585-63be-4446-96ce-3e703820eb73",data:{jobTitle:"Admiral",name:"Princess Leia",organization:"Rebela Alliance",thumbnail:"https://placehold.co/400x400",badges:{platform:{all:["orange-badge"]}}}},kind:"pin",activity_id:"769e5a90-0eba-11ef-8080-80017b714aaf",data:{mentioned_users:null},parent:"",latest_children:{},children_counts:{}}],next:"xy12345"};const hF=3e3,f_=({url:e,gtm:t={context:"ShareLink",event:"copy-link-click"}})=>{const n=le.useIntl(),r="discussion_share_copy_link",[i,a]=E.useState({isOpen:!1,isCopied:!1});return h.jsxs("li",{className:"share-link-wrapper",children:[h.jsx(ys,{className:"gtm-trackable",icon:{icon:"link_chain"},onMouseOver:()=>a({...i,isOpen:!0}),onFocus:()=>a({...i,isOpen:!0}),onMouseOut:()=>a({isOpen:!1,isCopied:!1}),onBlur:()=>a({isOpen:!1,isCopied:!1}),onClick:()=>{navigator.clipboard.writeText(e).then(()=>{a({isOpen:!0,isCopied:!0});const s=new CustomEvent("ariaLive",{detail:{message:n.formatMessage({id:`${r}_success`})}});document.dispatchEvent(s),setTimeout(()=>{a({isOpen:!1,isCopied:!1})},hF)})},"data-gtm-event-context":t.context,"data-gtm-event-type":t.event,"data-testid":"share-link",screenreaderText:n.formatMessage({id:r})}),h.jsx(pi,{className:te({copied:i.isCopied}),isOpen:i.isOpen,styling:{hasPointer:"top",extraPadding:!1},children:n.formatMessage({id:`${r}${i.isCopied?"_success":""}`})})]})};const ra="discussion_",h_=({className:e,gtmContext:t,contentType:n,likes:r,comments:i,replies:a,edit:s,shareLink:o,moreMenu:l})=>{const u=le.useIntl(),c=[];return l&&l.reportData&&c.push({text:u.formatMessage({id:`${ra}moreMenu_report`}),onClick:d=>{d.stopPropagation()},href:`mailto:communities@apolitical.co?subject=${encodeURI(u.formatMessage({id:`${ra}report_subject`}))}&body=${encodeURI(u.formatMessage({id:`${ra}report_body`},{contentType:n||"",contentSlug:l&&l.reportData&&l.contentSlug||"",contentUrl:l&&l.reportData&&l.reportData.contentUrl||""}))}`,icon:"flag"}),h.jsxs("ul",{className:te("actions text-medium",e),"data-testid":`${n}-actions`,children:[r?h.jsx(_b,{element:"li",likes:r.count,isShort:!1,userLiked:r.userLiked,content:{type:n,slugs:r.content.slugs,slug:r.content.slug},canLike:r.canLike,peopleWhoLiked:r.peopleWhoLiked,activityId:r.activityId,functions:r.functions,basePath:r.basePath||"",parentId:r.parentId||""}):h.jsx(h.Fragment,{}),i?h.jsx("li",{children:h.jsx(ys,{shortText:`${i.count??0}`,onClick:d=>{d.preventDefault(),d.stopPropagation(),i.functions.onClick()},icon:{icon:"speech-bubble_square"},"data-testid":"comment","data-gtm-event-context":t,"data-gtm-event-type":`answer-${n}-click`,screenreaderText:u.formatMessage({id:`${ra}comments_screenReader`},{count:i.count}),children:u.formatMessage({id:`${ra}comments${i.count===null?"_loading":""}`},{count:i.count})})}):h.jsx(h.Fragment,{}),a?h.jsx("li",{children:h.jsx(ys,{styling:{muted:!0},onClick:a.functions.onClick,icon:{icon:"speech-bubble_square"},"data-testid":"reply",disabled:!a.canReply,children:u.formatMessage({id:`${ra}reply`})})}):h.jsx(h.Fragment,{}),s?h.jsx("li",{className:"edit-button-item",children:h.jsx(ys,{styling:{muted:!0},onClick:s.onClick,icon:{icon:"pencil-paper"},"data-testid":"edit",children:u.formatMessage({id:`${ra}action_edit`})})}):h.jsx(h.Fragment,{}),o?h.jsx(f_,{url:o.url,gtm:{context:t||"",event:`copy-link-${n}-click`}}):h.jsx(h.Fragment,{}),l?h.jsx(Fc,{element:"li",id:`more-${l.contentSlug}`,options:[...l.options||[],...c]}):h.jsx(h.Fragment,{})]})};const mF=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=le.useIntl();return h.jsxs(h.Fragment,{children:[h.jsx(ot,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),h.jsx("ul",{className:te("breadcrumbs text-small",n),children:e.map(({text:i,href:a,current:s=!1},o)=>{const l={};return s&&(l["aria-current"]="location"),h.jsxs("li",{children:[s&&h.jsx(ot,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),h.jsx(Ki,{href:s?void 0:a,...l,children:rl(i,t)})]},`${mi(i)}_${o}`)})})]})};const gp=({variant:e="default",data:{image:t,url:n,title:r,description:i},onClick:a,gtm:s,...o})=>{if(!n)return h.jsx(h.Fragment,{});let l=n.split("//");l.length>1?l=l[1]:l=l[0],l=l.split("/"),l=l[0];const{context:u="EnrichedLink",event:c="enriched-link-click"}=s??{};return h.jsxs("aside",{className:te("enriched-url gtm-trackable",{"has-image":t,[e]:e!=="default"}),onClick:d=>{if(d.preventDefault(),d.stopPropagation(),a){a(d);return}window.open(n,"_blank")},"data-gtm-event-context":u,"data-gtm-event-type":c,children:[h.jsx("small",{children:l}),h.jsx("p",{className:"title text-medium",children:h.jsx("a",{...o,href:n,target:"_blank",rel:"noreferrer",children:r})}),i&&e!=="condensed"?h.jsx("p",{className:"text-small",children:i}):h.jsx(h.Fragment,{}),t&&t.src?h.jsx("p",{className:"img",children:h.jsx("img",{src:t.src,alt:t.alt||"",loading:"lazy",fetchpriority:"low",width:t.width||"auto",height:t.height||"100%"})}):h.jsx(h.Fragment,{})]})};const m_=({options:e,defaultOptions:t=[],allOption:n=!1,allowMultiple:r=!0,onChange:i=()=>{},preventNoOptionSelected:a=!1,className:s="",styling:o,gtm:l})=>{const u=le.useIntl(),{muted:c,large:d}=o||{},f=n?[{id:"all",text:typeof n!="boolean"&&n.text||u.formatMessage({id:"filters_all"})},...e]:e,[m,g]=E.useState(n?["all"]:t.length?t.map(T=>T.id):[]),[p,y]=E.useState(0),v=(T,_)=>{let C=[];m.includes(T)&&!a?C=m.filter(w=>w!==T):T==="all"?C=["all"]:r?C=[...m.filter(w=>w!=="all"),T]:C=[T],g(w=>(i&&typeof i=="function"&&i({current:C,previous:w}),C)),_&&typeof _=="function"&&_()};return h.jsx("ul",{className:te("filters",s),children:f.map(({id:T,text:_,disabled:C=!1,callback:w=()=>{},content:x},S)=>{let N={tabIndex:p===S?0:-1};return C&&(N={disabled:!0,"aria-label":u.formatMessage({id:"filters_disabled"},{name:_})}),h.jsx("li",{children:h.jsx("button",{"data-gtm-event-context":(l==null?void 0:l.context)||"filters","data-gtm-event-type":(l==null?void 0:l.type)||`${_.toLowerCase().replace(" ","-")}-click`,className:te(T,{selected:m.includes(T),large:d,muted:c}),onClick:B=>{B.preventDefault(),B.stopPropagation(),v(T,w)},onKeyDown:B=>{var O,P;let $=S+1,F,L;switch(B.code){case"Enter":case"Space":B.preventDefault(),B.stopPropagation(),v(T,w);break;case"ArrowLeft":case"ArrowRight":B.preventDefault(),B.stopPropagation(),B.code==="ArrowLeft"?($=S-1,$<0&&($=f.length-1)):$>=f.length&&($=0),y($),F=B.currentTarget.closest("li"),L=(O=F==null?void 0:F.parentElement)==null?void 0:O.children[$],(P=L==null?void 0:L.querySelector("button"))==null||P.focus();break}},"aria-selected":m.includes(T),...N,children:x||_})},T)})})},pF=(e,t,n)=>{const r=String(e);if(!n||!n.length)return t?`/${r}/${t}`:`/${r}`;let i="",a=!1;return n.forEach(({url:s,position:o})=>{o==="before-lang"?(i+=`/${s}`,a=!0):(i.includes(`/${r}/`)||(i+=`/${r}`),i+=`/${s}`)}),i.includes(`/${r}/`)||(i+=`/${r}`),t&&(i+=`/${t}`),a?{url:i,urlForRouter:`/${i.split("/").slice(2).join("/")}`}:i};const au="languageSwitcher_",gF=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:i,urlParts:a,variant:s="default",label:o,className:l=""})=>{const u=le.useIntl(),{updateLanguage:c=()=>{}}=E.useContext(_m),[d,f]=E.useState(e);if(E.useEffect(()=>{e!==d&&f(e)},[e]),!r||!Object.values(r).some(y=>y&&y.post_name))return null;const g=Object.keys(r),p=d!==e;return h.jsxs("div",{className:te("language-switcher text-small",s,l),children:[h.jsxs("nav",{children:[s!=="short"&&h.jsx("p",{children:o||u.formatMessage({id:`${au}label`})}),h.jsx("ul",{children:g.map(y=>{var C;if(!wa.ALL_LOCALES.includes(y))return null;const v=(C=r[y])==null?void 0:C.post_name,T=wa.ALL_LOCALES_WITH_LABELS.filter(w=>w.value===y)[0].title;let _={className:y};if(d===y)_["aria-label"]=u.formatMessage({id:`${au}selected`},{language:T});else{const w=pF(y,v,a);_={..._,href:typeof w=="string"?w:w.url,onClick:x=>{f(y),c(y),typeof i<"u"&&(x.preventDefault(),x.stopPropagation(),i(y,typeof w=="string"?w:w.urlForRouter))}}}return h.jsx("li",{children:h.jsx(Ki,{..._,fallbackElement:"span",children:T})},y)})}),s!=="short"&&!p&&h.jsx("p",{children:u.formatMessage({id:`${au}translation_${t?"original":n?"human":"machine"}`})})]}),s!=="short"&&!p&&!t&&!n&&h.jsx("small",{children:u.formatMessage({id:`${au}disclaimer`},{email:ls.support,link:y=>{const v=`mailto:${y}`;return h.jsx("a",{href:v,children:y})}})})]})};const Od=le.createIntl({locale:"en",messages:Vt}),wl=({hasNextPage:e=!0,loadNextPage:t=()=>{},isLoading:n=!1,variant:r="secondary",size:i="medium",styling:a={muted:!1,fullWidth:!1},icon:s=!1,messages:o={button:Od.formatMessage({id:"loadMore_button"}),endOfFeed:Od.formatMessage({id:"loadMore_endOfFeed"}),error:Od.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:u="LoadMore"})=>{const[c,d]=E.useState(""),f=async m=>{if(!n)try{await t(m)}catch(g){g instanceof Error?d(g.message):d("Unknown error")}};return!c&&!e&&!o.endOfFeed?null:h.jsx("footer",{className:te("load-more",l),children:!c&&e?h.jsx(Ie,{variant:r,size:i,styling:a,icon:s,onClick:f,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",disabled:n,className:"gtm-trackable","data-testid":"load-more-button",children:o.button}):o.endOfFeed&&(!c||c!=null&&c.includes("Cannot read items"))?h.jsx("p",{children:o.endOfFeed}):c&&h.jsx("p",{className:"error",children:o.error})})};const vp=({variant:e="default",version:t="default",className:n="",...r})=>{const i=Xc();return h.jsx("p",{className:"logo-wrapper",children:h.jsx("a",{href:i||"/home/",className:te("logo",e,t,n),...r,children:h.jsx(ot,{children:h.jsx(le.FormattedMessage,{id:"apolitical"})})})})};let su=!1;const Fc=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const i=le.useIntl(),a=E.useRef(null),[s,o]=E.useState(!1),l=u=>{a.current&&u.target instanceof HTMLElement&&!a.current.contains(u.target)&&o(!1)};return E.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),E.createElement(e,{ref:a,className:te("more-menu text-medium",r),children:h.jsxs(h.Fragment,{children:[h.jsx(Ie,{variant:"tertiary",size:"medium","data-testid":"more-menu",icon:{icon:"ellipsis"},onClick:()=>o(!s),"aria-haspopup":"true","aria-expanded":s,"aria-controls":t,screenreaderText:i.formatMessage({id:"moreMenu"}),className:"more-menu-button"}),h.jsx("ul",{id:t,hidden:!s,children:n.map(({href:u,onClick:c,text:d,icon:f,...m},g)=>{const p={...m,onClick:y=>{o(!1),typeof c=="function"&&c(y)},onFocus:()=>{su&&(clearTimeout(su),su=!1)},onBlur:()=>{su=setTimeout(()=>{o(!1)},100)}};return u&&(p.href=u),h.jsx("li",{className:"more-menu-list-item",children:h.jsx(Ie,{variant:"tertiary",size:"medium",icon:f?{icon:f,position:"left"}:!1,...p,children:d})},`${mi(d)}_${g}`)})})]})})},vF=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const yF=E.lazy(()=>Promise.resolve().then(()=>P7)),N9=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"},{key:"communities",href:"/communities/"}],p_=({activeLink:e,profile:t})=>{const n=le.useIntl(),r=E.useContext(Pt),i=r&&typeof r.id=="string",a=Xc();return a&&(N9[0].href=a),h.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[N9.map(({key:s,href:o})=>{const l=vF(o,e),u={};return l&&(u["aria-current"]="page"),h.jsx("li",{className:te(s,{active:l}),children:h.jsx("a",{href:o,"data-gtm-event-type":`${s}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",...u,children:n.formatMessage({id:`navigationMenu_links_${s}`})})},s)}),i&&t&&h.jsx(yF,{element:"li",member:r,styling:{variant:"card",isCondensed:!1},functions:{profile:t},className:"profile gtm-trackable","data-testid":"profile-link",alt:"",gtmContext:"NavigationMenu",gtmType:"profile-click"})]})},oo=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,EF=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${oo(t,"linkedin",n)}&src=linkedin`)}&title=${encodeURIComponent(e)}&source=Apolitical`},{key:"twitter",icon:"social_twitter",url:`https://twitter.com/share?ref_src=twsrc%5Etfw&url=${encodeURIComponent(`${oo(t,"twitter",n)}&src=twitter`)}&text=${encodeURIComponent(e)}&via=${encodeURIComponent("apoliticalco")}`},{key:"facebook",icon:"social_facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(`${oo(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
141
141
 
142
- ${oo(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:oo(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,i)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(i))}];const bF="shareLinks_",TF=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:i="large",variant:a="default",className:s=""})=>{const o=le.useIntl(),l=EF({title:e,link:t,referrer:n});return h.jsxs("aside",{className:te("share-links",i,a,s),children:[h.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),h.jsx("ul",{children:l.map(({key:u,icon:c,url:d,shouldRender:f=!0,onClick:m})=>{if(typeof f=="function"&&!f())return null;const g={};return m&&(g.onClick=p=>m(p,d)),h.jsx("li",{children:h.jsx(Ie,{size:i,variant:"tertiary",icon:{icon:c||u},href:d,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${u}-click`,"data-testid":"link",screenreaderText:o.formatMessage({id:`${bF}link_${u}`}),...g})},u)})})]})};const _F=({tabs:e,className:t="",preventLocationChange:n})=>{var g;const r=(p,y,v)=>(p||(p=`panel-${mi(y)}-${v}`),p),i=Wi(!0)||0;let a=e.findIndex(p=>p.current===!0);if(a<0&&(a=0),window.location.hash){const p=window.location.hash.replace("#","");if(e.find(v=>v.id===p)){for(let v=0;v<e.length;v++)if(r(e[v].id,e[v].text,v)===p){a=v;break}}}const[s,o]=E.useState((g=e[a])!=null&&g.id?e[a].id:r(e[a].id,e[a].text,a)),[l,u]=E.useState(""),c=(p,y)=>{switch(p.key){case"ArrowLeft":case"ArrowRight":{p.preventDefault();let v=y;p.key==="ArrowLeft"?y>0?v=y-1:v=e.length-1:p.key==="ArrowRight"&&(y<e.length-1?v=y+1:v=0);const T=r(e[v].id,e[v].text,v),_=document.getElementById(`tab-${T}`);_==null||_.focus(),u(T);break}case"Enter":o(l),window.location.hash=`#${l}`;break}},d=p=>{let y=!1;return p.target==="min-width"&&i>=p.value&&(y=!0),p.target==="max-width"&&i<=p.value&&(y=!0),y};E.useEffect(()=>{if(e[a].hasCarousel){const p=new CustomEvent("hiddenSectionVisible",{detail:{id:s}});window.dispatchEvent(p)}},[s]);const f=[],m=[];return e.forEach(({id:p,text:y,content:v,href:T,hasCarousel:_,breakpoint:C},w)=>{if(C&&!d(C))return;p=r(p,y,w);const x=s===p,S={};T||(S["aria-controls"]=p,S.onClick=N=>{N.preventDefault(),N.stopPropagation(),o(p),!n&&window.history.replaceState(null,"",`#${p}`)},m.push(h.jsx("section",{id:p,hidden:!x,role:"tabpanel","aria-labelledby":`tab-${p}`,"aria-live":x?"assertive":"off",children:typeof v=="string"?h.jsx("p",{children:v}):v},`section-${p}`))),f.push(h.jsx("li",{"data-testid":"navigation-tab",children:h.jsx("a",{href:T||`#${p}`,id:`tab-${p}`,"aria-controls":p,className:te({selected:x}),role:"tab",tabIndex:x?0:-1,"aria-selected":x,onKeyDown:N=>c(N,w),...S,children:y})},`tab-${p}`))}),h.jsxs("div",{className:te("tabs-wrapper",t),children:[h.jsx("ul",{className:"tabs",role:"tablist",children:f}),h.jsx("div",{className:"tab-content",children:m})]})};const CF={"2-1":901,"1-3":769,"1-1":769},g_=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:i})=>{const a=Wi(!0);let s=i;if(E.Children.count(i)===1){const o=E.Children.toArray(i)[0];E.isValidElement(o)&&o.props&&(s=o.props.children)}return h.jsx("section",{className:te("columns",`layout-${e}`,r,{"has-containers":n}),children:E.Children.map(s,(o,l)=>t!==!1&&l===t&&a&&a<CF[e]?null:o)})};const Zi=({children:e,className:t="",styling:n={},...r})=>{const{background:i="default",padding:a="none"}=n;return h.jsx("section",{className:te("full-width-section",t,{[i]:i!=="default",[a]:a!=="none"}),...r,children:e})};const xF=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(i=>{r.push({href:i.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable new","data-gtm-event-type":"download-click","data-gtm-event-context":i.eventContext||"Download",target:"_blank",children:i.text})}),h.jsx(Zi,{className:te("download-section",n),styling:{background:"dark"},children:h.jsxs("div",{className:"content-default",children:[E.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),h.jsx(Hs,{buttons:r})]})})};const Mh="editSection_";function v_({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const wF=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:i,setShowModal:a})=>{const{formatMessage:s}=le.useIntl();return h.jsxs(In,{variant:"muted",icon:e,children:[h.jsx("p",{children:t||s({id:`${Mh}placeholder_description`})}),i&&h.jsx("p",{children:h.jsx(Ie,{href:r,variant:"secondary",size:"small",onClick:()=>v_({href:r,setShowModal:a}),children:n||s({id:`${Mh}placeholder_cta`})})})]})},AF=({children:e,className:t="",formProps:n,formComponent:r,href:i,title:a,showTitle:s=!0,modalTitle:o,placeholder:l,showDivider:u=!0})=>{const{formatMessage:c}=le.useIntl(),[d,f]=E.useState(!1),m=()=>f(!1),g=!!n||!!r,p=typeof i=="string"||g;let y;return r&&(y=E.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()}}})),h.jsxs("section",{className:te("edit-section",t),children:[g&&h.jsx(vi,{title:o||`Edit ${a}`,isOpen:d,showDivider:!1,showIcon:!1,functions:{onClose:m},className:te("edit-section-modal"),children:y||(n?h.jsx(vr,{...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 T,_;(T=n==null?void 0:n.functions)!=null&&T.onSuccess&&await((_=n==null?void 0:n.functions)==null?void 0:_.onSuccess(v)),f(!1)},onCancel:m}}):h.jsx(h.Fragment,{}))}),h.jsxs("div",{className:te("edit-section-header",{"no-title":!s}),children:[s&&h.jsx("h2",{className:"edit-section-header-title",children:a}),p&&h.jsx(Ie,{href:i,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>v_({href:i,setShowModal:f}),children:c({id:`${Mh}edit`})})]}),e||h.jsx(wF,{...l,href:i,setShowModal:f,showEditButton:p}),u&&h.jsx(pr,{})]})};const SF=({title:e=!1,text:t,logos:n=[],styling:r={},className:i=""})=>{const a=n.length;if(a===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return h.jsxs("div",{className:te("logos",i,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&E.createElement(s.element,{className:te("title",s.className)},s.text),t&&h.jsx("p",{children:t}),h.jsx("ul",{className:te({"two-col":a===2||a===4,"three-col":a===5||a<=10&&a%3===0}),children:n.map(({logo:c,nameOfBusiness:d,link:f=!1,description:m=!1},g)=>{if(!c||!c.url)return null;const p=h.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:d});return h.jsxs("li",{children:[h.jsx("p",{className:"img-wrapper",children:f?h.jsx("a",{href:f,target:"_blank",rel:"nofollow noreferrer noopener",children:p}):p}),m&&h.jsx("small",{children:m})]},`${c.url}_${g}`)})})]})};let Nd;const Id="contactFooter_",kF=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=E.useRef(null),[r,i]=E.useState(0),[a,s]=E.useState(!1),o=()=>{n.current&&i(n.current.clientHeight)},l=()=>{a||(s(!0),clearTimeout(Nd),Nd=setTimeout(()=>{o(),s(!1)},500))};return E.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(Nd),window.removeEventListener("resize",l)}),[]),h.jsx(Zi,{id:"contactForm",className:"contact-footer",children:h.jsxs("div",{className:"inner-wrapper",children:[h.jsx("h2",{children:h.jsx(le.FormattedMessage,{id:`${Id}title`})}),h.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:a?{}:{minHeight:r},children:[h.jsxs("aside",{children:[h.jsx("p",{children:h.jsx(le.FormattedMessage,{id:`${Id}text`})}),h.jsx(Ki,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:h.jsx(le.FormattedMessage,{id:`${Id}email`})})]}),h.jsx(i_,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},DF=({activeLink:e,profile:t,...n})=>h.jsx(Zi,{children:h.jsx(g_,{layout:"1-3",children:h.jsxs(h.Fragment,{children:[h.jsx(p_,{activeLink:e,profile:t}),h.jsx(G4,{...n})]})})});const Pd="cookieBanner_",Rd=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Fd=new Date(Date.now()+12*30*24*60*60*1e3),y_=()=>{const e=le.useIntl(),[t,n,r]=hm.useCookies(Rd),[i,a]=E.useState(!t["apol-cookie-banner"]),s=()=>{Rd.forEach(c=>{n(c,!0,{path:"/",expires:Fd,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),a(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Fd}),Rd.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:Fd});return}r(c)}),a(!1)};if(!i)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,gtmType:"accepted-all"}],u=[];return l.forEach(c=>{u.push({variant:c.href?"tertiary":"primary",href:c.href,onClick:c.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${c.gtmType}-click`,children:e.formatMessage({id:`${Pd}buttons_${c.id}`})})}),h.jsxs("section",{id:"cookie-banner","aria-labelledby":"cookie-banner-title","aria-describedby":"cookie-banner-desc","aria-live":"polite","aria-modal":"true",className:"text-medium",children:[h.jsx("h6",{id:"cookie-banner-title","aria-label":"Cookies and your privacy",children:e.formatMessage({id:`${Pd}title`})}),h.jsx("p",{id:"cookie-banner-desc",children:e.formatMessage({id:`${Pd}text`})}),h.jsx(Hs,{buttons:u})]})},si={platform:{order:["events","courses","articles","communities","aiCampus","climateCampus"],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"},aiCampus:{href:"/pages/government-ai-campus",gtmType:"ai-campus-click"},climateCampus:{href:"/pages/government-energy-climate-campus",gtmType:"climate-campus-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:["trust","privacy","terms","cookie","accessibility","ai"],privacy:{href:"/pages/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"/pages/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"},trust:{href:"/pages/trust-at-apolitical",gtmType:"trust-at-apolitical-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:ls["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:ls["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["london","washington","berlin","registered","support","business"],london:{address:!0},washington:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:ls.support,gtmType:"concierge-email-click"},business:{email:ls.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 ps="footer_",Bc="SiteFooter",I9=({group:e})=>{const t=si[e].order||[];let n=!1;return"text"in si[e]&&(n=si[e].text),h.jsxs(E.Fragment,{children:[h.jsx("p",{className:"pre-title",children:h.jsx(le.FormattedMessage,{id:`${ps}${e}`})}),Array.isArray(t)&&t.length>0&&h.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:a}=si[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),h.jsx("li",{children:h.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":Bc,"data-gtm-event-type":a,...s,children:h.jsx(le.FormattedMessage,{id:`${ps}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&h.jsx("dl",{className:"text-medium",children:n.order.map(r=>h.jsxs(E.Fragment,{children:[h.jsx("dt",{children:h.jsx(le.FormattedMessage,{id:`${ps}${e}_${r}`})}),h.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&h.jsx("address",{children:h.jsx(le.FormattedMessage,{id:`${ps}${e}_${r}_address`,values:{br:h.jsx("br",{},"br")}})}),typeof n!="boolean"&&n[r].email&&h.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":Bc,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},yp=()=>h.jsx("div",{id:"footer",children:h.jsxs("div",{className:"wrapper",children:[h.jsx(Yc,{element:"hr"}),h.jsx(vp,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Bc,"data-gtm-event-type":"logo-homepage-link"}),h.jsx("footer",{children:["platform","community","company","contact"].map(e=>h.jsxs("div",{className:"group",children:[h.jsx(I9,{group:e}),Object.keys(si[e]).includes("child")&&h.jsx(I9,{group:si[e].child})]},e))}),h.jsx("hr",{}),h.jsxs("div",{className:"sub-footer",children:[h.jsx("ul",{children:Array.isArray(si.social.order)&&si.social.order.map(e=>{const t=si.social[e];return h.jsx("li",{className:e,children:h.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":Bc,"data-gtm-event-type":"social-click",children:h.jsx("span",{className:"hidden",children:h.jsx(le.FormattedMessage,{id:`${ps}social_${e}`})})})},e)})}),h.jsx("small",{children:h.jsx(le.FormattedMessage,{id:`${ps}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),jr=Object.create(null);jr.open="0";jr.close="1";jr.ping="2";jr.pong="3";jr.message="4";jr.upgrade="5";jr.noop="6";const rc=Object.create(null);Object.keys(jr).forEach(e=>{rc[jr[e]]=e});const Lh={type:"error",data:"parser error"},E_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",b_=typeof ArrayBuffer=="function",T_=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ep=({type:e,data:t},n,r)=>E_&&t instanceof Blob?n?r(t):P9(t,r):b_&&(t instanceof ArrayBuffer||T_(t))?n?r(t):P9(new Blob([t]),r):r(jr[e]+(t||"")),P9=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function R9(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Bd;function OF(e,t){if(E_&&e.data instanceof Blob)return e.data.arrayBuffer().then(R9).then(t);if(b_&&(e.data instanceof ArrayBuffer||T_(e.data)))return t(R9(e.data));Ep(e,!1,n=>{Bd||(Bd=new TextEncoder),t(Bd.encode(n))})}const F9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Io=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<F9.length;e++)Io[F9.charCodeAt(e)]=e;const NF=e=>{let t=e.length*.75,n=e.length,r,i=0,a,s,o,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)a=Io[e.charCodeAt(r)],s=Io[e.charCodeAt(r+1)],o=Io[e.charCodeAt(r+2)],l=Io[e.charCodeAt(r+3)],c[i++]=a<<2|s>>4,c[i++]=(s&15)<<4|o>>2,c[i++]=(o&3)<<6|l&63;return u},IF=typeof ArrayBuffer=="function",bp=(e,t)=>{if(typeof e!="string")return{type:"message",data:__(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:PF(e.substring(1),t)}:rc[n]?e.length>1?{type:rc[n],data:e.substring(1)}:{type:rc[n]}:Lh},PF=(e,t)=>{if(IF){const n=NF(e);return __(n,t)}else return{base64:!0,data:e}},__=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},C_=String.fromCharCode(30),RF=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((a,s)=>{Ep(a,!1,o=>{r[s]=o,++i===n&&t(r.join(C_))})})},FF=(e,t)=>{const n=e.split(C_),r=[];for(let i=0;i<n.length;i++){const a=bp(n[i],t);if(r.push(a),a.type==="error")break}return r};function BF(){return new TransformStream({transform(e,t){OF(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Md;function ou(e){return e.reduce((t,n)=>t+n.length,0)}function lu(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function MF(e,t){Md||(Md=new TextDecoder);const n=[];let r=0,i=-1,a=!1;return new TransformStream({transform(s,o){for(n.push(s);;){if(r===0){if(ou(n)<1)break;const l=lu(n,1);a=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(ou(n)<2)break;const l=lu(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(ou(n)<8)break;const l=lu(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){o.enqueue(Lh);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(ou(n)<i)break;const l=lu(n,i);o.enqueue(bp(a?l:Md.decode(l),t)),r=0}if(i===0||i>e){o.enqueue(Lh);break}}}})}const x_=4;function $t(e){if(e)return LF(e)}function LF(e){for(var t in $t.prototype)e[t]=$t.prototype[t];return e}$t.prototype.on=$t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};$t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};$t.prototype.off=$t.prototype.removeListener=$t.prototype.removeAllListeners=$t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};$t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};$t.prototype.emitReserved=$t.prototype.emit;$t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};$t.prototype.hasListeners=function(e){return!!this.listeners(e).length};const d1=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Vn=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),$F="arraybuffer";function w_(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const jF=Vn.setTimeout,HF=Vn.clearTimeout;function f1(e,t){t.useNativeTimers?(e.setTimeoutFn=jF.bind(Vn),e.clearTimeoutFn=HF.bind(Vn)):(e.setTimeoutFn=Vn.setTimeout.bind(Vn),e.clearTimeoutFn=Vn.clearTimeout.bind(Vn))}const UF=1.33;function zF(e){return typeof e=="string"?qF(e):Math.ceil((e.byteLength||e.size)*UF)}function qF(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function A_(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function WF(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function VF(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class KF extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Tp extends $t{constructor(t){super(),this.writable=!1,f1(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new KF(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=bp(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=WF(t);return n.length?"?"+n:""}}class GF extends Tp{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};FF(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,RF(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=A_()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let S_=!1;try{S_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const YF=S_;function ZF(){}class QF extends GF{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Rr extends $t{constructor(t,n,r){super(),this.createRequest=t,f1(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=w_(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Rr.requestsCount++,Rr.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=ZF,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Rr.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Rr.requestsCount=0;Rr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",B9);else if(typeof addEventListener=="function"){const e="onpagehide"in Vn?"pagehide":"unload";addEventListener(e,B9,!1)}}function B9(){for(let e in Rr.requests)Rr.requests.hasOwnProperty(e)&&Rr.requests[e].abort()}const XF=function(){const e=k_({xdomain:!1});return e&&e.responseType!==null}();class JF extends QF{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=XF&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Rr(k_,this.uri(),t)}}function k_(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||YF))return new XMLHttpRequest}catch{}if(!t)try{return new Vn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const D_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class eB extends Tp{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=D_?{}:w_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Ep(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}i&&d1(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=A_()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ld=Vn.WebSocket||Vn.MozWebSocket;class tB extends eB{createSocket(t,n,r){return D_?new Ld(t,n,r):n?new Ld(t,n):new Ld(t)}doWrite(t,n){this.ws.send(n)}}class nB extends Tp{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=MF(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=BF();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{r.read().then(({done:o,value:l})=>{o||(this.onPacket(l),a())}).catch(o=>{})};a();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&d1(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const rB={websocket:tB,webtransport:nB,polling:JF},iB=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,aB=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function $h(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=iB.exec(e||""),a={},s=14;for(;s--;)a[aB[s]]=i[s]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=sB(a,a.path),a.queryKey=oB(a,a.query),a}function sB(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function oB(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}const jh=typeof addEventListener=="function"&&typeof removeEventListener=="function",ic=[];jh&&addEventListener("offline",()=>{ic.forEach(e=>e())},!1);class Ui extends $t{constructor(t,n){if(super(),this.binaryType=$F,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=$h(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=$h(n.host).host);f1(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=VF(this.opts.query)),jh&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ic.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=x_,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ui.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ui.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=zF(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,d1(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ui.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),jh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=ic.indexOf(this._offlineEventListener);r!==-1&&ic.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ui.protocol=x_;class lB extends Ui{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ui.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ui.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,c(),n.close(),n=null)}const s=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function o(){s("transport closed")}function l(){s("socket closed")}function u(d){n&&d.name!==n.name&&a()}const c=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",o),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",o),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let uB=class extends lB{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>rB[i]).filter(i=>!!i)),super(t,r)}};function cB(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=$h(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const dB=typeof ArrayBuffer=="function",fB=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,O_=Object.prototype.toString,hB=typeof Blob=="function"||typeof Blob<"u"&&O_.call(Blob)==="[object BlobConstructor]",mB=typeof File=="function"||typeof File<"u"&&O_.call(File)==="[object FileConstructor]";function _p(e){return dB&&(e instanceof ArrayBuffer||fB(e))||hB&&e instanceof Blob||mB&&e instanceof File}function ac(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(ac(e[n]))return!0;return!1}if(_p(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ac(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ac(e[n]))return!0;return!1}function pB(e){const t=[],n=e.data,r=e;return r.data=Hh(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Hh(e,t){if(!e)return e;if(_p(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Hh(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Hh(e[r],t));return n}return e}function gB(e,t){return e.data=Uh(e.data,t),delete e.attachments,e}function Uh(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Uh(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Uh(e[n],t));return e}const vB=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],yB=5;var st;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(st||(st={}));class EB{constructor(t){this.replacer=t}encode(t){return(t.type===st.EVENT||t.type===st.ACK)&&ac(t)?this.encodeAsBinary({type:t.type===st.EVENT?st.BINARY_EVENT:st.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===st.BINARY_EVENT||t.type===st.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=pB(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function M9(e){return Object.prototype.toString.call(e)==="[object Object]"}class Cp extends $t{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===st.BINARY_EVENT;r||n.type===st.BINARY_ACK?(n.type=r?st.EVENT:st.ACK,this.reconstructor=new bB(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(_p(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(st[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===st.BINARY_EVENT||r.type===st.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(a,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Cp.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case st.CONNECT:return M9(n);case st.DISCONNECT:return n===void 0;case st.CONNECT_ERROR:return typeof n=="string"||M9(n);case st.EVENT:case st.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&vB.indexOf(n[0])===-1);case st.ACK:case st.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class bB{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=gB(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const TB=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Cp,Encoder:EB,get PacketType(){return st},protocol:yB},Symbol.toStringTag,{value:"Module"}));function fr(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const _B=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class N_ extends $t{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[fr(t,"open",this.onopen.bind(this)),fr(t,"packet",this.onpacket.bind(this)),fr(t,"error",this.onerror.bind(this)),fr(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,a;if(_B.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:st.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const c=this.ids++,d=n.pop();this._registerAckCallback(c,d),s.id=c}const o=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!o||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},i),s=(...o)=>{this.io.clearTimeoutFn(a),n.apply(this,o)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,i)=>{const a=(s,o)=>s?i(s):r(o);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:st.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case st.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case st.EVENT:case st.BINARY_EVENT:this.onevent(t);break;case st.ACK:case st.BINARY_ACK:this.onack(t);break;case st.DISCONNECT:this.ondisconnect();break;case st.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:st.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:st.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ws(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ws.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Ws.prototype.reset=function(){this.attempts=0};Ws.prototype.setMin=function(e){this.ms=e};Ws.prototype.setMax=function(e){this.max=e};Ws.prototype.setJitter=function(e){this.jitter=e};class zh extends $t{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,f1(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ws({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||TB;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new uB(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=fr(n,"open",function(){r.onopen(),t&&t()}),a=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),t?t(o):this.maybeReconnectOnOpen()},s=fr(n,"error",a);if(this._timeout!==!1){const o=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},o);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(fr(t,"ping",this.onping.bind(this)),fr(t,"data",this.ondata.bind(this)),fr(t,"error",this.onerror.bind(this)),fr(t,"close",this.onclose.bind(this)),fr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){d1(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new N_(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const lo={};function sc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=cB(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,s=lo[i]&&a in lo[i].nsps,o=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return o?l=new zh(r,t):(lo[i]||(lo[i]=new zh(r,t)),l=lo[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(sc,{Manager:zh,Socket:N_,io:sc,connect:sc});const L9=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const m=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,m))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{n.clear()}},u=t=e(r,i,l);return l},I_=e=>e?L9(e):L9;function CB(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(i){i(n)}),(r=e.get("*"))&&r.slice().map(function(i){i(t,n)})}}}function Nn(){return Nn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nn.apply(this,arguments)}class xB extends Error{constructor(t){super(t),this.name=void 0,this.name="SuprSendError"}}function Ea(){return Math.round(Date.now())}function ia(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)});return t}const ln=I_()(()=>({apiUrl:"https://inboxs.live",collectorApiUrl:"https://hub.suprsend.com",socketUrl:"https://betainbox.suprsend.com",pageSize:20})),wB={unseenCount:0,stores:{},activeStoreId:null,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null},at=I_()(()=>wB);class AB{constructor(t){this.socket=void 0,this.config=void 0,this.config=t;const n=ln.getState();this.socket=sc(n.socketUrl,{transports:["websocket"],auth:{subscriber_id:this.config.subscriberId,distinct_id:this.config.distinctId,authorization:`${this.config.workspaceKey}:${ia()}`,tenant_id:this.config.tenantId},reconnectionAttempts:25,reconnectionDelay:5e3,reconnectionDelayMax:1e4}),this._initializeSocketEvents()}orderNotifications(t,n){if(t.is_pinned)return[t,...n];{let r=!1,i=[];return n.forEach(a=>{a.is_pinned||r?i.push(a):(i.push(t),i.push(a),r=!0)}),r?i:[...n,t]}}_initializeSocketEvents(){var t=this;this.socket.on("new_notification",async function(n){n.n_id&&setTimeout(async function(){try{const i=await(await t.getNotificationDetails(n.n_id)).json(),a=at.getState();if(t.config.stores){let s=!1;for(let o of t.config.stores){const l=a.stores[o.storeId];t._notificationBelongToStore(i.data,o)&&(s=!0,l.notifications=t.orderNotifications(i.data,l.notifications),l.unseenCount+=1)}s&&(a.unseenCount+=1,t.config.emitter.emit("new_notification",i.data)),at.setState({unseenCount:a.unseenCount,stores:Nn({},a.stores)})}else{if(!a.activeStoreId)return;let s=a.stores[a.activeStoreId];a.unseenCount+=1,s.unseenCount+=1,s.notifications=t.orderNotifications(i.data,s.notifications),at.setState({unseenCount:a.unseenCount,stores:Nn({},a.stores)}),t.config.emitter.emit("new_notification",i.data)}t.config.emitter.emit("sync_notif_store")}catch(r){console.log("SuprSend: error in new_notification event",r)}},1e3)}),this.socket.on("notification_updated",async function(n){n.n_id&&setTimeout(async function(){try{const a=await Promise.allSettled([t.getNotificationDetails(n.n_id),t.getNotificationsCount()]),s=at.getState();let o=s.activeStoreId;if(a[0].status==="fulfilled"){var r;const u=await a[0].value.json(),c=u.data;if(!o)return;let d=s.stores[o];const f=(r=t.config.stores)==null?void 0:r.find(m=>m.storeId===o);if((n==null?void 0:n.type)==="archive"){var i;f!=null&&(i=f.query)!=null&&i.archived?t._notificationBelongToStore(c,f)&&(s.stores[o].notifications=[c,...d.notifications]):s.stores[o].notifications=d.notifications.filter(m=>m.n_id!==n.n_id)}else s.stores[o].notifications=d.notifications.map(m=>m.n_id===n.n_id?u.data:m);at.setState({stores:Nn({},s.stores)})}if(a[1].status==="fulfilled"){const u=await a[1].value.json();at.setState(c=>{for(let d in c.stores){const f=c.stores[d];f.unseenCount=u[d]||0}return{unseenCount:u.ss_bell_count,stores:Nn({},c.stores)}})}t.config.emitter.emit("sync_notif_store")}catch(a){console.log("SuprSend: error in notification_updated event",a)}},1e3)}),this.socket.on("update_badge",async function(){at.setState({unseenCount:0}),t.config.emitter.emit("sync_notif_store")}),this.socket.on("mark_all_read",async function(){const n=at.getState(),r=Ea();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(s=>{s.seen_on||(s.seen_on=r)}),a.unseenCount=0}at.setState({stores:n.stores}),t.config.emitter.emit("sync_notif_store")})}_notificationBelongToStore(t,n){var r,i,a,s;const o=!!t.seen_on,l=t.archived,u=t.tags,c=t.n_category,d=n==null||(r=n.query)==null?void 0:r.read,f=n==null||(i=n.query)==null?void 0:i.archived,m=n==null||(a=n.query)==null?void 0:a.tags,g=n==null||(s=n.query)==null?void 0:s.categories,p=!d||o===d,y=!f||l===f;let v,T;return Array.isArray(m)&&m.length>0?m.forEach(_=>{u!=null&&u.includes(_)&&(v=!0)}):v=!0,Array.isArray(g)&&g.length>0?g.includes(c)&&(T=!0):T=!0,p&&v&&T&&y}_getStoreQueryString(t){const n=t==null?void 0:t.query;let r=(n==null?void 0:n.tags)||[],i=(n==null?void 0:n.categories)||[];const a=n==null?void 0:n.read,s=n==null?void 0:n.archived;return{store_id:t.storeId,query:{read:a,archived:s,tags:{or:r},categories:{or:i}}}}_getStoresQueryString(){const t=this.config.stores;return t==null?void 0:t.map(r=>this._getStoreQueryString(r))}getNotificationsCount(){const{apiUrl:t}=ln.getState();let n=`/notification_count/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}`;if(this.config.stores){const r=this._getStoresQueryString();n+=`&stores=${encodeURIComponent(JSON.stringify(r))}`}return fetch(`${t}${n}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${ia()}`}})}getNotifications(t,n,r=20,i){const{apiUrl:a}=ln.getState();let s=`/notifications/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}&page_no=${n}&page_size=${r}&before=${i}`;if(t){const o=this._getStoreQueryString(t);s+=`&store=${encodeURIComponent(JSON.stringify(o))}`}return fetch(`${a}${s}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${ia()}`}})}getNotificationDetails(t){const{apiUrl:n}=ln.getState(),r=`/notification/${t}/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}`;return fetch(`${n}${r}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${ia()}`}})}markBellClicked(){const{apiUrl:t}=ln.getState(),n="/bell-clicked/",r=JSON.stringify({time:Ea(),distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId,tenant_id:this.config.tenantId});return fetch(`${t}${n}`,{method:"POST",body:r,headers:{Authorization:`${this.config.workspaceKey}:${ia()}`,"Content-Type":"application/json"}})}markAllRead(){const{apiUrl:t}=ln.getState(),n="/mark-all-read/",r=JSON.stringify({time:Ea(),distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId,tenant_id:this.config.tenantId});return fetch(`${t}${n}`,{method:"POST",body:r,headers:{Authorization:`${this.config.workspaceKey}:${ia()}`,"Content-Type":"application/json"}})}markNotificationClicked(t){const{collectorApiUrl:n}=ln.getState(),r={event:"$notification_clicked",env:this.config.workspaceKey,$insert_id:ia(),$time:Ea(),properties:{id:t}};return fetch(`${n}/event/`,{method:"POST",body:JSON.stringify(r),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationRead(t){const{apiUrl:n}=ln.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"read",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationUnRead(t){const{apiUrl:n}=ln.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"unread",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationArchive(t){const{apiUrl:n}=ln.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"archive",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}}let $9=class{constructor(t){this.config=void 0,this.config=t}_overallFirstApiCall(){const t=at.getState();for(let n in t.stores)if(t.stores[n].isFirstCall===!1)return!1;return!0}async fetchNotifications(){var t,n;const r=this.config.client,i=at.getState(),a=ln.getState(),s=i.activeStoreId;if(!s||!((t=i.stores)!=null&&t[s]))return;const o=i.stores[s],l=o.isFirstCall,u=i.initialFetchTime||Date.now(),c=(n=this.config.stores)==null?void 0:n.find(d=>d.storeId===s);try{if(!r||!i.hasNext)return;l?(at.setState({initialLoading:!0}),this._overallFirstApiCall()&&this.getNotificationsCount()):i.pageNumber>1&&at.setState({fetchMoreLoading:!0}),this.config.emitter.emit("sync_notif_store");const f=await(await r.getNotifications(c,i.pageNumber,a.pageSize,u)).json();let m;l||!l&&i.pageNumber===1?m=f.results:m=[...o.notifications,...f.results],i.stores[s].notifications=m,i.stores[s].isFirstCall=!1,at.setState({stores:i.stores,pageNumber:i.pageNumber+1,hasNext:f.meta.current_page<f.meta.total_pages,initialFetchTime:u,initialLoading:!1,fetchMoreLoading:!1}),this.config.emitter.emit("sync_notif_store"),this.config._startExipryCheck()}catch(d){console.log("SUPRSEND: error getting latest notifications",d),at.setState({initialLoading:!1,fetchMoreLoading:!1}),this.config.emitter.emit("sync_notif_store")}}async getNotificationsCount(){const t=this.config.client;if(t)try{const r=await(await t.getNotificationsCount()).json();at.setState(i=>{for(let a in i.stores){const s=i.stores[a];s.unseenCount=r[a]||0}return{unseenCount:r.ss_bell_count,stores:Nn({},i.stores)}}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error getting notifications count",n)}}async markClicked(t){var n;const r=this.config.client,i=at.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&(!l.interacted_on||!l.seen_on)){if(!r)return;try{l.interacted_on?l.seen_on||r.markNotificationRead(t):r.markNotificationClicked(t);const c=Ea();if(l.interacted_on=c,!l.seen_on)for(let d in i==null?void 0:i.stores){var u;const f=i.stores[d];(u=f.notifications)==null||u.forEach(m=>{m.n_id===l.n_id&&(m.seen_on=c,m.interacted_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}at.setState(Nn({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification clicked",c)}}}async markAllSeen(){const t=this.config.client;try{if(!t)return;t.markBellClicked(),at.setState({unseenCount:0}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error marking all notifications seen",n)}}async markAllRead(){const t=this.config.client;try{if(!t)return;t.markAllRead();const n=at.getState(),r=Ea();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(s=>{s.seen_on||(s.seen_on=r)}),a.unseenCount=0}at.setState({stores:n.stores}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error marking all notifications read",n)}}async markRead(t){var n;const r=this.config.client,i=at.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&!l.seen_on){if(!r)return;try{r.markNotificationRead(t);const c=Ea();if(!l.seen_on)for(let d in i==null?void 0:i.stores){var u;const f=i.stores[d];(u=f.notifications)==null||u.forEach(m=>{m.n_id===l.n_id&&(m.seen_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}at.setState(Nn({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification read",c)}}}async markUnRead(t){var n;const r=this.config.client,i=at.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&l.seen_on){if(!r)return;try{if(r.markNotificationUnRead(t),l.seen_on)for(let c in i==null?void 0:i.stores){var u;const d=i.stores[c];(u=d.notifications)==null||u.forEach(f=>{f.n_id===l.n_id&&(f.seen_on=void 0,d.unseenCount>=0&&(d.unseenCount+=1))})}at.setState(Nn({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification read",c)}}}markArchived(t){var n;const r=this.config.client,i=at.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const o=(i==null?void 0:i.stores)[a],l=o.notifications.find(u=>u.n_id===t);if(l&&!l.archived){if(!r)return;try{r.markNotificationArchive(t),o.notifications=o.notifications.filter(u=>u.n_id!==t),!l.seen_on&&o.unseenCount>0&&(o.unseenCount-=1),at.setState(Nn({},i)),this.config.emitter.emit("sync_notif_store")}catch(u){console.log("SUPRSEND: error marking notification archived",u)}}}get stores(){return this.config.stores}get data(){const t=at.getState(),n=t.activeStoreId,r=this.stores;if(n)return{unseenCount:t.unseenCount,activeStoreId:t.activeStoreId,stores:t.stores,hasStores:r?(r==null?void 0:r.length)>0:!1,hasNext:t.hasNext,initialLoading:t.initialLoading,fetchMoreLoading:t.fetchMoreLoading}}};class SB{constructor(t,n){this.workspaceKey="",this.tenantId=void 0,this.stores=void 0,this.distinctId=void 0,this.subscriberId=void 0,this._client=void 0,this._expiryTimerId=void 0,this.feed=new $9(this),this.emitter=CB(),this._validateConfig(t),this._setConfigStoreState((n==null?void 0:n.host)||{}),this.tenantId=(n==null?void 0:n.tenantID)||"default",this._validateStore(n==null?void 0:n.stores),this._validatePageSize(n==null?void 0:n.pageSize),this._initializeStoreState()}_validateConfig(t){if(t)this.workspaceKey=t;else throw new xB("workspaceKey missing")}_validateStore(t){if(!t||!Array.isArray(t))return;const n=[];t.forEach(r=>{if(!r.storeId){console.log("SuprSendInbox: storeId is mandatory if stores are used");return}const i=r==null?void 0:r.query;let a,s=[],o=[],l;typeof(i==null?void 0:i.read)=="boolean"&&(a=i.read),typeof(i==null?void 0:i.archived)=="boolean"&&(l=i.archived),typeof(i==null?void 0:i.tags)=="string"?s=[i.tags]:Array.isArray(i==null?void 0:i.tags)&&(s=i==null?void 0:i.tags.filter(u=>typeof u=="string")),typeof(i==null?void 0:i.categories)=="string"?o=[i.categories]:Array.isArray(i==null?void 0:i.categories)&&(o=i==null?void 0:i.categories.filter(u=>typeof u=="string")),n.push({storeId:r.storeId,label:r.label||r.storeId,query:{archived:l,read:a,tags:s,categories:o}})}),this.stores=n}_validatePageSize(t){if(t&&typeof t=="number"){const r=t<=50?t:50;ln.setState({pageSize:r})}}_setConfigStoreState(t){t&&(t!=null&&t.socketHost&&ln.setState({socketUrl:t.socketHost}),t!=null&&t.apiHost&&ln.setState({apiUrl:t.apiHost}),t!=null&&t.collectorHost&&ln.setState({collectorApiUrl:t.collectorHost}))}_initializeStoreState(){const t="default_store",n={notifications:[],unseenCount:0,isFirstCall:!0};if(this.stores&&Array.isArray(this.stores)&&this.stores.length>0){const r={};this.stores.map(i=>{r[i.storeId]=Nn({},n)}),at.setState({stores:r,activeStoreId:this.stores[0].storeId})}else at.setState({stores:{[t]:Nn({},n)},activeStoreId:t});setTimeout(()=>{this.emitter.emit("sync_notif_store")},0)}_startExipryCheck(){var t=this;this._expiryTimerId||(this._expiryTimerId=setInterval(async function(){const r=at.getState().stores;let i=!1;for(let a in r){let s=r[a].notifications;s=s.filter(o=>(o.expiry?Date.now()>o.expiry:!1)?(i=!0,!1):!0),r[a].notifications=s}i&&(at.setState({stores:r}),await t.feed.getNotificationsCount(),t.emitter.emit("sync_notif_store"))},3e4))}get client(){return this.distinctId&&this.subscriberId&&(this._client||(this._client=new AB(this))),this._client}identifyUser(t,n){this.distinctId=t,this.subscriberId=n}changeActiveStore(t){var n;const r=at.getState(),i={};if(r.activeStoreId!==t&&(n=r.stores)!=null&&n[t]){for(let a in r.stores){const s=r.stores[a],o=s.notifications.slice(0,20);i[a]={notifications:o,unseenCount:s.unseenCount,isFirstCall:s.isFirstCall}}at.setState({activeStoreId:t,stores:i,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this.client&&this.feed.fetchNotifications()}}resetUser(){var t;at.setState({unseenCount:0,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this._initializeStoreState(),(t=this._client)==null||t.socket.disconnect(),this.distinctId=void 0,this.subscriberId=void 0,this._client=void 0,clearInterval(this._expiryTimerId),this._expiryTimerId=void 0,this.feed=new $9(this)}}var j9=function(t){return t.reduce(function(n,r){var i=r[0],a=r[1];return n[i]=a,n},{})},H9=typeof window<"u"&&window.document&&window.document.createElement?Xt.useLayoutEffect:Xt.useEffect,bn="top",er="bottom",tr="right",Tn="left",xp="auto",Al=[bn,er,tr,Tn],Fs="start",pl="end",kB="clippingParents",P_="viewport",uo="popper",DB="reference",U9=Al.reduce(function(e,t){return e.concat([t+"-"+Fs,t+"-"+pl])},[]),R_=[].concat(Al,[xp]).reduce(function(e,t){return e.concat([t,t+"-"+Fs,t+"-"+pl])},[]),OB="beforeRead",NB="read",IB="afterRead",PB="beforeMain",RB="main",FB="afterMain",BB="beforeWrite",MB="write",LB="afterWrite",$B=[OB,NB,IB,PB,RB,FB,BB,MB,LB];function Hr(e){return e?(e.nodeName||"").toLowerCase():null}function Bn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ia(e){var t=Bn(e).Element;return e instanceof t||e instanceof Element}function Qn(e){var t=Bn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function wp(e){if(typeof ShadowRoot>"u")return!1;var t=Bn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function jB(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},a=t.elements[n];!Qn(a)||!Hr(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(s){var o=i[s];o===!1?a.removeAttribute(s):a.setAttribute(s,o===!0?"":o)}))})}function HB(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],a=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),o=s.reduce(function(l,u){return l[u]="",l},{});!Qn(i)||!Hr(i)||(Object.assign(i.style,o),Object.keys(a).forEach(function(l){i.removeAttribute(l)}))})}}const UB={name:"applyStyles",enabled:!0,phase:"write",fn:jB,effect:HB,requires:["computeStyles"]};function Fr(e){return e.split("-")[0]}var xa=Math.max,Mc=Math.min,Bs=Math.round;function qh(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function F_(){return!/^((?!chrome|android).)*safari/i.test(qh())}function Ms(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&Qn(e)&&(i=e.offsetWidth>0&&Bs(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Bs(r.height)/e.offsetHeight||1);var s=Ia(e)?Bn(e):window,o=s.visualViewport,l=!F_()&&n,u=(r.left+(l&&o?o.offsetLeft:0))/i,c=(r.top+(l&&o?o.offsetTop:0))/a,d=r.width/i,f=r.height/a;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function Ap(e){var t=Ms(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function B_(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&wp(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function di(e){return Bn(e).getComputedStyle(e)}function zB(e){return["table","td","th"].indexOf(Hr(e))>=0}function Qi(e){return((Ia(e)?e.ownerDocument:e.document)||window.document).documentElement}function h1(e){return Hr(e)==="html"?e:e.assignedSlot||e.parentNode||(wp(e)?e.host:null)||Qi(e)}function z9(e){return!Qn(e)||di(e).position==="fixed"?null:e.offsetParent}function qB(e){var t=/firefox/i.test(qh()),n=/Trident/i.test(qh());if(n&&Qn(e)){var r=di(e);if(r.position==="fixed")return null}var i=h1(e);for(wp(i)&&(i=i.host);Qn(i)&&["html","body"].indexOf(Hr(i))<0;){var a=di(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function Sl(e){for(var t=Bn(e),n=z9(e);n&&zB(n)&&di(n).position==="static";)n=z9(n);return n&&(Hr(n)==="html"||Hr(n)==="body"&&di(n).position==="static")?t:n||qB(e)||t}function Sp(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Wo(e,t,n){return xa(e,Mc(t,n))}function WB(e,t,n){var r=Wo(e,t,n);return r>n?n:r}function M_(){return{top:0,right:0,bottom:0,left:0}}function L_(e){return Object.assign({},M_(),e)}function $_(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var VB=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,L_(typeof t!="number"?t:$_(t,Al))};function KB(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,s=n.modifiersData.popperOffsets,o=Fr(n.placement),l=Sp(o),u=[Tn,tr].indexOf(o)>=0,c=u?"height":"width";if(!(!a||!s)){var d=VB(i.padding,n),f=Ap(a),m=l==="y"?bn:Tn,g=l==="y"?er:tr,p=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],y=s[l]-n.rects.reference[l],v=Sl(a),T=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,_=p/2-y/2,C=d[m],w=T-f[c]-d[g],x=T/2-f[c]/2+_,S=Wo(C,x,w),N=l;n.modifiersData[r]=(t={},t[N]=S,t.centerOffset=S-x,t)}}function GB(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||B_(t.elements.popper,i)&&(t.elements.arrow=i))}const YB={name:"arrow",enabled:!0,phase:"main",fn:KB,effect:GB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ls(e){return e.split("-")[1]}var ZB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function QB(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Bs(n*i)/i||0,y:Bs(r*i)/i||0}}function q9(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,s=e.offsets,o=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=s.x,m=f===void 0?0:f,g=s.y,p=g===void 0?0:g,y=typeof c=="function"?c({x:m,y:p}):{x:m,y:p};m=y.x,p=y.y;var v=s.hasOwnProperty("x"),T=s.hasOwnProperty("y"),_=Tn,C=bn,w=window;if(u){var x=Sl(n),S="clientHeight",N="clientWidth";if(x===Bn(n)&&(x=Qi(n),di(x).position!=="static"&&o==="absolute"&&(S="scrollHeight",N="scrollWidth")),x=x,i===bn||(i===Tn||i===tr)&&a===pl){C=er;var B=d&&x===w&&w.visualViewport?w.visualViewport.height:x[S];p-=B-r.height,p*=l?1:-1}if(i===Tn||(i===bn||i===er)&&a===pl){_=tr;var $=d&&x===w&&w.visualViewport?w.visualViewport.width:x[N];m-=$-r.width,m*=l?1:-1}}var F=Object.assign({position:o},u&&ZB),L=c===!0?QB({x:m,y:p},Bn(n)):{x:m,y:p};if(m=L.x,p=L.y,l){var O;return Object.assign({},F,(O={},O[C]=T?"0":"",O[_]=v?"0":"",O.transform=(w.devicePixelRatio||1)<=1?"translate("+m+"px, "+p+"px)":"translate3d("+m+"px, "+p+"px, 0)",O))}return Object.assign({},F,(t={},t[C]=T?p+"px":"",t[_]=v?m+"px":"",t.transform="",t))}function XB(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,s=a===void 0?!0:a,o=n.roundOffsets,l=o===void 0?!0:o,u={placement:Fr(t.placement),variation:Ls(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,q9(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,q9(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const JB={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:XB,data:{}};var uu={passive:!0};function eM(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,s=r.resize,o=s===void 0?!0:s,l=Bn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(c){c.addEventListener("scroll",n.update,uu)}),o&&l.addEventListener("resize",n.update,uu),function(){a&&u.forEach(function(c){c.removeEventListener("scroll",n.update,uu)}),o&&l.removeEventListener("resize",n.update,uu)}}const tM={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:eM,data:{}};var nM={left:"right",right:"left",bottom:"top",top:"bottom"};function oc(e){return e.replace(/left|right|bottom|top/g,function(t){return nM[t]})}var rM={start:"end",end:"start"};function W9(e){return e.replace(/start|end/g,function(t){return rM[t]})}function kp(e){var t=Bn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Dp(e){return Ms(Qi(e)).left+kp(e).scrollLeft}function iM(e,t){var n=Bn(e),r=Qi(e),i=n.visualViewport,a=r.clientWidth,s=r.clientHeight,o=0,l=0;if(i){a=i.width,s=i.height;var u=F_();(u||!u&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:a,height:s,x:o+Dp(e),y:l}}function aM(e){var t,n=Qi(e),r=kp(e),i=(t=e.ownerDocument)==null?void 0:t.body,a=xa(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=xa(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),o=-r.scrollLeft+Dp(e),l=-r.scrollTop;return di(i||n).direction==="rtl"&&(o+=xa(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:s,x:o,y:l}}function Op(e){var t=di(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function j_(e){return["html","body","#document"].indexOf(Hr(e))>=0?e.ownerDocument.body:Qn(e)&&Op(e)?e:j_(h1(e))}function Vo(e,t){var n;t===void 0&&(t=[]);var r=j_(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=Bn(r),s=i?[a].concat(a.visualViewport||[],Op(r)?r:[]):r,o=t.concat(s);return i?o:o.concat(Vo(h1(s)))}function Wh(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function sM(e,t){var n=Ms(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function V9(e,t,n){return t===P_?Wh(iM(e,n)):Ia(t)?sM(t,n):Wh(aM(Qi(e)))}function oM(e){var t=Vo(h1(e)),n=["absolute","fixed"].indexOf(di(e).position)>=0,r=n&&Qn(e)?Sl(e):e;return Ia(r)?t.filter(function(i){return Ia(i)&&B_(i,r)&&Hr(i)!=="body"}):[]}function lM(e,t,n,r){var i=t==="clippingParents"?oM(e):[].concat(t),a=[].concat(i,[n]),s=a[0],o=a.reduce(function(l,u){var c=V9(e,u,r);return l.top=xa(c.top,l.top),l.right=Mc(c.right,l.right),l.bottom=Mc(c.bottom,l.bottom),l.left=xa(c.left,l.left),l},V9(e,s,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function H_(e){var t=e.reference,n=e.element,r=e.placement,i=r?Fr(r):null,a=r?Ls(r):null,s=t.x+t.width/2-n.width/2,o=t.y+t.height/2-n.height/2,l;switch(i){case bn:l={x:s,y:t.y-n.height};break;case er:l={x:s,y:t.y+t.height};break;case tr:l={x:t.x+t.width,y:o};break;case Tn:l={x:t.x-n.width,y:o};break;default:l={x:t.x,y:t.y}}var u=i?Sp(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(a){case Fs:l[u]=l[u]-(t[c]/2-n[c]/2);break;case pl:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function gl(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,s=a===void 0?e.strategy:a,o=n.boundary,l=o===void 0?kB:o,u=n.rootBoundary,c=u===void 0?P_:u,d=n.elementContext,f=d===void 0?uo:d,m=n.altBoundary,g=m===void 0?!1:m,p=n.padding,y=p===void 0?0:p,v=L_(typeof y!="number"?y:$_(y,Al)),T=f===uo?DB:uo,_=e.rects.popper,C=e.elements[g?T:f],w=lM(Ia(C)?C:C.contextElement||Qi(e.elements.popper),l,c,s),x=Ms(e.elements.reference),S=H_({reference:x,element:_,strategy:"absolute",placement:i}),N=Wh(Object.assign({},_,S)),B=f===uo?N:x,$={top:w.top-B.top+v.top,bottom:B.bottom-w.bottom+v.bottom,left:w.left-B.left+v.left,right:B.right-w.right+v.right},F=e.modifiersData.offset;if(f===uo&&F){var L=F[i];Object.keys($).forEach(function(O){var P=[tr,er].indexOf(O)>=0?1:-1,M=[bn,er].indexOf(O)>=0?"y":"x";$[O]+=L[M]*P})}return $}function uM(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,s=n.padding,o=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?R_:l,c=Ls(r),d=c?o?U9:U9.filter(function(g){return Ls(g)===c}):Al,f=d.filter(function(g){return u.indexOf(g)>=0});f.length===0&&(f=d);var m=f.reduce(function(g,p){return g[p]=gl(e,{placement:p,boundary:i,rootBoundary:a,padding:s})[Fr(p)],g},{});return Object.keys(m).sort(function(g,p){return m[g]-m[p]})}function cM(e){if(Fr(e)===xp)return[];var t=oc(e);return[W9(e),t,W9(t)]}function dM(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,s=n.altAxis,o=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,m=n.flipVariations,g=m===void 0?!0:m,p=n.allowedAutoPlacements,y=t.options.placement,v=Fr(y),T=v===y,_=l||(T||!g?[oc(y)]:cM(y)),C=[y].concat(_).reduce(function(j,H){return j.concat(Fr(H)===xp?uM(t,{placement:H,boundary:c,rootBoundary:d,padding:u,flipVariations:g,allowedAutoPlacements:p}):H)},[]),w=t.rects.reference,x=t.rects.popper,S=new Map,N=!0,B=C[0],$=0;$<C.length;$++){var F=C[$],L=Fr(F),O=Ls(F)===Fs,P=[bn,er].indexOf(L)>=0,M=P?"width":"height",U=gl(t,{placement:F,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),D=P?O?tr:Tn:O?er:bn;w[M]>x[M]&&(D=oc(D));var X=oc(D),Z=[];if(a&&Z.push(U[L]<=0),o&&Z.push(U[D]<=0,U[X]<=0),Z.every(function(j){return j})){B=F,N=!1;break}S.set(F,Z)}if(N)for(var k=g?3:1,b=function(H){var z=C.find(function(Y){var re=S.get(Y);if(re)return re.slice(0,H).every(function(Q){return Q})});if(z)return B=z,"break"},q=k;q>0;q--){var R=b(q);if(R==="break")break}t.placement!==B&&(t.modifiersData[r]._skip=!0,t.placement=B,t.reset=!0)}}const fM={name:"flip",enabled:!0,phase:"main",fn:dM,requiresIfExists:["offset"],data:{_skip:!1}};function K9(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function G9(e){return[bn,tr,er,Tn].some(function(t){return e[t]>=0})}function hM(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,s=gl(t,{elementContext:"reference"}),o=gl(t,{altBoundary:!0}),l=K9(s,r),u=K9(o,i,a),c=G9(l),d=G9(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const mM={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hM};function pM(e,t,n){var r=Fr(e),i=[Tn,bn].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=a[0],o=a[1];return s=s||0,o=(o||0)*i,[Tn,tr].indexOf(r)>=0?{x:o,y:s}:{x:s,y:o}}function gM(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,s=R_.reduce(function(c,d){return c[d]=pM(d,t.rects,a),c},{}),o=s[t.placement],l=o.x,u=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}const vM={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:gM};function yM(e){var t=e.state,n=e.name;t.modifiersData[n]=H_({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const EM={name:"popperOffsets",enabled:!0,phase:"read",fn:yM,data:{}};function bM(e){return e==="x"?"y":"x"}function TM(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,s=n.altAxis,o=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,m=f===void 0?!0:f,g=n.tetherOffset,p=g===void 0?0:g,y=gl(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),v=Fr(t.placement),T=Ls(t.placement),_=!T,C=Sp(v),w=bM(C),x=t.modifiersData.popperOffsets,S=t.rects.reference,N=t.rects.popper,B=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,$=typeof B=="number"?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),F=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(x){if(a){var O,P=C==="y"?bn:Tn,M=C==="y"?er:tr,U=C==="y"?"height":"width",D=x[C],X=D+y[P],Z=D-y[M],k=m?-N[U]/2:0,b=T===Fs?S[U]:N[U],q=T===Fs?-N[U]:-S[U],R=t.elements.arrow,j=m&&R?Ap(R):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:M_(),z=H[P],Y=H[M],re=Wo(0,S[U],j[U]),Q=_?S[U]/2-k-re-z-$.mainAxis:b-re-z-$.mainAxis,G=_?-S[U]/2+k+re+Y+$.mainAxis:q+re+Y+$.mainAxis,se=t.elements.arrow&&Sl(t.elements.arrow),ae=se?C==="y"?se.clientTop||0:se.clientLeft||0:0,be=(O=F==null?void 0:F[C])!=null?O:0,Ce=D+Q-be-ae,Pe=D+G-be,je=Wo(m?Mc(X,Ce):X,D,m?xa(Z,Pe):Z);x[C]=je,L[C]=je-D}if(o){var Fe,Be=C==="x"?bn:Tn,Qe=C==="x"?er:tr,tt=x[w],Xe=w==="y"?"height":"width",me=tt+y[Be],de=tt-y[Qe],Te=[bn,Tn].indexOf(v)!==-1,ee=(Fe=F==null?void 0:F[w])!=null?Fe:0,fe=Te?me:tt-S[Xe]-N[Xe]-ee+$.altAxis,Ae=Te?tt+S[Xe]+N[Xe]-ee-$.altAxis:de,Se=m&&Te?WB(fe,tt,Ae):Wo(m?fe:me,tt,m?Ae:de);x[w]=Se,L[w]=Se-tt}t.modifiersData[r]=L}}const _M={name:"preventOverflow",enabled:!0,phase:"main",fn:TM,requiresIfExists:["offset"]};function CM(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function xM(e){return e===Bn(e)||!Qn(e)?kp(e):CM(e)}function wM(e){var t=e.getBoundingClientRect(),n=Bs(t.width)/e.offsetWidth||1,r=Bs(t.height)/e.offsetHeight||1;return n!==1||r!==1}function AM(e,t,n){n===void 0&&(n=!1);var r=Qn(t),i=Qn(t)&&wM(t),a=Qi(t),s=Ms(e,i,n),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Hr(t)!=="body"||Op(a))&&(o=xM(t)),Qn(t)?(l=Ms(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):a&&(l.x=Dp(a))),{x:s.left+o.scrollLeft-l.x,y:s.top+o.scrollTop-l.y,width:s.width,height:s.height}}function SM(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function i(a){n.add(a.name);var s=[].concat(a.requires||[],a.requiresIfExists||[]);s.forEach(function(o){if(!n.has(o)){var l=t.get(o);l&&i(l)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||i(a)}),r}function kM(e){var t=SM(e);return $B.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function DM(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function OM(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Y9={placement:"bottom",modifiers:[],strategy:"absolute"};function Z9(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function NM(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?Y9:i;return function(o,l,u){u===void 0&&(u=a);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Y9,a),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],f=!1,m={state:c,setOptions:function(v){var T=typeof v=="function"?v(c.options):v;p(),c.options=Object.assign({},a,c.options,T),c.scrollParents={reference:Ia(o)?Vo(o):o.contextElement?Vo(o.contextElement):[],popper:Vo(l)};var _=kM(OM([].concat(r,c.options.modifiers)));return c.orderedModifiers=_.filter(function(C){return C.enabled}),g(),m.update()},forceUpdate:function(){if(!f){var v=c.elements,T=v.reference,_=v.popper;if(Z9(T,_)){c.rects={reference:AM(T,Sl(_),c.options.strategy==="fixed"),popper:Ap(_)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function($){return c.modifiersData[$.name]=Object.assign({},$.data)});for(var C=0;C<c.orderedModifiers.length;C++){if(c.reset===!0){c.reset=!1,C=-1;continue}var w=c.orderedModifiers[C],x=w.fn,S=w.options,N=S===void 0?{}:S,B=w.name;typeof x=="function"&&(c=x({state:c,options:N,name:B,instance:m})||c)}}}},update:DM(function(){return new Promise(function(y){m.forceUpdate(),y(c)})}),destroy:function(){p(),f=!0}};if(!Z9(o,l))return m;m.setOptions(u).then(function(y){!f&&u.onFirstUpdate&&u.onFirstUpdate(y)});function g(){c.orderedModifiers.forEach(function(y){var v=y.name,T=y.options,_=T===void 0?{}:T,C=y.effect;if(typeof C=="function"){var w=C({state:c,name:v,instance:m,options:_}),x=function(){};d.push(w||x)}})}function p(){d.forEach(function(y){return y()}),d=[]}return m}}var IM=[tM,EM,JB,UB,vM,fM,_M,YB,mM],PM=NM({defaultModifiers:IM}),RM=typeof Element<"u",FM=typeof Map=="function",BM=typeof Set=="function",MM=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function lc(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!lc(e[r],t[r]))return!1;return!0}var a;if(FM&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;for(a=e.entries();!(r=a.next()).done;)if(!lc(r.value[1],t.get(r.value[0])))return!1;return!0}if(BM&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(MM&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(RM&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!lc(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var LM=function(t,n){try{return lc(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const $M=gr(LM);var jM=[],HM=function(t,n,r){r===void 0&&(r={});var i=Xt.useRef(null),a={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||jM},s=Xt.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=s[0],l=s[1],u=Xt.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(m){var g=m.state,p=Object.keys(g.elements);vx.flushSync(function(){l({styles:j9(p.map(function(y){return[y,g.styles[y]||{}]})),attributes:j9(p.map(function(y){return[y,g.attributes[y]]}))})})},requires:["computeStyles"]}},[]),c=Xt.useMemo(function(){var f={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return $M(i.current,f)?i.current||f:(i.current=f,f)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=Xt.useRef();return H9(function(){d.current&&d.current.setOptions(c)},[c]),H9(function(){if(!(t==null||n==null)){var f=r.createPopper||PM,m=f(t,n,c);return d.current=m,function(){m.destroy(),d.current=null}}},[t,n,r.createPopper]),{state:d.current?d.current.state:null,styles:o.styles,attributes:o.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};function Vh(){return Vh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vh.apply(this,arguments)}function U_(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var UM=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,zM=U_(function(e){return UM.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),qM=!1;function WM(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function VM(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var KM=function(){function e(n){var r=this;this._insertTag=function(i){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,a),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!qM:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(VM(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=WM(i);try{a.insertRule(r,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e}(),en="-ms-",Lc="-moz-",ut="-webkit-",z_="comm",Np="rule",Ip="decl",GM="@import",q_="@keyframes",YM="@layer",ZM=Math.abs,m1=String.fromCharCode,QM=Object.assign;function XM(e,t){return Qt(e,0)^45?(((t<<2^Qt(e,0))<<2^Qt(e,1))<<2^Qt(e,2))<<2^Qt(e,3):0}function W_(e){return e.trim()}function JM(e,t){return(e=t.exec(e))?e[0]:e}function ct(e,t,n){return e.replace(t,n)}function Kh(e,t){return e.indexOf(t)}function Qt(e,t){return e.charCodeAt(t)|0}function vl(e,t,n){return e.slice(t,n)}function Sr(e){return e.length}function Pp(e){return e.length}function cu(e,t){return t.push(e),e}function eL(e,t){return e.map(t).join("")}var p1=1,$s=1,V_=0,Cn=0,Lt=0,Vs="";function g1(e,t,n,r,i,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:p1,column:$s,length:s,return:""}}function co(e,t){return QM(g1("",null,null,"",null,null,0),e,{length:-e.length},t)}function tL(){return Lt}function nL(){return Lt=Cn>0?Qt(Vs,--Cn):0,$s--,Lt===10&&($s=1,p1--),Lt}function Pn(){return Lt=Cn<V_?Qt(Vs,Cn++):0,$s++,Lt===10&&($s=1,p1++),Lt}function Br(){return Qt(Vs,Cn)}function uc(){return Cn}function kl(e,t){return vl(Vs,e,t)}function yl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function K_(e){return p1=$s=1,V_=Sr(Vs=e),Cn=0,[]}function G_(e){return Vs="",e}function cc(e){return W_(kl(Cn-1,Gh(e===91?e+2:e===40?e+1:e)))}function rL(e){for(;(Lt=Br())&&Lt<33;)Pn();return yl(e)>2||yl(Lt)>3?"":" "}function iL(e,t){for(;--t&&Pn()&&!(Lt<48||Lt>102||Lt>57&&Lt<65||Lt>70&&Lt<97););return kl(e,uc()+(t<6&&Br()==32&&Pn()==32))}function Gh(e){for(;Pn();)switch(Lt){case e:return Cn;case 34:case 39:e!==34&&e!==39&&Gh(Lt);break;case 40:e===41&&Gh(e);break;case 92:Pn();break}return Cn}function aL(e,t){for(;Pn()&&e+Lt!==47+10;)if(e+Lt===42+42&&Br()===47)break;return"/*"+kl(t,Cn-1)+"*"+m1(e===47?e:Pn())}function sL(e){for(;!yl(Br());)Pn();return kl(e,Cn)}function oL(e){return G_(dc("",null,null,null,[""],e=K_(e),0,[0],e))}function dc(e,t,n,r,i,a,s,o,l){for(var u=0,c=0,d=s,f=0,m=0,g=0,p=1,y=1,v=1,T=0,_="",C=i,w=a,x=r,S=_;y;)switch(g=T,T=Pn()){case 40:if(g!=108&&Qt(S,d-1)==58){Kh(S+=ct(cc(T),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:S+=cc(T);break;case 9:case 10:case 13:case 32:S+=rL(g);break;case 92:S+=iL(uc()-1,7);continue;case 47:switch(Br()){case 42:case 47:cu(lL(aL(Pn(),uc()),t,n),l);break;default:S+="/"}break;case 123*p:o[u++]=Sr(S)*v;case 125*p:case 59:case 0:switch(T){case 0:case 125:y=0;case 59+c:v==-1&&(S=ct(S,/\f/g,"")),m>0&&Sr(S)-d&&cu(m>32?X9(S+";",r,n,d-1):X9(ct(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(cu(x=Q9(S,t,n,u,c,i,o,_,C=[],w=[],d),a),T===123)if(c===0)dc(S,t,x,x,C,a,d,o,w);else switch(f===99&&Qt(S,3)===110?100:f){case 100:case 108:case 109:case 115:dc(e,x,x,r&&cu(Q9(e,x,x,0,0,i,o,_,i,C=[],d),w),i,w,d,o,r?C:w);break;default:dc(S,x,x,x,[""],w,0,o,w)}}u=c=m=0,p=v=1,_=S="",d=s;break;case 58:d=1+Sr(S),m=g;default:if(p<1){if(T==123)--p;else if(T==125&&p++==0&&nL()==125)continue}switch(S+=m1(T),T*p){case 38:v=c>0?1:(S+="\f",-1);break;case 44:o[u++]=(Sr(S)-1)*v,v=1;break;case 64:Br()===45&&(S+=cc(Pn())),f=Br(),c=d=Sr(_=S+=sL(uc())),T++;break;case 45:g===45&&Sr(S)==2&&(p=0)}}return a}function Q9(e,t,n,r,i,a,s,o,l,u,c){for(var d=i-1,f=i===0?a:[""],m=Pp(f),g=0,p=0,y=0;g<r;++g)for(var v=0,T=vl(e,d+1,d=ZM(p=s[g])),_=e;v<m;++v)(_=W_(p>0?f[v]+" "+T:ct(T,/&\f/g,f[v])))&&(l[y++]=_);return g1(e,t,n,i===0?Np:o,l,u,c)}function lL(e,t,n){return g1(e,t,n,z_,m1(tL()),vl(e,2,-2),0)}function X9(e,t,n,r){return g1(e,t,n,Ip,vl(e,0,r),vl(e,r+1,-1),r)}function Ts(e,t){for(var n="",r=Pp(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function uL(e,t,n,r){switch(e.type){case YM:if(e.children.length)break;case GM:case Ip:return e.return=e.return||e.value;case z_:return"";case q_:return e.return=e.value+"{"+Ts(e.children,r)+"}";case Np:e.value=e.props.join(",")}return Sr(n=Ts(e.children,r))?e.return=e.value+"{"+n+"}":""}function cL(e){var t=Pp(e);return function(n,r,i,a){for(var s="",o=0;o<t;o++)s+=e[o](n,r,i,a)||"";return s}}function dL(e){return function(t){t.root||(t=t.return)&&e(t)}}var fL=function(t,n,r){for(var i=0,a=0;i=a,a=Br(),i===38&&a===12&&(n[r]=1),!yl(a);)Pn();return kl(t,Cn)},hL=function(t,n){var r=-1,i=44;do switch(yl(i)){case 0:i===38&&Br()===12&&(n[r]=1),t[r]+=fL(Cn-1,n,r);break;case 2:t[r]+=cc(i);break;case 4:if(i===44){t[++r]=Br()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=m1(i)}while(i=Pn());return t},mL=function(t,n){return G_(hL(K_(t),n))},J9=new WeakMap,pL=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!J9.get(r))&&!i){J9.set(t,!0);for(var a=[],s=mL(n,a),o=r.props,l=0,u=0;l<s.length;l++)for(var c=0;c<o.length;c++,u++)t.props[u]=a[l]?s[l].replace(/&\f/g,o[c]):o[c]+" "+s[l]}}},gL=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function Y_(e,t){switch(XM(e,t)){case 5103:return ut+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ut+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ut+e+Lc+e+en+e+e;case 6828:case 4268:return ut+e+en+e+e;case 6165:return ut+e+en+"flex-"+e+e;case 5187:return ut+e+ct(e,/(\w+).+(:[^]+)/,ut+"box-$1$2"+en+"flex-$1$2")+e;case 5443:return ut+e+en+"flex-item-"+ct(e,/flex-|-self/,"")+e;case 4675:return ut+e+en+"flex-line-pack"+ct(e,/align-content|flex-|-self/,"")+e;case 5548:return ut+e+en+ct(e,"shrink","negative")+e;case 5292:return ut+e+en+ct(e,"basis","preferred-size")+e;case 6060:return ut+"box-"+ct(e,"-grow","")+ut+e+en+ct(e,"grow","positive")+e;case 4554:return ut+ct(e,/([^-])(transform)/g,"$1"+ut+"$2")+e;case 6187:return ct(ct(ct(e,/(zoom-|grab)/,ut+"$1"),/(image-set)/,ut+"$1"),e,"")+e;case 5495:case 3959:return ct(e,/(image-set\([^]*)/,ut+"$1$`$1");case 4968:return ct(ct(e,/(.+:)(flex-)?(.*)/,ut+"box-pack:$3"+en+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ut+e+e;case 4095:case 3583:case 4068:case 2532:return ct(e,/(.+)-inline(.+)/,ut+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Sr(e)-1-t>6)switch(Qt(e,t+1)){case 109:if(Qt(e,t+4)!==45)break;case 102:return ct(e,/(.+:)(.+)-([^]+)/,"$1"+ut+"$2-$3$1"+Lc+(Qt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Kh(e,"stretch")?Y_(ct(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Qt(e,t+1)!==115)break;case 6444:switch(Qt(e,Sr(e)-3-(~Kh(e,"!important")&&10))){case 107:return ct(e,":",":"+ut)+e;case 101:return ct(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ut+(Qt(e,14)===45?"inline-":"")+"box$3$1"+ut+"$2$3$1"+en+"$2box$3")+e}break;case 5936:switch(Qt(e,t+11)){case 114:return ut+e+en+ct(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ut+e+en+ct(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ut+e+en+ct(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ut+e+en+e+e}return e}var vL=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Ip:t.return=Y_(t.value,t.length);break;case q_:return Ts([co(t,{value:ct(t.value,"@","@"+ut)})],i);case Np:if(t.length)return eL(t.props,function(a){switch(JM(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ts([co(t,{props:[ct(a,/:(read-\w+)/,":"+Lc+"$1")]})],i);case"::placeholder":return Ts([co(t,{props:[ct(a,/:(plac\w+)/,":"+ut+"input-$1")]}),co(t,{props:[ct(a,/:(plac\w+)/,":"+Lc+"$1")]}),co(t,{props:[ct(a,/:(plac\w+)/,en+"input-$1")]})],i)}return""})}},yL=[vL],EL=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var y=p.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=t.stylisPlugins||yL,a={},s,o=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var y=p.getAttribute("data-emotion").split(" "),v=1;v<y.length;v++)a[y[v]]=!0;o.push(p)});var l,u=[pL,gL];{var c,d=[uL,dL(function(p){c.insert(p)})],f=cL(u.concat(i,d)),m=function(y){return Ts(oL(y),f)};l=function(y,v,T,_){c=T,m(y?y+"{"+v.styles+"}":v.styles),_&&(g.inserted[v.name]=!0)}}var g={key:n,sheet:new KM({key:n,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return g.sheet.hydrate(o),g},Yh={exports:{}},ht={};/** @license React v16.13.1
142
+ ${oo(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:oo(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,i)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(i))}];const bF="shareLinks_",TF=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:i="large",variant:a="default",className:s=""})=>{const o=le.useIntl(),l=EF({title:e,link:t,referrer:n});return h.jsxs("aside",{className:te("share-links",i,a,s),children:[h.jsx("p",{className:"text-small",children:o.formatMessage({id:"shareLinks_label"})}),h.jsx("ul",{children:l.map(({key:u,icon:c,url:d,shouldRender:f=!0,onClick:m})=>{if(typeof f=="function"&&!f())return null;const g={};return m&&(g.onClick=p=>m(p,d)),h.jsx("li",{children:h.jsx(Ie,{size:i,variant:"tertiary",icon:{icon:c||u},href:d,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${u}-click`,"data-testid":"link",screenreaderText:o.formatMessage({id:`${bF}link_${u}`}),...g})},u)})})]})};const _F=({tabs:e,className:t="",preventLocationChange:n})=>{var g;const r=(p,y,v)=>(p||(p=`panel-${mi(y)}-${v}`),p),i=Wi(!0)||0;let a=e.findIndex(p=>p.current===!0);if(a<0&&(a=0),window.location.hash){const p=window.location.hash.replace("#","");if(e.find(v=>v.id===p)){for(let v=0;v<e.length;v++)if(r(e[v].id,e[v].text,v)===p){a=v;break}}}const[s,o]=E.useState((g=e[a])!=null&&g.id?e[a].id:r(e[a].id,e[a].text,a)),[l,u]=E.useState(""),c=(p,y)=>{switch(p.key){case"ArrowLeft":case"ArrowRight":{p.preventDefault();let v=y;p.key==="ArrowLeft"?y>0?v=y-1:v=e.length-1:p.key==="ArrowRight"&&(y<e.length-1?v=y+1:v=0);const T=r(e[v].id,e[v].text,v),_=document.getElementById(`tab-${T}`);_==null||_.focus(),u(T);break}case"Enter":o(l),window.location.hash=`#${l}`;break}},d=p=>{let y=!1;return p.target==="min-width"&&i>=p.value&&(y=!0),p.target==="max-width"&&i<=p.value&&(y=!0),y};E.useEffect(()=>{if(e[a].hasCarousel){const p=new CustomEvent("hiddenSectionVisible",{detail:{id:s}});window.dispatchEvent(p)}},[s]);const f=[],m=[];return e.forEach(({id:p,text:y,content:v,href:T,hasCarousel:_,breakpoint:C},w)=>{if(C&&!d(C))return;p=r(p,y,w);const x=s===p,S={};T||(S["aria-controls"]=p,S.onClick=N=>{N.preventDefault(),N.stopPropagation(),o(p),!n&&window.history.replaceState(null,"",`#${p}`)},m.push(h.jsx("section",{id:p,hidden:!x,role:"tabpanel","aria-labelledby":`tab-${p}`,"aria-live":x?"assertive":"off",children:typeof v=="string"?h.jsx("p",{children:v}):v},`section-${p}`))),f.push(h.jsx("li",{"data-testid":"navigation-tab",children:h.jsx("a",{href:T||`#${p}`,id:`tab-${p}`,"aria-controls":p,className:te({selected:x}),role:"tab",tabIndex:x?0:-1,"aria-selected":x,onKeyDown:N=>c(N,w),...S,children:y})},`tab-${p}`))}),h.jsxs("div",{className:te("tabs-wrapper",t),children:[h.jsx("ul",{className:"tabs",role:"tablist",children:f}),h.jsx("div",{className:"tab-content",children:m})]})};const CF={"2-1":901,"1-3":769,"1-1":769},g_=({layout:e="2-1",hideOnMobile:t=!1,hasCSSContainers:n=!1,className:r="",children:i})=>{const a=Wi(!0);let s=i;if(E.Children.count(i)===1){const o=E.Children.toArray(i)[0];E.isValidElement(o)&&o.props&&(s=o.props.children)}return h.jsx("section",{className:te("columns",`layout-${e}`,r,{"has-containers":n}),children:E.Children.map(s,(o,l)=>t!==!1&&l===t&&a&&a<CF[e]?null:o)})};const Zi=({children:e,className:t="",styling:n={},...r})=>{const{background:i="default",padding:a="none"}=n;return h.jsx("section",{className:te("full-width-section",t,{[i]:i!=="default",[a]:a!=="none"}),...r,children:e})};const xF=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(i=>{r.push({href:i.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable new","data-gtm-event-type":"download-click","data-gtm-event-context":i.eventContext||"Download",target:"_blank",children:i.text})}),h.jsx(Zi,{className:te("download-section",n),styling:{background:"dark"},children:h.jsxs("div",{className:"content-default",children:[E.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),h.jsx(Hs,{buttons:r})]})})};const Mh="editSection_";function v_({href:e,setShowModal:t}){typeof e!="string"&&t(!0)}const wF=({icon:e,description:t,ctaMessage:n,href:r,showEditButton:i,setShowModal:a})=>{const{formatMessage:s}=le.useIntl();return h.jsxs(In,{variant:"muted",icon:e,children:[h.jsx("p",{children:t||s({id:`${Mh}placeholder_description`})}),i&&h.jsx("p",{children:h.jsx(Ie,{href:r,variant:"secondary",size:"small",onClick:()=>v_({href:r,setShowModal:a}),children:n||s({id:`${Mh}placeholder_cta`})})})]})},AF=({children:e,className:t="",formProps:n,formComponent:r,href:i,title:a,showTitle:s=!0,modalTitle:o,placeholder:l,showDivider:u=!0})=>{const{formatMessage:c}=le.useIntl(),[d,f]=E.useState(!1),m=()=>f(!1),g=!!n||!!r,p=typeof i=="string"||g;let y;return r&&(y=E.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()}}})),h.jsxs("section",{className:te("edit-section",t),children:[g&&h.jsx(vi,{title:o||`Edit ${a}`,isOpen:d,showDivider:!1,showIcon:!1,functions:{onClose:m},className:te("edit-section-modal"),children:y||(n?h.jsx(vr,{...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 T,_;(T=n==null?void 0:n.functions)!=null&&T.onSuccess&&await((_=n==null?void 0:n.functions)==null?void 0:_.onSuccess(v)),f(!1)},onCancel:m}}):h.jsx(h.Fragment,{}))}),h.jsxs("div",{className:te("edit-section-header",{"no-title":!s}),children:[s&&h.jsx("h2",{className:"edit-section-header-title",children:a}),p&&h.jsx(Ie,{href:i,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>v_({href:i,setShowModal:f}),children:c({id:`${Mh}edit`})})]}),e||h.jsx(wF,{...l,href:i,setShowModal:f,showEditButton:p}),u&&h.jsx(pr,{})]})};const SF=({title:e=!1,text:t,logos:n=[],styling:r={},className:i=""})=>{const a=n.length;if(a===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:"",className:typeof e=="object"?e.className:""},{wrapLogos:o=!1,align:l="center",display:u="block"}=r;return h.jsxs("div",{className:te("logos",i,`align-${l}`,{[u]:u!=="block","wrap-logos":o}),children:[e&&E.createElement(s.element,{className:te("title",s.className)},s.text),t&&h.jsx("p",{children:t}),h.jsx("ul",{className:te({"two-col":a===2||a===4,"three-col":a===5||a<=10&&a%3===0}),children:n.map(({logo:c,nameOfBusiness:d,link:f=!1,description:m=!1},g)=>{if(!c||!c.url)return null;const p=h.jsx("img",{src:c.url,width:c.width||"auto",height:c.height||"auto",alt:d});return h.jsxs("li",{children:[h.jsx("p",{className:"img-wrapper",children:f?h.jsx("a",{href:f,target:"_blank",rel:"nofollow noreferrer noopener",children:p}):p}),m&&h.jsx("small",{children:m})]},`${c.url}_${g}`)})})]})};let Nd;const Id="contactFooter_",kF=({onSuccess:e=async()=>{},onFailure:t=()=>{}})=>{const n=E.useRef(null),[r,i]=E.useState(0),[a,s]=E.useState(!1),o=()=>{n.current&&i(n.current.clientHeight)},l=()=>{a||(s(!0),clearTimeout(Nd),Nd=setTimeout(()=>{o(),s(!1)},500))};return E.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(Nd),window.removeEventListener("resize",l)}),[]),h.jsx(Zi,{id:"contactForm",className:"contact-footer",children:h.jsxs("div",{className:"inner-wrapper",children:[h.jsx("h2",{children:h.jsx(le.FormattedMessage,{id:`${Id}title`})}),h.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:a?{}:{minHeight:r},children:[h.jsxs("aside",{children:[h.jsx("p",{children:h.jsx(le.FormattedMessage,{id:`${Id}text`})}),h.jsx(Ki,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:h.jsx(le.FormattedMessage,{id:`${Id}email`})})]}),h.jsx(i_,{functions:{onSuccess:e,onFailure:t},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},DF=({activeLink:e,profile:t,...n})=>h.jsx(Zi,{children:h.jsx(g_,{layout:"1-3",children:h.jsxs(h.Fragment,{children:[h.jsx(p_,{activeLink:e,profile:t}),h.jsx(G4,{...n})]})})});const Pd="cookieBanner_",Rd=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Fd=new Date(Date.now()+12*30*24*60*60*1e3),y_=()=>{const e=le.useIntl(),[t,n,r]=hm.useCookies(Rd),[i,a]=E.useState(!t["apol-cookie-banner"]),s=()=>{Rd.forEach(c=>{n(c,!0,{path:"/",expires:Fd,domain:c==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),a(!1),window.location.reload()},o=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Fd}),Rd.forEach(c=>{if(c==="apol-cookie-banner"){n(c,!0,{path:"/",expires:Fd});return}r(c)}),a(!1)};if(!i)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:o,gtmType:"reject-all"},{id:"accept",onClick:s,gtmType:"accepted-all"}],u=[];return l.forEach(c=>{u.push({variant:c.href?"tertiary":"primary",href:c.href,onClick:c.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${c.gtmType}-click`,children:e.formatMessage({id:`${Pd}buttons_${c.id}`})})}),h.jsxs("section",{id:"cookie-banner","aria-labelledby":"cookie-banner-title","aria-describedby":"cookie-banner-desc","aria-live":"polite","aria-modal":"true",className:"text-medium",children:[h.jsx("h6",{id:"cookie-banner-title","aria-label":"Cookies and your privacy",children:e.formatMessage({id:`${Pd}title`})}),h.jsx("p",{id:"cookie-banner-desc",children:e.formatMessage({id:`${Pd}text`})}),h.jsx(Hs,{buttons:u})]})},si={platform:{order:["events","courses","articles","communities","aiCampus","climateCampus"],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"},aiCampus:{href:"/pages/government-ai-campus",gtmType:"ai-campus-click"},climateCampus:{href:"/pages/government-energy-climate-campus",gtmType:"climate-campus-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:["trust","privacy","terms","cookie","accessibility","ai"],privacy:{href:"/pages/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"/pages/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"},trust:{href:"/pages/trust-at-apolitical",gtmType:"trust-at-apolitical-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:ls["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:ls["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["london","washington","berlin","registered","support","business"],london:{address:!0},washington:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:ls.support,gtmType:"concierge-email-click"},business:{email:ls.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 ps="footer_",Bc="SiteFooter",I9=({group:e})=>{const t=si[e].order||[];let n=!1;return"text"in si[e]&&(n=si[e].text),h.jsxs(E.Fragment,{children:[h.jsx("p",{className:"pre-title",children:h.jsx(le.FormattedMessage,{id:`${ps}${e}`})}),Array.isArray(t)&&t.length>0&&h.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:a}=si[e][r],s={};return["legal"].includes(e)&&(s.target="_blank",s.rel="noopener"),h.jsx("li",{children:h.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":Bc,"data-gtm-event-type":a,...s,children:h.jsx(le.FormattedMessage,{id:`${ps}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&h.jsx("dl",{className:"text-medium",children:n.order.map(r=>h.jsxs(E.Fragment,{children:[h.jsx("dt",{children:h.jsx(le.FormattedMessage,{id:`${ps}${e}_${r}`})}),h.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&h.jsx("address",{children:h.jsx(le.FormattedMessage,{id:`${ps}${e}_${r}_address`,values:{br:h.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&h.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":Bc,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},yp=()=>h.jsx("div",{id:"footer",children:h.jsxs("div",{className:"wrapper",children:[h.jsx(Yc,{element:"hr"}),h.jsx(vp,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":Bc,"data-gtm-event-type":"logo-homepage-link"}),h.jsx("footer",{children:["platform","community","company","contact"].map(e=>h.jsxs("div",{className:"group",children:[h.jsx(I9,{group:e}),Object.keys(si[e]).includes("child")&&h.jsx(I9,{group:si[e].child})]},e))}),h.jsx("hr",{}),h.jsxs("div",{className:"sub-footer",children:[h.jsx("ul",{children:Array.isArray(si.social.order)&&si.social.order.map(e=>{const t=si.social[e];return h.jsx("li",{className:e,children:h.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":Bc,"data-gtm-event-type":"social-click",children:h.jsx("span",{className:"hidden",children:h.jsx(le.FormattedMessage,{id:`${ps}social_${e}`})})})},e)})}),h.jsx("small",{children:h.jsx(le.FormattedMessage,{id:`${ps}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),jr=Object.create(null);jr.open="0";jr.close="1";jr.ping="2";jr.pong="3";jr.message="4";jr.upgrade="5";jr.noop="6";const rc=Object.create(null);Object.keys(jr).forEach(e=>{rc[jr[e]]=e});const Lh={type:"error",data:"parser error"},E_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",b_=typeof ArrayBuffer=="function",T_=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ep=({type:e,data:t},n,r)=>E_&&t instanceof Blob?n?r(t):P9(t,r):b_&&(t instanceof ArrayBuffer||T_(t))?n?r(t):P9(new Blob([t]),r):r(jr[e]+(t||"")),P9=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function R9(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Bd;function OF(e,t){if(E_&&e.data instanceof Blob)return e.data.arrayBuffer().then(R9).then(t);if(b_&&(e.data instanceof ArrayBuffer||T_(e.data)))return t(R9(e.data));Ep(e,!1,n=>{Bd||(Bd=new TextEncoder),t(Bd.encode(n))})}const F9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Io=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<F9.length;e++)Io[F9.charCodeAt(e)]=e;const NF=e=>{let t=e.length*.75,n=e.length,r,i=0,a,s,o,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)a=Io[e.charCodeAt(r)],s=Io[e.charCodeAt(r+1)],o=Io[e.charCodeAt(r+2)],l=Io[e.charCodeAt(r+3)],c[i++]=a<<2|s>>4,c[i++]=(s&15)<<4|o>>2,c[i++]=(o&3)<<6|l&63;return u},IF=typeof ArrayBuffer=="function",bp=(e,t)=>{if(typeof e!="string")return{type:"message",data:__(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:PF(e.substring(1),t)}:rc[n]?e.length>1?{type:rc[n],data:e.substring(1)}:{type:rc[n]}:Lh},PF=(e,t)=>{if(IF){const n=NF(e);return __(n,t)}else return{base64:!0,data:e}},__=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},C_=String.fromCharCode(30),RF=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((a,s)=>{Ep(a,!1,o=>{r[s]=o,++i===n&&t(r.join(C_))})})},FF=(e,t)=>{const n=e.split(C_),r=[];for(let i=0;i<n.length;i++){const a=bp(n[i],t);if(r.push(a),a.type==="error")break}return r};function BF(){return new TransformStream({transform(e,t){OF(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Md;function ou(e){return e.reduce((t,n)=>t+n.length,0)}function lu(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function MF(e,t){Md||(Md=new TextDecoder);const n=[];let r=0,i=-1,a=!1;return new TransformStream({transform(s,o){for(n.push(s);;){if(r===0){if(ou(n)<1)break;const l=lu(n,1);a=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(ou(n)<2)break;const l=lu(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(ou(n)<8)break;const l=lu(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){o.enqueue(Lh);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(ou(n)<i)break;const l=lu(n,i);o.enqueue(bp(a?l:Md.decode(l),t)),r=0}if(i===0||i>e){o.enqueue(Lh);break}}}})}const x_=4;function $t(e){if(e)return LF(e)}function LF(e){for(var t in $t.prototype)e[t]=$t.prototype[t];return e}$t.prototype.on=$t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};$t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};$t.prototype.off=$t.prototype.removeListener=$t.prototype.removeAllListeners=$t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};$t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};$t.prototype.emitReserved=$t.prototype.emit;$t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};$t.prototype.hasListeners=function(e){return!!this.listeners(e).length};const d1=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Vn=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),$F="arraybuffer";function w_(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const jF=Vn.setTimeout,HF=Vn.clearTimeout;function f1(e,t){t.useNativeTimers?(e.setTimeoutFn=jF.bind(Vn),e.clearTimeoutFn=HF.bind(Vn)):(e.setTimeoutFn=Vn.setTimeout.bind(Vn),e.clearTimeoutFn=Vn.clearTimeout.bind(Vn))}const UF=1.33;function zF(e){return typeof e=="string"?qF(e):Math.ceil((e.byteLength||e.size)*UF)}function qF(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function A_(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function WF(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function VF(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class KF extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Tp extends $t{constructor(t){super(),this.writable=!1,f1(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new KF(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=bp(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=WF(t);return n.length?"?"+n:""}}class GF extends Tp{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};FF(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,RF(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=A_()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let S_=!1;try{S_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const YF=S_;function ZF(){}class QF extends GF{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Rr extends $t{constructor(t,n,r){super(),this.createRequest=t,f1(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=w_(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Rr.requestsCount++,Rr.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=ZF,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Rr.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Rr.requestsCount=0;Rr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",B9);else if(typeof addEventListener=="function"){const e="onpagehide"in Vn?"pagehide":"unload";addEventListener(e,B9,!1)}}function B9(){for(let e in Rr.requests)Rr.requests.hasOwnProperty(e)&&Rr.requests[e].abort()}const XF=function(){const e=k_({xdomain:!1});return e&&e.responseType!==null}();class JF extends QF{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=XF&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Rr(k_,this.uri(),t)}}function k_(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||YF))return new XMLHttpRequest}catch{}if(!t)try{return new Vn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const D_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class eB extends Tp{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=D_?{}:w_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;Ep(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}i&&d1(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=A_()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ld=Vn.WebSocket||Vn.MozWebSocket;class tB extends eB{createSocket(t,n,r){return D_?new Ld(t,n,r):n?new Ld(t,n):new Ld(t)}doWrite(t,n){this.ws.send(n)}}class nB extends Tp{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=MF(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=BF();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{r.read().then(({done:o,value:l})=>{o||(this.onPacket(l),a())}).catch(o=>{})};a();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&d1(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const rB={websocket:tB,webtransport:nB,polling:JF},iB=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,aB=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function $h(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=iB.exec(e||""),a={},s=14;for(;s--;)a[aB[s]]=i[s]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=sB(a,a.path),a.queryKey=oB(a,a.query),a}function sB(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function oB(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}const jh=typeof addEventListener=="function"&&typeof removeEventListener=="function",ic=[];jh&&addEventListener("offline",()=>{ic.forEach(e=>e())},!1);class Ui extends $t{constructor(t,n){if(super(),this.binaryType=$F,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=$h(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=$h(n.host).host);f1(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=VF(this.opts.query)),jh&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ic.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=x_,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ui.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ui.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=zF(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,d1(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ui.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),jh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=ic.indexOf(this._offlineEventListener);r!==-1&&ic.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ui.protocol=x_;class lB extends Ui{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ui.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ui.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,c(),n.close(),n=null)}const s=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function o(){s("transport closed")}function l(){s("socket closed")}function u(d){n&&d.name!==n.name&&a()}const c=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",o),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",o),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let uB=class extends lB{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>rB[i]).filter(i=>!!i)),super(t,r)}};function cB(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=$h(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const dB=typeof ArrayBuffer=="function",fB=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,O_=Object.prototype.toString,hB=typeof Blob=="function"||typeof Blob<"u"&&O_.call(Blob)==="[object BlobConstructor]",mB=typeof File=="function"||typeof File<"u"&&O_.call(File)==="[object FileConstructor]";function _p(e){return dB&&(e instanceof ArrayBuffer||fB(e))||hB&&e instanceof Blob||mB&&e instanceof File}function ac(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(ac(e[n]))return!0;return!1}if(_p(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ac(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ac(e[n]))return!0;return!1}function pB(e){const t=[],n=e.data,r=e;return r.data=Hh(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Hh(e,t){if(!e)return e;if(_p(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Hh(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Hh(e[r],t));return n}return e}function gB(e,t){return e.data=Uh(e.data,t),delete e.attachments,e}function Uh(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Uh(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Uh(e[n],t));return e}const vB=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],yB=5;var st;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(st||(st={}));class EB{constructor(t){this.replacer=t}encode(t){return(t.type===st.EVENT||t.type===st.ACK)&&ac(t)?this.encodeAsBinary({type:t.type===st.EVENT?st.BINARY_EVENT:st.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===st.BINARY_EVENT||t.type===st.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=pB(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function M9(e){return Object.prototype.toString.call(e)==="[object Object]"}class Cp extends $t{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===st.BINARY_EVENT;r||n.type===st.BINARY_ACK?(n.type=r?st.EVENT:st.ACK,this.reconstructor=new bB(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(_p(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(st[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===st.BINARY_EVENT||r.type===st.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(a,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Cp.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case st.CONNECT:return M9(n);case st.DISCONNECT:return n===void 0;case st.CONNECT_ERROR:return typeof n=="string"||M9(n);case st.EVENT:case st.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&vB.indexOf(n[0])===-1);case st.ACK:case st.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class bB{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=gB(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const TB=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Cp,Encoder:EB,get PacketType(){return st},protocol:yB},Symbol.toStringTag,{value:"Module"}));function fr(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const _B=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class N_ extends $t{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[fr(t,"open",this.onopen.bind(this)),fr(t,"packet",this.onpacket.bind(this)),fr(t,"error",this.onerror.bind(this)),fr(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,a;if(_B.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:st.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const c=this.ids++,d=n.pop();this._registerAckCallback(c,d),s.id=c}const o=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!o||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},i),s=(...o)=>{this.io.clearTimeoutFn(a),n.apply(this,o)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...n){return new Promise((r,i)=>{const a=(s,o)=>s?i(s):r(o);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:st.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case st.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case st.EVENT:case st.BINARY_EVENT:this.onevent(t);break;case st.ACK:case st.BINARY_ACK:this.onack(t);break;case st.DISCONNECT:this.ondisconnect();break;case st.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:st.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:st.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ws(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ws.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Ws.prototype.reset=function(){this.attempts=0};Ws.prototype.setMin=function(e){this.ms=e};Ws.prototype.setMax=function(e){this.max=e};Ws.prototype.setJitter=function(e){this.jitter=e};class zh extends $t{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,f1(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ws({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||TB;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new uB(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=fr(n,"open",function(){r.onopen(),t&&t()}),a=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),t?t(o):this.maybeReconnectOnOpen()},s=fr(n,"error",a);if(this._timeout!==!1){const o=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},o);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(fr(t,"ping",this.onping.bind(this)),fr(t,"data",this.ondata.bind(this)),fr(t,"error",this.onerror.bind(this)),fr(t,"close",this.onclose.bind(this)),fr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){d1(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new N_(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const lo={};function sc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=cB(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,s=lo[i]&&a in lo[i].nsps,o=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return o?l=new zh(r,t):(lo[i]||(lo[i]=new zh(r,t)),l=lo[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(sc,{Manager:zh,Socket:N_,io:sc,connect:sc});const L9=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const m=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,m))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{n.clear()}},u=t=e(r,i,l);return l},I_=e=>e?L9(e):L9;function CB(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(i){i(n)}),(r=e.get("*"))&&r.slice().map(function(i){i(t,n)})}}}function Nn(){return Nn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nn.apply(this,arguments)}class xB extends Error{constructor(t){super(t),this.name=void 0,this.name="SuprSendError"}}function Ea(){return Math.round(Date.now())}function ia(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)});return t}const ln=I_()(()=>({apiUrl:"https://inboxs.live",collectorApiUrl:"https://hub.suprsend.com",socketUrl:"https://betainbox.suprsend.com",pageSize:20})),wB={unseenCount:0,stores:{},activeStoreId:null,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null},at=I_()(()=>wB);class AB{constructor(t){this.socket=void 0,this.config=void 0,this.config=t;const n=ln.getState();this.socket=sc(n.socketUrl,{transports:["websocket"],auth:{subscriber_id:this.config.subscriberId,distinct_id:this.config.distinctId,authorization:`${this.config.workspaceKey}:${ia()}`,tenant_id:this.config.tenantId},reconnectionAttempts:25,reconnectionDelay:5e3,reconnectionDelayMax:1e4}),this._initializeSocketEvents()}orderNotifications(t,n){if(t.is_pinned)return[t,...n];{let r=!1,i=[];return n.forEach(a=>{a.is_pinned||r?i.push(a):(i.push(t),i.push(a),r=!0)}),r?i:[...n,t]}}_initializeSocketEvents(){var t=this;this.socket.on("new_notification",async function(n){n.n_id&&setTimeout(async function(){try{const i=await(await t.getNotificationDetails(n.n_id)).json(),a=at.getState();if(t.config.stores){let s=!1;for(let o of t.config.stores){const l=a.stores[o.storeId];t._notificationBelongToStore(i.data,o)&&(s=!0,l.notifications=t.orderNotifications(i.data,l.notifications),l.unseenCount+=1)}s&&(a.unseenCount+=1,t.config.emitter.emit("new_notification",i.data)),at.setState({unseenCount:a.unseenCount,stores:Nn({},a.stores)})}else{if(!a.activeStoreId)return;let s=a.stores[a.activeStoreId];a.unseenCount+=1,s.unseenCount+=1,s.notifications=t.orderNotifications(i.data,s.notifications),at.setState({unseenCount:a.unseenCount,stores:Nn({},a.stores)}),t.config.emitter.emit("new_notification",i.data)}t.config.emitter.emit("sync_notif_store")}catch(r){console.log("SuprSend: error in new_notification event",r)}},1e3)}),this.socket.on("notification_updated",async function(n){n.n_id&&setTimeout(async function(){try{const a=await Promise.allSettled([t.getNotificationDetails(n.n_id),t.getNotificationsCount()]),s=at.getState();let o=s.activeStoreId;if(a[0].status==="fulfilled"){var r;const u=await a[0].value.json(),c=u.data;if(!o)return;let d=s.stores[o];const f=(r=t.config.stores)==null?void 0:r.find(m=>m.storeId===o);if((n==null?void 0:n.type)==="archive"){var i;f!=null&&(i=f.query)!=null&&i.archived?t._notificationBelongToStore(c,f)&&(s.stores[o].notifications=[c,...d.notifications]):s.stores[o].notifications=d.notifications.filter(m=>m.n_id!==n.n_id)}else s.stores[o].notifications=d.notifications.map(m=>m.n_id===n.n_id?u.data:m);at.setState({stores:Nn({},s.stores)})}if(a[1].status==="fulfilled"){const u=await a[1].value.json();at.setState(c=>{for(let d in c.stores){const f=c.stores[d];f.unseenCount=u[d]||0}return{unseenCount:u.ss_bell_count,stores:Nn({},c.stores)}})}t.config.emitter.emit("sync_notif_store")}catch(a){console.log("SuprSend: error in notification_updated event",a)}},1e3)}),this.socket.on("update_badge",async function(){at.setState({unseenCount:0}),t.config.emitter.emit("sync_notif_store")}),this.socket.on("mark_all_read",async function(){const n=at.getState(),r=Ea();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(s=>{s.seen_on||(s.seen_on=r)}),a.unseenCount=0}at.setState({stores:n.stores}),t.config.emitter.emit("sync_notif_store")})}_notificationBelongToStore(t,n){var r,i,a,s;const o=!!t.seen_on,l=t.archived,u=t.tags,c=t.n_category,d=n==null||(r=n.query)==null?void 0:r.read,f=n==null||(i=n.query)==null?void 0:i.archived,m=n==null||(a=n.query)==null?void 0:a.tags,g=n==null||(s=n.query)==null?void 0:s.categories,p=!d||o===d,y=!f||l===f;let v,T;return Array.isArray(m)&&m.length>0?m.forEach(_=>{u!=null&&u.includes(_)&&(v=!0)}):v=!0,Array.isArray(g)&&g.length>0?g.includes(c)&&(T=!0):T=!0,p&&v&&T&&y}_getStoreQueryString(t){const n=t==null?void 0:t.query;let r=(n==null?void 0:n.tags)||[],i=(n==null?void 0:n.categories)||[];const a=n==null?void 0:n.read,s=n==null?void 0:n.archived;return{store_id:t.storeId,query:{read:a,archived:s,tags:{or:r},categories:{or:i}}}}_getStoresQueryString(){const t=this.config.stores;return t==null?void 0:t.map(r=>this._getStoreQueryString(r))}getNotificationsCount(){const{apiUrl:t}=ln.getState();let n=`/notification_count/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}`;if(this.config.stores){const r=this._getStoresQueryString();n+=`&stores=${encodeURIComponent(JSON.stringify(r))}`}return fetch(`${t}${n}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${ia()}`}})}getNotifications(t,n,r=20,i){const{apiUrl:a}=ln.getState();let s=`/notifications/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}&page_no=${n}&page_size=${r}&before=${i}`;if(t){const o=this._getStoreQueryString(t);s+=`&store=${encodeURIComponent(JSON.stringify(o))}`}return fetch(`${a}${s}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${ia()}`}})}getNotificationDetails(t){const{apiUrl:n}=ln.getState(),r=`/notification/${t}/?subscriber_id=${this.config.subscriberId}&distinct_id=${this.config.distinctId}&tenant_id=${this.config.tenantId}`;return fetch(`${n}${r}`,{method:"GET",headers:{Authorization:`${this.config.workspaceKey}:${ia()}`}})}markBellClicked(){const{apiUrl:t}=ln.getState(),n="/bell-clicked/",r=JSON.stringify({time:Ea(),distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId,tenant_id:this.config.tenantId});return fetch(`${t}${n}`,{method:"POST",body:r,headers:{Authorization:`${this.config.workspaceKey}:${ia()}`,"Content-Type":"application/json"}})}markAllRead(){const{apiUrl:t}=ln.getState(),n="/mark-all-read/",r=JSON.stringify({time:Ea(),distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId,tenant_id:this.config.tenantId});return fetch(`${t}${n}`,{method:"POST",body:r,headers:{Authorization:`${this.config.workspaceKey}:${ia()}`,"Content-Type":"application/json"}})}markNotificationClicked(t){const{collectorApiUrl:n}=ln.getState(),r={event:"$notification_clicked",env:this.config.workspaceKey,$insert_id:ia(),$time:Ea(),properties:{id:t}};return fetch(`${n}/event/`,{method:"POST",body:JSON.stringify(r),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationRead(t){const{apiUrl:n}=ln.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"read",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationUnRead(t){const{apiUrl:n}=ln.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"unread",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}markNotificationArchive(t){const{apiUrl:n}=ln.getState();return fetch(`${n}/notification/${t}/action`,{method:"POST",body:JSON.stringify({action:"archive",distinct_id:this.config.distinctId,subscriber_id:this.config.subscriberId}),headers:{Authorization:`${this.config.workspaceKey}:`,"Content-Type":"application/json"}})}}let $9=class{constructor(t){this.config=void 0,this.config=t}_overallFirstApiCall(){const t=at.getState();for(let n in t.stores)if(t.stores[n].isFirstCall===!1)return!1;return!0}async fetchNotifications(){var t,n;const r=this.config.client,i=at.getState(),a=ln.getState(),s=i.activeStoreId;if(!s||!((t=i.stores)!=null&&t[s]))return;const o=i.stores[s],l=o.isFirstCall,u=i.initialFetchTime||Date.now(),c=(n=this.config.stores)==null?void 0:n.find(d=>d.storeId===s);try{if(!r||!i.hasNext)return;l?(at.setState({initialLoading:!0}),this._overallFirstApiCall()&&this.getNotificationsCount()):i.pageNumber>1&&at.setState({fetchMoreLoading:!0}),this.config.emitter.emit("sync_notif_store");const f=await(await r.getNotifications(c,i.pageNumber,a.pageSize,u)).json();let m;l||!l&&i.pageNumber===1?m=f.results:m=[...o.notifications,...f.results],i.stores[s].notifications=m,i.stores[s].isFirstCall=!1,at.setState({stores:i.stores,pageNumber:i.pageNumber+1,hasNext:f.meta.current_page<f.meta.total_pages,initialFetchTime:u,initialLoading:!1,fetchMoreLoading:!1}),this.config.emitter.emit("sync_notif_store"),this.config._startExipryCheck()}catch(d){console.log("SUPRSEND: error getting latest notifications",d),at.setState({initialLoading:!1,fetchMoreLoading:!1}),this.config.emitter.emit("sync_notif_store")}}async getNotificationsCount(){const t=this.config.client;if(t)try{const r=await(await t.getNotificationsCount()).json();at.setState(i=>{for(let a in i.stores){const s=i.stores[a];s.unseenCount=r[a]||0}return{unseenCount:r.ss_bell_count,stores:Nn({},i.stores)}}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error getting notifications count",n)}}async markClicked(t){var n;const r=this.config.client,i=at.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&(!l.interacted_on||!l.seen_on)){if(!r)return;try{l.interacted_on?l.seen_on||r.markNotificationRead(t):r.markNotificationClicked(t);const c=Ea();if(l.interacted_on=c,!l.seen_on)for(let d in i==null?void 0:i.stores){var u;const f=i.stores[d];(u=f.notifications)==null||u.forEach(m=>{m.n_id===l.n_id&&(m.seen_on=c,m.interacted_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}at.setState(Nn({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification clicked",c)}}}async markAllSeen(){const t=this.config.client;try{if(!t)return;t.markBellClicked(),at.setState({unseenCount:0}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error marking all notifications seen",n)}}async markAllRead(){const t=this.config.client;try{if(!t)return;t.markAllRead();const n=at.getState(),r=Ea();for(let i in n.stores){const a=n.stores[i];a.notifications.forEach(s=>{s.seen_on||(s.seen_on=r)}),a.unseenCount=0}at.setState({stores:n.stores}),this.config.emitter.emit("sync_notif_store")}catch(n){console.log("SUPRSEND: error marking all notifications read",n)}}async markRead(t){var n;const r=this.config.client,i=at.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&!l.seen_on){if(!r)return;try{r.markNotificationRead(t);const c=Ea();if(!l.seen_on)for(let d in i==null?void 0:i.stores){var u;const f=i.stores[d];(u=f.notifications)==null||u.forEach(m=>{m.n_id===l.n_id&&(m.seen_on=c,f.unseenCount>0&&(f.unseenCount-=1))})}at.setState(Nn({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification read",c)}}}async markUnRead(t){var n;const r=this.config.client,i=at.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const l=i.stores[a].notifications.find(c=>c.n_id===t);if(l&&l.seen_on){if(!r)return;try{if(r.markNotificationUnRead(t),l.seen_on)for(let c in i==null?void 0:i.stores){var u;const d=i.stores[c];(u=d.notifications)==null||u.forEach(f=>{f.n_id===l.n_id&&(f.seen_on=void 0,d.unseenCount>=0&&(d.unseenCount+=1))})}at.setState(Nn({},i)),this.config.emitter.emit("sync_notif_store")}catch(c){console.log("SUPRSEND: error marking notification read",c)}}}markArchived(t){var n;const r=this.config.client,i=at.getState(),a=i.activeStoreId;if(!a||!((n=i.stores)!=null&&n[a]))return;const o=(i==null?void 0:i.stores)[a],l=o.notifications.find(u=>u.n_id===t);if(l&&!l.archived){if(!r)return;try{r.markNotificationArchive(t),o.notifications=o.notifications.filter(u=>u.n_id!==t),!l.seen_on&&o.unseenCount>0&&(o.unseenCount-=1),at.setState(Nn({},i)),this.config.emitter.emit("sync_notif_store")}catch(u){console.log("SUPRSEND: error marking notification archived",u)}}}get stores(){return this.config.stores}get data(){const t=at.getState(),n=t.activeStoreId,r=this.stores;if(n)return{unseenCount:t.unseenCount,activeStoreId:t.activeStoreId,stores:t.stores,hasStores:r?(r==null?void 0:r.length)>0:!1,hasNext:t.hasNext,initialLoading:t.initialLoading,fetchMoreLoading:t.fetchMoreLoading}}};class SB{constructor(t,n){this.workspaceKey="",this.tenantId=void 0,this.stores=void 0,this.distinctId=void 0,this.subscriberId=void 0,this._client=void 0,this._expiryTimerId=void 0,this.feed=new $9(this),this.emitter=CB(),this._validateConfig(t),this._setConfigStoreState((n==null?void 0:n.host)||{}),this.tenantId=(n==null?void 0:n.tenantID)||"default",this._validateStore(n==null?void 0:n.stores),this._validatePageSize(n==null?void 0:n.pageSize),this._initializeStoreState()}_validateConfig(t){if(t)this.workspaceKey=t;else throw new xB("workspaceKey missing")}_validateStore(t){if(!t||!Array.isArray(t))return;const n=[];t.forEach(r=>{if(!r.storeId){console.log("SuprSendInbox: storeId is mandatory if stores are used");return}const i=r==null?void 0:r.query;let a,s=[],o=[],l;typeof(i==null?void 0:i.read)=="boolean"&&(a=i.read),typeof(i==null?void 0:i.archived)=="boolean"&&(l=i.archived),typeof(i==null?void 0:i.tags)=="string"?s=[i.tags]:Array.isArray(i==null?void 0:i.tags)&&(s=i==null?void 0:i.tags.filter(u=>typeof u=="string")),typeof(i==null?void 0:i.categories)=="string"?o=[i.categories]:Array.isArray(i==null?void 0:i.categories)&&(o=i==null?void 0:i.categories.filter(u=>typeof u=="string")),n.push({storeId:r.storeId,label:r.label||r.storeId,query:{archived:l,read:a,tags:s,categories:o}})}),this.stores=n}_validatePageSize(t){if(t&&typeof t=="number"){const r=t<=50?t:50;ln.setState({pageSize:r})}}_setConfigStoreState(t){t&&(t!=null&&t.socketHost&&ln.setState({socketUrl:t.socketHost}),t!=null&&t.apiHost&&ln.setState({apiUrl:t.apiHost}),t!=null&&t.collectorHost&&ln.setState({collectorApiUrl:t.collectorHost}))}_initializeStoreState(){const t="default_store",n={notifications:[],unseenCount:0,isFirstCall:!0};if(this.stores&&Array.isArray(this.stores)&&this.stores.length>0){const r={};this.stores.map(i=>{r[i.storeId]=Nn({},n)}),at.setState({stores:r,activeStoreId:this.stores[0].storeId})}else at.setState({stores:{[t]:Nn({},n)},activeStoreId:t});setTimeout(()=>{this.emitter.emit("sync_notif_store")},0)}_startExipryCheck(){var t=this;this._expiryTimerId||(this._expiryTimerId=setInterval(async function(){const r=at.getState().stores;let i=!1;for(let a in r){let s=r[a].notifications;s=s.filter(o=>(o.expiry?Date.now()>o.expiry:!1)?(i=!0,!1):!0),r[a].notifications=s}i&&(at.setState({stores:r}),await t.feed.getNotificationsCount(),t.emitter.emit("sync_notif_store"))},3e4))}get client(){return this.distinctId&&this.subscriberId&&(this._client||(this._client=new AB(this))),this._client}identifyUser(t,n){this.distinctId=t,this.subscriberId=n}changeActiveStore(t){var n;const r=at.getState(),i={};if(r.activeStoreId!==t&&(n=r.stores)!=null&&n[t]){for(let a in r.stores){const s=r.stores[a],o=s.notifications.slice(0,20);i[a]={notifications:o,unseenCount:s.unseenCount,isFirstCall:s.isFirstCall}}at.setState({activeStoreId:t,stores:i,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this.client&&this.feed.fetchNotifications()}}resetUser(){var t;at.setState({unseenCount:0,pageNumber:1,hasNext:!0,initialLoading:!1,fetchMoreLoading:!1,initialFetchTime:null}),this._initializeStoreState(),(t=this._client)==null||t.socket.disconnect(),this.distinctId=void 0,this.subscriberId=void 0,this._client=void 0,clearInterval(this._expiryTimerId),this._expiryTimerId=void 0,this.feed=new $9(this)}}var j9=function(t){return t.reduce(function(n,r){var i=r[0],a=r[1];return n[i]=a,n},{})},H9=typeof window<"u"&&window.document&&window.document.createElement?Xt.useLayoutEffect:Xt.useEffect,bn="top",er="bottom",tr="right",Tn="left",xp="auto",Al=[bn,er,tr,Tn],Fs="start",pl="end",kB="clippingParents",P_="viewport",uo="popper",DB="reference",U9=Al.reduce(function(e,t){return e.concat([t+"-"+Fs,t+"-"+pl])},[]),R_=[].concat(Al,[xp]).reduce(function(e,t){return e.concat([t,t+"-"+Fs,t+"-"+pl])},[]),OB="beforeRead",NB="read",IB="afterRead",PB="beforeMain",RB="main",FB="afterMain",BB="beforeWrite",MB="write",LB="afterWrite",$B=[OB,NB,IB,PB,RB,FB,BB,MB,LB];function Hr(e){return e?(e.nodeName||"").toLowerCase():null}function Bn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ia(e){var t=Bn(e).Element;return e instanceof t||e instanceof Element}function Qn(e){var t=Bn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function wp(e){if(typeof ShadowRoot>"u")return!1;var t=Bn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function jB(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},a=t.elements[n];!Qn(a)||!Hr(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(s){var o=i[s];o===!1?a.removeAttribute(s):a.setAttribute(s,o===!0?"":o)}))})}function HB(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],a=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),o=s.reduce(function(l,u){return l[u]="",l},{});!Qn(i)||!Hr(i)||(Object.assign(i.style,o),Object.keys(a).forEach(function(l){i.removeAttribute(l)}))})}}const UB={name:"applyStyles",enabled:!0,phase:"write",fn:jB,effect:HB,requires:["computeStyles"]};function Fr(e){return e.split("-")[0]}var xa=Math.max,Mc=Math.min,Bs=Math.round;function qh(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function F_(){return!/^((?!chrome|android).)*safari/i.test(qh())}function Ms(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&Qn(e)&&(i=e.offsetWidth>0&&Bs(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Bs(r.height)/e.offsetHeight||1);var s=Ia(e)?Bn(e):window,o=s.visualViewport,l=!F_()&&n,u=(r.left+(l&&o?o.offsetLeft:0))/i,c=(r.top+(l&&o?o.offsetTop:0))/a,d=r.width/i,f=r.height/a;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function Ap(e){var t=Ms(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function B_(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&wp(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function di(e){return Bn(e).getComputedStyle(e)}function zB(e){return["table","td","th"].indexOf(Hr(e))>=0}function Qi(e){return((Ia(e)?e.ownerDocument:e.document)||window.document).documentElement}function h1(e){return Hr(e)==="html"?e:e.assignedSlot||e.parentNode||(wp(e)?e.host:null)||Qi(e)}function z9(e){return!Qn(e)||di(e).position==="fixed"?null:e.offsetParent}function qB(e){var t=/firefox/i.test(qh()),n=/Trident/i.test(qh());if(n&&Qn(e)){var r=di(e);if(r.position==="fixed")return null}var i=h1(e);for(wp(i)&&(i=i.host);Qn(i)&&["html","body"].indexOf(Hr(i))<0;){var a=di(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function Sl(e){for(var t=Bn(e),n=z9(e);n&&zB(n)&&di(n).position==="static";)n=z9(n);return n&&(Hr(n)==="html"||Hr(n)==="body"&&di(n).position==="static")?t:n||qB(e)||t}function Sp(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Wo(e,t,n){return xa(e,Mc(t,n))}function WB(e,t,n){var r=Wo(e,t,n);return r>n?n:r}function M_(){return{top:0,right:0,bottom:0,left:0}}function L_(e){return Object.assign({},M_(),e)}function $_(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var VB=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,L_(typeof t!="number"?t:$_(t,Al))};function KB(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,s=n.modifiersData.popperOffsets,o=Fr(n.placement),l=Sp(o),u=[Tn,tr].indexOf(o)>=0,c=u?"height":"width";if(!(!a||!s)){var d=VB(i.padding,n),f=Ap(a),m=l==="y"?bn:Tn,g=l==="y"?er:tr,p=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],y=s[l]-n.rects.reference[l],v=Sl(a),T=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,_=p/2-y/2,C=d[m],w=T-f[c]-d[g],x=T/2-f[c]/2+_,S=Wo(C,x,w),N=l;n.modifiersData[r]=(t={},t[N]=S,t.centerOffset=S-x,t)}}function GB(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||B_(t.elements.popper,i)&&(t.elements.arrow=i))}const YB={name:"arrow",enabled:!0,phase:"main",fn:KB,effect:GB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ls(e){return e.split("-")[1]}var ZB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function QB(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Bs(n*i)/i||0,y:Bs(r*i)/i||0}}function q9(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,s=e.offsets,o=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=s.x,m=f===void 0?0:f,g=s.y,p=g===void 0?0:g,y=typeof c=="function"?c({x:m,y:p}):{x:m,y:p};m=y.x,p=y.y;var v=s.hasOwnProperty("x"),T=s.hasOwnProperty("y"),_=Tn,C=bn,w=window;if(u){var x=Sl(n),S="clientHeight",N="clientWidth";if(x===Bn(n)&&(x=Qi(n),di(x).position!=="static"&&o==="absolute"&&(S="scrollHeight",N="scrollWidth")),x=x,i===bn||(i===Tn||i===tr)&&a===pl){C=er;var B=d&&x===w&&w.visualViewport?w.visualViewport.height:x[S];p-=B-r.height,p*=l?1:-1}if(i===Tn||(i===bn||i===er)&&a===pl){_=tr;var $=d&&x===w&&w.visualViewport?w.visualViewport.width:x[N];m-=$-r.width,m*=l?1:-1}}var F=Object.assign({position:o},u&&ZB),L=c===!0?QB({x:m,y:p},Bn(n)):{x:m,y:p};if(m=L.x,p=L.y,l){var O;return Object.assign({},F,(O={},O[C]=T?"0":"",O[_]=v?"0":"",O.transform=(w.devicePixelRatio||1)<=1?"translate("+m+"px, "+p+"px)":"translate3d("+m+"px, "+p+"px, 0)",O))}return Object.assign({},F,(t={},t[C]=T?p+"px":"",t[_]=v?m+"px":"",t.transform="",t))}function XB(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,s=a===void 0?!0:a,o=n.roundOffsets,l=o===void 0?!0:o,u={placement:Fr(t.placement),variation:Ls(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,q9(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,q9(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const JB={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:XB,data:{}};var uu={passive:!0};function eM(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,s=r.resize,o=s===void 0?!0:s,l=Bn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach(function(c){c.addEventListener("scroll",n.update,uu)}),o&&l.addEventListener("resize",n.update,uu),function(){a&&u.forEach(function(c){c.removeEventListener("scroll",n.update,uu)}),o&&l.removeEventListener("resize",n.update,uu)}}const tM={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:eM,data:{}};var nM={left:"right",right:"left",bottom:"top",top:"bottom"};function oc(e){return e.replace(/left|right|bottom|top/g,function(t){return nM[t]})}var rM={start:"end",end:"start"};function W9(e){return e.replace(/start|end/g,function(t){return rM[t]})}function kp(e){var t=Bn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Dp(e){return Ms(Qi(e)).left+kp(e).scrollLeft}function iM(e,t){var n=Bn(e),r=Qi(e),i=n.visualViewport,a=r.clientWidth,s=r.clientHeight,o=0,l=0;if(i){a=i.width,s=i.height;var u=F_();(u||!u&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:a,height:s,x:o+Dp(e),y:l}}function aM(e){var t,n=Qi(e),r=kp(e),i=(t=e.ownerDocument)==null?void 0:t.body,a=xa(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=xa(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),o=-r.scrollLeft+Dp(e),l=-r.scrollTop;return di(i||n).direction==="rtl"&&(o+=xa(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:s,x:o,y:l}}function Op(e){var t=di(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function j_(e){return["html","body","#document"].indexOf(Hr(e))>=0?e.ownerDocument.body:Qn(e)&&Op(e)?e:j_(h1(e))}function Vo(e,t){var n;t===void 0&&(t=[]);var r=j_(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=Bn(r),s=i?[a].concat(a.visualViewport||[],Op(r)?r:[]):r,o=t.concat(s);return i?o:o.concat(Vo(h1(s)))}function Wh(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function sM(e,t){var n=Ms(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function V9(e,t,n){return t===P_?Wh(iM(e,n)):Ia(t)?sM(t,n):Wh(aM(Qi(e)))}function oM(e){var t=Vo(h1(e)),n=["absolute","fixed"].indexOf(di(e).position)>=0,r=n&&Qn(e)?Sl(e):e;return Ia(r)?t.filter(function(i){return Ia(i)&&B_(i,r)&&Hr(i)!=="body"}):[]}function lM(e,t,n,r){var i=t==="clippingParents"?oM(e):[].concat(t),a=[].concat(i,[n]),s=a[0],o=a.reduce(function(l,u){var c=V9(e,u,r);return l.top=xa(c.top,l.top),l.right=Mc(c.right,l.right),l.bottom=Mc(c.bottom,l.bottom),l.left=xa(c.left,l.left),l},V9(e,s,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function H_(e){var t=e.reference,n=e.element,r=e.placement,i=r?Fr(r):null,a=r?Ls(r):null,s=t.x+t.width/2-n.width/2,o=t.y+t.height/2-n.height/2,l;switch(i){case bn:l={x:s,y:t.y-n.height};break;case er:l={x:s,y:t.y+t.height};break;case tr:l={x:t.x+t.width,y:o};break;case Tn:l={x:t.x-n.width,y:o};break;default:l={x:t.x,y:t.y}}var u=i?Sp(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(a){case Fs:l[u]=l[u]-(t[c]/2-n[c]/2);break;case pl:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function gl(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,s=a===void 0?e.strategy:a,o=n.boundary,l=o===void 0?kB:o,u=n.rootBoundary,c=u===void 0?P_:u,d=n.elementContext,f=d===void 0?uo:d,m=n.altBoundary,g=m===void 0?!1:m,p=n.padding,y=p===void 0?0:p,v=L_(typeof y!="number"?y:$_(y,Al)),T=f===uo?DB:uo,_=e.rects.popper,C=e.elements[g?T:f],w=lM(Ia(C)?C:C.contextElement||Qi(e.elements.popper),l,c,s),x=Ms(e.elements.reference),S=H_({reference:x,element:_,strategy:"absolute",placement:i}),N=Wh(Object.assign({},_,S)),B=f===uo?N:x,$={top:w.top-B.top+v.top,bottom:B.bottom-w.bottom+v.bottom,left:w.left-B.left+v.left,right:B.right-w.right+v.right},F=e.modifiersData.offset;if(f===uo&&F){var L=F[i];Object.keys($).forEach(function(O){var P=[tr,er].indexOf(O)>=0?1:-1,M=[bn,er].indexOf(O)>=0?"y":"x";$[O]+=L[M]*P})}return $}function uM(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,s=n.padding,o=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?R_:l,c=Ls(r),d=c?o?U9:U9.filter(function(g){return Ls(g)===c}):Al,f=d.filter(function(g){return u.indexOf(g)>=0});f.length===0&&(f=d);var m=f.reduce(function(g,p){return g[p]=gl(e,{placement:p,boundary:i,rootBoundary:a,padding:s})[Fr(p)],g},{});return Object.keys(m).sort(function(g,p){return m[g]-m[p]})}function cM(e){if(Fr(e)===xp)return[];var t=oc(e);return[W9(e),t,W9(t)]}function dM(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,s=n.altAxis,o=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,m=n.flipVariations,g=m===void 0?!0:m,p=n.allowedAutoPlacements,y=t.options.placement,v=Fr(y),T=v===y,_=l||(T||!g?[oc(y)]:cM(y)),C=[y].concat(_).reduce(function(j,H){return j.concat(Fr(H)===xp?uM(t,{placement:H,boundary:c,rootBoundary:d,padding:u,flipVariations:g,allowedAutoPlacements:p}):H)},[]),w=t.rects.reference,x=t.rects.popper,S=new Map,N=!0,B=C[0],$=0;$<C.length;$++){var F=C[$],L=Fr(F),O=Ls(F)===Fs,P=[bn,er].indexOf(L)>=0,M=P?"width":"height",U=gl(t,{placement:F,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),D=P?O?tr:Tn:O?er:bn;w[M]>x[M]&&(D=oc(D));var X=oc(D),Z=[];if(a&&Z.push(U[L]<=0),o&&Z.push(U[D]<=0,U[X]<=0),Z.every(function(j){return j})){B=F,N=!1;break}S.set(F,Z)}if(N)for(var k=g?3:1,b=function(H){var z=C.find(function(Y){var re=S.get(Y);if(re)return re.slice(0,H).every(function(Q){return Q})});if(z)return B=z,"break"},q=k;q>0;q--){var R=b(q);if(R==="break")break}t.placement!==B&&(t.modifiersData[r]._skip=!0,t.placement=B,t.reset=!0)}}const fM={name:"flip",enabled:!0,phase:"main",fn:dM,requiresIfExists:["offset"],data:{_skip:!1}};function K9(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function G9(e){return[bn,tr,er,Tn].some(function(t){return e[t]>=0})}function hM(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,s=gl(t,{elementContext:"reference"}),o=gl(t,{altBoundary:!0}),l=K9(s,r),u=K9(o,i,a),c=G9(l),d=G9(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const mM={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hM};function pM(e,t,n){var r=Fr(e),i=[Tn,bn].indexOf(r)>=0?-1:1,a=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=a[0],o=a[1];return s=s||0,o=(o||0)*i,[Tn,tr].indexOf(r)>=0?{x:o,y:s}:{x:s,y:o}}function gM(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,s=R_.reduce(function(c,d){return c[d]=pM(d,t.rects,a),c},{}),o=s[t.placement],l=o.x,u=o.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}const vM={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:gM};function yM(e){var t=e.state,n=e.name;t.modifiersData[n]=H_({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const EM={name:"popperOffsets",enabled:!0,phase:"read",fn:yM,data:{}};function bM(e){return e==="x"?"y":"x"}function TM(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,s=n.altAxis,o=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,m=f===void 0?!0:f,g=n.tetherOffset,p=g===void 0?0:g,y=gl(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),v=Fr(t.placement),T=Ls(t.placement),_=!T,C=Sp(v),w=bM(C),x=t.modifiersData.popperOffsets,S=t.rects.reference,N=t.rects.popper,B=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,$=typeof B=="number"?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),F=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(x){if(a){var O,P=C==="y"?bn:Tn,M=C==="y"?er:tr,U=C==="y"?"height":"width",D=x[C],X=D+y[P],Z=D-y[M],k=m?-N[U]/2:0,b=T===Fs?S[U]:N[U],q=T===Fs?-N[U]:-S[U],R=t.elements.arrow,j=m&&R?Ap(R):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:M_(),z=H[P],Y=H[M],re=Wo(0,S[U],j[U]),Q=_?S[U]/2-k-re-z-$.mainAxis:b-re-z-$.mainAxis,G=_?-S[U]/2+k+re+Y+$.mainAxis:q+re+Y+$.mainAxis,se=t.elements.arrow&&Sl(t.elements.arrow),ae=se?C==="y"?se.clientTop||0:se.clientLeft||0:0,be=(O=F==null?void 0:F[C])!=null?O:0,Ce=D+Q-be-ae,Pe=D+G-be,je=Wo(m?Mc(X,Ce):X,D,m?xa(Z,Pe):Z);x[C]=je,L[C]=je-D}if(o){var Fe,Be=C==="x"?bn:Tn,Qe=C==="x"?er:tr,tt=x[w],Xe=w==="y"?"height":"width",me=tt+y[Be],de=tt-y[Qe],Te=[bn,Tn].indexOf(v)!==-1,ee=(Fe=F==null?void 0:F[w])!=null?Fe:0,fe=Te?me:tt-S[Xe]-N[Xe]-ee+$.altAxis,Ae=Te?tt+S[Xe]+N[Xe]-ee-$.altAxis:de,Se=m&&Te?WB(fe,tt,Ae):Wo(m?fe:me,tt,m?Ae:de);x[w]=Se,L[w]=Se-tt}t.modifiersData[r]=L}}const _M={name:"preventOverflow",enabled:!0,phase:"main",fn:TM,requiresIfExists:["offset"]};function CM(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function xM(e){return e===Bn(e)||!Qn(e)?kp(e):CM(e)}function wM(e){var t=e.getBoundingClientRect(),n=Bs(t.width)/e.offsetWidth||1,r=Bs(t.height)/e.offsetHeight||1;return n!==1||r!==1}function AM(e,t,n){n===void 0&&(n=!1);var r=Qn(t),i=Qn(t)&&wM(t),a=Qi(t),s=Ms(e,i,n),o={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Hr(t)!=="body"||Op(a))&&(o=xM(t)),Qn(t)?(l=Ms(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):a&&(l.x=Dp(a))),{x:s.left+o.scrollLeft-l.x,y:s.top+o.scrollTop-l.y,width:s.width,height:s.height}}function SM(e){var t=new Map,n=new Set,r=[];e.forEach(function(a){t.set(a.name,a)});function i(a){n.add(a.name);var s=[].concat(a.requires||[],a.requiresIfExists||[]);s.forEach(function(o){if(!n.has(o)){var l=t.get(o);l&&i(l)}}),r.push(a)}return e.forEach(function(a){n.has(a.name)||i(a)}),r}function kM(e){var t=SM(e);return $B.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function DM(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function OM(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Y9={placement:"bottom",modifiers:[],strategy:"absolute"};function Z9(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function NM(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?Y9:i;return function(o,l,u){u===void 0&&(u=a);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Y9,a),modifiersData:{},elements:{reference:o,popper:l},attributes:{},styles:{}},d=[],f=!1,m={state:c,setOptions:function(v){var T=typeof v=="function"?v(c.options):v;p(),c.options=Object.assign({},a,c.options,T),c.scrollParents={reference:Ia(o)?Vo(o):o.contextElement?Vo(o.contextElement):[],popper:Vo(l)};var _=kM(OM([].concat(r,c.options.modifiers)));return c.orderedModifiers=_.filter(function(C){return C.enabled}),g(),m.update()},forceUpdate:function(){if(!f){var v=c.elements,T=v.reference,_=v.popper;if(Z9(T,_)){c.rects={reference:AM(T,Sl(_),c.options.strategy==="fixed"),popper:Ap(_)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function($){return c.modifiersData[$.name]=Object.assign({},$.data)});for(var C=0;C<c.orderedModifiers.length;C++){if(c.reset===!0){c.reset=!1,C=-1;continue}var w=c.orderedModifiers[C],x=w.fn,S=w.options,N=S===void 0?{}:S,B=w.name;typeof x=="function"&&(c=x({state:c,options:N,name:B,instance:m})||c)}}}},update:DM(function(){return new Promise(function(y){m.forceUpdate(),y(c)})}),destroy:function(){p(),f=!0}};if(!Z9(o,l))return m;m.setOptions(u).then(function(y){!f&&u.onFirstUpdate&&u.onFirstUpdate(y)});function g(){c.orderedModifiers.forEach(function(y){var v=y.name,T=y.options,_=T===void 0?{}:T,C=y.effect;if(typeof C=="function"){var w=C({state:c,name:v,instance:m,options:_}),x=function(){};d.push(w||x)}})}function p(){d.forEach(function(y){return y()}),d=[]}return m}}var IM=[tM,EM,JB,UB,vM,fM,_M,YB,mM],PM=NM({defaultModifiers:IM}),RM=typeof Element<"u",FM=typeof Map=="function",BM=typeof Set=="function",MM=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function lc(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!lc(e[r],t[r]))return!1;return!0}var a;if(FM&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;for(a=e.entries();!(r=a.next()).done;)if(!lc(r.value[1],t.get(r.value[0])))return!1;return!0}if(BM&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(MM&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(RM&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!lc(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var LM=function(t,n){try{return lc(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const $M=gr(LM);var jM=[],HM=function(t,n,r){r===void 0&&(r={});var i=Xt.useRef(null),a={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||jM},s=Xt.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),o=s[0],l=s[1],u=Xt.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(m){var g=m.state,p=Object.keys(g.elements);vx.flushSync(function(){l({styles:j9(p.map(function(y){return[y,g.styles[y]||{}]})),attributes:j9(p.map(function(y){return[y,g.attributes[y]]}))})})},requires:["computeStyles"]}},[]),c=Xt.useMemo(function(){var f={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return $M(i.current,f)?i.current||f:(i.current=f,f)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=Xt.useRef();return H9(function(){d.current&&d.current.setOptions(c)},[c]),H9(function(){if(!(t==null||n==null)){var f=r.createPopper||PM,m=f(t,n,c);return d.current=m,function(){m.destroy(),d.current=null}}},[t,n,r.createPopper]),{state:d.current?d.current.state:null,styles:o.styles,attributes:o.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};function Vh(){return Vh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vh.apply(this,arguments)}function U_(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var UM=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,zM=U_(function(e){return UM.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),qM=!1;function WM(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function VM(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var KM=function(){function e(n){var r=this;this._insertTag=function(i){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,a),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!qM:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(VM(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=WM(i);try{a.insertRule(r,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e}(),en="-ms-",Lc="-moz-",ut="-webkit-",z_="comm",Np="rule",Ip="decl",GM="@import",q_="@keyframes",YM="@layer",ZM=Math.abs,m1=String.fromCharCode,QM=Object.assign;function XM(e,t){return Qt(e,0)^45?(((t<<2^Qt(e,0))<<2^Qt(e,1))<<2^Qt(e,2))<<2^Qt(e,3):0}function W_(e){return e.trim()}function JM(e,t){return(e=t.exec(e))?e[0]:e}function ct(e,t,n){return e.replace(t,n)}function Kh(e,t){return e.indexOf(t)}function Qt(e,t){return e.charCodeAt(t)|0}function vl(e,t,n){return e.slice(t,n)}function Sr(e){return e.length}function Pp(e){return e.length}function cu(e,t){return t.push(e),e}function eL(e,t){return e.map(t).join("")}var p1=1,$s=1,V_=0,Cn=0,Lt=0,Vs="";function g1(e,t,n,r,i,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:p1,column:$s,length:s,return:""}}function co(e,t){return QM(g1("",null,null,"",null,null,0),e,{length:-e.length},t)}function tL(){return Lt}function nL(){return Lt=Cn>0?Qt(Vs,--Cn):0,$s--,Lt===10&&($s=1,p1--),Lt}function Pn(){return Lt=Cn<V_?Qt(Vs,Cn++):0,$s++,Lt===10&&($s=1,p1++),Lt}function Br(){return Qt(Vs,Cn)}function uc(){return Cn}function kl(e,t){return vl(Vs,e,t)}function yl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function K_(e){return p1=$s=1,V_=Sr(Vs=e),Cn=0,[]}function G_(e){return Vs="",e}function cc(e){return W_(kl(Cn-1,Gh(e===91?e+2:e===40?e+1:e)))}function rL(e){for(;(Lt=Br())&&Lt<33;)Pn();return yl(e)>2||yl(Lt)>3?"":" "}function iL(e,t){for(;--t&&Pn()&&!(Lt<48||Lt>102||Lt>57&&Lt<65||Lt>70&&Lt<97););return kl(e,uc()+(t<6&&Br()==32&&Pn()==32))}function Gh(e){for(;Pn();)switch(Lt){case e:return Cn;case 34:case 39:e!==34&&e!==39&&Gh(Lt);break;case 40:e===41&&Gh(e);break;case 92:Pn();break}return Cn}function aL(e,t){for(;Pn()&&e+Lt!==47+10;)if(e+Lt===42+42&&Br()===47)break;return"/*"+kl(t,Cn-1)+"*"+m1(e===47?e:Pn())}function sL(e){for(;!yl(Br());)Pn();return kl(e,Cn)}function oL(e){return G_(dc("",null,null,null,[""],e=K_(e),0,[0],e))}function dc(e,t,n,r,i,a,s,o,l){for(var u=0,c=0,d=s,f=0,m=0,g=0,p=1,y=1,v=1,T=0,_="",C=i,w=a,x=r,S=_;y;)switch(g=T,T=Pn()){case 40:if(g!=108&&Qt(S,d-1)==58){Kh(S+=ct(cc(T),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:S+=cc(T);break;case 9:case 10:case 13:case 32:S+=rL(g);break;case 92:S+=iL(uc()-1,7);continue;case 47:switch(Br()){case 42:case 47:cu(lL(aL(Pn(),uc()),t,n),l);break;default:S+="/"}break;case 123*p:o[u++]=Sr(S)*v;case 125*p:case 59:case 0:switch(T){case 0:case 125:y=0;case 59+c:v==-1&&(S=ct(S,/\f/g,"")),m>0&&Sr(S)-d&&cu(m>32?X9(S+";",r,n,d-1):X9(ct(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(cu(x=Q9(S,t,n,u,c,i,o,_,C=[],w=[],d),a),T===123)if(c===0)dc(S,t,x,x,C,a,d,o,w);else switch(f===99&&Qt(S,3)===110?100:f){case 100:case 108:case 109:case 115:dc(e,x,x,r&&cu(Q9(e,x,x,0,0,i,o,_,i,C=[],d),w),i,w,d,o,r?C:w);break;default:dc(S,x,x,x,[""],w,0,o,w)}}u=c=m=0,p=v=1,_=S="",d=s;break;case 58:d=1+Sr(S),m=g;default:if(p<1){if(T==123)--p;else if(T==125&&p++==0&&nL()==125)continue}switch(S+=m1(T),T*p){case 38:v=c>0?1:(S+="\f",-1);break;case 44:o[u++]=(Sr(S)-1)*v,v=1;break;case 64:Br()===45&&(S+=cc(Pn())),f=Br(),c=d=Sr(_=S+=sL(uc())),T++;break;case 45:g===45&&Sr(S)==2&&(p=0)}}return a}function Q9(e,t,n,r,i,a,s,o,l,u,c){for(var d=i-1,f=i===0?a:[""],m=Pp(f),g=0,p=0,y=0;g<r;++g)for(var v=0,T=vl(e,d+1,d=ZM(p=s[g])),_=e;v<m;++v)(_=W_(p>0?f[v]+" "+T:ct(T,/&\f/g,f[v])))&&(l[y++]=_);return g1(e,t,n,i===0?Np:o,l,u,c)}function lL(e,t,n){return g1(e,t,n,z_,m1(tL()),vl(e,2,-2),0)}function X9(e,t,n,r){return g1(e,t,n,Ip,vl(e,0,r),vl(e,r+1,-1),r)}function Ts(e,t){for(var n="",r=Pp(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function uL(e,t,n,r){switch(e.type){case YM:if(e.children.length)break;case GM:case Ip:return e.return=e.return||e.value;case z_:return"";case q_:return e.return=e.value+"{"+Ts(e.children,r)+"}";case Np:e.value=e.props.join(",")}return Sr(n=Ts(e.children,r))?e.return=e.value+"{"+n+"}":""}function cL(e){var t=Pp(e);return function(n,r,i,a){for(var s="",o=0;o<t;o++)s+=e[o](n,r,i,a)||"";return s}}function dL(e){return function(t){t.root||(t=t.return)&&e(t)}}var fL=function(t,n,r){for(var i=0,a=0;i=a,a=Br(),i===38&&a===12&&(n[r]=1),!yl(a);)Pn();return kl(t,Cn)},hL=function(t,n){var r=-1,i=44;do switch(yl(i)){case 0:i===38&&Br()===12&&(n[r]=1),t[r]+=fL(Cn-1,n,r);break;case 2:t[r]+=cc(i);break;case 4:if(i===44){t[++r]=Br()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=m1(i)}while(i=Pn());return t},mL=function(t,n){return G_(hL(K_(t),n))},J9=new WeakMap,pL=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!J9.get(r))&&!i){J9.set(t,!0);for(var a=[],s=mL(n,a),o=r.props,l=0,u=0;l<s.length;l++)for(var c=0;c<o.length;c++,u++)t.props[u]=a[l]?s[l].replace(/&\f/g,o[c]):o[c]+" "+s[l]}}},gL=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function Y_(e,t){switch(XM(e,t)){case 5103:return ut+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ut+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ut+e+Lc+e+en+e+e;case 6828:case 4268:return ut+e+en+e+e;case 6165:return ut+e+en+"flex-"+e+e;case 5187:return ut+e+ct(e,/(\w+).+(:[^]+)/,ut+"box-$1$2"+en+"flex-$1$2")+e;case 5443:return ut+e+en+"flex-item-"+ct(e,/flex-|-self/,"")+e;case 4675:return ut+e+en+"flex-line-pack"+ct(e,/align-content|flex-|-self/,"")+e;case 5548:return ut+e+en+ct(e,"shrink","negative")+e;case 5292:return ut+e+en+ct(e,"basis","preferred-size")+e;case 6060:return ut+"box-"+ct(e,"-grow","")+ut+e+en+ct(e,"grow","positive")+e;case 4554:return ut+ct(e,/([^-])(transform)/g,"$1"+ut+"$2")+e;case 6187:return ct(ct(ct(e,/(zoom-|grab)/,ut+"$1"),/(image-set)/,ut+"$1"),e,"")+e;case 5495:case 3959:return ct(e,/(image-set\([^]*)/,ut+"$1$`$1");case 4968:return ct(ct(e,/(.+:)(flex-)?(.*)/,ut+"box-pack:$3"+en+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ut+e+e;case 4095:case 3583:case 4068:case 2532:return ct(e,/(.+)-inline(.+)/,ut+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Sr(e)-1-t>6)switch(Qt(e,t+1)){case 109:if(Qt(e,t+4)!==45)break;case 102:return ct(e,/(.+:)(.+)-([^]+)/,"$1"+ut+"$2-$3$1"+Lc+(Qt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Kh(e,"stretch")?Y_(ct(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Qt(e,t+1)!==115)break;case 6444:switch(Qt(e,Sr(e)-3-(~Kh(e,"!important")&&10))){case 107:return ct(e,":",":"+ut)+e;case 101:return ct(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ut+(Qt(e,14)===45?"inline-":"")+"box$3$1"+ut+"$2$3$1"+en+"$2box$3")+e}break;case 5936:switch(Qt(e,t+11)){case 114:return ut+e+en+ct(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ut+e+en+ct(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ut+e+en+ct(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ut+e+en+e+e}return e}var vL=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Ip:t.return=Y_(t.value,t.length);break;case q_:return Ts([co(t,{value:ct(t.value,"@","@"+ut)})],i);case Np:if(t.length)return eL(t.props,function(a){switch(JM(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ts([co(t,{props:[ct(a,/:(read-\w+)/,":"+Lc+"$1")]})],i);case"::placeholder":return Ts([co(t,{props:[ct(a,/:(plac\w+)/,":"+ut+"input-$1")]}),co(t,{props:[ct(a,/:(plac\w+)/,":"+Lc+"$1")]}),co(t,{props:[ct(a,/:(plac\w+)/,en+"input-$1")]})],i)}return""})}},yL=[vL],EL=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var y=p.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=t.stylisPlugins||yL,a={},s,o=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var y=p.getAttribute("data-emotion").split(" "),v=1;v<y.length;v++)a[y[v]]=!0;o.push(p)});var l,u=[pL,gL];{var c,d=[uL,dL(function(p){c.insert(p)})],f=cL(u.concat(i,d)),m=function(y){return Ts(oL(y),f)};l=function(y,v,T,_){c=T,m(y?y+"{"+v.styles+"}":v.styles),_&&(g.inserted[v.name]=!0)}}var g={key:n,sheet:new KM({key:n,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:l};return g.sheet.hydrate(o),g},Yh={exports:{}},ht={};/** @license React v16.13.1
143
143
  * react-is.production.min.js
144
144
  *
145
145
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -565,6 +565,6 @@ and limitations under the License.
565
565
  .Toastify__toast-body {
566
566
  padding: 0px;
567
567
  }
568
- `]))),Xre={storeData:{},unseenCount:0,hasNext:!1,initialLoading:!1,fetchMoreLoading:!1};E.createContext({notificationsData:Xre});function Jre(e){var t=e.workspaceKey,n=t===void 0?"":t,r=e.tenantId,i=r===void 0?"":r,a=e.distinctId,s=a===void 0?"":a,o=e.subscriberId,l=o===void 0?"":o,u=e.inboxId,c=u===void 0?"":u,d=e.stores,f=e.toastProps,m=e.notificationClickHandler,g=e.primaryActionClickHandler,p=e.secondaryActionClickHandler,y=e.bellComponent,v=e.badgeComponent,T=e.notificationComponent,_=e.noNotificationsComponent,C=e.loaderComponent,w=e.tabBadgeComponent,x=e.headerRightComponent,S=e.hideAvatar,N=S===void 0?!1:S,B=e.hideInbox,$=e.hideToast,F=e.theme,L=e.themeType,O=L===void 0?"light":L,P=e.pagination,M=P===void 0?!0:P,U=e.pageSize,D=e.popperPosition,X=D===void 0?"bottom":D,Z=e.showUnreadCountOnTabs,k=Z===void 0?!0:Z,b=e.host,q=e.language,R=e.disableMarkdown,j=e.translations;c&&(l=c);var H=E.useState(!1),z=H[0],Y=H[1],re=E.useState(),Q=re[0],G=re[1],se=E.useState({storeData:{},count:0}),ae=se[0],be=se[1],Ce=E.useState(""),Pe=Ce[0],je=Ce[1],Fe=E.useState(!1),Be=Fe[0],Qe=Fe[1];E.useEffect(function(){var Xe=new SB(n,{pageSize:U,tenantID:i,stores:d,host:b});return G(Xe),Xe.emitter.on("sync_notif_store",function(){var me=Xe.feed.data;be({storeData:(me==null?void 0:me.stores)||{},count:(me==null?void 0:me.unseenCount)||0,hasNext:me==null?void 0:me.hasNext,initialLoading:me==null?void 0:me.initialLoading,activeStoreId:me==null?void 0:me.activeStoreId}),je(me==null?void 0:me.activeStoreId)}),Xe.emitter.on("new_notification",function(me){Zre({notificationsData:me,toastProps:f})}),function(){Xe.emitter.all.clear()}},[]),E.useEffect(function(){z&&l&&Q&&Q.feed.markAllSeen()},[z,l,Q]),E.useEffect(function(){if(!(!l||!Q))return be({storeData:{},count:0}),Q.identifyUser(s,l),Q.feed.fetchNotifications(),function(){Q.resetUser()}},[l,Q]);var tt=O==="dark"?V3(Dne,F):F||{};return E.createElement(q3.Provider,{value:tt},E.createElement(D0.Provider,{value:{workspaceKey:n,notificationsData:ae,setNotificationsData:be,notificationClickHandler:m,primaryActionClickHandler:g,secondaryActionClickHandler:p,bellComponent:y,badgeComponent:v,notificationComponent:T,noNotificationsComponent:_,tabBadgeComponent:w,headerRightComponent:x,toggleInbox:Y,inbox:Q,loaderComponent:C,pagination:M,hideAvatar:N,activeStore:Pe,setActiveStore:je,changingActiveStore:Be,setChangingActiveStore:Qe,showUnreadCountOnTabs:k,themeType:O,language:q,disableMarkdown:R,translations:j}},!B&&E.createElement(jre,{openInbox:z,toggleInbox:Y,popperPosition:X}),!$&&E.createElement(Yre,f)))}const pt={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=a=>{const s=`logged${e?"In":"Out"}`;return t>=n[a][s]};let i={};return["navigation","search"].forEach(a=>{i[a]=r(a)}),i},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(i=>i===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:i=!1})=>{if(!i&&n[e]===t||!i&&e===On.ACCOUNT&&t===!1&&n[On.SITE]===!0)return;const a=Date.now();if(!i&&!t&&pt.handlerCalled[e]&&a-pt.handlerCalled[e]<500)return;pt.handlerCalled[e]=a;let s=[{type:`menus.${e}`,value:t}];if(t===!0)Object.keys(n).forEach(o=>{o===e||n[o]===!1||s.push({type:`menus.${o}`,value:!1})});else{let o=null;switch(e){case On.SITE:o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation .navigation-button"));break;case On.SEARCH:o=document.querySelector("#header .toggle-search-button");break;case On.ACCOUNT:o=document.querySelector("#header .account-button");break;default:return}o&&o.focus()}r(s)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const i=m4(e[r],t);if(!(typeof i>"u")&&(!n||i[t]&&i[t].includes(n)||i.value&&i.value.includes(n)||i.toString().includes(n)))return e[r]}return e[0].children?pt.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:i})=>{var l;if(!t.current||!t.current.children)return;const a=n?"desktop":"default";if(r[e][a]){(l=document.querySelector(`#header ul a[href="${r[e][a]}"]:last-child`))==null||l.focus();return}let s,o;switch(e){case On.SITE:if(n){const u=pt.findFirstChild(t.current.children,"className","has-submenu parent"),c=pt.findFirstChild(u.children,"id",On.SITE);s=pt.findFirstChild(c.children,"href")}else s=pt.findFirstChild(t.current.children,"href");break;case On.ACCOUNT:if(o=pt.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=pt.findFirstChild(o.children,"href");break;default:return}s&&(i([{type:`focusElements.${e}.${a}`,value:s.attributes.href.value}]),s.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(pt.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(pt.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(pt.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{pt.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}},readLocaleFromCookie:()=>{if(!document||!document.cookie||!document.cookie.length)return null;const e=document.cookie.match(new RegExp("(^|;\\s*)apolitical_locale=([^;]*)"));return e?decodeURIComponent(e[2]):null}},As={order:["home","communities","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},communities:{href:"/communities/",gtmType:"communities-click",onlyShow:"logged-in"},topics:{onlyShow:"logged-in",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:["cities-and-local-government","digital-and-data","education","climate","health-and-social-care","equity-justice-and-inclusion","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:"/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/login",withReturnTo:!0},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},Kc=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:i=()=>{},doTrack:a=null,getHref:s})=>{const o=le.useIntl(),l=m4(As,e);if(!l||l.onlyShow&&(l.onlyShow==="logged-in"&&!t||l.onlyShow==="logged-out"&&t))return null;const u="doTrack"in l,c=a===null?u?l.doTrack:!0:a,d=e.includes("buttons.");let f=`header_${e.replaceAll(".","_")}`;l.hasVariantText&&(f+=`_logged${t?"In":"Out"}`);let m=!1;if(l.href){let C=l.gtmType||`${e}-click`;if(C.includes(".")){const w=C.split("."),x=w[w.length-2];C=`${x==="topics"?`${x}-`:""}${w[w.length-1]}`}m={href:s?s(l.href):l.withReturnTo?`${l.href}?returnTo=${window.location.pathname+window.location.search}`:l.href},c&&(m={...m,className:"gtm-trackable","data-gtm-event-type":C,"data-gtm-event-context":"HeaderButtons"}),d&&(m={...m,variant:"secondary",size:{mobile:"small",881:"large"},...l.props||{}})}const g=l.order&&l.order[0]&&l[l.order[0]],p=g&&l[l.order[0]].order,y=m&&window.location.pathname===l.href;let v={},T={},_={};if(y&&(v={...v,"aria-current":"page"}),g){const C=l.menuId||e,w={onClick:x=>pt.events.onClick(x,{id:C,callback:i,isOpen:r[C]}),onFocus:()=>pt.events.onFocus({id:C}),onBlur:()=>pt.events.onBlur({id:C,callback:i}),onMouseLeave:()=>pt.events.onBlur({id:C,callback:i}),onMouseEnter:()=>pt.events.onMouseEnter({id:C,callback:i})};T={...w,id:C===On.SITE?On.SITE:On.ACCOUNT},n&&(p&&(_={...w,className:"navigation-button",onKeyPress:x=>{x.key==="Enter"&&pt.events.onClick(x,{id:C,callback:i,isOpen:r[C]})},"aria-haspopup":!0,"aria-expanded":r[C],"aria-controls":C}),T={...T,hidden:C in r?!r[C]:!0}),p||(T={...T})}return h.jsxs("li",{className:te({[l.className]:l.className,"has-submenu":g,parent:p,active:y}),...v,children:[m?E.createElement(d?Ie:"a",m,o.formatMessage({id:f})):n&&l.order&&p?h.jsxs("button",{..._,children:[o.formatMessage({id:f}),h.jsx(ot,{children:o.formatMessage({id:`header_menu_${r[On.SITE]?"hide":"show"}`})})]}):o.formatMessage({id:f}),l.order&&h.jsx("ul",{...T,children:l.order.map(C=>{if(!l[C])return null;const w={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:i,doTrack:u?c:null};return l[C].order?h.jsxs("li",{className:te({[l[C].className]:l[C].className}),children:[o.formatMessage({id:`${f}_${C}`}),h.jsx("ul",{children:l[C].order.map(x=>h.jsx(Kc,{id:`${e}.${C}.${x}`,...w},x))})]},C):h.jsx(Kc,{id:`${e}.${C}`,...w},C)})})]},e)};const eie=({headerIsVisible:e,locale:t})=>{const n=le.useIntl();return h.jsx("div",{id:"language-unavailable-message",className:te({visible:e}),children:h.jsx("p",{className:"text",children:n.formatMessage({id:`header_language_unavailable_${t}`},{link:r=>h.jsx("a",{href:"/pages/multilingual-transition",children:r})})})})},tie={colors:{primary:"#4F43BA",primaryHover:"#7C72E1",error:"#C34141",icon:"#000000",text:{primary:"#151921",secondary:"#64748B"},background:{primary:"#FFFFFF",hover:"#F8FAFC"},border:"#E2E8F0"},typography:{fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"24px"},fontWeights:{medium:"medium",bold:"bold"}},spacing:{xs:"8px",sm:"12px",md:"16px"},borderRadius:{sm:"8px",md:"12px",full:"9999px"},shadows:{sm:"0px 4px 6px rgba(0, 0, 0, 0.1)"},circleSizes:{avatar:"40px",dot:"10px"}},{colors:{primary:Ao,primaryHover:nie,error:s4,text:ei,background:ti,border:Qf,icon:rie},typography:{fontSizes:ni,fontWeights:da},spacing:fa,borderRadius:zu,shadows:o4,circleSizes:l4}=tie,iie={bell:{color:rie},badge:{backgroundColor:s4,color:ti.primary},header:{container:{backgroundColor:ti.primary,borderBottom:`1px solid ${Qf}`},headerText:{color:ei.primary,fontSize:ni.lg,fontWeight:da.bold},markAllReadText:{color:Ao,fontWeight:da.medium,fontSize:ni.sm}},notificationsContainer:{container:{borderRadius:zu.md,overflow:"auto",backgroundColor:ti.primary,boxShadow:o4.sm,border:"none"},loader:{color:Ao},noNotificationsText:{color:ei.primary,fontSize:ni.md,fontWeight:da.medium},noNotificationsSubtext:{color:ei.secondary,fontSize:ni.sm}},notification:{unseenDot:{backgroundColor:s4,width:l4.dot,height:l4.dot,right:fa.md,top:fa.md},container:{unreadBackgroundColor:ti.primary,readBackgroundColor:ti.primary,hoverBackgroundColor:ti.hover,borderBottom:`1px solid ${Qf}`,padding:fa.md},headerText:{color:ei.primary,fontSize:ni.md,fontWeight:da.medium},bodyText:{color:ei.primary,fontSize:ni.md},subtext:{color:ei.secondary,fontSize:ni.sm},actions:[{container:{backgroundColor:Ao,color:ti.primary,borderRadius:zu.full,padding:`${fa.xs} ${fa.md}`,fontSize:ni.sm,fontWeight:da.medium,hoverBackgroundColor:nie}},{container:{borderColor:Ao,color:ei.secondary,backgroundColor:ti.primary,borderRadius:zu.full,padding:`${fa.xs} ${fa.md}`,fontSize:ni.sm,fontWeight:da.medium},text:{color:Ao}}]},toast:{container:{backgroundColor:ti.primary,borderRadius:zu.sm,boxShadow:o4.sm,border:`1px solid ${Qf}`},headerText:{color:ei.primary,fontWeight:da.medium},bodyText:{color:ei.secondary}}},aie={notifications:"Notifications",markAllAsRead:"Mark all as read",noNotificationsTitle:"No notifications yet",noNotificationsDescription:"Stay tuned for updates and new content",pinned:"Pinned",markAsUnread:"Mark as unread",markAsRead:"Mark as read",archive:"Archive",expiresIn:"Expires in"};const Xf={height:67,height_desktop:83,additional_message_height:40};var On=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(On||{});const N0=({showNavigation:e=!0,showLanguageUnavailableMessage:t=!0,showLanguageSwitcher:n=!0,onLanguageSwitcherClick:r,suprSendWorkspaceKey:i,locale:a,suprSendTranslations:s})=>{var b,q;const o=le.useIntl(),l=E.useContext(Pt),u=Xc();u&&(As.home.href=u);const c=Wi(!0,!0),d=l&&typeof l.id=="string",f=E.useMemo(()=>pt.getIsDesktopVersion(d,c),[d,c]),m=us("suprsend-notifications")&&i,g=(q=(b=l==null?void 0:l.externalsMetadata)==null?void 0:b.suprsend)==null?void 0:q.subscriberId,p=t&&!d,y=us("language-switcher")&&n&&!p,[v,T]=E.useState(!1),[_,C]=E.useState(null);E.useEffect(()=>{let R=null;if(a)R=a;else try{R=pt.readLocaleFromCookie()}catch{R=null}C(R),t&&y&&(R!==null&&R!==Yu)&&T(!0)},[t,y,l,a]);const[w,x]=E.useReducer(js,{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:S,menus:N,focusElements:B}=w,$=E.useRef(w);E.useEffect(()=>{$.current=w},[w]),I4({scrollPosition:v?Xf[`height${f.navigation?"_desktop":""}`]+Xf.additional_message_height:Xf[`height${f.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const R=$.current.menus;!f&&R["site-navigation"]||pt.shouldChangeHeaderIsVisible(!0,R,x)},scrollDown:()=>{const R=$.current.menus;!f&&R["site-navigation"]||pt.shouldChangeHeaderIsVisible(!1,R,x)}}});const F=(R,j,H=!1)=>{pt.handleMenus({id:R,value:j,menus:$.current.menus,dispatch:x,forceHandle:H})},L=E.useRef(null),O=R=>{R.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(j=>{$.current.menus[j]&&F(j,!1,!0)})};E.useEffect(()=>{var R;return(R=document.getElementById("header"))==null||R.addEventListener("keydown",O),()=>{var j;(j=document.getElementById("header"))==null||j.removeEventListener("keydown",O)}},[]),Ss(()=>{N["site-navigation"]&&pt.autoFocus({menu:"site-navigation",navigationRef:L,isDesktopVersion:f.navigation,focusElements:B,dispatch:x})},[N["site-navigation"]]),Ss(()=>{N["account-navigation"]&&pt.autoFocus({menu:"account-navigation",navigationRef:L,isDesktopVersion:f.navigation,focusElements:B,dispatch:x})},[N["account-navigation"]]);const P=d&&h.jsxs(h.Fragment,{children:[!f.search&&h.jsx("button",{className:"search toggle-search-button",onClick:R=>{R.preventDefault(),R.stopPropagation(),F("search",!N.search)},children:h.jsx(ot,{children:o.formatMessage({id:`header_search_${N.search?"hide":"show"}`})})}),h.jsx(l_,{id:"global-search",handleToggle:{searchIsOpen:N.search,isDesktopVersion:f.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),M=h.jsx("button",{className:"language icon language-switcher-button gtm-trackable","data-gtm-event-type":"open-language-switcher-click","data-gtm-event-context":"HeaderLeft-LanguageSwitcher","aria-label":"Language switcher",onClick:R=>{R.preventDefault(),R.stopPropagation(),r?r():T(!v)},children:h.jsx(ot,{children:o.formatMessage({id:"header_language_switcher"})})}),U=[m&&g&&h.jsx("div",{id:"suprsend-notifications",children:h.jsx(Jre,{workspaceKey:i,distinctId:(l==null?void 0:l.id)??"",subscriberId:g,theme:iie,language:_||Yu,translations:s||aie,bellComponent:()=>h.jsx("button",{className:"bell icon bell-button gtm-trackable","data-gtm-event-type":"open-bell-click","data-gtm-event-context":"HeaderLeft-Bell"})})},"suprsend-notifications")],D=h.jsxs(h.Fragment,{children:[!f.navigation&&h.jsx("button",{className:"menu-button gtm-trackable",onClick:R=>{R.preventDefault(),R.stopPropagation(),F("site-navigation",!N["site-navigation"])},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":N["site-navigation"],"aria-controls":"site-navigation",children:h.jsx(ot,{children:o.formatMessage({id:`header_menu_${N["site-navigation"]?"hide":"show"}`})})}),h.jsx("ul",{"data-phunmask":"true",ref:L,id:"navigation",hidden:f.navigation||N["account-navigation"]?!1:!N["site-navigation"],"data-showing":!f.navigation&&N["account-navigation"]?"account":"default",children:As.order.map(R=>h.jsx(Kc,{id:R,isLoggedIn:d,isDesktopVersion:f.navigation,menus:{"site-navigation":N["site-navigation"],"account-navigation":N["account-navigation"]},callback:F},R))})]}),X=window.location.pathname.match(new RegExp("(courses/[^/]+/[^/]+|microcourses/[^/]+/[^/]+)")),Z=window.location.pathname.match(new RegExp("academies/[^/]+")),k=R=>{var se;const[j,H]=R.split("?"),z=new URLSearchParams(H||""),re=new URLSearchParams(window.location.search).get("ref");if(z.set("ref",re||(X?"course-overview":"header-banner")),window.location.pathname){const ae=window.location.pathname.match(new RegExp("(courses/([^/]+)/([^/]+)|microcourses/[^/]+/([^/]+))"));if(ae){const[,,be,Ce,Pe]=ae;Pe?z.set("courseSlug",Pe):(z.set("courseSlug",be),z.set("journeySlug",Ce)),z.set("signupRedirectUrl",window.location.pathname+(window.location.search||""))}}const Q=((se=window.location.pathname.match(/^\/([^/]+)\/(?:courses|academies)/))==null?void 0:se[1])||"";return`${Q?`/${Q}`:""}${j}?${z.toString()}`};return l&&l.isLoading?null:h.jsxs(h.Fragment,{children:[h.jsxs("nav",{id:"header",className:te({"logged-in":d,"logged-out":!d,visible:S}),children:[h.jsx(ot,{element:"a",href:"#content-wrapper",children:o.formatMessage({id:"header_skip"})}),h.jsx(vp,{variant:"monochrome"}),e?h.jsxs(h.Fragment,{children:[f.navigation?h.jsxs(h.Fragment,{children:[D,P,y&&M,U]}):h.jsxs(h.Fragment,{children:[P,y&&M,U,D]}),d?h.jsxs("button",{className:"account-button",onClick:R=>pt.events.onClick(R,{id:"account-navigation",callback:F,isOpen:N["account-navigation"]}),onMouseEnter:()=>pt.events.onMouseEnter({id:"account-navigation",callback:F}),onMouseLeave:()=>pt.events.onBlur({id:"account-navigation",callback:F}),"aria-haspopup":"true","aria-expanded":N["account-navigation"],"aria-controls":"account-navigation",children:[h.jsx(ot,{children:o.formatMessage({id:`header_account_${N["account-navigation"]?"hide":"show"}`})}),h.jsx(gi,{name:l&&l.name||"",src:l&&l.image&&l.image.thumbnail||""})]}):h.jsx("ul",{className:"sign-in-buttons",children:As.buttons.order.map(R=>h.jsx(Kc,{id:`buttons.${R}`,getHref:R==="signup"&&(X||Z)?k:void 0},R))})]}):y&&M]}),v&&h.jsx(eie,{headerIsVisible:S,locale:(l==null?void 0:l.locale)||Yu}),h.jsx("hr",{id:"content-of-page"}),h.jsx("div",{className:te("overlay",{open:N["site-navigation"]||N["account-navigation"]||!f.search&&N.search})})]})};const sie=()=>{const e=le.useIntl();return h.jsxs(h.Fragment,{children:[h.jsx(N0,{}),h.jsx("div",{id:"content",children:h.jsx(Lr,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),h.jsx(yp,{})]})},Z3=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:i={},styling:a={},className:s="",locale:o="en",suprSendWorkspaceKey:l})=>{const u=le.useIntl(),{navigation:c=!0,footer:d=!0}=i,{background:f="default",variant:m="default",circle:g="default",modal:p="default"}=a,y=E4(),[v,T]=E.useState(""),_=N=>{const{detail:{message:B}}=N;T(B)};E.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",_),()=>{document.removeEventListener("ariaLive",_)}),[y]);const C=Ku(e,{locale:o}),w=Ku(t,{locale:o}),x=Ku(n,{locale:o}),S={};return f!=="default"&&(S[f]=!0),m!=="default"&&(S[m]=!0),g!=="default"&&(S[g]=!0),h.jsx(px.ErrorBoundary,{onError:r,fallback:h.jsx(sie,{}),children:h.jsxs(E.Suspense,{fallback:null,children:[h.jsxs("div",{id:"wrapper",className:te(s,S,{"has-footer":d,v1styles:!0}),"data-too-small":u.formatMessage({id:"pageLayout_browserTooSmall"}),children:[h.jsx(N0,{suprSendWorkspaceKey:l,showNavigation:c}),h.jsxs("main",{id:"content-wrapper",tabIndex:-1,children:[w&&h.jsx("div",{className:te("additional-content prepended",{"large-modal":p==="large"}),children:w}),E.createElement(f==="bold"?km:"div",{id:"content",children:C,className:te({"large-modal":p==="large"})})]}),x&&h.jsx("div",{className:"additional-content appended",children:x}),d&&h.jsx(yp,{}),h.jsx(y_,{})]}),v&&h.jsx(ot,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:v})]})})},u4={default:"tags_",headerTopics:"header_topics_topics_"},Jf={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"},oie={getTagDetails:e=>{if(e.includes("topic_")){if(e=Jf.topic[e.replace("topic_","")],e){const t=As.topics.topics[e].href;return t?{id:e,href:t,text:`${u4.headerTopics}${e}`}:null}return null}return Jf[e]?(e=Jf[e],{id:e,text:`${u4.default}${e}`}):null}};const lie=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:i="",gtmType:a="tag-click",gtmContext:s="tags"})=>{const o=le.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const c=oie.getTagDetails(u);c&&l.push(c)}),l.length<1?null:h.jsx("ul",{className:te("tags text-small",t,i,{"one-line":n}),children:l.map(u=>{const c=o.formatMessage({id:u.text});return h.jsx("li",{children:u.href&&r?h.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":a,"data-gtm-event-context":s,children:c}):c},u.id)})})};const Q3=25,uie=({members:{data:e=[],total:t=e.length},communitySlug:n,isMember:r=!1,hasNextPage:i=!1,loadNextPage:a=()=>{},profile:s,gtmContext:o="member",gtmType:l="member-click",showHeader:u=!0,showPlaceholders:c=!1,className:d="",ownersFns:f})=>{const m=le.useIntl(),g="membersList",p=E.useContext(Pt),[y,v]=E.useState(!1);return e.length===0&&!c?null:h.jsxs("div",{className:te("members-list",d),children:[u?h.jsxs("h1",{children:[m.formatMessage({id:g}),h.jsx("span",{className:"count",children:m.formatNumber(t)})]}):h.jsx(h.Fragment,{}),h.jsxs("ul",{children:[r?h.jsxs("li",{children:[h.jsx(li,{member:p,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:nn.Communities,area:n||""},{scope:nn.Platform,area:"all"}]}}),h.jsx(Ki,{href:"/profiles/me",className:"text-small",onClick:T=>{T==null||T.preventDefault(),T==null||T.stopPropagation(),v(!0)},children:m.formatMessage({id:`${g}_profile`})})]}):h.jsx(h.Fragment,{}),e.map((T,_)=>p&&T.id===p.id?h.jsx(h.Fragment,{}):h.jsxs("li",{children:[h.jsx(li,{member:T,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:nn.Communities,area:n||""},{scope:nn.Platform,area:"all"}]}}),T.isAdmin?h.jsxs("div",{className:"member-owner-actions",children:[h.jsx(Pr,{children:m.formatMessage({id:`${g}_owner`})}),(f==null?void 0:f.remove)&&h.jsx("button",{type:"button",className:"member-owner-actions-button","aria-label":"Remove owner",disabled:!T.id,onClick:async C=>{C==null||C.preventDefault(),C==null||C.stopPropagation(),await f.remove(T.id)},children:"×"})]}):(f==null?void 0:f.create)&&h.jsx("div",{className:"member-owner-actions",children:h.jsx("button",{type:"button",className:"member-owner-actions-button","aria-label":"Add owner",disabled:!T.id,onClick:async C=>{C==null||C.preventDefault(),C==null||C.stopPropagation(),await f.create(T.id)},children:"+"})})]},_)),c&&e.length===0&&t>0?[...new Array(Math.min(t,Q3))].map((T,_)=>h.jsx("li",{children:h.jsx(t1,{layout:"member"})},_)):h.jsx(h.Fragment,{})]}),i&&h.jsx(wl,{hasNextPage:i,loadNextPage:a,icon:{icon:"arrow-down",position:"right"},messages:{button:m.formatMessage({id:"loadMore_button"}),error:m.formatMessage({id:"loadMore_error"})},gtmContext:o}),s?h.jsx(H1,{form:s,showModal:y,content:{title:m.formatMessage({id:`${g}_modal_title`})},functions:{onClose:()=>{v(!1)}}}):h.jsx(h.Fragment,{})]})},X3=uie,cie=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const i=le.useIntl();return t?h.jsx("small",{children:wr(i.formatMessage,`${e}explainer`,n,"action",{a:a=>h.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":r,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:a})})}):h.jsx(h.Fragment,{})},die=({intlPath:e,type:t,...n})=>{const r=le.useIntl();return h.jsx(Pc,{label:{visible:r.formatMessage({id:`${e}label`}),screenreader:wr(r.formatMessage,`${e}label_action`,t,"action")},...n})},c4=5,d4=2,fie=(e,t)=>{var i;let n=0;const r=[];return(i=e==null?void 0:e["poll-options"])==null||i.forEach((a,s)=>{a!==""&&(n++,r.push({position:n,body:a,locale:t}))}),{title:e.title,locale:t,options:r,settings:{allow_multiple_votes:e["multiple-answers"]||!1}}};const _t="discussion_form_",Ll=({id:e,parentId:t,content:n={type:ze.Response,slugs:{}},userHasPermissions:r=!0,meta:i,placeholder:a,maxLength:s=0,buttons:o,forceShow:l={cancel:!1,error:!1},functions:u,data:c={},gtmContext:d="DiscussionForm"})=>{var Oe,qe,gt;const f=le.useIntl(),m=E.useContext(Pt),g=Ra(),[p,y]=E.useState(n.type),[v,T]=E.useState(!1),[_,C]=E.useState(!1),[w,x]=E.useState(""),{isLoading:S=!1,isInWrapper:N=!1,isInOverlay:B=!1,isAutoFocused:$=!1,isEditing:F=!1,hasTitleField:L=!1,canBePrepopulated:O=!1,isPrepopulated:P=!1,showTitle:M=!1,showGuidelines:U=!0,showDivider:D=!1,showSuccessMessage:X=!0,showPostType:Z=!1,postCategories:k=[],allowAnonymousPosts:b=!1}=i||{},{onChange:q=()=>{},create:R=()=>{},createPoll:j=()=>Promise,handleSaveEdit:H=()=>{},handleCancel:z=()=>{},callback:Y=()=>{},onMention:re=()=>{},listMembers:Q=()=>Promise.resolve([]),clickMentionFallback:G=()=>{},getLinkPreview:se=()=>Promise.resolve({}),props:ae={create:{projectNames:["questions-answers"]}}}=u,[be,Ce]=E.useState({body:F&&F.text||P&&P.text||"",data:c!=null&&c.link?{link:c==null?void 0:c.link}:{}}),[Pe,je]=E.useState(l.error||!1),Fe={status:!1,title:L&&L.text||"",polls:0},[Be,Qe]=E.useState(Fe);E.useEffect(()=>{O&&!F&&P&&P!==be.body&&Ce(Ee=>({...Ee,body:P.text||""}))},[P]),E.useEffect(()=>{y(n.type)},[n.type]);const tt=il((Ee,Le)=>{Ce($e=>({...$e,body:Ee,data:{link:Le}})),q({body:Ee});let He;!m||!m.id?He=wr(f.formatMessage,`${_t}error_loggedOut`,p,"action"):r?s>0&&Ee.length>=s&&(He=`${_t}error_tooLong`):He=wr(f.formatMessage,`${_t}error_noPermission`,p,"action"),He?je(He):Pe&&je(!1)},50);let Xe=`${p}-form`;if(p===ze.Response||p===ze.Reply){const Ee=((Oe=n.slugs)==null?void 0:Oe.reply)||((qe=n.slugs)==null?void 0:qe.answer)||((gt=n.slugs)==null?void 0:gt.question)||"";Ee&&(Xe=`${Xe}-${Ee.slice(-15)}`)}e&&(Xe=`${e}-${Xe}`);const me=async Ee=>{if(!m||!m.id||!r||Ae)throw new Error("You do not have permission to post.");Qe(He=>({...He,status:"submitting"}));const Le=window.location.pathname;try{let He;switch(p){case ze.Post:He=await R({title:Ee.title,content:Ee.body,categories:Ee.postType,locale:g,data:Ee.data,is_anonymous:v});break;case ze.Poll:He=await j(fie(Ee,g));break;case ze.Question:He=await R({title:Ee.body,authorId:m&&m.id,data:Ee.data,is_anonymous:v,...ae==null?void 0:ae.create});break;case ze.Response:He=await R({questionSlug:n.slugs.question},{body:Ee.body,authorId:m&&m.id,contentPath:Le,data:Ee.data,is_anonymous:v});break;case ze.Reply:He=await R({questionSlug:n.slugs.question,answerSlug:n.slugs.answer},{body:Ee.body,authorId:m&&m.id,contentPath:Le,data:Ee.data,is_anonymous:v});break;default:break}await rg(1e3),Y&&await Y(He),Ce({body:"",data:{}}),y(n.type),Qe(Nt=>({...Nt,status:"submitted"})),x(wr(f.formatMessage,`${_t}success`,p,"action"));const $e=new Event(Ut.DISCUSSION_FORM_SUBMITTED);return document.dispatchEvent($e),await de(),He}catch(He){const $e=He;let Nt=`${_t}error`;$e!=null&&$e.message.includes("entry already exists")&&(Nt=wr(f.formatMessage,`${_t}error_alreadyExists`,p,"action")),$e!=null&&$e.message.includes("429")?Nt=wr(f.formatMessage,`${_t}error_tooMany`,p,"action"):$e!=null&&$e.message.includes("400")&&(Nt=`${_t}error`),je(Nt),await de()}},de=async()=>{await rg(5e3),je(!1),Qe(Fe),x("")},Te=il(async Ee=>{const Le={...be,...Ee};if(F){Qe(He=>({...He,status:"submitting"})),H(Le);return}try{if(!await me(Le))throw Error("No response from handleSubmit")}catch{}},100);if(S)return h.jsx(Jn,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const ee=!be.body||!sl(be.body),fe=!Be.title||!sl(Be.title);let Ae=!1;p!==ze.Poll&&(Ae=ee),L&&(Ae=Ae&&fe);const Se=Be.status==="submitting",J=[];p===ze.Poll?J.push({id:"poll-options",label:f.formatMessage({id:`${_t}option_label`}),type:"multiple-inputs",element:"textarea",placeholder:f.formatMessage({id:`${_t}option_placeholder`}),limit:100,multipleInputs:{showCount:!0,defaultInputs:d4,maxInputs:c4,hasButton:{variant:"secondary",size:"small",styling:{muted:!0},icon:"plus",children:f.formatMessage({id:`${_t}option_cta`})}},styling:{autosizeToFit:!0},functions:{onChange:Ee=>{var He;let Le=0;Ee&&Array.isArray(Ee)&&(Le=((He=Ee==null?void 0:Ee.filter($e=>$e!==""))==null?void 0:He.length)||0),Be.polls!==Le&&Qe($e=>({...$e,polls:Le})),q({polls:Ee})}},validation:[{condition:"required"}]},{type:"checkbox",id:"multiple-answers",label:f.formatMessage({id:`${_t}multiplePollAnswers`}),className:"text-medium"}):J.push({component:die,props:{formID:Xe,intlPath:_t,showLabel:L!==!1,type:p}},{component:mp,props:{id:`${Xe}-input`,value:Be.status==="submitting"&&!Pe?"":be.body,placeholder:a||wr(f.formatMessage,`${_t}placeholder`,p,"action"),maxLength:s,meta:{isInOverlay:B},functions:{onChange:tt,onChangeData:Ee=>{Ce(Le=>({...Le,data:Ee}))},onMention:re,listMembers:Q,clickMentionFallback:G,getLinkPreview:se},data:c,autoFocus:F!==!1||$&&!L,"aria-invalid":!!Pe,"aria-errormessage":"error-message"}},{component:cie,props:{intlPath:_t,showGuidelines:U,type:p,gtmContext:d}}),D&&J.push({component:pr}),L&&J.unshift({id:"title",type:"textarea",value:L.text,limit:250,label:f.formatMessage({id:`${_t}${p===ze.Poll?"question":"titleField"}_label`}),styling:{autosizeToFit:!0},placeholder:f.formatMessage({id:`${_t}${p===ze.Poll?"question":"titleField"}_placeholder`}),functions:{onChange:Ee=>{Qe(Le=>({...Le,title:Ee})),q({title:Ee})}},validation:p===ze.Poll?[{condition:"required"}]:[]}),Z&&J.unshift({id:"postType",type:"radio",value:"no-category",accessibilityOptions:{checkboxes:{navigateWithArrowKeys:!0}},styling:{displayOptionsAsPills:!0},label:f.formatMessage({id:`${_t}postType_label`}),options:k.map(Ee=>({id:Ee.slug,label:Ee.name})).filter(Ee=>!v||!Ee.id.includes("poll")),validation:[{condition:"required"}],functions:{onChange:Ee=>{q({postType:Ee}),Ee.includes(ze.Poll)?y(ze.Poll):p!==ze.Post&&y(ze.Post)}}});let ve=!m||!m.id||!r||Se;if(p===ze.Poll){const Ee=Be.polls;ve=ve||fe||Ee<d4||Ee>c4}else ve=ve||Ae,F&&(L?ve=ve||be.body===F.text&&Be.title===L.text:ve=ve||be.body===F.text);return h.jsxs(h.Fragment,{children:[h.jsxs(vr,{id:Xe,className:te("discussion-card discussion-form",{"no-styling":N&&F}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:F&&!Se||l.cancel},functions:{onSuccess:async Ee=>{await Te(Ee)},onCancel:z},fields:J,intlPath:_t,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":d,"data-gtm-event-type":`${F?"save":"submit"}-${p}-click`,"data-testid":"save-button",disabled:ve,text:{default:!F&&(o!=null&&o.submit)?o==null?void 0:o.submit:f.formatMessage({id:`${_t}${F?"save":"post"}`}),submitting:f.formatMessage({id:`${_t}${F?"saving":"posting"}`})}},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":d,"data-gtm-event-type":`cancel-${p}-click`,disabled:!l.cancel&&(!m||!m.id||!be.body),text:o!=null&&o.cancel?o==null?void 0:o.cancel:f.formatMessage({id:`${_t}cancel`})},gtm:{context:d,event:`${p}-form`},"data-testid":`discussion-${p}-form`,children:[M&&!F&&p===ze.Question&&h.jsx("h2",{children:wr(f.formatMessage,`${_t}title`,p,"action")}),b&&h.jsxs("div",{className:"toggle-wrapper",children:[h.jsxs("div",{className:"label",children:[f.formatMessage({id:`${_t}isAnonymous_label`}),h.jsx("span",{onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:h.jsx(pi,{isOpen:_,styling:{hasPointer:"bottom"},className:"positioned-tooltip",children:f.formatMessage({id:`${_t}isAnonymous_tooltip_content`})})})]}),h.jsx(n_,{label:"",options:[{label:"False",value:!1},{label:"True",value:!0}],initialValue:v,isDisabled:p===ze.Poll,functions:{onChange:Ee=>T(Ee===!0)}})]}),h.jsx(li,{member:v?{name:f.formatMessage({id:"member_anonymous"}),jobTitle:f.formatMessage({id:`${_t}member_anonymous_infoMsg`}),image:{thumbnail:`${Yn}logos/member_anonymous.png`},link:!1}:m?{...m,link:!1}:"community",gtmContext:d,gtmType:"profile-click",badges:{showBadges:!0,scopes:[{scope:nn.Communities,area:t||""},{scope:nn.Platform,area:"all"}]}})]}),Be.status==="submitted"&&X&&h.jsx(ks,{className:"success","data-testid":"success",children:wr(f.formatMessage,`${_t}success`,p,"action")}),Pe&&h.jsx(ks,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof Pe=="string"?Pe.includes(" ")?Pe:f.formatMessage({id:Pe},{action:f.formatMessage({id:`discussion_action_${p}`}),maxLength:s}):Pe}),w&&h.jsx(ot,{"aria-live":"polite",showOnFocus:!1,children:w})]})},hie=Object.freeze(Object.defineProperty({__proto__:null,default:Ll},Symbol.toStringTag,{value:"Module"}));function J3(e,t){let n=t;const r=e.matchAll(Aa),i=e.matchAll(/\[([^\]]+)\]\(([^)]+)\)/g);for(const a of[r,i])for(const s of a)if(s.index!==void 0){if(s.index>=n)break;if(s.index+s[0].length<=n)continue;n=s.index}return e.length>n?e.slice(0,n).trim()+"…":e}const ex=280,mie=(e,t,n)=>{let r=t?J3(e,typeof t=="number"?t:ex):e;return r=r.trim(),r=r.replaceAll(Aa,(i,a)=>{var s,o;return`[@${((o=(s=n==null?void 0:n[a])==null?void 0:s.data)==null?void 0:o.name)||a}](/profiles/${a})`}),r},I0=async(e,t,n,r=()=>Promise.resolve([]))=>{let i=t?J3(e,typeof t=="number"?t:ex):e;i=i.trim();const a=`<br>
568
+ `]))),Xre={storeData:{},unseenCount:0,hasNext:!1,initialLoading:!1,fetchMoreLoading:!1};E.createContext({notificationsData:Xre});function Jre(e){var t=e.workspaceKey,n=t===void 0?"":t,r=e.tenantId,i=r===void 0?"":r,a=e.distinctId,s=a===void 0?"":a,o=e.subscriberId,l=o===void 0?"":o,u=e.inboxId,c=u===void 0?"":u,d=e.stores,f=e.toastProps,m=e.notificationClickHandler,g=e.primaryActionClickHandler,p=e.secondaryActionClickHandler,y=e.bellComponent,v=e.badgeComponent,T=e.notificationComponent,_=e.noNotificationsComponent,C=e.loaderComponent,w=e.tabBadgeComponent,x=e.headerRightComponent,S=e.hideAvatar,N=S===void 0?!1:S,B=e.hideInbox,$=e.hideToast,F=e.theme,L=e.themeType,O=L===void 0?"light":L,P=e.pagination,M=P===void 0?!0:P,U=e.pageSize,D=e.popperPosition,X=D===void 0?"bottom":D,Z=e.showUnreadCountOnTabs,k=Z===void 0?!0:Z,b=e.host,q=e.language,R=e.disableMarkdown,j=e.translations;c&&(l=c);var H=E.useState(!1),z=H[0],Y=H[1],re=E.useState(),Q=re[0],G=re[1],se=E.useState({storeData:{},count:0}),ae=se[0],be=se[1],Ce=E.useState(""),Pe=Ce[0],je=Ce[1],Fe=E.useState(!1),Be=Fe[0],Qe=Fe[1];E.useEffect(function(){var Xe=new SB(n,{pageSize:U,tenantID:i,stores:d,host:b});return G(Xe),Xe.emitter.on("sync_notif_store",function(){var me=Xe.feed.data;be({storeData:(me==null?void 0:me.stores)||{},count:(me==null?void 0:me.unseenCount)||0,hasNext:me==null?void 0:me.hasNext,initialLoading:me==null?void 0:me.initialLoading,activeStoreId:me==null?void 0:me.activeStoreId}),je(me==null?void 0:me.activeStoreId)}),Xe.emitter.on("new_notification",function(me){Zre({notificationsData:me,toastProps:f})}),function(){Xe.emitter.all.clear()}},[]),E.useEffect(function(){z&&l&&Q&&Q.feed.markAllSeen()},[z,l,Q]),E.useEffect(function(){if(!(!l||!Q))return be({storeData:{},count:0}),Q.identifyUser(s,l),Q.feed.fetchNotifications(),function(){Q.resetUser()}},[l,Q]);var tt=O==="dark"?V3(Dne,F):F||{};return E.createElement(q3.Provider,{value:tt},E.createElement(D0.Provider,{value:{workspaceKey:n,notificationsData:ae,setNotificationsData:be,notificationClickHandler:m,primaryActionClickHandler:g,secondaryActionClickHandler:p,bellComponent:y,badgeComponent:v,notificationComponent:T,noNotificationsComponent:_,tabBadgeComponent:w,headerRightComponent:x,toggleInbox:Y,inbox:Q,loaderComponent:C,pagination:M,hideAvatar:N,activeStore:Pe,setActiveStore:je,changingActiveStore:Be,setChangingActiveStore:Qe,showUnreadCountOnTabs:k,themeType:O,language:q,disableMarkdown:R,translations:j}},!B&&E.createElement(jre,{openInbox:z,toggleInbox:Y,popperPosition:X}),!$&&E.createElement(Yre,f)))}const pt={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=a=>{const s=`logged${e?"In":"Out"}`;return t>=n[a][s]};let i={};return["navigation","search"].forEach(a=>{i[a]=r(a)}),i},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(i=>i===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r,forceHandle:i=!1})=>{if(!i&&n[e]===t||!i&&e===On.ACCOUNT&&t===!1&&n[On.SITE]===!0)return;const a=Date.now();if(!i&&!t&&pt.handlerCalled[e]&&a-pt.handlerCalled[e]<500)return;pt.handlerCalled[e]=a;let s=[{type:`menus.${e}`,value:t}];if(t===!0)Object.keys(n).forEach(o=>{o===e||n[o]===!1||s.push({type:`menus.${o}`,value:!1})});else{let o=null;switch(e){case On.SITE:o=document.querySelector("#header .menu-button"),o||(o=document.querySelector("#navigation .navigation-button"));break;case On.SEARCH:o=document.querySelector("#header .toggle-search-button");break;case On.ACCOUNT:o=document.querySelector("#header .account-button");break;default:return}o&&o.focus()}r(s)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const i=m4(e[r],t);if(!(typeof i>"u")&&(!n||i[t]&&i[t].includes(n)||i.value&&i.value.includes(n)||i.toString().includes(n)))return e[r]}return e[0].children?pt.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:i})=>{var l;if(!t.current||!t.current.children)return;const a=n?"desktop":"default";if(r[e][a]){(l=document.querySelector(`#header ul a[href="${r[e][a]}"]:last-child`))==null||l.focus();return}let s,o;switch(e){case On.SITE:if(n){const u=pt.findFirstChild(t.current.children,"className","has-submenu parent"),c=pt.findFirstChild(u.children,"id",On.SITE);s=pt.findFirstChild(c.children,"href")}else s=pt.findFirstChild(t.current.children,"href");break;case On.ACCOUNT:if(o=pt.findFirstChild(t.current.children,"className","account"),!o||!o.children)return;s=pt.findFirstChild(o.children,"href");break;default:return}s&&(i([{type:`focusElements.${e}.${a}`,value:s.attributes.href.value}]),s.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(pt.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(pt.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(pt.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{pt.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}},readLocaleFromCookie:()=>{if(!document||!document.cookie||!document.cookie.length)return null;const e=document.cookie.match(new RegExp("(^|;\\s*)apolitical_locale=([^;]*)"));return e?decodeURIComponent(e[2]):null}},As={order:["home","communities","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},communities:{href:"/communities/",gtmType:"communities-click",onlyShow:"logged-in"},topics:{onlyShow:"logged-in",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:["cities-and-local-government","digital-and-data","education","climate","health-and-social-care","equity-justice-and-inclusion","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:"/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/login",withReturnTo:!0},signup:{href:"/signup?ref=header-banner",props:{variant:"primary"}}}},Kc=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:i=()=>{},doTrack:a=null,getHref:s})=>{const o=le.useIntl(),l=m4(As,e);if(!l||l.onlyShow&&(l.onlyShow==="logged-in"&&!t||l.onlyShow==="logged-out"&&t))return null;const u="doTrack"in l,c=a===null?u?l.doTrack:!0:a,d=e.includes("buttons.");let f=`header_${e.replaceAll(".","_")}`;l.hasVariantText&&(f+=`_logged${t?"In":"Out"}`);let m=!1;if(l.href){let C=l.gtmType||`${e}-click`;if(C.includes(".")){const w=C.split("."),x=w[w.length-2];C=`${x==="topics"?`${x}-`:""}${w[w.length-1]}`}m={href:s?s(l.href):l.withReturnTo?`${l.href}?returnTo=${window.location.pathname+window.location.search}`:l.href},c&&(m={...m,className:"gtm-trackable","data-gtm-event-type":C,"data-gtm-event-context":"HeaderButtons"}),d&&(m={...m,variant:"secondary",size:{mobile:"small",881:"large"},...l.props||{}})}const g=l.order&&l.order[0]&&l[l.order[0]],p=g&&l[l.order[0]].order,y=m&&window.location.pathname===l.href;let v={},T={},_={};if(y&&(v={...v,"aria-current":"page"}),g){const C=l.menuId||e,w={onClick:x=>pt.events.onClick(x,{id:C,callback:i,isOpen:r[C]}),onFocus:()=>pt.events.onFocus({id:C}),onBlur:()=>pt.events.onBlur({id:C,callback:i}),onMouseLeave:()=>pt.events.onBlur({id:C,callback:i}),onMouseEnter:()=>pt.events.onMouseEnter({id:C,callback:i})};T={...w,id:C===On.SITE?On.SITE:On.ACCOUNT},n&&(p&&(_={...w,className:"navigation-button",onKeyPress:x=>{x.key==="Enter"&&pt.events.onClick(x,{id:C,callback:i,isOpen:r[C]})},"aria-haspopup":!0,"aria-expanded":r[C],"aria-controls":C}),T={...T,hidden:C in r?!r[C]:!0}),p||(T={...T})}return h.jsxs("li",{className:te({[l.className]:l.className,"has-submenu":g,parent:p,active:y}),...v,children:[m?E.createElement(d?Ie:"a",m,o.formatMessage({id:f})):n&&l.order&&p?h.jsxs("button",{..._,children:[o.formatMessage({id:f}),h.jsx(ot,{children:o.formatMessage({id:`header_menu_${r[On.SITE]?"hide":"show"}`})})]}):o.formatMessage({id:f}),l.order&&h.jsx("ul",{...T,children:l.order.map(C=>{if(!l[C])return null;const w={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:i,doTrack:u?c:null};return l[C].order?h.jsxs("li",{className:te({[l[C].className]:l[C].className}),children:[o.formatMessage({id:`${f}_${C}`}),h.jsx("ul",{children:l[C].order.map(x=>h.jsx(Kc,{id:`${e}.${C}.${x}`,...w},x))})]},C):h.jsx(Kc,{id:`${e}.${C}`,...w},C)})})]},e)};const eie=({headerIsVisible:e,locale:t})=>{const n=le.useIntl();return h.jsx("div",{id:"language-unavailable-message",className:te({visible:e}),children:h.jsx("p",{className:"text",children:n.formatMessage({id:`header_language_unavailable_${t}`},{link:r=>h.jsx("a",{href:"/pages/multilingual-transition",children:r})})})})},tie={colors:{primary:"#4F43BA",primaryHover:"#7C72E1",error:"#C34141",icon:"#000000",text:{primary:"#151921",secondary:"#64748B"},background:{primary:"#FFFFFF",hover:"#F8FAFC"},border:"#E2E8F0"},typography:{fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"24px"},fontWeights:{medium:"medium",bold:"bold"}},spacing:{xs:"8px",sm:"12px",md:"16px"},borderRadius:{sm:"8px",md:"12px",full:"9999px"},shadows:{sm:"0px 4px 6px rgba(0, 0, 0, 0.1)"},circleSizes:{avatar:"40px",dot:"10px"}},{colors:{primary:Ao,primaryHover:nie,error:s4,text:ei,background:ti,border:Qf,icon:rie},typography:{fontSizes:ni,fontWeights:da},spacing:fa,borderRadius:zu,shadows:o4,circleSizes:l4}=tie,iie={bell:{color:rie},badge:{backgroundColor:s4,color:ti.primary},header:{container:{backgroundColor:ti.primary,borderBottom:`1px solid ${Qf}`},headerText:{color:ei.primary,fontSize:ni.lg,fontWeight:da.bold},markAllReadText:{color:Ao,fontWeight:da.medium,fontSize:ni.sm}},notificationsContainer:{container:{borderRadius:zu.md,overflow:"auto",backgroundColor:ti.primary,boxShadow:o4.sm,border:"none"},loader:{color:Ao},noNotificationsText:{color:ei.primary,fontSize:ni.md,fontWeight:da.medium},noNotificationsSubtext:{color:ei.secondary,fontSize:ni.sm}},notification:{unseenDot:{backgroundColor:s4,width:l4.dot,height:l4.dot,right:fa.md,top:fa.md},container:{unreadBackgroundColor:ti.primary,readBackgroundColor:ti.primary,hoverBackgroundColor:ti.hover,borderBottom:`1px solid ${Qf}`,padding:fa.md},headerText:{color:ei.primary,fontSize:ni.md,fontWeight:da.medium},bodyText:{color:ei.primary,fontSize:ni.md},subtext:{color:ei.secondary,fontSize:ni.sm},actions:[{container:{backgroundColor:Ao,color:ti.primary,borderRadius:zu.full,padding:`${fa.xs} ${fa.md}`,fontSize:ni.sm,fontWeight:da.medium,hoverBackgroundColor:nie}},{container:{borderColor:Ao,color:ei.secondary,backgroundColor:ti.primary,borderRadius:zu.full,padding:`${fa.xs} ${fa.md}`,fontSize:ni.sm,fontWeight:da.medium},text:{color:Ao}}]},toast:{container:{backgroundColor:ti.primary,borderRadius:zu.sm,boxShadow:o4.sm,border:`1px solid ${Qf}`},headerText:{color:ei.primary,fontWeight:da.medium},bodyText:{color:ei.secondary}}},aie={notifications:"Notifications",markAllAsRead:"Mark all as read",noNotificationsTitle:"No notifications yet",noNotificationsDescription:"Stay tuned for updates and new content",pinned:"Pinned",markAsUnread:"Mark as unread",markAsRead:"Mark as read",archive:"Archive",expiresIn:"Expires in"};const Xf={height:67,height_desktop:83,additional_message_height:40};var On=(e=>(e.NAVIGATION="navigation",e.SEARCH="search",e.ACCOUNT="account-navigation",e.SITE="site-navigation",e))(On||{});const N0=({showNavigation:e=!0,showLanguageUnavailableMessage:t=!0,showLanguageSwitcher:n=!0,onLanguageSwitcherClick:r,suprSendWorkspaceKey:i,locale:a,suprSendTranslations:s})=>{var b,q;const o=le.useIntl(),l=E.useContext(Pt),u=Xc();u&&(As.home.href=u);const c=Wi(!0,!0),d=l&&typeof l.id=="string",f=E.useMemo(()=>pt.getIsDesktopVersion(d,c),[d,c]),m=us("suprsend-notifications")&&i,g=(q=(b=l==null?void 0:l.externalsMetadata)==null?void 0:b.suprsend)==null?void 0:q.subscriberId,p=t&&!d,y=us("language-switcher")&&n&&!p,[v,T]=E.useState(!1),[_,C]=E.useState(null);E.useEffect(()=>{let R=null;if(a)R=a;else try{R=pt.readLocaleFromCookie()}catch{R=null}C(R),t&&y&&(R!==null&&R!==Yu)&&T(!0)},[t,y,l,a]);const[w,x]=E.useReducer(js,{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:S,menus:N,focusElements:B}=w,$=E.useRef(w);E.useEffect(()=>{$.current=w},[w]),I4({scrollPosition:v?Xf[`height${f.navigation?"_desktop":""}`]+Xf.additional_message_height:Xf[`height${f.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{const R=$.current.menus;!f&&R["site-navigation"]||pt.shouldChangeHeaderIsVisible(!0,R,x)},scrollDown:()=>{const R=$.current.menus;!f&&R["site-navigation"]||pt.shouldChangeHeaderIsVisible(!1,R,x)}}});const F=(R,j,H=!1)=>{pt.handleMenus({id:R,value:j,menus:$.current.menus,dispatch:x,forceHandle:H})},L=E.useRef(null),O=R=>{R.key==="Escape"&&["site-navigation","search","account-navigation"].forEach(j=>{$.current.menus[j]&&F(j,!1,!0)})};E.useEffect(()=>{var R;return(R=document.getElementById("header"))==null||R.addEventListener("keydown",O),()=>{var j;(j=document.getElementById("header"))==null||j.removeEventListener("keydown",O)}},[]),Ss(()=>{N["site-navigation"]&&pt.autoFocus({menu:"site-navigation",navigationRef:L,isDesktopVersion:f.navigation,focusElements:B,dispatch:x})},[N["site-navigation"]]),Ss(()=>{N["account-navigation"]&&pt.autoFocus({menu:"account-navigation",navigationRef:L,isDesktopVersion:f.navigation,focusElements:B,dispatch:x})},[N["account-navigation"]]);const P=d&&h.jsxs(h.Fragment,{children:[!f.search&&h.jsx("button",{className:"search toggle-search-button",onClick:R=>{R.preventDefault(),R.stopPropagation(),F("search",!N.search)},children:h.jsx(ot,{children:o.formatMessage({id:`header_search_${N.search?"hide":"show"}`})})}),h.jsx(l_,{id:"global-search",handleToggle:{searchIsOpen:N.search,isDesktopVersion:f.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"})]}),M=h.jsx("button",{className:"language icon language-switcher-button gtm-trackable","data-gtm-event-type":"open-language-switcher-click","data-gtm-event-context":"HeaderLeft-LanguageSwitcher","aria-label":"Language switcher",onClick:R=>{R.preventDefault(),R.stopPropagation(),r?r():T(!v)},children:h.jsx(ot,{children:o.formatMessage({id:"header_language_switcher"})})}),U=[m&&g&&h.jsx("div",{id:"suprsend-notifications",children:h.jsx(Jre,{workspaceKey:i,distinctId:(l==null?void 0:l.id)??"",subscriberId:g,theme:iie,language:_||Yu,translations:s||aie,bellComponent:()=>h.jsx("button",{className:"bell icon bell-button gtm-trackable","data-gtm-event-type":"open-bell-click","data-gtm-event-context":"HeaderLeft-Bell"})})})],D=h.jsxs(h.Fragment,{children:[!f.navigation&&h.jsx("button",{className:"menu-button gtm-trackable",onClick:R=>{R.preventDefault(),R.stopPropagation(),F("site-navigation",!N["site-navigation"])},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":N["site-navigation"],"aria-controls":"site-navigation",children:h.jsx(ot,{children:o.formatMessage({id:`header_menu_${N["site-navigation"]?"hide":"show"}`})})}),h.jsx("ul",{"data-phunmask":"true",ref:L,id:"navigation",hidden:f.navigation||N["account-navigation"]?!1:!N["site-navigation"],"data-showing":!f.navigation&&N["account-navigation"]?"account":"default",children:As.order.map(R=>h.jsx(Kc,{id:R,isLoggedIn:d,isDesktopVersion:f.navigation,menus:{"site-navigation":N["site-navigation"],"account-navigation":N["account-navigation"]},callback:F},R))})]}),X=window.location.pathname.match(new RegExp("(courses/[^/]+/[^/]+|microcourses/[^/]+/[^/]+)")),Z=window.location.pathname.match(new RegExp("academies/[^/]+")),k=R=>{var se;const[j,H]=R.split("?"),z=new URLSearchParams(H||""),re=new URLSearchParams(window.location.search).get("ref");if(z.set("ref",re||(X?"course-overview":"header-banner")),window.location.pathname){const ae=window.location.pathname.match(new RegExp("(courses/([^/]+)/([^/]+)|microcourses/[^/]+/([^/]+))"));if(ae){const[,,be,Ce,Pe]=ae;Pe?z.set("courseSlug",Pe):(z.set("courseSlug",be),z.set("journeySlug",Ce)),z.set("signupRedirectUrl",window.location.pathname+(window.location.search||""))}}const Q=((se=window.location.pathname.match(/^\/([^/]+)\/(?:courses|academies)/))==null?void 0:se[1])||"";return`${Q?`/${Q}`:""}${j}?${z.toString()}`};return l&&l.isLoading?null:h.jsxs(h.Fragment,{children:[h.jsxs("nav",{id:"header",className:te({"logged-in":d,"logged-out":!d,visible:S}),children:[h.jsx(ot,{element:"a",href:"#content-wrapper",children:o.formatMessage({id:"header_skip"})}),h.jsx(vp,{variant:"monochrome"}),e?h.jsxs(h.Fragment,{children:[f.navigation?h.jsxs(h.Fragment,{children:[D,P,y&&M,U]}):h.jsxs(h.Fragment,{children:[P,y&&M,U,D]}),d?h.jsxs("button",{className:"account-button",onClick:R=>pt.events.onClick(R,{id:"account-navigation",callback:F,isOpen:N["account-navigation"]}),onMouseEnter:()=>pt.events.onMouseEnter({id:"account-navigation",callback:F}),onMouseLeave:()=>pt.events.onBlur({id:"account-navigation",callback:F}),"aria-haspopup":"true","aria-expanded":N["account-navigation"],"aria-controls":"account-navigation",children:[h.jsx(ot,{children:o.formatMessage({id:`header_account_${N["account-navigation"]?"hide":"show"}`})}),h.jsx(gi,{name:l&&l.name||"",src:l&&l.image&&l.image.thumbnail||""})]}):h.jsx("ul",{className:"sign-in-buttons",children:As.buttons.order.map(R=>h.jsx(Kc,{id:`buttons.${R}`,getHref:R==="signup"&&(X||Z)?k:void 0},R))})]}):y&&M]}),v&&h.jsx(eie,{headerIsVisible:S,locale:(l==null?void 0:l.locale)||Yu}),h.jsx("hr",{id:"content-of-page"}),h.jsx("div",{className:te("overlay",{open:N["site-navigation"]||N["account-navigation"]||!f.search&&N.search})})]})};const sie=()=>{const e=le.useIntl();return h.jsxs(h.Fragment,{children:[h.jsx(N0,{}),h.jsx("div",{id:"content",children:h.jsx(Lr,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),h.jsx(yp,{})]})},Z3=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:i={},styling:a={},className:s="",locale:o="en",suprSendWorkspaceKey:l})=>{const u=le.useIntl(),{navigation:c=!0,footer:d=!0}=i,{background:f="default",variant:m="default",circle:g="default",modal:p="default"}=a,y=E4(),[v,T]=E.useState(""),_=N=>{const{detail:{message:B}}=N;T(B)};E.useEffect(()=>(window.scrollTo(0,0),document.addEventListener("ariaLive",_),()=>{document.removeEventListener("ariaLive",_)}),[y]);const C=Ku(e,{locale:o}),w=Ku(t,{locale:o}),x=Ku(n,{locale:o}),S={};return f!=="default"&&(S[f]=!0),m!=="default"&&(S[m]=!0),g!=="default"&&(S[g]=!0),h.jsx(px.ErrorBoundary,{onError:r,fallback:h.jsx(sie,{}),children:h.jsxs(E.Suspense,{fallback:null,children:[h.jsxs("div",{id:"wrapper",className:te(s,S,{"has-footer":d,v1styles:!0}),"data-too-small":u.formatMessage({id:"pageLayout_browserTooSmall"}),children:[h.jsx(N0,{suprSendWorkspaceKey:l,showNavigation:c}),h.jsxs("main",{id:"content-wrapper",tabIndex:-1,children:[w&&h.jsx("div",{className:te("additional-content prepended",{"large-modal":p==="large"}),children:w}),E.createElement(f==="bold"?km:"div",{id:"content",children:C,className:te({"large-modal":p==="large"})})]}),x&&h.jsx("div",{className:"additional-content appended",children:x}),d&&h.jsx(yp,{}),h.jsx(y_,{})]}),v&&h.jsx(ot,{"aria-live":"polite",showOnFocus:!1,"data-testid":"layout-aria-live",children:v})]})})},u4={default:"tags_",headerTopics:"header_topics_topics_"},Jf={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"},oie={getTagDetails:e=>{if(e.includes("topic_")){if(e=Jf.topic[e.replace("topic_","")],e){const t=As.topics.topics[e].href;return t?{id:e,href:t,text:`${u4.headerTopics}${e}`}:null}return null}return Jf[e]?(e=Jf[e],{id:e,text:`${u4.default}${e}`}):null}};const lie=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:i="",gtmType:a="tag-click",gtmContext:s="tags"})=>{const o=le.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(u=>{if(!u)return;const c=oie.getTagDetails(u);c&&l.push(c)}),l.length<1?null:h.jsx("ul",{className:te("tags text-small",t,i,{"one-line":n}),children:l.map(u=>{const c=o.formatMessage({id:u.text});return h.jsx("li",{children:u.href&&r?h.jsx("a",{href:u.href,className:"gtm-trackable","data-gtm-event-type":a,"data-gtm-event-context":s,children:c}):c},u.id)})})};const Q3=25,uie=({members:{data:e=[],total:t=e.length},communitySlug:n,isMember:r=!1,hasNextPage:i=!1,loadNextPage:a=()=>{},profile:s,gtmContext:o="member",gtmType:l="member-click",showHeader:u=!0,showPlaceholders:c=!1,className:d="",ownersFns:f})=>{const m=le.useIntl(),g="membersList",p=E.useContext(Pt),[y,v]=E.useState(!1);return e.length===0&&!c?null:h.jsxs("div",{className:te("members-list",d),children:[u?h.jsxs("h1",{children:[m.formatMessage({id:g}),h.jsx("span",{className:"count",children:m.formatNumber(t)})]}):h.jsx(h.Fragment,{}),h.jsxs("ul",{children:[r?h.jsxs("li",{children:[h.jsx(li,{member:p,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:nn.Communities,area:n||""},{scope:nn.Platform,area:"all"}]}}),h.jsx(Ki,{href:"/profiles/me",className:"text-small",onClick:T=>{T==null||T.preventDefault(),T==null||T.stopPropagation(),v(!0)},children:m.formatMessage({id:`${g}_profile`})})]}):h.jsx(h.Fragment,{}),e.map((T,_)=>p&&T.id===p.id?h.jsx(h.Fragment,{}):h.jsxs("li",{children:[h.jsx(li,{member:T,gtmContext:o,gtmType:l,badges:{showBadges:!0,scopes:[{scope:nn.Communities,area:n||""},{scope:nn.Platform,area:"all"}]}}),T.isAdmin?h.jsxs("div",{className:"member-owner-actions",children:[h.jsx(Pr,{children:m.formatMessage({id:`${g}_owner`})}),(f==null?void 0:f.remove)&&h.jsx("button",{type:"button",className:"member-owner-actions-button","aria-label":"Remove owner",disabled:!T.id,onClick:async C=>{C==null||C.preventDefault(),C==null||C.stopPropagation(),await f.remove(T.id)},children:"×"})]}):(f==null?void 0:f.create)&&h.jsx("div",{className:"member-owner-actions",children:h.jsx("button",{type:"button",className:"member-owner-actions-button","aria-label":"Add owner",disabled:!T.id,onClick:async C=>{C==null||C.preventDefault(),C==null||C.stopPropagation(),await f.create(T.id)},children:"+"})})]},_)),c&&e.length===0&&t>0?[...new Array(Math.min(t,Q3))].map((T,_)=>h.jsx("li",{children:h.jsx(t1,{layout:"member"})},_)):h.jsx(h.Fragment,{})]}),i&&h.jsx(wl,{hasNextPage:i,loadNextPage:a,icon:{icon:"arrow-down",position:"right"},messages:{button:m.formatMessage({id:"loadMore_button"}),error:m.formatMessage({id:"loadMore_error"})},gtmContext:o}),s?h.jsx(H1,{form:s,showModal:y,content:{title:m.formatMessage({id:`${g}_modal_title`})},functions:{onClose:()=>{v(!1)}}}):h.jsx(h.Fragment,{})]})},X3=uie,cie=({intlPath:e,showGuidelines:t,type:n,gtmContext:r})=>{const i=le.useIntl();return t?h.jsx("small",{children:wr(i.formatMessage,`${e}explainer`,n,"action",{a:a=>h.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":r,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:a})})}):h.jsx(h.Fragment,{})},die=({intlPath:e,type:t,...n})=>{const r=le.useIntl();return h.jsx(Pc,{label:{visible:r.formatMessage({id:`${e}label`}),screenreader:wr(r.formatMessage,`${e}label_action`,t,"action")},...n})},c4=5,d4=2,fie=(e,t)=>{var i;let n=0;const r=[];return(i=e==null?void 0:e["poll-options"])==null||i.forEach((a,s)=>{a!==""&&(n++,r.push({position:n,body:a,locale:t}))}),{title:e.title,locale:t,options:r,settings:{allow_multiple_votes:e["multiple-answers"]||!1}}};const _t="discussion_form_",Ll=({id:e,parentId:t,content:n={type:ze.Response,slugs:{}},userHasPermissions:r=!0,meta:i,placeholder:a,maxLength:s=0,buttons:o,forceShow:l={cancel:!1,error:!1},functions:u,data:c={},gtmContext:d="DiscussionForm"})=>{var Oe,qe,gt;const f=le.useIntl(),m=E.useContext(Pt),g=Ra(),[p,y]=E.useState(n.type),[v,T]=E.useState(!1),[_,C]=E.useState(!1),[w,x]=E.useState(""),{isLoading:S=!1,isInWrapper:N=!1,isInOverlay:B=!1,isAutoFocused:$=!1,isEditing:F=!1,hasTitleField:L=!1,canBePrepopulated:O=!1,isPrepopulated:P=!1,showTitle:M=!1,showGuidelines:U=!0,showDivider:D=!1,showSuccessMessage:X=!0,showPostType:Z=!1,postCategories:k=[],allowAnonymousPosts:b=!1}=i||{},{onChange:q=()=>{},create:R=()=>{},createPoll:j=()=>Promise,handleSaveEdit:H=()=>{},handleCancel:z=()=>{},callback:Y=()=>{},onMention:re=()=>{},listMembers:Q=()=>Promise.resolve([]),clickMentionFallback:G=()=>{},getLinkPreview:se=()=>Promise.resolve({}),props:ae={create:{projectNames:["questions-answers"]}}}=u,[be,Ce]=E.useState({body:F&&F.text||P&&P.text||"",data:c!=null&&c.link?{link:c==null?void 0:c.link}:{}}),[Pe,je]=E.useState(l.error||!1),Fe={status:!1,title:L&&L.text||"",polls:0},[Be,Qe]=E.useState(Fe);E.useEffect(()=>{O&&!F&&P&&P!==be.body&&Ce(Ee=>({...Ee,body:P.text||""}))},[P]),E.useEffect(()=>{y(n.type)},[n.type]);const tt=il((Ee,Le)=>{Ce($e=>({...$e,body:Ee,data:{link:Le}})),q({body:Ee});let He;!m||!m.id?He=wr(f.formatMessage,`${_t}error_loggedOut`,p,"action"):r?s>0&&Ee.length>=s&&(He=`${_t}error_tooLong`):He=wr(f.formatMessage,`${_t}error_noPermission`,p,"action"),He?je(He):Pe&&je(!1)},50);let Xe=`${p}-form`;if(p===ze.Response||p===ze.Reply){const Ee=((Oe=n.slugs)==null?void 0:Oe.reply)||((qe=n.slugs)==null?void 0:qe.answer)||((gt=n.slugs)==null?void 0:gt.question)||"";Ee&&(Xe=`${Xe}-${Ee.slice(-15)}`)}e&&(Xe=`${e}-${Xe}`);const me=async Ee=>{if(!m||!m.id||!r||Ae)throw new Error("You do not have permission to post.");Qe(He=>({...He,status:"submitting"}));const Le=window.location.pathname;try{let He;switch(p){case ze.Post:He=await R({title:Ee.title,content:Ee.body,categories:Ee.postType,locale:g,data:Ee.data,is_anonymous:v});break;case ze.Poll:He=await j(fie(Ee,g));break;case ze.Question:He=await R({title:Ee.body,authorId:m&&m.id,data:Ee.data,is_anonymous:v,...ae==null?void 0:ae.create});break;case ze.Response:He=await R({questionSlug:n.slugs.question},{body:Ee.body,authorId:m&&m.id,contentPath:Le,data:Ee.data,is_anonymous:v});break;case ze.Reply:He=await R({questionSlug:n.slugs.question,answerSlug:n.slugs.answer},{body:Ee.body,authorId:m&&m.id,contentPath:Le,data:Ee.data,is_anonymous:v});break;default:break}await rg(1e3),Y&&await Y(He),Ce({body:"",data:{}}),y(n.type),Qe(Nt=>({...Nt,status:"submitted"})),x(wr(f.formatMessage,`${_t}success`,p,"action"));const $e=new Event(Ut.DISCUSSION_FORM_SUBMITTED);return document.dispatchEvent($e),await de(),He}catch(He){const $e=He;let Nt=`${_t}error`;$e!=null&&$e.message.includes("entry already exists")&&(Nt=wr(f.formatMessage,`${_t}error_alreadyExists`,p,"action")),$e!=null&&$e.message.includes("429")?Nt=wr(f.formatMessage,`${_t}error_tooMany`,p,"action"):$e!=null&&$e.message.includes("400")&&(Nt=`${_t}error`),je(Nt),await de()}},de=async()=>{await rg(5e3),je(!1),Qe(Fe),x("")},Te=il(async Ee=>{const Le={...be,...Ee};if(F){Qe(He=>({...He,status:"submitting"})),H(Le);return}try{if(!await me(Le))throw Error("No response from handleSubmit")}catch{}},100);if(S)return h.jsx(Jn,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const ee=!be.body||!sl(be.body),fe=!Be.title||!sl(Be.title);let Ae=!1;p!==ze.Poll&&(Ae=ee),L&&(Ae=Ae&&fe);const Se=Be.status==="submitting",J=[];p===ze.Poll?J.push({id:"poll-options",label:f.formatMessage({id:`${_t}option_label`}),type:"multiple-inputs",element:"textarea",placeholder:f.formatMessage({id:`${_t}option_placeholder`}),limit:100,multipleInputs:{showCount:!0,defaultInputs:d4,maxInputs:c4,hasButton:{variant:"secondary",size:"small",styling:{muted:!0},icon:"plus",children:f.formatMessage({id:`${_t}option_cta`})}},styling:{autosizeToFit:!0},functions:{onChange:Ee=>{var He;let Le=0;Ee&&Array.isArray(Ee)&&(Le=((He=Ee==null?void 0:Ee.filter($e=>$e!==""))==null?void 0:He.length)||0),Be.polls!==Le&&Qe($e=>({...$e,polls:Le})),q({polls:Ee})}},validation:[{condition:"required"}]},{type:"checkbox",id:"multiple-answers",label:f.formatMessage({id:`${_t}multiplePollAnswers`}),className:"text-medium"}):J.push({component:die,props:{formID:Xe,intlPath:_t,showLabel:L!==!1,type:p}},{component:mp,props:{id:`${Xe}-input`,value:Be.status==="submitting"&&!Pe?"":be.body,placeholder:a||wr(f.formatMessage,`${_t}placeholder`,p,"action"),maxLength:s,meta:{isInOverlay:B},functions:{onChange:tt,onChangeData:Ee=>{Ce(Le=>({...Le,data:Ee}))},onMention:re,listMembers:Q,clickMentionFallback:G,getLinkPreview:se},data:c,autoFocus:F!==!1||$&&!L,"aria-invalid":!!Pe,"aria-errormessage":"error-message"}},{component:cie,props:{intlPath:_t,showGuidelines:U,type:p,gtmContext:d}}),D&&J.push({component:pr}),L&&J.unshift({id:"title",type:"textarea",value:L.text,limit:250,label:f.formatMessage({id:`${_t}${p===ze.Poll?"question":"titleField"}_label`}),styling:{autosizeToFit:!0},placeholder:f.formatMessage({id:`${_t}${p===ze.Poll?"question":"titleField"}_placeholder`}),functions:{onChange:Ee=>{Qe(Le=>({...Le,title:Ee})),q({title:Ee})}},validation:p===ze.Poll?[{condition:"required"}]:[]}),Z&&J.unshift({id:"postType",type:"radio",value:"no-category",accessibilityOptions:{checkboxes:{navigateWithArrowKeys:!0}},styling:{displayOptionsAsPills:!0},label:f.formatMessage({id:`${_t}postType_label`}),options:k.map(Ee=>({id:Ee.slug,label:Ee.name})).filter(Ee=>!v||!Ee.id.includes("poll")),validation:[{condition:"required"}],functions:{onChange:Ee=>{q({postType:Ee}),Ee.includes(ze.Poll)?y(ze.Poll):p!==ze.Post&&y(ze.Post)}}});let ve=!m||!m.id||!r||Se;if(p===ze.Poll){const Ee=Be.polls;ve=ve||fe||Ee<d4||Ee>c4}else ve=ve||Ae,F&&(L?ve=ve||be.body===F.text&&Be.title===L.text:ve=ve||be.body===F.text);return h.jsxs(h.Fragment,{children:[h.jsxs(vr,{id:Xe,className:te("discussion-card discussion-form",{"no-styling":N&&F}),meta:{shouldReset:!0,shouldHide:!1,showRequiredLabels:!1,shouldShowCancelButton:F&&!Se||l.cancel},functions:{onSuccess:async Ee=>{await Te(Ee)},onCancel:z},fields:J,intlPath:_t,button:{variant:"primary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":d,"data-gtm-event-type":`${F?"save":"submit"}-${p}-click`,"data-testid":"save-button",disabled:ve,text:{default:!F&&(o!=null&&o.submit)?o==null?void 0:o.submit:f.formatMessage({id:`${_t}${F?"save":"post"}`}),submitting:f.formatMessage({id:`${_t}${F?"saving":"posting"}`})}},secondaryActionButton:{variant:"secondary",size:{mobile:"small",600:"medium"},"data-gtm-event-context":d,"data-gtm-event-type":`cancel-${p}-click`,disabled:!l.cancel&&(!m||!m.id||!be.body),text:o!=null&&o.cancel?o==null?void 0:o.cancel:f.formatMessage({id:`${_t}cancel`})},gtm:{context:d,event:`${p}-form`},"data-testid":`discussion-${p}-form`,children:[M&&!F&&p===ze.Question&&h.jsx("h2",{children:wr(f.formatMessage,`${_t}title`,p,"action")}),b&&h.jsxs("div",{className:"toggle-wrapper",children:[h.jsxs("div",{className:"label",children:[f.formatMessage({id:`${_t}isAnonymous_label`}),h.jsx("span",{onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:h.jsx(pi,{isOpen:_,styling:{hasPointer:"bottom"},className:"positioned-tooltip",children:f.formatMessage({id:`${_t}isAnonymous_tooltip_content`})})})]}),h.jsx(n_,{label:"",options:[{label:"False",value:!1},{label:"True",value:!0}],initialValue:v,isDisabled:p===ze.Poll,functions:{onChange:Ee=>T(Ee===!0)}})]}),h.jsx(li,{member:v?{name:f.formatMessage({id:"member_anonymous"}),jobTitle:f.formatMessage({id:`${_t}member_anonymous_infoMsg`}),image:{thumbnail:`${Yn}logos/member_anonymous.png`},link:!1}:m?{...m,link:!1}:"community",gtmContext:d,gtmType:"profile-click",badges:{showBadges:!0,scopes:[{scope:nn.Communities,area:t||""},{scope:nn.Platform,area:"all"}]}})]}),Be.status==="submitted"&&X&&h.jsx(ks,{className:"success","data-testid":"success",children:wr(f.formatMessage,`${_t}success`,p,"action")}),Pe&&h.jsx(ks,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof Pe=="string"?Pe.includes(" ")?Pe:f.formatMessage({id:Pe},{action:f.formatMessage({id:`discussion_action_${p}`}),maxLength:s}):Pe}),w&&h.jsx(ot,{"aria-live":"polite",showOnFocus:!1,children:w})]})},hie=Object.freeze(Object.defineProperty({__proto__:null,default:Ll},Symbol.toStringTag,{value:"Module"}));function J3(e,t){let n=t;const r=e.matchAll(Aa),i=e.matchAll(/\[([^\]]+)\]\(([^)]+)\)/g);for(const a of[r,i])for(const s of a)if(s.index!==void 0){if(s.index>=n)break;if(s.index+s[0].length<=n)continue;n=s.index}return e.length>n?e.slice(0,n).trim()+"…":e}const ex=280,mie=(e,t,n)=>{let r=t?J3(e,typeof t=="number"?t:ex):e;return r=r.trim(),r=r.replaceAll(Aa,(i,a)=>{var s,o;return`[@${((o=(s=n==null?void 0:n[a])==null?void 0:s.data)==null?void 0:o.name)||a}](/profiles/${a})`}),r},I0=async(e,t,n,r=()=>Promise.resolve([]))=>{let i=t?J3(e,typeof t=="number"?t:ex):e;i=i.trim();const a=`<br>
569
569
 
570
570
  `;return i.slice(0,a.length)===a&&(i=i.slice(a.length)),n?await N4({text:i,template:"[@{{name}}](/profiles/{{id}})",mentions:n,listMembers:r}):i},tx=(e,t)=>t.length===0||e.length===0?[]:e.map(n=>t.find(r=>r.slug===n)).filter(n=>n!==void 0),pie=(e,t,n)=>{let r=!1;function i(a){let s=30;for(;a||s<=0;){if(t.some(o=>Array.from(a==null?void 0:a.classList).includes(o))){r=!0;break}if(Array.from(a==null?void 0:a.classList).includes(n))break;a=a.parentElement,s--}}return i(e.target),r},gie=(e,t)=>e?typeof e=="string"?e:e[t]:"";const vie={showForm:!1},j1=E.createContext(vie),nx=({children:e})=>{const[t,n]=E.useState({showForm:!1});return h.jsx(j1.Provider,{value:{...t,updateConversation:n},children:e})};function yie({author:e,originalAuthorId:t,createdAt:n,contentData:r,content:i,gtmContext:a,badges:s}){var d;const o="discussion_",l=le.useIntl(),u=(d=i==null?void 0:i.componentProps)==null?void 0:d.member.additionalContent,c=u?u.customMessage:void 0;return h.jsxs("div",{className:"author-section",children:[h.jsx(li,{member:e,additionalContent:{createdAt:n,didEdit:r.didEdit,customMessage:c},className:te({highlighted:typeof e!="string"&&e.id===t}),styling:{additionalContentNewLine:!!c},gtmContext:a,gtmType:"profile-click",badges:s}),i.pinned&&h.jsx(Pr,{variant:"naked",size:"xlarge",icon:"pin",children:h.jsx(ot,{children:l.formatMessage({id:`${o}pinned_post`})})})]})}const eh=({children:e,class:t,...n})=>{const r={...n,class:te("subtle",t)};return h.jsx("blockquote",{...r,children:e})};function Eie({content:e}){var t;return!e||!((t=e.categories)!=null&&t.length)?h.jsx(h.Fragment,{}):h.jsx("ul",{className:"categories-list",children:e.categories.map(n=>!n.slug||!n.name?h.jsx(h.Fragment,{}):h.jsx(Pr,{size:"small",element:"li",children:n.name},n.slug))})}var P0=(e=>(e.Always="always",e.AfterVoting="after-voting",e))(P0||{});const bie=(e,t,n)=>n===void 0?0:e.some(i=>i.hasUserVoted)?t?e.findIndex(i=>!i.hasUserVoted):e.findIndex(i=>i.hasUserVoted):0,Tie=(e,t,n,r=0)=>{if(!e)return{nextElement:null,nextIndex:0};let i=n==="next"?e.nextElementSibling:e.previousElementSibling,a=r+(n==="next"?1:-1);for(;i;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}const s=e.parentElement;if(s)for(i=n==="next"?s.firstElementChild:s.lastElementChild,a=n==="next"?0:s.childElementCount-1;i&&i!==e;){if(!i.classList.contains(t))return{nextElement:i,nextIndex:a};i=n==="next"?i.nextElementSibling:i.previousElementSibling,a=a+(n==="next"?1:-1)}return{nextElement:null,nextIndex:0}};const _ie=({user:e,option:t,optionIndex:n,totalPollVotes:r=0,allowMultipleVotes:i=!1,showResults:a=!1,hasVotedOnPoll:s=!1,isTabbable:o=!1,functions:l})=>{var y;const[u,c]=E.useState(t.hasUserVoted);let d=0,f={};const m=(i||!s)&&!t.hasUserVoted;a&&(d=Math.round(t.numVotes/r*100)||0,f={"--vote-perc":`${d}%`});const g=v=>{v.stopPropagation(),m&&(l==null||l.createVote(t),c(!0))},p={htmlFor:t.id,className:te({"can-vote":m}),tabIndex:o&&m?0:-1,"data-testid":"poll-option-label","data-gtm-event-type":"poll-option-click","data-gtm-event-context":"PollOption","aria-selected":t.hasUserVoted,onClick:g,onKeyDown:v=>{var T;if(v.code!=="Tab")switch(v.code){case"Enter":case"Space":v.preventDefault(),v.stopPropagation(),g(v),c(!0);break;case"ArrowUp":case"ArrowDown":v.stopPropagation(),v.preventDefault();const _=v.code==="ArrowUp"?"prev":"next",{nextElement:C,nextIndex:w}=Tie(v.currentTarget.parentElement,"selected",_,n);C&&((T=C.querySelector("label"))==null||T.focus(),l==null||l.setTabbableOption(w));break}}};return h.jsxs("li",{"data-testid":"poll-option",style:f,className:te("poll-option text-small",{selected:t.hasUserVoted}),children:[h.jsx("label",{...p,children:h.jsx("span",{children:t.label})}),a&&h.jsxs("div",{className:"vote-details",children:[t.hasUserVoted&&h.jsx(gi,{className:"author-profile-picture",name:e.name,src:(y=e==null?void 0:e.image)==null?void 0:y.thumbnail}),h.jsxs("p",{className:"vote-perc text-medium","data-testid":"vote-perc",children:[d,"%"]})]}),h.jsx("input",{type:i?"radio":"checkbox",id:t.id,name:t.id,checked:u,tabIndex:-1})]})};const rx=({title:e,options:t,settings:n,functions:r})=>{const i="poll_",a=le.useIntl(),s=E.useContext(Pt),{showRemoveVote:o=!1,allowMultipleVotes:l=!1,resultsVisibility:u=P0.AfterVoting}=n||{},[c,d]=E.useState(bie(t,l,s==null?void 0:s.id)),f=t.reduce((v,T)=>v+T.numVotes,0),m=t.filter(v=>v.hasUserVoted).length,g=t.filter(v=>v.hasUserVoted),p=E.useCallback(async v=>{await r.createVote({reactionId:v.id})},[]),y=E.useCallback(async()=>{t.forEach(async v=>{v.hasUserVoted&&v.userVote&&r.removeVote({reactionId:v.userVote.id})})},[t]);return h.jsxs("div",{className:"poll-wrapper",children:[h.jsx("p",{className:"poll-title",children:e}),h.jsxs("aside",{className:"poll-info",children:[h.jsx("p",{className:"poll-instructions","data-testid":"poll-instructions",children:h.jsx("small",{children:a.formatMessage({id:`${i}instructions`},{allowMultipleVotes:l})})}),h.jsx("p",{className:"poll-num-votes",children:h.jsx("small",{"data-testid":"poll-total-votes",children:a.formatMessage({id:`${i}num_votes`},{number:f})})}),o&&h.jsx("p",{className:"poll-remove-vote",children:h.jsx(Ie,{variant:"tertiary",onClick:y,"data-testid":"remove-votes-button",disabled:m===0,children:h.jsx("small",{children:a.formatMessage({id:`${i}remove_vote_button`},{number:m})})})})]}),t&&h.jsx("form",{children:h.jsx("fieldset",{children:h.jsx("ul",{className:"poll-options",children:t==null?void 0:t.map((v,T)=>h.jsx(_ie,{isTabbable:c===T,user:s,option:v,optionIndex:T,totalPollVotes:f,showResults:u==wa.EResultsVisibility.Always||!!m,allowMultipleVotes:l,hasVotedOnPoll:!!m,functions:{createVote:p,setTabbableOption:d}},v.id))})})}),h.jsxs(ot,{"aria-live":"polite",children:[a.formatMessage({id:`${i}aria_votes`},{number:m}),!!m&&h.jsx("ul",{children:g.map(v=>h.jsx("li",{children:v.label}))})]})]})};function Cie({content:e,contentData:t,functions:n}){return h.jsx(rx,{title:t.title,options:(e==null?void 0:e.pollOptions)||[],settings:(e==null?void 0:e.pollSettings)||{},functions:{createVote:n.createVote,removeVote:n.removeVote}})}function xie({links:e={},contentData:t,postCutOff:n,content:r,gtmContext:i}){var a;return h.jsxs(h.Fragment,{children:[e.post?h.jsxs("a",{href:e.post,className:"gtm-trackable gtm-visible","data-gtm-event-type":`discussion-${r.type}`,"data-gtm-event-context":i,children:[(t==null?void 0:t.title)&&h.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),t.postBody.length>n?h.jsx(M4,{text:t.postBody,markdownOptions:{overrides:{a:uh,blockquote:{component:eh}}}}):h.jsx(Sa,{options:{overrides:{a:uh,blockquote:{component:eh}}},children:t.postBody})]}):h.jsxs(h.Fragment,{children:[(t==null?void 0:t.title)&&h.jsx("p",{className:"content-title",children:t==null?void 0:t.title}),h.jsx(Sa,{options:{wrapper:r.type===ze.Question?"h1":E.Fragment,forceWrapper:r.type===ze.Question,forceInline:r.type===ze.Question,forceBlock:r.type!==ze.Question,overrides:{blockquote:{component:eh}}},children:t.postBody})]}),(a=t.data)!=null&&a.link?h.jsx(gp,{data:t.data.link}):h.jsx(h.Fragment,{})]})}const ur="discussion_",wie=195;let qu=null;const $l=({element:e="div",content:t,userHasPermissions:n=!0,userHasOwnerPermissions:r=!1,isLoading:i=!1,originalAuthorId:a,forceHide:s,functions:o,links:l={},className:u,gtmContext:c="DiscussionAnswer",children:d,isTruncated:f=!1,setFocus:m=!1,isCommunity:g=!1,badges:p,basePath:y,parentId:v,disableMentions:T,onClick:_,translation:C,hideReply:w=!1,discussionType:x})=>{var $0,j0,H0,U0,z0,q0,W0;const S=le.useIntl(),N=Ra(),B=E.useContext(j1),$=E.useContext(Pt),F=us("ugc-translation"),L=us("ugc-translation-comments"),O=us("community-owners-post-delete"),P=us("course-discussion-admin-delete"),M=x===Ft.Courses,U=t.type===ze.Reply?L:F,[D,X]=E.useState({isTranslating:!1,isTranslated:!1,isTranslatedError:!1}),{isTranslating:Z,isTranslated:k,isTranslatedError:b}=D,[q,R]=E.useState(!1),[j,H]=E.useState(!1),{createContent:z=async()=>{},deleteContent:Y=async()=>{},updateContent:re=async()=>{}}=o.content||{},{createLike:Q=()=>{},deleteLike:G=()=>{},listLikes:se=async()=>({})}=o.likes||{},{openComments:ae=()=>{}}=o.comments||{},{listMembers:be=()=>Promise.resolve([]),clickMentionFallback:Ce=()=>{}}=o.form||{},{createVote:Pe=()=>{},removeVote:je=()=>{},removePoll:Fe=()=>{}}=o.polls||{},{author:Be,createdAt:Qe,id:tt,likes:Xe=0,userLiked:me,comments:de=0,data:Te,deanonymisedAuthorId:ee}=t,fe=gie(t.title,N),Ae=$&&$.id&&typeof Be!="string"&&Be.id&&Be.id===$.id||Be==="anonymous"&&$&&$.id&&$.id===ee||!1,Se=Ae&&(!t.createdAt||Dx(t.createdAt,10,"seconds")),J=E.useRef(null),[ve,Oe]=E.useState({title:t.body!==fe&&fe||"",body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1,postBody:t&&t.body?mie(t.body,f,($0=t.data)==null?void 0:$0.mentions):"",data:t&&t.data||{}}),[qe,gt]=E.useState(!1),[Ee,Le]=E.useState(Se?"highlighted":"default"),[He,$e]=E.useState("");E.useEffect(()=>{const Ve=J.current;if(!(!Ve||Ee==="default"))return document.addEventListener(Ut.DISCUSSION_FORM_SUBMITTED,Nt),Ve.addEventListener("transitionend",vt),()=>{document.removeEventListener(Ut.DISCUSSION_FORM_SUBMITTED,Nt),Ve.removeEventListener("transitionend",vt)}},[]),E.useEffect(()=>{Oe(Ve=>({...Ve,title:t&&fe||"",body:t&&t.body||"",didEdit:t&&t.isEdited||!1,data:t&&t.data||{}}))},[t.isEdited]),E.useEffect(()=>{(async()=>{const nt=await I0(ve.body,f,Te==null?void 0:Te.mentions,be);Oe(kt=>({...kt,postBody:nt}))})()},[ve.body,Te==null?void 0:Te.mentions]);const Nt=()=>{setTimeout(()=>{Le("fading")},1e3)},vt=({propertyName:Ve})=>{Ve==="background-color"&&Le(nt=>(nt==="default"&&(document.removeEventListener(Ut.DISCUSSION_FORM_SUBMITTED,Nt),J.current&&J.current.removeEventListener("transitionend",vt)),nt==="fading"?"default":nt))};if(i||!t||t.type===ze.Answer&&(!t.slugs||!t.slugs.question)||ve.postBody===""&&t.title==="")return h.jsx(Jn,{className:"discussion-card"});const Wr=async({title:Ve,body:nt,data:kt})=>{Ve||(Ve=""),nt||(nt=""),$e("");try{if(!vc(Ve,ve.title)||!vc(nt,ve.body)){const Kt=t.type===ze.Question?{title:nt}:{title:Ve,body:nt,data:kt};await re(mh(t.slugs),Kt)}Oe(Kt=>({...Kt,title:Ve||"",body:nt||"",data:{...Kt.data,...kt},isEditing:!1,didEdit:!0}))}catch{$e(`${ur}form_error`)}},na=()=>{if(B&&B.updateConversation){const Ve={showForm:!0},nt=t.author;nt&&nt.id&&!T&&(g&&(Ve.prepopulateForm=`@{{${nt.id}}}`),Ve.mentionData={id:nt.id,name:nt.name}),B.updateConversation(Ve)}setTimeout(()=>{var sr,or,eo;const nt=`reply-form-${(t.type===ze.Answer?t.slug:((sr=t.slugs)==null?void 0:sr.reply)||((or=t.slugs)==null?void 0:or.answer)||((eo=t.slugs)==null?void 0:eo.question)||"").toLowerCase().slice(-15)}`,kt=document.getElementById(nt),Kt=document.getElementById(`${nt}-input`);Kt&&Kt.focus(),kt&&kt.scrollIntoView({behavior:"smooth"})},0)},fx=async()=>{gt(!1);try{t.type===ze.Poll?(await Fe(),_?_(`${y}/${v}`):window.location.href=`${y}/${v}`):await Y(mh(t.slugs))}catch{$e("delete-error")}},M0=async Ve=>{if(Ve.preventDefault(),Ve.stopPropagation(),C!=null&&C.onTranslate){try{X(kt=>({...kt,isTranslating:!0}));const nt=await(C==null?void 0:C.onTranslate({activityId:tt||"",locale:N,payloadId:t.payloadId||"",payloadCollection:t.payloadCollection||""}));X(kt=>({...kt,isTranslated:!0,isTranslating:!1,isTranslatedError:!1})),H(!1),Oe(kt=>({...kt,body:nt.body,title:nt.title})),t.data.translationInfo.currentBody=nt.body,t.data.translationInfo.currentTitle=nt.title}catch{X(kt=>({...kt,isTranslating:!1,isTranslatedError:!0}))}H(!1)}},L0=Ve=>{Ve.preventDefault(),Ve.stopPropagation(),j?(H(!1),Oe(nt=>{var kt,Kt,sr,or;return{...nt,body:((Kt=(kt=t.data)==null?void 0:kt.translationInfo)==null?void 0:Kt.currentBody)||"",title:((or=(sr=t.data)==null?void 0:sr.translationInfo)==null?void 0:or.currentTitle)||""}})):(H(!0),Oe(nt=>{var kt,Kt,sr,or;return{...nt,body:((Kt=(kt=t.data)==null?void 0:kt.translationInfo)==null?void 0:Kt.originalBody)||"",title:((or=(sr=t.data)==null?void 0:sr.translationInfo)==null?void 0:or.originalTitle)||""}}))},jl=[];return n&&Ae&&t.type!==ze.Poll&&jl.push({text:S.formatMessage({id:`${ur}moreMenu_edit`}),onClick:()=>Oe(Ve=>({...Ve,isEditing:!0})),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`edit-${t.type}-click`}),(n&&Ae||O&&r&&!M||P&&M)&&jl.push({text:S.formatMessage({id:`${ur}moreMenu_delete`}),onClick:Ve=>{Ve.preventDefault(),Ve.stopPropagation(),gt(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`delete-${t.type}-click`,...fb(`delete-${t.slug}-modal`,qe)}),r&&o.pins&&jl.push({text:S.formatMessage({id:`${ur}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":c,"data-gtm-event-type":`edit-${t.type}-click`}),m&&((j0=J==null?void 0:J.current)==null||j0.focus(),(H0=J==null?void 0:J.current)==null||H0.scrollIntoView({behavior:"smooth"})),E.createElement(e,{className:te("discussion-post",u,{[Ee]:!u||!u.includes("highlighted-text-box"),"has-link":l.post&&!ve.isEditing,"is-pinned":(t==null?void 0:t.pinned)||!1}),ref:J,tabIndex:m?0:null,"data-testid":`discussion-${t.type}-thread`,"data-gtm-event-context":`${c}-post-click`,onClick:Ve=>{if(!l.post||ve.isEditing||t.type===ze.Poll&&pie(Ve,["poll-options","poll-info"],"discussion-post"))return;Ve.preventDefault(),Ve.stopPropagation(),qu&&clearTimeout(qu),qu=setTimeout(()=>{_?_(l.post):window.location.href=l.post},150);const nt=new CustomEvent(Ut.DISCUSSION_POST_CLICKED,{detail:{link:l.post,timeout:qu}});document.dispatchEvent(nt)},children:h.jsxs(h.Fragment,{children:[h.jsxs("div",{id:tt||t.slug,className:te("discussion-card text-medium",t.type,{editing:ve.isEditing,"has-link":l.post&&!ve.isEditing}),children:[!ve.isEditing&&h.jsx(yie,{author:Be,originalAuthorId:a,createdAt:Qe,contentData:{didEdit:ve.didEdit},content:t,gtmContext:c,badges:p}),ve.isEditing?h.jsx(Ll,{id:`editing-${t.slug}`,content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:i,isInWrapper:!0,hasTitleField:ve.title!==""?{text:ve.title}:!1,isEditing:{text:ve.body,categories:[]},canBePrepopulated:g,isPrepopulated:!1},maxLength:t.type===ze.Question?250:5e4,forceShow:{error:He!==""&&He!=="delete-error"?S.formatMessage({id:He},{action:S.formatMessage({id:`${ur}action_${t.type}`})}):!1},functions:{create:z,handleSaveEdit:Wr,handleCancel:()=>{$e(""),Oe(Ve=>({...Ve,isEditing:!1}))},listMembers:be,clickMentionFallback:Ce},gtmContext:`${c}Form`,data:Te}):h.jsxs(h.Fragment,{children:[t.type===ze.Poll?h.jsx(Cie,{content:t,contentData:ve,functions:{createVote:Pe,removeVote:je}}):h.jsx(xie,{links:l,contentData:ve,postCutOff:wie,content:t,gtmContext:c}),(C==null?void 0:C.isTranslatable)&&(()=>{var Ve,nt,kt,Kt,sr,or,eo,V0,K0,G0,Y0,Z0,Q0,X0,J0,eg;return t.type===ze.Poll||((nt=(Ve=t.data)==null?void 0:Ve.translationInfo)==null?void 0:nt.originalLocale)===N?null:!U&&!((Kt=(kt=t.data)==null?void 0:kt.translationInfo)!=null&&Kt.hasTranslation)&&!((or=(sr=t.data)==null?void 0:sr.translationInfo)!=null&&or.isOriginalPost)?h.jsxs("div",{className:"translation-tooltip-wrapper",children:[h.jsx("div",{className:"translation-info",onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:h.jsx("a",{children:h.jsx(le.FormattedMessage,{id:"discussion_translation_translate",values:{locale:S.formatMessage({id:`language_${N}`})}})})}),h.jsx(pi,{isOpen:q,callbacks:{onOpen:()=>R(!0),onClose:()=>R(!1)},styling:{extraPadding:!1,hasPointer:"top"},children:S.formatMessage({id:"discussion_translation_coming_soon"})})]}):U&&((V0=(eo=t.data)==null?void 0:eo.translationInfo)!=null&&V0.isOriginalPost)&&!((G0=(K0=t.data)==null?void 0:K0.translationInfo)!=null&&G0.hasTranslation)&&!k?null:U?Z?h.jsx("div",{className:"translation-info is-translating",children:h.jsx("p",{className:"translation-loading",children:h.jsx(le.FormattedMessage,{id:"discussion_translation_translate_loading",values:{locale:S.formatMessage({id:`language_${N}`})}})})}):h.jsx("div",{className:"translation-info",children:(Z0=(Y0=t.data)==null?void 0:Y0.translationInfo)!=null&&Z0.hasTranslation||k?h.jsx("p",{children:j?h.jsx("a",{onClick:L0,children:h.jsx(le.FormattedMessage,{id:"discussion_translation_translate",values:{locale:S.formatMessage({id:`language_${N}`})}})}):h.jsxs(h.Fragment,{children:[h.jsx(le.FormattedMessage,{id:"discussion_translation_translated",values:{originalLocale:S.formatMessage({id:`language_${(X0=(Q0=t.data)==null?void 0:Q0.translationInfo)==null?void 0:X0.originalLocale}`})}})," ",h.jsx("a",{onClick:L0,children:S.formatMessage({id:"discussion_translation_seeOriginal"})})]})}):h.jsx("p",{children:b?h.jsxs(h.Fragment,{children:[h.jsx(le.FormattedMessage,{id:"discussion_translation_translate_error"})," ",h.jsx("a",{onClick:M0,children:h.jsx(le.FormattedMessage,{id:"discussion_translation_translate",values:{locale:S.formatMessage({id:`language_${N}`})}})})]}):h.jsx("a",{onClick:M0,className:"gtm-trackable","data-gtm-event-type":"translate-ugc","data-gtm-event-context":`${c}-${(eg=(J0=t.data)==null?void 0:J0.translationInfo)==null?void 0:eg.originalLocale}-${N}`,children:h.jsx(le.FormattedMessage,{id:"discussion_translation_translate",values:{locale:S.formatMessage({id:`language_${N}`})}})})})}):null})(),h.jsx(Eie,{content:t})]}),!ve.isEditing&&!(s!=null&&s.actionBar)&&h.jsx(h_,{className:t.type,gtmContext:c,contentType:t.type,likes:s!=null&&s.likes?!1:{count:Xe||0,userLiked:me||!1,canLike:n??!0,peopleWhoLiked:t.peopleWhoLiked,activityId:t.id||t.slug,content:{slugs:t.slugs||{},slug:t.slug},functions:{createLike:Q,deleteLike:G,listLikes:se},basePath:y,parentId:v},comments:!(s!=null&&s.comments)&&([ze.Question,ze.Post].includes(t.type)||l.comments)?{count:de||0,functions:{onClick:()=>{l!=null&&l.comments&&(_?_(l.comments):window.location.href=l.comments),typeof ae=="function"&&ae()}}}:!1,replies:!w&&(t.type==="answer"||t.type==="reply")?{canReply:n??!0,functions:{onClick:na}}:!1,shareLink:!(s!=null&&s.shareLink)&&{url:`${window.location.origin}${(U0=t.slugs)==null?void 0:U0.question}/${(z0=t.slugs)==null?void 0:z0.answer}${(q0=t.slugs)!=null&&q0.reply?`#${(W0=t.slugs)==null?void 0:W0.reply}`:""}`},moreMenu:!(s!=null&&s.moreMenu)&&{options:jl,contentSlug:t.slug,reportData:{contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}}})]}),d,h.jsx(vi,{id:`delete-${t.slug}-modal`,isOpen:qe,functions:{onOpen:()=>{},onClose:()=>gt(!1)},forceShow:{error:He==="delete-error"?S.formatMessage({id:"${intlPath}delete_error"},{action:S.formatMessage({id:`${ur}action_${t.type}`})}):!1},title:S.formatMessage({id:`${ur}delete_title`},{action:S.formatMessage({id:`${ur}action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>gt(!1),children:S.formatMessage({id:`${ur}delete_cancel`})},{variant:"primary",className:"destructive",onClick:fx,children:S.formatMessage({id:`${ur}delete_delete`})}],gtmContext:`${(t.type||"").charAt(0).toUpperCase()}${(t.type||"").slice(1)}:${t.slug}`,children:h.jsx(le.FormattedMessage,{id:"discussion_delete_text",values:{p:Ve=>h.jsx("p",{children:Ve}),action:S.formatMessage({id:`${ur}action_${t.type}`})}})})]})})};const Aie=E.lazy(()=>Promise.resolve().then(()=>$ie)),Sie=65,ix=({forceShow:e,form:t,className:n})=>{const r=le.useIntl(),i="discussionFormCard_",a="DiscardDraftModal",o=E.useContext(Pt)||"community",l=n1(o);l.name||(l.name=r.formatMessage({id:`member_${typeof o=="string"?o:"community"}`}));const u=Wi(!0,!1),c=u?u<768:0,{modal:d=!1}=e||{},[f,m]=E.useState({form:d||Qc("showPost")==="true"||!1,warning:!1}),[g,p]=E.useState({showCachedText:!1});E.useEffect(()=>{if(!g.showCachedText)return;(async()=>{const _=await I0(g.title||g.body||"",Sie,g.mentions);p(C=>({...C,prettifiedText:_}))})()},[g.showCachedText,g.title,g.body]);const y=T=>{if(!g.showCachedText||typeof f.warning=="string")return;let _;if("detail"in T&&T.detail.link)T.detail.timeout&&clearTimeout(T.detail.timeout),_=T.detail.link;else{const C=T;C.preventDefault(),C.stopPropagation();const x=C.target.closest("a");_=x&&x.getAttribute("href")}m(C=>({...C,warning:_||!1}))};E.useEffect(()=>{if(!g.showCachedText){document.removeEventListener(Ut.DISCUSSION_POST_CLICKED,y),document.removeEventListener(Ut.MEMBER_CLICKED,y),document.removeEventListener("click",y);return}return document.addEventListener(Ut.DISCUSSION_POST_CLICKED,y),document.addEventListener(Ut.MEMBER_CLICKED,y),document.addEventListener("click",y),()=>{document.removeEventListener(Ut.DISCUSSION_POST_CLICKED,y),document.removeEventListener(Ut.MEMBER_CLICKED,y),document.removeEventListener("click",y)}},[g.showCachedText]),E.useEffect(()=>{const T=_=>{if(!(!g.showCachedText||f.warning!==!1))return _.preventDefault(),_.returnValue=""};return window.addEventListener("beforeunload",T,{capture:!0}),()=>{window.removeEventListener("beforeunload",T,{capture:!0})}},[g.showCachedText,f.warning]);let v=r.formatMessage({id:`${i}placeholder${c?"":"_long"}`});return g.showCachedText&&(g.title||g.body)&&(v=g.prettifiedText||v),h.jsxs(h.Fragment,{children:[h.jsxs("button",{className:te("discussion-form-card",n),onClick:T=>{T.preventDefault(),T.stopPropagation(),m(_=>({..._,form:!0}))},"data-testid":"discussion-form-card",children:[h.jsx(gi,{name:l.name,src:l.image,alt:""}),h.jsx(Sa,{className:te("input",{placeholder:!g.showCachedText}),element:"span",options:{forceInline:!0,overrides:{a:Hn,blockquote:Hn,br:Hn,em:Hn,li:Hn,ol:Hn,p:Hn,s:Hn,span:Hn,strong:Hn,ul:Hn}},children:v})]}),h.jsxs(Us,{children:[h.jsx(Aie,{showModal:f.form,functions:{cacheText:p,onClose:()=>{m(T=>({...T,form:!1}))}},form:t,cachedText:g,className:"in-portal"}),h.jsx(vi,{id:t.id?`${t.id}-warning`:"discussion-form-card-warning",className:"in-portal",isOpen:f.warning!==!1,functions:{onClose:()=>{m(T=>({...T,warning:!1}))}},title:r.formatMessage({id:`${i}overlay_title`}),buttons:[{variant:"secondary",children:r.formatMessage({id:`${i}overlay_cta_discard`}),onClick:T=>{T.preventDefault(),T.stopPropagation(),typeof f.warning=="string"&&(window.location.href=f.warning)},"data-gtm-event-type":"discard-click","data-gtm-event-context":a},{variant:"primary",children:r.formatMessage({id:`${i}overlay_cta_continue`}),onClick:()=>{m({form:!0,warning:!1})},"data-gtm-event-type":"continue-editing-click","data-gtm-event-context":a}],withFocusTrap:t.withFocusTrap,children:h.jsx("p",{children:r.formatMessage({id:`${i}overlay_text`})})})]})]})},kie=E.lazy(()=>Promise.resolve().then(()=>hie)),R0=({isCard:e=!1,form:t,parentId:n,categories:r,isHidden:i=!1,membershipRequiredToPost:{isMember:a,required:s,join:o,leave:l,notMemberStateText:u},locale:c=Yu})=>{const d=le.useIntl();if(i)return h.jsx(h.Fragment,{});if(s&&!a)return h.jsx(Lr,{text:u,button:{breakpoints:{mobile:!0,901:!1},component:h.jsx(Nm,{isShort:!0,functions:{join:o,leave:l}})}});const{content:f,functions:m,meta:g,...p}=t,y={content:{type:(f==null?void 0:f.type)||"reply",slugs:(f==null?void 0:f.slugs)||{}},functions:{...m,create:(m==null?void 0:m.create)||(()=>{})},parentId:n,meta:{...g,isEditing:(g==null?void 0:g.isEditing)||!1,isPrepopulated:!1,showSuccessMessage:!1,postCategories:[{name:d.formatMessage({id:"discussion_form__postType_no-category",defaultMessage:"Post"}),slug:"no-category"},...r||[]]},...p,id:`add-post-${p.id||""}`};return e?h.jsx(ix,{form:y}):h.jsx(kie,{...y})},F0=({form:e})=>{const t=E.useContext(Pt),n=le.useIntl(),[r,i]=E.useState(!1),a=()=>{Gx(t)||i(!0)};E.useEffect(()=>{if(e&&!(e!=null&&e.isDisabled)||(e==null?void 0:e.isDisabled)===void 0)return document.addEventListener(Ut.DISCUSSION_POST_ADDED,a),()=>{document.removeEventListener(Ut.DISCUSSION_POST_ADDED,a)}});const s={};return["successMessage","title","text"].forEach(o=>{s[o]=n.formatMessage({id:`profileModalLauncher_${o}`})}),h.jsx(H1,{form:e,showModal:r,functions:{onClose:()=>{i(!1)}},content:s})};const f4="discussion_responses_",ax=({type:e="answer",responses:t=0,isLoading:n=!1})=>{const r=le.useIntl();return t=parseInt(t),h.jsx("div",{className:"responses-heading",children:h.jsx("h4",{children:r.formatMessage({id:`${f4}title`},{action:r.formatMessage({id:`${f4}${e}`}),count:t})})})};const sx=({loadMore:{isLoading:e,hasNextPage:t,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:i})=>{const a=le.useIntl(),s=E.useContext(j1),o=Ku(i,{element:"li"});if(s.prepopulateForm&&(r!=null&&r.meta)&&(r.meta.isPrepopulated={text:s.prepopulateForm},s.mentionData)){const l=r.data||{};l.mentions||(l.mentions={});const u=s.mentionData.id||"1";l.mentions[u]={created_at:"",updated_at:"",id:u,data:s.mentionData},r.data=l,r.meta.isAutoFocused=!0}return h.jsxs("div",{className:te("thread-wrapper",{"empty-thread":!o}),children:[!Object.is(o,null)&&h.jsx("ul",{className:"thread",children:o}),!e&&h.jsx(wl,{hasNextPage:t,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:a.formatMessage({id:"discussion_thread_loadMore"}),error:a.formatMessage({id:"loadMore_error"})}}),r&&s.showForm&&h.jsx(Ll,{...r})]})};function Die(e){var n,r;let t=!1;return(r=(n=e.latest_reactions)==null?void 0:n["poll-option"])==null||r.forEach(i=>{var a,s;(s=(a=i.own_children)==null?void 0:a["poll-vote"])!=null&&s.length&&(t=!0)}),t}function Oie({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i,user:a}){const{mutate:s}=ft.useMutation({mutationFn:e,onMutate:({reactionId:o})=>t(l=>(mb({activity:l,reactionId:o,user:a}),l)),onError:n,onSuccess:(o,{reactionId:l},u)=>{u&&pb({activity:u,reactionId:l,correctReactionId:o.body.id,user:a}),r.setQueryData(i,u)}});return s}function Nie({mutationFn:e,mutationHandlers:{mutate:t,error:n}}){const{mutate:r}=ft.useMutation({mutationFn:e,onMutate:({content:i,title:a})=>t(s=>(s&&(i!=null&&(s.content=i),a!=null&&(s.title=a)),s)),onError:n});return r}function Iie({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=ft.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&wc({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&wc({activity:l,reaction:s}),r.setQueryData(i,l)}});return a}function Pie({mutationFn:e,mutationHandlers:{mutate:t,error:n},queryClient:r,queryKey:i}){const{mutate:a}=ft.useMutation({mutationFn:e,onMutate:s=>t(o=>(o&&Ac({activity:o}),o)),onError:n,onSuccess:(s,o,l)=>{l&&Ac({activity:l,reaction:s}),r.setQueryData(i,l)}});return a}function Rie({queryFn:e,queryKey:t}){const{data:n,error:r,isLoading:i,isFetching:a}=ft.useQuery({queryFn:e,queryKey:t});return{activity:n,error:r,isLoading:i,isFetching:a}}function Fie({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=ft.useMutation({mutationFn:e,onMutate:({reactionId:a})=>t(s=>(gb({activity:s,reactionId:a}),s)),onError:n});return i}function ox({queryFns:{read:e,edit:t,like:n,unlike:r,pin:i,unpin:a,createVote:s,removeVote:o,translate:l},queryKey:u}){const c=ft.useQueryClient(),d=e1(),f={queryClient:c,queryKey:u},m={mutationHandlers:{error:Im(f),mutate:Pm(f)},user:d,...f},g=Nie({...m,mutationFn:t}),p=Iie({...m,mutationFn:n}),y=Bie({...m,mutationFn:r}),v=Pie({...m,mutationFn:i}),T=Mie({...m,mutationFn:a}),_=Oie({...m,mutationFn:s}),C=Fie({...m,mutationFn:o}),{activity:w,...x}=Rie({queryKey:u,queryFn:e});return{activity:w,mutations:{edit:g,like:p,unlike:y,pin:v,unpin:T,createVote:_,removeVote:C},user:d,...x}}function Bie({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=ft.useMutation({mutationFn:e,onMutate:a=>t(s=>(s&&vb({activity:s,user:r}),s)),onError:n});return i}function Mie({mutationFn:e,mutationHandlers:{mutate:t,error:n},user:r}){const{mutate:i}=ft.useMutation({mutationFn:e,onMutate:a=>(console.log("unpin"),t(s=>(s&&yb({activity:s,user:r}),s))),onError:n});return i}const Lie=({basePath:e,parentId:t,activityId:n,isMember:r,isOwner:i,functions:{activities:{remove:a,...s},likes:o,reactions:l,form:u,join:c,leave:d,polls:f},profile:m,categories:g,type:p=Ft.Communities,repliesFilters:y,translation:v})=>{var R,j;const T=le.useIntl(),_=Ra(),C=E.useContext(Pt),w={...s,...f},{activity:x,error:S,isLoading:N,mutations:{edit:B,like:$,unlike:F,pin:L,unpin:O,createVote:P,removeVote:M}}=ox({queryFns:w,queryKey:[e,t,n]});if(N)return h.jsx(Jn,{style:{height:"400px",width:p===Ft.Courses?"100%":"initial"}});if(S||!x)return h.jsx(Lr,{variant:"error",text:T.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:U,verb:D,latest_reactions:X}=x,k=!!((R=U==null?void 0:U.like)!=null&&R.find(H=>{var z;return((z=H.user)==null?void 0:z.id)===(C==null?void 0:C.id)}))?U==null?void 0:U.like[0].id:"",b=x==null?void 0:x.actor,q=Fm(x,g,_);return h.jsxs("section",{className:"activity-section",children:[h.jsx($l,{className:"highlighted-text-box subtle",isCommunity:!0,content:{...q,body:p===Ft.Courses?bb({payload:(j=x==null?void 0:x.payload)==null?void 0:j.data,locale:_}):q.body,slugs:{question:`${e}/${t}`,answer:x==null?void 0:x.id}},originalAuthorId:b==null?void 0:b.id,forceHide:{comments:!0,shareLink:p===Ft.Courses},functions:{content:{createContent:()=>null,deleteContent:a,updateContent:(H,{title:z,body:Y})=>B({title:z,content:Y})},likes:{createLike:()=>$({activityId:n}),deleteLike:()=>F({activityId:n,reactionId:k}),listLikes:H=>o.list({activityId:n,...H})},comments:{openComments:()=>{}},pins:{createPin:()=>L({activityId:n}),deletePin:()=>{var H;return O({activityId:n,reactionId:(H=X==null?void 0:X.pin)==null?void 0:H[0].id})}},polls:{createVote:({reactionId:H})=>P({reactionId:H}),removeVote:({reactionId:H})=>M({reactionId:H}),removePoll:()=>f.removePoll({activityId:n})},form:u},styling:{showShareLinkButton:!0},userHasPermissions:r,userHasOwnerPermissions:i,badges:{showBadges:!0,scopes:[{scope:nn.Communities,area:t||""},{scope:nn.Platform,area:"all"}]},basePath:e,parentId:t,locale:_,translation:v},n),h.jsx(u_,{basePath:e,parentId:t,activityId:n,showReplies:D===ze.Poll?Die(x):!0,activityTotalReplies:(x==null?void 0:x.total_replies)||0,isMember:r,functions:{reactions:l,likes:o,form:u,join:c,leave:d},profile:m,type:p,repliesFilters:y})]})};const lx=({showModal:e=!0,functions:t,form:n,cachedText:r,className:i})=>{const a=le.useIntl(),s="discussionFormModal_",{onClose:o=()=>{},cacheText:l=()=>{}}=t,{data:u,meta:c,functions:d}=n,{title:f="",body:m="",mentions:g}=r||{},p="discussion-form-modal";return h.jsx(vi,{id:p,title:a.formatMessage({id:`${s}title`}),isOpen:e,functions:{onClose:()=>{(f!==""||m!=="")&&l(y=>({...y,showCachedText:!0})),o()}},className:te("discussion-form-modal",i),withFocusTrap:n.withFocusTrap,children:h.jsx(Ll,{...n,data:{...u,mentions:g||(u==null?void 0:u.mentions)},meta:{...c,isAutoFocused:!0,isInOverlay:`${p}-overlay`,hasTitleField:{text:f},isPrepopulated:{text:m||(c==null?void 0:c.isPrepopulated)!==!1&&(c==null?void 0:c.isPrepopulated.text)||""},showGuidelines:!1,showDivider:!0,showPostType:!0},buttons:{submit:a.formatMessage({id:`${s}cta`})},functions:{...d,onChange:y=>{l(v=>({...v,...y}))},onMention:({id:y,name:v}={})=>{if(!y||!v)return;const T=g||{};T[y]={created_at:"",updated_at:"",id:y,data:{name:v}},l(_=>({..._,mentions:T}))},create:async y=>{o(),d.create&&await d.create(y),l({showCachedText:!1})},createPoll:async y=>{const v=()=>{o(),l({showCachedText:!1})};if(d.createPoll)try{const T=await d.createPoll(y);return new Promise(_=>(v(),_(T)))}catch{return new Promise((_,C)=>C())}else return v(),new Promise(T=>T({}))},handleSaveEdit:async y=>{o(),d.handleSaveEdit&&await d.handleSaveEdit(y),l({showCachedText:!1})}}})})},$ie=Object.freeze(Object.defineProperty({__proto__:null,default:lx},Symbol.toStringTag,{value:"Module"}));const jie=({className:e,showModal:t=!0,title:n,messagePlaceholder:r,formTitle:i,formLabel:a,ctaMessage:s,showIcon:o,onClose:l,reportError:u=()=>{},sendInvites:c})=>{const d=le.useIntl();return i||(i=d.formatMessage({id:"inviteModal_formTitle"})),a||(a=d.formatMessage({id:"inviteModal_formLabel"})),s||(s=d.formatMessage({id:"inviteModal_cta"})),h.jsx(vi,{id:"invite-user-modal",title:n,isOpen:t,showDivider:!1,showIcon:o,functions:{onClose:l},className:te("invite-modal",e,{success:!!n}),children:h.jsx(a_,{title:i,label:a,messagePlaceholder:r,ctaMessage:s,onClose:l,sendInvites:c,reportError:u})})};const Hie=({showModal:e=!0,content:{successMessage:t,title:n,text:r}={},functions:i,form:a,className:s})=>{const o=le.useIntl(),[l,u]=E.useState(Qc("showProfile")==="true"||e);E.useEffect(()=>{u(e)},[e]);const{onClose:c=()=>{}}=i;return h.jsx(vi,{id:"profile-form-modal",title:t||n||o.formatMessage({id:"profileModal_title"}),isOpen:l,showDivider:!t,functions:{onClose:c},className:te("profile-modal",s,{success:!!t}),maxWidth:700,children:h.jsxs(h.Fragment,{children:[t&&n||r?h.jsxs("div",{className:"intro",children:[t&&n?h.jsx("h3",{children:n}):"",r?h.jsx("p",{children:r}):""]}):null,h.jsx(s_,{...a,meta:{shouldShowCancelButton:!1},functions:{...(a==null?void 0:a.functions)||{},onSuccess:async d=>{var f;try{(f=a==null?void 0:a.functions)!=null&&f.onSuccess&&await a.functions.onSuccess(d)}finally{c()}}}})]})})},H1=Hie,Uie=Object.freeze(Object.defineProperty({__proto__:null,default:H1},Symbol.toStringTag,{value:"Module"}));const zie=({members:e})=>{const[t,n]=E.useState(!1),r=i=>{const{fullName:a,jobTitle:s,organisation:o,photo:l}=i||{};return h.jsxs(h.Fragment,{children:[h.jsx(gi,{name:a,src:l}),h.jsx("p",{children:a}),h.jsx("small",{className:"text-medium",children:o?`${s}, ${o}`:s})]})};return h.jsxs("div",{className:"directory-wrapper",children:[h.jsx("ul",{className:"directory",children:e.map(i=>h.jsx("li",{children:h.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),n(i)},children:r(i)})},i.fullName))}),h.jsx(vi,{isOpen:t!==!1,children:t===!1?"":h.jsxs(h.Fragment,{children:[r(t),h.jsx(Sa,{children:t.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})};const qie=({email:e,settings:t={}})=>{const{formatMessage:n}=le.useIntl(),r=E.useContext(Pt),{myProfile:i,isConnected:a,cannotConnect:s}=t,[o,l]=E.useState(!1),[u,c]=E.useState(!1);return r?e&&i?h.jsx(Ie,{icon:{icon:"info-inside-circle",position:"right"},size:"small",variant:"secondary",styling:{muted:!0},tooltip:n({id:"member_show_email_tooltip_mine"}),forceTooltip:!0,className:"show-email fake-button",children:e}):s?h.jsx(Ie,{icon:"email",size:"small",variant:"secondary",styling:{muted:!0},tooltip:n({id:"member_show_email_tooltip_private"}),forceTooltip:!0,className:"show-email fake-button",children:n({id:"member_show_email_private"})}):a?e&&a?h.jsx(h.Fragment,{children:o?h.jsx(Ie,{icon:{icon:"copy",position:"right"},size:"small",variant:"secondary",styling:{muted:!0},className:"show-email copy-button",tooltip:n({id:`member_show_email_tooltip${u?"_copied":""}`}),forceTooltip:!0,"data-gtm-event-context":"connections-email-address-button","data-gtm-event-type":"copy-email-click",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{c(!0),setTimeout(()=>{c(!1)},2e3)})},children:e}):h.jsx(Ie,{icon:"email",size:"small","data-gtm-event-context":"connections-email-address-button","data-gtm-event-type":"show-email-click",onClick:()=>l(!0),children:n({id:"member_show_email_show"})})}):h.jsx(h.Fragment,{}):h.jsx(Ie,{icon:"email",size:"small",variant:"secondary",styling:{muted:!0},className:"show-email fake-button",children:n({id:"member_show_email_hide"})}):h.jsx(h.Fragment,{})};const Wie=({author:e,authorCite:t,content:n,member:r,className:i=""})=>h.jsxs("blockquote",{className:te("testimonial-block",i),children:[h.jsx(Ir,{className:"testimonial",children:n}),r?h.jsx(li,{member:r,styling:{size:"large"}}):h.jsxs(h.Fragment,{children:[e&&h.jsx("p",{className:te("author",{"text-small":!i.includes("new")}),children:e}),t&&h.jsx("p",{className:te("author-cite",{"text-small":!i.includes("new")}),children:h.jsx("cite",{children:t})})]})]}),Vie=E.memo(Wie);const Kie=({items:e=[],selector:t="",className:n=""})=>{const r=le.useIntl(),[i,a]=E.useState(e);return E.useEffect(()=>{if(e.length)return;let s="";Array(6).fill(0).forEach((u,c)=>{s+=`${c>0?", ":""}${t} h${c+1}`});const l=Array.from(document.querySelectorAll(s)).filter(u=>u.id).map(u=>({id:u.id,text:u.textContent||""}));a(l)},[]),i&&i.length>0&&h.jsxs(In,{variant:"subtle",className:te("table-of-contents",n),children:[h.jsx("h2",{children:r.formatMessage({id:"tableOfContents"})}),h.jsx("nav",{children:h.jsx("ul",{children:i.map(({id:s,text:o})=>h.jsx("li",{children:h.jsx("a",{href:`#${s}`,children:o})},s))})})]})};const U1=({time:e,rangeTime:t,prependedText:n,appendedText:r,className:i=""})=>{const a=le.useIntl(),s="timeToComplete_";if(!e||typeof e!="number")return null;const o=c=>{const d=c/60,f=Math.floor(d),m=(d-f)*60,g=Math.round(m),p=`${a.formatMessage({id:`${s}hours`},{time:f})}${f>0&&g>0?", ":""}${a.formatMessage({id:`${s}minutes`},{time:g})}`;return{text:`${f>0?`${a.formatMessage({id:`${s}hours_short`},{time:f})} `:""}${g>0?a.formatMessage({id:`${s}minutes_short`},{time:g}):""}`,ariaText:p}};let{text:l,ariaText:u}=o(e);if(t){const{text:c,ariaText:d}=o(e+t);l=a.formatMessage({id:`${s}range`},{early:l,late:c}),u=a.formatMessage({id:`${s}range_aria`},{early:u,late:d})}return n&&(u=`${n} ${u}`,l=`${n} ${l}`),r&&(u=`${u} ${r}`,l=`${l} ${r}`),h.jsx("span",{className:te("time-to-complete",i),"aria-label":u,children:l})};const Gie=({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",h.jsx(Vi,{...n,className:te("banner",e),image:{...t,aspect:"banner"}})):null;const Yie=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],Zie=({className:e="",content:t,image:n,variant:r,spacing:i="normal",styling:a,hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:l})=>{var g,p;const u={imageFullWidth:!0,...a};r||(r=u.imageFullWidth?"default":"light");const c=["eyebrow","title","text"],d={eyebrow:"small",title:"h1",text:"p"},f={};c.forEach(y=>{if(!t[y]){f[y]=!1;return}if(!s[y]){if(typeof t[y]=="object"){f[y]=t[y];const{text:v,element:T}=t[y];if(T&&Yie.includes(T.toLowerCase()))return;f[y]={text:v,element:d[y]};return}f[y]={text:t[y],element:d[y]}}});const m=o&&o.text&&o.link;return m&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=y=>{y.preventDefault(),y.stopPropagation();const v=document.getElementById(o.link.substring(1));v&&v.scrollIntoView({behavior:"smooth"})}),h.jsx(Zi,{className:te("banner-section",r,i,e,{"has-image":n,"image-full-width":n&&u.imageFullWidth,"image-inline":n&&!u.imageFullWidth,"has-cta":m,"has-extra-spacing":r!=="subtle"&&i==="normal"&&f.eyebrow&&f.title}),children:h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"content-wrapper",children:[c.map(y=>{if(f[y]&&typeof f[y]=="object"){const{text:v,element:T=""}=f[y];return y==="text"?h.jsx(Sa,{overrideType:"text-only",className:"text",children:v},y):E.createElement(T,{key:y,className:y},v)}return null}),l,m&&h.jsx(Ie,{variant:n||["light","subtle"].includes(r)?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,className:te({new:r==="subtle",[(g=o.props)==null?void 0:g.className]:(p=o.props)==null?void 0:p.className}),children:o.text})]}),n&&h.jsx(Vi,{image:{...n,aspect:u.imageFullWidth?"banner":n.aspect||void 0}})]})})},Qie=E.memo(Zie);const Xie=({image:e,variant:t="default",children:n,className:r=""})=>{const i={};return e&&(i["--image"]=`url(${e})`),h.jsx(Zi,{className:te("custom-content-banner",t,r,{"has-image":e}),style:i,children:h.jsx("div",{className:"content-slim",children:n})})};const Jie=({alignImage:e="left",className:t,content:n,image:r})=>{const i=typeof n=="string"?h.jsx(Sa,{children:n}):n;return h.jsxs(Zi,{className:te("highlight-section",t),children:[r&&h.jsx("div",{className:te("highlight-container highlight-image",{[`highlight-image-${e}`]:e==="right"}),children:h.jsx(Vi,{image:{...r,description:"",query:"q=85",aspect:"highlightSection"}})}),h.jsx("div",{className:te("highlight-container highlight-content-wrapper",{"no-image":!r}),children:h.jsx("div",{className:te("highlight-content",{"highlight-content-right":e==="left"}),children:r?i:h.jsx("div",{className:"content-default",children:i})})})]})},eae=E.memo(Jie);const tae=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:i})=>!n&&!r?null:h.jsxs("aside",{className:te("marketing-block",e),children:[n&&h.jsx("p",{className:"title",children:n}),r&&h.jsx("p",{children:r}),t&&h.jsx(Ie,{variant:t.variant||"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":i,"data-gtm-event-type":"learn-more-click",children:t.text})]}),nae=({type:e,data:t})=>{const n=le.useIntl(),{answers:r,createdAt:i,dateHasPassed:a,isOngoingEvent:s,pill:o,readingTime:l,publishedDate:u,startDate:c}=t;if(e==="question"){const d=i&&ah(i);return h.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),i&&h.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:d?n.formatMessage({id:`dates_${d.path}`},{number:d.number}):0})]})]})}if(c&&!a||s)return h.jsx("p",{className:"details",children:s?n.formatMessage({id:"card_bootcamp"}):gm(c)});if(o)return h.jsx(Pr,{variant:o==="free"?"subtle":"highlighted",className:o,"data-testid":"course-type",children:o});if(l||u){const d=u&&ah(u);return h.jsxs("ul",{className:"details",children:[l&&h.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),u&&h.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:d?n.formatMessage({id:`dates_${d.path}`},{number:d.number}):0})})]})}return null},rae={title:66,text:3e3,secondaryText:1e3,partner:34},nl={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"},courseJourney:{basePath:"/courses/",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"}},iae=({data:e,cta:t,link:n,gtmContext:r})=>{var p,y;const i=le.useIntl(),[a,s]=E.useState({loading:!1,registered:e.registered||!1});E.useEffect(()=>{e.registered&&s(v=>({...v,registered:!0}))},[e.registered]);const{customLinkText:o,startDate:l,dateHasPassed:u,pill:c,slug:d}=e,f=e.contentType;let m="";if((p=nl[f])!=null&&p.gtmEvent&&(m=nl[f].gtmEvent),l&&u)return n?h.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${m}-click`,children:o||i.formatMessage({id:"card_watch"})}):null;if(f==="people")return n?h.jsx(Ie,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${m}-click`,children:o||i.formatMessage({id:"card_cta_people"})}):null;const g=["communityPage","microcourse","event"];if(t&&t.onClick&&g.includes(f)&&c!=="premium"){const v=a.loading||a.registered||((y=e==null?void 0:e.members)==null?void 0:y.isMember),T=async _=>{var C;if(_.preventDefault(),_.stopPropagation(),window&&((C=window.dataLayer)==null||C.push({event:"gtm.click","gtm.element":n,"gtm.elementClasses":"gtm-trackable","gtm.elementUrl":n,EventType:`${r}-${f}-register-click`,EventContext:`${r}Page-${f}: ${d}`})),!(v||!t||!t.onClick)){s(w=>({...w,loading:!0}));try{const w=await t.onClick(e);s(w==="success"?()=>({registered:!0,loading:!1}):x=>({...x,loading:!1}))}catch{s(x=>({...x,loading:!1}))}}};return h.jsx("p",{className:te("cta-wrapper",{"has-member-section":e==null?void 0:e.members}),children:h.jsx(Ie,{onClick:T,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:v,"data-gtm-event-context":`${r}Page-${f}: ${d}`,"data-gtm-event-type":`${r}-${f}-register-click`,"data-testid":"in-card-button",children:o||i.formatMessage({id:`card_cta_${f}${v?`_${a.loading?"loading":"done"}`:""}`})})})}return null};function aae({buildMemberData:e,communitySlug:t}){const n=le.useIntl(),r=E.useContext(Pt),[i,a]=E.useState({count:"...",isMember:!1,memberType:""});return E.useEffect(()=>{e(t,typeof(r==null?void 0:r.id)<"u").then(s=>{if(!s)return;const{membersCount:o,role:l="",pagination:u}=s;let c=0;o?c=o:u!=null&&u.total&&(c=u==null?void 0:u.total),a({count:c.toString(),isMember:!!l,memberType:l})})},[t,e]),h.jsxs("span",{className:"member-information",children:[i.isMember&&h.jsx(Pr,{size:"small",variant:"registered",icon:(i==null?void 0:i.memberType)==="owner"?"user":"tick",children:n.formatMessage({id:`card_member_type_${i.memberType}`})}),h.jsx("span",{className:"label member-count",children:n.formatMessage({id:"card_member_count"},{count:i.count})})]})}const B0=({id:e="",className:t="",buildCardData:n,buildMemberData:r,card:i,cta:a,gtmContext:s="Carousel",handleCardClick:o,meta:l})=>{var O,P;const u=le.useIntl(),c=E.useContext(Pt),d=!!(c!=null&&c.id),{isTabbable:f=!0,setFocus:m=!1}=l||{},g=E.useRef(null),[p,y]=E.useState({data:null,isLoading:!0});E.useEffect(()=>{n(i,d).then(M=>{y({data:M,isLoading:!1})}).catch(()=>y(M=>({...M,isLoading:!1})))},[i,d,n]);const{data:v,isLoading:T}=p;if(T||!v)return h.jsx(Jn,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});o&&!a&&(a={text:u.formatMessage({id:`card_cta_${i.contentType}`}),onClick:o});const{contentType:_}=v;if(!_||!nl[_])return h.jsx(Jn,{element:"li",className:"card-wrapper"});const{basePath:C="",className:w,length:x,gtmEvent:S}=nl[_];let N=f&&v.slug?`${C}${v.slug}`:!1;if(i.courseV2){const{basePath:M}=nl.courseJourney;N=`${M}${v.slug}`}f&&v.slug&&(v.slug.slice(0,4)==="http"||v.slug.slice(0,2)==="//"||v.slug.slice(0,6)==="mailto"||v.slug.slice(0,3)==="tel")&&(N=v.slug);const B=M=>{if(N){M.preventDefault(),M.stopPropagation();const U=M.currentTarget.getAttribute("data-url");window&&window.dataLayer.push({event:"gtm.click","gtm.element":U,"gtm.elementClasses":"gtm-trackable","gtm.elementUrl":U,EventType:`${s}-CarouselCard`,EventContext:`${S}-click`}),window.location.href=U}},$={...rae,...x};let F={className:"card"},L={};return N&&(L={href:N,className:"gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${S}-click`,"data-testid":"link"},v.openInNewTab&&(L.target="_blank"),F={onClick:B,className:"card gtm-trackable","data-gtm-event-context":`${s}-CarouselCard`,"data-gtm-event-type":`${S}-click`}),m&&(F={...F,tabIndex:"0"},(O=g==null?void 0:g.current)==null||O.focus(),(P=g==null?void 0:g.current)==null||P.scrollIntoView({behavior:"smooth"})),h.jsx("li",{className:te("card-wrapper text-medium",w,t,{"has-link":N,"no-link":!N,"has-image":v.banner}),"data-testid":`${_}-card`,children:h.jsxs("div",{...F,ref:g,"data-url":N,children:[h.jsx(R4,{className:"card-label",contentType:_,customIcon:v.isPrivate?"lock-locked":v.customIcon,customLabel:v.customLabel}),_==="communityPage"&&(v==null?void 0:v.createdAt)&&Ox(v==null?void 0:v.createdAt,60)&&h.jsx(Pr,{size:"small",variant:"information","data-testid":"new-community",children:u.formatMessage({id:"card_new"})}),v.startDate&&!v.isOngoingEvent&&h.jsx(Pr,{size:"small",variant:v.dateHasPassed?"default":"information","data-testid":"date",children:v.dateHasPassed?u.formatMessage({id:"card_ended"}):k4(v.startDate)}),v.banner?h.jsxs("p",{className:"img",children:[v.registered&&h.jsx(Pr,{size:"small",variant:"registered",children:u.formatMessage({id:"card_registered"})}),h.jsx(Vi,{image:{...v.banner,description:""}})]}):w==="people"?h.jsx(gi,{name:v.title||"",src:v.profile,"data-testid":"people-profile-picture"}):null,v.contributors&&h.jsx(Sm,{contributors:{data:v.contributors},styling:{size:"small",showGap:w!=="question",showText:!0},multipleText:["event","solutionArticle"].includes(_)?u.formatMessage({id:`card_contributors_${_}`}):void 0,"data-testid":"contributors"}),v.partner&&h.jsx("p",{className:"partners","data-testid":"partners",children:v.partner.length>1?u.formatMessage({id:"card_partner"},{partner:v.partner[0],number:v.partner.length-1}):rl(v.partner[0],$.partner)}),["title","text","secondaryText"].map(M=>{const U=v[M];if(!U)return null;const D=C4(M),X={key:M,className:D,"data-testid":D},Z={wrapper:"p",forceWrapper:!0,forceInline:!0},k=rl(U,$[M]);return["title","text"].includes(M)&&N?(Z.wrapper="a",h.jsx("p",{...X,children:h.jsx(Ir,{options:Z,...L,children:k})})):h.jsx(Ir,{options:Z,...X,children:k})}),i.contentType==="communityPage"&&(i.slug||v.slug)&&r&&h.jsx(aae,{communitySlug:i.slug||v.slug,buildMemberData:r}),h.jsx(nae,{type:w||"",data:v}),h.jsx(iae,{data:v,cta:a,link:N||"",gtmContext:s})]})})};const ux=({cards:e,cardTypes:t,className:n="",gtmContext:r="",...i})=>h.jsx("ul",{className:te("card-block",n),children:e.map((a,s)=>{const o=a.slug?`${a.slug}-${t[s]}`:`${t[s]}-${s}`;return h.jsx(B0,{id:o,card:{...a,contentType:t[s]},meta:{setFocus:s===(i==null?void 0:i.focusCardIndex)},...i},`${o}-${r}-${a.title}`)})}),sae=(e,t,n,r)=>{const i=t*n<=e,a=e<t*(n+1),s=r.includes(Math.floor(e/t));return{inView:i&&a,isLoaded:s}},oae=({id:e,title:t})=>{const n=le.useIntl();if(!t||!t.text)return null;const{text:r,element:i="h2",variant:a="default",size:s="medium",link:o}=t;return E.createElement(i,{className:te("title",a,s,{"highlighted-title":a==="highlighted"}),children:h.jsxs(h.Fragment,{children:[r,o&&h.jsx("a",{href:o,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${e||mi(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const th={fourCards:1024,threeCards:769,twoCards:480};let Wu=null,nh=null;const lae=({id:e,cards:t,cardTypes:n,buildCardData:r,title:i,className:a,gtmContext:s,...o})=>{const l=le.useIntl(),u="carousel_pagination_",[c,d]=E.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:f,isLoading:m}=c,[g,p]=E.useState({currentPage:0,loadedPages:[0]}),{currentPage:y,loadedPages:v}=g,[T,_]=E.useState(""),C=t.length,w=Math.ceil(C/f),x=E.useRef(null),S=Wi(!0,!0,x==null?void 0:x.current);E.useEffect(()=>{let O=1;S&&(S>=th.fourCards?O=4:S>=th.threeCards?O=3:S>=th.twoCards&&(O=2),O>C&&(O=C)),d(P=>({...P,cardsPerPage:O,isLoading:!1}))},[S,C]);const N=(O="next")=>{nh&&clearTimeout(nh);let P=y;if(typeof O=="string")if(O==="next")if(y<w-1)P=y+1;else return;else if(y>0)P=y-1;else return;else P=O;_(""),p(U=>({...U,currentPage:P,loadedPages:[...new Set([...v,P])]}));const M=()=>{const U=P*c.cardsPerPage,D=U+c.cardsPerPage;return t.slice(U,D).length};nh=setTimeout(()=>{_(l.formatMessage({id:`${u}ariaLive${typeof O=="string"?"":"_slide"}`},{direction:l.formatMessage({id:`${u}${typeof O=="string"?O:"next"}`}),slide:typeof O=="string"?1:O+1,count:M()}))},500)},B=O=>{Wu=O.touches[0].clientX},$=O=>{if(Wu===null)return;const P=O.touches[0].clientX,M=Wu-P;M>5?N("next"):M<-5&&N("previous"),Wu=null},F={"--width":`${S||0}px`,"--total-cards":C,"--cards-per-page":f,"--page":y};if(m)return h.jsx(t1,{layout:`carousel${i?"-with-title":""}`});const L=(O,P)=>{var U;let M=null;return(U=O==null?void 0:O.sys)!=null&&U.id?M=`card-${O.sys.id}`:O!=null&&O.slug?M=`card-${O.slug}`:[n[P],O.contentType].includes("customCard")&&(M=`card-${mi(`${O.title} ${O.createdAt}`)}-${P}`),M};return h.jsxs("section",{ref:x,className:te("carousel-wrapper",a),"data-testid":"carousel",children:[h.jsx(oae,{id:e,title:i}),h.jsx("ul",{className:"carousel",onTouchStart:B,onTouchMove:$,style:F,"data-testid":"carousel-list",children:t.map((O,P)=>{let M=L(O,P);const{inView:U,isLoaded:D}=sae(P,f,y,v);return M&&(U||D)?h.jsx(B0,{id:M,card:{...O,contentType:n[P]},buildCardData:r,gtmContext:s,meta:{isTabbable:U},...o},M):(M=M||`${e}-card-${P}`,h.jsx(Jn,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},M))})}),w<=1?null:h.jsxs(h.Fragment,{children:[h.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[h.jsx("li",{className:"arrow previous",children:h.jsx(Ie,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:O=>{O.preventDefault(),O.stopPropagation(),N("previous")},screenreaderText:l.formatMessage({id:`${u}previousSlide`}),disabled:y<=0})}),[...Array(w)].map((O,P)=>h.jsx("li",{"data-testid":"carousel-controls-button",children:h.jsx("button",{className:te("page-indicator",{selected:P===y}),onClick:M=>{M.preventDefault(),M.stopPropagation(),N(P)},children:h.jsx(ot,{showOnFocus:!1,children:l.formatMessage({id:`${u}slide`},{number:P+1,total:w})})})},`page-indicator-${P}`)),h.jsx("li",{className:"arrow next",children:h.jsx(Ie,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:O=>{O.preventDefault(),O.stopPropagation(),N("next")},screenreaderText:l.formatMessage({id:`${u}nextSlide`}),disabled:y>=w-1})})]}),h.jsx(ot,{"aria-live":"polite",showOnFocus:!1,children:T})]})]})},uae=({carousels:e=[],isLoading:t,title:n,className:r="",...i})=>!e||!e.length?null:e.map(({title:a,viewAllUrl:s,cards:o,cardsTypes:l},u)=>{const c=a?mi(a):`carousel-${u}`,d=u===e.length-1;return t?h.jsxs(E.Fragment,{children:[h.jsx(t1,{layout:`carousel${a?"-with-title":""}`,"data-testid":"carousel-placeholder"}),d?null:h.jsx(pr,{})]},`placeholder-${c}`):h.jsxs(E.Fragment,{children:[h.jsx(lae,{cards:o,cardTypes:l,title:n!=null&&n.hidden?{}:{...n,text:a,link:s},...i}),d?null:h.jsx(pr,{})]},`carousel-${c}`)});const cae=({element:e="div",className:t="",card:n,gtmContext:r="NarrowCard"})=>{const{banner:i,title:a,text:s,isPrivate:o,slug:l}=n;let u={};return l&&(u={onClick:d=>{l&&(d.preventDefault(),d.stopPropagation(),window.location.href=l)},tabIndex:"0","data-gtm-event-context":`${r}-NarrowCard`,"data-gtm-event-type":`${r}-click`}),E.createElement(e,{className:te("narrow-card",t,{"has-link":l,"gtm-trackable":l,"no-link":!l}),...u,children:h.jsxs(h.Fragment,{children:[h.jsx("div",{className:te("img",{private:o,"no-image":!i}),children:i&&h.jsx(Vi,{image:i})}),h.jsxs("div",{className:"content",children:[a&&h.jsx("p",{className:"title text-medium",children:a}),s&&h.jsx("p",{className:"text text-medium",children:s})]})]})})};const dae=({element:e="p",data:{timeLeftToFinish:t,percentageCompleted:{inTime:n=0,inLessons:r=0},shouldShowTimes:i=!0},graph:a,styling:s={},className:o=""})=>{const l=le.useIntl();let u=i?n:r;u>99?u=100:u<1&&(u=0);const{highlightPercentage:c=!1}=s;return E.createElement(e,{className:te("course-progression",o,{"highlight-percentage":c,"has-circle-graph":a==="circle"}),children:h.jsxs(h.Fragment,{children:[h.jsx(Am,{progress:u,styling:{layout:a||"bar",size:a&&a==="circle"?"small":"default"}}),h.jsx("span",{className:"percentage",children:l.formatMessage({id:"courseProgression_done"},{percent:d=>h.jsx("strong",{children:d}),number:u})}),u<100&&i&&h.jsx(U1,{time:t,appendedText:l.formatMessage({id:"courseProgression_timeLeft"})})]})})};const cx=({element:e="span",sectionId:t,subsectionId:n,title:r,className:i=""})=>E.createElement(e,{className:te("lesson-name",i),"data-number":`${t}.${n}`,children:r});const dx=({size:e="default",completionTime:t,icon:n,optional:r,type:i,children:a})=>{const s=le.useIntl(),o=Zc(`lessonType_${i}`)?s.formatMessage({id:`lessonType_${i}`}):w4(i||"");return h.jsxs("small",{className:te("content-type",{[e]:e!=="default"}),children:[h.jsx("span",{className:te("type",n),children:o})," ",t>0&&!r&&h.jsx(U1,{time:t})," ",a?h.jsx("span",{className:"additional",children:a}):null]})};const fae=({course:{articles:e,canAccessCourse:t,description:n,hideTimes:r,isEnrolled:i,sectionId:a,sectionTime:s,slug:o,timeLeft:l,title:u},quizScores:c})=>{const d=le.useIntl(),f="courseStructure_",m=u.toLowerCase().includes("course conclusion");return h.jsxs(Jc,{className:"course-structure",label:h.jsxs(h.Fragment,{children:[h.jsxs("small",{children:[d.formatMessage({id:`${f}section${m?"_end":""}`},{number:a})," ",!r&&s>=0&&h.jsx("span",{className:"time",children:i&&l===0?d.formatMessage({id:`${f}time_completed`}):h.jsx(U1,{time:s,appendedText:i?d.formatMessage({id:`${f}time_left`}):""})})]}),h.jsx("h3",{children:u})]}),shouldAnimate:!0,children:[h.jsx("p",{children:n}),h.jsx("ol",{children:e&&e.length>0&&e.map(({completed:g,completionTime:p,contentType:y,icon:v,image:T,isIntroduction:_,optional:C,slug:w,subsectionId:x,title:S,type:N})=>{const B=i&&t||_,$={};return T&&($.style={"--image":`url(${T})`}),h.jsx("li",{className:te({article:y===So.ARTICLE,discussion:y===So.DISCUSSION,quiz:y===So.QUIZ,completed:g&&y===So.ARTICLE,locked:!B}),...$,children:h.jsx(Ki,{href:B?`/microcourses/en/${o}/${w}`:void 0,fallbackElement:"span",className:"inner",gtmContext:`MicrocourseOutline${x4(S)}`,gtmType:"article-click",children:h.jsxs(h.Fragment,{children:[h.jsx(cx,{sectionId:a,subsectionId:x,title:S,className:"course-title"})," ",h.jsx(dx,{completionTime:p,icon:v,optional:C,type:N,children:c&&c[w]&&h.jsx("span",{className:"quiz-score",children:`${c[w]}%`})})]})})},w)})})]})};const hae=({isComplete:e=!1,onClick:t,...n})=>{const r=le.useIntl();return n["data-gtm-event-context"]||(n["data-gtm-event-context"]="LessonIntroduction"),h.jsx(Ie,{...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:te("mark-complete-button center gtm-trackable",{completed:e}),"data-gtm-event-type":"mark-as-complete",disabled:e,children:r.formatMessage({id:`markCompleteButton${e?"_completed":""}`})})},mae=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:i}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:i}}),h4=[{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 Vu="notFoundError_",pae=()=>{const e=le.useIntl(),t=[];return h4.forEach((n,r)=>{n.title=e.formatMessage({id:`${Vu}post_${r+1}`}),t.push("solutionArticle")}),h.jsxs(Z3,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:h.jsxs(Zi,{children:[h.jsx(ux,{cards:h4,cardTypes:t,buildCardData:n=>new Promise((r,i)=>{r(n)})}),h.jsx(Ie,{href:"/solution-articles/",children:e.formatMessage({id:`${Vu}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[h.jsx("h1",{children:e.formatMessage({id:`${Vu}title`})}),h.jsx("p",{children:e.formatMessage({id:`${Vu}text`})})]})};exports.APOLITICAL_LOCALE_COOKIE=mm;exports.ASSETS_URL=Yn;exports.ActionBar=h_;exports.ActionButton=ys;exports.ActivitiesFeed=rw;exports.ActivitySection=Lie;exports.ActivityType=zs;exports.AddPost=R0;exports.Badge=Y4;exports.BadgeScope=nn;exports.Badges=Z4;exports.BadgesContext=bm;exports.BadgesProvider=$4;exports.Banner=Gie;exports.BannerSection=Qie;exports.Breadcrumbs=mF;exports.Buckets=r7;exports.Button=Ie;exports.ButtonWrapper=Hs;exports.COURSE_CONTENT_TYPES=So;exports.CacheProvider=j4;exports.Card=B0;exports.CardBlock=ux;exports.Carousel=uae;exports.CharacterLimit=jm;exports.Checkbox=Hm;exports.CollapsibleSection=Jc;exports.Columns=g_;exports.CommunityDetails=A6;exports.ConnectionCta=Q4;exports.ConnectionDirectionType=wm;exports.ConnectionStatusType=xm;exports.ContactFooter=kF;exports.ContactForm=i_;exports.ContentTypeLabel=R4;exports.Contributors=Sm;exports.ConversationContext=j1;exports.CookieBanner=y_;exports.CourseProgression=dae;exports.CourseStructure=fae;exports.CustomContentBanner=Xie;exports.CustomEvents=Ut;exports.DELETED_USER_ID=al;exports.Directory=zie;exports.DiscussionContentType=ze;exports.DiscussionConversation=nx;exports.DiscussionForm=Ll;exports.DiscussionFormCard=ix;exports.DiscussionFormModal=lx;exports.DiscussionPost=$l;exports.DiscussionThread=sx;exports.DiscussionType=Ft;exports.Divider=pr;exports.DownloadSection=xF;exports.EMAILS=ls;exports.EditSection=AF;exports.EmailHelperTextBox=wb;exports.EmptyStateBox=Lr;exports.EnrichedUrl=gp;exports.FeatureFlags=z4;exports.Filters=m_;exports.FlagsProvider=U4;exports.Footer=yp;exports.Form=vr;exports.Formatting=ne;exports.Fragment=Hn;exports.FullWidthSection=Zi;exports.GET_STREAM_USER_PREFIX=ih;exports.GlobalProviders=y7;exports.Header=N0;exports.HelperTextBox=B4;exports.HiddenFromScreenReaders=Yc;exports.HideShowTextBox=M4;exports.HighlightSection=eae;exports.HighlightedTextBox=In;exports.INVALID_TOKEN=A4;exports.IconBulletedList=s7;exports.ImageContainer=Jx;exports.IntlProvider=q4;exports.InviteForm=a_;exports.InviteModal=jie;exports.JoinButton=Nm;exports.Label=Pc;exports.LanguageContext=_m;exports.LanguageSwitcher=gF;exports.LessonName=cx;exports.LessonType=dx;exports.LikesButton=_b;exports.LikesFeed=c_;exports.LikesModal=d_;exports.Link=Ki;exports.LoadMore=wl;exports.LoadingBlock=X4;exports.LoadingPlaceholder=Jn;exports.LoadingState=t1;exports.Logo=vp;exports.LogoSection=SF;exports.MEMBERS_PER_PAGE=Q3;exports.MENTION_REGEX=S4;exports.MarkCompleteButton=hae;exports.MarkdownText=Sa;exports.MarketingBlock=tae;exports.Marks=Nr;exports.Member=li;exports.MembersList=X3;exports.Modal=km;exports.MoreMenu=Fc;exports.NUMBER_OF_COUNTRIES=Sx;exports.NUMBER_OF_USERS=Ax;exports.NarrowCard=cae;exports.NavigationMenu=p_;exports.NotFoundError=pae;exports.Overlay=vi;exports.OverlayContext=Cm;exports.OverlayProvider=K4;exports.PageHeading=G4;exports.PageLayout=Z3;exports.Password=Ab;exports.PasswordForm=LR;exports.PasswordRules=Nb;exports.Pill=Pr;exports.Poll=rx;exports.Popover=P4;exports.Portal=Us;exports.ProfileForm=s_;exports.ProfileImageChange=r_;exports.ProfileModal=H1;exports.ProfileModalLauncher=F0;exports.ProfilePicture=gi;exports.ProgressBar=Am;exports.ProgressTracker=t7;exports.PublishArticleForm=HR;exports.Rating=mw;exports.RepliesFeed=u_;exports.ResponsesHeading=ax;exports.ResponsiveImage=Vi;exports.ResultsVisibility=P0;exports.ReturnToNavButton=n7;exports.RichTextEditor=mp;exports.STORAGE_KEYS=pm;exports.SearchForm=l_;exports.ShareLink=f_;exports.ShareLinks=TF;exports.ShowEmail=qie;exports.SignupForm=ZR;exports.Span=uh;exports.StatusBanner=ks;exports.TableOfContents=Kie;exports.Tabs=_F;exports.Tags=lie;exports.TestimonialBlock=Vie;exports.TimeToComplete=U1;exports.Toggle=n_;exports.Tooltip=pi;exports.TopLevelPage=DF;exports.UUID_V4_REGEX=Aa;exports.UserContext=Pt;exports.UserProvider=W4;exports.VisuallyHidden=ot;exports.addAriaProps=fb;exports.basicReducer=js;exports.camelCaseToDashCase=C4;exports.checkIntlPathExists=Zc;exports.constructActivityContent=Fm;exports.courseDiscussionRepliesFeedMock=aw;exports.enrichPostCategories=tx;exports.generateConditions=nc;exports.generateCssIcon=kx;exports.getActivityPollOptions=hb;exports.getAuthorData=_l;exports.getCharacterLimitProps=xb;exports.getLocalisedActivityContent=bb;exports.getLocalisedReactionContent=Tb;exports.getLongDate=gm;exports.getMember=n1;exports.getPostBody=I0;exports.getSearchParam=Qc;exports.getShortDate=k4;exports.getValueLength=r1;exports.headerData=As;exports.likesResponseMock=fF;exports.mapGetStreamData=mae;exports.pageReady=O4;exports.passwordValidator=sh;exports.repliesFeedMock=iw;exports.safeBase64Encode=mi;exports.toCamelCase=x4;exports.toCapitalisedCase=wx;exports.toSentenceCase=w4;exports.transformSlugs=mh;exports.useActivitiesFeed=Cb;exports.useActivitySection=ox;exports.useAutoResize=y4;exports.useBadges=L4;exports.useCurrentPath=E4;exports.useEffectAfterMount=Ss;exports.useElementWidth=Wi;exports.useHomepagePath=Xc;exports.useLocale=Ra;exports.useOverlay=V4;exports.useRepliesFeed=pp;exports.useScrollListener=I4;exports.useScrollToHash=ym;exports.useScrollToPost=Lm;exports.useTooltips=Em;exports.useUser=e1;