@apolitical/component-library 8.5.0 → 8.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -28,7 +28,7 @@ Check the render method of \``+K+"`."}return""}}function M3(K){{if(K!==void 0){v
|
|
|
28
28
|
|
|
29
29
|
Check your code at `+ve+":"+Ae+"."}return""}}var k0={};function L3(K){{var ve=S0();if(!ve){var Ae=typeof K=="string"?K:K.displayName||K.name;Ae&&(ve=`
|
|
30
30
|
|
|
31
|
-
Check the top-level render call using <`+Ae+">.")}return ve}}function D0(K,ve){{if(!K._store||K._store.validated||K.key!=null)return;K._store.validated=!0;var Ae=L3(ve);if(k0[Ae])return;k0[Ae]=!0;var He="";K&&K._owner&&K._owner!==Tt.current&&(He=" It was passed a child from "+k(K._owner.type)+"."),qn(K),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Ae,He),qn(null)}}function O0(K,ve){{if(typeof K!="object")return;if(We(K))for(var Ae=0;Ae<K.length;Ae++){var He=K[Ae];U1(He)&&D0(He,ve)}else if(U1(K))K._store&&(K._store.validated=!0);else if(K){var ht=E(K);if(typeof ht=="function"&&ht!==K.entries)for(var At=ht.call(K),lt;!(lt=At.next()).done;)U1(lt.value)&&D0(lt.value,ve)}}}function $3(K){{var ve=K.type;if(ve==null||typeof ve=="string")return;var Ae;if(typeof ve=="function")Ae=ve.propTypes;else if(typeof ve=="object"&&(ve.$$typeof===l||ve.$$typeof===d))Ae=ve.propTypes;else return;if(Ae){var He=k(ve);Qe(Ae,K.props,"prop",He,K)}else if(ve.PropTypes!==void 0&&!H1){H1=!0;var ht=k(ve);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ht||"Unknown")}typeof ve.getDefaultProps=="function"&&!ve.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function j3(K){{for(var ve=Object.keys(K.props),Ae=0;Ae<ve.length;Ae++){var He=ve[Ae];if(He!=="children"&&He!=="key"){qn(K),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",He),qn(null);break}}K.ref!==null&&(qn(K),b("Invalid attribute `ref` supplied to `React.Fragment`."),qn(null))}}function N0(K,ve,Ae,He,ht,At){{var lt=L(K);if(!lt){var nt="";(K===void 0||typeof K=="object"&&K!==null&&Object.keys(K).length===0)&&(nt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var cn=M3(ht);cn?nt+=cn:nt+=S0();var Ht;K===null?Ht="null":We(K)?Ht="array":K!==void 0&&K.$$typeof===t?(Ht="<"+(k(K.type)||"Unknown")+" />",nt=" Did you accidentally export a JSX literal instead of a component?"):Ht=typeof K,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ht,nt)}var zt=vn(K,ve,Ae,ht,At);if(zt==null)return zt;if(lt){var Wn=ve.children;if(Wn!==void 0)if(He)if(We(Wn)){for(var za=0;za<Wn.length;za++)O0(Wn[za],K);Object.freeze&&Object.freeze(Wn)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else O0(Wn,K)}return K===r?j3(zt):$3(zt),zt}}function H3(K,ve,Ae){return N0(K,ve,Ae,!0)}function U3(K,ve,Ae){return N0(K,ve,Ae,!1)}var z3=U3,q3=H3;io.Fragment=r,io.jsx=z3,io.jsxs=q3}()),io}process.env.NODE_ENV==="production"?eh.exports=J3():eh.exports=ex();var h=eh.exports;const tx=50,nx=8,Gy=(e,t)=>{if(!e)return!1;const n=y.useRef(null),r=t||n;return y.useEffect(()=>{const i=r.current,a=()=>{if(i){const s=parseInt(i.style.height.replace("px",""))||0,o=i.scrollHeight,l=Math.abs(o-s);o!==s&&l>nx&&(i.style.height=`${o}px`,i.scrollHeight>=tx?i.classList.contains("single-line")&&i.classList.remove("single-line"):i.classList.contains("single-line")||i.classList.add("single-line"))}};if(i)return a(),i.addEventListener("input",a),()=>i.removeEventListener("input",a)},[]),r},Yy=()=>{const[e,t]=y.useState(window.location.pathname),n=()=>{const r=window.location.pathname;t(r)};return y.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),e},ks=(e,t)=>{const n=y.useRef(!1);y.useEffect(()=>{n.current?e():n.current=!0},t)};function rl(e,t,n){var r=this,i=y.useRef(null),a=y.useRef(0),s=y.useRef(null),o=y.useRef([]),l=y.useRef(),u=y.useRef(),c=y.useRef(e),d=y.useRef(!0);c.current=e;var f=typeof window<"u",p=!t&&t!==0&&f;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var g=!!(n=n||{}).leading,m=!("trailing"in n)||!!n.trailing,E="maxWait"in n,v="debounceOnServer"in n&&!!n.debounceOnServer,b=E?Math.max(+n.maxWait||0,t):null;y.useEffect(function(){return d.current=!0,function(){d.current=!1}},[]);var T=y.useMemo(function(){var C=function(L){var P=o.current,I=l.current;return o.current=l.current=null,a.current=L,u.current=c.current.apply(I,P)},_=function(L,P){p&&cancelAnimationFrame(s.current),s.current=p?requestAnimationFrame(L):setTimeout(L,P)},x=function(L){if(!d.current)return!1;var P=L-i.current;return!i.current||P>=t||P<0||E&&L-a.current>=b},S=function(L){return s.current=null,m&&o.current?C(L):(o.current=l.current=null,u.current)},F=function L(){var P=Date.now();if(x(P))return S(P);if(d.current){var I=t-(P-i.current),k=E?Math.min(I,b-(P-a.current)):I;_(L,k)}},R=function(){if(f||v){var L=Date.now(),P=x(L);if(o.current=[].slice.call(arguments),l.current=r,i.current=L,P){if(!s.current&&d.current)return a.current=i.current,_(F,t),g?C(i.current):u.current;if(E)return _(F,t),C(i.current)}return s.current||_(F,t),u.current}};return R.cancel=function(){s.current&&(p?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,o.current=i.current=l.current=s.current=null},R.isPending=function(){return!!s.current},R.flush=function(){return s.current?S(Date.now()):u.current},R},[g,E,t,b,m,p,f,v]);return T}function Zy(e,t,n){var r=n===void 0?{}:n,i=r.leading,a=r.trailing;return rl(e,t,{maxWait:t,leading:i===void 0||i,trailing:a===void 0||a})}let z1;const Yi=(e=!0,t=!1,n="window")=>{if(!e)return;const[r,i]=y.useState(0)||[!1,()=>{}],a=n==="window"?[]:[n];y.useEffect(()=>(o(),window.addEventListener("resize",u),window.addEventListener("hashchange",u),window.addEventListener("hiddenSectionVisible",l),()=>{clearTimeout(z1),u.flush(),window.removeEventListener("resize",u),window.removeEventListener("hashchange",u),window.removeEventListener("hiddenSectionVisible",l)}),a);const s=()=>{if(n)return n==="window"?window.innerWidth:n.offsetWidth},o=()=>{i(s())},l=({detail:c})=>{const{id:d}=c;n==="window"||!n.closest(`#${d}`)||s()===r||o()},u=Zy(()=>{s()!==r&&(t&&(clearTimeout(z1),document.body.classList.add("is-resizing"),z1=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),o())},500,{leading:!0});return r};var Qy=y.createContext({client:Vu});function rx(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,a=y.useMemo(function(){return n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&i&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n||(r&&(Vu.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),Vu.init(r,i)),Vu)},[n,r]);return y.createElement(Qy.Provider,{value:{client:a}},t)}var ix=function(){var e=y.useContext(Qy).client;return e};function th(e){var t=ix(),n=y.useState(),r=n[0],i=n[1];return y.useEffect(function(){return t.onFeatureFlags(function(){i(t.isFeatureEnabled(e))})},[t,e]),r}const cp=()=>{const e=th("homepage-next-ui"),{id:t}=y.useContext(Mt),[n,r]=y.useState(void 0);return y.useEffect(()=>{if(e===void 0)return;if(!t||!e){r("/home/");return}const i=ax("NEXT_LOCALE");if(i){r(`/${i}`);return}r(`/${gc.DEFAULT_LOCALE}`)},[e,t]),n};function ax(e){const t=document.cookie.match(new RegExp("(^|;\\s*)"+e+"=([^;]*)"));return t?decodeURIComponent(t[2]):null}const Xy=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[i,a]=y.useState({current:0,past:0})||[!1,()=>{}],[s,o]=y.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];y.useEffect(()=>(l(),window.addEventListener("scroll",u),()=>{u.flush(),window.removeEventListener("scroll",u)}),[]);const l=()=>{const c=window.scrollY,d=i.current,f=c-d,p=f>0?"down":"up";if(a({current:c,past:d}),p==="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=Zy(()=>{l()},250);return i},dp=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=y.useRef(!1);ks(()=>{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)},fp=(e=!1)=>{if(!e)return{showTooltip:!1,tooltipProps:{}};const[t,n]=y.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 F0={},sx=y.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=he.useIntl(),[f]=y.useState(e||Date.now().toString()),p=y.useRef(null),g=c||p,[m,E]=y.useState(n?"open":"hidden"),{extraPadding:v=!0,hasPointer:b=!1,hasForm:T=!1}=t,{onOpen:C=()=>{},onClose:_=()=>{}}=o,{readToScreenreadersWhenClosed:x=!1,...S}=l,F=F0[f];y.useEffect(()=>{const I=g==null?void 0:g.current;if(I)return I.addEventListener("transitionend",R),()=>{I.removeEventListener("transitionend",R)}},[]),y.useEffect(()=>{if(m!=="open")return;const I=k=>{k.key==="Escape"&&(k.stopPropagation(),k.preventDefault(),E("closed"))};return document.addEventListener("keyup",I),()=>{document.removeEventListener("keyup",I)}},[m]);const R=({propertyName:I})=>{I==="opacity"&&(F!==!1&&clearTimeout(F),E(k=>(k==="open"?C():k==="closed"&&_(),k==="opening"?"open":k==="closing"?"closed":k==="closed"?"hidden":k)))};ks(()=>{F!==!1&&clearTimeout(F);let I="open";n?E("opening"):(E("closing"),I="hidden"),F0[f||""]=setTimeout(()=>{E(I)},300)},[n]);const L={"aria-live":"polite",...u,...S};s&&s.onBlur&&(L.onBlur=s.onBlur);const P={className:"content"};return x?P.className=ee("content",{hidden:m==="hidden"}):P.hidden=m==="hidden",h.jsx("aside",{ref:g,id:f,className:ee("tooltip text-medium",m,a,{loading:r,"extra-padding":v,"has-pointer":b,bottom:b==="bottom","has-form":T}),...L,children:h.jsx("div",{...P,children:r?h.jsx("p",{children:d.formatMessage({id:"tooltip_loading"})}):typeof i=="string"?h.jsx("p",{children:i}):i})})}),Fa=y.memo(sx),Us=(e,t)=>{Array.isArray(t)||(t=[t]);const n=tr(e);return t.forEach(({type:r,value:i})=>{W3(n,r,i)}),n},Jy=e=>{const t=[];return e.forEach(n=>{const r=parseInt(n);isNaN(r)||t.push(r)}),t.sort((n,r)=>n-r)},e4=(e,t,n)=>{let r=n.mobile;for(const i in t){const a=parseInt(String(t[i]));if(e>=a)r=n[a];else if(e<a)break}return r},t4=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),n4=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()).replace(/[&\s]+/g,""),r4=(e="")=>e.charAt(0).toUpperCase()+e.slice(1),ox=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()),qr="https://assets.apolitical.co/",us={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},Do={ARTICLE:"microcourseArticle",DISCUSSION:"microcourseDiscussion",QUIZ:"assessmentQuiz"},nh="SU:",il="DELETED",i4="Invalid token error: Logging user out...",lx="250,000+",ux="160+",al=/@{{([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})}}/g,a4=new RegExp("(?<=^|\\s)@([A-Za-z]+(?:[- ]?[A-Za-z]*)*)$"),hp={LOCAL_STORAGE:{},SESSION_STORAGE:{EMAIL:"email"}};function cx(e){return e?{"--icon":`url(${qr}icons/${e}.svg)`}:{}}const ba={milliseconds:{inSecond:1e3,inMinute:6e4,inHour:36e5,inDay:864e5},year:{weeks:52,days:365}},s4=(e,t="en")=>new Date(e).toLocaleString(t,{day:"numeric",month:"short"}),pp=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),rh=e=>{let t;const n=Ec(),r=Ec(new Date(e));try{t=n.getTime()-r.getTime()}catch{return""}const i=t/ba.milliseconds.inHour,a=Math.floor(t/ba.milliseconds.inDay);if(a<1)return i<1?{path:"now"}:{path:"hours",number:Math.floor(i)};if(a<7)return{path:"days",number:a};const s=Math.floor(a/7);return s<=ba.year.weeks?{path:"weeks",number:s}:{path:"years",number:Math.floor(a/ba.year.days)}},Ec=e=>{const n=(e||new Date).toUTCString();return new Date(n)},dx=(e,t,n)=>{let r;const i=Ec(),a=Ec(new Date(e));try{r=i.getTime()-a.getTime()}catch{return!1}switch(n){case"seconds":return r/ba.milliseconds.inSecond<=t;case"minutes":return r/ba.milliseconds.inMinute<=t;case"hours":return r/ba.milliseconds.inHour<=t}return!1},fx=(e,t)=>{const n=new Date(e);return Math.abs(new Date().getTime()-n.getTime())/(1e3*60*60*24)<t},B0=e=>new Promise(t=>setTimeout(t,e)),hx=()=>{let e=!1;return typeof window<"u"&&(e=!!(window&&window.location&&window.location.href&&window.location.href.includes("localhost"))),e},Nn={apolitical:"Apolitical",dates_now:"now",dates_hours:"{number}h",dates_days:"{number}d",dates_weeks:"{number}w",dates_years:"{number}y",card_carousel_viewAll:"View all",card_label_communityPage:"Community",card_label_event:"Event",card_label_learningHub:"Programme",card_label_listPage:"List",card_label_microcourse:"Course",card_label_qaQuestion:"Q&A",card_label_solutionArticle:"Article",card_bootcamp:"Email boot camp",card_ended:"Ended",card_new:"New",card_registered:"Registered",card_partner:"{partner} and {number} more",card_contributors_event:"Multiple speakers",card_contributors_solutionArticle:"Multiple authors",card_answers:"{number, plural, =0 {0 answers} one {# answer} other {# answers}}",card_time_ago:"{time} ago",card_time_read:"{time} min read",card_watch:"Watch recording",card_member_type_owner:"Admin",card_member_type_member:"Member",card_member_count:"{count} members",card_cta_people:"View profile",card_cta_communityPage:"Join now",card_cta_event:"Register now",card_cta_microcourse:"Enrol now",card_cta_communityPage_loading:"Joining...",card_cta_event_loading:"Registering...",card_cta_microcourse_loading:"Enrolling...",card_cta_communityPage_done:"Joined",card_cta_event_done:"Registered",card_cta_microcourse_done:"Enrolled",carousel_pagination_previous:"previous",carousel_pagination_previousSlide:"Previous slide",carousel_pagination_next:"next",carousel_pagination_nextSlide:"Next slide",carousel_pagination_slide:"Slide {number} of {total}",carousel_pagination_ariaLive:"On {direction} slide: {count, plural, one {1 card} other {# cards}} available",carousel_pagination_ariaLive_slide:"On slide {slide}: {count, plural, one {1 card} other {# cards}} available",activitySection_notFoundError:"Post not found",activitySection_language_switcher_info:"Our global community means you might see replies in other languages, even with a filter.",activitySection_language_switcher_all_languages_option:"Languages: All",activitiesFeed_sorting_label:"Choose feed sorting method",activitiesFeed_rankingMethod_recent:"Recent",activitiesFeed_rankingMethod_popular:"Popular",activitiesFeed_rankingMethod_internalTesting:"Testing",activitiesFeed_noActivities_inCategories:"There are no posts of this type yet.",activitiesFeed_noActivities:"Activities will appear here.",activitiesFeed_noActivities_button:"Explore Communities",communityDetails_members:"Members",communityDetails_viewAll:"View all",communityDetails_invite:"Invite colleagues",community_joinToPost:"Join community to create a post.",community_sortSuccess:"Feed ordered by {order}",joinCommunityButton:"Join community",joinCommunityButton_short:"Join",joinCommunityButton_joining:"Joining...",joinCommunityButton_member:"Member",joinCommunityButton_member_aria:"Leave community",joinCommunityButton_options_menu:"Options menu",joinCommunityButton_leaving:"Leaving...",joinCommunityButton_closed_tooltip:"Please contact the admin of this closed community if you would like to join it.",joinCommunityButton_aria_live:"You are {action} this community",member_apolitical:"Apolitical",member_community:"Community post",member_deleted:"Deleted user",member_profile:"Update profile",member_createdAt_community:"{time} ago in <link>{community}</link>",member_createdNow_community:"now in <link>{community}</link>",membersList:"Members",membersList_admin:"Admin",membersList_profile:"Update profile",membersList_modal_title:"Update profile",courseStructure_section:"{number, plural, =0 {Start here} other {Section #}}",courseStructure_section_end:"End here",courseStructure_time_left:"left",courseStructure_time_completed:"Completed",courseProgression_done:"<percent>{number}%</percent> done",courseProgression_timeLeft:"left","lessonType_analyse-data":"Analyse data","lessonType_analyse-scenarios":"Analyse scenarios","lessonType_attend-webinar":"Attend webinar","lessonType_brainstorm-ideas":"Brainstorm ideas","lessonType_discuss-with-peers":"Discuss with peers","lessonType_discuss-with-team":"Discuss with team","lessonType_do-activity":"Do activity","lessonType_do-assessment":"Do assessment","lessonType_explore-casebook":"Explore casebook","lessonType_fill-out-workbook":"Fill out workbook","lessonType_fill-out-worksheet":"Fill out worksheet","lessonType_investigate-interview":"Investigate interview","lessonType_listen-to-audio":"Listen to audio","lessonType_listen-to-audiocast":"Listen to audiocast","lessonType_listen-to-podcast":"Listen to podcast","lessonType_read-article":"Read article","lessonType_read-article-by-expert":"Read article by expert","lessonType_read-article-by-public-servant":"Read article by public servant","lessonType_read-conclusion":"Read conclusion","lessonType_read-infographic":"Read infographic","lessonType_read-introduction":"Read introduction","lessonType_read-resource":"Read resource","lessonType_reflect-on-content":"Reflect on content","lessonType_share-experiences":"Share experiences","lessonType_take-quiz":"Take quiz","lessonType_use-toolkit":"Use toolkit","lessonType_watch-video":"Watch video","lessonType_watch-webinar":"Watch webinar",markCompleteButton:"Mark as complete",markCompleteButton_completed:"Lesson complete",discussion_action_answer:"answer",discussion_action_comment:"comment",discussion_action_edit:"Edit",discussion_action_poll:"poll",discussion_action_post:"post",discussion_action_response:"response",discussion_action_reply:"reply",discussion_action_question:"question",discussion_edited:"Edited",discussion_delete_title:"Delete {action}",discussion_delete_text:"<p>Are you sure you want to delete your {action}?</p><p>This can't be undone.</p>",discussion_delete_cancel:"Cancel",discussion_delete_delete:"Delete",discussion_delete_error:"We are unable to delete your {action} at the moment. Please try again later or contact us if problem persists.",discussion_pinned_post:"Pinned Post",discussion_reply:"Reply",discussion_report_subject:"Report a post on Apolitical",discussion_report_body:`I'd like to report the {contentType} <{contentSlug}> at {contentUrl}.
|
|
31
|
+
Check the top-level render call using <`+Ae+">.")}return ve}}function D0(K,ve){{if(!K._store||K._store.validated||K.key!=null)return;K._store.validated=!0;var Ae=L3(ve);if(k0[Ae])return;k0[Ae]=!0;var He="";K&&K._owner&&K._owner!==Tt.current&&(He=" It was passed a child from "+k(K._owner.type)+"."),qn(K),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Ae,He),qn(null)}}function O0(K,ve){{if(typeof K!="object")return;if(We(K))for(var Ae=0;Ae<K.length;Ae++){var He=K[Ae];U1(He)&&D0(He,ve)}else if(U1(K))K._store&&(K._store.validated=!0);else if(K){var ht=E(K);if(typeof ht=="function"&&ht!==K.entries)for(var At=ht.call(K),lt;!(lt=At.next()).done;)U1(lt.value)&&D0(lt.value,ve)}}}function $3(K){{var ve=K.type;if(ve==null||typeof ve=="string")return;var Ae;if(typeof ve=="function")Ae=ve.propTypes;else if(typeof ve=="object"&&(ve.$$typeof===l||ve.$$typeof===d))Ae=ve.propTypes;else return;if(Ae){var He=k(ve);Qe(Ae,K.props,"prop",He,K)}else if(ve.PropTypes!==void 0&&!H1){H1=!0;var ht=k(ve);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ht||"Unknown")}typeof ve.getDefaultProps=="function"&&!ve.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function j3(K){{for(var ve=Object.keys(K.props),Ae=0;Ae<ve.length;Ae++){var He=ve[Ae];if(He!=="children"&&He!=="key"){qn(K),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",He),qn(null);break}}K.ref!==null&&(qn(K),b("Invalid attribute `ref` supplied to `React.Fragment`."),qn(null))}}function N0(K,ve,Ae,He,ht,At){{var lt=L(K);if(!lt){var nt="";(K===void 0||typeof K=="object"&&K!==null&&Object.keys(K).length===0)&&(nt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var cn=M3(ht);cn?nt+=cn:nt+=S0();var Ht;K===null?Ht="null":We(K)?Ht="array":K!==void 0&&K.$$typeof===t?(Ht="<"+(k(K.type)||"Unknown")+" />",nt=" Did you accidentally export a JSX literal instead of a component?"):Ht=typeof K,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ht,nt)}var zt=vn(K,ve,Ae,ht,At);if(zt==null)return zt;if(lt){var Wn=ve.children;if(Wn!==void 0)if(He)if(We(Wn)){for(var za=0;za<Wn.length;za++)O0(Wn[za],K);Object.freeze&&Object.freeze(Wn)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else O0(Wn,K)}return K===r?j3(zt):$3(zt),zt}}function H3(K,ve,Ae){return N0(K,ve,Ae,!0)}function U3(K,ve,Ae){return N0(K,ve,Ae,!1)}var z3=U3,q3=H3;io.Fragment=r,io.jsx=z3,io.jsxs=q3}()),io}process.env.NODE_ENV==="production"?eh.exports=J3():eh.exports=ex();var h=eh.exports;const tx=50,nx=8,Gy=(e,t)=>{if(!e)return!1;const n=y.useRef(null),r=t||n;return y.useEffect(()=>{const i=r.current,a=()=>{if(i){const s=parseInt(i.style.height.replace("px",""))||0,o=i.scrollHeight,l=Math.abs(o-s);o!==s&&l>nx&&(i.style.height=`${o}px`,i.scrollHeight>=tx?i.classList.contains("single-line")&&i.classList.remove("single-line"):i.classList.contains("single-line")||i.classList.add("single-line"))}};if(i)return a(),i.addEventListener("input",a),()=>i.removeEventListener("input",a)},[]),r},Yy=()=>{const[e,t]=y.useState(window.location.pathname),n=()=>{const r=window.location.pathname;t(r)};return y.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),e},ks=(e,t)=>{const n=y.useRef(!1);y.useEffect(()=>{n.current?e():n.current=!0},t)};function rl(e,t,n){var r=this,i=y.useRef(null),a=y.useRef(0),s=y.useRef(null),o=y.useRef([]),l=y.useRef(),u=y.useRef(),c=y.useRef(e),d=y.useRef(!0);c.current=e;var f=typeof window<"u",p=!t&&t!==0&&f;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var g=!!(n=n||{}).leading,m=!("trailing"in n)||!!n.trailing,E="maxWait"in n,v="debounceOnServer"in n&&!!n.debounceOnServer,b=E?Math.max(+n.maxWait||0,t):null;y.useEffect(function(){return d.current=!0,function(){d.current=!1}},[]);var T=y.useMemo(function(){var C=function(L){var P=o.current,I=l.current;return o.current=l.current=null,a.current=L,u.current=c.current.apply(I,P)},_=function(L,P){p&&cancelAnimationFrame(s.current),s.current=p?requestAnimationFrame(L):setTimeout(L,P)},x=function(L){if(!d.current)return!1;var P=L-i.current;return!i.current||P>=t||P<0||E&&L-a.current>=b},S=function(L){return s.current=null,m&&o.current?C(L):(o.current=l.current=null,u.current)},F=function L(){var P=Date.now();if(x(P))return S(P);if(d.current){var I=t-(P-i.current),k=E?Math.min(I,b-(P-a.current)):I;_(L,k)}},R=function(){if(f||v){var L=Date.now(),P=x(L);if(o.current=[].slice.call(arguments),l.current=r,i.current=L,P){if(!s.current&&d.current)return a.current=i.current,_(F,t),g?C(i.current):u.current;if(E)return _(F,t),C(i.current)}return s.current||_(F,t),u.current}};return R.cancel=function(){s.current&&(p?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,o.current=i.current=l.current=s.current=null},R.isPending=function(){return!!s.current},R.flush=function(){return s.current?S(Date.now()):u.current},R},[g,E,t,b,m,p,f,v]);return T}function Zy(e,t,n){var r=n===void 0?{}:n,i=r.leading,a=r.trailing;return rl(e,t,{maxWait:t,leading:i===void 0||i,trailing:a===void 0||a})}let z1;const Yi=(e=!0,t=!1,n="window")=>{if(!e)return;const[r,i]=y.useState(0)||[!1,()=>{}],a=n==="window"?[]:[n];y.useEffect(()=>(o(),window.addEventListener("resize",u),window.addEventListener("hashchange",u),window.addEventListener("hiddenSectionVisible",l),()=>{clearTimeout(z1),u.flush(),window.removeEventListener("resize",u),window.removeEventListener("hashchange",u),window.removeEventListener("hiddenSectionVisible",l)}),a);const s=()=>{if(n)return n==="window"?window.innerWidth:n.offsetWidth},o=()=>{i(s())},l=({detail:c})=>{const{id:d}=c;n==="window"||!n.closest(`#${d}`)||s()===r||o()},u=Zy(()=>{s()!==r&&(t&&(clearTimeout(z1),document.body.classList.add("is-resizing"),z1=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),o())},500,{leading:!0});return r};var Qy=y.createContext({client:Vu});function rx(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,a=y.useMemo(function(){return n&&r&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&i&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n||(r&&(Vu.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),Vu.init(r,i)),Vu)},[n,r]);return y.createElement(Qy.Provider,{value:{client:a}},t)}var ix=function(){var e=y.useContext(Qy).client;return e};function th(e){var t=ix(),n=y.useState(),r=n[0],i=n[1];return y.useEffect(function(){return t.onFeatureFlags(function(){i(t.isFeatureEnabled(e))})},[t,e]),r}const cp=()=>{const e=th("homepage-next-ui"),{id:t}=y.useContext(Mt),[n,r]=y.useState(void 0);return y.useEffect(()=>{if(e===void 0)return;if(!t||!e){r("/home/");return}const i=ax("apolitical_locale");if(i){r(`/${i}`);return}r(`/${gc.DEFAULT_LOCALE}`)},[e,t]),n};function ax(e){const t=document.cookie.match(new RegExp("(^|;\\s*)"+e+"=([^;]*)"));return t?decodeURIComponent(t[2]):null}const Xy=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[i,a]=y.useState({current:0,past:0})||[!1,()=>{}],[s,o]=y.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];y.useEffect(()=>(l(),window.addEventListener("scroll",u),()=>{u.flush(),window.removeEventListener("scroll",u)}),[]);const l=()=>{const c=window.scrollY,d=i.current,f=c-d,p=f>0?"down":"up";if(a({current:c,past:d}),p==="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=Zy(()=>{l()},250);return i},dp=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=y.useRef(!1);ks(()=>{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)},fp=(e=!1)=>{if(!e)return{showTooltip:!1,tooltipProps:{}};const[t,n]=y.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 F0={},sx=y.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=he.useIntl(),[f]=y.useState(e||Date.now().toString()),p=y.useRef(null),g=c||p,[m,E]=y.useState(n?"open":"hidden"),{extraPadding:v=!0,hasPointer:b=!1,hasForm:T=!1}=t,{onOpen:C=()=>{},onClose:_=()=>{}}=o,{readToScreenreadersWhenClosed:x=!1,...S}=l,F=F0[f];y.useEffect(()=>{const I=g==null?void 0:g.current;if(I)return I.addEventListener("transitionend",R),()=>{I.removeEventListener("transitionend",R)}},[]),y.useEffect(()=>{if(m!=="open")return;const I=k=>{k.key==="Escape"&&(k.stopPropagation(),k.preventDefault(),E("closed"))};return document.addEventListener("keyup",I),()=>{document.removeEventListener("keyup",I)}},[m]);const R=({propertyName:I})=>{I==="opacity"&&(F!==!1&&clearTimeout(F),E(k=>(k==="open"?C():k==="closed"&&_(),k==="opening"?"open":k==="closing"?"closed":k==="closed"?"hidden":k)))};ks(()=>{F!==!1&&clearTimeout(F);let I="open";n?E("opening"):(E("closing"),I="hidden"),F0[f||""]=setTimeout(()=>{E(I)},300)},[n]);const L={"aria-live":"polite",...u,...S};s&&s.onBlur&&(L.onBlur=s.onBlur);const P={className:"content"};return x?P.className=ee("content",{hidden:m==="hidden"}):P.hidden=m==="hidden",h.jsx("aside",{ref:g,id:f,className:ee("tooltip text-medium",m,a,{loading:r,"extra-padding":v,"has-pointer":b,bottom:b==="bottom","has-form":T}),...L,children:h.jsx("div",{...P,children:r?h.jsx("p",{children:d.formatMessage({id:"tooltip_loading"})}):typeof i=="string"?h.jsx("p",{children:i}):i})})}),Fa=y.memo(sx),Us=(e,t)=>{Array.isArray(t)||(t=[t]);const n=tr(e);return t.forEach(({type:r,value:i})=>{W3(n,r,i)}),n},Jy=e=>{const t=[];return e.forEach(n=>{const r=parseInt(n);isNaN(r)||t.push(r)}),t.sort((n,r)=>n-r)},e4=(e,t,n)=>{let r=n.mobile;for(const i in t){const a=parseInt(String(t[i]));if(e>=a)r=n[a];else if(e<a)break}return r},t4=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),n4=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()).replace(/[&\s]+/g,""),r4=(e="")=>e.charAt(0).toUpperCase()+e.slice(1),ox=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()),qr="https://assets.apolitical.co/",us={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},Do={ARTICLE:"microcourseArticle",DISCUSSION:"microcourseDiscussion",QUIZ:"assessmentQuiz"},nh="SU:",il="DELETED",i4="Invalid token error: Logging user out...",lx="250,000+",ux="160+",al=/@{{([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})}}/g,a4=new RegExp("(?<=^|\\s)@([A-Za-z]+(?:[- ]?[A-Za-z]*)*)$"),hp={LOCAL_STORAGE:{},SESSION_STORAGE:{EMAIL:"email"}};function cx(e){return e?{"--icon":`url(${qr}icons/${e}.svg)`}:{}}const ba={milliseconds:{inSecond:1e3,inMinute:6e4,inHour:36e5,inDay:864e5},year:{weeks:52,days:365}},s4=(e,t="en")=>new Date(e).toLocaleString(t,{day:"numeric",month:"short"}),pp=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),rh=e=>{let t;const n=Ec(),r=Ec(new Date(e));try{t=n.getTime()-r.getTime()}catch{return""}const i=t/ba.milliseconds.inHour,a=Math.floor(t/ba.milliseconds.inDay);if(a<1)return i<1?{path:"now"}:{path:"hours",number:Math.floor(i)};if(a<7)return{path:"days",number:a};const s=Math.floor(a/7);return s<=ba.year.weeks?{path:"weeks",number:s}:{path:"years",number:Math.floor(a/ba.year.days)}},Ec=e=>{const n=(e||new Date).toUTCString();return new Date(n)},dx=(e,t,n)=>{let r;const i=Ec(),a=Ec(new Date(e));try{r=i.getTime()-a.getTime()}catch{return!1}switch(n){case"seconds":return r/ba.milliseconds.inSecond<=t;case"minutes":return r/ba.milliseconds.inMinute<=t;case"hours":return r/ba.milliseconds.inHour<=t}return!1},fx=(e,t)=>{const n=new Date(e);return Math.abs(new Date().getTime()-n.getTime())/(1e3*60*60*24)<t},B0=e=>new Promise(t=>setTimeout(t,e)),hx=()=>{let e=!1;return typeof window<"u"&&(e=!!(window&&window.location&&window.location.href&&window.location.href.includes("localhost"))),e},Nn={apolitical:"Apolitical",dates_now:"now",dates_hours:"{number}h",dates_days:"{number}d",dates_weeks:"{number}w",dates_years:"{number}y",card_carousel_viewAll:"View all",card_label_communityPage:"Community",card_label_event:"Event",card_label_learningHub:"Programme",card_label_listPage:"List",card_label_microcourse:"Course",card_label_qaQuestion:"Q&A",card_label_solutionArticle:"Article",card_bootcamp:"Email boot camp",card_ended:"Ended",card_new:"New",card_registered:"Registered",card_partner:"{partner} and {number} more",card_contributors_event:"Multiple speakers",card_contributors_solutionArticle:"Multiple authors",card_answers:"{number, plural, =0 {0 answers} one {# answer} other {# answers}}",card_time_ago:"{time} ago",card_time_read:"{time} min read",card_watch:"Watch recording",card_member_type_owner:"Admin",card_member_type_member:"Member",card_member_count:"{count} members",card_cta_people:"View profile",card_cta_communityPage:"Join now",card_cta_event:"Register now",card_cta_microcourse:"Enrol now",card_cta_communityPage_loading:"Joining...",card_cta_event_loading:"Registering...",card_cta_microcourse_loading:"Enrolling...",card_cta_communityPage_done:"Joined",card_cta_event_done:"Registered",card_cta_microcourse_done:"Enrolled",carousel_pagination_previous:"previous",carousel_pagination_previousSlide:"Previous slide",carousel_pagination_next:"next",carousel_pagination_nextSlide:"Next slide",carousel_pagination_slide:"Slide {number} of {total}",carousel_pagination_ariaLive:"On {direction} slide: {count, plural, one {1 card} other {# cards}} available",carousel_pagination_ariaLive_slide:"On slide {slide}: {count, plural, one {1 card} other {# cards}} available",activitySection_notFoundError:"Post not found",activitySection_language_switcher_info:"Our global community means you might see replies in other languages, even with a filter.",activitySection_language_switcher_all_languages_option:"Languages: All",activitiesFeed_sorting_label:"Choose feed sorting method",activitiesFeed_rankingMethod_recent:"Recent",activitiesFeed_rankingMethod_popular:"Popular",activitiesFeed_rankingMethod_internalTesting:"Testing",activitiesFeed_noActivities_inCategories:"There are no posts of this type yet.",activitiesFeed_noActivities:"Activities will appear here.",activitiesFeed_noActivities_button:"Explore Communities",communityDetails_members:"Members",communityDetails_viewAll:"View all",communityDetails_invite:"Invite colleagues",community_joinToPost:"Join community to create a post.",community_sortSuccess:"Feed ordered by {order}",joinCommunityButton:"Join community",joinCommunityButton_short:"Join",joinCommunityButton_joining:"Joining...",joinCommunityButton_member:"Member",joinCommunityButton_member_aria:"Leave community",joinCommunityButton_options_menu:"Options menu",joinCommunityButton_leaving:"Leaving...",joinCommunityButton_closed_tooltip:"Please contact the admin of this closed community if you would like to join it.",joinCommunityButton_aria_live:"You are {action} this community",member_apolitical:"Apolitical",member_community:"Community post",member_deleted:"Deleted user",member_profile:"Update profile",member_createdAt_community:"{time} ago in <link>{community}</link>",member_createdNow_community:"now in <link>{community}</link>",membersList:"Members",membersList_admin:"Admin",membersList_profile:"Update profile",membersList_modal_title:"Update profile",courseStructure_section:"{number, plural, =0 {Start here} other {Section #}}",courseStructure_section_end:"End here",courseStructure_time_left:"left",courseStructure_time_completed:"Completed",courseProgression_done:"<percent>{number}%</percent> done",courseProgression_timeLeft:"left","lessonType_analyse-data":"Analyse data","lessonType_analyse-scenarios":"Analyse scenarios","lessonType_attend-webinar":"Attend webinar","lessonType_brainstorm-ideas":"Brainstorm ideas","lessonType_discuss-with-peers":"Discuss with peers","lessonType_discuss-with-team":"Discuss with team","lessonType_do-activity":"Do activity","lessonType_do-assessment":"Do assessment","lessonType_explore-casebook":"Explore casebook","lessonType_fill-out-workbook":"Fill out workbook","lessonType_fill-out-worksheet":"Fill out worksheet","lessonType_investigate-interview":"Investigate interview","lessonType_listen-to-audio":"Listen to audio","lessonType_listen-to-audiocast":"Listen to audiocast","lessonType_listen-to-podcast":"Listen to podcast","lessonType_read-article":"Read article","lessonType_read-article-by-expert":"Read article by expert","lessonType_read-article-by-public-servant":"Read article by public servant","lessonType_read-conclusion":"Read conclusion","lessonType_read-infographic":"Read infographic","lessonType_read-introduction":"Read introduction","lessonType_read-resource":"Read resource","lessonType_reflect-on-content":"Reflect on content","lessonType_share-experiences":"Share experiences","lessonType_take-quiz":"Take quiz","lessonType_use-toolkit":"Use toolkit","lessonType_watch-video":"Watch video","lessonType_watch-webinar":"Watch webinar",markCompleteButton:"Mark as complete",markCompleteButton_completed:"Lesson complete",discussion_action_answer:"answer",discussion_action_comment:"comment",discussion_action_edit:"Edit",discussion_action_poll:"poll",discussion_action_post:"post",discussion_action_response:"response",discussion_action_reply:"reply",discussion_action_question:"question",discussion_edited:"Edited",discussion_delete_title:"Delete {action}",discussion_delete_text:"<p>Are you sure you want to delete your {action}?</p><p>This can't be undone.</p>",discussion_delete_cancel:"Cancel",discussion_delete_delete:"Delete",discussion_delete_error:"We are unable to delete your {action} at the moment. Please try again later or contact us if problem persists.",discussion_pinned_post:"Pinned Post",discussion_reply:"Reply",discussion_report_subject:"Report a post on Apolitical",discussion_report_body:`I'd like to report the {contentType} <{contentSlug}> at {contentUrl}.
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
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.
|
package/index.mjs
CHANGED