@apolitical/component-library 8.1.0 → 8.2.0-bht.0

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.
@@ -1 +1 @@
1
- export declare const ASSETS_BUCKET = "https://storage.googleapis.com/apolitical-assets/";
1
+ export declare const ASSETS_BUCKET = "https://assets.apolitical.co/";
package/index.js CHANGED
@@ -28,7 +28,7 @@ Check the render method of \``+$+"`."}return""}}function Bh($){{if($!==void 0){v
28
28
 
29
29
  Check your code at `+ue+":"+fe+"."}return""}}var wu={};function Th($){{var ue=xu();if(!ue){var fe=typeof $=="string"?$:$.displayName||$.name;fe&&(ue=`
30
30
 
31
- Check the top-level render call using <`+fe+">.")}return ue}}function Cu($,ue){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var fe=Th(ue);if(wu[fe])return;wu[fe]=!0;var ke="";$&&$._owner&&$._owner!==Cr.current&&(ke=" It was passed a child from "+F($._owner.type)+"."),qn($),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',fe,ke),qn(null)}}function Du($,ue){{if(typeof $!="object")return;if(Te($))for(var fe=0;fe<$.length;fe++){var ke=$[fe];Sa(ke)&&Cu(ke,ue)}else if(Sa($))$._store&&($._store.validated=!0);else if($){var Ne=b($);if(typeof Ne=="function"&&Ne!==$.entries)for(var Ve=Ne.call($),Pe;!(Pe=Ve.next()).done;)Sa(Pe.value)&&Cu(Pe.value,ue)}}}function Sh($){{var ue=$.type;if(ue==null||typeof ue=="string")return;var fe;if(typeof ue=="function")fe=ue.propTypes;else if(typeof ue=="object"&&(ue.$$typeof===l||ue.$$typeof===m))fe=ue.propTypes;else return;if(fe){var ke=F(ue);He(fe,$.props,"prop",ke,$)}else if(ue.PropTypes!==void 0&&!Ta){Ta=!0;var Ne=F(ue);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ne||"Unknown")}typeof ue.getDefaultProps=="function"&&!ue.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function jh($){{for(var ue=Object.keys($.props),fe=0;fe<ue.length;fe++){var ke=ue[fe];if(ke!=="children"&&ke!=="key"){qn($),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ke),qn(null);break}}$.ref!==null&&(qn($),y("Invalid attribute `ref` supplied to `React.Fragment`."),qn(null))}}function Eu($,ue,fe,ke,Ne,Ve){{var Pe=z($);if(!Pe){var je="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(je+=" 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 ct=Bh(Ne);ct?je+=ct:je+=xu();var Xe;$===null?Xe="null":Te($)?Xe="array":$!==void 0&&$.$$typeof===t?(Xe="<"+(F($.type)||"Unknown")+" />",je=" Did you accidentally export a JSX literal instead of a component?"):Xe=typeof $,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Xe,je)}var nt=Ba($,ue,fe,Ne,Ve);if(nt==null)return nt;if(Pe){var Bt=ue.children;if(Bt!==void 0)if(ke)if(Te(Bt)){for(var Un=0;Un<Bt.length;Un++)Du(Bt[Un],$);Object.freeze&&Object.freeze(Bt)}else y("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 Du(Bt,$)}return $===r?jh(nt):Sh(nt),nt}}function Ph($,ue,fe){return Eu($,ue,fe,!0)}function Oh($,ue,fe){return Eu($,ue,fe,!1)}var Mh=Oh,Nh=Ph;Er.Fragment=r,Er.jsx=Mh,Er.jsxs=Nh}()),Er}process.env.NODE_ENV==="production"?js.exports=Wh():js.exports=Vh();var c=js.exports;const Hh=50,Kh=8,yd=(e,t)=>{if(!e)return!1;const n=x.useRef(null),r=t||n;return x.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>Kh&&(i.style.height=`${o}px`,i.scrollHeight>=Hh?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},xd=()=>{const[e,t]=x.useState(window.location.pathname),n=()=>{const r=window.location.pathname;t(r)};return x.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),e},or=(e,t)=>{const n=x.useRef(!1);x.useEffect(()=>{n.current?e():n.current=!0},t)};function Wr(e,t,n){var r=this,i=x.useRef(null),a=x.useRef(0),s=x.useRef(null),o=x.useRef([]),l=x.useRef(),u=x.useRef(),d=x.useRef(e),m=x.useRef(!0);d.current=e;var h=typeof window<"u",p=!t&&t!==0&&h;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(n=n||{}).leading,f=!("trailing"in n)||!!n.trailing,b="maxWait"in n,g="debounceOnServer"in n&&!!n.debounceOnServer,y=b?Math.max(+n.maxWait||0,t):null;x.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var C=x.useMemo(function(){var k=function(z){var O=o.current,A=l.current;return o.current=l.current=null,a.current=z,u.current=d.current.apply(A,O)},E=function(z,O){p&&cancelAnimationFrame(s.current),s.current=p?requestAnimationFrame(z):setTimeout(z,O)},_=function(z){if(!m.current)return!1;var O=z-i.current;return!i.current||O>=t||O<0||b&&z-a.current>=y},T=function(z){return s.current=null,f&&o.current?k(z):(o.current=l.current=null,u.current)},P=function z(){var O=Date.now();if(_(O))return T(O);if(m.current){var A=t-(O-i.current),F=b?Math.min(A,y-(O-a.current)):A;E(z,F)}},N=function(){if(h||g){var z=Date.now(),O=_(z);if(o.current=[].slice.call(arguments),l.current=r,i.current=z,O){if(!s.current&&m.current)return a.current=i.current,E(P,t),v?k(i.current):u.current;if(b)return E(P,t),k(i.current)}return s.current||E(P,t),u.current}};return N.cancel=function(){s.current&&(p?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,o.current=i.current=l.current=s.current=null},N.isPending=function(){return!!s.current},N.flush=function(){return s.current?T(Date.now()):u.current},N},[v,b,t,y,f,p,h,g]);return C}function wd(e,t,n){var r=n===void 0?{}:n,i=r.leading,a=r.trailing;return Wr(e,t,{maxWait:t,leading:i===void 0||i,trailing:a===void 0||a})}let ja;const wn=(e=!0,t=!1,n="window")=>{if(!e)return;const[r,i]=x.useState(0)||[!1,()=>{}],a=n==="window"?[]:[n];x.useEffect(()=>(o(),window.addEventListener("resize",u),window.addEventListener("hashchange",u),window.addEventListener("hiddenSectionVisible",l),()=>{clearTimeout(ja),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:d})=>{const{id:m}=d;n==="window"||!n.closest(`#${m}`)||s()===r||o()},u=wd(()=>{s()!==r&&(t&&(clearTimeout(ja),document.body.classList.add("is-resizing"),ja=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),o())},500,{leading:!0});return r},Cd=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[i,a]=x.useState({current:0,past:0})||[!1,()=>{}],[s,o]=x.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];x.useEffect(()=>(l(),window.addEventListener("scroll",u),()=>{u.flush(),window.removeEventListener("scroll",u)}),[]);const l=()=>{const d=window.scrollY,m=i.current,h=d-m,p=h>0?"down":"up";if(a({current:d,past:m}),p==="down"){d>=e+t.down&&!s.scrollDown&&(!s.scrollUp||h>t.up)&&(n(),o({scrollUp:!1,scrollDown:!0}));return}Math.abs(h)>=t.up&&!s.scrollUp&&(r(),o({scrollUp:!0,scrollDown:!1}))},u=wd(()=>{l()},250);return i},ho=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=x.useRef(!1);or(()=>{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)},po=(e=!1)=>{if(!e)return{showTooltip:!1,tooltipProps:{}};const[t,n]=x.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 Au={},Zh=x.forwardRef(({id:e,styling:t={},isOpen:n=!1,isLoading:r=!1,children:i,className:a="",functions:s={},callbacks:o={},accessibility:l={},...u},d)=>{const m=ie.useIntl(),[h]=x.useState(e||Date.now().toString()),p=x.useRef(null),v=d||p,[f,b]=x.useState(n?"open":"hidden"),{extraPadding:g=!0,hasPointer:y=!1,hasForm:C=!1}=t,{onOpen:k=()=>{},onClose:E=()=>{}}=o,{readToScreenreadersWhenClosed:_=!1,...T}=l,P=Au[h];x.useEffect(()=>{const A=v==null?void 0:v.current;if(A)return A.addEventListener("transitionend",N),()=>{A.removeEventListener("transitionend",N)}},[]),x.useEffect(()=>{if(f!=="open")return;const A=F=>{F.key==="Escape"&&(F.stopPropagation(),F.preventDefault(),b("closed"))};return document.addEventListener("keyup",A),()=>{document.removeEventListener("keyup",A)}},[f]);const N=({propertyName:A})=>{A==="opacity"&&(P!==!1&&clearTimeout(P),b(F=>(F==="open"?k():F==="closed"&&E(),F==="opening"?"open":F==="closing"?"closed":F==="closed"?"hidden":F)))};or(()=>{P!==!1&&clearTimeout(P);let A="open";n?b("opening"):(b("closing"),A="hidden"),Au[h||""]=setTimeout(()=>{b(A)},300)},[n]);const z={"aria-live":"polite",...u,...T};s&&s.onBlur&&(z.onBlur=s.onBlur);const O={className:"content"};return _?O.className=K("content",{hidden:f==="hidden"}):O.hidden=f==="hidden",c.jsx("aside",{ref:v,id:h,className:K("tooltip text-medium",f,a,{loading:r,"extra-padding":g,"has-pointer":y,bottom:y==="bottom","has-form":C}),...z,children:c.jsx("div",{...O,children:r?c.jsx("p",{children:m.formatMessage({id:"tooltip_loading"})}):typeof i=="string"?c.jsx("p",{children:i}):i})})}),Ln=x.memo(Zh),pr=(e,t)=>{Array.isArray(t)||(t=[t]);const n=Pt(e);return t.forEach(({type:r,value:i})=>{Ih(n,r,i)}),n},Dd=e=>{const t=[];return e.forEach(n=>{const r=parseInt(n);isNaN(r)||t.push(r)}),t.sort((n,r)=>n-r)},Ed=(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},_d=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),kd=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()).replace(/[&\s]+/g,""),Fd=(e="")=>e.charAt(0).toUpperCase()+e.slice(1),Yh=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()),Gt="https://storage.googleapis.com/apolitical-assets/",Qn={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},jr={ARTICLE:"microcourseArticle",DISCUSSION:"microcourseDiscussion",QUIZ:"assessmentQuiz"},Ps="SU:",Vr="DELETED",Ad="Invalid token error: Logging user out...",Gh="250,000+",Qh="160+",Hr=/@{{([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})}}/g,Bd=new RegExp("(?<=^|\\s)@([A-Za-z]+(?:[- ]?[A-Za-z]*)*)$");function Jh(e){return e?{"--icon":`url(${Gt}icons/${e}.svg)`}:{}}const Bn={milliseconds:{inSecond:1e3,inMinute:6e4,inHour:36e5,inDay:864e5},year:{weeks:52,days:365}},Td=(e,t="en")=>new Date(e).toLocaleString(t,{day:"numeric",month:"short"}),go=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),Os=e=>{let t;const n=Vi(),r=Vi(new Date(e));try{t=n.getTime()-r.getTime()}catch{return""}const i=t/Bn.milliseconds.inHour,a=Math.floor(t/Bn.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<=Bn.year.weeks?{path:"weeks",number:s}:{path:"years",number:Math.floor(a/Bn.year.days)}},Vi=e=>{const n=(e||new Date).toUTCString();return new Date(n)},Xh=(e,t,n)=>{let r;const i=Vi(),a=Vi(new Date(e));try{r=i.getTime()-a.getTime()}catch{return!1}switch(n){case"seconds":return r/Bn.milliseconds.inSecond<=t;case"minutes":return r/Bn.milliseconds.inMinute<=t;case"hours":return r/Bn.milliseconds.inHour<=t}return!1},ep=(e,t)=>{const n=new Date(e);return Math.abs(new Date().getTime()-n.getTime())/(1e3*60*60*24)<t},tp=e=>new Promise(t=>setTimeout(t,e)),np=()=>{let e=!1;return typeof window<"u"&&(e=!!(window&&window.location&&window.location.href&&window.location.href.includes("localhost"))),e},gr={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",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_leave:"Leave",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>",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_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 <`+fe+">.")}return ue}}function Cu($,ue){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var fe=Th(ue);if(wu[fe])return;wu[fe]=!0;var ke="";$&&$._owner&&$._owner!==Cr.current&&(ke=" It was passed a child from "+F($._owner.type)+"."),qn($),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',fe,ke),qn(null)}}function Du($,ue){{if(typeof $!="object")return;if(Te($))for(var fe=0;fe<$.length;fe++){var ke=$[fe];Sa(ke)&&Cu(ke,ue)}else if(Sa($))$._store&&($._store.validated=!0);else if($){var Ne=b($);if(typeof Ne=="function"&&Ne!==$.entries)for(var Ve=Ne.call($),Pe;!(Pe=Ve.next()).done;)Sa(Pe.value)&&Cu(Pe.value,ue)}}}function Sh($){{var ue=$.type;if(ue==null||typeof ue=="string")return;var fe;if(typeof ue=="function")fe=ue.propTypes;else if(typeof ue=="object"&&(ue.$$typeof===l||ue.$$typeof===m))fe=ue.propTypes;else return;if(fe){var ke=F(ue);He(fe,$.props,"prop",ke,$)}else if(ue.PropTypes!==void 0&&!Ta){Ta=!0;var Ne=F(ue);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ne||"Unknown")}typeof ue.getDefaultProps=="function"&&!ue.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function jh($){{for(var ue=Object.keys($.props),fe=0;fe<ue.length;fe++){var ke=ue[fe];if(ke!=="children"&&ke!=="key"){qn($),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ke),qn(null);break}}$.ref!==null&&(qn($),y("Invalid attribute `ref` supplied to `React.Fragment`."),qn(null))}}function Eu($,ue,fe,ke,Ne,Ve){{var Pe=z($);if(!Pe){var je="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(je+=" 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 ct=Bh(Ne);ct?je+=ct:je+=xu();var Xe;$===null?Xe="null":Te($)?Xe="array":$!==void 0&&$.$$typeof===t?(Xe="<"+(F($.type)||"Unknown")+" />",je=" Did you accidentally export a JSX literal instead of a component?"):Xe=typeof $,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Xe,je)}var nt=Ba($,ue,fe,Ne,Ve);if(nt==null)return nt;if(Pe){var Bt=ue.children;if(Bt!==void 0)if(ke)if(Te(Bt)){for(var Un=0;Un<Bt.length;Un++)Du(Bt[Un],$);Object.freeze&&Object.freeze(Bt)}else y("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 Du(Bt,$)}return $===r?jh(nt):Sh(nt),nt}}function Ph($,ue,fe){return Eu($,ue,fe,!0)}function Oh($,ue,fe){return Eu($,ue,fe,!1)}var Mh=Oh,Nh=Ph;Er.Fragment=r,Er.jsx=Mh,Er.jsxs=Nh}()),Er}process.env.NODE_ENV==="production"?js.exports=Wh():js.exports=Vh();var c=js.exports;const Hh=50,Kh=8,yd=(e,t)=>{if(!e)return!1;const n=x.useRef(null),r=t||n;return x.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>Kh&&(i.style.height=`${o}px`,i.scrollHeight>=Hh?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},xd=()=>{const[e,t]=x.useState(window.location.pathname),n=()=>{const r=window.location.pathname;t(r)};return x.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),e},or=(e,t)=>{const n=x.useRef(!1);x.useEffect(()=>{n.current?e():n.current=!0},t)};function Wr(e,t,n){var r=this,i=x.useRef(null),a=x.useRef(0),s=x.useRef(null),o=x.useRef([]),l=x.useRef(),u=x.useRef(),d=x.useRef(e),m=x.useRef(!0);d.current=e;var h=typeof window<"u",p=!t&&t!==0&&h;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(n=n||{}).leading,f=!("trailing"in n)||!!n.trailing,b="maxWait"in n,g="debounceOnServer"in n&&!!n.debounceOnServer,y=b?Math.max(+n.maxWait||0,t):null;x.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var C=x.useMemo(function(){var k=function(z){var O=o.current,A=l.current;return o.current=l.current=null,a.current=z,u.current=d.current.apply(A,O)},E=function(z,O){p&&cancelAnimationFrame(s.current),s.current=p?requestAnimationFrame(z):setTimeout(z,O)},_=function(z){if(!m.current)return!1;var O=z-i.current;return!i.current||O>=t||O<0||b&&z-a.current>=y},T=function(z){return s.current=null,f&&o.current?k(z):(o.current=l.current=null,u.current)},P=function z(){var O=Date.now();if(_(O))return T(O);if(m.current){var A=t-(O-i.current),F=b?Math.min(A,y-(O-a.current)):A;E(z,F)}},N=function(){if(h||g){var z=Date.now(),O=_(z);if(o.current=[].slice.call(arguments),l.current=r,i.current=z,O){if(!s.current&&m.current)return a.current=i.current,E(P,t),v?k(i.current):u.current;if(b)return E(P,t),k(i.current)}return s.current||E(P,t),u.current}};return N.cancel=function(){s.current&&(p?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,o.current=i.current=l.current=s.current=null},N.isPending=function(){return!!s.current},N.flush=function(){return s.current?T(Date.now()):u.current},N},[v,b,t,y,f,p,h,g]);return C}function wd(e,t,n){var r=n===void 0?{}:n,i=r.leading,a=r.trailing;return Wr(e,t,{maxWait:t,leading:i===void 0||i,trailing:a===void 0||a})}let ja;const wn=(e=!0,t=!1,n="window")=>{if(!e)return;const[r,i]=x.useState(0)||[!1,()=>{}],a=n==="window"?[]:[n];x.useEffect(()=>(o(),window.addEventListener("resize",u),window.addEventListener("hashchange",u),window.addEventListener("hiddenSectionVisible",l),()=>{clearTimeout(ja),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:d})=>{const{id:m}=d;n==="window"||!n.closest(`#${m}`)||s()===r||o()},u=wd(()=>{s()!==r&&(t&&(clearTimeout(ja),document.body.classList.add("is-resizing"),ja=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),o())},500,{leading:!0});return r},Cd=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[i,a]=x.useState({current:0,past:0})||[!1,()=>{}],[s,o]=x.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];x.useEffect(()=>(l(),window.addEventListener("scroll",u),()=>{u.flush(),window.removeEventListener("scroll",u)}),[]);const l=()=>{const d=window.scrollY,m=i.current,h=d-m,p=h>0?"down":"up";if(a({current:d,past:m}),p==="down"){d>=e+t.down&&!s.scrollDown&&(!s.scrollUp||h>t.up)&&(n(),o({scrollUp:!1,scrollDown:!0}));return}Math.abs(h)>=t.up&&!s.scrollUp&&(r(),o({scrollUp:!0,scrollDown:!1}))},u=wd(()=>{l()},250);return i},ho=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=x.useRef(!1);or(()=>{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)},po=(e=!1)=>{if(!e)return{showTooltip:!1,tooltipProps:{}};const[t,n]=x.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 Au={},Zh=x.forwardRef(({id:e,styling:t={},isOpen:n=!1,isLoading:r=!1,children:i,className:a="",functions:s={},callbacks:o={},accessibility:l={},...u},d)=>{const m=ie.useIntl(),[h]=x.useState(e||Date.now().toString()),p=x.useRef(null),v=d||p,[f,b]=x.useState(n?"open":"hidden"),{extraPadding:g=!0,hasPointer:y=!1,hasForm:C=!1}=t,{onOpen:k=()=>{},onClose:E=()=>{}}=o,{readToScreenreadersWhenClosed:_=!1,...T}=l,P=Au[h];x.useEffect(()=>{const A=v==null?void 0:v.current;if(A)return A.addEventListener("transitionend",N),()=>{A.removeEventListener("transitionend",N)}},[]),x.useEffect(()=>{if(f!=="open")return;const A=F=>{F.key==="Escape"&&(F.stopPropagation(),F.preventDefault(),b("closed"))};return document.addEventListener("keyup",A),()=>{document.removeEventListener("keyup",A)}},[f]);const N=({propertyName:A})=>{A==="opacity"&&(P!==!1&&clearTimeout(P),b(F=>(F==="open"?k():F==="closed"&&E(),F==="opening"?"open":F==="closing"?"closed":F==="closed"?"hidden":F)))};or(()=>{P!==!1&&clearTimeout(P);let A="open";n?b("opening"):(b("closing"),A="hidden"),Au[h||""]=setTimeout(()=>{b(A)},300)},[n]);const z={"aria-live":"polite",...u,...T};s&&s.onBlur&&(z.onBlur=s.onBlur);const O={className:"content"};return _?O.className=K("content",{hidden:f==="hidden"}):O.hidden=f==="hidden",c.jsx("aside",{ref:v,id:h,className:K("tooltip text-medium",f,a,{loading:r,"extra-padding":g,"has-pointer":y,bottom:y==="bottom","has-form":C}),...z,children:c.jsx("div",{...O,children:r?c.jsx("p",{children:m.formatMessage({id:"tooltip_loading"})}):typeof i=="string"?c.jsx("p",{children:i}):i})})}),Ln=x.memo(Zh),pr=(e,t)=>{Array.isArray(t)||(t=[t]);const n=Pt(e);return t.forEach(({type:r,value:i})=>{Ih(n,r,i)}),n},Dd=e=>{const t=[];return e.forEach(n=>{const r=parseInt(n);isNaN(r)||t.push(r)}),t.sort((n,r)=>n-r)},Ed=(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},_d=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),kd=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()).replace(/[&\s]+/g,""),Fd=(e="")=>e.charAt(0).toUpperCase()+e.slice(1),Yh=(e="")=>e.replace(/(?:^\w|[A-Z]|\b\w)/g,t=>t.toUpperCase()),Gt="https://assets.apolitical.co/",Qn={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},jr={ARTICLE:"microcourseArticle",DISCUSSION:"microcourseDiscussion",QUIZ:"assessmentQuiz"},Ps="SU:",Vr="DELETED",Ad="Invalid token error: Logging user out...",Gh="250,000+",Qh="160+",Hr=/@{{([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})}}/g,Bd=new RegExp("(?<=^|\\s)@([A-Za-z]+(?:[- ]?[A-Za-z]*)*)$");function Jh(e){return e?{"--icon":`url(${Gt}icons/${e}.svg)`}:{}}const Bn={milliseconds:{inSecond:1e3,inMinute:6e4,inHour:36e5,inDay:864e5},year:{weeks:52,days:365}},Td=(e,t="en")=>new Date(e).toLocaleString(t,{day:"numeric",month:"short"}),go=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),Os=e=>{let t;const n=Vi(),r=Vi(new Date(e));try{t=n.getTime()-r.getTime()}catch{return""}const i=t/Bn.milliseconds.inHour,a=Math.floor(t/Bn.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<=Bn.year.weeks?{path:"weeks",number:s}:{path:"years",number:Math.floor(a/Bn.year.days)}},Vi=e=>{const n=(e||new Date).toUTCString();return new Date(n)},Xh=(e,t,n)=>{let r;const i=Vi(),a=Vi(new Date(e));try{r=i.getTime()-a.getTime()}catch{return!1}switch(n){case"seconds":return r/Bn.milliseconds.inSecond<=t;case"minutes":return r/Bn.milliseconds.inMinute<=t;case"hours":return r/Bn.milliseconds.inHour<=t}return!1},ep=(e,t)=>{const n=new Date(e);return Math.abs(new Date().getTime()-n.getTime())/(1e3*60*60*24)<t},tp=e=>new Promise(t=>setTimeout(t,e)),np=()=>{let e=!1;return typeof window<"u"&&(e=!!(window&&window.location&&window.location.href&&window.location.href.includes("localhost"))),e},gr={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",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_leave:"Leave",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>",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_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
  Please explain why you're reporting this post. Reasons could include: inappropriate language, harassment, spam, hate speech, false information, among others. Include as much detail as you feel comfortable.
34
34
 
package/index.mjs CHANGED
@@ -985,7 +985,7 @@ const pl = {}, gh = fo(
985
985
  break;
986
986
  }
987
987
  return r;
988
- }, vh = (e) => e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`), bh = (e = "") => e.replace(/(?:^\w|[A-Z]|\b\w)/g, (t) => t.toUpperCase()).replace(/[&\s]+/g, ""), yh = (e = "") => e.charAt(0).toUpperCase() + e.slice(1), Zk = (e = "") => e.replace(/(?:^\w|[A-Z]|\b\w)/g, (t) => t.toUpperCase()), dn = "https://storage.googleapis.com/apolitical-assets/", Nr = {
988
+ }, vh = (e) => e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`), bh = (e = "") => e.replace(/(?:^\w|[A-Z]|\b\w)/g, (t) => t.toUpperCase()).replace(/[&\s]+/g, ""), yh = (e = "") => e.charAt(0).toUpperCase() + e.slice(1), Zk = (e = "") => e.replace(/(?:^\w|[A-Z]|\b\w)/g, (t) => t.toUpperCase()), dn = "https://assets.apolitical.co/", Nr = {
989
989
  general: "hello@apolitical.co",
990
990
  support: "concierge@apolitical.co",
991
991
  "data-protection": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "8.1.0",
3
+ "version": "8.2.0-bht.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {