@apolitical/component-library 1.15.2 → 1.15.3

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,4 +1,3 @@
1
- import { PaginationType } from '../../navigation';
2
1
  import { MemberDetailsProps } from '../../user';
3
2
  interface CommunityMemberProps extends MemberDetailsProps {
4
3
  /** Whether the user is an admin of the community or not */
@@ -7,11 +6,13 @@ interface CommunityMemberProps extends MemberDetailsProps {
7
6
  interface Props {
8
7
  /** Details about members in the community */
9
8
  members: {
10
- total?: number | undefined;
11
- data?: CommunityMemberProps[];
9
+ data: CommunityMemberProps[];
10
+ total?: number;
12
11
  };
13
- /** Details for the pagination */
14
- pagination?: PaginationType;
12
+ /** Whether there is another page of members to load */
13
+ hasNextPage?: boolean;
14
+ /** Function to load the next page of members */
15
+ loadNextPage?: () => void;
15
16
  /** The GTM context to use */
16
17
  gtmContext?: string;
17
18
  /** The GTM event to use */
@@ -19,5 +20,5 @@ interface Props {
19
20
  /** Additional classes */
20
21
  className?: string;
21
22
  }
22
- declare const MembersList: ({ members: { total, data: members }, pagination, gtmContext, gtmType, className, }: Props) => import("react/jsx-runtime").JSX.Element | null;
23
+ declare const MembersList: ({ members: { data, total }, hasNextPage, loadNextPage, gtmContext, gtmType, className, }: Props) => import("react/jsx-runtime").JSX.Element | null;
23
24
  export default MembersList;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),Cs=require("lodash.clonedeep"),Ns=require("lodash.set"),M=require("react-intl"),Le=require("truncate"),xt=require("markdown-to-jsx"),z=require("@tanstack/react-query"),Ds=require("@tanstack/react-query-devtools"),mt=require("posthog-js"),Tn=require("react-cookie"),Ps=require("react-multi-email"),Mn=require("lodash.get"),Rs=require("react-error-boundary"),As=require("react-textarea-autosize"),Fs=require("lodash.isequal");function Is(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cn={exports:{}};/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),Cs=require("lodash.clonedeep"),Ns=require("lodash.set"),M=require("react-intl"),Le=require("truncate"),xt=require("markdown-to-jsx"),z=require("@tanstack/react-query"),Ds=require("@tanstack/react-query-devtools"),mt=require("posthog-js"),Tn=require("react-cookie"),Rs=require("react-multi-email"),Mn=require("lodash.get"),Ps=require("react-error-boundary"),As=require("react-textarea-autosize"),Fs=require("lodash.isequal");function Is(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cn={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
@@ -18,22 +18,22 @@
18
18
  *
19
19
  * This source code is licensed under the MIT license found in the
20
20
  * LICENSE file in the root directory of this source tree.
21
- */var _n;function Hs(){return _n||(_n=1,process.env.NODE_ENV!=="production"&&function(){var e=_,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),o=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),g=Symbol.iterator,v="@@iterator";function k(f){if(f===null||typeof f!="object")return null;var E=g&&f[g]||f[v];return typeof E=="function"?E:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(f){{for(var E=arguments.length,T=new Array(E>1?E-1:0),N=1;N<E;N++)T[N-1]=arguments[N];x("error",f,T)}}function x(f,E,T){{var N=S.ReactDebugCurrentFrame,O=N.getStackAddendum();O!==""&&(E+="%s",T=T.concat([O]));var W=T.map(function(I){return String(I)});W.unshift("Warning: "+E),Function.prototype.apply.call(console[f],console,W)}}var C=!1,D=!1,R=!1,G=!1,L=!1,Q;Q=Symbol.for("react.module.reference");function A(f){return!!(typeof f=="string"||typeof f=="function"||f===r||f===u||L||f===i||f===o||f===m||G||f===p||C||D||R||typeof f=="object"&&f!==null&&(f.$$typeof===h||f.$$typeof===c||f.$$typeof===d||f.$$typeof===a||f.$$typeof===l||f.$$typeof===Q||f.getModuleId!==void 0))}function b(f,E,T){var N=f.displayName;if(N)return N;var O=E.displayName||E.name||"";return O!==""?T+"("+O+")":T}function Y(f){return f.displayName||"Context"}function j(f){if(f==null)return null;if(typeof f.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case r:return"Fragment";case n:return"Portal";case u:return"Profiler";case i:return"StrictMode";case o:return"Suspense";case m:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case a:var E=f;return Y(E)+".Consumer";case d:var T=f;return Y(T._context)+".Provider";case l:return b(f,f.render,"ForwardRef");case c:var N=f.displayName||null;return N!==null?N:j(f.type)||"Memo";case h:{var O=f,W=O._payload,I=O._init;try{return j(I(W))}catch{return null}}}return null}var w=Object.assign,V=0,X,ne,se,re,q,de,ce;function F(){}F.__reactDisabledLog=!0;function ae(){{if(V===0){X=console.log,ne=console.info,se=console.warn,re=console.error,q=console.group,de=console.groupCollapsed,ce=console.groupEnd;var f={configurable:!0,enumerable:!0,value:F,writable:!0};Object.defineProperties(console,{info:f,log:f,warn:f,error:f,group:f,groupCollapsed:f,groupEnd:f})}V++}}function me(){{if(V--,V===0){var f={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:w({},f,{value:X}),info:w({},f,{value:ne}),warn:w({},f,{value:se}),error:w({},f,{value:re}),group:w({},f,{value:q}),groupCollapsed:w({},f,{value:de}),groupEnd:w({},f,{value:ce})})}V<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var oe=S.ReactCurrentDispatcher,pe;function fe(f,E,T){{if(pe===void 0)try{throw Error()}catch(O){var N=O.stack.trim().match(/\n( *(at )?)/);pe=N&&N[1]||""}return`
22
- `+pe+f}}var ge=!1,he;{var B=typeof WeakMap=="function"?WeakMap:Map;he=new B}function J(f,E){if(!f||ge)return"";{var T=he.get(f);if(T!==void 0)return T}var N;ge=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var W;W=oe.current,oe.current=null,ae();try{if(E){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(Ee){N=Ee}Reflect.construct(f,[],I)}else{try{I.call()}catch(Ee){N=Ee}f.call(I.prototype)}}else{try{throw Error()}catch(Ee){N=Ee}f()}}catch(Ee){if(Ee&&N&&typeof Ee.stack=="string"){for(var P=Ee.stack.split(`
21
+ */var _n;function Hs(){return _n||(_n=1,process.env.NODE_ENV!=="production"&&function(){var e=_,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),o=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),g=Symbol.iterator,v="@@iterator";function k(f){if(f===null||typeof f!="object")return null;var E=g&&f[g]||f[v];return typeof E=="function"?E:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(f){{for(var E=arguments.length,T=new Array(E>1?E-1:0),N=1;N<E;N++)T[N-1]=arguments[N];x("error",f,T)}}function x(f,E,T){{var N=S.ReactDebugCurrentFrame,O=N.getStackAddendum();O!==""&&(E+="%s",T=T.concat([O]));var W=T.map(function(I){return String(I)});W.unshift("Warning: "+E),Function.prototype.apply.call(console[f],console,W)}}var C=!1,D=!1,P=!1,G=!1,L=!1,Q;Q=Symbol.for("react.module.reference");function A(f){return!!(typeof f=="string"||typeof f=="function"||f===r||f===u||L||f===i||f===o||f===m||G||f===p||C||D||P||typeof f=="object"&&f!==null&&(f.$$typeof===h||f.$$typeof===c||f.$$typeof===d||f.$$typeof===a||f.$$typeof===l||f.$$typeof===Q||f.getModuleId!==void 0))}function b(f,E,T){var N=f.displayName;if(N)return N;var O=E.displayName||E.name||"";return O!==""?T+"("+O+")":T}function Y(f){return f.displayName||"Context"}function j(f){if(f==null)return null;if(typeof f.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case r:return"Fragment";case n:return"Portal";case u:return"Profiler";case i:return"StrictMode";case o:return"Suspense";case m:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case a:var E=f;return Y(E)+".Consumer";case d:var T=f;return Y(T._context)+".Provider";case l:return b(f,f.render,"ForwardRef");case c:var N=f.displayName||null;return N!==null?N:j(f.type)||"Memo";case h:{var O=f,W=O._payload,I=O._init;try{return j(I(W))}catch{return null}}}return null}var w=Object.assign,V=0,X,ne,se,re,q,de,ce;function F(){}F.__reactDisabledLog=!0;function ae(){{if(V===0){X=console.log,ne=console.info,se=console.warn,re=console.error,q=console.group,de=console.groupCollapsed,ce=console.groupEnd;var f={configurable:!0,enumerable:!0,value:F,writable:!0};Object.defineProperties(console,{info:f,log:f,warn:f,error:f,group:f,groupCollapsed:f,groupEnd:f})}V++}}function me(){{if(V--,V===0){var f={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:w({},f,{value:X}),info:w({},f,{value:ne}),warn:w({},f,{value:se}),error:w({},f,{value:re}),group:w({},f,{value:q}),groupCollapsed:w({},f,{value:de}),groupEnd:w({},f,{value:ce})})}V<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var oe=S.ReactCurrentDispatcher,pe;function fe(f,E,T){{if(pe===void 0)try{throw Error()}catch(O){var N=O.stack.trim().match(/\n( *(at )?)/);pe=N&&N[1]||""}return`
22
+ `+pe+f}}var ge=!1,he;{var B=typeof WeakMap=="function"?WeakMap:Map;he=new B}function J(f,E){if(!f||ge)return"";{var T=he.get(f);if(T!==void 0)return T}var N;ge=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var W;W=oe.current,oe.current=null,ae();try{if(E){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(Ee){N=Ee}Reflect.construct(f,[],I)}else{try{I.call()}catch(Ee){N=Ee}f.call(I.prototype)}}else{try{throw Error()}catch(Ee){N=Ee}f()}}catch(Ee){if(Ee&&N&&typeof Ee.stack=="string"){for(var R=Ee.stack.split(`
23
23
  `),_e=N.stack.split(`
24
- `),Z=P.length-1,te=_e.length-1;Z>=1&&te>=0&&P[Z]!==_e[te];)te--;for(;Z>=1&&te>=0;Z--,te--)if(P[Z]!==_e[te]){if(Z!==1||te!==1)do if(Z--,te--,te<0||P[Z]!==_e[te]){var ve=`
25
- `+P[Z].replace(" at new "," at ");return f.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",f.displayName)),typeof f=="function"&&he.set(f,ve),ve}while(Z>=1&&te>=0);break}}}finally{ge=!1,oe.current=W,me(),Error.prepareStackTrace=O}var Ae=f?f.displayName||f.name:"",pn=Ae?fe(Ae):"";return typeof f=="function"&&he.set(f,pn),pn}function ie(f,E,T){return J(f,!1)}function K(f){var E=f.prototype;return!!(E&&E.isReactComponent)}function le(f,E,T){if(f==null)return"";if(typeof f=="function")return J(f,K(f));if(typeof f=="string")return fe(f);switch(f){case o:return fe("Suspense");case m:return fe("SuspenseList")}if(typeof f=="object")switch(f.$$typeof){case l:return ie(f.render);case c:return le(f.type,E,T);case h:{var N=f,O=N._payload,W=N._init;try{return le(W(O),E,T)}catch{}}}return""}var be=Object.prototype.hasOwnProperty,Me={},Oe=S.ReactDebugCurrentFrame;function Ce(f){if(f){var E=f._owner,T=le(f.type,f._source,E?E.type:null);Oe.setExtraStackFrame(T)}else Oe.setExtraStackFrame(null)}function nt(f,E,T,N,O){{var W=Function.call.bind(be);for(var I in f)if(W(f,I)){var P=void 0;try{if(typeof f[I]!="function"){var _e=Error((N||"React class")+": "+T+" type `"+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof f[I]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw _e.name="Invariant Violation",_e}P=f[I](E,I,N,T,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Z){P=Z}P&&!(P instanceof Error)&&(Ce(O),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",N||"React class",T,I,typeof P),Ce(null)),P instanceof Error&&!(P.message in Me)&&(Me[P.message]=!0,Ce(O),y("Failed %s type: %s",T,P.message),Ce(null))}}}var ee=Array.isArray;function je(f){return ee(f)}function Ne(f){{var E=typeof Symbol=="function"&&Symbol.toStringTag,T=E&&f[Symbol.toStringTag]||f.constructor.name||"Object";return T}}function st(f){try{return rt(f),!1}catch{return!0}}function rt(f){return""+f}function an(f){if(st(f))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ne(f)),rt(f)}var Qe=S.ReactCurrentOwner,hs={key:!0,ref:!0,__self:!0,__source:!0},on,cn,kt;kt={};function ps(f){if(be.call(f,"ref")){var E=Object.getOwnPropertyDescriptor(f,"ref").get;if(E&&E.isReactWarning)return!1}return f.ref!==void 0}function gs(f){if(be.call(f,"key")){var E=Object.getOwnPropertyDescriptor(f,"key").get;if(E&&E.isReactWarning)return!1}return f.key!==void 0}function _s(f,E){if(typeof f.ref=="string"&&Qe.current&&E&&Qe.current.stateNode!==E){var T=j(Qe.current.type);kt[T]||(y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',j(Qe.current.type),f.ref),kt[T]=!0)}}function xs(f,E){{var T=function(){on||(on=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};T.isReactWarning=!0,Object.defineProperty(f,"key",{get:T,configurable:!0})}}function bs(f,E){{var T=function(){cn||(cn=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};T.isReactWarning=!0,Object.defineProperty(f,"ref",{get:T,configurable:!0})}}var vs=function(f,E,T,N,O,W,I){var P={$$typeof:t,type:f,key:E,ref:T,props:I,_owner:W};return P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(P,"_self",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.defineProperty(P,"_source",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P};function ws(f,E,T,N,O){{var W,I={},P=null,_e=null;T!==void 0&&(an(T),P=""+T),gs(E)&&(an(E.key),P=""+E.key),ps(E)&&(_e=E.ref,_s(E,O));for(W in E)be.call(E,W)&&!hs.hasOwnProperty(W)&&(I[W]=E[W]);if(f&&f.defaultProps){var Z=f.defaultProps;for(W in Z)I[W]===void 0&&(I[W]=Z[W])}if(P||_e){var te=typeof f=="function"?f.displayName||f.name||"Unknown":f;P&&xs(I,te),_e&&bs(I,te)}return vs(f,P,_e,O,N,Qe.current,I)}}var jt=S.ReactCurrentOwner,ln=S.ReactDebugCurrentFrame;function Re(f){if(f){var E=f._owner,T=le(f.type,f._source,E?E.type:null);ln.setExtraStackFrame(T)}else ln.setExtraStackFrame(null)}var yt;yt=!1;function Et(f){return typeof f=="object"&&f!==null&&f.$$typeof===t}function un(){{if(jt.current){var f=j(jt.current.type);if(f)return`
24
+ `),Z=R.length-1,te=_e.length-1;Z>=1&&te>=0&&R[Z]!==_e[te];)te--;for(;Z>=1&&te>=0;Z--,te--)if(R[Z]!==_e[te]){if(Z!==1||te!==1)do if(Z--,te--,te<0||R[Z]!==_e[te]){var ve=`
25
+ `+R[Z].replace(" at new "," at ");return f.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",f.displayName)),typeof f=="function"&&he.set(f,ve),ve}while(Z>=1&&te>=0);break}}}finally{ge=!1,oe.current=W,me(),Error.prepareStackTrace=O}var Ae=f?f.displayName||f.name:"",pn=Ae?fe(Ae):"";return typeof f=="function"&&he.set(f,pn),pn}function ie(f,E,T){return J(f,!1)}function K(f){var E=f.prototype;return!!(E&&E.isReactComponent)}function le(f,E,T){if(f==null)return"";if(typeof f=="function")return J(f,K(f));if(typeof f=="string")return fe(f);switch(f){case o:return fe("Suspense");case m:return fe("SuspenseList")}if(typeof f=="object")switch(f.$$typeof){case l:return ie(f.render);case c:return le(f.type,E,T);case h:{var N=f,O=N._payload,W=N._init;try{return le(W(O),E,T)}catch{}}}return""}var be=Object.prototype.hasOwnProperty,Me={},Oe=S.ReactDebugCurrentFrame;function Ce(f){if(f){var E=f._owner,T=le(f.type,f._source,E?E.type:null);Oe.setExtraStackFrame(T)}else Oe.setExtraStackFrame(null)}function nt(f,E,T,N,O){{var W=Function.call.bind(be);for(var I in f)if(W(f,I)){var R=void 0;try{if(typeof f[I]!="function"){var _e=Error((N||"React class")+": "+T+" type `"+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof f[I]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw _e.name="Invariant Violation",_e}R=f[I](E,I,N,T,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Z){R=Z}R&&!(R instanceof Error)&&(Ce(O),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",N||"React class",T,I,typeof R),Ce(null)),R instanceof Error&&!(R.message in Me)&&(Me[R.message]=!0,Ce(O),y("Failed %s type: %s",T,R.message),Ce(null))}}}var ee=Array.isArray;function je(f){return ee(f)}function Ne(f){{var E=typeof Symbol=="function"&&Symbol.toStringTag,T=E&&f[Symbol.toStringTag]||f.constructor.name||"Object";return T}}function st(f){try{return rt(f),!1}catch{return!0}}function rt(f){return""+f}function an(f){if(st(f))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ne(f)),rt(f)}var Qe=S.ReactCurrentOwner,hs={key:!0,ref:!0,__self:!0,__source:!0},on,cn,kt;kt={};function ps(f){if(be.call(f,"ref")){var E=Object.getOwnPropertyDescriptor(f,"ref").get;if(E&&E.isReactWarning)return!1}return f.ref!==void 0}function gs(f){if(be.call(f,"key")){var E=Object.getOwnPropertyDescriptor(f,"key").get;if(E&&E.isReactWarning)return!1}return f.key!==void 0}function _s(f,E){if(typeof f.ref=="string"&&Qe.current&&E&&Qe.current.stateNode!==E){var T=j(Qe.current.type);kt[T]||(y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',j(Qe.current.type),f.ref),kt[T]=!0)}}function xs(f,E){{var T=function(){on||(on=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};T.isReactWarning=!0,Object.defineProperty(f,"key",{get:T,configurable:!0})}}function bs(f,E){{var T=function(){cn||(cn=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};T.isReactWarning=!0,Object.defineProperty(f,"ref",{get:T,configurable:!0})}}var vs=function(f,E,T,N,O,W,I){var R={$$typeof:t,type:f,key:E,ref:T,props:I,_owner:W};return R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(R,"_self",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.defineProperty(R,"_source",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R};function ws(f,E,T,N,O){{var W,I={},R=null,_e=null;T!==void 0&&(an(T),R=""+T),gs(E)&&(an(E.key),R=""+E.key),ps(E)&&(_e=E.ref,_s(E,O));for(W in E)be.call(E,W)&&!hs.hasOwnProperty(W)&&(I[W]=E[W]);if(f&&f.defaultProps){var Z=f.defaultProps;for(W in Z)I[W]===void 0&&(I[W]=Z[W])}if(R||_e){var te=typeof f=="function"?f.displayName||f.name||"Unknown":f;R&&xs(I,te),_e&&bs(I,te)}return vs(f,R,_e,O,N,Qe.current,I)}}var jt=S.ReactCurrentOwner,ln=S.ReactDebugCurrentFrame;function Pe(f){if(f){var E=f._owner,T=le(f.type,f._source,E?E.type:null);ln.setExtraStackFrame(T)}else ln.setExtraStackFrame(null)}var yt;yt=!1;function Et(f){return typeof f=="object"&&f!==null&&f.$$typeof===t}function un(){{if(jt.current){var f=j(jt.current.type);if(f)return`
26
26
 
27
27
  Check the render method of \``+f+"`."}return""}}function ks(f){{if(f!==void 0){var E=f.fileName.replace(/^.*[\\\/]/,""),T=f.lineNumber;return`
28
28
 
29
29
  Check your code at `+E+":"+T+"."}return""}}var dn={};function js(f){{var E=un();if(!E){var T=typeof f=="string"?f:f.displayName||f.name;T&&(E=`
30
30
 
31
- Check the top-level render call using <`+T+">.")}return E}}function mn(f,E){{if(!f._store||f._store.validated||f.key!=null)return;f._store.validated=!0;var T=js(E);if(dn[T])return;dn[T]=!0;var N="";f&&f._owner&&f._owner!==jt.current&&(N=" It was passed a child from "+j(f._owner.type)+"."),Re(f),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',T,N),Re(null)}}function fn(f,E){{if(typeof f!="object")return;if(je(f))for(var T=0;T<f.length;T++){var N=f[T];Et(N)&&mn(N,E)}else if(Et(f))f._store&&(f._store.validated=!0);else if(f){var O=k(f);if(typeof O=="function"&&O!==f.entries)for(var W=O.call(f),I;!(I=W.next()).done;)Et(I.value)&&mn(I.value,E)}}}function ys(f){{var E=f.type;if(E==null||typeof E=="string")return;var T;if(typeof E=="function")T=E.propTypes;else if(typeof E=="object"&&(E.$$typeof===l||E.$$typeof===c))T=E.propTypes;else return;if(T){var N=j(E);nt(T,f.props,"prop",N,f)}else if(E.PropTypes!==void 0&&!yt){yt=!0;var O=j(E);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",O||"Unknown")}typeof E.getDefaultProps=="function"&&!E.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Es(f){{for(var E=Object.keys(f.props),T=0;T<E.length;T++){var N=E[T];if(N!=="children"&&N!=="key"){Re(f),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",N),Re(null);break}}f.ref!==null&&(Re(f),y("Invalid attribute `ref` supplied to `React.Fragment`."),Re(null))}}function hn(f,E,T,N,O,W){{var I=A(f);if(!I){var P="";(f===void 0||typeof f=="object"&&f!==null&&Object.keys(f).length===0)&&(P+=" 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 _e=ks(O);_e?P+=_e:P+=un();var Z;f===null?Z="null":je(f)?Z="array":f!==void 0&&f.$$typeof===t?(Z="<"+(j(f.type)||"Unknown")+" />",P=" Did you accidentally export a JSX literal instead of a component?"):Z=typeof f,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Z,P)}var te=ws(f,E,T,O,W);if(te==null)return te;if(I){var ve=E.children;if(ve!==void 0)if(N)if(je(ve)){for(var Ae=0;Ae<ve.length;Ae++)fn(ve[Ae],f);Object.freeze&&Object.freeze(ve)}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 fn(ve,f)}return f===r?Es(te):ys(te),te}}function Ss(f,E,T){return hn(f,E,T,!0)}function $s(f,E,T){return hn(f,E,T,!1)}var Ts=$s,Ms=Ss;Ue.Fragment=r,Ue.jsx=Ts,Ue.jsxs=Ms}()),Ue}process.env.NODE_ENV==="production"?Ot.exports=Qs():Ot.exports=Hs();var s=Ot.exports;const Nn=()=>{const[e,t]=_.useState(window.location.pathname),n=()=>{const r=window.location.pathname;t(r)};return _.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),e},De=(e,t)=>{const n=_.useRef(!1);_.useEffect(()=>{n.current?e():n.current=!0},t)};function Us(e,t,n){var r=this,i=_.useRef(null),u=_.useRef(0),d=_.useRef(null),a=_.useRef([]),l=_.useRef(),o=_.useRef(),m=_.useRef(e),c=_.useRef(!0);m.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 g=!!(n=n||{}).leading,v=!("trailing"in n)||!!n.trailing,k="maxWait"in n,S="debounceOnServer"in n&&!!n.debounceOnServer,y=k?Math.max(+n.maxWait||0,t):null;_.useEffect(function(){return c.current=!0,function(){c.current=!1}},[]);var x=_.useMemo(function(){var C=function(A){var b=a.current,Y=l.current;return a.current=l.current=null,u.current=A,o.current=m.current.apply(Y,b)},D=function(A,b){p&&cancelAnimationFrame(d.current),d.current=p?requestAnimationFrame(A):setTimeout(A,b)},R=function(A){if(!c.current)return!1;var b=A-i.current;return!i.current||b>=t||b<0||k&&A-u.current>=y},G=function(A){return d.current=null,v&&a.current?C(A):(a.current=l.current=null,o.current)},L=function A(){var b=Date.now();if(R(b))return G(b);if(c.current){var Y=t-(b-i.current),j=k?Math.min(Y,y-(b-u.current)):Y;D(A,j)}},Q=function(){if(h||S){var A=Date.now(),b=R(A);if(a.current=[].slice.call(arguments),l.current=r,i.current=A,b){if(!d.current&&c.current)return u.current=i.current,D(L,t),g?C(i.current):o.current;if(k)return D(L,t),C(i.current)}return d.current||D(L,t),o.current}};return Q.cancel=function(){d.current&&(p?cancelAnimationFrame(d.current):clearTimeout(d.current)),u.current=0,a.current=i.current=l.current=d.current=null},Q.isPending=function(){return!!d.current},Q.flush=function(){return d.current?G(Date.now()):o.current},Q},[g,k,t,y,v,p,h,S]);return x}function Dn(e,t,n){var r=n===void 0?{}:n,i=r.leading,u=r.trailing;return Us(e,t,{maxWait:t,leading:i===void 0||i,trailing:u===void 0||u})}let St;const Xe=(e=!0,t=!1,n="window")=>{if(!e)return;const[r,i]=_.useState(0)||[!1,()=>{}],u=n==="window"?[]:[n];_.useEffect(()=>(a(),window.addEventListener("resize",l),()=>{clearTimeout(St),l.flush(),window.removeEventListener("resize",l)}),u);const d=()=>{if(n)return n==="window"?window.innerWidth:n.offsetWidth},a=()=>{i(d())},l=Dn(()=>{d()!==r&&(t&&(clearTimeout(St),document.body.classList.add("is-resizing"),St=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),a())},500,{leading:!0});return r},Pn=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[i,u]=_.useState({current:0,past:0})||[!1,()=>{}],[d,a]=_.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];_.useEffect(()=>(l(),window.addEventListener("scroll",o),()=>{o.flush(),window.removeEventListener("scroll",o)}),[]);const l=()=>{const m=window.scrollY,c=i.current,h=m-c,p=h>0?"down":"up";if(u({current:m,past:c}),p==="down"){m>=e+t.down&&!d.scrollDown&&(!d.scrollUp||h>t.up)&&(n(),a({scrollUp:!1,scrollDown:!0}));return}Math.abs(h)>=t.up&&!d.scrollUp&&(r(),a({scrollUp:!0,scrollDown:!1}))},o=Dn(()=>{l()},250);return i},Rn=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=_.useRef(!1);De(()=>{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)},An=e=>{const t=[];return e.forEach(n=>{const r=parseInt(n);isNaN(r)||t.push(r)}),t.sort((n,r)=>n-r)},Fn=(e,t,n)=>{let r=n.mobile;for(const i in t){const u=parseInt(String(t[i]));if(e>=u)r=n[u];else if(e<u)break}return r},Ws=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),zs=(e,t="en")=>new Date(e).toLocaleString(t,{day:"numeric",month:"short"}),In=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),Qt=e=>{let u;const d=xn(),a=xn(new Date(e));try{u=d.getTime()-a.getTime()}catch{return""}const l=u/36e5,o=Math.floor(u/864e5);if(o<1)return l<1?{path:"now"}:{path:"hours",number:Math.floor(l)};if(o<7)return{path:"days",number:o};const m=Math.floor(o/7);return m<=52?{path:"weeks",number:m}:{path:"years",number:Math.floor(o/365)}},xn=e=>{const n=(e||new Date).toUTCString();return new Date(n)},Vt={apolitical:"Apolitical",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",card_carousel_viewAll:"View all",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_registered:"Registered",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_cta_people:"View profile",card_cta_event:"Register now",card_cta_microcourse:"Enrol now",card_cta_event_loading:"Registering...",card_cta_microcourse_loading:"Enrolling...",card_cta_event_done:"Registered",card_cta_microcourse_done:"Enrolled",carousel_pagination_previous:"Previous",carousel_pagination_next:"Next",carousel_pagination_page:"Page {number} of {total}",collapsibleSection_summary:"Find out more",communityDetails_members:"Members",communityDetails_viewAll:"View all",communityDetails_invite:"Invite colleagues",community_joinToPost:"Join community to create a post.",activitySection_notFoundError:"Post not found",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",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",dates_now:"now",dates_hours:"{number}h",dates_days:"{number}d",dates_weeks:"{number}w",dates_years:"{number}y",discussion_action_answer:"answer",discussion_action_comment:"comment",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_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 <`+T+">.")}return E}}function mn(f,E){{if(!f._store||f._store.validated||f.key!=null)return;f._store.validated=!0;var T=js(E);if(dn[T])return;dn[T]=!0;var N="";f&&f._owner&&f._owner!==jt.current&&(N=" It was passed a child from "+j(f._owner.type)+"."),Pe(f),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',T,N),Pe(null)}}function fn(f,E){{if(typeof f!="object")return;if(je(f))for(var T=0;T<f.length;T++){var N=f[T];Et(N)&&mn(N,E)}else if(Et(f))f._store&&(f._store.validated=!0);else if(f){var O=k(f);if(typeof O=="function"&&O!==f.entries)for(var W=O.call(f),I;!(I=W.next()).done;)Et(I.value)&&mn(I.value,E)}}}function ys(f){{var E=f.type;if(E==null||typeof E=="string")return;var T;if(typeof E=="function")T=E.propTypes;else if(typeof E=="object"&&(E.$$typeof===l||E.$$typeof===c))T=E.propTypes;else return;if(T){var N=j(E);nt(T,f.props,"prop",N,f)}else if(E.PropTypes!==void 0&&!yt){yt=!0;var O=j(E);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",O||"Unknown")}typeof E.getDefaultProps=="function"&&!E.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Es(f){{for(var E=Object.keys(f.props),T=0;T<E.length;T++){var N=E[T];if(N!=="children"&&N!=="key"){Pe(f),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",N),Pe(null);break}}f.ref!==null&&(Pe(f),y("Invalid attribute `ref` supplied to `React.Fragment`."),Pe(null))}}function hn(f,E,T,N,O,W){{var I=A(f);if(!I){var R="";(f===void 0||typeof f=="object"&&f!==null&&Object.keys(f).length===0)&&(R+=" 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 _e=ks(O);_e?R+=_e:R+=un();var Z;f===null?Z="null":je(f)?Z="array":f!==void 0&&f.$$typeof===t?(Z="<"+(j(f.type)||"Unknown")+" />",R=" Did you accidentally export a JSX literal instead of a component?"):Z=typeof f,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Z,R)}var te=ws(f,E,T,O,W);if(te==null)return te;if(I){var ve=E.children;if(ve!==void 0)if(N)if(je(ve)){for(var Ae=0;Ae<ve.length;Ae++)fn(ve[Ae],f);Object.freeze&&Object.freeze(ve)}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 fn(ve,f)}return f===r?Es(te):ys(te),te}}function Ss(f,E,T){return hn(f,E,T,!0)}function $s(f,E,T){return hn(f,E,T,!1)}var Ts=$s,Ms=Ss;Ue.Fragment=r,Ue.jsx=Ts,Ue.jsxs=Ms}()),Ue}process.env.NODE_ENV==="production"?Ot.exports=Qs():Ot.exports=Hs();var s=Ot.exports;const Nn=()=>{const[e,t]=_.useState(window.location.pathname),n=()=>{const r=window.location.pathname;t(r)};return _.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),e},De=(e,t)=>{const n=_.useRef(!1);_.useEffect(()=>{n.current?e():n.current=!0},t)};function Us(e,t,n){var r=this,i=_.useRef(null),u=_.useRef(0),d=_.useRef(null),a=_.useRef([]),l=_.useRef(),o=_.useRef(),m=_.useRef(e),c=_.useRef(!0);m.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 g=!!(n=n||{}).leading,v=!("trailing"in n)||!!n.trailing,k="maxWait"in n,S="debounceOnServer"in n&&!!n.debounceOnServer,y=k?Math.max(+n.maxWait||0,t):null;_.useEffect(function(){return c.current=!0,function(){c.current=!1}},[]);var x=_.useMemo(function(){var C=function(A){var b=a.current,Y=l.current;return a.current=l.current=null,u.current=A,o.current=m.current.apply(Y,b)},D=function(A,b){p&&cancelAnimationFrame(d.current),d.current=p?requestAnimationFrame(A):setTimeout(A,b)},P=function(A){if(!c.current)return!1;var b=A-i.current;return!i.current||b>=t||b<0||k&&A-u.current>=y},G=function(A){return d.current=null,v&&a.current?C(A):(a.current=l.current=null,o.current)},L=function A(){var b=Date.now();if(P(b))return G(b);if(c.current){var Y=t-(b-i.current),j=k?Math.min(Y,y-(b-u.current)):Y;D(A,j)}},Q=function(){if(h||S){var A=Date.now(),b=P(A);if(a.current=[].slice.call(arguments),l.current=r,i.current=A,b){if(!d.current&&c.current)return u.current=i.current,D(L,t),g?C(i.current):o.current;if(k)return D(L,t),C(i.current)}return d.current||D(L,t),o.current}};return Q.cancel=function(){d.current&&(p?cancelAnimationFrame(d.current):clearTimeout(d.current)),u.current=0,a.current=i.current=l.current=d.current=null},Q.isPending=function(){return!!d.current},Q.flush=function(){return d.current?G(Date.now()):o.current},Q},[g,k,t,y,v,p,h,S]);return x}function Dn(e,t,n){var r=n===void 0?{}:n,i=r.leading,u=r.trailing;return Us(e,t,{maxWait:t,leading:i===void 0||i,trailing:u===void 0||u})}let St;const Xe=(e=!0,t=!1,n="window")=>{if(!e)return;const[r,i]=_.useState(0)||[!1,()=>{}],u=n==="window"?[]:[n];_.useEffect(()=>(a(),window.addEventListener("resize",l),()=>{clearTimeout(St),l.flush(),window.removeEventListener("resize",l)}),u);const d=()=>{if(n)return n==="window"?window.innerWidth:n.offsetWidth},a=()=>{i(d())},l=Dn(()=>{d()!==r&&(t&&(clearTimeout(St),document.body.classList.add("is-resizing"),St=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),a())},500,{leading:!0});return r},Rn=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[i,u]=_.useState({current:0,past:0})||[!1,()=>{}],[d,a]=_.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];_.useEffect(()=>(l(),window.addEventListener("scroll",o),()=>{o.flush(),window.removeEventListener("scroll",o)}),[]);const l=()=>{const m=window.scrollY,c=i.current,h=m-c,p=h>0?"down":"up";if(u({current:m,past:c}),p==="down"){m>=e+t.down&&!d.scrollDown&&(!d.scrollUp||h>t.up)&&(n(),a({scrollUp:!1,scrollDown:!0}));return}Math.abs(h)>=t.up&&!d.scrollUp&&(r(),a({scrollUp:!0,scrollDown:!1}))},o=Dn(()=>{l()},250);return i},Pn=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=_.useRef(!1);De(()=>{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)},An=e=>{const t=[];return e.forEach(n=>{const r=parseInt(n);isNaN(r)||t.push(r)}),t.sort((n,r)=>n-r)},Fn=(e,t,n)=>{let r=n.mobile;for(const i in t){const u=parseInt(String(t[i]));if(e>=u)r=n[u];else if(e<u)break}return r},Ws=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),zs=(e,t="en")=>new Date(e).toLocaleString(t,{day:"numeric",month:"short"}),In=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),Qt=e=>{let u;const d=xn(),a=xn(new Date(e));try{u=d.getTime()-a.getTime()}catch{return""}const l=u/36e5,o=Math.floor(u/864e5);if(o<1)return l<1?{path:"now"}:{path:"hours",number:Math.floor(l)};if(o<7)return{path:"days",number:o};const m=Math.floor(o/7);return m<=52?{path:"weeks",number:m}:{path:"years",number:Math.floor(o/365)}},xn=e=>{const n=(e||new Date).toUTCString();return new Date(n)},Vt={apolitical:"Apolitical",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",card_carousel_viewAll:"View all",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_registered:"Registered",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_cta_people:"View profile",card_cta_event:"Register now",card_cta_microcourse:"Enrol now",card_cta_event_loading:"Registering...",card_cta_microcourse_loading:"Enrolling...",card_cta_event_done:"Registered",card_cta_microcourse_done:"Enrolled",carousel_pagination_previous:"Previous",carousel_pagination_next:"Next",carousel_pagination_page:"Page {number} of {total}",collapsibleSection_summary:"Find out more",communityDetails_members:"Members",communityDetails_viewAll:"View all",communityDetails_invite:"Invite colleagues",community_joinToPost:"Join community to create a post.",activitySection_notFoundError:"Post not found",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",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",dates_now:"now",dates_hours:"{number}h",dates_days:"{number}d",dates_weeks:"{number}w",dates_years:"{number}y",discussion_action_answer:"answer",discussion_action_comment:"comment",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_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
 
35
- Thank you for helping to protect the Apolitical community from abusive content.`,discussion_form_title:"Write your {action}",discussion_form_placeholder:"Type your {action} here...",discussion_form_label:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Write something...",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_more:"and {number} more...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_thread_show:"Show {count, plural, =0 {replies} one {# reply} other {# replies}}",discussion_thread_hide:"Hide replies",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.",filters_all:"Show all",filters_disabled:"{name} - no results",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",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_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_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_correspondence:"Correspondence address",footer_contact_correspondence_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",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_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital and data",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",inviteModal_title:"You’re registered",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 emails below",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",joinCommunityButton:"Join community",joinCommunityButton_short:"Join",joinCommunityButton_joining:"Joining...",joinCommunityButton_member:"Member",joinCommunityButton_member_aria:"Leave community",joinCommunityButton_leave:"Leave",joinCommunityButton_leaving:"Leaving...",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.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll",member_apolitical:"Apolitical",member_community:"Community post",membersList:"Members",membersList_admin:"Admin",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_profile:"My profile",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",overlay_close:"Close",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",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",progressBar:"{number}% loaded",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!",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",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",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>",tags_community:"From the community",tooltip_loading:"Loading..."},Vs={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>"},Ys={collapsibleSection_summary:"En savoir plus",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>"},Gs={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>"},Js=Object.freeze(Object.defineProperty({__proto__:null,en:Vt,es:Vs,fr:Ys,pt:Gs},Symbol.toStringTag,{value:"Module"})),Ln=e=>e in Vt,ye=(e,t,n,r,i={})=>{let u="";return Ln(`${t}_${n}`)?u=e({id:`${t}_${n}`},i):u=e({id:t},{[r]:n,...i}),u},Xs=(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 u=Math.pow(10,(i+1)*3);if(u<=e){e=Math.round(e*t/u)/t,e===1e3&&i<n.length-1&&(e=1,i++),r=`${e}${n[i]}`;break}}return r},Bn=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},Zs=e=>e.replace(/\s+/g,"").length>0,qs=(e,t)=>{Array.isArray(t)||(t=[t]);const n=Cs(e);return t.forEach(({type:r,value:i})=>{Ns(n,r,i)}),n},Ks=e=>new Promise(t=>setTimeout(t,e)),ft=(e,t)=>_.Children.map(e,n=>_.cloneElement(n,{...t})),H=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:u="button",onClick:d=!1,className:a="",disabled:l=!1,screenreaderText:o=!1,children:m=!1,...c})=>{const p=Xe(typeof t=="object");if(typeof t=="object"&&typeof p=="number"){const k=Object.assign({},t),S=An(Object.keys(k));t=Fn(p,S,k)}const g=[];typeof t=="string"&&g.push(t),r&&(g.push("icon"),typeof r=="object"?(g.push(r.icon),r.position?g.push(r.position):g.push("left"),r.hover&&g.push(`hover_${r.hover}`),r.animate&&(g.push("animate"),typeof r.animate=="string"&&g.push(r.animate))):(g.push(r),!r.includes("right")&&!r.includes("left")&&g.push("left"))),n.muted&&g.push("muted"),n.fullWidth&&g.push("full-width");const v={...c,className:$(e,a,g,{"no-text":!m,disabled:l,button:i}),onClick:k=>{(!i||i[0]==="#")&&d&&(k.preventDefault(),k.stopPropagation()),d&&d(k)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};return i&&(u="a",v.href=i),_.createElement(u,v,m||(o?s.jsx(ue,{showOnFocus:!1,children:o}):null))},Ze=({buttons:e,className:t="",...n})=>{const r=e.length>1?"ul":"p",i=e.map((u,d)=>r==="p"?s.jsx(H,{...u},d):s.jsx("li",{children:s.jsx(H,{...u})},d));return _.createElement(r,{className:$("button-wrapper",t),...n,children:i})};const Pe=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return s.jsx("hr",{className:$(e,{"has-max-width":t}),style:n})},qe=({href:e,children:t,fallbackElement:n,className:r="",onClick:i,gtmContext:u,gtmType:d,...a})=>{if(e){const l={...a};return i&&(l.onClick=i),u&&(l["data-gtm-event-context"]=u),d&&(l["data-gtm-event-type"]=d),s.jsx("a",{href:e,className:$("gtm-trackable",r),...l,children:t})}return n?_.createElement(n,{children:t,className:r,...a}):t},bn={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"}},er=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:i}=e?bn[e]:bn.fallback;return{range:t&&t.length>0?t:r,sizes:n||i}},tr=({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},$t=({format:e,range:t,url:n,query:r})=>t.map(({height:i,width:u})=>`${n}?${tr({format:e,height:i,query:r,width:u})} ${u}w`).join(", ");const Yt=({image:e,className:t,testId:n})=>{const{description:r,height:i,type:u,query:d,url:a,width:l,loading:o,decoding:m,fetchPriority:c}=e,{range:h,sizes:p}=er(e),g=$t({format:"avif",query:d,range:h,url:a}),v=$t({format:"webp",query:d,range:h,url:a}),k=$t({format:"",query:d,range:h,url:a});return s.jsxs("picture",{className:t,children:[u!=="image/gif"&&s.jsx("source",{type:"image/avif",srcSet:g,sizes:p,"data-testid":"source"}),s.jsx("source",{type:"image/webp",srcSet:v,sizes:p,"data-testid":"source"}),s.jsx("img",{srcSet:k,sizes:p,src:a,alt:r,loading:o||"lazy",decoding:m||"async",fetchpriority:c||"auto",width:l,height:i,"data-testid":n||"image"})]})};let We=!1;const On=({isOpen:e=!1,isLoading:t=!1,children:n})=>{const r=M.useIntl(),i=_.useRef(null),[u,d]=_.useState("hidden");_.useEffect(()=>{const l=i.current;if(l)return l.addEventListener("transitionend",a),()=>{l.removeEventListener("transitionend",a)}},[]);const a=({propertyName:l})=>{l==="opacity"&&(We!==!1&&clearTimeout(We),d(o=>o==="opening"?"open":o==="closing"?"closed":o==="closed"?"hidden":o))};return De(()=>{We!==!1&&clearTimeout(We);let l="open";e?d("opening"):(d("closing"),l="hidden"),We=setTimeout(()=>{d(l)},300)},[e]),s.jsx("aside",{ref:i,className:$("tooltip text-medium",u,{loading:t}),hidden:u==="hidden",children:t?s.jsx("p",{children:r.formatMessage({id:"tooltip_loading"})}):typeof n=="string"?s.jsx("p",{children:n}):n})};const bt=({children:e,className:t="",...n})=>s.jsx("section",{className:$("full-width-section",t),...n,children:e});const nr=({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","data-gtm-event-type":"download-click","data-gtm-event-context":i.eventContext||"Download",target:"_blank",children:i.text})}),s.jsx(bt,{className:$("download-section",n),children:s.jsxs(s.Fragment,{children:[_.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),s.jsx(Ze,{buttons:r})]})})};const sr=({title:e=!1,logos:t=[],className:n=""})=>{const r=t.length;if(r===0)return null;const i={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:""};return s.jsxs("div",{className:$("logos",n),children:[e&&_.createElement(i.element,{className:"title"},i.text),s.jsx("ul",{className:$({"two-col":r===2||r===4,"three-col":r===5||r<=10&&r%3===0}),children:t.map(({logo:u,nameOfBusiness:d,link:a=!1,description:l=!1},o)=>{if(!u||!u.url)return null;const m=s.jsx("img",{src:u.url,width:u.width||"auto",height:u.height||"auto",alt:d});return s.jsxs("li",{children:[s.jsx("p",{className:"img-wrapper",children:a?s.jsx("a",{href:a,target:"_blank",rel:"nofollow noreferrer noopener",children:m}):m}),l&&s.jsx("small",{children:l})]},window.btoa(`${u.url}_${o}`))})})]})};const rr=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],ar=({className:e="",content:t,image:n,variant:r="default",spacing:i="normal",hideElements:u={eyebrow:!1,title:!1,text:!1},cta:d,children:a})=>{const l=["eyebrow","title","text"],o={eyebrow:"small",title:"h1",text:"p"},m={};return l.forEach(c=>{if(!t[c]){m[c]=!1;return}if(!u[c]){if(typeof t[c]=="object"){m[c]=t[c];const{text:h,element:p}=t[c];if(p&&rr.includes(p.toLowerCase()))return;m[c]={text:h,element:o[c]};return}m[c]={text:t[c],element:o[c]}}}),d&&d.link&&d.link[0]==="#"&&(d.props||(d.props={}),d.props.onClick=c=>{c.preventDefault(),c.stopPropagation();const h=document.getElementById(d.link.substring(1));h&&h.scrollIntoView({behavior:"smooth"})}),s.jsx(bt,{className:$("banner-section",r,i,e,{"has-image":n,"has-extra-spacing":i==="normal"&&m.eyebrow&&m.title}),children:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"content-wrapper",children:[l.map(c=>{if(m[c]&&typeof m[c]=="object"){const{text:h,element:p=""}=m[c];return _.createElement(p.toLowerCase(),{key:c,className:c},h)}return null}),a,d&&d.text&&d.link&&s.jsx(H,{variant:n||r==="light"?"primary":"secondary",size:{mobile:"medium",768:"large"},href:d.link,...d.props,children:d.text})]}),n&&s.jsx(Yt,{image:{...n,aspect:"banner"}})]})})},or=_.memo(ar);const ir=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:i})=>!n&&!r?null:s.jsxs("aside",{className:$("marketing-block",e),children:[n&&s.jsx("p",{className:"title",children:n}),r&&s.jsx("p",{children:r}),t&&s.jsx(H,{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})]}),Ye="https://storage.googleapis.com/apolitical-assets/",Fe={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},cr="200,000+";const Gt=({label:e=!1,className:t="",children:n})=>{const r=M.useIntl();return s.jsxs("details",{className:$("collapsible-section",t),children:[s.jsx("summary",{children:e||r.formatMessage({id:"collapsibleSection_summary"})}),s.jsx("div",{className:"content",children:n})]})};const Te=({variant:e="primary",className:t="",children:n,...r})=>s.jsx("div",{className:$("highlighted-text-box",e,t),...r,children:n});const Ke=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let i=n&&!!Object.keys(n).length;const u=typeof n=="object"&&"breakpoints"in n,d=Xe(u);if(u&&typeof n=="object"&&typeof d=="number"){const c=Object.assign({},n.breakpoints),h=An(Object.keys(c));i=Fn(d,h,c)}const{breakpoints:a,text:l="",component:o,...m}=n;return s.jsx(Te,{variant:"subtle",className:$("empty-state-box",e,r),children:s.jsxs(s.Fragment,{children:[t&&s.jsx(xt,{options:{forceBlock:!0},children:t}),i&&typeof n=="object"&&(o||s.jsx(H,{...m,variant:n.variant?n.variant:"secondary",children:l}))]})})};const Ht=({children:e,...t})=>s.jsx("p",{...t,children:e}),Qn={q:Ht,blockquote:Ht};for(let e=1;e<=6;e++)Qn[`h${e}`]={component:Ht,props:{className:"title"}};const Hn=({type:e="default",className:t="",heading:n=!1,children:r})=>s.jsxs("div",{className:$("helper-text-box text-small",e,t),children:[n&&s.jsx("p",{className:"title",children:n}),typeof r=="string"?s.jsx(xt,{options:{wrapper:_.Fragment,forceBlock:!0,overrides:Qn},children:r}):s.jsx("p",{children:r})]});const lr=({className:e="",show:t=!1,hide:n=!1,text:r,children:i})=>{const u=M.useIntl(),d=_.useRef(null),[a,l]=_.useState(""),[o,m]=_.useState("closed");_.useEffect(()=>{const p=d.current;if(p)return p.addEventListener("transitionend",c),()=>{p.removeEventListener("transitionend",c)}},[]),_.useEffect(()=>{if(!r||typeof r!="string")return;const p=r.split(`
35
+ Thank you for helping to protect the Apolitical community from abusive content.`,discussion_form_title:"Write your {action}",discussion_form_placeholder:"Type your {action} here...",discussion_form_label:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Write something...",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_more:"and {number} more...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_thread_show:"Show {count, plural, =0 {replies} one {# reply} other {# replies}}",discussion_thread_hide:"Hide replies",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.",filters_all:"Show all",filters_disabled:"{name} - no results",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",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_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_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_correspondence:"Correspondence address",footer_contact_correspondence_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",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_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital and data",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",inviteModal_title:"You’re registered",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 emails below",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",joinCommunityButton:"Join community",joinCommunityButton_short:"Join",joinCommunityButton_joining:"Joining...",joinCommunityButton_member:"Member",joinCommunityButton_member_aria:"Leave community",joinCommunityButton_leave:"Leave",joinCommunityButton_leaving:"Leaving...",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.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll",member_apolitical:"Apolitical",member_community:"Community post",membersList:"Members",membersList_admin:"Admin",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_profile:"My profile",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",overlay_close:"Close",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",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",progressBar:"{number}% loaded",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!",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",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",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>",tags_community:"From the community",tooltip_loading:"Loading..."},Vs={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>"},Ys={collapsibleSection_summary:"En savoir plus",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>"},Gs={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>"},Js=Object.freeze(Object.defineProperty({__proto__:null,en:Vt,es:Vs,fr:Ys,pt:Gs},Symbol.toStringTag,{value:"Module"})),Ln=e=>e in Vt,ye=(e,t,n,r,i={})=>{let u="";return Ln(`${t}_${n}`)?u=e({id:`${t}_${n}`},i):u=e({id:t},{[r]:n,...i}),u},Xs=(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 u=Math.pow(10,(i+1)*3);if(u<=e){e=Math.round(e*t/u)/t,e===1e3&&i<n.length-1&&(e=1,i++),r=`${e}${n[i]}`;break}}return r},Bn=(e=0)=>{setTimeout(()=>{const t=document.querySelector(".splash-screen");t&&t.remove(),window.prerenderReady=!0},e)},Zs=e=>e.replace(/\s+/g,"").length>0,qs=(e,t)=>{Array.isArray(t)||(t=[t]);const n=Cs(e);return t.forEach(({type:r,value:i})=>{Ns(n,r,i)}),n},Ks=e=>new Promise(t=>setTimeout(t,e)),ft=(e,t)=>_.Children.map(e,n=>_.cloneElement(n,{...t})),H=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:u="button",onClick:d=!1,className:a="",disabled:l=!1,screenreaderText:o=!1,children:m=!1,...c})=>{const p=Xe(typeof t=="object");if(typeof t=="object"&&typeof p=="number"){const k=Object.assign({},t),S=An(Object.keys(k));t=Fn(p,S,k)}const g=[];typeof t=="string"&&g.push(t),r&&(g.push("icon"),typeof r=="object"?(g.push(r.icon),r.position?g.push(r.position):g.push("left"),r.hover&&g.push(`hover_${r.hover}`),r.animate&&(g.push("animate"),typeof r.animate=="string"&&g.push(r.animate))):(g.push(r),!r.includes("right")&&!r.includes("left")&&g.push("left"))),n.muted&&g.push("muted"),n.fullWidth&&g.push("full-width");const v={...c,className:$(e,a,g,{"no-text":!m,disabled:l,button:i}),onClick:k=>{(!i||i[0]==="#")&&d&&(k.preventDefault(),k.stopPropagation()),d&&d(k)},disabled:typeof l=="object"&&"isClickable"in l?!l.isClickable:l};return i&&(u="a",v.href=i),_.createElement(u,v,m||(o?s.jsx(ue,{showOnFocus:!1,children:o}):null))},Ze=({buttons:e,className:t="",...n})=>{const r=e.length>1?"ul":"p",i=e.map((u,d)=>r==="p"?s.jsx(H,{...u},d):s.jsx("li",{children:s.jsx(H,{...u})},d));return _.createElement(r,{className:$("button-wrapper",t),...n,children:i})};const Re=({className:e="",maxWidth:t=!1})=>{const n=t?{"--max-width":`${t/16}rem`}:{};return s.jsx("hr",{className:$(e,{"has-max-width":t}),style:n})},qe=({href:e,children:t,fallbackElement:n,className:r="",onClick:i,gtmContext:u,gtmType:d,...a})=>{if(e){const l={...a};return i&&(l.onClick=i),u&&(l["data-gtm-event-context"]=u),d&&(l["data-gtm-event-type"]=d),s.jsx("a",{href:e,className:$("gtm-trackable",r),...l,children:t})}return n?_.createElement(n,{children:t,className:r,...a}):t},bn={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"}},er=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:i}=e?bn[e]:bn.fallback;return{range:t&&t.length>0?t:r,sizes:n||i}},tr=({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},$t=({format:e,range:t,url:n,query:r})=>t.map(({height:i,width:u})=>`${n}?${tr({format:e,height:i,query:r,width:u})} ${u}w`).join(", ");const Yt=({image:e,className:t,testId:n})=>{const{description:r,height:i,type:u,query:d,url:a,width:l,loading:o,decoding:m,fetchPriority:c}=e,{range:h,sizes:p}=er(e),g=$t({format:"avif",query:d,range:h,url:a}),v=$t({format:"webp",query:d,range:h,url:a}),k=$t({format:"",query:d,range:h,url:a});return s.jsxs("picture",{className:t,children:[u!=="image/gif"&&s.jsx("source",{type:"image/avif",srcSet:g,sizes:p,"data-testid":"source"}),s.jsx("source",{type:"image/webp",srcSet:v,sizes:p,"data-testid":"source"}),s.jsx("img",{srcSet:k,sizes:p,src:a,alt:r,loading:o||"lazy",decoding:m||"async",fetchpriority:c||"auto",width:l,height:i,"data-testid":n||"image"})]})};let We=!1;const On=({isOpen:e=!1,isLoading:t=!1,children:n})=>{const r=M.useIntl(),i=_.useRef(null),[u,d]=_.useState("hidden");_.useEffect(()=>{const l=i.current;if(l)return l.addEventListener("transitionend",a),()=>{l.removeEventListener("transitionend",a)}},[]);const a=({propertyName:l})=>{l==="opacity"&&(We!==!1&&clearTimeout(We),d(o=>o==="opening"?"open":o==="closing"?"closed":o==="closed"?"hidden":o))};return De(()=>{We!==!1&&clearTimeout(We);let l="open";e?d("opening"):(d("closing"),l="hidden"),We=setTimeout(()=>{d(l)},300)},[e]),s.jsx("aside",{ref:i,className:$("tooltip text-medium",u,{loading:t}),hidden:u==="hidden",children:t?s.jsx("p",{children:r.formatMessage({id:"tooltip_loading"})}):typeof n=="string"?s.jsx("p",{children:n}):n})};const bt=({children:e,className:t="",...n})=>s.jsx("section",{className:$("full-width-section",t),...n,children:e});const nr=({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","data-gtm-event-type":"download-click","data-gtm-event-context":i.eventContext||"Download",target:"_blank",children:i.text})}),s.jsx(bt,{className:$("download-section",n),children:s.jsxs(s.Fragment,{children:[_.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),s.jsx(Ze,{buttons:r})]})})};const sr=({title:e=!1,logos:t=[],className:n=""})=>{const r=t.length;if(r===0)return null;const i={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:""};return s.jsxs("div",{className:$("logos",n),children:[e&&_.createElement(i.element,{className:"title"},i.text),s.jsx("ul",{className:$({"two-col":r===2||r===4,"three-col":r===5||r<=10&&r%3===0}),children:t.map(({logo:u,nameOfBusiness:d,link:a=!1,description:l=!1},o)=>{if(!u||!u.url)return null;const m=s.jsx("img",{src:u.url,width:u.width||"auto",height:u.height||"auto",alt:d});return s.jsxs("li",{children:[s.jsx("p",{className:"img-wrapper",children:a?s.jsx("a",{href:a,target:"_blank",rel:"nofollow noreferrer noopener",children:m}):m}),l&&s.jsx("small",{children:l})]},window.btoa(`${u.url}_${o}`))})})]})};const rr=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],ar=({className:e="",content:t,image:n,variant:r="default",spacing:i="normal",hideElements:u={eyebrow:!1,title:!1,text:!1},cta:d,children:a})=>{const l=["eyebrow","title","text"],o={eyebrow:"small",title:"h1",text:"p"},m={};return l.forEach(c=>{if(!t[c]){m[c]=!1;return}if(!u[c]){if(typeof t[c]=="object"){m[c]=t[c];const{text:h,element:p}=t[c];if(p&&rr.includes(p.toLowerCase()))return;m[c]={text:h,element:o[c]};return}m[c]={text:t[c],element:o[c]}}}),d&&d.link&&d.link[0]==="#"&&(d.props||(d.props={}),d.props.onClick=c=>{c.preventDefault(),c.stopPropagation();const h=document.getElementById(d.link.substring(1));h&&h.scrollIntoView({behavior:"smooth"})}),s.jsx(bt,{className:$("banner-section",r,i,e,{"has-image":n,"has-extra-spacing":i==="normal"&&m.eyebrow&&m.title}),children:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"content-wrapper",children:[l.map(c=>{if(m[c]&&typeof m[c]=="object"){const{text:h,element:p=""}=m[c];return _.createElement(p.toLowerCase(),{key:c,className:c},h)}return null}),a,d&&d.text&&d.link&&s.jsx(H,{variant:n||r==="light"?"primary":"secondary",size:{mobile:"medium",768:"large"},href:d.link,...d.props,children:d.text})]}),n&&s.jsx(Yt,{image:{...n,aspect:"banner"}})]})})},or=_.memo(ar);const ir=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:i})=>!n&&!r?null:s.jsxs("aside",{className:$("marketing-block",e),children:[n&&s.jsx("p",{className:"title",children:n}),r&&s.jsx("p",{children:r}),t&&s.jsx(H,{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})]}),Ye="https://storage.googleapis.com/apolitical-assets/",Fe={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},cr="200,000+";const Gt=({label:e=!1,className:t="",children:n})=>{const r=M.useIntl();return s.jsxs("details",{className:$("collapsible-section",t),children:[s.jsx("summary",{children:e||r.formatMessage({id:"collapsibleSection_summary"})}),s.jsx("div",{className:"content",children:n})]})};const Te=({variant:e="primary",className:t="",children:n,...r})=>s.jsx("div",{className:$("highlighted-text-box",e,t),...r,children:n});const Ke=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let i=n&&!!Object.keys(n).length;const u=typeof n=="object"&&"breakpoints"in n,d=Xe(u);if(u&&typeof n=="object"&&typeof d=="number"){const c=Object.assign({},n.breakpoints),h=An(Object.keys(c));i=Fn(d,h,c)}const{breakpoints:a,text:l="",component:o,...m}=n;return s.jsx(Te,{variant:"subtle",className:$("empty-state-box",e,r),children:s.jsxs(s.Fragment,{children:[t&&s.jsx(xt,{options:{forceBlock:!0},children:t}),i&&typeof n=="object"&&(o||s.jsx(H,{...m,variant:n.variant?n.variant:"secondary",children:l}))]})})};const Ht=({children:e,...t})=>s.jsx("p",{...t,children:e}),Qn={q:Ht,blockquote:Ht};for(let e=1;e<=6;e++)Qn[`h${e}`]={component:Ht,props:{className:"title"}};const Hn=({type:e="default",className:t="",heading:n=!1,children:r})=>s.jsxs("div",{className:$("helper-text-box text-small",e,t),children:[n&&s.jsx("p",{className:"title",children:n}),typeof r=="string"?s.jsx(xt,{options:{wrapper:_.Fragment,forceBlock:!0,overrides:Qn},children:r}):s.jsx("p",{children:r})]});const lr=({className:e="",show:t=!1,hide:n=!1,text:r,children:i})=>{const u=M.useIntl(),d=_.useRef(null),[a,l]=_.useState(""),[o,m]=_.useState("closed");_.useEffect(()=>{const p=d.current;if(p)return p.addEventListener("transitionend",c),()=>{p.removeEventListener("transitionend",c)}},[]),_.useEffect(()=>{if(!r||typeof r!="string")return;const p=r.split(`
36
36
  `);l(p.length<3?`${r.substring(0,400)}...`:p.slice(0,3).join(`
37
- `))},[r]),_.useEffect(()=>{o==="ready-to-close"&&m("closing")},[o]);const c=({propertyName:p})=>{p==="max-height"&&m(g=>g==="opening"?"open":g==="closing"?"closed":g)};if(!r)return null;const h=["opening","open"].includes(o);return s.jsxs(Te,{variant:"subtle",className:$("hide-show-text-box",e),children:[s.jsxs("div",{ref:d,className:$("content",o),children:[s.jsx(xt,{options:{forceBlock:!0},children:o==="closed"?a:r}),o!=="closed"&&i]}),s.jsx("p",{className:"cta",children:s.jsx(H,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:$({"rotate-180":h}),onClick:()=>{m(h?"ready-to-close":"opening")},children:h?n||u.formatMessage({id:"hideShowTextBox_hide"}):t||u.formatMessage({id:"hideShowTextBox_show"})})})]})},ur=()=>_.Fragment,dr=({children:e})=>s.jsx(Te,{variant:"secondary",children:e}),mr=["span","strong","h1","h2","h3","h4","h5","h6","p"],fr=({children:e})=>{const t=M.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const u of _.Children.toArray(e))if(!(!u||typeof u=="string"||typeof u=="number"))if(_.isValidElement(u)&&u.type==="summary"){if(u.props&&u.props.children){for(const d of _.Children.toArray(u.props.children))if(!(!d||typeof d=="string"||typeof d=="number")&&_.isValidElement(d)){const a=d.type;if(mr.includes(a)){for(n=d.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(u);const i=n?n.toString():"";return s.jsx(Gt,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:r.map(u=>u)})},hr=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return s.jsx(Te,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return s.jsx(Te,{variant:"primary",children:e});case"pink-textbox":return s.jsx(Te,{variant:"tertiary",children:e});default:return s.jsx("div",{...t,children:e})}return s.jsx("div",{...t,children:e})},pr=e=>{const t=M.useIntl(),n=Date.now().toString();let r="default";const i=e.src;return i.includes("youtube")||i.includes("vimeo")?r="video":i.includes("riddle")||i.includes("sli.do")?r="poll":i.includes("padlet")&&(r="padlet"),s.jsxs(s.Fragment,{children:[s.jsx(ue,{children:s.jsx("a",{href:`#content-after-iframe-${n}`,children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})})}),s.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),s.jsx("span",{id:`content-after-iframe-${n}`,tabIndex:-1})]})},vn=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},gr=({children:e,...t})=>{let n={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(n.target="_blank");let r=e,i=!1;for(const u of _.Children.toArray(e))if(!(!u||typeof u=="string"||typeof u=="number")&&_.isValidElement(u)){const d=u.type;if(["button","center","span","strong"].includes(d)&&u.props&&u.props.children&&u.props.children[0])for((d==="button"||vn(u.props.children[0])==="button")&&(i=!0),r=u.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!_.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&vn(r)==="button"&&(i=!0);else break}return i?(n={...n,className:"button primary medium"},s.jsx("p",{className:"center",children:s.jsx(H,{variant:"primary",size:"medium",...n,children:r})})):s.jsx("a",{...n,children:r})},Un=({children:e})=>s.jsx("span",{children:e});const Ut=({className:e="",options:t={},children:n})=>{n=n.replace(/^<br\/?>/,"");const r={wrapper:_.Fragment,forceBlock:!0,overrides:{a:gr,CollapsibleSection:Gt,TextBox:Te,CaseStudy:dr,style:ur,details:fr,div:hr,iframe:pr}};return s.jsx("div",{className:$("markdown-text",e),children:s.jsx(xt,{options:{...r,...t},children:n})})};const Wn=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:i=""})=>{const u=e?{"--max-width":`${e/16}rem`}:{};return s.jsxs("section",{className:$("page-heading",i),children:[s.jsxs("div",{className:$("content",{"has-max-width":e}),style:u,children:[t&&t.text&&_.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&_.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),r]})};const Ge=({size:e="medium",variant:t="default",className:n="",children:r,...i})=>s.jsx("span",{className:$("pill",e,t,n),...i,children:r});const ht=({element:e="p",children:t=null,className:n="",...r})=>_.createElement(e,{...r,className:$("status-banner text-small",n),"aria-live":"assertive"},t);const _r=({progress:e=0,text:t=!1,className:n=""})=>{const r=M.useIntl(),i=e>75?100:e>50?75:e>25?50:e>5?25:0,u={"--progress":`${e}%`};return s.jsx("span",{className:$(`progress-bar section-${i}`,n),style:u,children:s.jsx(ue,{children:t?`${e} ${t}`:r.formatMessage({id:"progressBar"},{number:e})})})},zn=_.memo(_r);const Tt="loadingBlock_",xr=({progress:e=0,steps:t=!1,className:n=""})=>{const r=M.useIntl();t||(t={0:{text:r.formatMessage({id:`${Tt}loading`})},75:{text:r.formatMessage({id:`${Tt}almostDone`})},100:{text:r.formatMessage({id:`${Tt}complete`})}});let i=null;const u=Object.keys(t);for(let a=0;a<u.length&&!(e<parseInt(u[a]));a++)i=u[a];const d=i&&t[i].icon?{"--icon":`url(${Ye}icons/${t[i].icon}.svg)`}:{};return s.jsxs(Te,{className:$("loading-block",n,{"has-icon":i&&t[i].icon}),variant:"subtle",style:d,children:[i&&s.jsx("span",{className:"step",children:t[i].text}),s.jsx(zn,{progress:e})]})},br=_.memo(xr);const we=({element:e="div",className:t="",...n})=>s.jsx(zt,{element:e,className:$("loading-placeholder",t),...n});const Wt={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"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"]},Vn=(e,t)=>e in Wt?s.jsx("div",{className:e,children:Wt[e].map((n,r)=>Vn(n,r))},t):s.jsx(we,{className:e},t),vr=({layout:e="overview-page",...t})=>s.jsx("div",{className:$("loading-state",e),...t,children:Wt[e].map((n,r)=>Vn(n,r))}),Yn=e=>{const t=e&&e.toUpperCase().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):""},at=["#5AB6A3","#A2D7AF","#806056","#3962B3"],wr=e=>{const t=Math.ceil(26/at.length),n=Yn(e).toLowerCase();if(n==="")return at[0];const r=n.charCodeAt(0)-96;for(let i=0;i<at.length;i++)if(r<=t*(i+1))return at[i]};const wn=256,Be=({className:e="",src:t="",name:n,alt:r,width:i=wn,height:u=wn,...d})=>{const[a,l]=_.useState(!1),o=_.useRef(null);_.useEffect(()=>{const c=o.current;if(!c)return;const h=c.getContext("2d");if(!h)return;const p=i,g=u;typeof window<"u"&&window.devicePixelRatio&&(c.width=p*window.devicePixelRatio,c.height=g*window.devicePixelRatio,h.scale(window.devicePixelRatio,window.devicePixelRatio)),h.fillStyle=wr(n),h.fillRect(0,0,p,g),h.font=`${p/3}px Arial`,h.textAlign="center",h.fillStyle="white",h.fillText(Yn(n),p/2,g/1.6)},[n]);let m=!1;return t&&t!==""&&!a&&(t.includes("http")||t.includes("//"))&&(m=!0),s.jsx("figure",{className:$("profile-picture",e,{error:a}),...d,children:m?s.jsx("img",{src:t,alt:r||n,onError:()=>{l(!0)},width:i,height:u}):s.jsx("canvas",{ref:o})})},Jt=e=>e==="apolitical"?{image:`${Ye}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${Ye}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.country||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail},kr=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const i=e!=="",u=t!=="",d=n!=="";if(!i&&!u&&!d)return"";const a=`${e}${i&&u?` — ${t}`:t}`;let l=`${a}${(i||u)&&d?`, ${n}`:n}`;return l.length>r&&(l=a),l.length>r&&(l=Le(l,r)),l};const vt=({element:e="div",member:t="community",additionalContent:n=!1,gtmContext:r="member",gtmType:i="member-click",className:u=""})=>{const d=M.useIntl(),a=Jt(t);a.name||(a.name=d.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:l,url:o,image:m}=a,c=kr(a),h=n&&n.createdAt?Qt(n.createdAt):!1,p=n&&n.createdAt?In(n.createdAt):"";return _.createElement(e,{className:$("member text-medium",u),children:s.jsxs(qe,{href:o,gtmType:i,gtmContext:r,onClick:g=>{g==null||g.stopPropagation()},children:[s.jsx(Be,{name:l,src:m}),s.jsxs("p",{className:"details",children:[s.jsx("strong",{children:l}),n&&s.jsxs("span",{className:"additional-content",children:[n.createdAt&&h&&s.jsx("span",{className:"date",title:p,"aria-label":p,children:d.formatMessage({id:`dates_${h.path}`},{number:h.number})}),n.didEdit&&s.jsx("em",{children:d.formatMessage({id:"discussion_edited"})})]}),c&&s.jsx("small",{children:c})]})]})})};const kn={small:24,medium:48},Xt=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:i,showGap:u,showPlaceholders:d}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:a=2,className:l="",...o})=>{const m=M.useIntl();return!n||n.length===0?null:_.createElement(e,{...o,className:$("contributors",l,i,{"has-gap":u}),children:s.jsxs(s.Fragment,{children:[s.jsx("ul",{children:n.map((c,h)=>{let p,g="";if(h<a){const{name:v="",image:k=""}=Jt(c);if(d)return s.jsx(we,{element:"li",className:"contributor"},h);p=s.jsx(Be,{name:v,src:k,width:kn[i||"medium"],height:kn[i||"medium"]})}else if(h===a){const v=(t||n.length)-a;p=s.jsxs("small",{className:$({"large-number":v>99}),children:["+",Xs(v,0)]}),g="number-left"}return p?s.jsx("li",{className:$("contributor",g),children:p},h):null})}),r&&s.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?m.formatMessage({id:`member_${n[0]}`}):Le(n[0].name||"",20):null})]})})},Gn=({showDevTools:e=!0,children:t})=>{const n=new z.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return s.jsxs(z.QueryClientProvider,{client:n,children:[t,e&&s.jsx(Ds.ReactQueryDevtools,{initialIsOpen:!1})]})};var jr=_.createContext({client:mt});function yr(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,u=_.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&&(mt.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),mt.init(r,i)),mt)},[n,r]);return _.createElement(jr.Provider,{value:{client:u}},t)}const Jn=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?s.jsx(yr,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",ui_host:"eu.posthog.com",autocapture:!1,secure_cookie:!0,bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id}},children:e}):e,Xn=({children:e,locale:t,messages:n})=>{const r=t||"en",i={...Js[r],...n||{}};return s.jsx(M.IntlProvider,{locale:r,messages:i,children:e})},ke=_.createContext(null),Zn=({children:e,user:t})=>s.jsx(ke.Provider,{value:t,children:e}),Er=({bootstrap:e,children:t,intl:n})=>{const[r,i]=_.useState({isLoading:!0});return _.useEffect(()=>{e().then(u=>{i({...u,isLoading:!1}),Bn(5e3)}).catch(()=>i({isLoading:!1}))},[]),s.jsx(Xn,{locale:n==null?void 0:n.locale,messages:n==null?void 0:n.messages,children:s.jsx(Tn.CookiesProvider,{children:s.jsx(Zn,{user:r,children:s.jsx(Gn,{children:s.jsx(Jn,{user:r,children:t})})})})})};const Mt="joinCommunityButton",Zt=({isMember:e=!1,isShort:t=!1,functions:{join:n,leave:r}={join:()=>{},leave:()=>{}}})=>{const i=M.useIntl(),u=_.useContext(ke),d=u&&typeof u.id=="string",[a,l]=_.useState(e),[o,m]=_.useState(e?"joined":"notJoined");_.useEffect(()=>{o==="joining"?m("joined"):o==="leaving"&&m("notJoined")},[a]);const c={},h={};return a&&o!=="leaving"&&(c["data-hover-text"]=i.formatMessage({id:`${Mt}_leave`}),c["aria-label"]=i.formatMessage({id:`${Mt}_member_aria`}),h["aria-hidden"]="true"),s.jsx(H,{variant:a?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:a&&o!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async p=>{d&&(p.currentTarget.blur(),a?(m("leaving"),typeof r=="function"&&await r()):(m("joining"),typeof n=="function"&&await n()),l(!a))},className:$("join-community-button",o,{active:o==="joining"}),disabled:!d,...c,children:s.jsx("span",{className:"text",...h,children:i.formatMessage({id:`${Mt}${["joining","leaving"].includes(o)?`_${o}`:a?"_member":t?"_short":""}`})})})};const Ct="communityDetails_",Sr=({className:e="",isMember:t=!1,slug:n,members:{number:r=0,data:i=[]}={number:0,data:[]},functions:{invite:u,...d}})=>{const a=M.useIntl(),l=5,o=r||i.length,m=i.length?i:Array(l).fill({});return s.jsxs("div",{className:$("community-details",e),children:[s.jsx(Pe,{}),s.jsxs("div",{className:"member-details",children:[s.jsxs("div",{className:"top",children:[s.jsxs("h3",{children:[a.formatMessage({id:`${Ct}members`}),s.jsx("span",{className:"count",children:o})]}),s.jsx("p",{className:"text-small",children:s.jsx("a",{href:`/communities/${n}/members`,children:a.formatMessage({id:`${Ct}viewAll`})})})]}),s.jsx(Xt,{contributors:{total:r,data:m},styling:{size:"medium",showGap:!0,showPlaceholders:o===0},cutoff:l})]}),s.jsx(Zt,{isMember:t,functions:{...d}}),t&&s.jsx(H,{variant:"primary",onClick:u,icon:{icon:"plus"},styling:{fullWidth:!0},children:a.formatMessage({id:`${Ct}invite`})})]})};const $r=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=M.useIntl();return s.jsxs(s.Fragment,{children:[s.jsx(ue,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),s.jsx("ul",{className:$("breadcrumbs text-small",n),children:e.map(({text:i,href:u,current:d=!1},a)=>s.jsxs("li",{children:[d&&s.jsx(ue,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),s.jsx(qe,{href:d?void 0:u,children:Le(i,t)})]},`${window.btoa(i)}_${a}`))})]})};const Tr=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:i=""})=>{const u=M.useIntl(),d=t?[{id:"all",text:typeof t!="boolean"&&t.text||u.formatMessage({id:"filters_all"})},...e]:e,[a,l]=_.useState(t?["all"]:[]),o=(m,c)=>{let h=[];a.includes(m)?h=a.filter(p=>p!==m):m==="all"?h=["all"]:n?h=[...a.filter(p=>p!=="all"),m]:h=[m],l(p=>(r&&typeof r=="function"&&r({current:h,previous:p}),h)),c&&typeof c=="function"&&c()};return s.jsx("ul",{className:$("filters",i),children:d.map(({id:m,text:c,disabled:h=!1,callback:p=()=>{}})=>{let g={};return h&&(g={disabled:!0,"aria-label":u.formatMessage({id:"filters_disabled"},{name:c})}),s.jsx("li",{children:s.jsx("button",{className:$(m,{selected:a.includes(m)}),onClick:v=>{v.preventDefault(),v.stopPropagation(),o(m,p)},...g,children:c})},m)})})},Mr=(e,t)=>{const n=String(e);if(!t||!t.length)return`/${n}`;let r="";return t.forEach(({url:i,position:u})=>{u==="before-lang"?r+=`/${i}`:(r.includes(`/${n}/`)||(r+=`/${n}`),r+=`/${i}`)}),r.includes(`/${n}/`)||(r+=`/${n}`),r};const Nt={en:"English",es:"Español",fr:"Français",pt:"Português"},ot="languageSwitcher_",Cr=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:i=()=>{},urlParts:u,variant:d="default",label:a,className:l=""})=>{const o=M.useIntl(),[m,c]=_.useState(e);if(_.useEffect(()=>{e!==m&&c(e)},[e]),!r||!Object.values(r).some(v=>v&&v.post_name))return null;const p=Object.keys(r),g=m!==e;return s.jsxs("div",{className:$("language-switcher text-small",d,l),children:[s.jsxs("nav",{children:[d!=="short"&&s.jsx("p",{children:a||o.formatMessage({id:`${ot}label`})}),s.jsx("ul",{children:p.map(v=>{if(!Nt[v])return null;let k={className:v};return m===v?k["aria-label"]=o.formatMessage({id:`${ot}selected`},{language:Nt[v]}):k={...k,href:Mr(v,u),onClick:S=>{S.preventDefault(),S.stopPropagation(),c(v),i(v)}},s.jsx("li",{children:s.jsx(qe,{...k,fallbackElement:"span",children:Nt[v]})},v)})}),d!=="short"&&!g&&s.jsx("p",{children:o.formatMessage({id:`${ot}translation_${t?"original":n?"human":"machine"}`})})]}),d!=="short"&&!g&&!t&&!n&&s.jsx("small",{children:o.formatMessage({id:`${ot}disclaimer`},{email:Fe.support,link:v=>{const k=`mailto:${v}`;return s.jsx("a",{href:k,children:v})}})})]})};const Dt=M.createIntl({locale:"en",messages:Vt}),qn=({hasNextPage:e,loadNextPage:t,icon:n=!1,messages:r={button:Dt.formatMessage({id:"loadMore_button"}),endOfFeed:Dt.formatMessage({id:"loadMore_endOfFeed"}),error:Dt.formatMessage({id:"loadMore_error"})},className:i="",gtmContext:u="LoadMore"})=>{const[d,a]=_.useState(!1),[l,o]=_.useState(e),m=async c=>{try{await t(c)}catch(h){h instanceof Error&&h.message&&h.message.includes("Cannot read items")?o(!1):a(!0)}};return s.jsxs("footer",{className:$("load-more",i),children:[d&&s.jsx("p",{className:"error",children:r.error}),l?s.jsx(H,{variant:"secondary",icon:n,onClick:m,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:r.button}):s.jsx("p",{children:r.endOfFeed})]})};const qt=({variant:e="default",version:t="default",className:n="",...r})=>s.jsx("p",{className:"logo-wrapper",children:s.jsx("a",{href:"/home/",className:$("logo",e,t,n),...r,children:s.jsx(ue,{children:s.jsx(M.FormattedMessage,{id:"apolitical"})})})});let it=!1;const Kn=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const i=M.useIntl(),u=_.useRef(null),[d,a]=_.useState(!1),l=o=>{u.current&&o.target instanceof HTMLElement&&!u.current.contains(o.target)&&a(!1)};return _.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),_.createElement(e,{ref:u,className:$("more-menu text-medium",r),children:s.jsxs(s.Fragment,{children:[s.jsx(H,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>a(!d),"aria-haspopup":"true","aria-expanded":d,"aria-controls":t,screenreaderText:i.formatMessage({id:"moreMenu"})}),s.jsx("ul",{id:t,hidden:!d,children:n.map(({href:o,onClick:m,text:c,icon:h,...p},g)=>{const v={...p,onClick:k=>{a(!1),typeof m=="function"&&m(k)},onFocus:()=>{it&&(clearTimeout(it),it=!1)},onBlur:()=>{it=setTimeout(()=>{a(!1)},100)}};return o&&(v.href=o),s.jsx("li",{children:s.jsx(H,{variant:"tertiary",size:"medium",icon:h?{icon:h,position:"left"}:!1,...v,children:c})},`${window.btoa(c)}_${g}`)})})]})})},Nr=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const Dr=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"q-and-a",href:"/questions-answers/"},{key:"articles",href:"/solution-articles/"}],es=({activeLink:e})=>{const t=M.useIntl(),n=_.useContext(ke),r=n&&typeof n.id=="string";return s.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[Dr.map(({key:i,href:u})=>s.jsx("li",{className:$(i,{active:Nr(u,e)}),children:s.jsx("a",{href:u,"data-gtm-event-type":`${i}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:t.formatMessage({id:`navigationMenu_links_${i}`})})},i)),r&&s.jsx("li",{className:"profile","data-testid":"profile-link",children:s.jsxs("a",{href:"/profiles/me","data-gtm-event-type":"profile-click","data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:[s.jsx(Be,{name:(n==null?void 0:n.name)||"",src:n!=null&&n.image?n.image.thumbnail:""}),s.jsx("span",{children:t.formatMessage({id:"navigationMenu_profile"})})]})})]})},ze=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,Pr=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${ze(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(`${ze(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(`${ze(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
37
+ `))},[r]),_.useEffect(()=>{o==="ready-to-close"&&m("closing")},[o]);const c=({propertyName:p})=>{p==="max-height"&&m(g=>g==="opening"?"open":g==="closing"?"closed":g)};if(!r)return null;const h=["opening","open"].includes(o);return s.jsxs(Te,{variant:"subtle",className:$("hide-show-text-box",e),children:[s.jsxs("div",{ref:d,className:$("content",o),children:[s.jsx(xt,{options:{forceBlock:!0},children:o==="closed"?a:r}),o!=="closed"&&i]}),s.jsx("p",{className:"cta",children:s.jsx(H,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:$({"rotate-180":h}),onClick:()=>{m(h?"ready-to-close":"opening")},children:h?n||u.formatMessage({id:"hideShowTextBox_hide"}):t||u.formatMessage({id:"hideShowTextBox_show"})})})]})},ur=()=>_.Fragment,dr=({children:e})=>s.jsx(Te,{variant:"secondary",children:e}),mr=["span","strong","h1","h2","h3","h4","h5","h6","p"],fr=({children:e})=>{const t=M.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const u of _.Children.toArray(e))if(!(!u||typeof u=="string"||typeof u=="number"))if(_.isValidElement(u)&&u.type==="summary"){if(u.props&&u.props.children){for(const d of _.Children.toArray(u.props.children))if(!(!d||typeof d=="string"||typeof d=="number")&&_.isValidElement(d)){const a=d.type;if(mr.includes(a)){for(n=d.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(u);const i=n?n.toString():"";return s.jsx(Gt,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:r.map(u=>u)})},hr=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return s.jsx(Te,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return s.jsx(Te,{variant:"primary",children:e});case"pink-textbox":return s.jsx(Te,{variant:"tertiary",children:e});default:return s.jsx("div",{...t,children:e})}return s.jsx("div",{...t,children:e})},pr=e=>{const t=M.useIntl(),n=Date.now().toString();let r="default";const i=e.src;return i.includes("youtube")||i.includes("vimeo")?r="video":i.includes("riddle")||i.includes("sli.do")?r="poll":i.includes("padlet")&&(r="padlet"),s.jsxs(s.Fragment,{children:[s.jsx(ue,{children:s.jsx("a",{href:`#content-after-iframe-${n}`,children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})})}),s.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),s.jsx("span",{id:`content-after-iframe-${n}`,tabIndex:-1})]})},vn=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},gr=({children:e,...t})=>{let n={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(n.target="_blank");let r=e,i=!1;for(const u of _.Children.toArray(e))if(!(!u||typeof u=="string"||typeof u=="number")&&_.isValidElement(u)){const d=u.type;if(["button","center","span","strong"].includes(d)&&u.props&&u.props.children&&u.props.children[0])for((d==="button"||vn(u.props.children[0])==="button")&&(i=!0),r=u.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!_.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&vn(r)==="button"&&(i=!0);else break}return i?(n={...n,className:"button primary medium"},s.jsx("p",{className:"center",children:s.jsx(H,{variant:"primary",size:"medium",...n,children:r})})):s.jsx("a",{...n,children:r})},Un=({children:e})=>s.jsx("span",{children:e});const Ut=({className:e="",options:t={},children:n})=>{n=n.replace(/^<br\/?>/,"");const r={wrapper:_.Fragment,forceBlock:!0,overrides:{a:gr,CollapsibleSection:Gt,TextBox:Te,CaseStudy:dr,style:ur,details:fr,div:hr,iframe:pr}};return s.jsx("div",{className:$("markdown-text",e),children:s.jsx(xt,{options:{...r,...t},children:n})})};const Wn=({maxWidth:e=!1,title:t,subtitle:n,children:r,className:i=""})=>{const u=e?{"--max-width":`${e/16}rem`}:{};return s.jsxs("section",{className:$("page-heading",i),children:[s.jsxs("div",{className:$("content",{"has-max-width":e}),style:u,children:[t&&t.text&&_.createElement(t.element||"h1",{className:"title"},t.text),n&&n.text&&_.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),r]})};const Ge=({size:e="medium",variant:t="default",className:n="",children:r,...i})=>s.jsx("span",{className:$("pill",e,t,n),...i,children:r});const ht=({element:e="p",children:t=null,className:n="",...r})=>_.createElement(e,{...r,className:$("status-banner text-small",n),"aria-live":"assertive"},t);const _r=({progress:e=0,text:t=!1,className:n=""})=>{const r=M.useIntl(),i=e>75?100:e>50?75:e>25?50:e>5?25:0,u={"--progress":`${e}%`};return s.jsx("span",{className:$(`progress-bar section-${i}`,n),style:u,children:s.jsx(ue,{children:t?`${e} ${t}`:r.formatMessage({id:"progressBar"},{number:e})})})},zn=_.memo(_r);const Tt="loadingBlock_",xr=({progress:e=0,steps:t=!1,className:n=""})=>{const r=M.useIntl();t||(t={0:{text:r.formatMessage({id:`${Tt}loading`})},75:{text:r.formatMessage({id:`${Tt}almostDone`})},100:{text:r.formatMessage({id:`${Tt}complete`})}});let i=null;const u=Object.keys(t);for(let a=0;a<u.length&&!(e<parseInt(u[a]));a++)i=u[a];const d=i&&t[i].icon?{"--icon":`url(${Ye}icons/${t[i].icon}.svg)`}:{};return s.jsxs(Te,{className:$("loading-block",n,{"has-icon":i&&t[i].icon}),variant:"subtle",style:d,children:[i&&s.jsx("span",{className:"step",children:t[i].text}),s.jsx(zn,{progress:e})]})},br=_.memo(xr);const we=({element:e="div",className:t="",...n})=>s.jsx(zt,{element:e,className:$("loading-placeholder",t),...n});const Wt={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"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"]},Vn=(e,t)=>e in Wt?s.jsx("div",{className:e,children:Wt[e].map((n,r)=>Vn(n,r))},t):s.jsx(we,{className:e},t),vr=({layout:e="overview-page",...t})=>s.jsx("div",{className:$("loading-state",e),...t,children:Wt[e].map((n,r)=>Vn(n,r))}),Yn=e=>{const t=e&&e.toUpperCase().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):""},at=["#5AB6A3","#A2D7AF","#806056","#3962B3"],wr=e=>{const t=Math.ceil(26/at.length),n=Yn(e).toLowerCase();if(n==="")return at[0];const r=n.charCodeAt(0)-96;for(let i=0;i<at.length;i++)if(r<=t*(i+1))return at[i]};const wn=256,Be=({className:e="",src:t="",name:n,alt:r,width:i=wn,height:u=wn,...d})=>{const[a,l]=_.useState(!1),o=_.useRef(null);_.useEffect(()=>{const c=o.current;if(!c)return;const h=c.getContext("2d");if(!h)return;const p=i,g=u;typeof window<"u"&&window.devicePixelRatio&&(c.width=p*window.devicePixelRatio,c.height=g*window.devicePixelRatio,h.scale(window.devicePixelRatio,window.devicePixelRatio)),h.fillStyle=wr(n),h.fillRect(0,0,p,g),h.font=`${p/3}px Arial`,h.textAlign="center",h.fillStyle="white",h.fillText(Yn(n),p/2,g/1.6)},[n]);let m=!1;return t&&t!==""&&!a&&(t.includes("http")||t.includes("//"))&&(m=!0),s.jsx("figure",{className:$("profile-picture",e,{error:a}),...d,children:m?s.jsx("img",{src:t,alt:r||n,onError:()=>{l(!0)},width:i,height:u}):s.jsx("canvas",{ref:o})})},Jt=e=>e==="apolitical"?{image:`${Ye}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${Ye}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.country||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail},kr=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const i=e!=="",u=t!=="",d=n!=="";if(!i&&!u&&!d)return"";const a=`${e}${i&&u?` — ${t}`:t}`;let l=`${a}${(i||u)&&d?`, ${n}`:n}`;return l.length>r&&(l=a),l.length>r&&(l=Le(l,r)),l};const vt=({element:e="div",member:t="community",additionalContent:n=!1,gtmContext:r="member",gtmType:i="member-click",className:u=""})=>{const d=M.useIntl(),a=Jt(t);a.name||(a.name=d.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:l,url:o,image:m}=a,c=kr(a),h=n&&n.createdAt?Qt(n.createdAt):!1,p=n&&n.createdAt?In(n.createdAt):"";return _.createElement(e,{className:$("member text-medium",u),children:s.jsxs(qe,{href:o,gtmType:i,gtmContext:r,onClick:g=>{g==null||g.stopPropagation()},children:[s.jsx(Be,{name:l,src:m}),s.jsxs("p",{className:"details",children:[s.jsx("strong",{children:l}),n&&s.jsxs("span",{className:"additional-content",children:[n.createdAt&&h&&s.jsx("span",{className:"date",title:p,"aria-label":p,children:d.formatMessage({id:`dates_${h.path}`},{number:h.number})}),n.didEdit&&s.jsx("em",{children:d.formatMessage({id:"discussion_edited"})})]}),c&&s.jsx("small",{children:c})]})]})})};const kn={small:24,medium:48},Xt=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:i,showGap:u,showPlaceholders:d}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:a=2,className:l="",...o})=>{const m=M.useIntl();return!n||n.length===0?null:_.createElement(e,{...o,className:$("contributors",l,i,{"has-gap":u}),children:s.jsxs(s.Fragment,{children:[s.jsx("ul",{children:n.map((c,h)=>{let p,g="";if(h<a){const{name:v="",image:k=""}=Jt(c);if(d)return s.jsx(we,{element:"li",className:"contributor"},h);p=s.jsx(Be,{name:v,src:k,width:kn[i||"medium"],height:kn[i||"medium"]})}else if(h===a){const v=(t||n.length)-a;p=s.jsxs("small",{className:$({"large-number":v>99}),children:["+",Xs(v,0)]}),g="number-left"}return p?s.jsx("li",{className:$("contributor",g),children:p},h):null})}),r&&s.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?m.formatMessage({id:`member_${n[0]}`}):Le(n[0].name||"",20):null})]})})},Gn=({showDevTools:e=!0,children:t})=>{const n=new z.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return s.jsxs(z.QueryClientProvider,{client:n,children:[t,e&&s.jsx(Ds.ReactQueryDevtools,{initialIsOpen:!1})]})};var jr=_.createContext({client:mt});function yr(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,u=_.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&&(mt.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),mt.init(r,i)),mt)},[n,r]);return _.createElement(jr.Provider,{value:{client:u}},t)}const Jn=({children:e,user:t})=>t.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?s.jsx(yr,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",ui_host:"eu.posthog.com",autocapture:!1,secure_cookie:!0,bootstrap:{distinctID:t.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!t.id}},children:e}):e,Xn=({children:e,locale:t,messages:n})=>{const r=t||"en",i={...Js[r],...n||{}};return s.jsx(M.IntlProvider,{locale:r,messages:i,children:e})},ke=_.createContext(null),Zn=({children:e,user:t})=>s.jsx(ke.Provider,{value:t,children:e}),Er=({bootstrap:e,children:t,intl:n})=>{const[r,i]=_.useState({isLoading:!0});return _.useEffect(()=>{e().then(u=>{i({...u,isLoading:!1}),Bn(5e3)}).catch(()=>i({isLoading:!1}))},[]),s.jsx(Xn,{locale:n==null?void 0:n.locale,messages:n==null?void 0:n.messages,children:s.jsx(Tn.CookiesProvider,{children:s.jsx(Zn,{user:r,children:s.jsx(Gn,{children:s.jsx(Jn,{user:r,children:t})})})})})};const Mt="joinCommunityButton",Zt=({isMember:e=!1,isShort:t=!1,functions:{join:n,leave:r}={join:()=>{},leave:()=>{}}})=>{const i=M.useIntl(),u=_.useContext(ke),d=u&&typeof u.id=="string",[a,l]=_.useState(e),[o,m]=_.useState(e?"joined":"notJoined");_.useEffect(()=>{o==="joining"?m("joined"):o==="leaving"&&m("notJoined")},[a]);const c={},h={};return a&&o!=="leaving"&&(c["data-hover-text"]=i.formatMessage({id:`${Mt}_leave`}),c["aria-label"]=i.formatMessage({id:`${Mt}_member_aria`}),h["aria-hidden"]="true"),s.jsx(H,{variant:a?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:a&&o!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async p=>{d&&(p.currentTarget.blur(),a?(m("leaving"),typeof r=="function"&&await r()):(m("joining"),typeof n=="function"&&await n()),l(!a))},className:$("join-community-button",o,{active:o==="joining"}),disabled:!d,...c,children:s.jsx("span",{className:"text",...h,children:i.formatMessage({id:`${Mt}${["joining","leaving"].includes(o)?`_${o}`:a?"_member":t?"_short":""}`})})})};const Ct="communityDetails_",Sr=({className:e="",isMember:t=!1,slug:n,members:{number:r=0,data:i=[]}={number:0,data:[]},functions:{invite:u,...d}})=>{const a=M.useIntl(),l=5,o=r||i.length,m=i.length?i:Array(l).fill({});return s.jsxs("div",{className:$("community-details",e),children:[s.jsx(Re,{}),s.jsxs("div",{className:"member-details",children:[s.jsxs("div",{className:"top",children:[s.jsxs("h3",{children:[a.formatMessage({id:`${Ct}members`}),s.jsx("span",{className:"count",children:o})]}),s.jsx("p",{className:"text-small",children:s.jsx("a",{href:`/communities/${n}/members`,children:a.formatMessage({id:`${Ct}viewAll`})})})]}),s.jsx(Xt,{contributors:{total:r,data:m},styling:{size:"medium",showGap:!0,showPlaceholders:o===0},cutoff:l})]}),s.jsx(Zt,{isMember:t,functions:{...d}}),t&&s.jsx(H,{variant:"primary",onClick:u,icon:{icon:"plus"},styling:{fullWidth:!0},children:a.formatMessage({id:`${Ct}invite`})})]})};const $r=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=M.useIntl();return s.jsxs(s.Fragment,{children:[s.jsx(ue,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),s.jsx("ul",{className:$("breadcrumbs text-small",n),children:e.map(({text:i,href:u,current:d=!1},a)=>s.jsxs("li",{children:[d&&s.jsx(ue,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),s.jsx(qe,{href:d?void 0:u,children:Le(i,t)})]},`${window.btoa(i)}_${a}`))})]})};const Tr=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:i=""})=>{const u=M.useIntl(),d=t?[{id:"all",text:typeof t!="boolean"&&t.text||u.formatMessage({id:"filters_all"})},...e]:e,[a,l]=_.useState(t?["all"]:[]),o=(m,c)=>{let h=[];a.includes(m)?h=a.filter(p=>p!==m):m==="all"?h=["all"]:n?h=[...a.filter(p=>p!=="all"),m]:h=[m],l(p=>(r&&typeof r=="function"&&r({current:h,previous:p}),h)),c&&typeof c=="function"&&c()};return s.jsx("ul",{className:$("filters",i),children:d.map(({id:m,text:c,disabled:h=!1,callback:p=()=>{}})=>{let g={};return h&&(g={disabled:!0,"aria-label":u.formatMessage({id:"filters_disabled"},{name:c})}),s.jsx("li",{children:s.jsx("button",{className:$(m,{selected:a.includes(m)}),onClick:v=>{v.preventDefault(),v.stopPropagation(),o(m,p)},...g,children:c})},m)})})},Mr=(e,t)=>{const n=String(e);if(!t||!t.length)return`/${n}`;let r="";return t.forEach(({url:i,position:u})=>{u==="before-lang"?r+=`/${i}`:(r.includes(`/${n}/`)||(r+=`/${n}`),r+=`/${i}`)}),r.includes(`/${n}/`)||(r+=`/${n}`),r};const Nt={en:"English",es:"Español",fr:"Français",pt:"Português"},ot="languageSwitcher_",Cr=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:i=()=>{},urlParts:u,variant:d="default",label:a,className:l=""})=>{const o=M.useIntl(),[m,c]=_.useState(e);if(_.useEffect(()=>{e!==m&&c(e)},[e]),!r||!Object.values(r).some(v=>v&&v.post_name))return null;const p=Object.keys(r),g=m!==e;return s.jsxs("div",{className:$("language-switcher text-small",d,l),children:[s.jsxs("nav",{children:[d!=="short"&&s.jsx("p",{children:a||o.formatMessage({id:`${ot}label`})}),s.jsx("ul",{children:p.map(v=>{if(!Nt[v])return null;let k={className:v};return m===v?k["aria-label"]=o.formatMessage({id:`${ot}selected`},{language:Nt[v]}):k={...k,href:Mr(v,u),onClick:S=>{S.preventDefault(),S.stopPropagation(),c(v),i(v)}},s.jsx("li",{children:s.jsx(qe,{...k,fallbackElement:"span",children:Nt[v]})},v)})}),d!=="short"&&!g&&s.jsx("p",{children:o.formatMessage({id:`${ot}translation_${t?"original":n?"human":"machine"}`})})]}),d!=="short"&&!g&&!t&&!n&&s.jsx("small",{children:o.formatMessage({id:`${ot}disclaimer`},{email:Fe.support,link:v=>{const k=`mailto:${v}`;return s.jsx("a",{href:k,children:v})}})})]})};const Dt=M.createIntl({locale:"en",messages:Vt}),qn=({hasNextPage:e,loadNextPage:t,icon:n=!1,messages:r={button:Dt.formatMessage({id:"loadMore_button"}),endOfFeed:Dt.formatMessage({id:"loadMore_endOfFeed"}),error:Dt.formatMessage({id:"loadMore_error"})},className:i="",gtmContext:u="LoadMore"})=>{const[d,a]=_.useState(!1),[l,o]=_.useState(e),m=async c=>{try{await t(c)}catch(h){h instanceof Error&&h.message&&h.message.includes("Cannot read items")?o(!1):a(!0)}};return s.jsxs("footer",{className:$("load-more",i),children:[d&&s.jsx("p",{className:"error",children:r.error}),l?s.jsx(H,{variant:"secondary",icon:n,onClick:m,"data-gtm-event-context":u,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:r.button}):s.jsx("p",{children:r.endOfFeed})]})};const qt=({variant:e="default",version:t="default",className:n="",...r})=>s.jsx("p",{className:"logo-wrapper",children:s.jsx("a",{href:"/home/",className:$("logo",e,t,n),...r,children:s.jsx(ue,{children:s.jsx(M.FormattedMessage,{id:"apolitical"})})})});let it=!1;const Kn=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const i=M.useIntl(),u=_.useRef(null),[d,a]=_.useState(!1),l=o=>{u.current&&o.target instanceof HTMLElement&&!u.current.contains(o.target)&&a(!1)};return _.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),_.createElement(e,{ref:u,className:$("more-menu text-medium",r),children:s.jsxs(s.Fragment,{children:[s.jsx(H,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>a(!d),"aria-haspopup":"true","aria-expanded":d,"aria-controls":t,screenreaderText:i.formatMessage({id:"moreMenu"})}),s.jsx("ul",{id:t,hidden:!d,children:n.map(({href:o,onClick:m,text:c,icon:h,...p},g)=>{const v={...p,onClick:k=>{a(!1),typeof m=="function"&&m(k)},onFocus:()=>{it&&(clearTimeout(it),it=!1)},onBlur:()=>{it=setTimeout(()=>{a(!1)},100)}};return o&&(v.href=o),s.jsx("li",{children:s.jsx(H,{variant:"tertiary",size:"medium",icon:h?{icon:h,position:"left"}:!1,...v,children:c})},`${window.btoa(c)}_${g}`)})})]})})},Nr=(e,t=!1)=>t?e.replaceAll("/","")===t:typeof window<"u"&&window.location&&window.location.pathname===e;const Dr=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"q-and-a",href:"/questions-answers/"},{key:"articles",href:"/solution-articles/"}],es=({activeLink:e})=>{const t=M.useIntl(),n=_.useContext(ke),r=n&&typeof n.id=="string";return s.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[Dr.map(({key:i,href:u})=>s.jsx("li",{className:$(i,{active:Nr(u,e)}),children:s.jsx("a",{href:u,"data-gtm-event-type":`${i}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:t.formatMessage({id:`navigationMenu_links_${i}`})})},i)),r&&s.jsx("li",{className:"profile","data-testid":"profile-link",children:s.jsxs("a",{href:"/profiles/me","data-gtm-event-type":"profile-click","data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:[s.jsx(Be,{name:(n==null?void 0:n.name)||"",src:n!=null&&n.image?n.image.thumbnail:""}),s.jsx("span",{children:t.formatMessage({id:"navigationMenu_profile"})})]})})]})},ze=(e,t,n)=>`${e}?share=${t}${n?`&uuid=${n}`:""}`,Rr=({title:e,link:t,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${ze(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(`${ze(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(`${ze(t,"facebook",n)}`)}&t=${e}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(e)}&body=${encodeURIComponent(`${e}
38
38
 
39
- ${ze(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:ze(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,i)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(i))}];const Rr="shareLinks_",Ar=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:i="large",variant:u="default",className:d=""})=>{const a=M.useIntl(),l=Pr({title:e,link:t,referrer:n});return s.jsxs("aside",{className:$("share-links",i,u,d),children:[s.jsx("p",{className:"text-small",children:a.formatMessage({id:"shareLinks_label"})}),s.jsx("ul",{children:l.map(({key:o,icon:m,url:c,shouldRender:h=!0,onClick:p})=>{if(typeof h=="function"&&!h())return null;const g={};return p&&(g.onClick=v=>p(v,c)),s.jsx("li",{children:s.jsx(H,{size:i,variant:"tertiary",icon:{icon:m||o},href:c,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${o}-click`,"data-testid":"link",screenreaderText:a.formatMessage({id:`${Rr}link_${o}`}),...g})},o)})})]})};const Fr=({tabs:e,className:t=""})=>{var l;const n=(o,m,c)=>(o||(o=`panel-${window.btoa(m)}-${c}`),o);let r=e.findIndex(o=>o.current===!0);if(r<0&&(r=0),window.location.hash){const o=window.location.hash.replace("#","");if(e.find(c=>c.id===o)){for(let c=0;c<e.length;c++)if(n(e[c].id,e[c].text,c)===o){r=c;break}}}const[i,u]=_.useState((l=e[r])!=null&&l.id?e[r].id:n(e[r].id,e[r].text,r)),d=[],a=[];return e.forEach(({id:o,text:m,content:c,href:h},p)=>{o=n(o,m,p);const g=i===o,v={};h||(v["aria-controls"]=o,v.onClick=k=>{k.preventDefault(),k.stopPropagation(),u(o),window.location.hash=`#${o}`},a.push(s.jsx("section",{id:o,hidden:!g,role:"tabpanel","aria-labelledby":`tab-${o}`,"aria-live":g?"assertive":"off",children:typeof c=="string"?s.jsx("p",{children:c}):c},`section-${o}`))),d.push(s.jsx("li",{children:s.jsx("a",{href:h||`#${o}`,id:`tab-${o}`,className:$({selected:g}),role:"tab","aria-selected":g,...v,children:m})},`tab-${o}`))}),s.jsxs("div",{className:$("tabs-wrapper",t),children:[s.jsx("ul",{className:"tabs",role:"tablist",children:d}),s.jsx("div",{className:"tab-content",children:a})]})};const Ir={"2-1":901,"1-3":769},ts=({layout:e="2-1",hideOnMobile:t=!1,className:n="",children:r})=>{const i=Xe(!0);let u=r;return _.Children.count(r)===1&&(u=_.Children.toArray(r)[0],u.props&&(u=u.props.children)),s.jsx("section",{className:$("columns",`layout-${e}`,n),children:_.Children.map(u,(d,a)=>t!==!1&&a===t&&i&&i<Ir[e]?null:d)})},Lr=({activeLink:e,...t})=>s.jsx(ts,{layout:"1-3",children:s.jsxs(s.Fragment,{children:[s.jsx(es,{activeLink:e}),s.jsx(Wn,{...t})]})});const Pt="cookieBanner_",Rt=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],At=new Date(Date.now()+12*30*24*60*60*1e3),ns=()=>{const e=M.useIntl(),[t,n,r]=Tn.useCookies(Rt),[i,u]=_.useState(!t["apol-cookie-banner"]),d=()=>{Rt.forEach(m=>{n(m,!0,{path:"/",expires:At,domain:m==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),u(!1),window.location.reload()},a=()=>{n("apol-cookie-banner",!0,{path:"/",expires:At}),Rt.forEach(m=>{if(m==="apol-cookie-banner"){n(m,!0,{path:"/",expires:At});return}r(m)}),u(!1)};if(!i)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:a,gtmType:"reject-all"},{id:"accept",onClick:d,gtmType:"accepted-all"}],o=[];return l.forEach(m=>{o.push({variant:m.href?"tertiary":"primary",href:m.href,onClick:m.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${m.gtmType}-click`,children:e.formatMessage({id:`${Pt}buttons_${m.id}`})})}),s.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[s.jsx("h6",{children:e.formatMessage({id:`${Pt}title`})}),s.jsx("p",{children:e.formatMessage({id:`${Pt}text`})}),s.jsx(Ze,{buttons:o})]})},$e={platform:{order:["events","courses","qanda","articles"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},qanda:{href:"/questions-answers/",gtmType:"q-and-a-click"},articles:{href:"/solution-articles/",gtmType:"articles-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:["story","team","careers","partner","contact"],story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:Fe["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Fe["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:Fe.support,gtmType:"concierge-email-click"},business:{email:Fe.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 Ie="footer_",pt="SiteFooter",jn=({group:e})=>{const t=$e[e].order||[];let n=!1;return"text"in $e[e]&&(n=$e[e].text),s.jsxs(_.Fragment,{children:[s.jsx("p",{className:"pre-title",children:s.jsx(M.FormattedMessage,{id:`${Ie}${e}`})}),Array.isArray(t)&&t.length>0&&s.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:u}=$e[e][r],d={};return["legal"].includes(e)&&(d.target="_blank",d.rel="noopener"),s.jsx("li",{children:s.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":pt,"data-gtm-event-type":u,...d,children:s.jsx(M.FormattedMessage,{id:`${Ie}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&s.jsx("dl",{className:"text-medium",children:n.order.map(r=>s.jsxs(_.Fragment,{children:[s.jsx("dt",{children:s.jsx(M.FormattedMessage,{id:`${Ie}${e}_${r}`})}),s.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&s.jsx("address",{children:s.jsx(M.FormattedMessage,{id:`${Ie}${e}_${r}_address`,values:{br:s.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&s.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":pt,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},Kt=()=>s.jsx("div",{id:"footer",children:s.jsxs("div",{className:"wrapper",children:[s.jsx(zt,{element:"hr"}),s.jsx(qt,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":pt,"data-gtm-event-type":"logo-homepage-link"}),s.jsx("footer",{children:["platform","community","company","contact"].map(e=>s.jsxs("div",{className:"group",children:[s.jsx(jn,{group:e}),Object.keys($e[e]).includes("child")&&s.jsx(jn,{group:$e[e].child})]},e))}),s.jsx("hr",{}),s.jsxs("div",{className:"sub-footer",children:[s.jsx("ul",{children:Array.isArray($e.social.order)&&$e.social.order.map(e=>{const t=$e.social[e];return s.jsx("li",{className:e,children:s.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":pt,"data-gtm-event-type":"social-click",children:s.jsx("span",{className:"hidden",children:s.jsx(M.FormattedMessage,{id:`${Ie}social_${e}`})})})},e)})}),s.jsx("small",{children:s.jsx(M.FormattedMessage,{id:`${Ie}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})});const ct="emailHelperTextBox_",Br=({type:e,email:t,redirectPath:n,resendVerificationCode:r})=>{const i=M.useIntl(),[u,d]=_.useState({path:`${ct}default`,type:"default",link:{},mail:{},error:""}),[a,l]=_.useState(!1),o=_.useCallback(p=>{p.preventDefault(),p.stopPropagation();const g=v=>{d({path:`${ct}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:k=>o(k),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:v})};if(typeof r!="function"){g(i.formatMessage({id:`${ct}error_noFunction`}));return}l(!0),r(t).then(()=>{localStorage.setItem("email",t),window.location.href=n||"/signup/verify-email"}).catch(v=>{g(v.message)}).finally(()=>{l(!1)})},[t,n,r]);_.useEffect(()=>{let p=ct,g="default",v={},k={};switch(e){case"gov":p+="autoApproved",g="success";break;case"nonGov":p+="unrecognisedEmail",g="error",v={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":p+="pendingApproval",g="error",k={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":p+="emailUnverified",g="error",v={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:S=>o(S),"data-testid":"send-verify-email-click"};break;case"exists":p+="emailAlreadyExists",g="error",v={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},k={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:p+="default",v={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}d({...u,path:p,type:g,link:v,mail:k})},[e]);const m={};return["link","mail"].forEach(p=>{m[p]=Object.keys(u[p]).length?g=>s.jsx("a",{...u[p],children:g}):g=>g}),s.jsx(Hn,{type:u.type,heading:a?!1:i.formatMessage({id:`${u.path}_title`}),children:a?s.jsxs(s.Fragment,{children:[s.jsx(we,{element:"span"}),s.jsx(we,{element:"span"})]}):i.formatMessage({id:`${u.path}_text`},{...m,strong:p=>s.jsx("strong",{children:p}),em:p=>s.jsx("em",{children:p}),br:s.jsxs(s.Fragment,{children:[s.jsx("br",{}),s.jsx("br",{})]}),error:u.error})})};const lt="passwordRules_",ss="isMoreThanEightCharacters",rs="includesNumberAndSymbol",as="includesLowerAndUppercase",Or={[ss]:"8Characters",[rs]:"numberSymbol",[as]:"lowercaseUppercase"},Qr=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=M.useIntl();return s.jsxs("aside",{className:$("password-rules",t),children:[s.jsx("small",{children:n.formatMessage({id:`${lt}intro`})}),s.jsx("ul",{children:[ss,rs,as].map(r=>s.jsxs("li",{className:$({matches:e[r]}),children:[s.jsxs(ue,{children:[n.formatMessage({id:`${lt}rule_label`})," "]}),s.jsx("span",{children:n.formatMessage({id:`${lt}rule_${Or[r]}`})}),!e[r]&&s.jsxs(ue,{element:"strong",children:[" "," ",n.formatMessage({id:`${lt}notMet`})]})]},`rule-${r}`))})]})},Hr=_.memo(Qr);const Ur=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:i=()=>{}},className:u="",hasLoaded:d=!1})=>{const a=M.useIntl(),[l,o]=_.useState({setUp:!1,id:null,rating:null,disabled:!0}),m=async()=>{try{const S=await n();o(y=>({...y,setUp:!0,id:S&&S.id,disabled:!1}))}catch(S){o(y=>({...y,setUp:!0,disabled:!0})),i(S)}};if(_.useEffect(()=>{d&&!l.setUp&&m()},[d]),!d)return s.jsx(we,{className:"rating-placeholder"});const{id:c,rating:h,disabled:p}=l,g="ratings_",v={text:a.formatMessage({id:`${g}text`}),low:a.formatMessage({id:`${g}low`}),high:a.formatMessage({id:`${g}high`}),success:a.formatMessage({id:`${g}success`}),...e},k=async S=>{if(!(!c||p))try{o(y=>({...y,rating:S,disabled:!0})),await r({id:c,value:S})}catch(y){o(x=>({...x,rating:null})),i(y)}finally{o(y=>({...y,disabled:!1}))}};return s.jsxs("div",{className:$("rating",u),children:[s.jsx("span",{className:"label",children:v[h?"success":"text"]}),s.jsx("ol",{children:Array.from(new Array(t).keys()).map(S=>{const y=S+1;return s.jsx("li",{className:$({selected:h&&y<=h}),children:s.jsx(H,{variant:"tertiary",size:"small",icon:{icon:`star${!h||y>h?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${a.formatMessage({id:`${g}stars`},{number:y,total:t})}${y===1||y===t?` - ${v[y===1?"low":"high"]}`:""}`,onClick:x=>{x.preventDefault(),x.stopPropagation(),k(y)},disabled:p})},`rating-${y}`)})})]})};const os=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:u="form-submission"})=>{const{searchIsOpen:d=!0,isDesktopVersion:a=!1}=n||{},l=M.useIntl(),o=_.useRef(null);De(()=>{!n||a||!d||o.current&&o.current.focus()},[d]);const m=c=>{c.preventDefault(),c.stopPropagation(),!(!o.current||!o.current.value||o.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(o.current.value)}`)};return s.jsx("form",{onSubmit:m,className:$("search-form gtm-trackable",t),"data-gtm-event-context":i,"data-gtm-event-type":u,children:s.jsx("fieldset",{id:`${e}-form`,hidden:n?!d:!1,role:"search",children:s.jsxs("p",{children:[s.jsx(ue,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),s.jsx("input",{ref:o,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:c=>{c.key==="Enter"&&m(c)}}),s.jsx("button",{className:"clear",onClick:c=>{c.preventDefault(),c.stopPropagation(),o.current&&o.current.value&&(o.current.value="")},children:s.jsx(ue,{children:l.formatMessage({id:"search_clear"})})}),s.jsx("button",{className:"search",onClick:m,children:s.jsx(ue,{children:l.formatMessage({id:"search_cta"})})})]})})})};const is=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:i,backgroundColor:u,onClose:d,reportError:a,sendInvites:l,initialFormStatus:o="NOT_SUBMITTED"})=>{const[m,c]=_.useState([]),[h,p]=_.useState(!0),[g,v]=_.useState(o),{formatMessage:k}=M.useIntl(),S=async C=>{C.preventDefault();try{await l(m),c([]),v("SUCCESS")}catch(D){v("ERROR"),a(D)}},y=C=>{C.preventDefault(),v("NOT_SUBMITTED"),p(!0),c([])},x=C=>{C.preventDefault(),d(),v("CLOSED")};return g==="CLOSED"?null:g==="ERROR"||g==="SUCCESS"?s.jsxs("div",{className:"invite-form-wrapper",children:[s.jsx("div",{className:"content centred",children:g==="SUCCESS"?s.jsx("h2",{className:"success-title",children:k({id:"inviteForm_success"})}):s.jsxs("h2",{className:"error-title",children:[" ",k({id:"inviteForm_error"})]})}),s.jsx(Pe,{}),s.jsx("div",{className:"footer",children:g==="SUCCESS"?s.jsxs(s.Fragment,{children:[s.jsx(H,{variant:"secondary",onClick:y,children:k({id:"inviteForm_ctaSendMoreInvites"})}),s.jsx(H,{onClick:x,children:k({id:"inviteForm_ctaDone"})})]}):s.jsx(H,{onClick:y,children:k({id:"inviteForm_ctaTryAgain"})})})]}):s.jsx("div",{className:"invite-form-wrapper",children:s.jsxs("form",{style:{backgroundColor:u},onSubmit:S,className:$("invite-form gtm-trackable"),children:[s.jsxs("fieldset",{className:"content",children:[s.jsx("h2",{className:"title",style:{color:r},children:e}),s.jsx("label",{htmlFor:"email-input",className:"label",style:{color:i},children:t}),s.jsx(Ps.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:k({id:"inviteForm_email_placeholder"}),emails:m,onChange:C=>{c(C),p(!C.length)},autoFocus:!1,getLabel:(C,D,R)=>s.jsxs("div",{className:"email text-medium",children:[s.jsx("div",{"data-tag-item":!0,children:C}),s.jsx(H,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{R(D),p(!m.length)},className:"remove-email-button",screenreaderText:k({id:"overlay_close"})})]},D)})]}),s.jsx(Pe,{}),s.jsx("fieldset",{className:"footer",children:s.jsx(H,{className:"sendEmailsButton",disabled:h,children:n})})]})})},U={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=u=>{const d=`logged${e?"In":"Out"}`;return t>=n[u][d]};let i={};return["navigation","search"].forEach(u=>{i[u]=r(u)}),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})=>{if(n[e]===t||e==="account"&&t===!1&&n.navigation===!0)return;const i=Date.now();if(!t&&U.handlerCalled[e]&&i-U.handlerCalled[e]<500)return;U.handlerCalled[e]=i;let u=[{type:`menus.${e}`,value:t}];t===!0&&Object.keys(n).forEach(d=>{d===e||n[d]===!1||u.push({type:`menus.${d}`,value:!1})}),r(u)},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=Mn(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?U.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:i})=>{if(!t.current||!t.current.children)return;const u=n?"desktop":"default";if(r[e][u]){r[e][u].focus();return}let d,a;switch(e){case"navigation":if(n){const l=U.findFirstChild(t.current.children,"attributes.aria-controls","navigation");d=U.findFirstChild(l.children,"href")}else d=U.findFirstChild(t.current.children,"href");d||(d=t.current);break;case"account":if(a=U.findFirstChild(t.current.children,"className","account"),!a||!a.children)return;d=U.findFirstChild(a.children,"href");break;default:return}d&&(i([{type:`focusElements.${e}.${u}`,value:d}]),d.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(U.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(U.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(U.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{U.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},Je={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"navigation",explore:{order:["events","courses","q-and-a","articles"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},"q-and-a":{href:"/questions-answers/",className:"icon q-and-a"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup/?ref=header-banner",props:{variant:"primary"}}}},gt=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:i=()=>{},doTrack:u=null})=>{const d=M.useIntl(),a=Mn(Je,e);if(!a||a.onlyShow&&(a.onlyShow==="logged-in"&&!t||a.onlyShow==="logged-out"&&t))return null;const l="doTrack"in a,o=u===null?l?a.doTrack:!0:u,m=e.includes("buttons.");let c=`header_${e.replaceAll(".","_")}`;a.hasVariantText&&(c+=`_logged${t?"In":"Out"}`);let h=!1;if(a.href){let y=a.gtmType||`${e}-click`;if(y.includes(".")){const x=y.split("."),C=x[x.length-2];y=`${C==="topics"?`${C}-`:""}${x[x.length-1]}`}h={href:a.href,role:"menuitem"},o&&(h={...h,className:"gtm-trackable","data-gtm-event-type":y,"data-gtm-event-context":"HeaderButtons"}),m&&(h={...h,variant:"secondary",size:{mobile:"small",881:"large"},...a.props||{}})}const p=a.order&&a.order[0]&&a[a.order[0]],g=p&&a[a.order[0]].order,v=h&&window.location.pathname===a.href;let k={},S={};if(p){const y=a.menuId||e,x={onClick:C=>U.events.onClick(C,{id:y,callback:i,isOpen:r[y]}),onFocus:()=>U.events.onFocus({id:y}),onBlur:()=>U.events.onBlur({id:y,callback:i}),onMouseLeave:()=>U.events.onBlur({id:y,callback:i}),onMouseEnter:()=>U.events.onMouseEnter({id:y,callback:i})};n&&(g&&(k={...x,onKeyPress:C=>{C.key==="Enter"&&U.events.onClick(C,{id:y,callback:i,isOpen:r[y]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":r[y],"aria-controls":y}),S={hidden:y in r?!r[y]:!0}),g||(S={...S,...x})}return s.jsxs("li",{className:$({[a.className]:a.className,"has-submenu":p,parent:g,active:v}),role:"none",...k,children:[h?_.createElement(m?H:"a",h,d.formatMessage({id:c})):d.formatMessage({id:c}),a.order&&s.jsx("ul",{...S,children:a.order.map(y=>{if(!a[y])return null;const x={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:i,doTrack:l?o:null};return a[y].order?s.jsxs("li",{className:$({[a[y].className]:a[y].className}),children:[d.formatMessage({id:`${c}_${y}`}),s.jsx("ul",{children:a[y].order.map(C=>s.jsx(gt,{id:`${e}.${y}.${C}`,...x},C))})]},y):s.jsx(gt,{id:`${e}.${y}`,...x},y)})})]},e)};const Wr={height:67,height_desktop:83},en=({showNavigation:e=!0})=>{const t=M.useIntl(),n=_.useContext(ke),r=Xe(!0,!0),i=n&&typeof n.id=="string",u=_.useMemo(()=>U.getIsDesktopVersion(i,r),[i,r]),[d,a]=_.useReducer(qs,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:l,menus:o,focusElements:m}=d;Pn({scrollPosition:Wr[`height${u.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{!u&&o.navigation||U.shouldChangeHeaderIsVisible(!0,o,a)},scrollDown:()=>{!u&&o.navigation||U.shouldChangeHeaderIsVisible(!1,o,a)}}});const c=(p,g)=>{U.handleMenus({id:p,value:g,menus:o,dispatch:a})},h=_.useRef(null);return De(()=>{o.navigation&&U.autoFocus({menu:"navigation",navigationRef:h,isDesktopVersion:u.navigation,focusElements:m,dispatch:a})},[o.navigation]),De(()=>{o.account&&U.autoFocus({menu:"account",navigationRef:h,isDesktopVersion:u.navigation,focusElements:m,dispatch:a})},[o.account]),n&&n.isLoading?null:s.jsxs(s.Fragment,{children:[s.jsxs("nav",{id:"header",className:$({"logged-in":i,"logged-out":!i,visible:l}),children:[s.jsx(ue,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),s.jsx(qt,{}),e&&s.jsxs(s.Fragment,{children:[!u.navigation&&s.jsx("button",{className:"menu-button gtm-trackable",onClick:p=>{p.preventDefault(),p.stopPropagation(),c("navigation",!o.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":o.navigation,"aria-controls":"navigation",children:s.jsx(ue,{children:t.formatMessage({id:`header_menu_${o.navigation?"hide":"show"}`})})}),s.jsx("ul",{ref:h,id:"navigation",hidden:u.navigation||o.account?!1:!o.navigation,role:"menu","data-showing":!u.navigation&&o.account?"account":"default",children:Je.order.map(p=>s.jsx(gt,{id:p,isLoggedIn:i,isDesktopVersion:u.navigation,menus:{navigation:o.navigation,account:o.account},callback:c},p))}),!u.search&&s.jsx("button",{className:"search toggle-search-button",onClick:p=>{p.preventDefault(),p.stopPropagation(),c("search",!o.search)},"aria-haspopup":"true","aria-expanded":o.search,"aria-controls":"search-form",children:s.jsx(ue,{children:t.formatMessage({id:`header_search_${o.search?"hide":"show"}`})})}),s.jsx(os,{id:"global-search",handleToggle:{searchIsOpen:o.search,isDesktopVersion:u.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),i?s.jsxs("button",{className:"account-button",onClick:p=>U.events.onClick(p,{id:"account",callback:c,isOpen:o.account}),onMouseEnter:()=>U.events.onMouseEnter({id:"account",callback:c}),onMouseLeave:()=>U.events.onBlur({id:"account",callback:c}),"aria-haspopup":"true","aria-expanded":o.account,"aria-controls":"navigation",children:[s.jsx(ue,{children:t.formatMessage({id:`header_account_${o.account?"hide":"show"}`})}),s.jsx(Be,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):s.jsx("ul",{className:"sign-in-buttons",children:Je.buttons.order.map(p=>s.jsx(gt,{id:`buttons.${p}`},p))})]})]}),s.jsx("hr",{id:"content-of-page"}),s.jsx("div",{className:$("overlay",{open:o.navigation||o.account||!u.search&&o.search})})]})};const tn=({element:e="section",children:t,className:n,...r})=>_.createElement(e,{className:$("modal",n),children:typeof t=="string"?s.jsx("p",{children:t}):t,...r});const nn=({id:e="content-overlay",isOpen:t=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:i=()=>{},onClose:u=()=>{}}={},forceShow:{error:d=!1}={},title:a,children:l,buttons:o,className:m="",gtmContext:c="Modal"})=>{const h=M.useIntl(),[p,g]=_.useState(t),v=S=>{g(S),S?(i(),document.body.classList.add("has-overlay")):(u(),document.body.classList.remove("has-overlay"))};_.useEffect(()=>{v(t)},[t]);const k=r?{"--max-width":`${r/16}rem`}:{};return s.jsx("div",{className:$("overlay",{open:p}),children:s.jsx(tn,{id:e,className:$("overlay-modal",m,{"has-max-width":r}),hidden:!p,style:k,children:t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"top",children:[a&&s.jsx("h2",{className:"modal-title",children:a}),s.jsx(H,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>v(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":c,screenreaderText:h.formatMessage({id:"overlay_close"})})]}),n&&s.jsx(Pe,{}),l,o&&s.jsxs("div",{className:"bottom",children:[s.jsx(Pe,{}),s.jsx(Ze,{buttons:o})]}),d&&s.jsx(ht,{className:"error",children:d})]})})})},cs=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const zr=({className:e,showModal:t=!0,title:n,formTitle:r="Know someone who might like to join this workshop?",formLabel:i="Invite your colleagues by typing or pasting their emails below.",ctaMessage:u="Send",showIcon:d,onClose:a,reportError:l=()=>{},sendInvites:o})=>s.jsx(nn,{title:n,isOpen:t,showDivider:!1,showIcon:d,functions:{onClose:a},className:$("invite-modal",e,{success:!!n}),children:s.jsx(is,{title:r,label:i,ctaMessage:u,onClose:a,sendInvites:o,reportError:l})});const Vr=()=>{const e=M.useIntl();return s.jsxs(s.Fragment,{children:[s.jsx(en,{}),s.jsx("div",{id:"content",children:s.jsx(Ke,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),s.jsx(Kt,{})]})},ls=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:i={},styling:u={},className:d="",locale:a="en"})=>{const{navigation:l=!0,footer:o=!0}=i,{background:m="default",variant:c="default",circle:h="default"}=u,p=Nn();_.useEffect(()=>{window.scrollTo(0,0)},[p]);const g=ft(e,{locale:a}),v=ft(t,{locale:a}),k=ft(n,{locale:a}),S={};return m!=="default"&&(S[m]=!0),c!=="default"&&(S[c]=!0),h!=="default"&&(S[h]=!0),s.jsx(Rs.ErrorBoundary,{onError:r,fallback:s.jsx(Vr,{}),children:s.jsx(_.Suspense,{fallback:null,children:s.jsxs("div",{id:"wrapper",className:$(d,S,{"has-footer":o}),children:[s.jsx(en,{showNavigation:l}),s.jsxs("section",{id:"content-wrapper",children:[v&&s.jsx("div",{className:"additional-content prepended",children:v}),_.createElement(m==="bold"?tn:"div",{id:"content",children:g})]}),k&&s.jsx("div",{className:"additional-content appended",children:k}),o&&s.jsx(Kt,{}),s.jsx(ns,{})]})})})},yn={default:"tags_",headerTopics:"header_topics_topics_"},Ft={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"},Yr={getTagDetails:e=>{if(e.includes("topic_")){if(e=Ft.topic[e.replace("topic_","")],e){const t=Je.topics.topics[e].href;return t?{id:e,href:t,text:`${yn.headerTopics}${e}`}:null}return null}return Ft[e]?(e=Ft[e],{id:e,text:`${yn.default}${e}`}):null}};const Gr=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:i="",gtmType:u="tag-click",gtmContext:d="tags"})=>{const a=M.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(o=>{if(!o)return;const m=Yr.getTagDetails(o);m&&l.push(m)}),l.length<1?null:s.jsx("ul",{className:$("tags text-small",t,i,{"one-line":n}),children:l.map(o=>{const m=a.formatMessage({id:o.text});return s.jsx("li",{children:o.href&&r?s.jsx("a",{href:o.href,className:"gtm-trackable","data-gtm-event-type":u,"data-gtm-event-context":d,children:m}):m},o.id)})})};const Jr=({members:{total:e,data:t=[]},pagination:n,gtmContext:r="member",gtmType:i="member-click",className:u=""})=>{const d=M.useIntl();return t.length===0?null:(e||(e=t.length),s.jsxs("div",{className:$("members-list",u),children:[s.jsxs("h1",{children:[d.formatMessage({id:"membersList"}),s.jsx("span",{className:"count",children:e})]}),s.jsx("ul",{children:t.map((a,l)=>s.jsxs("li",{children:[s.jsx(vt,{member:a,gtmContext:r,gtmType:i}),a.isAdmin&&s.jsx(Ge,{children:d.formatMessage({id:"membersList_admin"})})]},l))}),n&&s.jsx(qn,{hasNextPage:!0,loadNextPage:()=>{},icon:{icon:"arrow-down",position:"right"},gtmContext:r})]}))};let ut=null;const xe="discussion_form_",sn=({content:e={type:"response",slugs:{}},userHasPermissions:t=!0,meta:n={isLoading:!1,isInWrapper:!1,isEditing:!1,showTitle:!1},inputRef:r,maxLength:i=5e4,minRows:u=4,forceShow:d={cancel:!1,error:!1},functions:a={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},props:{create:{projectNames:["questions-answers"]}}},gtmContext:l="DiscussionForm"})=>{var Q,A;const o=M.useIntl(),m=_.useContext(ke),[c,h]=_.useState(n.isEditing&&n.isEditing.text||""),[p,g]=_.useState(d.error||!1),[v,k]=_.useState(!1),S=_.useRef(null);if(r||(r=S),n.isLoading)return s.jsx(we,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const y=b=>{const Y=b.target.value;h(Y);let j;!m||!m.id?j=ye(o.formatMessage,`${xe}error_loggedOut`,e.type,"action"):t?Y.length>=i&&(j=`${xe}error_tooLong`):j=ye(o.formatMessage,`${xe}error_noPermission`,e.type,"action"),j?g(j):p&&g(!1)};let x=`${e.type}-form`;if(e.type==="response"||e.type==="reply"){const b=e.type==="response"?((Q=e.slugs)==null?void 0:Q.question)||"":((A=e.slugs)==null?void 0:A.answer)||"";b&&(x=`${x}-${b.slice(-15)}`)}const C=async b=>{var j;if(b.preventDefault(),b.stopPropagation(),!m||!m.id||!t||R)return;ut&&clearTimeout(ut),k("submitting");const Y=window.location.pathname;try{let w;switch(e.type){case"post":w=await a.create({content:c});break;case"question":w=await a.create({title:c,authorId:m&&m.id,...(j=a.props)==null?void 0:j.create});break;case"response":w=await a.create({question:e.slugs.question},{body:c,authorId:m&&m.id,contentPath:Y});break;case"reply":w=await a.create({question:e.slugs.question,answer:e.slugs.answer},{body:c,authorId:m&&m.id,contentPath:Y});break;default:break}await Ks(1e3),a.callback&&await a.callback(w),ut=setTimeout(()=>{h(""),k("submitted"),D()},500)}catch(w){const V=w;let X=`${xe}error`;V.message.includes("entry already exists")&&(X=ye(o.formatMessage,`${xe}error_alreadyExists`,e.type,"action")),V.message.includes("429")?X=ye(o.formatMessage,`${xe}error_tooMany`,e.type,"action"):V.message.includes("400")&&(X=`${xe}error`),g(X),D()}},D=()=>{ut=setTimeout(()=>{g(!1),k(!1)},5e3)},R=!c||!Zs(c),G=v==="submitting",L=[];return(n.isEditing&&!G||d.cancel)&&L.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:a.handleCancel,className:"gtm-trackable","data-gtm-event-context":l,"data-gtm-event-type":`cancel-${e.type}-click`,disabled:!d.cancel&&(!m||!m.id||!c),children:o.formatMessage({id:`${xe}cancel`})}),L.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:b=>{if(n.isEditing){k("submitting"),a.handleSaveEdit&&a.handleSaveEdit(S.current&&"value"in S.current?S.current.value:"");return}C(b)},className:"gtm-trackable","data-gtm-event-context":l,"data-gtm-event-type":`${n.isEditing?"save":"submit"}-${e.type}-click`,"data-testid":"save-button",disabled:!m||!m.id||!t||R||G||n.isEditing&&c===n.isEditing.text,children:o.formatMessage({id:`${xe}${G?n.isEditing?"saving":"posting":n.isEditing?"save":"post"}`})}),s.jsxs("form",{id:x,className:$("discussion-card discussion-form",{"no-styling":n.isInWrapper&&n.isEditing}),"data-testid":`discussion-${e.type}-form`,children:[(n==null?void 0:n.showTitle)&&!n.isEditing&&["question"].includes(e.type)&&s.jsx("h2",{children:ye(o.formatMessage,`${xe}title`,e.type,"action")}),s.jsx(vt,{member:m||"community",gtmContext:l,gtmType:"profile-click"}),s.jsx(ue,{element:"label",showOnFocus:!1,htmlFor:`${x}-input`,children:ye(o.formatMessage,`${xe}label`,e.type,"action")}),s.jsx(As,{ref:r,id:`${x}-input`,name:e.type,placeholder:ye(o.formatMessage,`${xe}placeholder`,e.type,"action"),onChange:y,value:c,maxLength:i,"aria-invalid":!!p,"aria-errormessage":"error-message",minRows:u,autoFocus:!!n.isEditing}),s.jsx("small",{children:ye(o.formatMessage,`${xe}explainer`,e.type,"action",{a:b=>s.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":l,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:b})})}),s.jsx(Ze,{buttons:L}),v==="submitted"&&s.jsx(ht,{className:"success","data-testid":"success",children:ye(o.formatMessage,`${xe}success`,e.type,"action")}),p&&s.jsx(ht,{id:"error-message",className:"error","data-testid":"error",children:d.error?d.error:typeof p=="string"?p.includes(" ")?p:o.formatMessage({id:p},{action:o.formatMessage({id:`discussion_action_${e.type}`}),maxLength:i}):p})]})},wt=({contentType:e,createPost:t,membershipRequiredToPost:{isMember:n,required:r,join:i,leave:u,notMemberStateText:d}})=>r&&!n?s.jsx(Ke,{text:d,button:{breakpoints:{mobile:!0,901:!1},component:s.jsx(Zt,{isShort:!0,functions:{join:i,leave:u}})}}):s.jsx(sn,{content:{type:e,slugs:{}},functions:{create:t}}),Xr={showThread:!1,showForm:!1},et=_.createContext(Xr),us=({children:e})=>{const[t,n]=_.useState({showThread:!1,showForm:!1});return s.jsx(et.Provider,{value:{...t,updateConversation:n},children:e})},Zr=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),qr=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);let Ve=!1;const It=()=>{Ve!==!1&&(clearTimeout(Ve),Ve=!1)},Lt=5,ds=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:i=!1,content:u={type:"reply",slugs:{}},canLike:d=!0,functions:{createLike:a=()=>{},deleteLike:l=()=>{}}={}})=>{const o=M.useIntl();_.useEffect(()=>{p(i)},[i]);const[m,c]=_.useState(t),[h,p]=_.useState(i),[g,v]=_.useState(!1),[k,S]=_.useState(!1),y=_.useMemo(()=>qr(n,Lt),[n]),x=D=>{if(D.preventDefault(),D.stopPropagation(),S(!1),Ve)return It(),!1;if(It(),g||!d)return!1;Ve=setTimeout(C,350)},C=async()=>{if(It(),g||!d)return!1;let D=h?m-1:m+1;D<0&&(D=0),v(!0),c(D),p(!h);try{if(u&&u.slugs){const R=Zr(u.slugs);h?await l(R):await a(R,{contentPath:window.location.pathname})}}catch{c(t),p(i)}finally{v(!1)}};return _.createElement(e,{className:$("likes-wrapper text-medium action-button",{"show-spinner":g,"is-liked":h,disabled:!d}),onClick:x,onMouseEnter:()=>{S(!0)},onMouseLeave:()=>{S(!1)},onFocus:()=>{S(!0)},onBlur:()=>{S(!1)},children:s.jsxs(s.Fragment,{children:[s.jsx(H,{variant:"tertiary",size:"medium",icon:{icon:h?"heart":"heart_empty",animate:"bounce"},className:$({"do-animation":h&&!i}),screenreaderText:d?o.formatMessage({id:`discussion_likes_${h?"unlike":"like"}`},{action:o.formatMessage({id:`discussion_action_${u.type}`})}):!1,onClick:x,disabled:!d,"aria-hidden":!d,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${u.type}-click`}),s.jsx("span",{className:$("number-of-likes",{"no-likes":m===0}),"data-testid":"number-of-likes",children:o.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:m})}),n&&s.jsx(On,{isOpen:k,isLoading:n.length===0,children:n.length&&s.jsxs("ul",{children:[y.map(D=>typeof D=="string"||!D.name?null:s.jsx("li",{children:s.jsx(qe,{href:D.id?`/profiles/${D.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onClick:R=>R==null?void 0:R.stopPropagation(),children:D.name})},D.id||window.btoa(D.name))),n.length>Lt&&s.jsx("li",{children:o.formatMessage({id:"discussion_likes_more"},{number:n.length-Lt})})]})})]})})},En=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},rn=(e,t)=>e&&!t;const Se="discussion_",Kr=280,tt=({element:e="div",content:t,userHasPermissions:n=!0,isLoading:r=!1,originalAuthorId:i,functions:{content:{createContent:u,deleteContent:d,updateContent:a}={createContent:()=>{},deleteContent:()=>{},updateContent:()=>{}},likes:{createLike:l,deleteLike:o}={createLike:()=>{},deleteLike:()=>{}},comments:{openComments:m}={openComments:()=>{}}},links:c={},className:h,gtmContext:p="DiscussionAnswer",children:g,isTruncated:v=!1})=>{const k=M.useIntl(),S=_.useContext(ke),y=_.useContext(et),[x,C]=_.useState({body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1}),[D,R]=_.useState(!1),[G,L]=_.useState("");if(_.useEffect(()=>{C({...x,body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),r||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question))return s.jsx(we,{className:"discussion-card discussion-post"});const{author:Q,canLike:A,createdAt:b,id:Y,likes:j=0,userLiked:w,comments:V=0}=t,X=v?Le(x.body,Kr):x.body,ne=S&&S.id&&typeof Q!="string"&&Q.id&&Q.id===S.id||!1,se=typeof A=="boolean"?A:n?!ne:!1,re=async F=>{F||(F=""),L("");try{if(!Fs(F,x.body)){const ae=t.type==="question"?{title:F}:{body:F};await a(En(t.slugs),ae)}C({body:F,isEditing:!1,didEdit:!0})}catch{L(`${Se}form_error`)}},q=()=>{y&&y.updateConversation&&y.updateConversation({showThread:!0,showForm:!0}),setTimeout(()=>{const ae=`reply-form-${(t.type==="answer"?t.slug:t.slugs.answer||"").toLowerCase().slice(-15)}`,me=document.getElementById(ae),oe=document.getElementById(`${ae}-input`);oe&&oe.focus(),me&&me.scrollIntoView({behavior:"smooth"})},0)},de=()=>{R(!1);try{d(En(t.slugs))}catch{L("delete-error")}},ce=[{text:k.formatMessage({id:`${Se}moreMenu_report`}),href:`mailto:community@apolitical.co?subject=${encodeURI(k.formatMessage({id:`${Se}report_subject`}))}&body=${encodeURI(k.formatMessage({id:`${Se}report_body`},{contentType:t.type||"",contentSlug:t.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}))}`,icon:"flag"}];return n&&ne&&ce.push({text:k.formatMessage({id:`${Se}moreMenu_edit`}),onClick:()=>C({...x,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`edit-${t.type}-click`},{text:k.formatMessage({id:`${Se}moreMenu_delete`}),onClick:F=>{F.preventDefault(),F.stopPropagation(),R(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`delete-${t.type}-click`,...cs(`delete-${t.slug}-modal`,D)}),_.createElement(e,{className:$("discussion-post",h),"data-testid":`discussion-${t.type}-thread`,children:s.jsxs(s.Fragment,{children:[s.jsxs("div",{id:Y||t.slug,className:$("discussion-card",t.type,{editing:x.isEditing,"has-link":c.post&&!x.isEditing}),onClick:F=>{!c.post||x.isEditing||(F.preventDefault(),F.stopPropagation(),window.location.href=c.post)},children:[!x.isEditing&&s.jsx(vt,{member:Q,additionalContent:{createdAt:b,didEdit:x.didEdit},className:typeof Q!="string"&&Q.id===i?"highlighted":"",gtmContext:p,gtmType:"profile-click"}),x.isEditing?s.jsx(sn,{content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:r,isInWrapper:!0,isEditing:{text:x.body}},maxLength:t.type==="question"?250:5e4,forceShow:{error:G!==""&&G!=="delete-error"?k.formatMessage({id:G},{action:k.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:u,handleSaveEdit:re,handleCancel:()=>{L(""),C({...x,isEditing:!1})}},gtmContext:`${p}Form`}):c.post?s.jsx("a",{href:c.post,className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":"title-click",children:s.jsx(Ut,{options:{overrides:{a:Un}},children:X})}):s.jsx(Ut,{options:{wrapper:t.type==="question"?"h1":_.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question"},children:X}),!x.isEditing&&s.jsxs("ul",{className:$("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[s.jsx(ds,{element:"li",likes:j,isShort:!1,userLiked:w,content:{type:t.type,slugs:t.slugs},canLike:se,peopleWhoLiked:t.peopleWhoLiked,functions:{createLike:l,deleteLike:o}}),(["question","post"].includes(t.type)||c.comments||typeof m=="function")&&s.jsxs("li",{className:"action-button",onClick:F=>{F.preventDefault(),F.stopPropagation(),c.comments&&(window.location.href=c.comments),typeof m=="function"&&m()},children:[s.jsx(H,{variant:"tertiary",size:"medium",styling:{muted:!0},icon:{icon:"speech-bubble_square_thick"},href:c.comments?c.comments:!1,onClick:c.comments||typeof m!="function"?!1:m,className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:k.formatMessage({id:`${Se}comments_screenReader`},{count:V})}),s.jsx("span",{children:k.formatMessage({id:`${Se}comments`},{count:V})})]}),(t.type==="answer"||t.type==="reply")&&s.jsx("li",{children:s.jsx(H,{variant:"tertiary",size:"medium",styling:{muted:!0},onClick:q,children:k.formatMessage({id:`${Se}reply`})})}),s.jsx(Kn,{element:"li",id:`more-${t.slug}`,options:ce})]})]}),g,s.jsx(nn,{id:`delete-${t.slug}-modal`,isOpen:D,functions:{onOpen:()=>{},onClose:()=>R(!1)},forceShow:{error:G==="delete-error"?k.formatMessage({id:"discussion_delete_error"},{action:k.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:k.formatMessage({id:"discussion_delete_title"},{action:k.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>R(!1),children:k.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:de,children:k.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:s.jsx(M.FormattedMessage,{id:"discussion_delete_text",values:{p:F=>s.jsx("p",{children:F}),action:k.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const Bt="discussion_responses_",ea=({type:e="answer",responses:t=0})=>{const n=M.useIntl();return s.jsxs("div",{className:"responses-heading",children:[s.jsx("h3",{children:n.formatMessage({id:`${Bt}title`},{action:n.formatMessage({id:`${Bt}${e}`}),count:t})}),t===0&&s.jsx("p",{children:ye(n.formatMessage,`${Bt}empty`,e,e)})]})};const ms=({count:e=0,showRepliesButton:t=!0,children:n})=>{const r=M.useIntl(),i=_.useRef(null),u=_.useContext(et),[d,a]=_.useState("closed");_.useEffect(()=>{const c=i.current;if(c)return c.addEventListener("transitionend",l),()=>{c.removeEventListener("transitionend",l)}},[]),De(()=>{d==="closed"&&!u.showThread||a(["opening","open"].includes(d)?"ready-to-close":"opening")},[u.showThread]),_.useEffect(()=>{d==="ready-to-close"&&a("closing")},[d]);const l=({propertyName:c})=>{c==="max-height"&&a(h=>h==="opening"?"open":h==="closing"?"closed":h)},o=["opening","open"].includes(d),m=ft(n,{element:"li"});return s.jsxs("div",{className:"thread-wrapper",children:[t&&s.jsx(H,{variant:"secondary",size:"small",styling:{muted:!0},icon:{icon:`arrow_corner-down_${o?"left":"right"}`},onClick:()=>{var c;(c=u.updateConversation)==null||c.call(u,h=>({showThread:!h.showThread,showForm:!1}))},children:r.formatMessage({id:`discussion_thread_${o?"hide":"show"}`},{count:e})}),s.jsx("ul",{ref:i,className:$("thread",d),hidden:!u.showThread,children:m})]})},ta=({user:e,content:t,verb:n="post"})=>({actor:{id:e.id,data:{name:e.name,organization:e==null?void 0:e.organization,jobTitle:e==null?void 0:e.jobTitle}},content:t,latest_reactions:{like:[]},reaction_counts:{like:0},verb:n}),na=({queryClient:e,queryKey:t,user:n,mutationFn:r})=>({mutationFn:r,onMutate:async({content:a})=>{if(!n)return;const l=ta({user:n,content:a,verb:"post"});await e.cancelQueries({queryKey:t});const o=e.getQueryData(t);return e.setQueryData(t,m=>[...m,l]),{previousActivities:o}},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivities)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),sa=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityInfo:d,content:{body:a}})=>{if(a.length===0)return;await e.cancelQueries({queryKey:t});const l=e.getQueryData(t),o=l==null?void 0:l.map(m=>((m==null?void 0:m.id)===(d==null?void 0:d.activityId)&&(m.content=a),m));return e.setQueryData(t,()=>o&&[...o]),{previousActivities:o}},onError:(d,a,l)=>{e.setQueryData(t,l.previousActivities)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),ra=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityId:d})=>{await e.cancelQueries({queryKey:t});const a=e.getQueryData(t),l=a==null?void 0:a.filter(o=>(o==null?void 0:o.id)!==d);return e.setQueryData(t,()=>l&&[...l]),{previousActivities:l}},onError:(d,a,l)=>{e.setQueryData(t,l.previousActivities)},onSettled:(d,a,l)=>{e.invalidateQueries({queryKey:[...t,l.activityId]})}}),aa=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityId:a})=>{await e.cancelQueries({queryKey:t});const l=e.getQueryData(t),o=l==null?void 0:l.map(m=>{var c;return(m==null?void 0:m.id)===a&&((c=m.reaction_counts)!=null&&c.like?m.reaction_counts.like+=1:m.reaction_counts.like=1),m});return e.setQueryData(t,()=>o&&[...o]),{previousActivities:o}},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivities)},onSuccess:a=>{const l=e.getQueryData(t),o=l==null?void 0:l.map(m=>{var c,h;return(m==null?void 0:m.id)===(a==null?void 0:a.activity_id)&&((c=m.own_reactions)!=null&&c.like?m.own_reactions.like.push(a):m.own_reactions.like=[a],(h=m.latest_reactions)!=null&&h.like?m.latest_reactions.like.push(a):m.own_reactions.like=[a]),m});return e.setQueryData(t,()=>o&&[...o]),{previousActivities:l}},onSettled:(a,l,o)=>{e.invalidateQueries({queryKey:[...t,o.activityId]})}}),oa=({queryClient:e,queryKey:t,user:n,mutationFn:r})=>({mutationFn:r,onMutate:async({activityId:l})=>{await e.cancelQueries({queryKey:t});const o=e.getQueryData(t),m=o==null?void 0:o.map(c=>{var h;return(c==null?void 0:c.id)===l&&(h=c.reaction_counts)!=null&&h.like&&(c.reaction_counts.like-=1),c});return e.setQueryData(t,()=>m&&[...m]),{previousActivities:m}},onError:(l,o,m)=>{e.setQueryData(t,m.previousActivities)},onSuccess:(l,{activityId:o})=>{const m=e.getQueryData(t),c=m==null?void 0:m.map(h=>{var p,g,v,k,S;if(h.id===o){const y=(v=(g=(p=h.own_reactions)==null?void 0:p.like)==null?void 0:g.find(x=>x.user_id===(n==null?void 0:n.id)))==null?void 0:v.id;return h.own_reactions.like=(k=h.own_reactions.like)==null?void 0:k.filter(x=>x.id!==y),h.latest_reactions.like=(S=h.latest_reactions.like)==null?void 0:S.filter(x=>x.id!==y),h}else return h});return e.setQueryData(t,()=>c&&[...c]),{previousActivities:m}},onSettled:(l,o,m)=>{e.invalidateQueries({queryKey:[...t,m.activityId]})}}),ia=({basePath:e,parentId:t,isMember:n,functions:{list:r,create:i,edit:u,remove:d,like:a,unlike:l,join:o,leave:m}})=>{const c=M.useIntl(),h=z.useQueryClient(),p=_.useContext(ke),{data:g,error:v,isLoading:k,isFetching:S}=z.useQuery({queryKey:[e,t],queryFn:r}),y=na({queryClient:h,queryKey:[e,t],user:p,mutationFn:i}),{mutate:x}=z.useMutation(y),C=sa({queryClient:h,queryKey:[e,t],mutationFn:async w=>await u(w)}),{mutate:D}=z.useMutation(C),R=ra({queryClient:h,queryKey:[e,t],mutationFn:async({activityId:w})=>await d({activityId:w})}),{mutate:G}=z.useMutation(R),L=aa({queryClient:h,queryKey:[e,t],mutationFn:a}),{mutate:Q}=z.useMutation(L),A=oa({queryClient:h,queryKey:[e,t],user:p,mutationFn:async({activityId:w})=>{var ne,se,re;const V=g&&(g==null?void 0:g.find(q=>q.id===w)),X=(re=(se=(ne=V==null?void 0:V.own_reactions)==null?void 0:ne.like)==null?void 0:se.find(q=>q.user_id===(p==null?void 0:p.id)))==null?void 0:re.id;await l({reactionId:X||"",activityId:w})}}),{mutate:b}=z.useMutation(A),Y=_.useCallback(({activityId:w})=>Q({activityId:w}),[Q]),j=_.useCallback(({activityId:w})=>b({activityId:w}),[b]);return v?s.jsx(Ke,{variant:"error",text:v.message}):k?s.jsx(we,{style:{height:"400px"}}):s.jsxs("section",{children:[s.jsx(wt,{contentType:"post",createPost:x,membershipRequiredToPost:{isMember:n,required:!0,join:o,leave:m,notMemberStateText:c.formatMessage({id:"community_joinToPost"})}}),!S&&Array.isArray(g)&&(g==null?void 0:g.map(w=>{var ne,se,re,q,de,ce,F,ae,me,oe,pe,fe,ge,he;const V=((ne=w==null?void 0:w.actor)==null?void 0:ne.id)===(p==null?void 0:p.id),X=rn(n,V);return s.jsxs(_.Fragment,{children:[s.jsx(tt,{content:{type:"post",body:w==null?void 0:w.content,canLike:X,createdAt:(w==null?void 0:w.time)||"",slugs:{parentId:t,activityId:w==null?void 0:w.id},slug:w==null?void 0:w.id,author:{id:(se=w==null?void 0:w.actor)==null?void 0:se.id,name:`${(q=(re=w==null?void 0:w.actor)==null?void 0:re.data)==null?void 0:q.name}`,organization:(ce=(de=w==null?void 0:w.actor)==null?void 0:de.data)==null?void 0:ce.organization,jobTitle:(ae=(F=w==null?void 0:w.actor)==null?void 0:F.data)==null?void 0:ae.jobTitle,image:{thumbnail:((oe=(me=w==null?void 0:w.actor)==null?void 0:me.data)==null?void 0:oe.thumbnail)||void 0}},userLiked:((pe=w==null?void 0:w.own_reactions)==null?void 0:pe.like)&&((fe=w==null?void 0:w.own_reactions)==null?void 0:fe.like.length)>0,likes:(w==null?void 0:w.reaction_counts.like)||0,comments:(w==null?void 0:w.reaction_counts.reply)||0,peopleWhoLiked:((ge=w==null?void 0:w.latest_reactions)==null?void 0:ge.like)&&((he=w==null?void 0:w.latest_reactions)==null?void 0:he.like.map(B=>{var J,ie;return{id:B==null?void 0:B.user_id,name:(ie=(J=B==null?void 0:B.user)==null?void 0:J.data)==null?void 0:ie.name}}))},links:{post:`${e}/${t}/${w==null?void 0:w.id}`,comments:`${e}/${t}/${w==null?void 0:w.id}`},functions:{content:{createContent:()=>null,deleteContent:B=>G(B),updateContent:(B,J)=>D({activityInfo:B,content:J})},likes:{createLike:()=>{Y({activityId:w==null?void 0:w.id})},deleteLike:()=>{j({activityId:w==null?void 0:w.id})}},comments:{openComments:()=>null}},isTruncated:!0}),s.jsx(Pe,{})]},w==null?void 0:w.id)}))]})},ca=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async()=>{await e.cancelQueries({queryKey:t})},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivity)},onSuccess:a=>{var o;const l=e.getQueryData(t);if(l)return(o=l==null?void 0:l.latest_reactions)!=null&&o.reply?(l.latest_reactions.reply.unshift(a),l&&(l.reaction_counts={reply:l.latest_reactions.reply.length})):(l.latest_reactions={reply:[a]},l.reaction_counts={reply:1}),e.setQueryData(t,()=>({...l})),{previousActivity:l}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),la=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({replyInfo:u,content:{body:d}})=>{var o,m,c;if(d.length===0)return;await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);if(!a||!((o=a==null?void 0:a.latest_reactions)!=null&&o.reply))return;const l=(c=(m=a==null?void 0:a.latest_reactions)==null?void 0:m.reply)==null?void 0:c.map(h=>(h.id===u.replySlug&&(h.data.content=d),h));return e.setQueryData(t,()=>({...a,latest_reactions:{reply:l}})),{previousActivity:a}},onError:(u,d,a)=>{e.setQueryData(t,a.previousActivity)}}),ua=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({replyId:u})=>{var l,o,m;await e.cancelQueries({queryKey:t});const d=e.getQueryData(t);if(!d||!((l=d==null?void 0:d.latest_reactions)!=null&&l.reply))return;const a=(m=(o=d==null?void 0:d.latest_reactions)==null?void 0:o.reply)==null?void 0:m.filter(c=>c.id!==u);return e.setQueryData(t,()=>({...d,latest_reactions:{reply:a}})),{previousActivity:d}},onError:(u,d,a)=>{e.setQueryData(t,a.previousActivity)}}),da=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({replyId:d})=>{var o,m;await e.cancelQueries({queryKey:t});const a=e.getQueryData(t),l=(m=(o=a==null?void 0:a.latest_reactions)==null?void 0:o.reply)==null?void 0:m.map(c=>{var h;return c.id===d&&((h=c.children_counts)!=null&&h.like?c.children_counts.like+=1:c.children_counts={like:1}),c});return e.setQueryData(t,()=>({...a,latest_reactions:{reply:l}})),{previousActivity:a}},onError:(d,a,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:d=>{var o;const a=e.getQueryData(t),l=(o=a==null?void 0:a.latest_reactions.reply)==null?void 0:o.map(m=>{var c,h;return m.id===d.id&&((c=m.own_children)!=null&&c.like?m.own_children.like.push(d):m.own_children={like:[d]},(h=m.latest_children)!=null&&h.like?m.latest_children.like.push(d):m.latest_children={like:[d]}),m});return e.setQueryData(t,()=>({...a,latest_reactions:{reply:l}})),{previousActivity:a}}}),ma=({queryClient:e,queryKey:t,user:n,mutationFn:r})=>({mutationFn:r,onMutate:async({replyId:a})=>{var m;await e.cancelQueries({queryKey:t});const l=e.getQueryData(t);if(!l)return;const o=(m=l.latest_reactions.reply)==null?void 0:m.map(c=>(c.id===a&&c.children_counts.like&&(c.children_counts.like-=1),c));return e.setQueryData(t,()=>({...l,latest_reactions:{reply:o}})),{previousActivity:l}},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivity)},onSuccess:(a,{replyId:l})=>{var c;const o=e.getQueryData(t);if(!o)return;const m=(c=o.latest_reactions.reply)==null?void 0:c.map(h=>{var p,g,v;if(h.id===l){let k=(p=h.latest_children.reply)==null?void 0:p.filter(S=>S.user_id!==(n==null?void 0:n.id));return k=(v=(g=h==null?void 0:h.own_children)==null?void 0:g.reply)==null?void 0:v.filter(S=>S.user_id!==(n==null?void 0:n.id)),k}return h});return e.setQueryData(t,()=>({...o,latest_reactions:{reply:m}})),{previousActivity:o}}}),fa=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async()=>{await e.cancelQueries({queryKey:t})},onSuccess:a=>{var m;const l=e.getQueryData(t),o=(m=l==null?void 0:l.latest_reactions.reply)==null?void 0:m.map(c=>(c.id===a.parent&&(c.latest_children.reply&&c.children_counts.reply?(c.latest_children.reply.push(a),c.children_counts.reply+=1):(c.latest_children.reply=[a],c.children_counts.reply=1)),c));return e.setQueryData(t,()=>({...l,latest_reactions:{reply:o}})),{previousActivity:l}},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivity)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),ha=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onError:(u,d,a)=>{e.setQueryData(t,a.previousActivity)},onMutate:async({replyInfo:u,content:{body:d}})=>{var o,m,c;if(d.length===0)return;await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);if(!a||!((o=a==null?void 0:a.latest_reactions)!=null&&o.reply))return;const l=(c=(m=a==null?void 0:a.latest_reactions)==null?void 0:m.reply)==null?void 0:c.map(h=>{var p;return h.id===u.replyParentId&&((p=h.latest_children.reply)==null||p.map(g=>(g.id===u.replySlug&&(g.data.content=d),g))),h});return e.setQueryData(t,()=>({...a,latest_reactions:{reply:l}})),{previousActivity:a}}}),pa=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onError:(u,d,a)=>{e.setQueryData(t,a.previousActivity)},onMutate:async({replyId:u,replyParentId:d})=>{var o,m,c;await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);if(!a||!((o=a==null?void 0:a.latest_reactions)!=null&&o.reply))return;const l=(c=(m=a==null?void 0:a.latest_reactions)==null?void 0:m.reply)==null?void 0:c.map(h=>{var p,g;return h.id===d&&(h.latest_children.reply=(p=h.latest_children.reply)==null?void 0:p.filter(v=>v.id!==u),(g=h.children_counts)!=null&&g.reply&&(h.children_counts.reply-=1)),h});return e.setQueryData(t,()=>({...a,latest_reactions:{reply:l}})),{previousActivity:a}}}),ga=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({replyId:d,replyParentId:a})=>{var m;await e.cancelQueries({queryKey:t});const l=e.getQueryData(t),o=(m=l==null?void 0:l.latest_reactions.reply)==null?void 0:m.map(c=>{var h;return c.id===a&&((h=c.latest_children.reply)==null||h.map(p=>{var g;return p.id===d&&((g=p.children_counts)!=null&&g.like?p.children_counts.like+=1:p.children_counts={like:1}),p})),c});return e.setQueryData(t,()=>({...l,latest_reactions:{reply:o}})),{previousActivity:l}},onError:(d,a,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:(d,a)=>{var m;const l=e.getQueryData(t),o=(m=l==null?void 0:l.latest_reactions.reply)==null?void 0:m.map(c=>{var h;return c.id===a.replyParentId&&((h=c.latest_children.reply)==null||h.map(p=>(p.id===a.replyId&&(p.latest_children=p.latest_children||{},p.own_children=p.own_children||{},p.latest_children.like=p.latest_children.like||[],p.own_children.like=p.own_children.like||[],p.latest_children.like.push(d),p.own_children.like.push(d)),p))),c});return e.setQueryData(t,()=>({...l,latest_reactions:{reply:o}})),{previousActivity:l}}}),_a=({queryClient:e,queryKey:t,mutationFn:n,user:r})=>({mutationFn:n,onMutate:async({replyId:a,replyParentId:l})=>{var c;await e.cancelQueries({queryKey:t});const o=e.getQueryData(t),m=(c=o==null?void 0:o.latest_reactions.reply)==null?void 0:c.map(h=>{var p;return h.id===l&&((p=h.latest_children.reply)==null||p.map(g=>{var v;return g.id===a&&((v=g.children_counts)!=null&&v.like?g.children_counts.like-=1:g.children_counts={like:0}),g})),h});return e.setQueryData(t,()=>({...o,latest_reactions:{reply:m}})),{previousActivity:o}},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivity)},onSuccess:(a,l)=>{var c;const o=e.getQueryData(t),m=(c=o==null?void 0:o.latest_reactions.reply)==null?void 0:c.map(h=>{var p;return h.id===l.replyParentId&&((p=h.latest_children.reply)==null||p.map(g=>{var v,k;return g.id===l.replyId&&((v=g.own_children)!=null&&v.like&&(g.own_children.like=g.own_children.like.filter(S=>S.user_id!==(r==null?void 0:r.id))),(k=g.latest_children)!=null&&k.like&&(g.latest_children.like=g.latest_children.like.filter(S=>S.user_id!==(r==null?void 0:r.id)))),g})),h});return e.setQueryData(t,()=>({...o,latest_reactions:{reply:m}})),{previousActivity:o}}}),xa=({basePath:e,parentId:t,replyParentId:n,activityId:r,replyCount:i,replies:u,functions:{create:d,edit:a,remove:l,join:o,leave:m,like:c,unlike:h}})=>{const p=M.useIntl(),g=z.useQueryClient(),v=_.useContext(ke),k=_.useContext(et),S=fa({queryClient:g,queryKey:[e,t,r],mutationFn:async j=>d({replyId:n,content:j.body})}),{mutate:y}=z.useMutation(S),x=ha({queryClient:g,queryKey:[e,t,r],mutationFn:a}),{mutate:C}=z.useMutation(x),D=pa({queryClient:g,queryKey:[e,t,r],mutationFn:async({replyId:j})=>l({replyId:j})}),{mutate:R}=z.useMutation(D),G=ga({queryClient:g,queryKey:[e,t,r],mutationFn:c}),{mutate:L}=z.useMutation(G),Q=_a({queryClient:g,queryKey:[e,t,r],user:v,mutationFn:h}),{mutate:A}=z.useMutation(Q),b=_.useCallback(({replyId:j,replyParentId:w})=>L({replyId:j,replyParentId:w}),[L]),Y=_.useCallback(({replyId:j,replyParentId:w})=>A({replyId:j,replyParentId:w}),[A]);return s.jsx(ms,{count:i,showRepliesButton:i>0||k.showForm,children:s.jsxs(s.Fragment,{children:[k.showForm&&s.jsx(wt,{contentType:"reply",createPost:(j,w)=>y(w),membershipRequiredToPost:{isMember:!0,required:!0,join:o,leave:m,notMemberStateText:p.formatMessage({id:"community_joinToPost"})}}),(u==null?void 0:u.length)===0||(u==null?void 0:u.map(j=>{var w,V,X,ne,se,re,q,de,ce,F,ae,me,oe,pe,fe,ge,he;return s.jsx(tt,{content:{type:"reply",body:typeof j.data.content=="string"?(w=j==null?void 0:j.data)==null?void 0:w.content:((X=(V=j==null?void 0:j.data)==null?void 0:V.content)==null?void 0:X.text)||"",createdAt:j==null?void 0:j.created_at,slugs:{parentId:t,activityId:r,replyParentId:j==null?void 0:j.parent,reply:j==null?void 0:j.id},slug:"",author:{id:(ne=j==null?void 0:j.user)==null?void 0:ne.id,name:(re=(se=j==null?void 0:j.user)==null?void 0:se.data)==null?void 0:re.name,organization:(de=(q=j==null?void 0:j.user)==null?void 0:q.data)==null?void 0:de.organization,jobTitle:(F=(ce=j==null?void 0:j.user)==null?void 0:ce.data)==null?void 0:F.jobTitle,image:{thumbnail:((me=(ae=j==null?void 0:j.user)==null?void 0:ae.data)==null?void 0:me.thumbnail)||void 0}},userLiked:((oe=j==null?void 0:j.own_children)==null?void 0:oe.like)&&((pe=j==null?void 0:j.own_children)==null?void 0:pe.like.length)>0,likes:((fe=j==null?void 0:j.children_counts)==null?void 0:fe.like)||0,peopleWhoLiked:((ge=j==null?void 0:j.latest_children)==null?void 0:ge.like)&&((he=j==null?void 0:j.latest_children)==null?void 0:he.like.map(B=>{var J,ie;return{id:B==null?void 0:B.user_id,name:(ie=(J=B==null?void 0:B.user)==null?void 0:J.data)==null?void 0:ie.name}}))},functions:{content:{createContent:()=>console.log("create"),deleteContent:B=>{const{replySlug:J,replyParentId:ie}=B;return R({replyId:J,replyParentId:ie})},updateContent:(B,J)=>C({replyInfo:B,content:J})},likes:{createLike:()=>b({replyId:j==null?void 0:j.id,replyParentId:j==null?void 0:j.parent}),deleteLike:()=>{var J,ie,K;const B=((J=j==null?void 0:j.own_children)==null?void 0:J.like)&&((K=(ie=j==null?void 0:j.own_children)==null?void 0:ie.like[0])==null?void 0:K.id);return Y({replyId:B||""})}},comments:{}}},j==null?void 0:j.id)}))]})})},fs=({basePath:e,parentId:t,activityId:n,repliesList:r,isMember:i,functions:{create:u,edit:d,remove:a,like:l,unlike:o,join:m,leave:c}})=>{const h=M.useIntl(),p=z.useQueryClient(),g=_.useContext(ke),v=ca({queryClient:p,queryKey:[e,t,n],mutationFn:async b=>u({activityId:n,content:b.body})}),{mutate:k}=z.useMutation(v),S=la({queryClient:p,queryKey:[e,t,n],mutationFn:async b=>d(b)}),{mutate:y}=z.useMutation(S),x=ua({queryClient:p,queryKey:[e,t,n],mutationFn:async({replyId:b})=>a({replyId:b})}),{mutate:C}=z.useMutation(x),D=da({queryClient:p,queryKey:[e,t,n],mutationFn:l}),{mutate:R}=z.useMutation(D),G=ma({queryClient:p,queryKey:[e,t,n],user:g,mutationFn:o}),{mutate:L}=z.useMutation(G),Q=_.useCallback(({replyId:b})=>R({replyId:b}),[R]),A=_.useCallback(({replyId:b})=>L({replyId:b}),[L]);return Rn(),s.jsxs(s.Fragment,{children:[s.jsx(wt,{contentType:"reply",createPost:(b,Y)=>k(Y),membershipRequiredToPost:{isMember:i,required:!0,join:m,leave:c,notMemberStateText:h.formatMessage({id:"community_joinToPost"})}}),(r==null?void 0:r.length)===0||(r==null?void 0:r.map(b=>{var w,V,X,ne,se,re,q,de,ce,F,ae,me,oe,pe,fe,ge,he,B,J,ie;const Y=((w=b==null?void 0:b.user)==null?void 0:w.id)===(g==null?void 0:g.id),j=rn(i,Y);return s.jsx(us,{children:s.jsx(tt,{content:{type:"reply",body:typeof b.data.content=="string"?(V=b==null?void 0:b.data)==null?void 0:V.content:((ne=(X=b==null?void 0:b.data)==null?void 0:X.content)==null?void 0:ne.text)||"",canLike:j,createdAt:b==null?void 0:b.created_at,slugs:{question:`${e}/${t}/${n}`,parentId:t,reply:b==null?void 0:b.id},slug:b==null?void 0:b.id,author:{id:(se=b==null?void 0:b.user)==null?void 0:se.id,name:(q=(re=b==null?void 0:b.user)==null?void 0:re.data)==null?void 0:q.name,organization:(ce=(de=b==null?void 0:b.user)==null?void 0:de.data)==null?void 0:ce.organization,jobTitle:(ae=(F=b==null?void 0:b.user)==null?void 0:F.data)==null?void 0:ae.jobTitle,image:{thumbnail:((oe=(me=b==null?void 0:b.user)==null?void 0:me.data)==null?void 0:oe.thumbnail)||void 0}},userLiked:((pe=b==null?void 0:b.own_children)==null?void 0:pe.like)&&((fe=b==null?void 0:b.own_children)==null?void 0:fe.like.length)>0,likes:((ge=b==null?void 0:b.children_counts)==null?void 0:ge.like)||0,peopleWhoLiked:((he=b==null?void 0:b.latest_children)==null?void 0:he.like)&&((B=b==null?void 0:b.latest_children)==null?void 0:B.like.map(K=>{var le,be;return{id:K==null?void 0:K.user_id,name:(be=(le=K==null?void 0:K.user)==null?void 0:le.data)==null?void 0:be.name}}))},functions:{content:{createContent:()=>null,deleteContent:K=>{const{replySlug:le}=K;return C({replyId:le})},updateContent:(K,le)=>y({replyInfo:K,content:le})},likes:{createLike:()=>Q({replyId:b==null?void 0:b.id}),deleteLike:()=>{var le,be,Me;const K=((le=b==null?void 0:b.own_children)==null?void 0:le.like)&&((Me=(be=b==null?void 0:b.own_children)==null?void 0:be.like[0])==null?void 0:Me.id);return A({replyId:K||""})}},comments:{}},children:s.jsx(xa,{basePath:e,parentId:t,replyParentId:b==null?void 0:b.id,activityId:n,replyCount:((J=b==null?void 0:b.children_counts)==null?void 0:J.reply)||0,replies:(ie=b==null?void 0:b.latest_children)==null?void 0:ie.reply,isMember:i,functions:{create:u,edit:d,remove:a,like:l,unlike:o,join:m,leave:c}})},b==null?void 0:b.id)},b==null?void 0:b.id)}))]})},ba=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityInfo:d,content:{body:a}})=>{if(a.length===0)return;await e.cancelQueries({queryKey:t});const l=e.getQueryData(t);return l&&l.id===(d==null?void 0:d.activityId)&&(l.content=a),e.setQueryData(t,()=>({...l})),{previousActivity:l}},onError:(d,a,l)=>{e.setQueryData(t,l.previousActivity)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),va=({queryClient:e,queryKey:t,redirectUrl:n,mutationFn:r})=>({mutationFn:r,onSuccess:()=>{e.invalidateQueries({queryKey:t}),window.location.href=n}}),wa=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async()=>{var l;await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);return(l=a==null?void 0:a.reaction_counts)!=null&&l.like?a.reaction_counts.like+=1:a&&(a.reaction_counts={like:1}),e.setQueryData(t,()=>({...a})),{previousActivity:a}},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivity)},onSuccess:a=>{const l=e.getQueryData(t);return l!=null&&l.own_reactions.like?l.own_reactions.like.push(a):l&&(l.own_reactions={like:[a]}),l!=null&&l.latest_reactions.like?l.latest_reactions.like.push(a):l&&(l.own_reactions={like:[a]}),e.setQueryData(t,()=>({...l})),{previousActivity:l}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),ka=({queryClient:e,queryKey:t,user:n,activity:r,mutationFn:i})=>({mutationFn:i,onMutate:async()=>{var m;await e.cancelQueries({queryKey:t});const o=e.getQueryData(t);return(m=o==null?void 0:o.reaction_counts)!=null&&m.like&&o.reaction_counts.like>0&&(o.reaction_counts.like-=1),e.setQueryData(t,()=>({...o})),{previousActivity:o}},onError:(o,m,c)=>{e.setQueryData(t,c.previousActivity)},onSuccess:()=>{var c,h,p;if(!r)return;const o=(p=(h=(c=r.own_reactions)==null?void 0:c.like)==null?void 0:h.find(g=>g.user_id===(n==null?void 0:n.id)))==null?void 0:p.id,m=e.getQueryData(t);if(m!=null&&m.own_reactions.like&&(m.own_reactions.like=m.own_reactions.like.filter(g=>g.id!==o),!!(m!=null&&m.latest_reactions.like)))return m.latest_reactions.like=m.latest_reactions.like.filter(g=>g.id!==o),e.setQueryData(t,()=>({...m})),{previousActivity:m}},onSettled:()=>{e.invalidateQueries({queryKey:t})}});const ja=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{get:i,editActivity:u,removeActivity:d,likeActivity:a,unlikeActivity:l,createReply:o,editReply:m,removeReply:c,likeReply:h,unlikeReply:p,join:g,leave:v}})=>{var se,re,q,de,ce,F,ae,me,oe,pe,fe,ge,he,B,J,ie,K,le,be,Me,Oe,Ce,nt;const k=M.useIntl(),S=_.useContext(ke),y=z.useQueryClient(),{data:x,isLoading:C,isFetching:D}=z.useQuery({queryKey:[e,t,n],queryFn:i}),R=ba({queryClient:y,queryKey:[e,t,n],mutationFn:async ee=>await u(ee)}),{mutate:G}=z.useMutation(R),L=va({queryClient:y,queryKey:[e,t,n],mutationFn:async({activityId:ee})=>d({activityId:ee}),redirectUrl:`${e}/${t}`}),{mutate:Q}=z.useMutation(L),A=wa({queryClient:y,queryKey:[e,t,n],mutationFn:a}),{mutate:b}=z.useMutation(A),Y=ka({queryClient:y,queryKey:[e,t,n],user:S,mutationFn:async()=>{var je,Ne,st;const ee=(st=(Ne=(je=x==null?void 0:x.own_reactions)==null?void 0:je.like)==null?void 0:Ne.find(rt=>rt.user_id===(S==null?void 0:S.id)))==null?void 0:st.id;await l({activityId:n,reactionId:ee})},activity:x}),{mutate:j}=z.useMutation(Y),w=_.useCallback(({activityId:ee})=>b({activityId:ee}),[b]),V=_.useCallback(async({activityId:ee})=>j({activityId:ee}),[j]);if(C||D)return s.jsx(we,{style:{height:"400px"}});if(!x)return s.jsx(Ke,{variant:"error",text:k.formatMessage({id:"activitySection_notFoundError"})});const X=((se=x==null?void 0:x.actor)==null?void 0:se.id)===(S==null?void 0:S.id),ne=rn(r,X);return s.jsx(tt,{className:"activity-section",content:{type:"post",body:x==null?void 0:x.content,canLike:ne,createdAt:(x==null?void 0:x.time)||"",slugs:{question:`${t}/${n}`,parentId:t,activityId:x==null?void 0:x.id},slug:n,author:{id:(re=x==null?void 0:x.actor)==null?void 0:re.id,name:((q=x==null?void 0:x.actor)==null?void 0:q.data)&&((ce=(de=x==null?void 0:x.actor)==null?void 0:de.data)==null?void 0:ce.name),organization:((F=x==null?void 0:x.actor)==null?void 0:F.data)&&((me=(ae=x==null?void 0:x.actor)==null?void 0:ae.data)==null?void 0:me.organization),jobTitle:((oe=x==null?void 0:x.actor)==null?void 0:oe.data)&&((fe=(pe=x==null?void 0:x.actor)==null?void 0:pe.data)==null?void 0:fe.jobTitle),image:{thumbnail:((ge=x==null?void 0:x.actor)==null?void 0:ge.data)&&((B=(he=x==null?void 0:x.actor)==null?void 0:he.data)==null?void 0:B.thumbnail)||void 0}},userLiked:((J=x==null?void 0:x.own_reactions)==null?void 0:J.like)&&((ie=x==null?void 0:x.own_reactions)==null?void 0:ie.like.length)>0,likes:x&&((K=x==null?void 0:x.reaction_counts)==null?void 0:K.like),comments:x&&((le=x==null?void 0:x.reaction_counts)==null?void 0:le.reply),peopleWhoLiked:((be=x==null?void 0:x.latest_reactions)==null?void 0:be.like)&&((Me=x==null?void 0:x.latest_reactions)==null?void 0:Me.like.map(ee=>{var je,Ne;return{id:ee==null?void 0:ee.user_id,name:(Ne=(je=ee==null?void 0:ee.user)==null?void 0:je.data)==null?void 0:Ne.name}}))},originalAuthorId:(Oe=x==null?void 0:x.actor)==null?void 0:Oe.id,functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>Q({activityId:n}),updateContent:(ee,je)=>G({activityInfo:ee,content:je})},likes:{createLike:()=>w({activityId:n}),deleteLike:()=>V({activityId:n})},comments:{openComments:()=>{}}},children:s.jsxs(s.Fragment,{children:[s.jsxs("h3",{children:["Comments (",((Ce=x==null?void 0:x.reaction_counts)==null?void 0:Ce.reply)||0,")"]}),s.jsx(fs,{basePath:e,parentId:t,activityId:n,repliesList:(nt=x==null?void 0:x.latest_reactions)==null?void 0:nt.reply,isMember:r,functions:{create:o,edit:m,remove:c,like:h,unlike:p,join:g,leave:v}})]})},n)},ya=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:i}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:i}}),Ea=({type:e,data:t})=>{const n=M.useIntl(),{answers:r,createdAt:i,dateHasPassed:u,isOngoingEvent:d,pill:a,readingTime:l,publishedDate:o,startDate:m}=t;if(e==="question"){const c=i&&Qt(i);return s.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),i&&s.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:c?n.formatMessage({id:`dates_${c.path}`},{number:c.number}):0})]})]})}if(m&&!u||d)return s.jsx("p",{className:"details",children:d?n.formatMessage({id:"card_bootcamp"}):In(m)});if(a)return s.jsx(Ge,{variant:a==="free"?"subtle":"highlighted",className:a,"data-testid":"course-type",children:a});if(l||o){const c=o&&Qt(o);return s.jsxs("ul",{className:"details",children:[l&&s.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),o&&s.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:c?n.formatMessage({id:`dates_${c.path}`},{number:c.number}):0})})]})}return null},_t={customCard:{className:"custom",gtmEvent:"custom",length:{text:335,secondaryText:150}},event:{basePath:"/events/",className:"event",gtmEvent:"event"},microcourse:{basePath:"/microcourses/en/",className:"course",gtmEvent:"microcourse-overview"},solutionArticle:{basePath:"/solution-articles/en/",className:"article",length:{title:60},gtmEvent:"article"},qaQuestion:{basePath:"/questions-answers/",className:"question",length:{title:190},gtmEvent:"q-and-a-question"},listPage:{basePath:"/list/en/",className:"list",gtmEvent:"list"},people:{basePath:"/profiles/",className:"people",length:{people:1e3},gtmEvent:"person"},learningHub:{basePath:"/learning-hub/",className:"learning-hub",length:{title:190},gtmEvent:"learning-hub"}},Sa=({data:e,cta:t,link:n,gtmContext:r})=>{var g;const i=M.useIntl(),[u,d]=_.useState({loading:!1,registered:e.registered||!1});_.useEffect(()=>{e.registered&&d(v=>({...v,registered:!0}))},[e.registered]);const{startDate:a,dateHasPassed:l,pill:o,slug:m}=e,c=e.contentType;let h="";if((g=_t[c])!=null&&g.gtmEvent&&(h=_t[c].gtmEvent),a&&l)return s.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${h}-click`,children:i.formatMessage({id:"card_watch"})});if(c==="people")return s.jsx(H,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${h}-click`,children:i.formatMessage({id:"card_cta_people"})});const p=["microcourse","event"];if(t&&t.onClick&&p.includes(c)&&o!=="premium"){const v=u.loading||u.registered,k=async S=>{if(S.preventDefault(),S.stopPropagation(),!(v||!t||!t.onClick)){d(y=>({...y,loading:!0}));try{const y=await t.onClick(e);d(y==="success"?()=>({registered:!0,loading:!1}):x=>({...x,loading:!1}))}catch{d(x=>({...x,loading:!1}))}}};return s.jsx(H,{onClick:k,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:v,"data-gtm-event-context":`${r}Page-${c}: ${m}`,"data-gtm-event-type":`${r}-${c}-register-click`,"data-testid":"in-card-button",children:i.formatMessage({id:`card_cta_${c}${v?`_${u.loading?"loading":"done"}`:""}`})})}return null},Sn={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},$a=e=>{let t=e;return Object.keys(Sn).includes(e)&&(t=Sn[e]),`url(${Ye}icons/${t}.svg)`};const Ta={title:66,text:3e3,secondaryText:1e3,partner:25},Ma=({id:e="",card:t,buildCardData:n,cta:r,gtmContext:i="Carousel",className:u=""})=>{const d=M.useIntl(),a=_.useContext(ke),l=a&&typeof a.id=="string",[o,m]=_.useState({data:null,isLoading:!0}),{data:c,isLoading:h}=o,p=_.useCallback(()=>{n(t,l).then(L=>{m(()=>({data:L,isLoading:!1}))}).catch(()=>m(L=>({...L,isLoading:!1})))},[e]);if(_.useEffect(()=>{p()},[]),h||!c)return s.jsx(we,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});const{contentType:g}=c;if(!g||!_t[g])return s.jsx(we,{element:"li",className:"card-wrapper"});const{basePath:v="",className:k,length:S,gtmEvent:y}=_t[g],x=Ln(`card_label_${g}`)?d.formatMessage({id:`card_label_${g}`}):!1,C=c.slug?`${v}${c.slug}`:!1,D={...Ta,...S};let R={className:"card"};C&&(R={href:C,className:"card gtm-trackable","data-gtm-event-context":`${i}-CarouselCard`,"data-gtm-event-type":`${y}-click`,"data-testid":"link"},c.openInNewTab&&(R.target="_blank"));const G=c.customIcon?{"--custom-icon":$a(c.customIcon)}:{};return s.jsx("li",{className:$("card-wrapper text-medium",k,u,{"has-link":C,"no-link":!C,"has-custom-icon":c.customIcon,"has-image":c.banner}),style:G,"data-testid":`${g}-card`,children:_.createElement(C?"a":"div",R,s.jsxs(s.Fragment,{children:[(c.customLabel||x)&&s.jsx("small",{className:$("card-label text-small",k),children:c.customLabel||x}),c.startDate&&!c.isOngoingEvent&&s.jsx(Ge,{size:"small",variant:c.dateHasPassed?"default":"information","data-testid":"date",children:c.dateHasPassed?d.formatMessage({id:"card_ended"}):zs(c.startDate)}),c.banner?s.jsxs("p",{className:"img",children:[c.registered&&s.jsx(Ge,{size:"small",variant:"registered",children:d.formatMessage({id:"card_registered"})}),s.jsx(Yt,{image:c.banner})]}):k==="people"?s.jsx(Be,{name:c.title||"",src:c.profile,"data-testid":"people-profile-picture"}):null,c.contributors&&s.jsx(Xt,{contributors:{data:c.contributors},styling:{size:"small",showGap:k!=="question",showText:!0},"data-testid":"contributors"}),c.partner&&s.jsx("p",{className:"partners","data-testid":"partners",children:Le(c.partner.title,D.partner)}),["title","text","secondaryText"].map(L=>{const Q=c[L];if(!Q)return null;const A=Ws(L);return s.jsx("p",{className:A,"data-testid":A,children:Le(Q,D[L])},L)}),s.jsx(Ea,{type:k||"",data:c}),s.jsx(Sa,{data:c,cta:r,link:C||"",gtmContext:i})]}))})};const Ca=({cards:e,cardTypes:t,className:n="",...r})=>s.jsx("ul",{className:$("card-block",n),children:e.map((i,u)=>{const d=i.slug?`${i.slug}-${t[u]}`:`${t[u]}-${u}`;return s.jsx(Ma,{id:d,card:{...i,contentType:t[u]},...r},d)})});const $n=[{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 dt="notFoundError_",Na=()=>{const e=M.useIntl(),t=[];return $n.forEach((n,r)=>{n.title=e.formatMessage({id:`${dt}post_${r+1}`}),t.push("solutionArticle")}),s.jsxs(ls,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:s.jsxs(bt,{children:[s.jsx(Ca,{cards:$n,cardTypes:t,buildCardData:n=>new Promise((r,i)=>{r(n)})}),s.jsx(H,{href:"/solution-articles/",children:e.formatMessage({id:`${dt}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[s.jsx("h1",{children:e.formatMessage({id:`${dt}title`})}),s.jsx("p",{children:e.formatMessage({id:`${dt}text`})})]})};exports.ASSETS_BUCKET=Ye;exports.ActivitiesFeed=ia;exports.ActivitySection=ja;exports.AddPost=wt;exports.BannerSection=or;exports.Breadcrumbs=$r;exports.Button=H;exports.ButtonWrapper=Ze;exports.CacheProvider=Gn;exports.CollapsibleSection=Gt;exports.Columns=ts;exports.CommunityDetails=Sr;exports.Contributors=Xt;exports.ConversationContext=et;exports.CookieBanner=ns;exports.DiscussionConversation=us;exports.DiscussionForm=sn;exports.DiscussionLikes=ds;exports.DiscussionPost=tt;exports.DiscussionThread=ms;exports.Divider=Pe;exports.DownloadSection=nr;exports.EMAILS=Fe;exports.EmailHelperTextBox=Br;exports.EmptyStateBox=Ke;exports.Filters=Tr;exports.FlagsProvider=Jn;exports.Footer=Kt;exports.FullWidthSection=bt;exports.GlobalProviders=Er;exports.Header=en;exports.HelperTextBox=Hn;exports.HiddenFromScreenReaders=zt;exports.HideShowTextBox=lr;exports.HighlightedTextBox=Te;exports.IntlProvider=Xn;exports.InviteForm=is;exports.InviteModal=zr;exports.JoinButton=Zt;exports.LanguageSwitcher=Cr;exports.Link=qe;exports.LoadMore=qn;exports.LoadingBlock=br;exports.LoadingPlaceholder=we;exports.LoadingState=vr;exports.Logo=qt;exports.LogoSection=sr;exports.MarkdownText=Ut;exports.MarketingBox=ir;exports.Member=vt;exports.MembersList=Jr;exports.Modal=tn;exports.MoreMenu=Kn;exports.NUMBER_OF_USERS=cr;exports.NavigationMenu=es;exports.NotFoundError=Na;exports.Overlay=nn;exports.PageHeading=Wn;exports.PageLayout=ls;exports.PasswordRules=Hr;exports.Pill=Ge;exports.ProfilePicture=Be;exports.ProgressBar=zn;exports.Rating=Ur;exports.RepliesFeed=fs;exports.ResponsesHeading=ea;exports.ResponsiveImage=Yt;exports.SearchForm=os;exports.ShareLinks=Ar;exports.Span=Un;exports.StatusBanner=ht;exports.Tabs=Fr;exports.Tags=Gr;exports.Tooltip=On;exports.TopLevelPage=Lr;exports.UserContext=ke;exports.UserProvider=Zn;exports.VisuallyHidden=ue;exports.addAriaProps=cs;exports.getMember=Jt;exports.headerData=Je;exports.mapGetStreamData=ya;exports.pageReady=Bn;exports.useCurrentPath=Nn;exports.useEffectAfterMount=De;exports.useElementWidth=Xe;exports.useScrollListener=Pn;exports.useScrollToHash=Rn;
39
+ ${ze(t,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:ze(t,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,i)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(i))}];const Pr="shareLinks_",Ar=({title:e,link:t,referrer:n,gtmContext:r="ShareLinks",size:i="large",variant:u="default",className:d=""})=>{const a=M.useIntl(),l=Rr({title:e,link:t,referrer:n});return s.jsxs("aside",{className:$("share-links",i,u,d),children:[s.jsx("p",{className:"text-small",children:a.formatMessage({id:"shareLinks_label"})}),s.jsx("ul",{children:l.map(({key:o,icon:m,url:c,shouldRender:h=!0,onClick:p})=>{if(typeof h=="function"&&!h())return null;const g={};return p&&(g.onClick=v=>p(v,c)),s.jsx("li",{children:s.jsx(H,{size:i,variant:"tertiary",icon:{icon:m||o},href:c,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${o}-click`,"data-testid":"link",screenreaderText:a.formatMessage({id:`${Pr}link_${o}`}),...g})},o)})})]})};const Fr=({tabs:e,className:t=""})=>{var l;const n=(o,m,c)=>(o||(o=`panel-${window.btoa(m)}-${c}`),o);let r=e.findIndex(o=>o.current===!0);if(r<0&&(r=0),window.location.hash){const o=window.location.hash.replace("#","");if(e.find(c=>c.id===o)){for(let c=0;c<e.length;c++)if(n(e[c].id,e[c].text,c)===o){r=c;break}}}const[i,u]=_.useState((l=e[r])!=null&&l.id?e[r].id:n(e[r].id,e[r].text,r)),d=[],a=[];return e.forEach(({id:o,text:m,content:c,href:h},p)=>{o=n(o,m,p);const g=i===o,v={};h||(v["aria-controls"]=o,v.onClick=k=>{k.preventDefault(),k.stopPropagation(),u(o),window.location.hash=`#${o}`},a.push(s.jsx("section",{id:o,hidden:!g,role:"tabpanel","aria-labelledby":`tab-${o}`,"aria-live":g?"assertive":"off",children:typeof c=="string"?s.jsx("p",{children:c}):c},`section-${o}`))),d.push(s.jsx("li",{children:s.jsx("a",{href:h||`#${o}`,id:`tab-${o}`,className:$({selected:g}),role:"tab","aria-selected":g,...v,children:m})},`tab-${o}`))}),s.jsxs("div",{className:$("tabs-wrapper",t),children:[s.jsx("ul",{className:"tabs",role:"tablist",children:d}),s.jsx("div",{className:"tab-content",children:a})]})};const Ir={"2-1":901,"1-3":769},ts=({layout:e="2-1",hideOnMobile:t=!1,className:n="",children:r})=>{const i=Xe(!0);let u=r;return _.Children.count(r)===1&&(u=_.Children.toArray(r)[0],u.props&&(u=u.props.children)),s.jsx("section",{className:$("columns",`layout-${e}`,n),children:_.Children.map(u,(d,a)=>t!==!1&&a===t&&i&&i<Ir[e]?null:d)})},Lr=({activeLink:e,...t})=>s.jsx(ts,{layout:"1-3",children:s.jsxs(s.Fragment,{children:[s.jsx(es,{activeLink:e}),s.jsx(Wn,{...t})]})});const Rt="cookieBanner_",Pt=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],At=new Date(Date.now()+12*30*24*60*60*1e3),ns=()=>{const e=M.useIntl(),[t,n,r]=Tn.useCookies(Pt),[i,u]=_.useState(!t["apol-cookie-banner"]),d=()=>{Pt.forEach(m=>{n(m,!0,{path:"/",expires:At,domain:m==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),u(!1),window.location.reload()},a=()=>{n("apol-cookie-banner",!0,{path:"/",expires:At}),Pt.forEach(m=>{if(m==="apol-cookie-banner"){n(m,!0,{path:"/",expires:At});return}r(m)}),u(!1)};if(!i)return null;const l=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:a,gtmType:"reject-all"},{id:"accept",onClick:d,gtmType:"accepted-all"}],o=[];return l.forEach(m=>{o.push({variant:m.href?"tertiary":"primary",href:m.href,onClick:m.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${m.gtmType}-click`,children:e.formatMessage({id:`${Rt}buttons_${m.id}`})})}),s.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[s.jsx("h6",{children:e.formatMessage({id:`${Rt}title`})}),s.jsx("p",{children:e.formatMessage({id:`${Rt}text`})}),s.jsx(Ze,{buttons:o})]})},$e={platform:{order:["events","courses","qanda","articles"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},qanda:{href:"/questions-answers/",gtmType:"q-and-a-click"},articles:{href:"/solution-articles/",gtmType:"articles-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:["story","team","careers","partner","contact"],story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:Fe["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Fe["data-protection"].eu,gtmType:"email-eu-dpo-link"}}},contact:{text:{order:["correspondence","registered","berlin","support","business"],correspondence:{address:!0},registered:{address:!0},berlin:{address:!0},support:{email:Fe.support,gtmType:"concierge-email-click"},business:{email:Fe.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 Ie="footer_",pt="SiteFooter",jn=({group:e})=>{const t=$e[e].order||[];let n=!1;return"text"in $e[e]&&(n=$e[e].text),s.jsxs(_.Fragment,{children:[s.jsx("p",{className:"pre-title",children:s.jsx(M.FormattedMessage,{id:`${Ie}${e}`})}),Array.isArray(t)&&t.length>0&&s.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:u}=$e[e][r],d={};return["legal"].includes(e)&&(d.target="_blank",d.rel="noopener"),s.jsx("li",{children:s.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":pt,"data-gtm-event-type":u,...d,children:s.jsx(M.FormattedMessage,{id:`${Ie}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&s.jsx("dl",{className:"text-medium",children:n.order.map(r=>s.jsxs(_.Fragment,{children:[s.jsx("dt",{children:s.jsx(M.FormattedMessage,{id:`${Ie}${e}_${r}`})}),s.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&s.jsx("address",{children:s.jsx(M.FormattedMessage,{id:`${Ie}${e}_${r}_address`,values:{br:s.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&s.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":pt,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},Kt=()=>s.jsx("div",{id:"footer",children:s.jsxs("div",{className:"wrapper",children:[s.jsx(zt,{element:"hr"}),s.jsx(qt,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":pt,"data-gtm-event-type":"logo-homepage-link"}),s.jsx("footer",{children:["platform","community","company","contact"].map(e=>s.jsxs("div",{className:"group",children:[s.jsx(jn,{group:e}),Object.keys($e[e]).includes("child")&&s.jsx(jn,{group:$e[e].child})]},e))}),s.jsx("hr",{}),s.jsxs("div",{className:"sub-footer",children:[s.jsx("ul",{children:Array.isArray($e.social.order)&&$e.social.order.map(e=>{const t=$e.social[e];return s.jsx("li",{className:e,children:s.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":pt,"data-gtm-event-type":"social-click",children:s.jsx("span",{className:"hidden",children:s.jsx(M.FormattedMessage,{id:`${Ie}social_${e}`})})})},e)})}),s.jsx("small",{children:s.jsx(M.FormattedMessage,{id:`${Ie}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})});const ct="emailHelperTextBox_",Br=({type:e,email:t,redirectPath:n,resendVerificationCode:r})=>{const i=M.useIntl(),[u,d]=_.useState({path:`${ct}default`,type:"default",link:{},mail:{},error:""}),[a,l]=_.useState(!1),o=_.useCallback(p=>{p.preventDefault(),p.stopPropagation();const g=v=>{d({path:`${ct}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:k=>o(k),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:v})};if(typeof r!="function"){g(i.formatMessage({id:`${ct}error_noFunction`}));return}l(!0),r(t).then(()=>{localStorage.setItem("email",t),window.location.href=n||"/signup/verify-email"}).catch(v=>{g(v.message)}).finally(()=>{l(!1)})},[t,n,r]);_.useEffect(()=>{let p=ct,g="default",v={},k={};switch(e){case"gov":p+="autoApproved",g="success";break;case"nonGov":p+="unrecognisedEmail",g="error",v={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":p+="pendingApproval",g="error",k={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":p+="emailUnverified",g="error",v={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:S=>o(S),"data-testid":"send-verify-email-click"};break;case"exists":p+="emailAlreadyExists",g="error",v={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},k={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:p+="default",v={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}d({...u,path:p,type:g,link:v,mail:k})},[e]);const m={};return["link","mail"].forEach(p=>{m[p]=Object.keys(u[p]).length?g=>s.jsx("a",{...u[p],children:g}):g=>g}),s.jsx(Hn,{type:u.type,heading:a?!1:i.formatMessage({id:`${u.path}_title`}),children:a?s.jsxs(s.Fragment,{children:[s.jsx(we,{element:"span"}),s.jsx(we,{element:"span"})]}):i.formatMessage({id:`${u.path}_text`},{...m,strong:p=>s.jsx("strong",{children:p}),em:p=>s.jsx("em",{children:p}),br:s.jsxs(s.Fragment,{children:[s.jsx("br",{}),s.jsx("br",{})]}),error:u.error})})};const lt="passwordRules_",ss="isMoreThanEightCharacters",rs="includesNumberAndSymbol",as="includesLowerAndUppercase",Or={[ss]:"8Characters",[rs]:"numberSymbol",[as]:"lowercaseUppercase"},Qr=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=M.useIntl();return s.jsxs("aside",{className:$("password-rules",t),children:[s.jsx("small",{children:n.formatMessage({id:`${lt}intro`})}),s.jsx("ul",{children:[ss,rs,as].map(r=>s.jsxs("li",{className:$({matches:e[r]}),children:[s.jsxs(ue,{children:[n.formatMessage({id:`${lt}rule_label`})," "]}),s.jsx("span",{children:n.formatMessage({id:`${lt}rule_${Or[r]}`})}),!e[r]&&s.jsxs(ue,{element:"strong",children:[" "," ",n.formatMessage({id:`${lt}notMet`})]})]},`rule-${r}`))})]})},Hr=_.memo(Qr);const Ur=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:i=()=>{}},className:u="",hasLoaded:d=!1})=>{const a=M.useIntl(),[l,o]=_.useState({setUp:!1,id:null,rating:null,disabled:!0}),m=async()=>{try{const S=await n();o(y=>({...y,setUp:!0,id:S&&S.id,disabled:!1}))}catch(S){o(y=>({...y,setUp:!0,disabled:!0})),i(S)}};if(_.useEffect(()=>{d&&!l.setUp&&m()},[d]),!d)return s.jsx(we,{className:"rating-placeholder"});const{id:c,rating:h,disabled:p}=l,g="ratings_",v={text:a.formatMessage({id:`${g}text`}),low:a.formatMessage({id:`${g}low`}),high:a.formatMessage({id:`${g}high`}),success:a.formatMessage({id:`${g}success`}),...e},k=async S=>{if(!(!c||p))try{o(y=>({...y,rating:S,disabled:!0})),await r({id:c,value:S})}catch(y){o(x=>({...x,rating:null})),i(y)}finally{o(y=>({...y,disabled:!1}))}};return s.jsxs("div",{className:$("rating",u),children:[s.jsx("span",{className:"label",children:v[h?"success":"text"]}),s.jsx("ol",{children:Array.from(new Array(t).keys()).map(S=>{const y=S+1;return s.jsx("li",{className:$({selected:h&&y<=h}),children:s.jsx(H,{variant:"tertiary",size:"small",icon:{icon:`star${!h||y>h?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${a.formatMessage({id:`${g}stars`},{number:y,total:t})}${y===1||y===t?` - ${v[y===1?"low":"high"]}`:""}`,onClick:x=>{x.preventDefault(),x.stopPropagation(),k(y)},disabled:p})},`rating-${y}`)})})]})};const os=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:u="form-submission"})=>{const{searchIsOpen:d=!0,isDesktopVersion:a=!1}=n||{},l=M.useIntl(),o=_.useRef(null);De(()=>{!n||a||!d||o.current&&o.current.focus()},[d]);const m=c=>{c.preventDefault(),c.stopPropagation(),!(!o.current||!o.current.value||o.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(o.current.value)}`)};return s.jsx("form",{onSubmit:m,className:$("search-form gtm-trackable",t),"data-gtm-event-context":i,"data-gtm-event-type":u,children:s.jsx("fieldset",{id:`${e}-form`,hidden:n?!d:!1,role:"search",children:s.jsxs("p",{children:[s.jsx(ue,{element:"label",htmlFor:e,children:l.formatMessage({id:"search_label"})}),s.jsx("input",{ref:o,type:"search",id:e,name:e,defaultValue:r,placeholder:l.formatMessage({id:"search_placeholder"}),onKeyDown:c=>{c.key==="Enter"&&m(c)}}),s.jsx("button",{className:"clear",onClick:c=>{c.preventDefault(),c.stopPropagation(),o.current&&o.current.value&&(o.current.value="")},children:s.jsx(ue,{children:l.formatMessage({id:"search_clear"})})}),s.jsx("button",{className:"search",onClick:m,children:s.jsx(ue,{children:l.formatMessage({id:"search_cta"})})})]})})})};const is=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:i,backgroundColor:u,onClose:d,reportError:a,sendInvites:l,initialFormStatus:o="NOT_SUBMITTED"})=>{const[m,c]=_.useState([]),[h,p]=_.useState(!0),[g,v]=_.useState(o),{formatMessage:k}=M.useIntl(),S=async C=>{C.preventDefault();try{await l(m),c([]),v("SUCCESS")}catch(D){v("ERROR"),a(D)}},y=C=>{C.preventDefault(),v("NOT_SUBMITTED"),p(!0),c([])},x=C=>{C.preventDefault(),d(),v("CLOSED")};return g==="CLOSED"?null:g==="ERROR"||g==="SUCCESS"?s.jsxs("div",{className:"invite-form-wrapper",children:[s.jsx("div",{className:"content centred",children:g==="SUCCESS"?s.jsx("h2",{className:"success-title",children:k({id:"inviteForm_success"})}):s.jsxs("h2",{className:"error-title",children:[" ",k({id:"inviteForm_error"})]})}),s.jsx(Re,{}),s.jsx("div",{className:"footer",children:g==="SUCCESS"?s.jsxs(s.Fragment,{children:[s.jsx(H,{variant:"secondary",onClick:y,children:k({id:"inviteForm_ctaSendMoreInvites"})}),s.jsx(H,{onClick:x,children:k({id:"inviteForm_ctaDone"})})]}):s.jsx(H,{onClick:y,children:k({id:"inviteForm_ctaTryAgain"})})})]}):s.jsx("div",{className:"invite-form-wrapper",children:s.jsxs("form",{style:{backgroundColor:u},onSubmit:S,className:$("invite-form gtm-trackable"),children:[s.jsxs("fieldset",{className:"content",children:[s.jsx("h2",{className:"title",style:{color:r},children:e}),s.jsx("label",{htmlFor:"email-input",className:"label",style:{color:i},children:t}),s.jsx(Rs.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:k({id:"inviteForm_email_placeholder"}),emails:m,onChange:C=>{c(C),p(!C.length)},autoFocus:!1,getLabel:(C,D,P)=>s.jsxs("div",{className:"email text-medium",children:[s.jsx("div",{"data-tag-item":!0,children:C}),s.jsx(H,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{P(D),p(!m.length)},className:"remove-email-button",screenreaderText:k({id:"overlay_close"})})]},D)})]}),s.jsx(Re,{}),s.jsx("fieldset",{className:"footer",children:s.jsx(H,{className:"sendEmailsButton",disabled:h,children:n})})]})})},U={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=u=>{const d=`logged${e?"In":"Out"}`;return t>=n[u][d]};let i={};return["navigation","search"].forEach(u=>{i[u]=r(u)}),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})=>{if(n[e]===t||e==="account"&&t===!1&&n.navigation===!0)return;const i=Date.now();if(!t&&U.handlerCalled[e]&&i-U.handlerCalled[e]<500)return;U.handlerCalled[e]=i;let u=[{type:`menus.${e}`,value:t}];t===!0&&Object.keys(n).forEach(d=>{d===e||n[d]===!1||u.push({type:`menus.${d}`,value:!1})}),r(u)},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=Mn(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?U.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:i})=>{if(!t.current||!t.current.children)return;const u=n?"desktop":"default";if(r[e][u]){r[e][u].focus();return}let d,a;switch(e){case"navigation":if(n){const l=U.findFirstChild(t.current.children,"attributes.aria-controls","navigation");d=U.findFirstChild(l.children,"href")}else d=U.findFirstChild(t.current.children,"href");d||(d=t.current);break;case"account":if(a=U.findFirstChild(t.current.children,"className","account"),!a||!a.children)return;d=U.findFirstChild(a.children,"href");break;default:return}d&&(i([{type:`focusElements.${e}.${u}`,value:d}]),d.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(U.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(U.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(U.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{U.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},Je={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"navigation",explore:{order:["events","courses","q-and-a","articles"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},"q-and-a":{href:"/questions-answers/",className:"icon q-and-a"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup/?ref=header-banner",props:{variant:"primary"}}}},gt=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:i=()=>{},doTrack:u=null})=>{const d=M.useIntl(),a=Mn(Je,e);if(!a||a.onlyShow&&(a.onlyShow==="logged-in"&&!t||a.onlyShow==="logged-out"&&t))return null;const l="doTrack"in a,o=u===null?l?a.doTrack:!0:u,m=e.includes("buttons.");let c=`header_${e.replaceAll(".","_")}`;a.hasVariantText&&(c+=`_logged${t?"In":"Out"}`);let h=!1;if(a.href){let y=a.gtmType||`${e}-click`;if(y.includes(".")){const x=y.split("."),C=x[x.length-2];y=`${C==="topics"?`${C}-`:""}${x[x.length-1]}`}h={href:a.href,role:"menuitem"},o&&(h={...h,className:"gtm-trackable","data-gtm-event-type":y,"data-gtm-event-context":"HeaderButtons"}),m&&(h={...h,variant:"secondary",size:{mobile:"small",881:"large"},...a.props||{}})}const p=a.order&&a.order[0]&&a[a.order[0]],g=p&&a[a.order[0]].order,v=h&&window.location.pathname===a.href;let k={},S={};if(p){const y=a.menuId||e,x={onClick:C=>U.events.onClick(C,{id:y,callback:i,isOpen:r[y]}),onFocus:()=>U.events.onFocus({id:y}),onBlur:()=>U.events.onBlur({id:y,callback:i}),onMouseLeave:()=>U.events.onBlur({id:y,callback:i}),onMouseEnter:()=>U.events.onMouseEnter({id:y,callback:i})};n&&(g&&(k={...x,onKeyPress:C=>{C.key==="Enter"&&U.events.onClick(C,{id:y,callback:i,isOpen:r[y]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":r[y],"aria-controls":y}),S={hidden:y in r?!r[y]:!0}),g||(S={...S,...x})}return s.jsxs("li",{className:$({[a.className]:a.className,"has-submenu":p,parent:g,active:v}),role:"none",...k,children:[h?_.createElement(m?H:"a",h,d.formatMessage({id:c})):d.formatMessage({id:c}),a.order&&s.jsx("ul",{...S,children:a.order.map(y=>{if(!a[y])return null;const x={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:i,doTrack:l?o:null};return a[y].order?s.jsxs("li",{className:$({[a[y].className]:a[y].className}),children:[d.formatMessage({id:`${c}_${y}`}),s.jsx("ul",{children:a[y].order.map(C=>s.jsx(gt,{id:`${e}.${y}.${C}`,...x},C))})]},y):s.jsx(gt,{id:`${e}.${y}`,...x},y)})})]},e)};const Wr={height:67,height_desktop:83},en=({showNavigation:e=!0})=>{const t=M.useIntl(),n=_.useContext(ke),r=Xe(!0,!0),i=n&&typeof n.id=="string",u=_.useMemo(()=>U.getIsDesktopVersion(i,r),[i,r]),[d,a]=_.useReducer(qs,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:l,menus:o,focusElements:m}=d;Rn({scrollPosition:Wr[`height${u.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{!u&&o.navigation||U.shouldChangeHeaderIsVisible(!0,o,a)},scrollDown:()=>{!u&&o.navigation||U.shouldChangeHeaderIsVisible(!1,o,a)}}});const c=(p,g)=>{U.handleMenus({id:p,value:g,menus:o,dispatch:a})},h=_.useRef(null);return De(()=>{o.navigation&&U.autoFocus({menu:"navigation",navigationRef:h,isDesktopVersion:u.navigation,focusElements:m,dispatch:a})},[o.navigation]),De(()=>{o.account&&U.autoFocus({menu:"account",navigationRef:h,isDesktopVersion:u.navigation,focusElements:m,dispatch:a})},[o.account]),n&&n.isLoading?null:s.jsxs(s.Fragment,{children:[s.jsxs("nav",{id:"header",className:$({"logged-in":i,"logged-out":!i,visible:l}),children:[s.jsx(ue,{element:"a",href:"#content-of-page",children:t.formatMessage({id:"header_skip"})}),s.jsx(qt,{}),e&&s.jsxs(s.Fragment,{children:[!u.navigation&&s.jsx("button",{className:"menu-button gtm-trackable",onClick:p=>{p.preventDefault(),p.stopPropagation(),c("navigation",!o.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":o.navigation,"aria-controls":"navigation",children:s.jsx(ue,{children:t.formatMessage({id:`header_menu_${o.navigation?"hide":"show"}`})})}),s.jsx("ul",{ref:h,id:"navigation",hidden:u.navigation||o.account?!1:!o.navigation,role:"menu","data-showing":!u.navigation&&o.account?"account":"default",children:Je.order.map(p=>s.jsx(gt,{id:p,isLoggedIn:i,isDesktopVersion:u.navigation,menus:{navigation:o.navigation,account:o.account},callback:c},p))}),!u.search&&s.jsx("button",{className:"search toggle-search-button",onClick:p=>{p.preventDefault(),p.stopPropagation(),c("search",!o.search)},"aria-haspopup":"true","aria-expanded":o.search,"aria-controls":"search-form",children:s.jsx(ue,{children:t.formatMessage({id:`header_search_${o.search?"hide":"show"}`})})}),s.jsx(os,{id:"global-search",handleToggle:{searchIsOpen:o.search,isDesktopVersion:u.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),i?s.jsxs("button",{className:"account-button",onClick:p=>U.events.onClick(p,{id:"account",callback:c,isOpen:o.account}),onMouseEnter:()=>U.events.onMouseEnter({id:"account",callback:c}),onMouseLeave:()=>U.events.onBlur({id:"account",callback:c}),"aria-haspopup":"true","aria-expanded":o.account,"aria-controls":"navigation",children:[s.jsx(ue,{children:t.formatMessage({id:`header_account_${o.account?"hide":"show"}`})}),s.jsx(Be,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):s.jsx("ul",{className:"sign-in-buttons",children:Je.buttons.order.map(p=>s.jsx(gt,{id:`buttons.${p}`},p))})]})]}),s.jsx("hr",{id:"content-of-page"}),s.jsx("div",{className:$("overlay",{open:o.navigation||o.account||!u.search&&o.search})})]})};const tn=({element:e="section",children:t,className:n,...r})=>_.createElement(e,{className:$("modal",n),children:typeof t=="string"?s.jsx("p",{children:t}):t,...r});const nn=({id:e="content-overlay",isOpen:t=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:i=()=>{},onClose:u=()=>{}}={},forceShow:{error:d=!1}={},title:a,children:l,buttons:o,className:m="",gtmContext:c="Modal"})=>{const h=M.useIntl(),[p,g]=_.useState(t),v=S=>{g(S),S?(i(),document.body.classList.add("has-overlay")):(u(),document.body.classList.remove("has-overlay"))};_.useEffect(()=>{v(t)},[t]);const k=r?{"--max-width":`${r/16}rem`}:{};return s.jsx("div",{className:$("overlay",{open:p}),children:s.jsx(tn,{id:e,className:$("overlay-modal",m,{"has-max-width":r}),hidden:!p,style:k,children:t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"top",children:[a&&s.jsx("h2",{className:"modal-title",children:a}),s.jsx(H,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>v(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":c,screenreaderText:h.formatMessage({id:"overlay_close"})})]}),n&&s.jsx(Re,{}),l,o&&s.jsxs("div",{className:"bottom",children:[s.jsx(Re,{}),s.jsx(Ze,{buttons:o})]}),d&&s.jsx(ht,{className:"error",children:d})]})})})},cs=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const zr=({className:e,showModal:t=!0,title:n,formTitle:r="Know someone who might like to join this workshop?",formLabel:i="Invite your colleagues by typing or pasting their emails below.",ctaMessage:u="Send",showIcon:d,onClose:a,reportError:l=()=>{},sendInvites:o})=>s.jsx(nn,{title:n,isOpen:t,showDivider:!1,showIcon:d,functions:{onClose:a},className:$("invite-modal",e,{success:!!n}),children:s.jsx(is,{title:r,label:i,ctaMessage:u,onClose:a,sendInvites:o,reportError:l})});const Vr=()=>{const e=M.useIntl();return s.jsxs(s.Fragment,{children:[s.jsx(en,{}),s.jsx("div",{id:"content",children:s.jsx(Ke,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),s.jsx(Kt,{})]})},ls=({children:e,additionalContent:{prepended:t,appended:n}={},reportError:r,forceShow:i={},styling:u={},className:d="",locale:a="en"})=>{const{navigation:l=!0,footer:o=!0}=i,{background:m="default",variant:c="default",circle:h="default"}=u,p=Nn();_.useEffect(()=>{window.scrollTo(0,0)},[p]);const g=ft(e,{locale:a}),v=ft(t,{locale:a}),k=ft(n,{locale:a}),S={};return m!=="default"&&(S[m]=!0),c!=="default"&&(S[c]=!0),h!=="default"&&(S[h]=!0),s.jsx(Ps.ErrorBoundary,{onError:r,fallback:s.jsx(Vr,{}),children:s.jsx(_.Suspense,{fallback:null,children:s.jsxs("div",{id:"wrapper",className:$(d,S,{"has-footer":o}),children:[s.jsx(en,{showNavigation:l}),s.jsxs("section",{id:"content-wrapper",children:[v&&s.jsx("div",{className:"additional-content prepended",children:v}),_.createElement(m==="bold"?tn:"div",{id:"content",children:g})]}),k&&s.jsx("div",{className:"additional-content appended",children:k}),o&&s.jsx(Kt,{}),s.jsx(ns,{})]})})})},yn={default:"tags_",headerTopics:"header_topics_topics_"},Ft={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"},Yr={getTagDetails:e=>{if(e.includes("topic_")){if(e=Ft.topic[e.replace("topic_","")],e){const t=Je.topics.topics[e].href;return t?{id:e,href:t,text:`${yn.headerTopics}${e}`}:null}return null}return Ft[e]?(e=Ft[e],{id:e,text:`${yn.default}${e}`}):null}};const Gr=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:i="",gtmType:u="tag-click",gtmContext:d="tags"})=>{const a=M.useIntl();if(!e||e.length<1)return null;const l=[];return e.forEach(o=>{if(!o)return;const m=Yr.getTagDetails(o);m&&l.push(m)}),l.length<1?null:s.jsx("ul",{className:$("tags text-small",t,i,{"one-line":n}),children:l.map(o=>{const m=a.formatMessage({id:o.text});return s.jsx("li",{children:o.href&&r?s.jsx("a",{href:o.href,className:"gtm-trackable","data-gtm-event-type":u,"data-gtm-event-context":d,children:m}):m},o.id)})})};const Jr=({members:{data:e=[],total:t=e.length},hasNextPage:n=!1,loadNextPage:r=()=>{},gtmContext:i="member",gtmType:u="member-click",className:d=""})=>{const a=M.useIntl();return e.length===0?null:s.jsxs("div",{className:$("members-list",d),children:[s.jsxs("h1",{children:[a.formatMessage({id:"membersList"}),s.jsx("span",{className:"count",children:t})]}),s.jsx("ul",{children:e.map((l,o)=>s.jsxs("li",{children:[s.jsx(vt,{member:l,gtmContext:i,gtmType:u}),l.isAdmin&&s.jsx(Ge,{children:a.formatMessage({id:"membersList_admin"})})]},o))}),n&&s.jsx(qn,{hasNextPage:n,loadNextPage:r,icon:{icon:"arrow-down",position:"right"},gtmContext:i})]})};let ut=null;const xe="discussion_form_",sn=({content:e={type:"response",slugs:{}},userHasPermissions:t=!0,meta:n={isLoading:!1,isInWrapper:!1,isEditing:!1,showTitle:!1},inputRef:r,maxLength:i=5e4,minRows:u=4,forceShow:d={cancel:!1,error:!1},functions:a={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},props:{create:{projectNames:["questions-answers"]}}},gtmContext:l="DiscussionForm"})=>{var Q,A;const o=M.useIntl(),m=_.useContext(ke),[c,h]=_.useState(n.isEditing&&n.isEditing.text||""),[p,g]=_.useState(d.error||!1),[v,k]=_.useState(!1),S=_.useRef(null);if(r||(r=S),n.isLoading)return s.jsx(we,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const y=b=>{const Y=b.target.value;h(Y);let j;!m||!m.id?j=ye(o.formatMessage,`${xe}error_loggedOut`,e.type,"action"):t?Y.length>=i&&(j=`${xe}error_tooLong`):j=ye(o.formatMessage,`${xe}error_noPermission`,e.type,"action"),j?g(j):p&&g(!1)};let x=`${e.type}-form`;if(e.type==="response"||e.type==="reply"){const b=e.type==="response"?((Q=e.slugs)==null?void 0:Q.question)||"":((A=e.slugs)==null?void 0:A.answer)||"";b&&(x=`${x}-${b.slice(-15)}`)}const C=async b=>{var j;if(b.preventDefault(),b.stopPropagation(),!m||!m.id||!t||P)return;ut&&clearTimeout(ut),k("submitting");const Y=window.location.pathname;try{let w;switch(e.type){case"post":w=await a.create({content:c});break;case"question":w=await a.create({title:c,authorId:m&&m.id,...(j=a.props)==null?void 0:j.create});break;case"response":w=await a.create({question:e.slugs.question},{body:c,authorId:m&&m.id,contentPath:Y});break;case"reply":w=await a.create({question:e.slugs.question,answer:e.slugs.answer},{body:c,authorId:m&&m.id,contentPath:Y});break;default:break}await Ks(1e3),a.callback&&await a.callback(w),ut=setTimeout(()=>{h(""),k("submitted"),D()},500)}catch(w){const V=w;let X=`${xe}error`;V.message.includes("entry already exists")&&(X=ye(o.formatMessage,`${xe}error_alreadyExists`,e.type,"action")),V.message.includes("429")?X=ye(o.formatMessage,`${xe}error_tooMany`,e.type,"action"):V.message.includes("400")&&(X=`${xe}error`),g(X),D()}},D=()=>{ut=setTimeout(()=>{g(!1),k(!1)},5e3)},P=!c||!Zs(c),G=v==="submitting",L=[];return(n.isEditing&&!G||d.cancel)&&L.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:a.handleCancel,className:"gtm-trackable","data-gtm-event-context":l,"data-gtm-event-type":`cancel-${e.type}-click`,disabled:!d.cancel&&(!m||!m.id||!c),children:o.formatMessage({id:`${xe}cancel`})}),L.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:b=>{if(n.isEditing){k("submitting"),a.handleSaveEdit&&a.handleSaveEdit(S.current&&"value"in S.current?S.current.value:"");return}C(b)},className:"gtm-trackable","data-gtm-event-context":l,"data-gtm-event-type":`${n.isEditing?"save":"submit"}-${e.type}-click`,"data-testid":"save-button",disabled:!m||!m.id||!t||P||G||n.isEditing&&c===n.isEditing.text,children:o.formatMessage({id:`${xe}${G?n.isEditing?"saving":"posting":n.isEditing?"save":"post"}`})}),s.jsxs("form",{id:x,className:$("discussion-card discussion-form",{"no-styling":n.isInWrapper&&n.isEditing}),"data-testid":`discussion-${e.type}-form`,children:[(n==null?void 0:n.showTitle)&&!n.isEditing&&["question"].includes(e.type)&&s.jsx("h2",{children:ye(o.formatMessage,`${xe}title`,e.type,"action")}),s.jsx(vt,{member:m||"community",gtmContext:l,gtmType:"profile-click"}),s.jsx(ue,{element:"label",showOnFocus:!1,htmlFor:`${x}-input`,children:ye(o.formatMessage,`${xe}label`,e.type,"action")}),s.jsx(As,{ref:r,id:`${x}-input`,name:e.type,placeholder:ye(o.formatMessage,`${xe}placeholder`,e.type,"action"),onChange:y,value:c,maxLength:i,"aria-invalid":!!p,"aria-errormessage":"error-message",minRows:u,autoFocus:!!n.isEditing}),s.jsx("small",{children:ye(o.formatMessage,`${xe}explainer`,e.type,"action",{a:b=>s.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":l,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:b})})}),s.jsx(Ze,{buttons:L}),v==="submitted"&&s.jsx(ht,{className:"success","data-testid":"success",children:ye(o.formatMessage,`${xe}success`,e.type,"action")}),p&&s.jsx(ht,{id:"error-message",className:"error","data-testid":"error",children:d.error?d.error:typeof p=="string"?p.includes(" ")?p:o.formatMessage({id:p},{action:o.formatMessage({id:`discussion_action_${e.type}`}),maxLength:i}):p})]})},wt=({contentType:e,createPost:t,membershipRequiredToPost:{isMember:n,required:r,join:i,leave:u,notMemberStateText:d}})=>r&&!n?s.jsx(Ke,{text:d,button:{breakpoints:{mobile:!0,901:!1},component:s.jsx(Zt,{isShort:!0,functions:{join:i,leave:u}})}}):s.jsx(sn,{content:{type:e,slugs:{}},functions:{create:t}}),Xr={showThread:!1,showForm:!1},et=_.createContext(Xr),us=({children:e})=>{const[t,n]=_.useState({showThread:!1,showForm:!1});return s.jsx(et.Provider,{value:{...t,updateConversation:n},children:e})},Zr=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),qr=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);let Ve=!1;const It=()=>{Ve!==!1&&(clearTimeout(Ve),Ve=!1)},Lt=5,ds=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:i=!1,content:u={type:"reply",slugs:{}},canLike:d=!0,functions:{createLike:a=()=>{},deleteLike:l=()=>{}}={}})=>{const o=M.useIntl();_.useEffect(()=>{p(i)},[i]);const[m,c]=_.useState(t),[h,p]=_.useState(i),[g,v]=_.useState(!1),[k,S]=_.useState(!1),y=_.useMemo(()=>qr(n,Lt),[n]),x=D=>{if(D.preventDefault(),D.stopPropagation(),S(!1),Ve)return It(),!1;if(It(),g||!d)return!1;Ve=setTimeout(C,350)},C=async()=>{if(It(),g||!d)return!1;let D=h?m-1:m+1;D<0&&(D=0),v(!0),c(D),p(!h);try{if(u&&u.slugs){const P=Zr(u.slugs);h?await l(P):await a(P,{contentPath:window.location.pathname})}}catch{c(t),p(i)}finally{v(!1)}};return _.createElement(e,{className:$("likes-wrapper text-medium action-button",{"show-spinner":g,"is-liked":h,disabled:!d}),onClick:x,onMouseEnter:()=>{S(!0)},onMouseLeave:()=>{S(!1)},onFocus:()=>{S(!0)},onBlur:()=>{S(!1)},children:s.jsxs(s.Fragment,{children:[s.jsx(H,{variant:"tertiary",size:"medium",icon:{icon:h?"heart":"heart_empty",animate:"bounce"},className:$({"do-animation":h&&!i}),screenreaderText:d?o.formatMessage({id:`discussion_likes_${h?"unlike":"like"}`},{action:o.formatMessage({id:`discussion_action_${u.type}`})}):!1,onClick:x,disabled:!d,"aria-hidden":!d,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${u.type}-click`}),s.jsx("span",{className:$("number-of-likes",{"no-likes":m===0}),"data-testid":"number-of-likes",children:o.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:m})}),n&&s.jsx(On,{isOpen:k,isLoading:n.length===0,children:n.length&&s.jsxs("ul",{children:[y.map(D=>typeof D=="string"||!D.name?null:s.jsx("li",{children:s.jsx(qe,{href:D.id?`/profiles/${D.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onClick:P=>P==null?void 0:P.stopPropagation(),children:D.name})},D.id||window.btoa(D.name))),n.length>Lt&&s.jsx("li",{children:o.formatMessage({id:"discussion_likes_more"},{number:n.length-Lt})})]})})]})})},En=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},rn=(e,t)=>e&&!t;const Se="discussion_",Kr=280,tt=({element:e="div",content:t,userHasPermissions:n=!0,isLoading:r=!1,originalAuthorId:i,functions:{content:{createContent:u,deleteContent:d,updateContent:a}={createContent:()=>{},deleteContent:()=>{},updateContent:()=>{}},likes:{createLike:l,deleteLike:o}={createLike:()=>{},deleteLike:()=>{}},comments:{openComments:m}={openComments:()=>{}}},links:c={},className:h,gtmContext:p="DiscussionAnswer",children:g,isTruncated:v=!1})=>{const k=M.useIntl(),S=_.useContext(ke),y=_.useContext(et),[x,C]=_.useState({body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1}),[D,P]=_.useState(!1),[G,L]=_.useState("");if(_.useEffect(()=>{C({...x,body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),r||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question))return s.jsx(we,{className:"discussion-card discussion-post"});const{author:Q,canLike:A,createdAt:b,id:Y,likes:j=0,userLiked:w,comments:V=0}=t,X=v?Le(x.body,Kr):x.body,ne=S&&S.id&&typeof Q!="string"&&Q.id&&Q.id===S.id||!1,se=typeof A=="boolean"?A:n?!ne:!1,re=async F=>{F||(F=""),L("");try{if(!Fs(F,x.body)){const ae=t.type==="question"?{title:F}:{body:F};await a(En(t.slugs),ae)}C({body:F,isEditing:!1,didEdit:!0})}catch{L(`${Se}form_error`)}},q=()=>{y&&y.updateConversation&&y.updateConversation({showThread:!0,showForm:!0}),setTimeout(()=>{const ae=`reply-form-${(t.type==="answer"?t.slug:t.slugs.answer||"").toLowerCase().slice(-15)}`,me=document.getElementById(ae),oe=document.getElementById(`${ae}-input`);oe&&oe.focus(),me&&me.scrollIntoView({behavior:"smooth"})},0)},de=()=>{P(!1);try{d(En(t.slugs))}catch{L("delete-error")}},ce=[{text:k.formatMessage({id:`${Se}moreMenu_report`}),href:`mailto:community@apolitical.co?subject=${encodeURI(k.formatMessage({id:`${Se}report_subject`}))}&body=${encodeURI(k.formatMessage({id:`${Se}report_body`},{contentType:t.type||"",contentSlug:t.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}))}`,icon:"flag"}];return n&&ne&&ce.push({text:k.formatMessage({id:`${Se}moreMenu_edit`}),onClick:()=>C({...x,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`edit-${t.type}-click`},{text:k.formatMessage({id:`${Se}moreMenu_delete`}),onClick:F=>{F.preventDefault(),F.stopPropagation(),P(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`delete-${t.type}-click`,...cs(`delete-${t.slug}-modal`,D)}),_.createElement(e,{className:$("discussion-post",h),"data-testid":`discussion-${t.type}-thread`,children:s.jsxs(s.Fragment,{children:[s.jsxs("div",{id:Y||t.slug,className:$("discussion-card",t.type,{editing:x.isEditing,"has-link":c.post&&!x.isEditing}),onClick:F=>{!c.post||x.isEditing||(F.preventDefault(),F.stopPropagation(),window.location.href=c.post)},children:[!x.isEditing&&s.jsx(vt,{member:Q,additionalContent:{createdAt:b,didEdit:x.didEdit},className:typeof Q!="string"&&Q.id===i?"highlighted":"",gtmContext:p,gtmType:"profile-click"}),x.isEditing?s.jsx(sn,{content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:r,isInWrapper:!0,isEditing:{text:x.body}},maxLength:t.type==="question"?250:5e4,forceShow:{error:G!==""&&G!=="delete-error"?k.formatMessage({id:G},{action:k.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:u,handleSaveEdit:re,handleCancel:()=>{L(""),C({...x,isEditing:!1})}},gtmContext:`${p}Form`}):c.post?s.jsx("a",{href:c.post,className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":"title-click",children:s.jsx(Ut,{options:{overrides:{a:Un}},children:X})}):s.jsx(Ut,{options:{wrapper:t.type==="question"?"h1":_.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question"},children:X}),!x.isEditing&&s.jsxs("ul",{className:$("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[s.jsx(ds,{element:"li",likes:j,isShort:!1,userLiked:w,content:{type:t.type,slugs:t.slugs},canLike:se,peopleWhoLiked:t.peopleWhoLiked,functions:{createLike:l,deleteLike:o}}),(["question","post"].includes(t.type)||c.comments||typeof m=="function")&&s.jsxs("li",{className:"action-button",onClick:F=>{F.preventDefault(),F.stopPropagation(),c.comments&&(window.location.href=c.comments),typeof m=="function"&&m()},children:[s.jsx(H,{variant:"tertiary",size:"medium",styling:{muted:!0},icon:{icon:"speech-bubble_square_thick"},href:c.comments?c.comments:!1,onClick:c.comments||typeof m!="function"?!1:m,className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:k.formatMessage({id:`${Se}comments_screenReader`},{count:V})}),s.jsx("span",{children:k.formatMessage({id:`${Se}comments`},{count:V})})]}),(t.type==="answer"||t.type==="reply")&&s.jsx("li",{children:s.jsx(H,{variant:"tertiary",size:"medium",styling:{muted:!0},onClick:q,children:k.formatMessage({id:`${Se}reply`})})}),s.jsx(Kn,{element:"li",id:`more-${t.slug}`,options:ce})]})]}),g,s.jsx(nn,{id:`delete-${t.slug}-modal`,isOpen:D,functions:{onOpen:()=>{},onClose:()=>P(!1)},forceShow:{error:G==="delete-error"?k.formatMessage({id:"discussion_delete_error"},{action:k.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:k.formatMessage({id:"discussion_delete_title"},{action:k.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>P(!1),children:k.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:de,children:k.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:s.jsx(M.FormattedMessage,{id:"discussion_delete_text",values:{p:F=>s.jsx("p",{children:F}),action:k.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const Bt="discussion_responses_",ea=({type:e="answer",responses:t=0})=>{const n=M.useIntl();return s.jsxs("div",{className:"responses-heading",children:[s.jsx("h3",{children:n.formatMessage({id:`${Bt}title`},{action:n.formatMessage({id:`${Bt}${e}`}),count:t})}),t===0&&s.jsx("p",{children:ye(n.formatMessage,`${Bt}empty`,e,e)})]})};const ms=({count:e=0,showRepliesButton:t=!0,children:n})=>{const r=M.useIntl(),i=_.useRef(null),u=_.useContext(et),[d,a]=_.useState("closed");_.useEffect(()=>{const c=i.current;if(c)return c.addEventListener("transitionend",l),()=>{c.removeEventListener("transitionend",l)}},[]),De(()=>{d==="closed"&&!u.showThread||a(["opening","open"].includes(d)?"ready-to-close":"opening")},[u.showThread]),_.useEffect(()=>{d==="ready-to-close"&&a("closing")},[d]);const l=({propertyName:c})=>{c==="max-height"&&a(h=>h==="opening"?"open":h==="closing"?"closed":h)},o=["opening","open"].includes(d),m=ft(n,{element:"li"});return s.jsxs("div",{className:"thread-wrapper",children:[t&&s.jsx(H,{variant:"secondary",size:"small",styling:{muted:!0},icon:{icon:`arrow_corner-down_${o?"left":"right"}`},onClick:()=>{var c;(c=u.updateConversation)==null||c.call(u,h=>({showThread:!h.showThread,showForm:!1}))},children:r.formatMessage({id:`discussion_thread_${o?"hide":"show"}`},{count:e})}),s.jsx("ul",{ref:i,className:$("thread",d),hidden:!u.showThread,children:m})]})},ta=({user:e,content:t,verb:n="post"})=>({actor:{id:e.id,data:{name:e.name,organization:e==null?void 0:e.organization,jobTitle:e==null?void 0:e.jobTitle}},content:t,latest_reactions:{like:[]},reaction_counts:{like:0},verb:n}),na=({queryClient:e,queryKey:t,user:n,mutationFn:r})=>({mutationFn:r,onMutate:async({content:a})=>{if(!n)return;const l=ta({user:n,content:a,verb:"post"});await e.cancelQueries({queryKey:t});const o=e.getQueryData(t);return e.setQueryData(t,m=>[...m,l]),{previousActivities:o}},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivities)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),sa=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityInfo:d,content:{body:a}})=>{if(a.length===0)return;await e.cancelQueries({queryKey:t});const l=e.getQueryData(t),o=l==null?void 0:l.map(m=>((m==null?void 0:m.id)===(d==null?void 0:d.activityId)&&(m.content=a),m));return e.setQueryData(t,()=>o&&[...o]),{previousActivities:o}},onError:(d,a,l)=>{e.setQueryData(t,l.previousActivities)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),ra=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityId:d})=>{await e.cancelQueries({queryKey:t});const a=e.getQueryData(t),l=a==null?void 0:a.filter(o=>(o==null?void 0:o.id)!==d);return e.setQueryData(t,()=>l&&[...l]),{previousActivities:l}},onError:(d,a,l)=>{e.setQueryData(t,l.previousActivities)},onSettled:(d,a,l)=>{e.invalidateQueries({queryKey:[...t,l.activityId]})}}),aa=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityId:a})=>{await e.cancelQueries({queryKey:t});const l=e.getQueryData(t),o=l==null?void 0:l.map(m=>{var c;return(m==null?void 0:m.id)===a&&((c=m.reaction_counts)!=null&&c.like?m.reaction_counts.like+=1:m.reaction_counts.like=1),m});return e.setQueryData(t,()=>o&&[...o]),{previousActivities:o}},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivities)},onSuccess:a=>{const l=e.getQueryData(t),o=l==null?void 0:l.map(m=>{var c,h;return(m==null?void 0:m.id)===(a==null?void 0:a.activity_id)&&((c=m.own_reactions)!=null&&c.like?m.own_reactions.like.push(a):m.own_reactions.like=[a],(h=m.latest_reactions)!=null&&h.like?m.latest_reactions.like.push(a):m.own_reactions.like=[a]),m});return e.setQueryData(t,()=>o&&[...o]),{previousActivities:l}},onSettled:(a,l,o)=>{e.invalidateQueries({queryKey:[...t,o.activityId]})}}),oa=({queryClient:e,queryKey:t,user:n,mutationFn:r})=>({mutationFn:r,onMutate:async({activityId:l})=>{await e.cancelQueries({queryKey:t});const o=e.getQueryData(t),m=o==null?void 0:o.map(c=>{var h;return(c==null?void 0:c.id)===l&&(h=c.reaction_counts)!=null&&h.like&&(c.reaction_counts.like-=1),c});return e.setQueryData(t,()=>m&&[...m]),{previousActivities:m}},onError:(l,o,m)=>{e.setQueryData(t,m.previousActivities)},onSuccess:(l,{activityId:o})=>{const m=e.getQueryData(t),c=m==null?void 0:m.map(h=>{var p,g,v,k,S;if(h.id===o){const y=(v=(g=(p=h.own_reactions)==null?void 0:p.like)==null?void 0:g.find(x=>x.user_id===(n==null?void 0:n.id)))==null?void 0:v.id;return h.own_reactions.like=(k=h.own_reactions.like)==null?void 0:k.filter(x=>x.id!==y),h.latest_reactions.like=(S=h.latest_reactions.like)==null?void 0:S.filter(x=>x.id!==y),h}else return h});return e.setQueryData(t,()=>c&&[...c]),{previousActivities:m}},onSettled:(l,o,m)=>{e.invalidateQueries({queryKey:[...t,m.activityId]})}}),ia=({basePath:e,parentId:t,isMember:n,functions:{list:r,create:i,edit:u,remove:d,like:a,unlike:l,join:o,leave:m}})=>{const c=M.useIntl(),h=z.useQueryClient(),p=_.useContext(ke),{data:g,error:v,isLoading:k,isFetching:S}=z.useQuery({queryKey:[e,t],queryFn:r}),y=na({queryClient:h,queryKey:[e,t],user:p,mutationFn:i}),{mutate:x}=z.useMutation(y),C=sa({queryClient:h,queryKey:[e,t],mutationFn:async w=>await u(w)}),{mutate:D}=z.useMutation(C),P=ra({queryClient:h,queryKey:[e,t],mutationFn:async({activityId:w})=>await d({activityId:w})}),{mutate:G}=z.useMutation(P),L=aa({queryClient:h,queryKey:[e,t],mutationFn:a}),{mutate:Q}=z.useMutation(L),A=oa({queryClient:h,queryKey:[e,t],user:p,mutationFn:async({activityId:w})=>{var ne,se,re;const V=g&&(g==null?void 0:g.find(q=>q.id===w)),X=(re=(se=(ne=V==null?void 0:V.own_reactions)==null?void 0:ne.like)==null?void 0:se.find(q=>q.user_id===(p==null?void 0:p.id)))==null?void 0:re.id;await l({reactionId:X||"",activityId:w})}}),{mutate:b}=z.useMutation(A),Y=_.useCallback(({activityId:w})=>Q({activityId:w}),[Q]),j=_.useCallback(({activityId:w})=>b({activityId:w}),[b]);return v?s.jsx(Ke,{variant:"error",text:v.message}):k?s.jsx(we,{style:{height:"400px"}}):s.jsxs("section",{children:[s.jsx(wt,{contentType:"post",createPost:x,membershipRequiredToPost:{isMember:n,required:!0,join:o,leave:m,notMemberStateText:c.formatMessage({id:"community_joinToPost"})}}),!S&&Array.isArray(g)&&(g==null?void 0:g.map(w=>{var ne,se,re,q,de,ce,F,ae,me,oe,pe,fe,ge,he;const V=((ne=w==null?void 0:w.actor)==null?void 0:ne.id)===(p==null?void 0:p.id),X=rn(n,V);return s.jsxs(_.Fragment,{children:[s.jsx(tt,{content:{type:"post",body:w==null?void 0:w.content,canLike:X,createdAt:(w==null?void 0:w.time)||"",slugs:{parentId:t,activityId:w==null?void 0:w.id},slug:w==null?void 0:w.id,author:{id:(se=w==null?void 0:w.actor)==null?void 0:se.id,name:`${(q=(re=w==null?void 0:w.actor)==null?void 0:re.data)==null?void 0:q.name}`,organization:(ce=(de=w==null?void 0:w.actor)==null?void 0:de.data)==null?void 0:ce.organization,jobTitle:(ae=(F=w==null?void 0:w.actor)==null?void 0:F.data)==null?void 0:ae.jobTitle,image:{thumbnail:((oe=(me=w==null?void 0:w.actor)==null?void 0:me.data)==null?void 0:oe.thumbnail)||void 0}},userLiked:((pe=w==null?void 0:w.own_reactions)==null?void 0:pe.like)&&((fe=w==null?void 0:w.own_reactions)==null?void 0:fe.like.length)>0,likes:(w==null?void 0:w.reaction_counts.like)||0,comments:(w==null?void 0:w.reaction_counts.reply)||0,peopleWhoLiked:((ge=w==null?void 0:w.latest_reactions)==null?void 0:ge.like)&&((he=w==null?void 0:w.latest_reactions)==null?void 0:he.like.map(B=>{var J,ie;return{id:B==null?void 0:B.user_id,name:(ie=(J=B==null?void 0:B.user)==null?void 0:J.data)==null?void 0:ie.name}}))},links:{post:`${e}/${t}/${w==null?void 0:w.id}`,comments:`${e}/${t}/${w==null?void 0:w.id}`},functions:{content:{createContent:()=>null,deleteContent:B=>G(B),updateContent:(B,J)=>D({activityInfo:B,content:J})},likes:{createLike:()=>{Y({activityId:w==null?void 0:w.id})},deleteLike:()=>{j({activityId:w==null?void 0:w.id})}},comments:{openComments:()=>null}},isTruncated:!0}),s.jsx(Re,{})]},w==null?void 0:w.id)}))]})},ca=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async()=>{await e.cancelQueries({queryKey:t})},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivity)},onSuccess:a=>{var o;const l=e.getQueryData(t);if(l)return(o=l==null?void 0:l.latest_reactions)!=null&&o.reply?(l.latest_reactions.reply.unshift(a),l&&(l.reaction_counts={reply:l.latest_reactions.reply.length})):(l.latest_reactions={reply:[a]},l.reaction_counts={reply:1}),e.setQueryData(t,()=>({...l})),{previousActivity:l}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),la=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({replyInfo:u,content:{body:d}})=>{var o,m,c;if(d.length===0)return;await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);if(!a||!((o=a==null?void 0:a.latest_reactions)!=null&&o.reply))return;const l=(c=(m=a==null?void 0:a.latest_reactions)==null?void 0:m.reply)==null?void 0:c.map(h=>(h.id===u.replySlug&&(h.data.content=d),h));return e.setQueryData(t,()=>({...a,latest_reactions:{reply:l}})),{previousActivity:a}},onError:(u,d,a)=>{e.setQueryData(t,a.previousActivity)}}),ua=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({replyId:u})=>{var l,o,m;await e.cancelQueries({queryKey:t});const d=e.getQueryData(t);if(!d||!((l=d==null?void 0:d.latest_reactions)!=null&&l.reply))return;const a=(m=(o=d==null?void 0:d.latest_reactions)==null?void 0:o.reply)==null?void 0:m.filter(c=>c.id!==u);return e.setQueryData(t,()=>({...d,latest_reactions:{reply:a}})),{previousActivity:d}},onError:(u,d,a)=>{e.setQueryData(t,a.previousActivity)}}),da=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({replyId:d})=>{var o,m;await e.cancelQueries({queryKey:t});const a=e.getQueryData(t),l=(m=(o=a==null?void 0:a.latest_reactions)==null?void 0:o.reply)==null?void 0:m.map(c=>{var h;return c.id===d&&((h=c.children_counts)!=null&&h.like?c.children_counts.like+=1:c.children_counts={like:1}),c});return e.setQueryData(t,()=>({...a,latest_reactions:{reply:l}})),{previousActivity:a}},onError:(d,a,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:d=>{var o;const a=e.getQueryData(t),l=(o=a==null?void 0:a.latest_reactions.reply)==null?void 0:o.map(m=>{var c,h;return m.id===d.id&&((c=m.own_children)!=null&&c.like?m.own_children.like.push(d):m.own_children={like:[d]},(h=m.latest_children)!=null&&h.like?m.latest_children.like.push(d):m.latest_children={like:[d]}),m});return e.setQueryData(t,()=>({...a,latest_reactions:{reply:l}})),{previousActivity:a}}}),ma=({queryClient:e,queryKey:t,user:n,mutationFn:r})=>({mutationFn:r,onMutate:async({replyId:a})=>{var m;await e.cancelQueries({queryKey:t});const l=e.getQueryData(t);if(!l)return;const o=(m=l.latest_reactions.reply)==null?void 0:m.map(c=>(c.id===a&&c.children_counts.like&&(c.children_counts.like-=1),c));return e.setQueryData(t,()=>({...l,latest_reactions:{reply:o}})),{previousActivity:l}},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivity)},onSuccess:(a,{replyId:l})=>{var c;const o=e.getQueryData(t);if(!o)return;const m=(c=o.latest_reactions.reply)==null?void 0:c.map(h=>{var p,g,v;if(h.id===l){let k=(p=h.latest_children.reply)==null?void 0:p.filter(S=>S.user_id!==(n==null?void 0:n.id));return k=(v=(g=h==null?void 0:h.own_children)==null?void 0:g.reply)==null?void 0:v.filter(S=>S.user_id!==(n==null?void 0:n.id)),k}return h});return e.setQueryData(t,()=>({...o,latest_reactions:{reply:m}})),{previousActivity:o}}}),fa=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async()=>{await e.cancelQueries({queryKey:t})},onSuccess:a=>{var m;const l=e.getQueryData(t),o=(m=l==null?void 0:l.latest_reactions.reply)==null?void 0:m.map(c=>(c.id===a.parent&&(c.latest_children.reply&&c.children_counts.reply?(c.latest_children.reply.push(a),c.children_counts.reply+=1):(c.latest_children.reply=[a],c.children_counts.reply=1)),c));return e.setQueryData(t,()=>({...l,latest_reactions:{reply:o}})),{previousActivity:l}},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivity)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),ha=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onError:(u,d,a)=>{e.setQueryData(t,a.previousActivity)},onMutate:async({replyInfo:u,content:{body:d}})=>{var o,m,c;if(d.length===0)return;await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);if(!a||!((o=a==null?void 0:a.latest_reactions)!=null&&o.reply))return;const l=(c=(m=a==null?void 0:a.latest_reactions)==null?void 0:m.reply)==null?void 0:c.map(h=>{var p;return h.id===u.replyParentId&&((p=h.latest_children.reply)==null||p.map(g=>(g.id===u.replySlug&&(g.data.content=d),g))),h});return e.setQueryData(t,()=>({...a,latest_reactions:{reply:l}})),{previousActivity:a}}}),pa=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onError:(u,d,a)=>{e.setQueryData(t,a.previousActivity)},onMutate:async({replyId:u,replyParentId:d})=>{var o,m,c;await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);if(!a||!((o=a==null?void 0:a.latest_reactions)!=null&&o.reply))return;const l=(c=(m=a==null?void 0:a.latest_reactions)==null?void 0:m.reply)==null?void 0:c.map(h=>{var p,g;return h.id===d&&(h.latest_children.reply=(p=h.latest_children.reply)==null?void 0:p.filter(v=>v.id!==u),(g=h.children_counts)!=null&&g.reply&&(h.children_counts.reply-=1)),h});return e.setQueryData(t,()=>({...a,latest_reactions:{reply:l}})),{previousActivity:a}}}),ga=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({replyId:d,replyParentId:a})=>{var m;await e.cancelQueries({queryKey:t});const l=e.getQueryData(t),o=(m=l==null?void 0:l.latest_reactions.reply)==null?void 0:m.map(c=>{var h;return c.id===a&&((h=c.latest_children.reply)==null||h.map(p=>{var g;return p.id===d&&((g=p.children_counts)!=null&&g.like?p.children_counts.like+=1:p.children_counts={like:1}),p})),c});return e.setQueryData(t,()=>({...l,latest_reactions:{reply:o}})),{previousActivity:l}},onError:(d,a,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:(d,a)=>{var m;const l=e.getQueryData(t),o=(m=l==null?void 0:l.latest_reactions.reply)==null?void 0:m.map(c=>{var h;return c.id===a.replyParentId&&((h=c.latest_children.reply)==null||h.map(p=>(p.id===a.replyId&&(p.latest_children=p.latest_children||{},p.own_children=p.own_children||{},p.latest_children.like=p.latest_children.like||[],p.own_children.like=p.own_children.like||[],p.latest_children.like.push(d),p.own_children.like.push(d)),p))),c});return e.setQueryData(t,()=>({...l,latest_reactions:{reply:o}})),{previousActivity:l}}}),_a=({queryClient:e,queryKey:t,mutationFn:n,user:r})=>({mutationFn:n,onMutate:async({replyId:a,replyParentId:l})=>{var c;await e.cancelQueries({queryKey:t});const o=e.getQueryData(t),m=(c=o==null?void 0:o.latest_reactions.reply)==null?void 0:c.map(h=>{var p;return h.id===l&&((p=h.latest_children.reply)==null||p.map(g=>{var v;return g.id===a&&((v=g.children_counts)!=null&&v.like?g.children_counts.like-=1:g.children_counts={like:0}),g})),h});return e.setQueryData(t,()=>({...o,latest_reactions:{reply:m}})),{previousActivity:o}},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivity)},onSuccess:(a,l)=>{var c;const o=e.getQueryData(t),m=(c=o==null?void 0:o.latest_reactions.reply)==null?void 0:c.map(h=>{var p;return h.id===l.replyParentId&&((p=h.latest_children.reply)==null||p.map(g=>{var v,k;return g.id===l.replyId&&((v=g.own_children)!=null&&v.like&&(g.own_children.like=g.own_children.like.filter(S=>S.user_id!==(r==null?void 0:r.id))),(k=g.latest_children)!=null&&k.like&&(g.latest_children.like=g.latest_children.like.filter(S=>S.user_id!==(r==null?void 0:r.id)))),g})),h});return e.setQueryData(t,()=>({...o,latest_reactions:{reply:m}})),{previousActivity:o}}}),xa=({basePath:e,parentId:t,replyParentId:n,activityId:r,replyCount:i,replies:u,functions:{create:d,edit:a,remove:l,join:o,leave:m,like:c,unlike:h}})=>{const p=M.useIntl(),g=z.useQueryClient(),v=_.useContext(ke),k=_.useContext(et),S=fa({queryClient:g,queryKey:[e,t,r],mutationFn:async j=>d({replyId:n,content:j.body})}),{mutate:y}=z.useMutation(S),x=ha({queryClient:g,queryKey:[e,t,r],mutationFn:a}),{mutate:C}=z.useMutation(x),D=pa({queryClient:g,queryKey:[e,t,r],mutationFn:async({replyId:j})=>l({replyId:j})}),{mutate:P}=z.useMutation(D),G=ga({queryClient:g,queryKey:[e,t,r],mutationFn:c}),{mutate:L}=z.useMutation(G),Q=_a({queryClient:g,queryKey:[e,t,r],user:v,mutationFn:h}),{mutate:A}=z.useMutation(Q),b=_.useCallback(({replyId:j,replyParentId:w})=>L({replyId:j,replyParentId:w}),[L]),Y=_.useCallback(({replyId:j,replyParentId:w})=>A({replyId:j,replyParentId:w}),[A]);return s.jsx(ms,{count:i,showRepliesButton:i>0||k.showForm,children:s.jsxs(s.Fragment,{children:[k.showForm&&s.jsx(wt,{contentType:"reply",createPost:(j,w)=>y(w),membershipRequiredToPost:{isMember:!0,required:!0,join:o,leave:m,notMemberStateText:p.formatMessage({id:"community_joinToPost"})}}),(u==null?void 0:u.length)===0||(u==null?void 0:u.map(j=>{var w,V,X,ne,se,re,q,de,ce,F,ae,me,oe,pe,fe,ge,he;return s.jsx(tt,{content:{type:"reply",body:typeof j.data.content=="string"?(w=j==null?void 0:j.data)==null?void 0:w.content:((X=(V=j==null?void 0:j.data)==null?void 0:V.content)==null?void 0:X.text)||"",createdAt:j==null?void 0:j.created_at,slugs:{parentId:t,activityId:r,replyParentId:j==null?void 0:j.parent,reply:j==null?void 0:j.id},slug:"",author:{id:(ne=j==null?void 0:j.user)==null?void 0:ne.id,name:(re=(se=j==null?void 0:j.user)==null?void 0:se.data)==null?void 0:re.name,organization:(de=(q=j==null?void 0:j.user)==null?void 0:q.data)==null?void 0:de.organization,jobTitle:(F=(ce=j==null?void 0:j.user)==null?void 0:ce.data)==null?void 0:F.jobTitle,image:{thumbnail:((me=(ae=j==null?void 0:j.user)==null?void 0:ae.data)==null?void 0:me.thumbnail)||void 0}},userLiked:((oe=j==null?void 0:j.own_children)==null?void 0:oe.like)&&((pe=j==null?void 0:j.own_children)==null?void 0:pe.like.length)>0,likes:((fe=j==null?void 0:j.children_counts)==null?void 0:fe.like)||0,peopleWhoLiked:((ge=j==null?void 0:j.latest_children)==null?void 0:ge.like)&&((he=j==null?void 0:j.latest_children)==null?void 0:he.like.map(B=>{var J,ie;return{id:B==null?void 0:B.user_id,name:(ie=(J=B==null?void 0:B.user)==null?void 0:J.data)==null?void 0:ie.name}}))},functions:{content:{createContent:()=>console.log("create"),deleteContent:B=>{const{replySlug:J,replyParentId:ie}=B;return P({replyId:J,replyParentId:ie})},updateContent:(B,J)=>C({replyInfo:B,content:J})},likes:{createLike:()=>b({replyId:j==null?void 0:j.id,replyParentId:j==null?void 0:j.parent}),deleteLike:()=>{var J,ie,K;const B=((J=j==null?void 0:j.own_children)==null?void 0:J.like)&&((K=(ie=j==null?void 0:j.own_children)==null?void 0:ie.like[0])==null?void 0:K.id);return Y({replyId:B||""})}},comments:{}}},j==null?void 0:j.id)}))]})})},fs=({basePath:e,parentId:t,activityId:n,repliesList:r,isMember:i,functions:{create:u,edit:d,remove:a,like:l,unlike:o,join:m,leave:c}})=>{const h=M.useIntl(),p=z.useQueryClient(),g=_.useContext(ke),v=ca({queryClient:p,queryKey:[e,t,n],mutationFn:async b=>u({activityId:n,content:b.body})}),{mutate:k}=z.useMutation(v),S=la({queryClient:p,queryKey:[e,t,n],mutationFn:async b=>d(b)}),{mutate:y}=z.useMutation(S),x=ua({queryClient:p,queryKey:[e,t,n],mutationFn:async({replyId:b})=>a({replyId:b})}),{mutate:C}=z.useMutation(x),D=da({queryClient:p,queryKey:[e,t,n],mutationFn:l}),{mutate:P}=z.useMutation(D),G=ma({queryClient:p,queryKey:[e,t,n],user:g,mutationFn:o}),{mutate:L}=z.useMutation(G),Q=_.useCallback(({replyId:b})=>P({replyId:b}),[P]),A=_.useCallback(({replyId:b})=>L({replyId:b}),[L]);return Pn(),s.jsxs(s.Fragment,{children:[s.jsx(wt,{contentType:"reply",createPost:(b,Y)=>k(Y),membershipRequiredToPost:{isMember:i,required:!0,join:m,leave:c,notMemberStateText:h.formatMessage({id:"community_joinToPost"})}}),(r==null?void 0:r.length)===0||(r==null?void 0:r.map(b=>{var w,V,X,ne,se,re,q,de,ce,F,ae,me,oe,pe,fe,ge,he,B,J,ie;const Y=((w=b==null?void 0:b.user)==null?void 0:w.id)===(g==null?void 0:g.id),j=rn(i,Y);return s.jsx(us,{children:s.jsx(tt,{content:{type:"reply",body:typeof b.data.content=="string"?(V=b==null?void 0:b.data)==null?void 0:V.content:((ne=(X=b==null?void 0:b.data)==null?void 0:X.content)==null?void 0:ne.text)||"",canLike:j,createdAt:b==null?void 0:b.created_at,slugs:{question:`${e}/${t}/${n}`,parentId:t,reply:b==null?void 0:b.id},slug:b==null?void 0:b.id,author:{id:(se=b==null?void 0:b.user)==null?void 0:se.id,name:(q=(re=b==null?void 0:b.user)==null?void 0:re.data)==null?void 0:q.name,organization:(ce=(de=b==null?void 0:b.user)==null?void 0:de.data)==null?void 0:ce.organization,jobTitle:(ae=(F=b==null?void 0:b.user)==null?void 0:F.data)==null?void 0:ae.jobTitle,image:{thumbnail:((oe=(me=b==null?void 0:b.user)==null?void 0:me.data)==null?void 0:oe.thumbnail)||void 0}},userLiked:((pe=b==null?void 0:b.own_children)==null?void 0:pe.like)&&((fe=b==null?void 0:b.own_children)==null?void 0:fe.like.length)>0,likes:((ge=b==null?void 0:b.children_counts)==null?void 0:ge.like)||0,peopleWhoLiked:((he=b==null?void 0:b.latest_children)==null?void 0:he.like)&&((B=b==null?void 0:b.latest_children)==null?void 0:B.like.map(K=>{var le,be;return{id:K==null?void 0:K.user_id,name:(be=(le=K==null?void 0:K.user)==null?void 0:le.data)==null?void 0:be.name}}))},functions:{content:{createContent:()=>null,deleteContent:K=>{const{replySlug:le}=K;return C({replyId:le})},updateContent:(K,le)=>y({replyInfo:K,content:le})},likes:{createLike:()=>Q({replyId:b==null?void 0:b.id}),deleteLike:()=>{var le,be,Me;const K=((le=b==null?void 0:b.own_children)==null?void 0:le.like)&&((Me=(be=b==null?void 0:b.own_children)==null?void 0:be.like[0])==null?void 0:Me.id);return A({replyId:K||""})}},comments:{}},children:s.jsx(xa,{basePath:e,parentId:t,replyParentId:b==null?void 0:b.id,activityId:n,replyCount:((J=b==null?void 0:b.children_counts)==null?void 0:J.reply)||0,replies:(ie=b==null?void 0:b.latest_children)==null?void 0:ie.reply,isMember:i,functions:{create:u,edit:d,remove:a,like:l,unlike:o,join:m,leave:c}})},b==null?void 0:b.id)},b==null?void 0:b.id)}))]})},ba=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityInfo:d,content:{body:a}})=>{if(a.length===0)return;await e.cancelQueries({queryKey:t});const l=e.getQueryData(t);return l&&l.id===(d==null?void 0:d.activityId)&&(l.content=a),e.setQueryData(t,()=>({...l})),{previousActivity:l}},onError:(d,a,l)=>{e.setQueryData(t,l.previousActivity)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),va=({queryClient:e,queryKey:t,redirectUrl:n,mutationFn:r})=>({mutationFn:r,onSuccess:()=>{e.invalidateQueries({queryKey:t}),window.location.href=n}}),wa=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async()=>{var l;await e.cancelQueries({queryKey:t});const a=e.getQueryData(t);return(l=a==null?void 0:a.reaction_counts)!=null&&l.like?a.reaction_counts.like+=1:a&&(a.reaction_counts={like:1}),e.setQueryData(t,()=>({...a})),{previousActivity:a}},onError:(a,l,o)=>{e.setQueryData(t,o.previousActivity)},onSuccess:a=>{const l=e.getQueryData(t);return l!=null&&l.own_reactions.like?l.own_reactions.like.push(a):l&&(l.own_reactions={like:[a]}),l!=null&&l.latest_reactions.like?l.latest_reactions.like.push(a):l&&(l.own_reactions={like:[a]}),e.setQueryData(t,()=>({...l})),{previousActivity:l}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),ka=({queryClient:e,queryKey:t,user:n,activity:r,mutationFn:i})=>({mutationFn:i,onMutate:async()=>{var m;await e.cancelQueries({queryKey:t});const o=e.getQueryData(t);return(m=o==null?void 0:o.reaction_counts)!=null&&m.like&&o.reaction_counts.like>0&&(o.reaction_counts.like-=1),e.setQueryData(t,()=>({...o})),{previousActivity:o}},onError:(o,m,c)=>{e.setQueryData(t,c.previousActivity)},onSuccess:()=>{var c,h,p;if(!r)return;const o=(p=(h=(c=r.own_reactions)==null?void 0:c.like)==null?void 0:h.find(g=>g.user_id===(n==null?void 0:n.id)))==null?void 0:p.id,m=e.getQueryData(t);if(m!=null&&m.own_reactions.like&&(m.own_reactions.like=m.own_reactions.like.filter(g=>g.id!==o),!!(m!=null&&m.latest_reactions.like)))return m.latest_reactions.like=m.latest_reactions.like.filter(g=>g.id!==o),e.setQueryData(t,()=>({...m})),{previousActivity:m}},onSettled:()=>{e.invalidateQueries({queryKey:t})}});const ja=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{get:i,editActivity:u,removeActivity:d,likeActivity:a,unlikeActivity:l,createReply:o,editReply:m,removeReply:c,likeReply:h,unlikeReply:p,join:g,leave:v}})=>{var se,re,q,de,ce,F,ae,me,oe,pe,fe,ge,he,B,J,ie,K,le,be,Me,Oe,Ce,nt;const k=M.useIntl(),S=_.useContext(ke),y=z.useQueryClient(),{data:x,isLoading:C,isFetching:D}=z.useQuery({queryKey:[e,t,n],queryFn:i}),P=ba({queryClient:y,queryKey:[e,t,n],mutationFn:async ee=>await u(ee)}),{mutate:G}=z.useMutation(P),L=va({queryClient:y,queryKey:[e,t,n],mutationFn:async({activityId:ee})=>d({activityId:ee}),redirectUrl:`${e}/${t}`}),{mutate:Q}=z.useMutation(L),A=wa({queryClient:y,queryKey:[e,t,n],mutationFn:a}),{mutate:b}=z.useMutation(A),Y=ka({queryClient:y,queryKey:[e,t,n],user:S,mutationFn:async()=>{var je,Ne,st;const ee=(st=(Ne=(je=x==null?void 0:x.own_reactions)==null?void 0:je.like)==null?void 0:Ne.find(rt=>rt.user_id===(S==null?void 0:S.id)))==null?void 0:st.id;await l({activityId:n,reactionId:ee})},activity:x}),{mutate:j}=z.useMutation(Y),w=_.useCallback(({activityId:ee})=>b({activityId:ee}),[b]),V=_.useCallback(async({activityId:ee})=>j({activityId:ee}),[j]);if(C||D)return s.jsx(we,{style:{height:"400px"}});if(!x)return s.jsx(Ke,{variant:"error",text:k.formatMessage({id:"activitySection_notFoundError"})});const X=((se=x==null?void 0:x.actor)==null?void 0:se.id)===(S==null?void 0:S.id),ne=rn(r,X);return s.jsx(tt,{className:"activity-section",content:{type:"post",body:x==null?void 0:x.content,canLike:ne,createdAt:(x==null?void 0:x.time)||"",slugs:{question:`${t}/${n}`,parentId:t,activityId:x==null?void 0:x.id},slug:n,author:{id:(re=x==null?void 0:x.actor)==null?void 0:re.id,name:((q=x==null?void 0:x.actor)==null?void 0:q.data)&&((ce=(de=x==null?void 0:x.actor)==null?void 0:de.data)==null?void 0:ce.name),organization:((F=x==null?void 0:x.actor)==null?void 0:F.data)&&((me=(ae=x==null?void 0:x.actor)==null?void 0:ae.data)==null?void 0:me.organization),jobTitle:((oe=x==null?void 0:x.actor)==null?void 0:oe.data)&&((fe=(pe=x==null?void 0:x.actor)==null?void 0:pe.data)==null?void 0:fe.jobTitle),image:{thumbnail:((ge=x==null?void 0:x.actor)==null?void 0:ge.data)&&((B=(he=x==null?void 0:x.actor)==null?void 0:he.data)==null?void 0:B.thumbnail)||void 0}},userLiked:((J=x==null?void 0:x.own_reactions)==null?void 0:J.like)&&((ie=x==null?void 0:x.own_reactions)==null?void 0:ie.like.length)>0,likes:x&&((K=x==null?void 0:x.reaction_counts)==null?void 0:K.like),comments:x&&((le=x==null?void 0:x.reaction_counts)==null?void 0:le.reply),peopleWhoLiked:((be=x==null?void 0:x.latest_reactions)==null?void 0:be.like)&&((Me=x==null?void 0:x.latest_reactions)==null?void 0:Me.like.map(ee=>{var je,Ne;return{id:ee==null?void 0:ee.user_id,name:(Ne=(je=ee==null?void 0:ee.user)==null?void 0:je.data)==null?void 0:Ne.name}}))},originalAuthorId:(Oe=x==null?void 0:x.actor)==null?void 0:Oe.id,functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>Q({activityId:n}),updateContent:(ee,je)=>G({activityInfo:ee,content:je})},likes:{createLike:()=>w({activityId:n}),deleteLike:()=>V({activityId:n})},comments:{openComments:()=>{}}},children:s.jsxs(s.Fragment,{children:[s.jsxs("h3",{children:["Comments (",((Ce=x==null?void 0:x.reaction_counts)==null?void 0:Ce.reply)||0,")"]}),s.jsx(fs,{basePath:e,parentId:t,activityId:n,repliesList:(nt=x==null?void 0:x.latest_reactions)==null?void 0:nt.reply,isMember:r,functions:{create:o,edit:m,remove:c,like:h,unlike:p,join:g,leave:v}})]})},n)},ya=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:i}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:i}}),Ea=({type:e,data:t})=>{const n=M.useIntl(),{answers:r,createdAt:i,dateHasPassed:u,isOngoingEvent:d,pill:a,readingTime:l,publishedDate:o,startDate:m}=t;if(e==="question"){const c=i&&Qt(i);return s.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),i&&s.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:c?n.formatMessage({id:`dates_${c.path}`},{number:c.number}):0})]})]})}if(m&&!u||d)return s.jsx("p",{className:"details",children:d?n.formatMessage({id:"card_bootcamp"}):In(m)});if(a)return s.jsx(Ge,{variant:a==="free"?"subtle":"highlighted",className:a,"data-testid":"course-type",children:a});if(l||o){const c=o&&Qt(o);return s.jsxs("ul",{className:"details",children:[l&&s.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:l})}),o&&s.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:c?n.formatMessage({id:`dates_${c.path}`},{number:c.number}):0})})]})}return null},_t={customCard:{className:"custom",gtmEvent:"custom",length:{text:335,secondaryText:150}},event:{basePath:"/events/",className:"event",gtmEvent:"event"},microcourse:{basePath:"/microcourses/en/",className:"course",gtmEvent:"microcourse-overview"},solutionArticle:{basePath:"/solution-articles/en/",className:"article",length:{title:60},gtmEvent:"article"},qaQuestion:{basePath:"/questions-answers/",className:"question",length:{title:190},gtmEvent:"q-and-a-question"},listPage:{basePath:"/list/en/",className:"list",gtmEvent:"list"},people:{basePath:"/profiles/",className:"people",length:{people:1e3},gtmEvent:"person"},learningHub:{basePath:"/learning-hub/",className:"learning-hub",length:{title:190},gtmEvent:"learning-hub"}},Sa=({data:e,cta:t,link:n,gtmContext:r})=>{var g;const i=M.useIntl(),[u,d]=_.useState({loading:!1,registered:e.registered||!1});_.useEffect(()=>{e.registered&&d(v=>({...v,registered:!0}))},[e.registered]);const{startDate:a,dateHasPassed:l,pill:o,slug:m}=e,c=e.contentType;let h="";if((g=_t[c])!=null&&g.gtmEvent&&(h=_t[c].gtmEvent),a&&l)return s.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${h}-click`,children:i.formatMessage({id:"card_watch"})});if(c==="people")return s.jsx(H,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${h}-click`,children:i.formatMessage({id:"card_cta_people"})});const p=["microcourse","event"];if(t&&t.onClick&&p.includes(c)&&o!=="premium"){const v=u.loading||u.registered,k=async S=>{if(S.preventDefault(),S.stopPropagation(),!(v||!t||!t.onClick)){d(y=>({...y,loading:!0}));try{const y=await t.onClick(e);d(y==="success"?()=>({registered:!0,loading:!1}):x=>({...x,loading:!1}))}catch{d(x=>({...x,loading:!1}))}}};return s.jsx(H,{onClick:k,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:v,"data-gtm-event-context":`${r}Page-${c}: ${m}`,"data-gtm-event-type":`${r}-${c}-register-click`,"data-testid":"in-card-button",children:i.formatMessage({id:`card_cta_${c}${v?`_${u.loading?"loading":"done"}`:""}`})})}return null},Sn={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},$a=e=>{let t=e;return Object.keys(Sn).includes(e)&&(t=Sn[e]),`url(${Ye}icons/${t}.svg)`};const Ta={title:66,text:3e3,secondaryText:1e3,partner:25},Ma=({id:e="",card:t,buildCardData:n,cta:r,gtmContext:i="Carousel",className:u=""})=>{const d=M.useIntl(),a=_.useContext(ke),l=a&&typeof a.id=="string",[o,m]=_.useState({data:null,isLoading:!0}),{data:c,isLoading:h}=o,p=_.useCallback(()=>{n(t,l).then(L=>{m(()=>({data:L,isLoading:!1}))}).catch(()=>m(L=>({...L,isLoading:!1})))},[e]);if(_.useEffect(()=>{p()},[]),h||!c)return s.jsx(we,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});const{contentType:g}=c;if(!g||!_t[g])return s.jsx(we,{element:"li",className:"card-wrapper"});const{basePath:v="",className:k,length:S,gtmEvent:y}=_t[g],x=Ln(`card_label_${g}`)?d.formatMessage({id:`card_label_${g}`}):!1,C=c.slug?`${v}${c.slug}`:!1,D={...Ta,...S};let P={className:"card"};C&&(P={href:C,className:"card gtm-trackable","data-gtm-event-context":`${i}-CarouselCard`,"data-gtm-event-type":`${y}-click`,"data-testid":"link"},c.openInNewTab&&(P.target="_blank"));const G=c.customIcon?{"--custom-icon":$a(c.customIcon)}:{};return s.jsx("li",{className:$("card-wrapper text-medium",k,u,{"has-link":C,"no-link":!C,"has-custom-icon":c.customIcon,"has-image":c.banner}),style:G,"data-testid":`${g}-card`,children:_.createElement(C?"a":"div",P,s.jsxs(s.Fragment,{children:[(c.customLabel||x)&&s.jsx("small",{className:$("card-label text-small",k),children:c.customLabel||x}),c.startDate&&!c.isOngoingEvent&&s.jsx(Ge,{size:"small",variant:c.dateHasPassed?"default":"information","data-testid":"date",children:c.dateHasPassed?d.formatMessage({id:"card_ended"}):zs(c.startDate)}),c.banner?s.jsxs("p",{className:"img",children:[c.registered&&s.jsx(Ge,{size:"small",variant:"registered",children:d.formatMessage({id:"card_registered"})}),s.jsx(Yt,{image:c.banner})]}):k==="people"?s.jsx(Be,{name:c.title||"",src:c.profile,"data-testid":"people-profile-picture"}):null,c.contributors&&s.jsx(Xt,{contributors:{data:c.contributors},styling:{size:"small",showGap:k!=="question",showText:!0},"data-testid":"contributors"}),c.partner&&s.jsx("p",{className:"partners","data-testid":"partners",children:Le(c.partner.title,D.partner)}),["title","text","secondaryText"].map(L=>{const Q=c[L];if(!Q)return null;const A=Ws(L);return s.jsx("p",{className:A,"data-testid":A,children:Le(Q,D[L])},L)}),s.jsx(Ea,{type:k||"",data:c}),s.jsx(Sa,{data:c,cta:r,link:C||"",gtmContext:i})]}))})};const Ca=({cards:e,cardTypes:t,className:n="",...r})=>s.jsx("ul",{className:$("card-block",n),children:e.map((i,u)=>{const d=i.slug?`${i.slug}-${t[u]}`:`${t[u]}-${u}`;return s.jsx(Ma,{id:d,card:{...i,contentType:t[u]},...r},d)})});const $n=[{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 dt="notFoundError_",Na=()=>{const e=M.useIntl(),t=[];return $n.forEach((n,r)=>{n.title=e.formatMessage({id:`${dt}post_${r+1}`}),t.push("solutionArticle")}),s.jsxs(ls,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:s.jsxs(bt,{children:[s.jsx(Ca,{cards:$n,cardTypes:t,buildCardData:n=>new Promise((r,i)=>{r(n)})}),s.jsx(H,{href:"/solution-articles/",children:e.formatMessage({id:`${dt}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[s.jsx("h1",{children:e.formatMessage({id:`${dt}title`})}),s.jsx("p",{children:e.formatMessage({id:`${dt}text`})})]})};exports.ASSETS_BUCKET=Ye;exports.ActivitiesFeed=ia;exports.ActivitySection=ja;exports.AddPost=wt;exports.BannerSection=or;exports.Breadcrumbs=$r;exports.Button=H;exports.ButtonWrapper=Ze;exports.CacheProvider=Gn;exports.CollapsibleSection=Gt;exports.Columns=ts;exports.CommunityDetails=Sr;exports.Contributors=Xt;exports.ConversationContext=et;exports.CookieBanner=ns;exports.DiscussionConversation=us;exports.DiscussionForm=sn;exports.DiscussionLikes=ds;exports.DiscussionPost=tt;exports.DiscussionThread=ms;exports.Divider=Re;exports.DownloadSection=nr;exports.EMAILS=Fe;exports.EmailHelperTextBox=Br;exports.EmptyStateBox=Ke;exports.Filters=Tr;exports.FlagsProvider=Jn;exports.Footer=Kt;exports.FullWidthSection=bt;exports.GlobalProviders=Er;exports.Header=en;exports.HelperTextBox=Hn;exports.HiddenFromScreenReaders=zt;exports.HideShowTextBox=lr;exports.HighlightedTextBox=Te;exports.IntlProvider=Xn;exports.InviteForm=is;exports.InviteModal=zr;exports.JoinButton=Zt;exports.LanguageSwitcher=Cr;exports.Link=qe;exports.LoadMore=qn;exports.LoadingBlock=br;exports.LoadingPlaceholder=we;exports.LoadingState=vr;exports.Logo=qt;exports.LogoSection=sr;exports.MarkdownText=Ut;exports.MarketingBox=ir;exports.Member=vt;exports.MembersList=Jr;exports.Modal=tn;exports.MoreMenu=Kn;exports.NUMBER_OF_USERS=cr;exports.NavigationMenu=es;exports.NotFoundError=Na;exports.Overlay=nn;exports.PageHeading=Wn;exports.PageLayout=ls;exports.PasswordRules=Hr;exports.Pill=Ge;exports.ProfilePicture=Be;exports.ProgressBar=zn;exports.Rating=Ur;exports.RepliesFeed=fs;exports.ResponsesHeading=ea;exports.ResponsiveImage=Yt;exports.SearchForm=os;exports.ShareLinks=Ar;exports.Span=Un;exports.StatusBanner=ht;exports.Tabs=Fr;exports.Tags=Gr;exports.Tooltip=On;exports.TopLevelPage=Lr;exports.UserContext=ke;exports.UserProvider=Zn;exports.VisuallyHidden=ue;exports.addAriaProps=cs;exports.getMember=Jt;exports.headerData=Je;exports.mapGetStreamData=ya;exports.pageReady=Bn;exports.useCurrentPath=Nn;exports.useEffectAfterMount=De;exports.useElementWidth=Xe;exports.useScrollListener=Rn;exports.useScrollToHash=Pn;
package/index.mjs CHANGED
@@ -3841,33 +3841,34 @@ const oo = ({
3841
3841
  }) });
3842
3842
  };
3843
3843
  const io = ({
3844
- members: { total: e, data: t = [] },
3845
- pagination: n,
3846
- gtmContext: r = "member",
3847
- gtmType: i = "member-click",
3848
- className: d = ""
3844
+ members: { data: e = [], total: t = e.length },
3845
+ hasNextPage: n = !1,
3846
+ loadNextPage: r = () => {
3847
+ },
3848
+ gtmContext: i = "member",
3849
+ gtmType: d = "member-click",
3850
+ className: u = ""
3849
3851
  }) => {
3850
- const u = D();
3851
- return t.length === 0 ? null : (e || (e = t.length), /* @__PURE__ */ s.jsxs("div", { className: S("members-list", d), children: [
3852
+ const a = D();
3853
+ return e.length === 0 ? null : /* @__PURE__ */ s.jsxs("div", { className: S("members-list", u), children: [
3852
3854
  /* @__PURE__ */ s.jsxs("h1", { children: [
3853
- u.formatMessage({ id: "membersList" }),
3854
- /* @__PURE__ */ s.jsx("span", { className: "count", children: e })
3855
+ a.formatMessage({ id: "membersList" }),
3856
+ /* @__PURE__ */ s.jsx("span", { className: "count", children: t })
3855
3857
  ] }),
3856
- /* @__PURE__ */ s.jsx("ul", { children: t.map((a, l) => /* @__PURE__ */ s.jsxs("li", { children: [
3857
- /* @__PURE__ */ s.jsx(tn, { member: a, gtmContext: r, gtmType: i }),
3858
- a.isAdmin && /* @__PURE__ */ s.jsx(ft, { children: u.formatMessage({ id: "membersList_admin" }) })
3859
- ] }, l)) }),
3858
+ /* @__PURE__ */ s.jsx("ul", { children: e.map((l, o) => /* @__PURE__ */ s.jsxs("li", { children: [
3859
+ /* @__PURE__ */ s.jsx(tn, { member: l, gtmContext: i, gtmType: d }),
3860
+ l.isAdmin && /* @__PURE__ */ s.jsx(ft, { children: a.formatMessage({ id: "membersList_admin" }) })
3861
+ ] }, o)) }),
3860
3862
  n && /* @__PURE__ */ s.jsx(
3861
3863
  Er,
3862
3864
  {
3863
- hasNextPage: !0,
3864
- loadNextPage: () => {
3865
- },
3865
+ hasNextPage: n,
3866
+ loadNextPage: r,
3866
3867
  icon: { icon: "arrow-down", position: "right" },
3867
- gtmContext: r
3868
+ gtmContext: i
3868
3869
  }
3869
3870
  )
3870
- ] }));
3871
+ ] });
3871
3872
  };
3872
3873
  let ct = null;
3873
3874
  const ve = "discussion_form_", qn = ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "1.15.2",
3
+ "version": "1.15.3",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {