@apolitical/component-library 2.2.1 → 2.2.2-ac.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/form/components/form/form.d.ts +1 -1
- package/index.js +18 -18
- package/index.mjs +1007 -1009
- package/package.json +1 -1
- package/style.css +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),ut=require("lodash.clonedeep"),Si=require("lodash.set"),q=require("react-intl"),Ve=require("truncate"),me=require("@tanstack/react-query"),Ci=require("@tanstack/react-query-devtools"),Rt=require("posthog-js"),Ln=require("react-cookie"),Qe=require("markdown-to-jsx"),Mi=require("react-multi-email"),Kr=require("lodash.get"),$i=require("react-error-boundary"),Ni=require("react-textarea-autosize"),Pi=require("lodash.isequal");function Gr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Qr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Jr={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],i=0;i<arguments.length;i++){var s=arguments[i];if(s){var o=typeof s;if(o==="string"||o==="number")r.push(s);else if(Array.isArray(s)){if(s.length){var c=n.apply(null,s);c&&r.push(c)}}else if(o==="object"){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){r.push(s.toString());continue}for(var f in s)e.call(s,f)&&s[f]&&r.push(f)}}}return r.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(Jr);var Ri=Jr.exports;const
|
|
5
|
+
*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],i=0;i<arguments.length;i++){var s=arguments[i];if(s){var o=typeof s;if(o==="string"||o==="number")r.push(s);else if(Array.isArray(s)){if(s.length){var c=n.apply(null,s);c&&r.push(c)}}else if(o==="object"){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){r.push(s.toString());continue}for(var f in s)e.call(s,f)&&s[f]&&r.push(f)}}}return r.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(Jr);var Ri=Jr.exports;const C=Gr(Ri),Fi=({element:t="span",showOnFocus:e=!0,children:n,...r})=>g.createElement(t,{...r,className:C("hidden",{"show-on-focus":e}),children:n}),ge=g.memo(Fi),Oi=({element:t="span",children:e=null,...n})=>g.createElement(t,{...n,"aria-hidden":!0},e),Yt=g.memo(Oi);var Pn={exports:{}},rt={};/**
|
|
6
6
|
* @license React
|
|
7
7
|
* react-jsx-runtime.production.min.js
|
|
8
8
|
*
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* This source code is licensed under the MIT license found in the
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/var hr;function Di(){if(hr)return
|
|
13
|
+
*/var hr;function Di(){if(hr)return rt;hr=1;var t=g,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(c,f,l){var d,u={},m=null,p=null;l!==void 0&&(m=""+l),f.key!==void 0&&(m=""+f.key),f.ref!==void 0&&(p=f.ref);for(d in f)r.call(f,d)&&!s.hasOwnProperty(d)&&(u[d]=f[d]);if(c&&c.defaultProps)for(d in f=c.defaultProps,f)u[d]===void 0&&(u[d]=f[d]);return{$$typeof:e,type:c,key:m,ref:p,props:u,_owner:i.current}}return rt.Fragment=n,rt.jsx=o,rt.jsxs=o,rt}var at={};/**
|
|
14
14
|
* @license React
|
|
15
15
|
* react-jsx-runtime.development.js
|
|
16
16
|
*
|
|
@@ -18,47 +18,47 @@
|
|
|
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 gr;function Ai(){return gr||(gr=1,process.env.NODE_ENV!=="production"&&function(){var t=g,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),b=Symbol.iterator,y="@@iterator";function x(h){if(h===null||typeof h!="object")return null;var P=b&&h[b]||h[y];return typeof P=="function"?P:null}var v=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(h){{for(var P=arguments.length,
|
|
22
|
-
`+
|
|
21
|
+
*/var gr;function Ai(){return gr||(gr=1,process.env.NODE_ENV!=="production"&&function(){var t=g,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),b=Symbol.iterator,y="@@iterator";function x(h){if(h===null||typeof h!="object")return null;var P=b&&h[b]||h[y];return typeof P=="function"?P:null}var v=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(h){{for(var P=arguments.length,B=new Array(P>1?P-1:0),te=1;te<P;te++)B[te-1]=arguments[te];S("error",h,B)}}function S(h,P,B){{var te=v.ReactDebugCurrentFrame,oe=te.getStackAddendum();oe!==""&&(P+="%s",B=B.concat([oe]));var de=B.map(function(se){return String(se)});de.unshift("Warning: "+P),Function.prototype.apply.call(console[h],console,de)}}var T=!1,k=!1,W=!1,O=!1,z=!1,R;R=Symbol.for("react.module.reference");function D(h){return!!(typeof h=="string"||typeof h=="function"||h===r||h===s||z||h===i||h===l||h===d||O||h===p||T||k||W||typeof h=="object"&&h!==null&&(h.$$typeof===m||h.$$typeof===u||h.$$typeof===o||h.$$typeof===c||h.$$typeof===f||h.$$typeof===R||h.getModuleId!==void 0))}function M(h,P,B){var te=h.displayName;if(te)return te;var oe=P.displayName||P.name||"";return oe!==""?B+"("+oe+")":B}function E(h){return h.displayName||"Context"}function w(h){if(h==null)return null;if(typeof h.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case l:return"Suspense";case d:return"SuspenseList"}if(typeof h=="object")switch(h.$$typeof){case c:var P=h;return E(P)+".Consumer";case o:var B=h;return E(B._context)+".Provider";case f:return M(h,h.render,"ForwardRef");case u:var te=h.displayName||null;return te!==null?te:w(h.type)||"Memo";case m:{var oe=h,de=oe._payload,se=oe._init;try{return w(se(de))}catch{return null}}}return null}var $=Object.assign,L=0,Z,I,V,J,j,N,H;function U(){}U.__reactDisabledLog=!0;function Y(){{if(L===0){Z=console.log,I=console.info,V=console.warn,J=console.error,j=console.group,N=console.groupCollapsed,H=console.groupEnd;var h={configurable:!0,enumerable:!0,value:U,writable:!0};Object.defineProperties(console,{info:h,log:h,warn:h,error:h,group:h,groupCollapsed:h,groupEnd:h})}L++}}function ee(){{if(L--,L===0){var h={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:$({},h,{value:Z}),info:$({},h,{value:I}),warn:$({},h,{value:V}),error:$({},h,{value:J}),group:$({},h,{value:j}),groupCollapsed:$({},h,{value:N}),groupEnd:$({},h,{value:H})})}L<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var G=v.ReactCurrentDispatcher,K;function X(h,P,B){{if(K===void 0)try{throw Error()}catch(oe){var te=oe.stack.trim().match(/\n( *(at )?)/);K=te&&te[1]||""}return`
|
|
22
|
+
`+K+h}}var ne=!1,F;{var ie=typeof WeakMap=="function"?WeakMap:Map;F=new ie}function A(h,P){if(!h||ne)return"";{var B=F.get(h);if(B!==void 0)return B}var te;ne=!0;var oe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var de;de=G.current,G.current=null,Y();try{if(P){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(Se){te=Se}Reflect.construct(h,[],se)}else{try{se.call()}catch(Se){te=Se}h.call(se.prototype)}}else{try{throw Error()}catch(Se){te=Se}h()}}catch(Se){if(Se&&te&&typeof Se.stack=="string"){for(var ae=Se.stack.split(`
|
|
23
23
|
`),be=te.stack.split(`
|
|
24
24
|
`),fe=ae.length-1,pe=be.length-1;fe>=1&&pe>=0&&ae[fe]!==be[pe];)pe--;for(;fe>=1&&pe>=0;fe--,pe--)if(ae[fe]!==be[pe]){if(fe!==1||pe!==1)do if(fe--,pe--,pe<0||ae[fe]!==be[pe]){var _e=`
|
|
25
|
-
`+ae[fe].replace(" at new "," at ");return h.displayName&&_e.includes("<anonymous>")&&(_e=_e.replace("<anonymous>",h.displayName)),typeof h=="function"&&
|
|
25
|
+
`+ae[fe].replace(" at new "," at ");return h.displayName&&_e.includes("<anonymous>")&&(_e=_e.replace("<anonymous>",h.displayName)),typeof h=="function"&&F.set(h,_e),_e}while(fe>=1&&pe>=0);break}}}finally{ne=!1,G.current=de,ee(),Error.prepareStackTrace=oe}var Ue=h?h.displayName||h.name:"",pr=Ue?X(Ue):"";return typeof h=="function"&&F.set(h,pr),pr}function he(h,P,B){return A(h,!1)}function Ee(h){var P=h.prototype;return!!(P&&P.isReactComponent)}function we(h,P,B){if(h==null)return"";if(typeof h=="function")return A(h,Ee(h));if(typeof h=="string")return X(h);switch(h){case l:return X("Suspense");case d:return X("SuspenseList")}if(typeof h=="object")switch(h.$$typeof){case f:return he(h.render);case u:return we(h.type,P,B);case m:{var te=h,oe=te._payload,de=te._init;try{return we(de(oe),P,B)}catch{}}}return""}var Fe=Object.prototype.hasOwnProperty,nr={},rr=v.ReactDebugCurrentFrame;function xt(h){if(h){var P=h._owner,B=we(h.type,h._source,P?P.type:null);rr.setExtraStackFrame(B)}else rr.setExtraStackFrame(null)}function oi(h,P,B,te,oe){{var de=Function.call.bind(Fe);for(var se in h)if(de(h,se)){var ae=void 0;try{if(typeof h[se]!="function"){var be=Error((te||"React class")+": "+B+" type `"+se+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof h[se]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw be.name="Invariant Violation",be}ae=h[se](P,se,te,B,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(fe){ae=fe}ae&&!(ae instanceof Error)&&(xt(oe),_("%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).",te||"React class",B,se,typeof ae),xt(null)),ae instanceof Error&&!(ae.message in nr)&&(nr[ae.message]=!0,xt(oe),_("Failed %s type: %s",B,ae.message),xt(null))}}}var ci=Array.isArray;function tn(h){return ci(h)}function li(h){{var P=typeof Symbol=="function"&&Symbol.toStringTag,B=P&&h[Symbol.toStringTag]||h.constructor.name||"Object";return B}}function ui(h){try{return ar(h),!1}catch{return!0}}function ar(h){return""+h}function ir(h){if(ui(h))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",li(h)),ar(h)}var nt=v.ReactCurrentOwner,di={key:!0,ref:!0,__self:!0,__source:!0},sr,or,nn;nn={};function fi(h){if(Fe.call(h,"ref")){var P=Object.getOwnPropertyDescriptor(h,"ref").get;if(P&&P.isReactWarning)return!1}return h.ref!==void 0}function mi(h){if(Fe.call(h,"key")){var P=Object.getOwnPropertyDescriptor(h,"key").get;if(P&&P.isReactWarning)return!1}return h.key!==void 0}function pi(h,P){if(typeof h.ref=="string"&&nt.current&&P&&nt.current.stateNode!==P){var B=w(nt.current.type);nn[B]||(_('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',w(nt.current.type),h.ref),nn[B]=!0)}}function hi(h,P){{var B=function(){sr||(sr=!0,_("%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)",P))};B.isReactWarning=!0,Object.defineProperty(h,"key",{get:B,configurable:!0})}}function gi(h,P){{var B=function(){or||(or=!0,_("%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)",P))};B.isReactWarning=!0,Object.defineProperty(h,"ref",{get:B,configurable:!0})}}var vi=function(h,P,B,te,oe,de,se){var ae={$$typeof:e,type:h,key:P,ref:B,props:se,_owner:de};return ae._store={},Object.defineProperty(ae._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ae,"_self",{configurable:!1,enumerable:!1,writable:!1,value:te}),Object.defineProperty(ae,"_source",{configurable:!1,enumerable:!1,writable:!1,value:oe}),Object.freeze&&(Object.freeze(ae.props),Object.freeze(ae)),ae};function bi(h,P,B,te,oe){{var de,se={},ae=null,be=null;B!==void 0&&(ir(B),ae=""+B),mi(P)&&(ir(P.key),ae=""+P.key),fi(P)&&(be=P.ref,pi(P,oe));for(de in P)Fe.call(P,de)&&!di.hasOwnProperty(de)&&(se[de]=P[de]);if(h&&h.defaultProps){var fe=h.defaultProps;for(de in fe)se[de]===void 0&&(se[de]=fe[de])}if(ae||be){var pe=typeof h=="function"?h.displayName||h.name||"Unknown":h;ae&&hi(se,pe),be&&gi(se,pe)}return vi(h,ae,be,oe,te,nt.current,se)}}var rn=v.ReactCurrentOwner,cr=v.ReactDebugCurrentFrame;function qe(h){if(h){var P=h._owner,B=we(h.type,h._source,P?P.type:null);cr.setExtraStackFrame(B)}else cr.setExtraStackFrame(null)}var an;an=!1;function sn(h){return typeof h=="object"&&h!==null&&h.$$typeof===e}function lr(){{if(rn.current){var h=w(rn.current.type);if(h)return`
|
|
26
26
|
|
|
27
|
-
Check the render method of \``+h+"`."}return""}}function yi(h){{if(h!==void 0){var P=h.fileName.replace(/^.*[\\\/]/,""),
|
|
27
|
+
Check the render method of \``+h+"`."}return""}}function yi(h){{if(h!==void 0){var P=h.fileName.replace(/^.*[\\\/]/,""),B=h.lineNumber;return`
|
|
28
28
|
|
|
29
|
-
Check your code at `+P+":"+
|
|
29
|
+
Check your code at `+P+":"+B+"."}return""}}var ur={};function _i(h){{var P=lr();if(!P){var B=typeof h=="string"?h:h.displayName||h.name;B&&(P=`
|
|
30
30
|
|
|
31
|
-
Check the top-level render call using <`+q+">.")}return P}}function dr(h,P){{if(!h._store||h._store.validated||h.key!=null)return;h._store.validated=!0;var q=_i(P);if(ur[q])return;ur[q]=!0;var te="";h&&h._owner&&h._owner!==rn.current&&(te=" It was passed a child from "+w(h._owner.type)+"."),qe(h),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',q,te),qe(null)}}function fr(h,P){{if(typeof h!="object")return;if(tn(h))for(var q=0;q<h.length;q++){var te=h[q];sn(te)&&dr(te,P)}else if(sn(h))h._store&&(h._store.validated=!0);else if(h){var oe=x(h);if(typeof oe=="function"&&oe!==h.entries)for(var de=oe.call(h),se;!(se=de.next()).done;)sn(se.value)&&dr(se.value,P)}}}function xi(h){{var P=h.type;if(P==null||typeof P=="string")return;var q;if(typeof P=="function")q=P.propTypes;else if(typeof P=="object"&&(P.$$typeof===f||P.$$typeof===u))q=P.propTypes;else return;if(q){var te=w(P);oi(q,h.props,"prop",te,h)}else if(P.PropTypes!==void 0&&!an){an=!0;var oe=w(P);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",oe||"Unknown")}typeof P.getDefaultProps=="function"&&!P.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function wi(h){{for(var P=Object.keys(h.props),q=0;q<P.length;q++){var te=P[q];if(te!=="children"&&te!=="key"){qe(h),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",te),qe(null);break}}h.ref!==null&&(qe(h),_("Invalid attribute `ref` supplied to `React.Fragment`."),qe(null))}}function mr(h,P,q,te,oe,de){{var se=D(h);if(!se){var ae="";(h===void 0||typeof h=="object"&&h!==null&&Object.keys(h).length===0)&&(ae+=" 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 be=yi(oe);be?ae+=be:ae+=lr();var fe;h===null?fe="null":tn(h)?fe="array":h!==void 0&&h.$$typeof===e?(fe="<"+(w(h.type)||"Unknown")+" />",ae=" Did you accidentally export a JSX literal instead of a component?"):fe=typeof h,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",fe,ae)}var pe=bi(h,P,q,oe,de);if(pe==null)return pe;if(se){var _e=P.children;if(_e!==void 0)if(te)if(tn(_e)){for(var Ue=0;Ue<_e.length;Ue++)fr(_e[Ue],h);Object.freeze&&Object.freeze(_e)}else _("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 fr(_e,h)}return h===r?wi(pe):xi(pe),pe}}function ki(h,P,q){return mr(h,P,q,!0)}function ji(h,P,q){return mr(h,P,q,!1)}var Ti=ji,Ei=ki;rt.Fragment=r,rt.jsx=Ti,rt.jsxs=Ei}()),rt}process.env.NODE_ENV==="production"?Pn.exports=Di():Pn.exports=Ai();var a=Pn.exports;const Xr=()=>{const[t,e]=g.useState(window.location.pathname),n=()=>{const r=window.location.pathname;e(r)};return g.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),t},Ye=(t,e)=>{const n=g.useRef(!1);g.useEffect(()=>{n.current?t():n.current=!0},e)};function Ii(t,e,n){var r=this,i=g.useRef(null),s=g.useRef(0),o=g.useRef(null),c=g.useRef([]),f=g.useRef(),l=g.useRef(),d=g.useRef(t),u=g.useRef(!0);d.current=t;var m=typeof window<"u",p=!e&&e!==0&&m;if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0;var b=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,x="maxWait"in n,v="debounceOnServer"in n&&!!n.debounceOnServer,_=x?Math.max(+n.maxWait||0,e):null;g.useEffect(function(){return u.current=!0,function(){u.current=!1}},[]);var S=g.useMemo(function(){var T=function(D){var C=c.current,E=f.current;return c.current=f.current=null,s.current=D,l.current=d.current.apply(E,C)},k=function(D,C){p&&cancelAnimationFrame(o.current),o.current=p?requestAnimationFrame(D):setTimeout(D,C)},Z=function(D){if(!u.current)return!1;var C=D-i.current;return!i.current||C>=e||C<0||x&&D-s.current>=_},A=function(D){return o.current=null,y&&c.current?T(D):(c.current=f.current=null,l.current)},z=function D(){var C=Date.now();if(Z(C))return A(C);if(u.current){var E=e-(C-i.current),w=x?Math.min(E,_-(C-s.current)):E;k(D,w)}},R=function(){if(m||v){var D=Date.now(),C=Z(D);if(c.current=[].slice.call(arguments),f.current=r,i.current=D,C){if(!o.current&&u.current)return s.current=i.current,k(z,e),b?T(i.current):l.current;if(x)return k(z,e),T(i.current)}return o.current||k(z,e),l.current}};return R.cancel=function(){o.current&&(p?cancelAnimationFrame(o.current):clearTimeout(o.current)),s.current=0,c.current=i.current=f.current=o.current=null},R.isPending=function(){return!!o.current},R.flush=function(){return o.current?A(Date.now()):l.current},R},[b,x,e,_,y,p,m,v]);return S}function ea(t,e,n){var r=n===void 0?{}:n,i=r.leading,s=r.trailing;return Ii(t,e,{maxWait:e,leading:i===void 0||i,trailing:s===void 0||s})}let on;const Je=(t=!0,e=!1,n="window")=>{if(!t)return;const[r,i]=g.useState(0)||[!1,()=>{}],s=n==="window"?[]:[n];g.useEffect(()=>(c(),window.addEventListener("resize",l),window.addEventListener("hiddenSectionVisible",f),()=>{clearTimeout(on),l.flush(),window.removeEventListener("resize",l),window.removeEventListener("hiddenSectionVisible",f)}),s);const o=()=>{if(n)return n==="window"?window.innerWidth:n.offsetWidth},c=()=>{i(o())},f=({detail:d})=>{const{id:u}=d;n==="window"||!n.closest(`#${u}`)||o()===r||c()},l=ea(()=>{o()!==r&&(e&&(clearTimeout(on),document.body.classList.add("is-resizing"),on=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),c())},500,{leading:!0});return r},ta=({scrollPosition:t=0,offset:e={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[i,s]=g.useState({current:0,past:0})||[!1,()=>{}],[o,c]=g.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];g.useEffect(()=>(f(),window.addEventListener("scroll",l),()=>{l.flush(),window.removeEventListener("scroll",l)}),[]);const f=()=>{const d=window.scrollY,u=i.current,m=d-u,p=m>0?"down":"up";if(s({current:d,past:u}),p==="down"){d>=t+e.down&&!o.scrollDown&&(!o.scrollUp||m>e.up)&&(n(),c({scrollUp:!1,scrollDown:!0}));return}Math.abs(m)>=e.up&&!o.scrollUp&&(r(),c({scrollUp:!0,scrollDown:!1}))},l=ea(()=>{f()},250);return i},na=(t=[],e=!0)=>{t=Array.isArray(t)?t:[t];const n=g.useRef(!1);Ye(()=>{if(window&&window.location&&window.location.hash){if(n.current)return;const r=document.getElementById(window.location.hash.replace("#",""));r&&(r.scrollIntoView(e?{behavior:"smooth"}:null),n.current=!0)}},t)},ra=(t,e)=>{Array.isArray(e)||(e=[e]);const n=lt(t);return e.forEach(({type:r,value:i})=>{Si(n,r,i)}),n},aa=t=>{const e=[];return t.forEach(n=>{const r=parseInt(n);isNaN(r)||e.push(r)}),e.sort((n,r)=>n-r)},ia=(t,e,n)=>{let r=n.mobile;for(const i in e){const s=parseInt(String(e[i]));if(t>=s)r=n[s];else if(t<s)break}return r},Li=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),Ae="https://storage.googleapis.com/apolitical-assets/",We={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},Bi="200,000+";function sa(t){return t?{"--icon":`url(${Ae}icons/${t}.svg)`}:{}}const De={milliseconds:{inSecond:1e3,inMinute:6e4,inHour:36e5,inDay:864e5},year:{weeks:52,days:365}},qi=(t,e="en")=>new Date(t).toLocaleString(e,{day:"numeric",month:"short"}),oa=(t,e="en")=>new Date(t).toLocaleString(e,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),Rn=t=>{let e;const n=Dt(),r=Dt(new Date(t));try{e=n.getTime()-r.getTime()}catch{return""}const i=e/De.milliseconds.inHour,s=Math.floor(e/De.milliseconds.inDay);if(s<1)return i<1?{path:"now"}:{path:"hours",number:Math.floor(i)};if(s<7)return{path:"days",number:s};const o=Math.floor(s/7);return o<=De.year.weeks?{path:"weeks",number:o}:{path:"years",number:Math.floor(s/De.year.days)}},Dt=t=>{const n=(t||new Date).toUTCString();return new Date(n)},Ui=(t,e,n)=>{let r;const i=Dt(),s=Dt(new Date(t));try{r=i.getTime()-s.getTime()}catch{return!1}switch(n){case"seconds":return r/De.milliseconds.inSecond<=e;case"minutes":return r/De.milliseconds.inMinute<=e;case"hours":return r/De.milliseconds.inHour<=e}return!1},zi=t=>new Promise(e=>setTimeout(e,t)),Bn={apolitical:"Apolitical",dates_now:"now",dates_hours:"{number}h",dates_days:"{number}d",dates_weeks:"{number}w",dates_years:"{number}y",card_carousel_viewAll:"View all",card_label_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}",activitySection_notFoundError:"Post not found",communityDetails_members:"Members",communityDetails_viewAll:"View all",communityDetails_invite:"Invite colleagues",community_joinToPost:"Join community to create a post.",joinCommunityButton:"Join community",joinCommunityButton_short:"Join",joinCommunityButton_joining:"Joining...",joinCommunityButton_member:"Member",joinCommunityButton_member_aria:"Leave community",joinCommunityButton_leave:"Leave",joinCommunityButton_leaving:"Leaving...",member_apolitical:"Apolitical",member_community:"Community post",membersList:"Members",membersList_admin:"Admin",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 <`+B+">.")}return P}}function dr(h,P){{if(!h._store||h._store.validated||h.key!=null)return;h._store.validated=!0;var B=_i(P);if(ur[B])return;ur[B]=!0;var te="";h&&h._owner&&h._owner!==rn.current&&(te=" It was passed a child from "+w(h._owner.type)+"."),qe(h),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',B,te),qe(null)}}function fr(h,P){{if(typeof h!="object")return;if(tn(h))for(var B=0;B<h.length;B++){var te=h[B];sn(te)&&dr(te,P)}else if(sn(h))h._store&&(h._store.validated=!0);else if(h){var oe=x(h);if(typeof oe=="function"&&oe!==h.entries)for(var de=oe.call(h),se;!(se=de.next()).done;)sn(se.value)&&dr(se.value,P)}}}function xi(h){{var P=h.type;if(P==null||typeof P=="string")return;var B;if(typeof P=="function")B=P.propTypes;else if(typeof P=="object"&&(P.$$typeof===f||P.$$typeof===u))B=P.propTypes;else return;if(B){var te=w(P);oi(B,h.props,"prop",te,h)}else if(P.PropTypes!==void 0&&!an){an=!0;var oe=w(P);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",oe||"Unknown")}typeof P.getDefaultProps=="function"&&!P.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function wi(h){{for(var P=Object.keys(h.props),B=0;B<P.length;B++){var te=P[B];if(te!=="children"&&te!=="key"){qe(h),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",te),qe(null);break}}h.ref!==null&&(qe(h),_("Invalid attribute `ref` supplied to `React.Fragment`."),qe(null))}}function mr(h,P,B,te,oe,de){{var se=D(h);if(!se){var ae="";(h===void 0||typeof h=="object"&&h!==null&&Object.keys(h).length===0)&&(ae+=" 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 be=yi(oe);be?ae+=be:ae+=lr();var fe;h===null?fe="null":tn(h)?fe="array":h!==void 0&&h.$$typeof===e?(fe="<"+(w(h.type)||"Unknown")+" />",ae=" Did you accidentally export a JSX literal instead of a component?"):fe=typeof h,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",fe,ae)}var pe=bi(h,P,B,oe,de);if(pe==null)return pe;if(se){var _e=P.children;if(_e!==void 0)if(te)if(tn(_e)){for(var Ue=0;Ue<_e.length;Ue++)fr(_e[Ue],h);Object.freeze&&Object.freeze(_e)}else _("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 fr(_e,h)}return h===r?wi(pe):xi(pe),pe}}function ki(h,P,B){return mr(h,P,B,!0)}function ji(h,P,B){return mr(h,P,B,!1)}var Ti=ji,Ei=ki;at.Fragment=r,at.jsx=Ti,at.jsxs=Ei}()),at}process.env.NODE_ENV==="production"?Pn.exports=Di():Pn.exports=Ai();var a=Pn.exports;const Xr=()=>{const[t,e]=g.useState(window.location.pathname),n=()=>{const r=window.location.pathname;e(r)};return g.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),t},Ye=(t,e)=>{const n=g.useRef(!1);g.useEffect(()=>{n.current?t():n.current=!0},e)};function Ii(t,e,n){var r=this,i=g.useRef(null),s=g.useRef(0),o=g.useRef(null),c=g.useRef([]),f=g.useRef(),l=g.useRef(),d=g.useRef(t),u=g.useRef(!0);d.current=t;var m=typeof window<"u",p=!e&&e!==0&&m;if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0;var b=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,x="maxWait"in n,v="debounceOnServer"in n&&!!n.debounceOnServer,_=x?Math.max(+n.maxWait||0,e):null;g.useEffect(function(){return u.current=!0,function(){u.current=!1}},[]);var S=g.useMemo(function(){var T=function(D){var M=c.current,E=f.current;return c.current=f.current=null,s.current=D,l.current=d.current.apply(E,M)},k=function(D,M){p&&cancelAnimationFrame(o.current),o.current=p?requestAnimationFrame(D):setTimeout(D,M)},W=function(D){if(!u.current)return!1;var M=D-i.current;return!i.current||M>=e||M<0||x&&D-s.current>=_},O=function(D){return o.current=null,y&&c.current?T(D):(c.current=f.current=null,l.current)},z=function D(){var M=Date.now();if(W(M))return O(M);if(u.current){var E=e-(M-i.current),w=x?Math.min(E,_-(M-s.current)):E;k(D,w)}},R=function(){if(m||v){var D=Date.now(),M=W(D);if(c.current=[].slice.call(arguments),f.current=r,i.current=D,M){if(!o.current&&u.current)return s.current=i.current,k(z,e),b?T(i.current):l.current;if(x)return k(z,e),T(i.current)}return o.current||k(z,e),l.current}};return R.cancel=function(){o.current&&(p?cancelAnimationFrame(o.current):clearTimeout(o.current)),s.current=0,c.current=i.current=f.current=o.current=null},R.isPending=function(){return!!o.current},R.flush=function(){return o.current?O(Date.now()):l.current},R},[b,x,e,_,y,p,m,v]);return S}function ea(t,e,n){var r=n===void 0?{}:n,i=r.leading,s=r.trailing;return Ii(t,e,{maxWait:e,leading:i===void 0||i,trailing:s===void 0||s})}let on;const Je=(t=!0,e=!1,n="window")=>{if(!t)return;const[r,i]=g.useState(0)||[!1,()=>{}],s=n==="window"?[]:[n];g.useEffect(()=>(c(),window.addEventListener("resize",l),window.addEventListener("hiddenSectionVisible",f),()=>{clearTimeout(on),l.flush(),window.removeEventListener("resize",l),window.removeEventListener("hiddenSectionVisible",f)}),s);const o=()=>{if(n)return n==="window"?window.innerWidth:n.offsetWidth},c=()=>{i(o())},f=({detail:d})=>{const{id:u}=d;n==="window"||!n.closest(`#${u}`)||o()===r||c()},l=ea(()=>{o()!==r&&(e&&(clearTimeout(on),document.body.classList.add("is-resizing"),on=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),c())},500,{leading:!0});return r},ta=({scrollPosition:t=0,offset:e={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[i,s]=g.useState({current:0,past:0})||[!1,()=>{}],[o,c]=g.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];g.useEffect(()=>(f(),window.addEventListener("scroll",l),()=>{l.flush(),window.removeEventListener("scroll",l)}),[]);const f=()=>{const d=window.scrollY,u=i.current,m=d-u,p=m>0?"down":"up";if(s({current:d,past:u}),p==="down"){d>=t+e.down&&!o.scrollDown&&(!o.scrollUp||m>e.up)&&(n(),c({scrollUp:!1,scrollDown:!0}));return}Math.abs(m)>=e.up&&!o.scrollUp&&(r(),c({scrollUp:!0,scrollDown:!1}))},l=ea(()=>{f()},250);return i},na=(t=[],e=!0)=>{t=Array.isArray(t)?t:[t];const n=g.useRef(!1);Ye(()=>{if(window&&window.location&&window.location.hash){if(n.current)return;const r=document.getElementById(window.location.hash.replace("#",""));r&&(r.scrollIntoView(e?{behavior:"smooth"}:null),n.current=!0)}},t)},ra=(t,e)=>{Array.isArray(e)||(e=[e]);const n=ut(t);return e.forEach(({type:r,value:i})=>{Si(n,r,i)}),n},aa=t=>{const e=[];return t.forEach(n=>{const r=parseInt(n);isNaN(r)||e.push(r)}),e.sort((n,r)=>n-r)},ia=(t,e,n)=>{let r=n.mobile;for(const i in e){const s=parseInt(String(e[i]));if(t>=s)r=n[s];else if(t<s)break}return r},Li=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),Ae="https://storage.googleapis.com/apolitical-assets/",We={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},Bi="200,000+";function sa(t){return t?{"--icon":`url(${Ae}icons/${t}.svg)`}:{}}const De={milliseconds:{inSecond:1e3,inMinute:6e4,inHour:36e5,inDay:864e5},year:{weeks:52,days:365}},qi=(t,e="en")=>new Date(t).toLocaleString(e,{day:"numeric",month:"short"}),oa=(t,e="en")=>new Date(t).toLocaleString(e,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),Rn=t=>{let e;const n=Dt(),r=Dt(new Date(t));try{e=n.getTime()-r.getTime()}catch{return""}const i=e/De.milliseconds.inHour,s=Math.floor(e/De.milliseconds.inDay);if(s<1)return i<1?{path:"now"}:{path:"hours",number:Math.floor(i)};if(s<7)return{path:"days",number:s};const o=Math.floor(s/7);return o<=De.year.weeks?{path:"weeks",number:o}:{path:"years",number:Math.floor(s/De.year.days)}},Dt=t=>{const n=(t||new Date).toUTCString();return new Date(n)},Ui=(t,e,n)=>{let r;const i=Dt(),s=Dt(new Date(t));try{r=i.getTime()-s.getTime()}catch{return!1}switch(n){case"seconds":return r/De.milliseconds.inSecond<=e;case"minutes":return r/De.milliseconds.inMinute<=e;case"hours":return r/De.milliseconds.inHour<=e}return!1},zi=t=>new Promise(e=>setTimeout(e,t)),Bn={apolitical:"Apolitical",dates_now:"now",dates_hours:"{number}h",dates_days:"{number}d",dates_weeks:"{number}w",dates_years:"{number}y",card_carousel_viewAll:"View all",card_label_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}",activitySection_notFoundError:"Post not found",communityDetails_members:"Members",communityDetails_viewAll:"View all",communityDetails_invite:"Invite colleagues",community_joinToPost:"Join community to create a post.",joinCommunityButton:"Join community",joinCommunityButton_short:"Join",joinCommunityButton_joining:"Joining...",joinCommunityButton_member:"Member",joinCommunityButton_member_aria:"Leave community",joinCommunityButton_leave:"Leave",joinCommunityButton_leaving:"Leaving...",member_apolitical:"Apolitical",member_community:"Community post",membersList:"Members",membersList_admin:"Admin",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:"Write a {action}...",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_responses_placeholder:"Write a comment...",discussion_thread_show:"Show {count} {count, select, 1 {reply} other {replies}}",discussion_thread_hide:"Hide replies",discussion_thread_loadMore:"Load more replies",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their 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",inputAutocomplete_placeholder:"Start typing...",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",profile_image_change_uploading_text:"Uploading image...",profile_image_change_cta_with_picture:"Change photo",profile_image_change_cta_without_picture:"+ Add profile photo",profile_image_change_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",showpassword_show:"Show",showpassword_hide:"Hide",showpassword_aria_show:"Your password is hidden. Click to show.",showpassword_aria_hide:"Your password is visible. Click to hide.",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_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",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",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",inviteModal_title:"You’re registered",overlay_close:"Close",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_profile:"My profile",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",edit_section_placeholder_description:"Add some details",edit_section_placeholder_cta:"add",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll"},Zi={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>"},Wi={languageSwitcher_label:"Je voudrais lire cet article dans...",languageSwitcher_translation_original:"langue originale",languageSwitcher_translation_human:"traduit par un humain",languageSwitcher_translation_machine:"traduit par machine",languageSwitcher_disclaimer:"Ce contenu est traduit automatiquement et contiendra d’évantuelles erreurs de genre ou d’autres traductions directes. Nous essayons de résoudre ce problème, mais en attendant, si vous remarquez une erreur importante, faites-le nous savoir à <link>{email}</link>",collapsibleSection_summary:"En savoir plus"},Hi={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>"},Vi=Object.freeze(Object.defineProperty({__proto__:null,en:Bn,es:Zi,fr:Wi,pt:Hi},Symbol.toStringTag,{value:"Module"})),ca=t=>t in Bn,ke=(t,e,n,r,i={})=>{let s="";return ca(`${e}_${n}`)?s=t({id:`${e}_${n}`},i):s=t({id:e},{[r]:n,...i}),s},Yi=(t,e,n)=>{if(!t||t===0)return"0";e||(e=0),n||(n=["k","m","b","t"]);let r=t.toString();e=Math.pow(10,e);for(let i=n.length-1;i>=0;i--){const s=Math.pow(10,(i+1)*3);if(s<=t){t=Math.round(t*e/s)/e,t===1e3&&i<n.length-1&&(t=1,i++),r=`${t}${n[i]}`;break}}return r},Ft=(t,e)=>g.Children.map(t,n=>Object.is(n,null)?n:g.cloneElement(n,{...e})),la=(t=0)=>{setTimeout(()=>{const e=document.querySelector(".splash-screen");e&&e.remove(),window.prerenderReady=!0},t)},Ki=t=>t.replace(/\s+/g,"").length>0,Gi=t=>{const e=t.length>8,n=/[0-9]/.test(t)&&/[`!@#$%^&*()_+\-=[\]{}£;':"\\|,.<>/?~]/.test(t),r=new RegExp("^(?=.*?[A-Z])(?=.*?[a-z])").test(t);return{isValid:e&&n&&r,matchingRules:{isMoreThanEightCharacters:e,includesNumberAndSymbol:n,includesLowerAndUppercase:r}}},re=({variant:t="primary",size:e="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:s="button",onClick:o=!1,className:c="",disabled:f=!1,screenreaderText:l=!1,children:d=!1,...u})=>{const p=Je(typeof e=="object");if(typeof e=="object"&&typeof p=="number"){const x=Object.assign({},e),v=aa(Object.keys(x));e=ia(p,v,x)}const b=[];typeof e=="string"&&b.push(e),r&&(b.push("icon"),typeof r=="object"?(b.push(r.icon),r.position?b.push(r.position):b.push("left"),r.hover&&b.push(`hover_${r.hover}`),r.animate&&(b.push("animate"),typeof r.animate=="string"&&b.push(r.animate))):(b.push(r),!r.includes("right")&&!r.includes("left")&&b.push("left"))),n.muted&&b.push("muted"),n.fullWidth&&b.push("full-width");const y={...u,className:$(t,c,b,{"no-text":!d,disabled:f,button:i}),onClick:x=>{(!i||i[0]==="#")&&o&&(x.preventDefault(),x.stopPropagation()),o&&o(x)},disabled:typeof f=="object"&&"isClickable"in f?!f.isClickable:f};return i&&(s="a",y.href=i),g.createElement(s,y,d||(l?a.jsx(ge,{showOnFocus:!1,children:l}):null))},vt=({buttons:t,className:e="",...n})=>{const r=t.length>1?"ul":"p",i=t.map((s,o)=>r==="p"?a.jsx(re,{...s},o):a.jsx("li",{children:a.jsx(re,{...s})},o));return g.createElement(r,{className:$("button-wrapper",e),...n,children:i})};const je=({className:t="",maxWidth:e=!1})=>{const n=e?{"--max-width":`${e/16}rem`}:{};return a.jsx("hr",{className:$(t,{"has-max-width":e}),style:n})},vr={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"}},Qi=({aspect:t,range:e,sizes:n})=>{const{range:r,sizes:i}=t?vr[t]:vr.fallback;return{range:e&&e.length>0?e:r,sizes:n||i}},Ji=({format:t,height:e,query:n,width:r})=>{let i=`w=${r}&h=${e}`;return i=t?`${i}&fm=${t}`:i,i=n?`${i}&${n}`:i,i},cn=({format:t,range:e,url:n,query:r})=>e.map(({height:i,width:s})=>`${n}?${Ji({format:t,height:i,query:r,width:s})} ${s}w`).join(", ");const Xe=({image:t,className:e,testId:n})=>{const{description:r,height:i,type:s,query:o,url:c,width:f,loading:l,decoding:d,fetchPriority:u}=t,{range:m,sizes:p}=Qi(t),b=cn({format:"avif",query:o,range:m,url:c}),y=cn({format:"webp",query:o,range:m,url:c}),x=cn({format:"",query:o,range:m,url:c});return a.jsxs("picture",{className:e,children:[s!=="image/gif"&&a.jsx("source",{type:"image/avif",srcSet:b,sizes:p,"data-testid":"source"}),a.jsx("source",{type:"image/webp",srcSet:y,sizes:p,"data-testid":"source"}),a.jsx("img",{srcSet:x,sizes:p,src:c,alt:r,loading:l||"lazy",decoding:d||"async",fetchpriority:u||"auto",width:f,height:i,"data-testid":n||"image"})]})};const Xi=({image:t,className:e,testId:n})=>a.jsx("div",{className:`image-container ${e}`,"data-testid":n||"image-container",children:t&&a.jsx(Xe,{image:{...t},className:"image"})}),et=({href:t,children:e,fallbackElement:n,className:r="",onClick:i,gtmContext:s,gtmType:o,...c})=>{if(t){const f={...c};return i&&(f.onClick=i),s&&(f["data-gtm-event-context"]=s),o&&(f["data-gtm-event-type"]=o),a.jsx("a",{href:t,className:$("gtm-trackable",r),...f,children:e})}return n?g.createElement(n,{children:e,className:r,...c}):e};const es=({elementId:t,offset:e=20})=>{const n=U.useIntl(),r=()=>{const i=document.getElementById(t);if(!i)return;const s=document.getElementById("header");s&&window.scrollTo({top:i.offsetTop-s.clientHeight-e})};return a.jsx(re,{variant:"secondary",className:"return-to-nav",onClick:r,"data-gtm-event-context":"ListPageMobile","data-gtm-event-type":"back-to-nav-button-click",screenreaderText:n.formatMessage({id:"return_to_nav_button"})})};let at=!1;const ua=({isOpen:t=!1,isLoading:e=!1,children:n})=>{const r=U.useIntl(),i=g.useRef(null),[s,o]=g.useState("hidden");g.useEffect(()=>{const f=i.current;if(f)return f.addEventListener("transitionend",c),()=>{f.removeEventListener("transitionend",c)}},[]);const c=({propertyName:f})=>{f==="opacity"&&(at!==!1&&clearTimeout(at),o(l=>l==="opening"?"open":l==="closing"?"closed":l==="closed"?"hidden":l))};return Ye(()=>{at!==!1&&clearTimeout(at);let f="open";t?o("opening"):(o("closing"),f="hidden"),at=setTimeout(()=>{o(f)},300)},[t]),a.jsx("aside",{ref:i,className:$("tooltip text-medium",s,{loading:e}),hidden:s==="hidden",children:e?a.jsx("p",{children:r.formatMessage({id:"tooltip_loading"})}):typeof n=="string"?a.jsx("p",{children:n}):n})};const ts=({className:t="",image:e,...n})=>e?(typeof e=="string"&&(e={width:1080,height:200,type:"image/png",url:e}),e.range=[{height:124,width:425},{height:200,width:768},{height:200,width:1368}],e.query="fit=thumb&f=center",a.jsx(Xe,{...n,className:$("banner",t),image:{...e,aspect:"banner"}})):null;const Le=({children:t,className:e="",styling:n={},...r})=>{const{background:i="default"}=n;return a.jsx("section",{className:$("full-width-section",e,{[i]:i!=="default"}),...r,children:t})};const ns=({text:t,buttons:e,className:n=""})=>{const r=[];return e.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})}),a.jsx(Le,{className:$("download-section",n),children:a.jsxs(a.Fragment,{children:[g.createElement(typeof t=="string"?"h2":t.element,{className:"text"},typeof t=="string"?t:t.text),a.jsx(vt,{buttons:r})]})})};function da({href:t,setShowModal:e}){typeof t!="string"&&e(!0)}const rs=({icon:t,description:e,ctaMessage:n,href:r,showEditButton:i,setShowModal:s})=>{const{formatMessage:o}=U.useIntl();return a.jsxs("div",{className:$("edit-section-placeholder",{"has-icon":!!t}),style:sa(t),children:[a.jsx("p",{children:e||o({id:"edit_section_placeholder_description"})}),i&&a.jsx(re,{href:r,variant:"secondary",size:"small",onClick:()=>da({href:r,setShowModal:s}),children:n||o({id:"edit_section_placeholder_cta"})})]})},as=({children:t,className:e="",formProps:n,href:r,title:i,modalTitle:s,placeholder:o,showDivider:c=!0})=>{const[f,l]=g.useState(!1),d=typeof r=="string"||!!n,u=()=>l(!1);return a.jsxs("section",{className:$("edit-section",e),children:[n&&a.jsx(bt,{title:s||`Edit ${i}`,isOpen:f,showDivider:!1,showIcon:!1,functions:{onClose:u},className:$("edit-section-modal"),children:a.jsx(Qt,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async m=>{var p,b;(p=n==null?void 0:n.functions)!=null&&p.onSuccess&&await((b=n==null?void 0:n.functions)==null?void 0:b.onSuccess(m)),l(!1)},onCancel:u}})}),a.jsxs("div",{className:"edit-section-header",children:[a.jsx("h2",{className:"edit-section-header-title",children:i}),d&&a.jsx(re,{href:r,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>da({href:r,setShowModal:l}),children:"Edit"})]}),t||a.jsx(rs,{...o,href:r,setShowModal:l,showEditButton:d}),c&&a.jsx(je,{})]})};const is=({title:t=!1,logos:e=[],className:n=""})=>{const r=e.length;if(r===0)return null;const i={element:typeof t=="object"?t.element:"h2",text:typeof t=="string"?t:typeof t=="object"?t.text:""};return a.jsxs("div",{className:$("logos",n),children:[t&&g.createElement(i.element,{className:"title"},i.text),a.jsx("ul",{className:$({"two-col":r===2||r===4,"three-col":r===5||r<=10&&r%3===0}),children:e.map(({logo:s,nameOfBusiness:o,link:c=!1,description:f=!1},l)=>{if(!s||!s.url)return null;const d=a.jsx("img",{src:s.url,width:s.width||"auto",height:s.height||"auto",alt:o});return a.jsxs("li",{children:[a.jsx("p",{className:"img-wrapper",children:c?a.jsx("a",{href:c,target:"_blank",rel:"nofollow noreferrer noopener",children:d}):d}),f&&a.jsx("small",{children:f})]},window.btoa(`${s.url}_${l}`))})})]})};const ss=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],os=({className:t="",content:e,image:n,variant:r="default",spacing:i="normal",hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:c})=>{const f=["eyebrow","title","text"],l={eyebrow:"small",title:"h1",text:"p"},d={};return f.forEach(u=>{if(!e[u]){d[u]=!1;return}if(!s[u]){if(typeof e[u]=="object"){d[u]=e[u];const{text:m,element:p}=e[u];if(p&&ss.includes(p.toLowerCase()))return;d[u]={text:m,element:l[u]};return}d[u]={text:e[u],element:l[u]}}}),o&&o.link&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=u=>{u.preventDefault(),u.stopPropagation();const m=document.getElementById(o.link.substring(1));m&&m.scrollIntoView({behavior:"smooth"})}),a.jsx(Le,{className:$("banner-section",r,i,t,{"has-image":n,"has-extra-spacing":i==="normal"&&d.eyebrow&&d.title}),children:a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"content-wrapper",children:[f.map(u=>{if(d[u]&&typeof d[u]=="object"){const{text:m,element:p=""}=d[u];return u==="text"?a.jsx(mt,{overrideType:"text-only",className:"text",children:m},u):g.createElement(p,{key:u,className:u},m)}return null}),c,o&&o.text&&o.link&&a.jsx(re,{variant:n||r==="light"?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,children:o.text})]}),n&&a.jsx(Xe,{image:{...n,aspect:"banner"}})]})})},cs=g.memo(os);const ls=({alignImage:t="left",className:e,content:n,image:r})=>{const i=()=>typeof n=="string"?a.jsx(Qe,{children:n}):n;return a.jsxs(Le,{className:$("highlight-section",e),children:[r&&a.jsx("div",{className:$("highlight-container highlight-image",{[`highlight-image-${t}`]:t==="right"}),children:a.jsx(Xe,{image:r})}),a.jsx("div",{className:$("highlight-container highlight-content-wrapper",{"no-image":!r}),children:a.jsx("div",{className:$("highlight-content",{"highlight-content-right":t==="left"}),children:i()})})]})},us=g.memo(ls);const ds=({variant:t="primary",button:e=null,title:n,text:r,gtmContext:i})=>!n&&!r?null:a.jsxs("aside",{className:$("marketing-block",t),children:[n&&a.jsx("p",{className:"title",children:n}),r&&a.jsx("p",{children:r}),e&&a.jsx(re,{variant:"secondary",size:"medium",href:e.link,className:"gtm-trackable","data-gtm-event-context":i,"data-gtm-event-type":"learn-more-click",children:e.text})]}),fa=({showDevTools:t=!0,children:e})=>{const n=new me.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return a.jsxs(me.QueryClientProvider,{client:n,children:[e,t&&a.jsx(Ci.ReactQueryDevtools,{initialIsOpen:!1})]})};var fs=g.createContext({client:Rt});function ms(t){var e=t.children,n=t.client,r=t.apiKey,i=t.options,s=g.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&&(Rt.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),Rt.init(r,i)),Rt)},[n,r]);return g.createElement(fs.Provider,{value:{client:s}},e)}const ma=({children:t,user:e})=>e.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?a.jsx(ms,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,disable_session_recording:!0,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:e.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!e.id}},children:t}):t,pa=({children:t,locale:e,messages:n})=>{const r=e||"en",i={...Vi[r],...n||{}};return a.jsx(U.IntlProvider,{locale:r,messages:i,children:t})},Te=g.createContext({isLoading:!0});function Kt(){return g.useContext(Te)}const ha=({children:t,user:e})=>a.jsx(Te.Provider,{value:e,children:t}),ps=({bootstrap:t,children:e,intl:n,showDevTools:r})=>{const[i,s]=g.useState({isLoading:!0});return g.useEffect(()=>{t().then(o=>{s({...o,isLoading:!1}),la(5e3)}).catch(()=>s({isLoading:!1}))},[]),a.jsx(pa,{locale:n==null?void 0:n.locale,messages:n==null?void 0:n.messages,children:a.jsx(Ln.CookiesProvider,{children:a.jsx(ha,{user:i,children:a.jsx(fa,{showDevTools:r,children:a.jsx(ma,{user:i,children:e})})})})})};const qn=({label:t=!1,className:e="",children:n})=>{const r=U.useIntl();return a.jsxs("details",{className:$("collapsible-section",e),children:[a.jsx("summary",{children:t||r.formatMessage({id:"collapsibleSection_summary"})}),a.jsx("div",{className:"content",children:n})]})};const $e=({variant:t="primary",icon:e,className:n="",children:r,...i})=>{const s=e?{"--icon":`url(${Ae}icons/${e}.svg)`}:{};return a.jsx("div",{className:$("highlighted-text-box",t,n,{"has-icon":e}),style:s,...i,children:r})};const Be=({variant:t="empty",text:e=!1,button:n=!1,className:r=""})=>{let i=n&&!!Object.keys(n).length;const s=typeof n=="object"&&"breakpoints"in n,o=Je(s);if(s&&typeof n=="object"&&typeof o=="number"){const u=Object.assign({},n.breakpoints),m=aa(Object.keys(u));i=ia(o,m,u)}const{breakpoints:c,text:f="",component:l,...d}=n;return a.jsx($e,{variant:"subtle",className:$("empty-state-box",t,r),children:a.jsxs(a.Fragment,{children:[e&&typeof e=="string"?a.jsx(Qe,{options:{forceBlock:!0},children:e}):e,i&&typeof n=="object"&&(l||a.jsx(re,{...d,variant:n.variant?n.variant:"secondary",children:f}))]})})};const Fn=({children:t,...e})=>a.jsx("p",{...e,children:t}),ga={q:Fn,blockquote:Fn};for(let t=1;t<=6;t++)ga[`h${t}`]={component:Fn,props:{className:"title"}};const va=({type:t="default",className:e="",heading:n=!1,children:r})=>a.jsxs("div",{className:$("helper-text-box text-small",t,e),children:[n&&a.jsx("p",{className:"title",children:n}),typeof r=="string"?a.jsx(Qe,{options:{wrapper:g.Fragment,forceBlock:!0,overrides:ga},children:r}):a.jsx("p",{children:r})]});const hs=({className:t="",show:e=!1,hide:n=!1,text:r,children:i})=>{const s=U.useIntl(),o=g.useRef(null),[c,f]=g.useState(""),[l,d]=g.useState("closed");g.useEffect(()=>{const p=o.current;if(p)return p.addEventListener("transitionend",u),()=>{p.removeEventListener("transitionend",u)}},[]),g.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:"Write a {action}...",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_responses_placeholder:"Write a comment...",discussion_thread_show:"Show {count} {count, select, 1 {reply} other {replies}}",discussion_thread_hide:"Hide replies",discussion_thread_loadMore:"Load more replies",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",dropdown_menu_multiselect_all:"All",dropdown_menu_multiselect_none:"None",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_cancel:"Cancel",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",form_success:"Thank you for submitting the form!",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their 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",inputAutocomplete_placeholder:"Start typing...",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",profile_image_change_uploading_text:"Uploading image...",profile_image_change_cta_with_picture:"Change photo",profile_image_change_cta_without_picture:"+ Add profile photo",profile_image_change_error:"There was an error uploading the image. Please try a different file format or reduce the file size to less than 5MB. Contact us if problem persists.",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",showpassword_show:"Show",showpassword_hide:"Hide",showpassword_aria_show:"Your password is hidden. Click to show.",showpassword_aria_hide:"Your password is visible. Click to hide.",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",tooltip_loading:"Loading...",return_to_nav_button:"Back to top",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_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",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",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",progressBar:"{number}% loaded",inviteModal_title:"You’re registered",overlay_close:"Close",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",filters_all:"Show all",filters_disabled:"{name} - no results",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",moreMenu:"See more options",navigationMenu_links_homepage:"Home",navigationMenu_links_events:"Events",navigationMenu_links_microcourses:"Courses","navigationMenu_links_q-and-a":"Q&A",navigationMenu_links_articles:"Articles",navigationMenu_profile:"My profile",shareLinks_label:"Share",shareLinks_link_linkedin:"Share on LinkedIn",shareLinks_link_twitter:"Share on Twitter",shareLinks_link_facebook:"Share on Facebook",shareLinks_link_email:"Share by email","shareLinks_link_clipboard-copy":"Copy the link",tags_community:"From the community",edit_section_placeholder_description:"Add some details",edit_section_placeholder_cta:"add",notFoundError_title:"We can't find that page",notFoundError_text:"Sorry about that. We all mess up sometimes - read some ‘fail’ stories below.",notFoundError_post_1:"Why public servants must learn to fail — and 3 tips for how to do it",notFoundError_post_2:"What failure has taught me",notFoundError_post_3:"How to learn from failure without causing a scandal",notFoundError_cta:"View more articles",collapsibleSection_summary:"Find out more",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll"},Zi={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>"},Wi={languageSwitcher_label:"Je voudrais lire cet article dans...",languageSwitcher_translation_original:"langue originale",languageSwitcher_translation_human:"traduit par un humain",languageSwitcher_translation_machine:"traduit par machine",languageSwitcher_disclaimer:"Ce contenu est traduit automatiquement et contiendra d’évantuelles erreurs de genre ou d’autres traductions directes. Nous essayons de résoudre ce problème, mais en attendant, si vous remarquez une erreur importante, faites-le nous savoir à <link>{email}</link>",collapsibleSection_summary:"En savoir plus"},Hi={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>"},Vi=Object.freeze(Object.defineProperty({__proto__:null,en:Bn,es:Zi,fr:Wi,pt:Hi},Symbol.toStringTag,{value:"Module"})),ca=t=>t in Bn,ke=(t,e,n,r,i={})=>{let s="";return ca(`${e}_${n}`)?s=t({id:`${e}_${n}`},i):s=t({id:e},{[r]:n,...i}),s},Yi=(t,e,n)=>{if(!t||t===0)return"0";e||(e=0),n||(n=["k","m","b","t"]);let r=t.toString();e=Math.pow(10,e);for(let i=n.length-1;i>=0;i--){const s=Math.pow(10,(i+1)*3);if(s<=t){t=Math.round(t*e/s)/e,t===1e3&&i<n.length-1&&(t=1,i++),r=`${t}${n[i]}`;break}}return r},Ft=(t,e)=>g.Children.map(t,n=>Object.is(n,null)?n:g.cloneElement(n,{...e})),la=(t=0)=>{setTimeout(()=>{const e=document.querySelector(".splash-screen");e&&e.remove(),window.prerenderReady=!0},t)},Ki=t=>t.replace(/\s+/g,"").length>0,Gi=t=>{const e=t.length>8,n=/[0-9]/.test(t)&&/[`!@#$%^&*()_+\-=[\]{}£;':"\\|,.<>/?~]/.test(t),r=new RegExp("^(?=.*?[A-Z])(?=.*?[a-z])").test(t);return{isValid:e&&n&&r,matchingRules:{isMoreThanEightCharacters:e,includesNumberAndSymbol:n,includesLowerAndUppercase:r}}},re=({variant:t="primary",size:e="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:i=!1,element:s="button",onClick:o=!1,className:c="",disabled:f=!1,screenreaderText:l=!1,children:d=!1,...u})=>{const p=Je(typeof e=="object");if(typeof e=="object"&&typeof p=="number"){const x=Object.assign({},e),v=aa(Object.keys(x));e=ia(p,v,x)}const b=[];typeof e=="string"&&b.push(e),r&&(b.push("icon"),typeof r=="object"?(b.push(r.icon),r.position?b.push(r.position):b.push("left"),r.hover&&b.push(`hover_${r.hover}`),r.animate&&(b.push("animate"),typeof r.animate=="string"&&b.push(r.animate))):(b.push(r),!r.includes("right")&&!r.includes("left")&&b.push("left"))),n.muted&&b.push("muted"),n.fullWidth&&b.push("full-width");const y={...u,className:C(t,c,b,{"no-text":!d,disabled:f,button:i}),onClick:x=>{(!i||i[0]==="#")&&o&&(x.preventDefault(),x.stopPropagation()),o&&o(x)},disabled:typeof f=="object"&&"isClickable"in f?!f.isClickable:f};return i&&(s="a",y.href=i),g.createElement(s,y,d||(l?a.jsx(ge,{showOnFocus:!1,children:l}):null))},Xe=({buttons:t,className:e="",...n})=>{const r=t.length>1?"ul":"p",i=t.map((s,o)=>r==="p"?a.jsx(re,{...s},o):a.jsx("li",{children:a.jsx(re,{...s})},o));return g.createElement(r,{className:C("button-wrapper",e),...n,children:i})};const je=({className:t="",maxWidth:e=!1})=>{const n=e?{"--max-width":`${e/16}rem`}:{};return a.jsx("hr",{className:C(t,{"has-max-width":e}),style:n})},vr={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"}},Qi=({aspect:t,range:e,sizes:n})=>{const{range:r,sizes:i}=t?vr[t]:vr.fallback;return{range:e&&e.length>0?e:r,sizes:n||i}},Ji=({format:t,height:e,query:n,width:r})=>{let i=`w=${r}&h=${e}`;return i=t?`${i}&fm=${t}`:i,i=n?`${i}&${n}`:i,i},cn=({format:t,range:e,url:n,query:r})=>e.map(({height:i,width:s})=>`${n}?${Ji({format:t,height:i,query:r,width:s})} ${s}w`).join(", ");const et=({image:t,className:e,testId:n})=>{const{description:r,height:i,type:s,query:o,url:c,width:f,loading:l,decoding:d,fetchPriority:u}=t,{range:m,sizes:p}=Qi(t),b=cn({format:"avif",query:o,range:m,url:c}),y=cn({format:"webp",query:o,range:m,url:c}),x=cn({format:"",query:o,range:m,url:c});return a.jsxs("picture",{className:e,children:[s!=="image/gif"&&a.jsx("source",{type:"image/avif",srcSet:b,sizes:p,"data-testid":"source"}),a.jsx("source",{type:"image/webp",srcSet:y,sizes:p,"data-testid":"source"}),a.jsx("img",{srcSet:x,sizes:p,src:c,alt:r,loading:l||"lazy",decoding:d||"async",fetchpriority:u||"auto",width:f,height:i,"data-testid":n||"image"})]})};const Xi=({image:t,className:e,testId:n})=>a.jsx("div",{className:`image-container ${e}`,"data-testid":n||"image-container",children:t&&a.jsx(et,{image:{...t},className:"image"})}),tt=({href:t,children:e,fallbackElement:n,className:r="",onClick:i,gtmContext:s,gtmType:o,...c})=>{if(t){const f={...c};return i&&(f.onClick=i),s&&(f["data-gtm-event-context"]=s),o&&(f["data-gtm-event-type"]=o),a.jsx("a",{href:t,className:C("gtm-trackable",r),...f,children:e})}return n?g.createElement(n,{children:e,className:r,...c}):e};const es=({elementId:t,offset:e=20})=>{const n=q.useIntl(),r=()=>{const i=document.getElementById(t);if(!i)return;const s=document.getElementById("header");s&&window.scrollTo({top:i.offsetTop-s.clientHeight-e})};return a.jsx(re,{variant:"secondary",className:"return-to-nav",onClick:r,"data-gtm-event-context":"ListPageMobile","data-gtm-event-type":"back-to-nav-button-click",screenreaderText:n.formatMessage({id:"return_to_nav_button"})})};let it=!1;const ua=({isOpen:t=!1,isLoading:e=!1,children:n})=>{const r=q.useIntl(),i=g.useRef(null),[s,o]=g.useState("hidden");g.useEffect(()=>{const f=i.current;if(f)return f.addEventListener("transitionend",c),()=>{f.removeEventListener("transitionend",c)}},[]);const c=({propertyName:f})=>{f==="opacity"&&(it!==!1&&clearTimeout(it),o(l=>l==="opening"?"open":l==="closing"?"closed":l==="closed"?"hidden":l))};return Ye(()=>{it!==!1&&clearTimeout(it);let f="open";t?o("opening"):(o("closing"),f="hidden"),it=setTimeout(()=>{o(f)},300)},[t]),a.jsx("aside",{ref:i,className:C("tooltip text-medium",s,{loading:e}),hidden:s==="hidden",children:e?a.jsx("p",{children:r.formatMessage({id:"tooltip_loading"})}):typeof n=="string"?a.jsx("p",{children:n}):n})};const ts=({className:t="",image:e,...n})=>e?(typeof e=="string"&&(e={width:1080,height:200,type:"image/png",url:e}),e.range=[{height:124,width:425},{height:200,width:768},{height:200,width:1368}],e.query="fit=thumb&f=center",a.jsx(et,{...n,className:C("banner",t),image:{...e,aspect:"banner"}})):null;const Le=({children:t,className:e="",styling:n={},...r})=>{const{background:i="default"}=n;return a.jsx("section",{className:C("full-width-section",e,{[i]:i!=="default"}),...r,children:t})};const ns=({text:t,buttons:e,className:n=""})=>{const r=[];return e.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})}),a.jsx(Le,{className:C("download-section",n),children:a.jsxs(a.Fragment,{children:[g.createElement(typeof t=="string"?"h2":t.element,{className:"text"},typeof t=="string"?t:t.text),a.jsx(Xe,{buttons:r})]})})};function da({href:t,setShowModal:e}){typeof t!="string"&&e(!0)}const rs=({icon:t,description:e,ctaMessage:n,href:r,showEditButton:i,setShowModal:s})=>{const{formatMessage:o}=q.useIntl();return a.jsxs("div",{className:C("edit-section-placeholder",{"has-icon":!!t}),style:sa(t),children:[a.jsx("p",{children:e||o({id:"edit_section_placeholder_description"})}),i&&a.jsx(re,{href:r,variant:"secondary",size:"small",onClick:()=>da({href:r,setShowModal:s}),children:n||o({id:"edit_section_placeholder_cta"})})]})},as=({children:t,className:e="",formProps:n,href:r,title:i,modalTitle:s,placeholder:o,showDivider:c=!0})=>{const[f,l]=g.useState(!1),d=typeof r=="string"||!!n,u=()=>l(!1);return a.jsxs("section",{className:C("edit-section",e),children:[n&&a.jsx(bt,{title:s||`Edit ${i}`,isOpen:f,showDivider:!1,showIcon:!1,functions:{onClose:u},className:C("edit-section-modal"),children:a.jsx(Qt,{...n,fields:n.fields,meta:{...n==null?void 0:n.meta,shouldShowCancelButton:!0,shouldReset:!1,showSuccessMessage:!0},functions:{...n==null?void 0:n.functions,onSuccess:async m=>{var p,b;(p=n==null?void 0:n.functions)!=null&&p.onSuccess&&await((b=n==null?void 0:n.functions)==null?void 0:b.onSuccess(m)),l(!1)},onCancel:u}})}),a.jsxs("div",{className:"edit-section-header",children:[a.jsx("h2",{className:"edit-section-header-title",children:i}),d&&a.jsx(re,{href:r,variant:"tertiary",size:"small",icon:"pencil",onClick:()=>da({href:r,setShowModal:l}),children:"Edit"})]}),t||a.jsx(rs,{...o,href:r,setShowModal:l,showEditButton:d}),c&&a.jsx(je,{})]})};const is=({title:t=!1,logos:e=[],className:n=""})=>{const r=e.length;if(r===0)return null;const i={element:typeof t=="object"?t.element:"h2",text:typeof t=="string"?t:typeof t=="object"?t.text:""};return a.jsxs("div",{className:C("logos",n),children:[t&&g.createElement(i.element,{className:"title"},i.text),a.jsx("ul",{className:C({"two-col":r===2||r===4,"three-col":r===5||r<=10&&r%3===0}),children:e.map(({logo:s,nameOfBusiness:o,link:c=!1,description:f=!1},l)=>{if(!s||!s.url)return null;const d=a.jsx("img",{src:s.url,width:s.width||"auto",height:s.height||"auto",alt:o});return a.jsxs("li",{children:[a.jsx("p",{className:"img-wrapper",children:c?a.jsx("a",{href:c,target:"_blank",rel:"nofollow noreferrer noopener",children:d}):d}),f&&a.jsx("small",{children:f})]},window.btoa(`${s.url}_${l}`))})})]})};const ss=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],os=({className:t="",content:e,image:n,variant:r="default",spacing:i="normal",hideElements:s={eyebrow:!1,title:!1,text:!1},cta:o,children:c})=>{const f=["eyebrow","title","text"],l={eyebrow:"small",title:"h1",text:"p"},d={};return f.forEach(u=>{if(!e[u]){d[u]=!1;return}if(!s[u]){if(typeof e[u]=="object"){d[u]=e[u];const{text:m,element:p}=e[u];if(p&&ss.includes(p.toLowerCase()))return;d[u]={text:m,element:l[u]};return}d[u]={text:e[u],element:l[u]}}}),o&&o.link&&o.link[0]==="#"&&(o.props||(o.props={}),o.props.onClick=u=>{u.preventDefault(),u.stopPropagation();const m=document.getElementById(o.link.substring(1));m&&m.scrollIntoView({behavior:"smooth"})}),a.jsx(Le,{className:C("banner-section",r,i,t,{"has-image":n,"has-extra-spacing":i==="normal"&&d.eyebrow&&d.title}),children:a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"content-wrapper",children:[f.map(u=>{if(d[u]&&typeof d[u]=="object"){const{text:m,element:p=""}=d[u];return u==="text"?a.jsx(pt,{overrideType:"text-only",className:"text",children:m},u):g.createElement(p,{key:u,className:u},m)}return null}),c,o&&o.text&&o.link&&a.jsx(re,{variant:n||r==="light"?"primary":"secondary",size:{mobile:"medium",768:"large"},href:o.link,...o.props,children:o.text})]}),n&&a.jsx(et,{image:{...n,aspect:"banner"}})]})})},cs=g.memo(os);const ls=({alignImage:t="left",className:e,content:n,image:r})=>{const i=()=>typeof n=="string"?a.jsx(Qe,{children:n}):n;return a.jsxs(Le,{className:C("highlight-section",e),children:[r&&a.jsx("div",{className:C("highlight-container highlight-image",{[`highlight-image-${t}`]:t==="right"}),children:a.jsx(et,{image:r})}),a.jsx("div",{className:C("highlight-container highlight-content-wrapper",{"no-image":!r}),children:a.jsx("div",{className:C("highlight-content",{"highlight-content-right":t==="left"}),children:i()})})]})},us=g.memo(ls);const ds=({variant:t="primary",button:e=null,title:n,text:r,gtmContext:i})=>!n&&!r?null:a.jsxs("aside",{className:C("marketing-block",t),children:[n&&a.jsx("p",{className:"title",children:n}),r&&a.jsx("p",{children:r}),e&&a.jsx(re,{variant:"secondary",size:"medium",href:e.link,className:"gtm-trackable","data-gtm-event-context":i,"data-gtm-event-type":"learn-more-click",children:e.text})]}),fa=({showDevTools:t=!0,children:e})=>{const n=new me.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return a.jsxs(me.QueryClientProvider,{client:n,children:[e,t&&a.jsx(Ci.ReactQueryDevtools,{initialIsOpen:!1})]})};var fs=g.createContext({client:Rt});function ms(t){var e=t.children,n=t.client,r=t.apiKey,i=t.options,s=g.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&&(Rt.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),Rt.init(r,i)),Rt)},[n,r]);return g.createElement(fs.Provider,{value:{client:s}},e)}const ma=({children:t,user:e})=>e.isLoading?null:process.env.REACT_APP_PUBLIC_POSTHOG_KEY?a.jsx(ms,{apiKey:atob(process.env.REACT_APP_PUBLIC_POSTHOG_KEY),options:{api_host:"/ph",autocapture:!1,disable_session_recording:!0,persistence_name:"flags",secure_cookie:!0,ui_host:"eu.posthog.com",bootstrap:{distinctID:e.id||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!e.id}},children:t}):t,pa=({children:t,locale:e,messages:n})=>{const r=e||"en",i={...Vi[r],...n||{}};return a.jsx(q.IntlProvider,{locale:r,messages:i,children:t})},Te=g.createContext({isLoading:!0});function Kt(){return g.useContext(Te)}const ha=({children:t,user:e})=>a.jsx(Te.Provider,{value:e,children:t}),ps=({bootstrap:t,children:e,intl:n,showDevTools:r})=>{const[i,s]=g.useState({isLoading:!0});return g.useEffect(()=>{t().then(o=>{s({...o,isLoading:!1}),la(5e3)}).catch(()=>s({isLoading:!1}))},[]),a.jsx(pa,{locale:n==null?void 0:n.locale,messages:n==null?void 0:n.messages,children:a.jsx(Ln.CookiesProvider,{children:a.jsx(ha,{user:i,children:a.jsx(fa,{showDevTools:r,children:a.jsx(ma,{user:i,children:e})})})})})};const qn=({label:t=!1,className:e="",children:n})=>{const r=q.useIntl();return a.jsxs("details",{className:C("collapsible-section",e),children:[a.jsx("summary",{children:t||r.formatMessage({id:"collapsibleSection_summary"})}),a.jsx("div",{className:"content",children:n})]})};const $e=({variant:t="primary",icon:e,className:n="",children:r,...i})=>{const s=e?{"--icon":`url(${Ae}icons/${e}.svg)`}:{};return a.jsx("div",{className:C("highlighted-text-box",t,n,{"has-icon":e}),style:s,...i,children:r})};const Be=({variant:t="empty",text:e=!1,button:n=!1,className:r=""})=>{let i=n&&!!Object.keys(n).length;const s=typeof n=="object"&&"breakpoints"in n,o=Je(s);if(s&&typeof n=="object"&&typeof o=="number"){const u=Object.assign({},n.breakpoints),m=aa(Object.keys(u));i=ia(o,m,u)}const{breakpoints:c,text:f="",component:l,...d}=n;return a.jsx($e,{variant:"subtle",className:C("empty-state-box",t,r),children:a.jsxs(a.Fragment,{children:[e&&typeof e=="string"?a.jsx(Qe,{options:{forceBlock:!0},children:e}):e,i&&typeof n=="object"&&(l||a.jsx(re,{...d,variant:n.variant?n.variant:"secondary",children:f}))]})})};const Fn=({children:t,...e})=>a.jsx("p",{...e,children:t}),ga={q:Fn,blockquote:Fn};for(let t=1;t<=6;t++)ga[`h${t}`]={component:Fn,props:{className:"title"}};const va=({type:t="default",className:e="",heading:n=!1,children:r})=>a.jsxs("div",{className:C("helper-text-box text-small",t,e),children:[n&&a.jsx("p",{className:"title",children:n}),typeof r=="string"?a.jsx(Qe,{options:{wrapper:g.Fragment,forceBlock:!0,overrides:ga},children:r}):a.jsx("p",{children:r})]});const hs=({className:t="",show:e=!1,hide:n=!1,text:r,children:i})=>{const s=q.useIntl(),o=g.useRef(null),[c,f]=g.useState(""),[l,d]=g.useState("closed");g.useEffect(()=>{const p=o.current;if(p)return p.addEventListener("transitionend",u),()=>{p.removeEventListener("transitionend",u)}},[]),g.useEffect(()=>{if(!r||typeof r!="string")return;const p=r.split(`
|
|
36
36
|
`);f(p.length<3?`${r.substring(0,400)}...`:p.slice(0,3).join(`
|
|
37
|
-
`))},[r]),g.useEffect(()=>{l==="ready-to-close"&&d("closing")},[l]);const u=({propertyName:p})=>{p==="max-height"&&d(b=>b==="opening"?"open":b==="closing"?"closed":b)};if(!r)return null;const m=["opening","open"].includes(l);return a.jsxs($e,{variant:"subtle",className:$("hide-show-text-box",t),children:[a.jsxs("div",{ref:o,className:$("content",l),children:[a.jsx(Qe,{options:{forceBlock:!0},children:l==="closed"?c:r}),l!=="closed"&&i]}),a.jsx("p",{className:"cta",children:a.jsx(re,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:$({"rotate-180":m}),onClick:()=>{d(m?"ready-to-close":"opening")},children:m?n||s.formatMessage({id:"hideShowTextBox_hide"}):e||s.formatMessage({id:"hideShowTextBox_show"})})})]})},ve=()=>g.Fragment,gs=({children:t})=>a.jsx($e,{variant:"secondary",children:t}),vs=["span","strong","h1","h2","h3","h4","h5","h6","p"],bs=({children:t})=>{const e=U.useIntl();if(!t)return null;let n=e.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const s of g.Children.toArray(t))if(!(!s||typeof s=="string"||typeof s=="number"))if(g.isValidElement(s)&&s.type==="summary"){if(s.props&&s.props.children){for(const o of g.Children.toArray(s.props.children))if(!(!o||typeof o=="string"||typeof o=="number")&&g.isValidElement(o)){const c=o.type;if(vs.includes(c)){for(n=o.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(s);const i=n?n.toString():"";return a.jsx(qn,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:r.map(s=>s)})},ys=({children:t,...e})=>{if(e.class)switch(e.class){case"casestudy":return a.jsx($e,{variant:"secondary",children:t});case"general-textbox":case"highlight-box":return a.jsx($e,{variant:"primary",children:t});case"pink-textbox":return a.jsx($e,{variant:"tertiary",children:t});default:return a.jsx("div",{...e,children:t})}return a.jsx("div",{...e,children:t})},_s=t=>{const e=U.useIntl(),n=Date.now().toString();let r="default";const i=t.src;return i.includes("youtube")||i.includes("vimeo")?r="video":i.includes("riddle")||i.includes("sli.do")?r="poll":i.includes("padlet")&&(r="padlet"),a.jsxs(a.Fragment,{children:[a.jsx(ge,{children:a.jsx("a",{href:`#content-after-iframe-${n}`,children:e.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})})}),a.jsx("iframe",{...t,title:e.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),a.jsx("span",{id:`content-after-iframe-${n}`,tabIndex:-1})]})},br=t=>{let e="";return t&&typeof t!="string"&&typeof t!="number"&&typeof t!="boolean"&&"type"in t&&(e=t.type),e},xs=({children:t,...e})=>{let n={...e};e.href&&(e.href.includes("http:")||e.href.includes("https:"))&&!e.target&&(n.target="_blank");let r=t,i=!1;for(const s of g.Children.toArray(t))if(!(!s||typeof s=="string"||typeof s=="number")&&g.isValidElement(s)){const o=s.type;if(["button","center","span","strong"].includes(o)&&s.props&&s.props.children&&s.props.children[0])for((o==="button"||br(s.props.children[0])==="button")&&(i=!0),r=s.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!g.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&br(r)==="button"&&(i=!0);else break}return i?(n={...n,className:"button primary medium"},a.jsx("p",{className:"center",children:a.jsx(re,{variant:"primary",size:"medium",...n,children:r})})):a.jsx("a",{...n,children:r})},ba=({children:t})=>a.jsx("span",{children:t});const ws={default:{a:xs,CollapsibleSection:qn,TextBox:$e,CaseStudy:gs,style:ve,details:bs,div:ys,iframe:_s},"text-only":{h1:ve,h2:ve,h3:ve,h4:ve,h5:ve,h6:ve,style:ve,details:ve,div:ve,TextBox:ve,CollapsibleSection:ve,CaseStudy:ve,blockquote:ve,iframe:ve,button:ve}},mt=({className:t="",options:e={},children:n,overrideType:r="default"})=>{n=n.replace(/^<br\/?>/,"");const i={wrapper:g.Fragment,forceBlock:!0,overrides:ws[r]};return a.jsx("div",{className:$("markdown-text",t),children:a.jsx(Qe,{options:{...i,...e},children:n})})};const ya=({maxWidth:t=!1,title:e,subtitle:n,children:r,className:i=""})=>{const s=t?{"--max-width":`${t/16}rem`}:{};return a.jsxs("section",{className:$("page-heading",i),children:[a.jsxs("div",{className:$("content",{"has-max-width":t}),style:s,children:[e&&e.text&&g.createElement(e.element||"h1",{className:"title"},e.text),n&&n.text&&g.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),r]})};const pt=({size:t="medium",variant:e="default",className:n="",children:r,...i})=>a.jsx("span",{className:$("pill",t,e,n),...i,children:r});const ht=({element:t="p",children:e=null,className:n="",...r})=>g.createElement(t,{...r,className:$("status-banner text-small",n),"aria-live":"assertive"},e);const ks=({author:t,authorCite:e,content:n})=>a.jsxs("blockquote",{className:"testimonial-block",children:[a.jsx(Qe,{className:"testimonial",children:n}),t&&a.jsx("p",{className:"author text-small",children:t}),e&&a.jsx("p",{className:"author-cite text-small",children:a.jsx("cite",{children:e})})]}),js=g.memo(ks);const Ts=({progress:t=0,text:e=!1,className:n=""})=>{const r=U.useIntl(),i=t>75?100:t>50?75:t>25?50:t>5?25:0,s={"--progress":`${t}%`};return a.jsx("span",{className:$(`progress-bar section-${i}`,n),style:s,children:a.jsx(ge,{children:e?`${t} ${e}`:r.formatMessage({id:"progressBar"},{number:t})})})},_a=g.memo(Ts);const ln="loadingBlock_",Es=({progress:t=0,steps:e=!1,className:n=""})=>{const r=U.useIntl();e||(e={0:{text:r.formatMessage({id:`${ln}loading`})},75:{text:r.formatMessage({id:`${ln}almostDone`})},100:{text:r.formatMessage({id:`${ln}complete`})}});let i=null;const s=Object.keys(e);for(let c=0;c<s.length&&!(t<parseInt(s[c]));c++)i=s[c];const o=i&&e[i].icon?{"--icon":`url(${Ae}icons/${e[i].icon}.svg)`}:{};return a.jsxs($e,{className:$("loading-block",n,{"has-icon":i&&e[i].icon}),variant:"subtle",style:o,children:[i&&a.jsx("span",{className:"step",children:e[i].text}),a.jsx(_a,{progress:t})]})},Ss=g.memo(Es);const xe=({element:t="div",className:e="",...n})=>a.jsx(Yt,{element:t,className:$("loading-placeholder",e),...n});const On={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"],"general-website-page":["banner","title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"]},xa=(t,e)=>t in On?a.jsx("div",{className:t,children:On[t].map((n,r)=>xa(n,r))},e):a.jsx(xe,{className:t},e),Un=({layout:t="overview-page",...e})=>a.jsx("div",{className:$("loading-state",t),...e,children:On[t].map((n,r)=>xa(n,r))}),wa=t=>{const e=t&&t.toUpperCase().split(" ");return Array.isArray(e)&&e.length>1&&e[0]!==""?e[1]===""?e[0][0]:e[0][0]+e[e.length-1][0]:t?t.substr(0,1):""},wt=["#5AB6A3","#A2D7AF","#806056","#3962B3"],Cs=t=>{const e=Math.ceil(26/wt.length),n=wa(t).toLowerCase();if(n==="")return wt[0];const r=n.charCodeAt(0)-96;for(let i=0;i<wt.length;i++)if(r<=e*(i+1))return wt[i]};const yr=256,Re=({className:t="",src:e="",name:n,alt:r,width:i=yr,height:s=yr,...o})=>{const[c,f]=g.useState(!1),l=g.useRef(null);g.useEffect(()=>{const u=l.current;if(!u)return;const m=u.getContext("2d");if(!m)return;const p=i,b=s;typeof window<"u"&&window.devicePixelRatio&&(u.width=p*window.devicePixelRatio,u.height=b*window.devicePixelRatio,m.scale(window.devicePixelRatio,window.devicePixelRatio)),m.fillStyle=Cs(n),m.fillRect(0,0,p,b),m.font=`${p/3}px Arial`,m.textAlign="center",m.fillStyle="white",m.fillText(wa(n),p/2,b/1.6)},[n]);let d=!1;return e&&e!==""&&!c&&(e.includes("http")||e.includes("//"))&&(d=!0),a.jsx("figure",{className:$("profile-picture",t,{error:c}),...o,children:d?a.jsx("img",{src:e,alt:r||n,onError:()=>{f(!0)},width:i,height:s}):a.jsx("canvas",{ref:l})})},zn=t=>t==="apolitical"?{image:`${Ae}logos/member_apolitical.svg`}:t==="community"||typeof t=="object"&&!t.name?{image:`${Ae}logos/member_community.svg`}:{name:t.name,role:t.jobTitle||"",organisation:t.organization||"",country:t.location&&t.location.country||"",url:`/profiles/${t.id}`,image:t.image&&t.image.thumbnail},Ns=({role:t="",organisation:e="",country:n="",maximumCharacters:r=80})=>{const i=t!=="",s=e!=="",o=n!=="";if(!i&&!s&&!o)return"";const c=`${t}${i&&s?` — ${e}`:e}`;let f=`${c}${(i||s)&&o?`, ${n}`:n}`;return f.length>r&&(f=c),f.length>r&&(f=Ve(f,r)),f};const Gt=({element:t="div",member:e="community",additionalContent:n=!1,gtmContext:r="member",gtmType:i="member-click",className:s=""})=>{const o=U.useIntl(),c=zn(e);c.name||(c.name=o.formatMessage({id:`member_${typeof e=="string"?e:"community"}`}));const{name:f,url:l,image:d}=c,u=Ns(c),m=n&&n.createdAt?Rn(n.createdAt):!1,p=n&&n.createdAt?oa(n.createdAt):"";return g.createElement(t,{className:$("member text-medium",s),children:a.jsxs(et,{href:l,gtmType:i,gtmContext:r,onClick:b=>{b==null||b.stopPropagation()},children:[a.jsx(Re,{name:f,src:d}),a.jsxs("p",{className:"details",children:[a.jsx("strong",{children:f}),n&&a.jsxs("span",{className:"additional-content",children:[n.createdAt&&m&&a.jsx("span",{className:"date",title:p,"aria-label":p,children:o.formatMessage({id:`dates_${m.path}`},{number:m.number})}),n.didEdit&&a.jsx("em",{children:o.formatMessage({id:"discussion_edited"})})]}),u&&a.jsx("small",{children:u})]})]})})};const _r={small:24,medium:48},Zn=({element:t="div",contributors:{total:e,data:n}={total:void 0,data:[]},styling:{showText:r,size:i,showGap:s,showPlaceholders:o}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:c=2,className:f="",...l})=>{const d=U.useIntl();return!n||n.length===0?null:g.createElement(t,{...l,className:$("contributors",f,i,{"has-gap":s}),children:a.jsxs(a.Fragment,{children:[a.jsx("ul",{children:n.map((u,m)=>{let p,b="";if(m<c){const{name:y="",image:x=""}=zn(u);if(o)return a.jsx(xe,{element:"li",className:"contributor"},m);p=a.jsx(Re,{name:y,src:x,width:_r[i||"medium"],height:_r[i||"medium"]})}else if(m===c){const y=(e||n.length)-c;p=a.jsxs("small",{className:$({"large-number":y>99}),children:["+",Yi(y,0)]}),b="number-left"}return p?a.jsx("li",{className:$("contributor",b),children:p},m):null})}),r&&a.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?d.formatMessage({id:`member_${n[0]}`}):Ve(n[0].name||"",20):null})]})})};var Dn={exports:{}},kt={exports:{}},ce={};/** @license React v16.13.1
|
|
37
|
+
`))},[r]),g.useEffect(()=>{l==="ready-to-close"&&d("closing")},[l]);const u=({propertyName:p})=>{p==="max-height"&&d(b=>b==="opening"?"open":b==="closing"?"closed":b)};if(!r)return null;const m=["opening","open"].includes(l);return a.jsxs($e,{variant:"subtle",className:C("hide-show-text-box",t),children:[a.jsxs("div",{ref:o,className:C("content",l),children:[a.jsx(Qe,{options:{forceBlock:!0},children:l==="closed"?c:r}),l!=="closed"&&i]}),a.jsx("p",{className:"cta",children:a.jsx(re,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:C({"rotate-180":m}),onClick:()=>{d(m?"ready-to-close":"opening")},children:m?n||s.formatMessage({id:"hideShowTextBox_hide"}):e||s.formatMessage({id:"hideShowTextBox_show"})})})]})},ve=()=>g.Fragment,gs=({children:t})=>a.jsx($e,{variant:"secondary",children:t}),vs=["span","strong","h1","h2","h3","h4","h5","h6","p"],bs=({children:t})=>{const e=q.useIntl();if(!t)return null;let n=e.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const s of g.Children.toArray(t))if(!(!s||typeof s=="string"||typeof s=="number"))if(g.isValidElement(s)&&s.type==="summary"){if(s.props&&s.props.children){for(const o of g.Children.toArray(s.props.children))if(!(!o||typeof o=="string"||typeof o=="number")&&g.isValidElement(o)){const c=o.type;if(vs.includes(c)){for(n=o.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(s);const i=n?n.toString():"";return a.jsx(qn,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:r.map(s=>s)})},ys=({children:t,...e})=>{if(e.class)switch(e.class){case"casestudy":return a.jsx($e,{variant:"secondary",children:t});case"general-textbox":case"highlight-box":return a.jsx($e,{variant:"primary",children:t});case"pink-textbox":return a.jsx($e,{variant:"tertiary",children:t});default:return a.jsx("div",{...e,children:t})}return a.jsx("div",{...e,children:t})},_s=t=>{const e=q.useIntl(),n=Date.now().toString();let r="default";const i=t.src;return i.includes("youtube")||i.includes("vimeo")?r="video":i.includes("riddle")||i.includes("sli.do")?r="poll":i.includes("padlet")&&(r="padlet"),a.jsxs(a.Fragment,{children:[a.jsx(ge,{children:a.jsx("a",{href:`#content-after-iframe-${n}`,children:e.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})})}),a.jsx("iframe",{...t,title:e.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),a.jsx("span",{id:`content-after-iframe-${n}`,tabIndex:-1})]})},br=t=>{let e="";return t&&typeof t!="string"&&typeof t!="number"&&typeof t!="boolean"&&"type"in t&&(e=t.type),e},xs=({children:t,...e})=>{let n={...e};e.href&&(e.href.includes("http:")||e.href.includes("https:"))&&!e.target&&(n.target="_blank");let r=t,i=!1;for(const s of g.Children.toArray(t))if(!(!s||typeof s=="string"||typeof s=="number")&&g.isValidElement(s)){const o=s.type;if(["button","center","span","strong"].includes(o)&&s.props&&s.props.children&&s.props.children[0])for((o==="button"||br(s.props.children[0])==="button")&&(i=!0),r=s.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!g.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&br(r)==="button"&&(i=!0);else break}return i?(n={...n,className:"button primary medium"},a.jsx("p",{className:"center",children:a.jsx(re,{variant:"primary",size:"medium",...n,children:r})})):a.jsx("a",{...n,children:r})},ba=({children:t})=>a.jsx("span",{children:t});const ws={default:{a:xs,CollapsibleSection:qn,TextBox:$e,CaseStudy:gs,style:ve,details:bs,div:ys,iframe:_s},"text-only":{h1:ve,h2:ve,h3:ve,h4:ve,h5:ve,h6:ve,style:ve,details:ve,div:ve,TextBox:ve,CollapsibleSection:ve,CaseStudy:ve,blockquote:ve,iframe:ve,button:ve}},pt=({className:t="",options:e={},children:n,overrideType:r="default"})=>{n=n.replace(/^<br\/?>/,"");const i={wrapper:g.Fragment,forceBlock:!0,overrides:ws[r]};return a.jsx("div",{className:C("markdown-text",t),children:a.jsx(Qe,{options:{...i,...e},children:n})})};const ya=({maxWidth:t=!1,title:e,subtitle:n,children:r,className:i=""})=>{const s=t?{"--max-width":`${t/16}rem`}:{};return a.jsxs("section",{className:C("page-heading",i),children:[a.jsxs("div",{className:C("content",{"has-max-width":t}),style:s,children:[e&&e.text&&g.createElement(e.element||"h1",{className:"title"},e.text),n&&n.text&&g.createElement(n.element||"h2",{className:"text-medium"},n.text)]}),r]})};const ht=({size:t="medium",variant:e="default",className:n="",children:r,...i})=>a.jsx("span",{className:C("pill",t,e,n),...i,children:r});const gt=({element:t="p",children:e=null,className:n="",...r})=>g.createElement(t,{...r,className:C("status-banner text-small",n),"aria-live":"assertive"},e);const ks=({author:t,authorCite:e,content:n})=>a.jsxs("blockquote",{className:"testimonial-block",children:[a.jsx(Qe,{className:"testimonial",children:n}),t&&a.jsx("p",{className:"author text-small",children:t}),e&&a.jsx("p",{className:"author-cite text-small",children:a.jsx("cite",{children:e})})]}),js=g.memo(ks);const Ts=({progress:t=0,text:e=!1,className:n=""})=>{const r=q.useIntl(),i=t>75?100:t>50?75:t>25?50:t>5?25:0,s={"--progress":`${t}%`};return a.jsx("span",{className:C(`progress-bar section-${i}`,n),style:s,children:a.jsx(ge,{children:e?`${t} ${e}`:r.formatMessage({id:"progressBar"},{number:t})})})},_a=g.memo(Ts);const ln="loadingBlock_",Es=({progress:t=0,steps:e=!1,className:n=""})=>{const r=q.useIntl();e||(e={0:{text:r.formatMessage({id:`${ln}loading`})},75:{text:r.formatMessage({id:`${ln}almostDone`})},100:{text:r.formatMessage({id:`${ln}complete`})}});let i=null;const s=Object.keys(e);for(let c=0;c<s.length&&!(t<parseInt(s[c]));c++)i=s[c];const o=i&&e[i].icon?{"--icon":`url(${Ae}icons/${e[i].icon}.svg)`}:{};return a.jsxs($e,{className:C("loading-block",n,{"has-icon":i&&e[i].icon}),variant:"subtle",style:o,children:[i&&a.jsx("span",{className:"step",children:e[i].text}),a.jsx(_a,{progress:t})]})},Ss=g.memo(Es);const xe=({element:t="div",className:e="",...n})=>a.jsx(Yt,{element:t,className:C("loading-placeholder",e),...n});const On={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"],"general-website-page":["banner","title","text","text","text","text","subtitle","text","text","text","text","subtitle","text","text","text","text"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"]},xa=(t,e)=>t in On?a.jsx("div",{className:t,children:On[t].map((n,r)=>xa(n,r))},e):a.jsx(xe,{className:t},e),Un=({layout:t="overview-page",...e})=>a.jsx("div",{className:C("loading-state",t),...e,children:On[t].map((n,r)=>xa(n,r))}),wa=t=>{const e=t&&t.toUpperCase().split(" ");return Array.isArray(e)&&e.length>1&&e[0]!==""?e[1]===""?e[0][0]:e[0][0]+e[e.length-1][0]:t?t.substr(0,1):""},wt=["#5AB6A3","#A2D7AF","#806056","#3962B3"],Cs=t=>{const e=Math.ceil(26/wt.length),n=wa(t).toLowerCase();if(n==="")return wt[0];const r=n.charCodeAt(0)-96;for(let i=0;i<wt.length;i++)if(r<=e*(i+1))return wt[i]};const yr=256,Re=({className:t="",src:e="",name:n,alt:r,width:i=yr,height:s=yr,...o})=>{const[c,f]=g.useState(!1),l=g.useRef(null);g.useEffect(()=>{const u=l.current;if(!u)return;const m=u.getContext("2d");if(!m)return;const p=i,b=s;typeof window<"u"&&window.devicePixelRatio&&(u.width=p*window.devicePixelRatio,u.height=b*window.devicePixelRatio,m.scale(window.devicePixelRatio,window.devicePixelRatio)),m.fillStyle=Cs(n),m.fillRect(0,0,p,b),m.font=`${p/3}px Arial`,m.textAlign="center",m.fillStyle="white",m.fillText(wa(n),p/2,b/1.6)},[n]);let d=!1;return e&&e!==""&&!c&&(e.includes("http")||e.includes("//"))&&(d=!0),a.jsx("figure",{className:C("profile-picture",t,{error:c}),...o,children:d?a.jsx("img",{src:e,alt:r||n,onError:()=>{f(!0)},width:i,height:s}):a.jsx("canvas",{ref:l})})},zn=t=>t==="apolitical"?{image:`${Ae}logos/member_apolitical.svg`}:t==="community"||typeof t=="object"&&!t.name?{image:`${Ae}logos/member_community.svg`}:{name:t.name,role:t.jobTitle||"",organisation:t.organization||"",country:t.location&&t.location.country||"",url:`/profiles/${t.id}`,image:t.image&&t.image.thumbnail},Ms=({role:t="",organisation:e="",country:n="",maximumCharacters:r=80})=>{const i=t!=="",s=e!=="",o=n!=="";if(!i&&!s&&!o)return"";const c=`${t}${i&&s?` — ${e}`:e}`;let f=`${c}${(i||s)&&o?`, ${n}`:n}`;return f.length>r&&(f=c),f.length>r&&(f=Ve(f,r)),f};const Gt=({element:t="div",member:e="community",additionalContent:n=!1,gtmContext:r="member",gtmType:i="member-click",className:s=""})=>{const o=q.useIntl(),c=zn(e);c.name||(c.name=o.formatMessage({id:`member_${typeof e=="string"?e:"community"}`}));const{name:f,url:l,image:d}=c,u=Ms(c),m=n&&n.createdAt?Rn(n.createdAt):!1,p=n&&n.createdAt?oa(n.createdAt):"";return g.createElement(t,{className:C("member text-medium",s),children:a.jsxs(tt,{href:l,gtmType:i,gtmContext:r,onClick:b=>{b==null||b.stopPropagation()},children:[a.jsx(Re,{name:f,src:d}),a.jsxs("p",{className:"details",children:[a.jsx("strong",{children:f}),n&&a.jsxs("span",{className:"additional-content",children:[n.createdAt&&m&&a.jsx("span",{className:"date",title:p,"aria-label":p,children:o.formatMessage({id:`dates_${m.path}`},{number:m.number})}),n.didEdit&&a.jsx("em",{children:o.formatMessage({id:"discussion_edited"})})]}),u&&a.jsx("small",{children:u})]})]})})};const _r={small:24,medium:48},Zn=({element:t="div",contributors:{total:e,data:n}={total:void 0,data:[]},styling:{showText:r,size:i,showGap:s,showPlaceholders:o}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:c=2,className:f="",...l})=>{const d=q.useIntl();return!n||n.length===0?null:g.createElement(t,{...l,className:C("contributors",f,i,{"has-gap":s}),children:a.jsxs(a.Fragment,{children:[a.jsx("ul",{children:n.map((u,m)=>{let p,b="";if(m<c){const{name:y="",image:x=""}=zn(u);if(o)return a.jsx(xe,{element:"li",className:"contributor"},m);p=a.jsx(Re,{name:y,src:x,width:_r[i||"medium"],height:_r[i||"medium"]})}else if(m===c){const y=(e||n.length)-c;p=a.jsxs("small",{className:C({"large-number":y>99}),children:["+",Yi(y,0)]}),b="number-left"}return p?a.jsx("li",{className:C("contributor",b),children:p},m):null})}),r&&a.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?d.formatMessage({id:`member_${n[0]}`}):Ve(n[0].name||"",20):null})]})})};var Dn={exports:{}},kt={exports:{}},ce={};/** @license React v16.13.1
|
|
38
38
|
* react-is.production.min.js
|
|
39
39
|
*
|
|
40
40
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
41
41
|
*
|
|
42
42
|
* This source code is licensed under the MIT license found in the
|
|
43
43
|
* LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/var xr;function $s(){if(xr)return ce;xr=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,o=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,f=t?Symbol.for("react.async_mode"):60111,l=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,u=t?Symbol.for("react.suspense"):60113,m=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,b=t?Symbol.for("react.lazy"):60116,y=t?Symbol.for("react.block"):60121,x=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,_=t?Symbol.for("react.scope"):60119;function S(k){if(typeof k=="object"&&k!==null){var
|
|
44
|
+
*/var xr;function $s(){if(xr)return ce;xr=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,o=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,f=t?Symbol.for("react.async_mode"):60111,l=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,u=t?Symbol.for("react.suspense"):60113,m=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,b=t?Symbol.for("react.lazy"):60116,y=t?Symbol.for("react.block"):60121,x=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,_=t?Symbol.for("react.scope"):60119;function S(k){if(typeof k=="object"&&k!==null){var W=k.$$typeof;switch(W){case e:switch(k=k.type,k){case f:case l:case r:case s:case i:case u:return k;default:switch(k=k&&k.$$typeof,k){case c:case d:case b:case p:case o:return k;default:return W}}case n:return W}}}function T(k){return S(k)===l}return ce.AsyncMode=f,ce.ConcurrentMode=l,ce.ContextConsumer=c,ce.ContextProvider=o,ce.Element=e,ce.ForwardRef=d,ce.Fragment=r,ce.Lazy=b,ce.Memo=p,ce.Portal=n,ce.Profiler=s,ce.StrictMode=i,ce.Suspense=u,ce.isAsyncMode=function(k){return T(k)||S(k)===f},ce.isConcurrentMode=T,ce.isContextConsumer=function(k){return S(k)===c},ce.isContextProvider=function(k){return S(k)===o},ce.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===e},ce.isForwardRef=function(k){return S(k)===d},ce.isFragment=function(k){return S(k)===r},ce.isLazy=function(k){return S(k)===b},ce.isMemo=function(k){return S(k)===p},ce.isPortal=function(k){return S(k)===n},ce.isProfiler=function(k){return S(k)===s},ce.isStrictMode=function(k){return S(k)===i},ce.isSuspense=function(k){return S(k)===u},ce.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===l||k===s||k===i||k===u||k===m||typeof k=="object"&&k!==null&&(k.$$typeof===b||k.$$typeof===p||k.$$typeof===o||k.$$typeof===c||k.$$typeof===d||k.$$typeof===x||k.$$typeof===v||k.$$typeof===_||k.$$typeof===y)},ce.typeOf=S,ce}var le={};/** @license React v16.13.1
|
|
45
45
|
* react-is.development.js
|
|
46
46
|
*
|
|
47
47
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the MIT license found in the
|
|
50
50
|
* LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/var wr;function
|
|
51
|
+
*/var wr;function Ns(){return wr||(wr=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,o=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,f=t?Symbol.for("react.async_mode"):60111,l=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,u=t?Symbol.for("react.suspense"):60113,m=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,b=t?Symbol.for("react.lazy"):60116,y=t?Symbol.for("react.block"):60121,x=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,_=t?Symbol.for("react.scope"):60119;function S(A){return typeof A=="string"||typeof A=="function"||A===r||A===l||A===s||A===i||A===u||A===m||typeof A=="object"&&A!==null&&(A.$$typeof===b||A.$$typeof===p||A.$$typeof===o||A.$$typeof===c||A.$$typeof===d||A.$$typeof===x||A.$$typeof===v||A.$$typeof===_||A.$$typeof===y)}function T(A){if(typeof A=="object"&&A!==null){var he=A.$$typeof;switch(he){case e:var Ee=A.type;switch(Ee){case f:case l:case r:case s:case i:case u:return Ee;default:var we=Ee&&Ee.$$typeof;switch(we){case c:case d:case b:case p:case o:return we;default:return he}}case n:return he}}}var k=f,W=l,O=c,z=o,R=e,D=d,M=r,E=b,w=p,$=n,L=s,Z=i,I=u,V=!1;function J(A){return V||(V=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),j(A)||T(A)===f}function j(A){return T(A)===l}function N(A){return T(A)===c}function H(A){return T(A)===o}function U(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function Y(A){return T(A)===d}function ee(A){return T(A)===r}function G(A){return T(A)===b}function K(A){return T(A)===p}function X(A){return T(A)===n}function ne(A){return T(A)===s}function F(A){return T(A)===i}function ie(A){return T(A)===u}le.AsyncMode=k,le.ConcurrentMode=W,le.ContextConsumer=O,le.ContextProvider=z,le.Element=R,le.ForwardRef=D,le.Fragment=M,le.Lazy=E,le.Memo=w,le.Portal=$,le.Profiler=L,le.StrictMode=Z,le.Suspense=I,le.isAsyncMode=J,le.isConcurrentMode=j,le.isContextConsumer=N,le.isContextProvider=H,le.isElement=U,le.isForwardRef=Y,le.isFragment=ee,le.isLazy=G,le.isMemo=K,le.isPortal=X,le.isProfiler=ne,le.isStrictMode=F,le.isSuspense=ie,le.isValidElementType=S,le.typeOf=T}()),le}var kr;function ka(){return kr||(kr=1,process.env.NODE_ENV==="production"?kt.exports=$s():kt.exports=Ns()),kt.exports}/*
|
|
52
52
|
object-assign
|
|
53
53
|
(c) Sindre Sorhus
|
|
54
54
|
@license MIT
|
|
55
|
-
*/var un,jr;function Ps(){if(jr)return un;jr=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},c=0;c<10;c++)o["_"+String.fromCharCode(c)]=c;var f=Object.getOwnPropertyNames(o).map(function(d){return o[d]});if(f.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(d){l[d]=d}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return un=i()?Object.assign:function(s,o){for(var c,f=r(s),l,d=1;d<arguments.length;d++){c=Object(arguments[d]);for(var u in c)e.call(c,u)&&(f[u]=c[u]);if(t){l=t(c);for(var m=0;m<l.length;m++)n.call(c,l[m])&&(f[l[m]]=c[l[m]])}}return f},un}var dn,Tr;function Wn(){if(Tr)return dn;Tr=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return dn=t,dn}var fn,Er;function ja(){return Er||(Er=1,fn=Function.call.bind(Object.prototype.hasOwnProperty)),fn}var mn,Sr;function Rs(){if(Sr)return mn;Sr=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=Wn(),n={},r=ja();t=function(s){var o="Warning: "+s;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(s,o,c,f,l){if(process.env.NODE_ENV!=="production"){for(var d in s)if(r(s,d)){var u;try{if(typeof s[d]!="function"){var m=Error((f||"React class")+": "+c+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}u=s[d](o,d,f,c,null,e)}catch(b){u=b}if(u&&!(u instanceof Error)&&t((f||"React class")+": type specification of "+c+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in n)){n[u.message]=!0;var p=l?l():"";t("Failed "+c+" type: "+u.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},mn=i,mn}var pn,Cr;function Fs(){if(Cr)return pn;Cr=1;var t=ka(),e=Ps(),n=Wn(),r=ja(),i=Rs(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(c){var f="Warning: "+c;typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}});function o(){return null}return pn=function(c,f){var l=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function u(j){var
|
|
56
|
-
Valid keys: `+JSON.stringify(Object.keys(j),null," "));var
|
|
55
|
+
*/var un,jr;function Ps(){if(jr)return un;jr=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},c=0;c<10;c++)o["_"+String.fromCharCode(c)]=c;var f=Object.getOwnPropertyNames(o).map(function(d){return o[d]});if(f.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(d){l[d]=d}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return un=i()?Object.assign:function(s,o){for(var c,f=r(s),l,d=1;d<arguments.length;d++){c=Object(arguments[d]);for(var u in c)e.call(c,u)&&(f[u]=c[u]);if(t){l=t(c);for(var m=0;m<l.length;m++)n.call(c,l[m])&&(f[l[m]]=c[l[m]])}}return f},un}var dn,Tr;function Wn(){if(Tr)return dn;Tr=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return dn=t,dn}var fn,Er;function ja(){return Er||(Er=1,fn=Function.call.bind(Object.prototype.hasOwnProperty)),fn}var mn,Sr;function Rs(){if(Sr)return mn;Sr=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=Wn(),n={},r=ja();t=function(s){var o="Warning: "+s;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(s,o,c,f,l){if(process.env.NODE_ENV!=="production"){for(var d in s)if(r(s,d)){var u;try{if(typeof s[d]!="function"){var m=Error((f||"React class")+": "+c+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}u=s[d](o,d,f,c,null,e)}catch(b){u=b}if(u&&!(u instanceof Error)&&t((f||"React class")+": type specification of "+c+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in n)){n[u.message]=!0;var p=l?l():"";t("Failed "+c+" type: "+u.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},mn=i,mn}var pn,Cr;function Fs(){if(Cr)return pn;Cr=1;var t=ka(),e=Ps(),n=Wn(),r=ja(),i=Rs(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(c){var f="Warning: "+c;typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}});function o(){return null}return pn=function(c,f){var l=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function u(j){var N=j&&(l&&j[l]||j[d]);if(typeof N=="function")return N}var m="<<anonymous>>",p={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:_(),arrayOf:S,element:T(),elementType:k(),instanceOf:W,node:D(),objectOf:z,oneOf:O,oneOfType:R,shape:E,exact:w};function b(j,N){return j===N?j!==0||1/j===1/N:j!==j&&N!==N}function y(j,N){this.message=j,this.data=N&&typeof N=="object"?N:{},this.stack=""}y.prototype=Error.prototype;function x(j){if(process.env.NODE_ENV!=="production")var N={},H=0;function U(ee,G,K,X,ne,F,ie){if(X=X||m,F=F||K,ie!==n){if(f){var A=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw A.name="Invariant Violation",A}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var he=X+":"+K;!N[he]&&H<3&&(s("You are manually calling a React.PropTypes validation function for the `"+F+"` prop on `"+X+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),N[he]=!0,H++)}}return G[K]==null?ee?G[K]===null?new y("The "+ne+" `"+F+"` is marked as required "+("in `"+X+"`, but its value is `null`.")):new y("The "+ne+" `"+F+"` is marked as required in "+("`"+X+"`, but its value is `undefined`.")):null:j(G,K,X,ne,F)}var Y=U.bind(null,!1);return Y.isRequired=U.bind(null,!0),Y}function v(j){function N(H,U,Y,ee,G,K){var X=H[U],ne=Z(X);if(ne!==j){var F=I(X);return new y("Invalid "+ee+" `"+G+"` of type "+("`"+F+"` supplied to `"+Y+"`, expected ")+("`"+j+"`."),{expectedType:j})}return null}return x(N)}function _(){return x(o)}function S(j){function N(H,U,Y,ee,G){if(typeof j!="function")return new y("Property `"+G+"` of component `"+Y+"` has invalid PropType notation inside arrayOf.");var K=H[U];if(!Array.isArray(K)){var X=Z(K);return new y("Invalid "+ee+" `"+G+"` of type "+("`"+X+"` supplied to `"+Y+"`, expected an array."))}for(var ne=0;ne<K.length;ne++){var F=j(K,ne,Y,ee,G+"["+ne+"]",n);if(F instanceof Error)return F}return null}return x(N)}function T(){function j(N,H,U,Y,ee){var G=N[H];if(!c(G)){var K=Z(G);return new y("Invalid "+Y+" `"+ee+"` of type "+("`"+K+"` supplied to `"+U+"`, expected a single ReactElement."))}return null}return x(j)}function k(){function j(N,H,U,Y,ee){var G=N[H];if(!t.isValidElementType(G)){var K=Z(G);return new y("Invalid "+Y+" `"+ee+"` of type "+("`"+K+"` supplied to `"+U+"`, expected a single ReactElement type."))}return null}return x(j)}function W(j){function N(H,U,Y,ee,G){if(!(H[U]instanceof j)){var K=j.name||m,X=J(H[U]);return new y("Invalid "+ee+" `"+G+"` of type "+("`"+X+"` supplied to `"+Y+"`, expected ")+("instance of `"+K+"`."))}return null}return x(N)}function O(j){if(!Array.isArray(j))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),o;function N(H,U,Y,ee,G){for(var K=H[U],X=0;X<j.length;X++)if(b(K,j[X]))return null;var ne=JSON.stringify(j,function(ie,A){var he=I(A);return he==="symbol"?String(A):A});return new y("Invalid "+ee+" `"+G+"` of value `"+String(K)+"` "+("supplied to `"+Y+"`, expected one of "+ne+"."))}return x(N)}function z(j){function N(H,U,Y,ee,G){if(typeof j!="function")return new y("Property `"+G+"` of component `"+Y+"` has invalid PropType notation inside objectOf.");var K=H[U],X=Z(K);if(X!=="object")return new y("Invalid "+ee+" `"+G+"` of type "+("`"+X+"` supplied to `"+Y+"`, expected an object."));for(var ne in K)if(r(K,ne)){var F=j(K,ne,Y,ee,G+"."+ne,n);if(F instanceof Error)return F}return null}return x(N)}function R(j){if(!Array.isArray(j))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var N=0;N<j.length;N++){var H=j[N];if(typeof H!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+V(H)+" at index "+N+"."),o}function U(Y,ee,G,K,X){for(var ne=[],F=0;F<j.length;F++){var ie=j[F],A=ie(Y,ee,G,K,X,n);if(A==null)return null;A.data&&r(A.data,"expectedType")&&ne.push(A.data.expectedType)}var he=ne.length>0?", expected one of type ["+ne.join(", ")+"]":"";return new y("Invalid "+K+" `"+X+"` supplied to "+("`"+G+"`"+he+"."))}return x(U)}function D(){function j(N,H,U,Y,ee){return $(N[H])?null:new y("Invalid "+Y+" `"+ee+"` supplied to "+("`"+U+"`, expected a ReactNode."))}return x(j)}function M(j,N,H,U,Y){return new y((j||"React class")+": "+N+" type `"+H+"."+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Y+"`.")}function E(j){function N(H,U,Y,ee,G){var K=H[U],X=Z(K);if(X!=="object")return new y("Invalid "+ee+" `"+G+"` of type `"+X+"` "+("supplied to `"+Y+"`, expected `object`."));for(var ne in j){var F=j[ne];if(typeof F!="function")return M(Y,ee,G,ne,I(F));var ie=F(K,ne,Y,ee,G+"."+ne,n);if(ie)return ie}return null}return x(N)}function w(j){function N(H,U,Y,ee,G){var K=H[U],X=Z(K);if(X!=="object")return new y("Invalid "+ee+" `"+G+"` of type `"+X+"` "+("supplied to `"+Y+"`, expected `object`."));var ne=e({},H[U],j);for(var F in ne){var ie=j[F];if(r(j,F)&&typeof ie!="function")return M(Y,ee,G,F,I(ie));if(!ie)return new y("Invalid "+ee+" `"+G+"` key `"+F+"` supplied to `"+Y+"`.\nBad object: "+JSON.stringify(H[U],null," ")+`
|
|
56
|
+
Valid keys: `+JSON.stringify(Object.keys(j),null," "));var A=ie(K,F,Y,ee,G+"."+F,n);if(A)return A}return null}return x(N)}function $(j){switch(typeof j){case"number":case"string":case"undefined":return!0;case"boolean":return!j;case"object":if(Array.isArray(j))return j.every($);if(j===null||c(j))return!0;var N=u(j);if(N){var H=N.call(j),U;if(N!==j.entries){for(;!(U=H.next()).done;)if(!$(U.value))return!1}else for(;!(U=H.next()).done;){var Y=U.value;if(Y&&!$(Y[1]))return!1}}else return!1;return!0;default:return!1}}function L(j,N){return j==="symbol"?!0:N?N["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&N instanceof Symbol:!1}function Z(j){var N=typeof j;return Array.isArray(j)?"array":j instanceof RegExp?"object":L(N,j)?"symbol":N}function I(j){if(typeof j>"u"||j===null)return""+j;var N=Z(j);if(N==="object"){if(j instanceof Date)return"date";if(j instanceof RegExp)return"regexp"}return N}function V(j){var N=I(j);switch(N){case"array":case"object":return"an "+N;case"boolean":case"date":case"regexp":return"a "+N;default:return N}}function J(j){return!j.constructor||!j.constructor.name?m:j.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},pn}var hn,Mr;function Os(){if(Mr)return hn;Mr=1;var t=Wn();function e(){}function n(){}return n.resetWarningCache=e,hn=function(){function r(o,c,f,l,d,u){if(u!==t){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return s.PropTypes=s,s},hn}if(process.env.NODE_ENV!=="production"){var Ds=ka(),As=!0;Dn.exports=Fs()(Ds.isElement,As)}else Dn.exports=Os()();var Is=Dn.exports;/*!
|
|
57
57
|
* tabbable 6.2.0
|
|
58
58
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
59
|
-
*/var Ta=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],At=Ta.join(","),Ea=typeof Element>"u",Ie=Ea?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,It=!Ea&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t==null?void 0:t.ownerDocument},Lt=function t(e,n){var r;n===void 0&&(n=!0);var i=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=i===""||i==="true",o=s||n&&e&&t(e.parentNode);return o},Ls=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},Sa=function(e,n,r){if(Lt(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(At));return n&&Ie.call(e,At)&&i.unshift(e),i=i.filter(r),i},Ca=function t(e,n,r){for(var i=[],s=Array.from(e);s.length;){var o=s.shift();if(!Lt(o,!1))if(o.tagName==="SLOT"){var c=o.assignedElements(),f=c.length?c:o.children,l=t(f,!0,r);r.flatten?i.push.apply(i,l):i.push({scopeParent:o,candidates:l})}else{var d=Ie.call(o,At);d&&r.filter(o)&&(n||!e.includes(o))&&i.push(o);var u=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),m=!Lt(u,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(u&&m){var p=t(u===!0?o.children:u.children,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:o,candidates:p})}else s.unshift.apply(s,o.children)}}return i},
|
|
59
|
+
*/var Ta=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],At=Ta.join(","),Ea=typeof Element>"u",Ie=Ea?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,It=!Ea&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t==null?void 0:t.ownerDocument},Lt=function t(e,n){var r;n===void 0&&(n=!0);var i=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=i===""||i==="true",o=s||n&&e&&t(e.parentNode);return o},Ls=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},Sa=function(e,n,r){if(Lt(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(At));return n&&Ie.call(e,At)&&i.unshift(e),i=i.filter(r),i},Ca=function t(e,n,r){for(var i=[],s=Array.from(e);s.length;){var o=s.shift();if(!Lt(o,!1))if(o.tagName==="SLOT"){var c=o.assignedElements(),f=c.length?c:o.children,l=t(f,!0,r);r.flatten?i.push.apply(i,l):i.push({scopeParent:o,candidates:l})}else{var d=Ie.call(o,At);d&&r.filter(o)&&(n||!e.includes(o))&&i.push(o);var u=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),m=!Lt(u,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(u&&m){var p=t(u===!0?o.children:u.children,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:o,candidates:p})}else s.unshift.apply(s,o.children)}}return i},Ma=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ne=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Ls(e))&&!Ma(e)?0:e.tabIndex},Bs=function(e,n){var r=Ne(e);return r<0&&n&&!Ma(e)?0:r},qs=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},$a=function(e){return e.tagName==="INPUT"},Us=function(e){return $a(e)&&e.type==="hidden"},zs=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},Zs=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},Ws=function(e){if(!e.name)return!0;var n=e.form||It(e),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(e.name));else try{i=r(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=Zs(i,e.form);return!s||s===e},Hs=function(e){return $a(e)&&e.type==="radio"},Vs=function(e){return Hs(e)&&!Ws(e)},Ys=function(e){var n,r=e&&It(e),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==e){var o,c,f;for(s=!!((o=i)!==null&&o!==void 0&&(c=o.ownerDocument)!==null&&c!==void 0&&c.contains(i)||e!=null&&(f=e.ownerDocument)!==null&&f!==void 0&&f.contains(e));!s&&i;){var l,d,u;r=It(i),i=(l=r)===null||l===void 0?void 0:l.host,s=!!((d=i)!==null&&d!==void 0&&(u=d.ownerDocument)!==null&&u!==void 0&&u.contains(i))}}return s},$r=function(e){var n=e.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},Ks=function(e,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var s=Ie.call(e,"details>summary:first-of-type"),o=s?e.parentElement:e;if(Ie.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var c=e;e;){var f=e.parentElement,l=It(e);if(f&&!f.shadowRoot&&i(f)===!0)return $r(e);e.assignedSlot?e=e.assignedSlot:!f&&l!==e.ownerDocument?e=l.host:e=f}e=c}if(Ys(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return $r(e);return!1},Gs=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Ie.call(n,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}n=n.parentElement}return!1},Bt=function(e,n){return!(n.disabled||Lt(n)||Us(n)||Ks(n,e)||zs(n)||Gs(n))},An=function(e,n){return!(Vs(n)||Ne(n)<0||!Bt(e,n))},Qs=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Js=function t(e){var n=[],r=[];return e.forEach(function(i,s){var o=!!i.scopeParent,c=o?i.scopeParent:i,f=Bs(c,o),l=o?t(i.candidates):c;f===0?o?n.push.apply(n,l):n.push(c):r.push({documentOrder:s,tabIndex:f,item:i,isScope:o,content:l})}),r.sort(qs).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Na=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Ca([e],n.includeContainer,{filter:An.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Qs}):r=Sa(e,n.includeContainer,An.bind(null,n)),Js(r)},Pa=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Ca([e],n.includeContainer,{filter:Bt.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Sa(e,n.includeContainer,Bt.bind(null,n)),r},Oe=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Ie.call(e,At)===!1?!1:An(n,e)},Xs=Ta.concat("iframe").join(","),Ot=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Ie.call(e,Xs)===!1?!1:Bt(n,e)};const eo=Object.freeze(Object.defineProperty({__proto__:null,focusable:Pa,getTabIndex:Ne,isFocusable:Ot,isTabbable:Oe,tabbable:Na},Symbol.toStringTag,{value:"Module"}));/*!
|
|
60
60
|
* focus-trap 7.5.4
|
|
61
61
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
62
|
-
*/function Mr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Pr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Mr(Object(n),!0).forEach(function(r){to(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function to(t,e,n){return e=ro(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function no(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ro(t){var e=no(t,"string");return typeof e=="symbol"?e:String(e)}var Rr={activateTrap:function(e,n){if(e.length>0){var r=e[e.length-1];r!==n&&r.pause()}var i=e.indexOf(n);i===-1||e.splice(i,1),e.push(n)},deactivateTrap:function(e,n){var r=e.indexOf(n);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},ao=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},io=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},ut=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},so=function(e){return ut(e)&&!e.shiftKey},oo=function(e){return ut(e)&&e.shiftKey},Fr=function(e){return setTimeout(e,0)},Or=function(e,n){var r=-1;return e.every(function(i,s){return n(i)?(r=s,!1):!0}),r},it=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof e=="function"?e.apply(void 0,r):e},jt=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},co=[],lo=function(e,n){var r=(n==null?void 0:n.document)||document,i=(n==null?void 0:n.trapStack)||co,s=Pr({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:so,isKeyBackward:oo},n),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},c,f=function(E,w,N){return E&&E[w]!==void 0?E[w]:s[N||w]},l=function(E,w){var N=typeof(w==null?void 0:w.composedPath)=="function"?w.composedPath():void 0;return o.containerGroups.findIndex(function(B){var F=B.container,L=B.tabbableNodes;return F.contains(E)||(N==null?void 0:N.includes(F))||L.find(function(K){return K===E})})},d=function(E){var w=s[E];if(typeof w=="function"){for(var N=arguments.length,B=new Array(N>1?N-1:0),F=1;F<N;F++)B[F-1]=arguments[F];w=w.apply(void 0,B)}if(w===!0&&(w=void 0),!w){if(w===void 0||w===!1)return w;throw new Error("`".concat(E,"` was specified but was not a node, or did not return a node"))}var L=w;if(typeof w=="string"&&(L=r.querySelector(w),!L))throw new Error("`".concat(E,"` as selector refers to no known node"));return L},u=function(){var E=d("initialFocus");if(E===!1)return!1;if(E===void 0||!Ot(E,s.tabbableOptions))if(l(r.activeElement)>=0)E=r.activeElement;else{var w=o.tabbableGroups[0],N=w&&w.firstTabbableNode;E=N||d("fallbackFocus")}if(!E)throw new Error("Your focus-trap needs to have at least one focusable element");return E},m=function(){if(o.containerGroups=o.containers.map(function(E){var w=Ma(E,s.tabbableOptions),N=Pa(E,s.tabbableOptions),B=w.length>0?w[0]:void 0,F=w.length>0?w[w.length-1]:void 0,L=N.find(function(j){return Oe(j)}),K=N.slice().reverse().find(function(j){return Oe(j)}),ee=!!w.find(function(j){return Me(j)>0});return{container:E,tabbableNodes:w,focusableNodes:N,posTabIndexesFound:ee,firstTabbableNode:B,lastTabbableNode:F,firstDomTabbableNode:L,lastDomTabbableNode:K,nextTabbableNode:function(M){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,W=w.indexOf(M);return W<0?H?N.slice(N.indexOf(M)+1).find(function(V){return Oe(V)}):N.slice(0,N.indexOf(M)).reverse().find(function(V){return Oe(V)}):w[W+(H?1:-1)]}}}),o.tabbableGroups=o.containerGroups.filter(function(E){return E.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!d("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(o.containerGroups.find(function(E){return E.posTabIndexesFound})&&o.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function C(E){var w=E.activeElement;if(w)return w.shadowRoot&&w.shadowRoot.activeElement!==null?C(w.shadowRoot):w},b=function C(E){if(E!==!1&&E!==p(document)){if(!E||!E.focus){C(u());return}E.focus({preventScroll:!!s.preventScroll}),o.mostRecentlyFocusedNode=E,ao(E)&&E.select()}},y=function(E){var w=d("setReturnFocus",E);return w||(w===!1?!1:E)},x=function(E){var w=E.target,N=E.event,B=E.isBackward,F=B===void 0?!1:B;w=w||jt(N),m();var L=null;if(o.tabbableGroups.length>0){var K=l(w,N),ee=K>=0?o.containerGroups[K]:void 0;if(K<0)F?L=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:L=o.tabbableGroups[0].firstTabbableNode;else if(F){var j=Or(o.tabbableGroups,function(G){var Y=G.firstTabbableNode;return w===Y});if(j<0&&(ee.container===w||Ot(w,s.tabbableOptions)&&!Oe(w,s.tabbableOptions)&&!ee.nextTabbableNode(w,!1))&&(j=K),j>=0){var M=j===0?o.tabbableGroups.length-1:j-1,H=o.tabbableGroups[M];L=Me(w)>=0?H.lastTabbableNode:H.lastDomTabbableNode}else ut(N)||(L=ee.nextTabbableNode(w,!1))}else{var W=Or(o.tabbableGroups,function(G){var Y=G.lastTabbableNode;return w===Y});if(W<0&&(ee.container===w||Ot(w,s.tabbableOptions)&&!Oe(w,s.tabbableOptions)&&!ee.nextTabbableNode(w))&&(W=K),W>=0){var V=W===o.tabbableGroups.length-1?0:W+1,X=o.tabbableGroups[V];L=Me(w)>=0?X.firstTabbableNode:X.firstDomTabbableNode}else ut(N)||(L=ee.nextTabbableNode(w))}}else L=d("fallbackFocus");return L},v=function(E){var w=jt(E);if(!(l(w,E)>=0)){if(it(s.clickOutsideDeactivates,E)){c.deactivate({returnFocus:s.returnFocusOnDeactivate});return}it(s.allowOutsideClick,E)||E.preventDefault()}},_=function(E){var w=jt(E),N=l(w,E)>=0;if(N||w instanceof Document)N&&(o.mostRecentlyFocusedNode=w);else{E.stopImmediatePropagation();var B,F=!0;if(o.mostRecentlyFocusedNode)if(Me(o.mostRecentlyFocusedNode)>0){var L=l(o.mostRecentlyFocusedNode),K=o.containerGroups[L].tabbableNodes;if(K.length>0){var ee=K.findIndex(function(j){return j===o.mostRecentlyFocusedNode});ee>=0&&(s.isKeyForward(o.recentNavEvent)?ee+1<K.length&&(B=K[ee+1],F=!1):ee-1>=0&&(B=K[ee-1],F=!1))}}else o.containerGroups.some(function(j){return j.tabbableNodes.some(function(M){return Me(M)>0})})||(F=!1);else F=!1;F&&(B=x({target:o.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(o.recentNavEvent)})),b(B||o.mostRecentlyFocusedNode||u())}o.recentNavEvent=void 0},S=function(E){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;o.recentNavEvent=E;var N=x({event:E,isBackward:w});N&&(ut(E)&&E.preventDefault(),b(N))},T=function(E){if(io(E)&&it(s.escapeDeactivates,E)!==!1){E.preventDefault(),c.deactivate();return}(s.isKeyForward(E)||s.isKeyBackward(E))&&S(E,s.isKeyBackward(E))},k=function(E){var w=jt(E);l(w,E)>=0||it(s.clickOutsideDeactivates,E)||it(s.allowOutsideClick,E)||(E.preventDefault(),E.stopImmediatePropagation())},Z=function(){if(o.active)return Rr.activateTrap(i,c),o.delayInitialFocusTimer=s.delayInitialFocus?Fr(function(){b(u())}):b(u()),r.addEventListener("focusin",_,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",k,{capture:!0,passive:!1}),r.addEventListener("keydown",T,{capture:!0,passive:!1}),c},A=function(){if(o.active)return r.removeEventListener("focusin",_,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",k,!0),r.removeEventListener("keydown",T,!0),c},z=function(E){var w=E.some(function(N){var B=Array.from(N.removedNodes);return B.some(function(F){return F===o.mostRecentlyFocusedNode})});w&&b(u())},R=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(z):void 0,D=function(){R&&(R.disconnect(),o.active&&!o.paused&&o.containers.map(function(E){R.observe(E,{subtree:!0,childList:!0})}))};return c={get active(){return o.active},get paused(){return o.paused},activate:function(E){if(o.active)return this;var w=f(E,"onActivate"),N=f(E,"onPostActivate"),B=f(E,"checkCanFocusTrap");B||m(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,w==null||w();var F=function(){B&&m(),Z(),D(),N==null||N()};return B?(B(o.containers.concat()).then(F,F),this):(F(),this)},deactivate:function(E){if(!o.active)return this;var w=Pr({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},E);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,A(),o.active=!1,o.paused=!1,D(),Rr.deactivateTrap(i,c);var N=f(w,"onDeactivate"),B=f(w,"onPostDeactivate"),F=f(w,"checkCanReturnFocus"),L=f(w,"returnFocus","returnFocusOnDeactivate");N==null||N();var K=function(){Fr(function(){L&&b(y(o.nodeFocusedBeforeActivation)),B==null||B()})};return L&&F?(F(y(o.nodeFocusedBeforeActivation)).then(K,K),this):(K(),this)},pause:function(E){if(o.paused||!o.active)return this;var w=f(E,"onPause"),N=f(E,"onPostPause");return o.paused=!0,w==null||w(),A(),D(),N==null||N(),this},unpause:function(E){if(!o.paused||!o.active)return this;var w=f(E,"onUnpause"),N=f(E,"onPostUnpause");return o.paused=!1,w==null||w(),m(),Z(),D(),N==null||N(),this},updateContainerElements:function(E){var w=[].concat(E).filter(Boolean);return o.containers=w.map(function(N){return typeof N=="string"?r.querySelector(N):N}),o.active&&m(),D(),this}},c.updateContainerElements(e),c};const uo=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:lo},Symbol.toStringTag,{value:"Module"})),fo=Qr(uo),mo=Qr(eo);function Ke(t){"@babel/helpers - typeof";return Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ke(t)}function po(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ra(r.key),r)}}function ho(t,e,n){return e&&Dr(t.prototype,e),n&&Dr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function go(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&In(t,e)}function In(t,e){return In=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},In(t,e)}function vo(t){var e=yo();return function(){var r=qt(t),i;if(e){var s=qt(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return bo(this,i)}}function bo(t,e){if(e&&(Ke(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ct(t)}function ct(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qt(t){return qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qt(t)}function _o(t,e,n){return e=Ra(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ra(t){var e=xo(t,"string");return Ke(e)==="symbol"?e:String(e)}function xo(t,e){if(Ke(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Ke(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Tt=g,Q=Is,wo=fo,ko=wo.createFocusTrap,jo=mo,To=jo.isFocusable,Hn=function(t){go(n,t);var e=vo(n);function n(r){var i;po(this,n),i=e.call(this,r),_o(ct(i),"getNodeForOption",function(c){var f,l=(f=this.internalOptions[c])!==null&&f!==void 0?f:this.originalOptions[c];if(typeof l=="function"){for(var d=arguments.length,u=new Array(d>1?d-1:0),m=1;m<d;m++)u[m-1]=arguments[m];l=l.apply(void 0,u)}if(l===!0&&(l=void 0),!l){if(l===void 0||l===!1)return l;throw new Error("`".concat(c,"` was specified but was not a node, or did not return a node"))}var p=l;if(typeof l=="string"){var b;if(p=(b=this.getDocument())===null||b===void 0?void 0:b.querySelector(l),!p)throw new Error("`".concat(c,"` as selector refers to no known node"))}return p}),i.handleDeactivate=i.handleDeactivate.bind(ct(i)),i.handlePostDeactivate=i.handlePostDeactivate.bind(ct(i)),i.handleClickOutsideDeactivates=i.handleClickOutsideDeactivates.bind(ct(i)),i.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:i.handleDeactivate,onPostDeactivate:i.handlePostDeactivate,clickOutsideDeactivates:i.handleClickOutsideDeactivates},i.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var s=r.focusTrapOptions;for(var o in s)if(Object.prototype.hasOwnProperty.call(s,o)){if(o==="returnFocusOnDeactivate"||o==="onDeactivate"||o==="onPostDeactivate"||o==="checkCanReturnFocus"||o==="clickOutsideDeactivates"){i.originalOptions[o]=s[o];continue}i.internalOptions[o]=s[o]}return i.outsideClick=null,i.focusTrapElements=r.containerElements||[],i.updatePreviousElement(),i}return ho(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var i=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return i||(i===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var i=this.getDocument();i&&(this.previouslyFocusedElement=i.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(i){var s=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,i):this.originalOptions.clickOutsideDeactivates;return s&&(this.outsideClick={target:i.target,allowDeactivation:s}),s}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var i=this,s=function(){var c=i.getReturnFocusNode(),f=!!(i.originalOptions.returnFocusOnDeactivate&&c!==null&&c!==void 0&&c.focus&&(!i.outsideClick||i.outsideClick.allowDeactivation&&!To(i.outsideClick.target,i.internalOptions.tabbableOptions))),l=i.internalOptions.preventScroll,d=l===void 0?!1:l;f&&c.focus({preventScroll:d}),i.originalOptions.onPostDeactivate&&i.originalOptions.onPostDeactivate.call(null),i.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(s,s):s()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var i=this.focusTrapElements.some(Boolean);i&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(i){if(this.focusTrap){i.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var s=!i.active&&this.props.active,o=i.active&&!this.props.active,c=!i.paused&&this.props.paused,f=i.paused&&!this.props.paused;if(s&&(this.updatePreviousElement(),this.focusTrap.activate()),o){this.deactivateTrap();return}c&&this.focusTrap.pause(),f&&this.focusTrap.unpause()}else i.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var i=this,s=this.props.children?Tt.Children.only(this.props.children):void 0;if(s){if(s.type&&s.type===Tt.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var o=function(l){var d=i.props.containerElements;s&&(typeof s.ref=="function"?s.ref(l):s.ref&&(s.ref.current=l)),i.focusTrapElements=d||[l]},c=Tt.cloneElement(s,{ref:o});return c}return null}}]),n}(Tt.Component),st=typeof Element>"u"?Function:Element;Hn.propTypes={active:Q.bool,paused:Q.bool,focusTrapOptions:Q.shape({document:Q.object,onActivate:Q.func,onPostActivate:Q.func,checkCanFocusTrap:Q.func,onPause:Q.func,onPostPause:Q.func,onUnpause:Q.func,onPostUnpause:Q.func,onDeactivate:Q.func,onPostDeactivate:Q.func,checkCanReturnFocus:Q.func,initialFocus:Q.oneOfType([Q.instanceOf(st),Q.string,Q.bool,Q.func]),fallbackFocus:Q.oneOfType([Q.instanceOf(st),Q.string,Q.func]),escapeDeactivates:Q.oneOfType([Q.bool,Q.func]),clickOutsideDeactivates:Q.oneOfType([Q.bool,Q.func]),returnFocusOnDeactivate:Q.bool,setReturnFocus:Q.oneOfType([Q.instanceOf(st),Q.string,Q.bool,Q.func]),allowOutsideClick:Q.oneOfType([Q.bool,Q.func]),preventScroll:Q.bool,tabbableOptions:Q.shape({displayCheck:Q.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:Q.oneOfType([Q.bool,Q.func])}),trapStack:Q.array,isKeyForward:Q.func,isKeyBackward:Q.func}),containerElements:Q.arrayOf(Q.instanceOf(st)),children:Q.oneOfType([Q.element,Q.instanceOf(st)])};Hn.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:ko};var Eo=Hn;const So=Gr(Eo);const Vn=({element:t="section",children:e,className:n,...r})=>g.createElement(t,{className:$("modal",n),children:typeof e=="string"?a.jsx("p",{children:e}):e,...r});const bt=({id:t="content-overlay",isOpen:e=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:i=()=>{},onClose:s=()=>{}}={},forceShow:{error:o=!1}={},title:c,children:f,buttons:l,className:d="",gtmContext:u="Modal"})=>{const m=U.useIntl(),[p,b]=g.useState(e),y=_=>{_.key==="Escape"&&x(!1)};g.useEffect(()=>(window.addEventListener("keyup",y),()=>{window.removeEventListener("keyup",y)}));const x=_=>{b(_),_?(i(),document.body.classList.add("has-overlay")):(s(),document.body.classList.remove("has-overlay"))};g.useEffect(()=>{x(e)},[e]);const v=r?{"--max-width":`${r/16}rem`}:{};return a.jsx("div",{className:$("overlay",{open:p}),role:"dialog",children:a.jsx(Vn,{id:t,className:$("overlay-modal",d,{"has-max-width":r}),hidden:!p,style:v,children:e&&a.jsx(So,{children:a.jsxs("div",{className:"overlay-content",children:[a.jsxs("div",{className:"top",children:[c&&a.jsx("h2",{className:"modal-title",children:c}),a.jsx(re,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>x(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":u,screenreaderText:m.formatMessage({id:"overlay_close"})})]}),n&&a.jsx(je,{}),f,l&&a.jsxs("div",{className:"bottom",children:[a.jsx(je,{}),a.jsx(vt,{buttons:l})]}),o&&a.jsx(ht,{className:"error",children:o})]})})})})},Fa=(t,e)=>({"aria-haspopup":!0,"aria-expanded":e,"aria-controls":t});const Et="emailHelperTextBox_",Oa=({type:t,email:e,redirectPath:n,resendVerificationCode:r})=>{const i=U.useIntl(),[s,o]=g.useState({path:`${Et}default`,type:"default",link:{},mail:{},error:""}),[c,f]=g.useState(!1),l=g.useCallback(p=>{p.preventDefault(),p.stopPropagation();const b=y=>{o({path:`${Et}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:x=>l(x),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:y})};if(typeof r!="function"){b(i.formatMessage({id:`${Et}error_noFunction`}));return}f(!0),r(e).then(()=>{localStorage.setItem("email",e),window.location.href=n||"/signup/verify-email"}).catch(y=>{b(y.message)}).finally(()=>{f(!1)})},[e,n,r]);g.useEffect(()=>{let p=Et,b="default",y={},x={};switch(t){case"gov":p+="autoApproved",b="success";break;case"nonGov":p+="unrecognisedEmail",b="error",y={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",b="error",x={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",b="error",y={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:v=>l(v),"data-testid":"send-verify-email-click"};break;case"exists":p+="emailAlreadyExists",b="error",y={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},x={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:p+="default",y={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}o({...s,path:p,type:b,link:y,mail:x})},[t]);const d={};return["link","mail"].forEach(p=>{d[p]=Object.keys(s[p]).length?b=>a.jsx("a",{...s[p],children:b}):b=>b}),a.jsx(va,{type:s.type,heading:c?!1:i.formatMessage({id:`${s.path}_title`}),children:c?a.jsxs(a.Fragment,{children:[a.jsx(xe,{element:"span"}),a.jsx(xe,{element:"span"})]}):i.formatMessage({id:`${s.path}_text`},{...d,strong:p=>a.jsx("strong",{children:p}),em:p=>a.jsx("em",{children:p}),br:a.jsxs(a.Fragment,{children:[a.jsx("br",{}),a.jsx("br",{})]}),error:s.error})})},dt=({className:t="",element:e="input",id:n,inputRef:r,functions:i={onChange:()=>{}},name:s=n,placeholder:o,type:c="text",value:f,...l})=>{const d=g.useRef(),u=r||d;return g.createElement(e,{ref:u,...l,type:c,id:n,name:s,className:$(t,e,{"has-scrollbar":c==="textarea"&&u.current&&u.current.clientHeight<u.current.scrollHeight}),value:f,placeholder:o,...i,onChange:m=>{const p=m.target;i.onChange(p.value)}})};const ze={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},Co=500,No=({value:t,placeholder:e,functions:n={onChange:()=>{},onKeyInput:async()=>new Promise(()=>{})}})=>{const{onChange:r=()=>{},onKeyInput:i=async()=>{}}=n,[{input:s,displayInput:o,debouncedInput:c},f]=g.useState({input:t,displayInput:t,debouncedInput:t}),[{predictions:l,activePredictionIndex:d,isPredictionSelected:u},m]=g.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!t}),{formatMessage:p}=U.useIntl();e||(e=p({id:"inputAutocomplete_placeholder"})),g.useEffect(()=>{const v=setTimeout(()=>{u||f(_=>({..._,debouncedInput:s}))},Co);return()=>{clearTimeout(v)}},[s,u]),g.useEffect(()=>{c&&!u?(async()=>{try{const _=await i(c)||[];m(S=>({...S,predictions:_}))}catch(_){console.error("Error fetching predictions:",_),m(S=>({...S,predictions:[]}))}})():m(v=>({...v,predictions:[]}))},[c,u]),g.useEffect(()=>{d>=0&&l[d]&&f(v=>({...v,displayInput:l[d].description}))},[d,l]);const b=v=>{[ze.DOWN,ze.UP,ze.ENTER].includes(v.key)&&(v.preventDefault(),v.key===ze.DOWN&&d<l.length-1?m(_=>({..._,activePredictionIndex:d+1})):v.key===ze.UP&&d>0?m(_=>({..._,activePredictionIndex:d-1})):v.key===ze.ENTER&&d>-1&&(r(l[d].description),f(_=>({..._,input:l[d].description})),m(_=>({..._,predictions:[],isPredictionSelected:!0}))))},y=v=>{r(v.target.value),f(_=>({..._,input:v.target.value,displayInput:v.target.value})),m(_=>({..._,activePredictionIndex:-1,isPredictionSelected:!1}))},x=v=>{r(v.description),f(_=>({..._,input:v.description,displayInput:v.description})),m(_=>({..._,isPredictionSelected:!0,predictions:[]}))};return a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"text",value:o,onChange:y,onKeyDown:b,placeholder:e}),a.jsx("ul",{className:"predictions-list",children:l.map((v,_)=>a.jsx("li",{onClick:()=>x(v),onMouseEnter:()=>m(S=>({...S,activePredictionIndex:_})),className:$("predictions-list-item",{active:_===d}),children:v.description},_))})]})};const Da=({className:t="",disabled:e,element:n="p",functions:r={onChange:()=>{}},id:i,inputRef:s,intlPath:o=!1,label:c,shownValue:f=!0,type:l="checkbox",value:d,...u})=>{const m=U.useIntl(),{onChange:p,...b}=r,y=()=>{e||p(d?null:f)},x=a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:s,id:i,name:i,type:l,value:f,checked:d,onKeyDown:v=>{(v.key==="Enter"||v.code==="Space")&&(v.preventDefault(),v.stopPropagation(),y())},readOnly:!0,disabled:e}),a.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),a.jsx("label",{htmlFor:i,children:c||m.formatMessage({id:o?`${o}_${i}`:i})})]});return g.createElement(n,{onClick:v=>{const _=v.target;_.nodeName.toLowerCase()==="a"||_.parentNode&&_.parentNode.nodeName.toLowerCase()==="a"||(v.preventDefault(),v.stopPropagation(),y())},className:$("checkbox-wrapper",t),...u,...b},x)};const $o=g.memo(function({direction:e="down"}){return a.jsx(Yt,{className:$("rotating-chevron",`direction-${e}`)})});const Mo=({className:t,options:e,initialValue:n,value:r,functions:i={onChange:()=>{},onMultiSelectSubmit:()=>{}},gtm:{context:s}={context:""},placeholder:o,multiSelect:c,multiSelectOptions:f,id:l})=>{const d=U.useIntl(),[u,m]=g.useState(!1),p=r||n,b=Array.isArray(p)?[...p]:p?[p]:[],[y,x]=g.useState(b);let v;Array.isArray(y)&&y.length===1&&typeof y[0]=="string"?v=e&&y?e.find(A=>A.id===y[0]):e?e[0]:{id:"",label:""}:Array.isArray(y)&&y.length===1&&typeof y[0]!="string"?v=y[0]:v={id:"",label:""},g.useEffect(()=>{x(b)},[r,n]);const{onChange:_,onMultiSelectSubmit:S,...T}=i,k=A=>{if(c){let z=[];y!=null&&y.includes(A.id)?z=y.filter(R=>R!==A.id):z=[...y,A.id],x([...z]),_&&_([...z])}else x([A]),_&&_(A.id),m(!1)},Z=A=>{if(A==="all"){const z=(e==null?void 0:e.map(R=>R.id))||[];x(z),_&&_(z)}else x([]),_&&_([])};return a.jsxs("div",{className:$("dropdown-wrapper",t),children:[a.jsxs("button",{className:"input","aria-expanded":u,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:A=>{A.preventDefault(),A.stopPropagation(),m(!u)},"data-testid":"dropdown-selector",...T,children:[c?`${o} · ${y.length}`:v.label,a.jsx($o,{direction:u?"up":"down"})]}),a.jsx("select",{defaultValue:v.id,onChange:A=>{A.preventDefault(),A.stopPropagation();const z=e&&e.find(R=>R.id===A.target.value);k(z)},hidden:!u,...T,children:e==null?void 0:e.map(A=>a.jsx("option",{value:A.id,children:A.label},A.id))}),a.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!u,children:[a.jsxs("div",{className:"dropdown-menu-list",children:[(f==null?void 0:f.topbar)&&a.jsxs("div",{className:"action-bar",children:[a.jsx("p",{children:`${y==null?void 0:y.length} selected`}),a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx(re,{variant:"tertiary",size:"small",onClick:()=>Z("all"),className:"gtm-trackable",children:d.formatMessage({id:"dropdown_menu_multiselect_all"})})}),a.jsx("li",{children:a.jsx(re,{variant:"tertiary",size:"small",onClick:()=>Z("none"),className:"gtm-trackable",children:d.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),a.jsx("ul",{children:e==null?void 0:e.map(A=>{const z=A.id===v.id||(y==null?void 0:y.includes(A))||(y==null?void 0:y.includes(A.id));return a.jsx("li",{"data-testid":"dropdown-options",children:a.jsxs("button",{className:$("gtm-trackable",{selected:z,"selected-single":z&&!c}),"data-gtm-event-type":`${A}-click`,"data-gtm-event-context":s,onClick:R=>{R.preventDefault(),R.stopPropagation(),k(A)},role:"menuitem","aria-current":z,"data-testid":z?"current-selection":"",children:[c&&a.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),a.jsx("span",{className:$({"menu-option-label":c}),children:A.label})]})},A.id)})})]}),(f==null?void 0:f.submitSection)&&a.jsx("p",{className:"submit",children:a.jsx(re,{variant:"secondary",onClick:()=>{S&&S(y),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:l||"dropdown-multi-select",value:y}})),m(!1)},children:d.formatMessage({id:"form_submit"})})})]})]})};const Po=({className:t="",functions:e={onChange:()=>{}},intlPath:n=!1,id:r,label:i,multiSelect:s=!1,name:o,options:c,required:f,type:l="checkboxes",value:d,...u})=>{const m=U.useIntl(),p=s?d:[],b=d;return a.jsx("ul",{...u,className:$("options-wrapper",t),"data-testid":`ul-${r}`,children:c==null?void 0:c.map(({id:y,label:x=!1,value:v=y,disabled:_=!1})=>{const S=`${r}_${y}`,T=()=>{if(_)return;let k;if(s){const Z=p==null?void 0:p.indexOf(v);Array.isArray(p)&&Z>=0?(k=p,k.splice(Z,1)):(!p||p.length===0?k=[]:k=p,k.push(v))}else k=b===v?void 0:v;e.onChange(k)};return a.jsx(Da,{element:"li",id:S,type:l==="checkboxes"?"checkbox":"radio",shownValue:v,value:s?p==null?void 0:p.includes(v):b===v,functions:{...e,onChange:T},intlPath:n,label:x||m.formatMessage({id:n?`${n}_${y}`:y}),disabled:_},S)})})};const Ro=({inputRef:t,type:e="password",gtm:{context:n}={context:void 0},...r})=>{const i=U.useIntl(),s=g.useRef(),o=t||s,[c,f]=g.useState(!1),[l,d]=g.useState(e),u=()=>{var m;f(!c),d(c?"password":"text"),(m=o.current)==null||m.focus()};return a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:$("show-password gtm-trackable",{"password-visible":c}),"data-gtm-event-context":n,"data-gtm-event-type":`${c?"hide":"show"}-password-click`,onClick:u,"aria-label":i.formatMessage({id:`showpassword_aria_${c?"hide":"show"}`}),children:i.formatMessage({id:`showpassword_${c?"hide":"show"}`})}),a.jsx(dt,{inputRef:o,type:l,...r})]})};const Ze={text:{component:dt},email:{component:dt},textarea:{component:dt,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:Da},checkboxes:{component:Po,props:{multiSelect:!0}},select:{component:Mo},password:{component:Ro},autocomplete:{component:No}},Fo=({id:t,intlPath:e=!1,className:n="",error:r,functions:i={onChange:()=>{}},limit:s=0,showRequiredLabels:o=!0,type:c,validation:f,value:l,...d})=>{const u=U.useIntl(),m=f&&f.some(({condition:T})=>T==="required"),p=(l==null?void 0:l.toString().length)||0,b=c&&Ze[c]&&Ze[c].component?Ze[c].component:dt,y={};c&&["checkboxes"].includes(c)?y.element="span":y.htmlFor=t;let x={...d,id:t,name:t,className:r?"error":"",type:c,required:m,"aria-required":m,functions:lt(i),value:l};s>0&&(x["data-character-limit"]=s,x.functions&&(x.functions.onChange=T=>{((T==null?void 0:T.toString().length)||0)>s&&(T=T==null?void 0:T.toString().slice(0,s)),i.onChange(T)})),c&&Ze[c]&&Ze[c].props&&(x={...x,...Ze[c].props}),c&&["checkboxes"].includes(c)&&(x.intlPath=`${e}_${t}`),r&&(x["aria-invalid"]=!0,x["aria-describedby"]=`error-${t}`);const v=d.label||u.formatMessage({id:e?`${e}_${t}`:t}),_=({...T})=>r?g.createElement(T.as||"dd",{id:`error-${t}`,className:"error text-small",role:"alert","aria-live":"assertive",...T},r):null;if(c&&["checkbox"].includes(c))return a.jsxs(a.Fragment,{children:[a.jsx(b,{...x,label:v,className:$("field-wrapper",n)}),a.jsx(_,{as:"p"})]});const S=T=>g.createElement(T.element||"label",{...T,className:"checkboxes-label text-small","data-testid":`label-${t}`});return a.jsxs("dl",{className:$("field-wrapper text-medium",n),children:[a.jsx("dt",{children:a.jsxs(S,{...y,children:[v,m&&o&&a.jsxs(a.Fragment,{children:[" ",a.jsxs("small",{children:["(",u.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})}),a.jsxs("dd",{children:[a.jsx(b,{...x}),s>0?a.jsxs("small",{className:$("character-limit",{"near-limit":p>=.99*s,"approaching-limit":p>=.9*s&&p<.99*s}),children:[a.jsx("span",{className:"hidden",children:u.formatMessage({id:"form_fieldWrapper_characterLimit"})}),p," / ",s]}):null]}),a.jsx(_,{})]})},Oo=(t,e)=>{const{type:n,payload:r}=e,i=t.errors?lt(t.errors):{},s=t.values?lt(t.values):{};switch(n){case"toggleSubmitting":return{...t,isSubmitting:!t.isSubmitting};case"updateValue":if(r!=null&&r.key&&i[r==null?void 0:r.key]&&delete i[r==null?void 0:r.key],r!=null&&r.key){if(["isSubmitting","formSubmitted","errors"].includes(r==null?void 0:r.key))return{...t,errors:i,[r==null?void 0:r.key]:r==null?void 0:r.value};s[r==null?void 0:r.key]=r==null?void 0:r.value}return{...t,errors:i,values:s};case"addError":return r!=null&&r.key&&!i[r==null?void 0:r.key]&&(i[r==null?void 0:r.key]=r==null?void 0:r.value),{...t,errors:i};case"removeError":return r!=null&&r.key&&i[r==null?void 0:r.key]&&delete i[r==null?void 0:r.key],{...t,errors:i};case"submitForm":{const{fields:o=[],dispatch:c=()=>{},onSuccess:f=()=>{},onFailure:l=()=>{},intl:d}=r,u=lt(Object.keys(i));for(const m of o)if(m.validation)for(let p=0;p<m.validation.length;p++){const{condition:b="required",error:y=!1}=m.validation[p];let x=!1;if(typeof b=="function"){const v=b(s);v&&(x=y||v)}else{const v=s[m.id];switch(b){case"required":(!v||typeof v=="string"&&v.trim().length===0)&&(x=y||(d==null?void 0:d.formatMessage({id:"form_error_required"})));break;case"no-numbers":{v&&!/^([^0-9]*)$/.test(v)&&(x=y||(d==null?void 0:d.formatMessage({id:"form_error_numbers"})));break}case"valid-email":{v&&!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(v)&&(x=y||(d==null?void 0:d.formatMessage({id:"form_error_email"})));break}case"valid-url":{v&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(v)&&(x=y||(d==null?void 0:d.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(x){c({type:"addError",payload:{key:m.id,value:x}}),u.push(m.id);break}}return u.length===0?f(s):l(s,u),{...t,isSubmitting:!1}}case"formSubmitted":return{...t,isSubmitting:!1,formSubmitted:!0,errors:{}};case"formSubmittedAndReset":return{isSubmitting:!1,formSubmitted:!0,errors:{}};default:return t}};let gn=null;const Qt=({fields:t,className:e="",id:n=t.length?`form__${t[0].id}`:"form",formRef:r,intlPath:i=!1,button:s={variant:"primary",size:"large",customOnSubmit:!1},secondaryActionButton:o={variant:"secondary",size:"large"},meta:{shouldShowCancelButton:c=!1,shouldReset:f=!0,showRequiredLabels:l=!0,showSuccessMessage:d=!1}={shouldShowCancelButton:!1,shouldReset:!0,showRequiredLabels:!0,showSuccessMessage:!1},gtm:u={context:"Form",event:"form-submit-click"},functions:{onSuccess:m=async()=>{},onCancel:p=()=>{},onCatch:b=()=>{},onFailure:y=()=>{}}={onSuccess:async()=>{},onCancel:()=>{},onCatch:()=>{},onFailure:()=>{}},...x})=>{const{customOnSubmit:v,hideButton:_,...S}=s,T=40,k=U.useIntl(),Z={};t.length&&t.forEach(F=>{const L=F.id||F.name;L&&(Z[L]=F.value||"")});const[A,z]=g.useReducer(Oo,{isSubmitting:!1,formSubmitted:!1,errors:{},values:Z}),{errors:R,isSubmitting:D,formSubmitted:C,values:E}=A;g.useEffect(()=>{f&&C&&(gn=setTimeout(()=>{z({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[C]),g.useEffect(()=>()=>{gn&&clearTimeout(gn)},[]),g.useEffect(()=>{const F=L=>{z({type:"updateValue",payload:{key:L.detail.id,value:L.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",F),()=>{document.removeEventListener("dropdownMultiSelectSubmit",F)}},[]);const w=g.useRef(null),N=r||w;if(!t.length)return null;s.text||(s.text=k.formatMessage({id:"form_submit"}));const B=F=>{var ee;if(F.preventDefault(),F.stopPropagation(),D)return;let L=0;if((ee=N==null?void 0:N.current)!=null&&ee.id){const j=document.getElementById(N.current.id);j&&(L=j.getBoundingClientRect().top+window.scrollY)}const K=document.getElementById("header");if(K&&(L=L-K.offsetHeight-T),L<0&&(L=0),window.scrollTo({top:L,behavior:"smooth"}),z({type:"toggleSubmitting"}),s.disabled){typeof s.disabled=="object"&&s.disabled.isClickable&&z({type:"submitForm",payload:{fields:t,dispatch:z,intl:k}});return}z({type:"submitForm",payload:{fields:t,dispatch:z,onSuccess:async j=>{try{await m(j),z({type:f?"formSubmittedAndReset":"formSubmitted"})}catch(M){b(M),z({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:(j,M)=>{y(j,M),z({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:k}})};return a.jsxs(a.Fragment,{children:[a.jsxs("form",{...x,id:n,className:$("form",e),ref:N,children:[R!=null&&R.general?a.jsx(Be,{variant:"error",text:k.formatMessage({id:"form_error_generalError"})}):null,(!D&&!C||v)&&t.map((F,L)=>{const{id:K=F.name||L,component:ee,functions:j={onChange:()=>{}}}=F;if(ee)return a.jsx(ee,{...F.props||{}},`component-${K}-${L}`);const M=E?E[K]:"";return a.jsx(Fo,{intlPath:i,...F,showRequiredLabels:l,value:M,error:R==null?void 0:R[K],functions:{...j,onChange:H=>{z({type:"updateValue",payload:{key:K,value:H}}),j.onChange(H&&H.toString(),z)}}},K)}),_?null:(D||C)&&v?a.jsxs("div",{className:"form-buttons",children:[c&&a.jsx(re,{...o,className:"gtm-trackable","data-gtm-event-context":u.context,"data-gtm-event-type":u.event,disabled:D||C,onClick:p,children:o.text||k.formatMessage({id:"form_cancel"})}),"customOnSubmit"]}):a.jsx("div",{className:`cta ${D||C?"center":""} ${C?"submitted":""}`,children:a.jsxs("div",{className:"form-buttons",children:[c&&a.jsx(re,{...o,className:"gtm-trackable","data-gtm-event-context":u.context,"data-gtm-event-type":u.event,disabled:D||C,onClick:p,children:o.text||k.formatMessage({id:"form_cancel"})}),a.jsx(re,{...S,icon:C?{icon:"tick",position:"left"}:!1,className:"gtm-trackable",onClick:B,disabled:D||C||s.disabled,"data-gtm-event-context":u.context,"data-gtm-event-type":u.event,children:D||C?k.formatMessage({id:`form_${D?"submitting":"submitted"}`}):s.text})]})})]}),d&&C&&a.jsx(ht,{className:"success",children:typeof d=="string"?d:k.formatMessage({id:"form_success"})})]})};const St="passwordRules_",Aa="isMoreThanEightCharacters",Ia="includesNumberAndSymbol",La="includesLowerAndUppercase",Do={[Aa]:"8Characters",[Ia]:"numberSymbol",[La]:"lowercaseUppercase"},Ao=({matchingRules:t={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:e=""})=>{const n=U.useIntl();return a.jsxs("aside",{className:$("password-rules",e),children:[a.jsx("small",{children:n.formatMessage({id:`${St}intro`})}),a.jsx("ul",{children:[Aa,Ia,La].map(r=>a.jsxs("li",{className:$({matches:t[r]}),children:[a.jsxs(ge,{children:[n.formatMessage({id:`${St}rule_label`})," "]}),a.jsx("span",{children:n.formatMessage({id:`${St}rule_${Do[r]}`})}),!t[r]&&a.jsxs(ge,{element:"strong",children:[" ",n.formatMessage({id:`${St}notMet`})]})]},`rule-${r}`))})]})},Io=g.memo(Ao);const Lo=({text:t={},topRating:e=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:i=()=>{}},className:s="",hasLoaded:o=!1})=>{const c=U.useIntl(),[f,l]=g.useState({setUp:!1,id:null,rating:null,disabled:!0}),d=async()=>{try{const v=await n();l(_=>({..._,setUp:!0,id:v&&v.id,disabled:!1}))}catch(v){l(_=>({..._,setUp:!0,disabled:!0})),i(v)}};if(g.useEffect(()=>{o&&!f.setUp&&d()},[o]),!o)return a.jsx(xe,{className:"rating-placeholder"});const{id:u,rating:m,disabled:p}=f,b="ratings_",y={text:c.formatMessage({id:`${b}text`}),low:c.formatMessage({id:`${b}low`}),high:c.formatMessage({id:`${b}high`}),success:c.formatMessage({id:`${b}success`}),...t},x=async v=>{if(!(!u||p))try{l(_=>({..._,rating:v,disabled:!0})),await r({id:u,value:v})}catch(_){l(S=>({...S,rating:null})),i(_)}finally{l(_=>({..._,disabled:!1}))}};return a.jsxs("div",{className:$("rating",s),children:[a.jsx("span",{className:"label",children:y[m?"success":"text"]}),a.jsx("ol",{children:Array.from(new Array(e).keys()).map(v=>{const _=v+1;return a.jsx("li",{className:$({selected:m&&_<=m}),children:a.jsx(re,{variant:"tertiary",size:"small",icon:{icon:`star${!m||_>m?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${c.formatMessage({id:`${b}stars`},{number:_,total:e})}${_===1||_===e?` - ${y[_===1?"low":"high"]}`:""}`,onClick:S=>{S.preventDefault(),S.stopPropagation(),x(_)},disabled:p})},`rating-${_}`)})})]})};const Bo=({id:t="form-toggle",label:e,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:s=!1,className:o=""})=>{const[c,f]=g.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);g.useEffect(()=>{r&&f(r)},[r]);const l=d=>{s||(f(d),i(d))};return a.jsxs("div",{className:$("toggle",o),onClick:d=>{d.preventDefault(),d.stopPropagation(),l(c===n[0].value?n[1].value:n[0].value)},children:[a.jsx("p",{children:e}),a.jsx("ul",{className:$("toggle-options",{disabled:s,on:c===n[1].value}),children:n.map(d=>{const u=`${t}-${d.value}`;return a.jsxs("li",{className:"hidden",children:[a.jsx("input",{type:"radio",id:u,name:t,value:d.value,checked:c===d.value,onChange:()=>l(d.value),disabled:s}),a.jsx("label",{htmlFor:u,children:d.label})]},u)})})]})};function qo({className:t="",userId:e,userName:n,src:r,setUserImage:i,uploadImage:s}){const[o,c]=g.useState(!1),[f,l]=g.useState(!1),d=g.useRef(null),u=async m=>{c(!0),l(!1);try{const p=m.target.files&&m.target.files[0];if(!p||!e)throw c(!1),new Error("Image file or userID is missing");const b=await s({fileObject:p,userId:e});i(y=>({...y,image:{thumbnail:b.thumbnailURL,full:b.originalURL}}))}catch{l(!0)}finally{c(!1)}c(!1)};return a.jsxs("div",{className:$("profile-image-change-figure",t),children:[a.jsx(Re,{className:"profile-image-change-picture",name:n,src:r,"data-testid":"profile-picture"}),f&&a.jsx("p",{className:"error text-small",children:a.jsx(U.FormattedMessage,{id:"profile_image_change_error"})}),a.jsx("input",{id:"file",type:"file",accept:"image/*",ref:d,onChange:u,hidden:!0,"data-testid":"file-input"}),a.jsx(re,{onClick:()=>d.current&&d.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${r?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:o,children:a.jsx(U.FormattedMessage,{id:o?"profile_image_change_uploading_text":r?"profile_image_change_cta_with_picture":"profile_image_change_cta_without_picture"})})]})}const Ba=({gtm:t,functions:{onSuccess:e=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=t||{};return a.jsx(Qt,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}]},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:i},functions:{onSuccess:e,onFailure:n}})};const qa=({title:t,label:e,ctaMessage:n,titleColor:r,labelColor:i,backgroundColor:s,onClose:o,reportError:c,sendInvites:f,initialFormStatus:l="NOT_SUBMITTED"})=>{const[d,u]=g.useState([]),[m,p]=g.useState(!0),[b,y]=g.useState(l),{formatMessage:x}=U.useIntl(),v=async T=>{T.preventDefault();try{await f(d),u([]),y("SUCCESS")}catch(k){y("ERROR"),c(k)}},_=T=>{T.preventDefault(),y("NOT_SUBMITTED"),p(!0),u([])},S=T=>{T.preventDefault(),o(),y("CLOSED")};return b==="CLOSED"?null:b==="ERROR"||b==="SUCCESS"?a.jsxs("div",{className:"invite-form-wrapper",children:[a.jsx("div",{className:"content centred",children:b==="SUCCESS"?a.jsx("h2",{className:"success-title",children:x({id:"inviteForm_success"})}):a.jsxs("h2",{className:"error-title",children:[" ",x({id:"inviteForm_error"})]})}),a.jsx(je,{}),a.jsx("div",{className:"footer",children:b==="SUCCESS"?a.jsxs(a.Fragment,{children:[a.jsx(re,{variant:"secondary",onClick:_,children:x({id:"inviteForm_ctaSendMoreInvites"})}),a.jsx(re,{onClick:S,children:x({id:"inviteForm_ctaDone"})})]}):a.jsx(re,{onClick:_,children:x({id:"inviteForm_ctaTryAgain"})})})]}):a.jsx("div",{className:"invite-form-wrapper",children:a.jsxs("form",{style:{backgroundColor:s},onSubmit:v,className:$("invite-form gtm-trackable"),children:[a.jsxs("fieldset",{className:"content",children:[a.jsx("h2",{className:"title",style:{color:r},children:t}),a.jsx("label",{htmlFor:"email-input",className:"label",style:{color:i},children:e}),a.jsx(Ni.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:x({id:"inviteForm_email_placeholder"}),emails:d,onChange:T=>{u(T),p(!T.length)},autoFocus:!1,getLabel:(T,k,Z)=>a.jsxs("div",{className:"email text-medium",children:[a.jsx("div",{"data-tag-item":!0,children:T}),a.jsx(re,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{Z(k),p(!d.length)},className:"remove-email-button",screenreaderText:x({id:"overlay_close"})})]},k)})]}),a.jsx(je,{}),a.jsx("fieldset",{className:"footer",children:a.jsx(re,{className:"sendEmailsButton",disabled:m,children:n})})]})})};const Ua=({id:t="search",className:e="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:s="form-submission"})=>{const{searchIsOpen:o=!0,isDesktopVersion:c=!1}=n||{},f=U.useIntl(),l=g.useRef(null);Ye(()=>{!n||c||!o||l.current&&l.current.focus()},[o]);const d=u=>{u.preventDefault(),u.stopPropagation(),!(!l.current||!l.current.value||l.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(l.current.value)}`)};return a.jsx("form",{onSubmit:d,className:$("search-form gtm-trackable",e),"data-gtm-event-context":i,"data-gtm-event-type":s,children:a.jsx("fieldset",{id:`${t}-form`,hidden:n?!o:!1,role:"search",children:a.jsxs("p",{children:[a.jsx(ge,{element:"label",htmlFor:t,children:f.formatMessage({id:"search_label"})}),a.jsx("input",{ref:l,type:"search",id:t,name:t,defaultValue:r,placeholder:f.formatMessage({id:"search_placeholder"}),onKeyDown:u=>{u.key==="Enter"&&d(u)}}),a.jsx("button",{className:"clear",onClick:u=>{u.preventDefault(),u.stopPropagation(),l.current&&l.current.value&&(l.current.value="")},children:a.jsx(ge,{children:f.formatMessage({id:"search_clear"})})}),a.jsx("button",{className:"search",onClick:d,children:a.jsx(ge,{children:f.formatMessage({id:"search_cta"})})})]})})})},Ar=async({ref:t,validateEmail:e,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!t.current.validity.valid||!r.test(t.current.value))return n([{type:"validFields.email",value:!1}]);const i=t.current.value.toString().toLowerCase().trim(),s={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let o=Object.assign({},s);try{o=await e(i),o===void 0&&(o=s)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:c=!1,autoApproved:f=!1,exists:l}=o;let d="";return c?d=f?"gov":"nonGov":l.registration?l.engagement&&!l.user?d=l.auth?"verify":"pending":d="exists":l.auth&&(d="exists"),n([{type:"shouldManuallyApprove",value:!f},{type:"emailDetails",value:{email:i,boxType:d,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(i)}},{type:"validFields.email",value:!0}])},Uo=t=>{const e={};for(const n of t.entries())e[n[0]]=n[1];return{name:e.full_name,email:e.email_address.toString().toLowerCase().trim(),jobTitle:e.job_title,organization:e.organization,bioLink:e.url,optIn:!0,expectation:e.expectation,page:window.location.pathname,"g-recaptcha-response":e["g-recaptcha-response"]}},zo=async({refs:t,dataToSubmit:e,createAccount:n,onSuccess:r,dispatch:i,state:s})=>{if(!t.form||!t.form.current)throw new Error("No refs.form");if(!t.form.current.checkValidity()){t.hiddenValidation&&t.hiddenValidation.current&&t.hiddenValidation.current.click();return}const o=Uo(new FormData(t.form.current)),c=Object.assign(o,e);await n(c),localStorage.setItem("email",o.email),r&&r({...o,...s.values}),i([{type:"showSuccessMessage",value:!0}])},Zo=({shouldShow:t,functions:{validateEmail:e,resendVerificationCode:n},refs:r,state:i,dispatch:s,dataToSubmit:o,intl:c})=>{const{emailDetails:f}=i,l=(u,m)=>{u.current&&i.validFields[m]!==u.current.validity.valid&&s([{type:`validFields.${m}`,value:u.current.validity.valid}])},d=[{id:"full_name",type:"text",inputRef:r.name,placeholder:c.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>l(r.name,"name"),onFocus:()=>s([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:r.email,placeholder:c.formatMessage({id:"signup_email_address_placeholder"}),functions:{onBlur:()=>{Ar({ref:r.email,validateEmail:e,dispatch:s})},onChange:(u,m)=>{m&&m({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>s([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Oa,props:{email:f.email,type:f.boxType,resendVerificationCode:n}}];return i.shouldManuallyApprove&&(d.push({id:"job_title",type:"text",inputRef:r.jobTitle,placeholder:c.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>l(r.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:r.organisation,placeholder:c.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{l(r.organisation,"organisation")}},validation:[{condition:"required"}],"data-testid":"signup-org-input"}),t.url&&d.push({id:"url",type:"text",label:c.formatMessage({id:"signup_url"},{small:u=>a.jsx("small",{children:u})}),placeholder:c.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),t.expectation&&d.push({id:"expectation",className:"expectation",type:"text",label:c.formatMessage({id:"signup_expectation"},{small:u=>a.jsx("small",{className:"notes text-small",children:u})}),placeholder:c.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),d.push({id:"terms",className:"text-small",type:"checkbox",inputRef:r.tc,label:c.formatMessage({id:"signup_terms"},{terms:u=>a.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:u}),privacy:u=>a.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:u})}),shownValue:"accepted",functions:{onChange:u=>{if(!u)return;const m=[];["name","email"].forEach(p=>{i.validFields[p]!==r[p].current.validity.valid&&(m.push({type:`validFields.${p}`,value:r[p].current.validity.valid}),p==="email"&&Ar({ref:r.email,validateEmail:e,dispatch:s}))}),m.length&&s(m)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),d};const Wo=({className:t=""})=>a.jsxs("div",{className:$("success-message",t),"data-testid":"success-message",children:[a.jsx("p",{className:"success-title",children:a.jsx(U.FormattedMessage,{id:"signup_success_title"})}),a.jsx(U.FormattedMessage,{id:"signup_success_text",values:{p:e=>a.jsx("p",{children:e})}})]});const Ho={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},Vo=({className:t="",functions:e={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>{}},shouldShow:n={title:!0,expectation:!1,url:!0,logInButton:!0,successMessage:!0},submitButton:r,dataToSubmit:i={ref:"sign-up-form"},...s})=>{const o=U.useIntl(),[c,f]=g.useReducer(ra,Ho),{validFields:l,emailDetails:d,shouldManuallyApprove:u,showSuccessMessage:m,showError:p}=c,[b,y]=Ln.useCookies(["signup-this-session","functional-cookie-consent"]),x={form:g.createRef(),name:g.createRef(),email:g.createRef(),jobTitle:g.createRef(),organisation:g.createRef(),tc:g.createRef(),hiddenValidation:g.createRef()};g.useEffect(()=>{u===!0&&x.jobTitle.current&&x.jobTitle.current.focus()},[u]),g.useEffect(()=>{(s.showSuccessMessage||b["signup-this-session"])&&f([{type:"showSuccessMessage",value:!0}])},[b]),g.useEffect(()=>{if(m&&b["functional-cookie-consent"]){const S={path:"/",maxAge:3600};s.showSuccessMessage||y("signup-this-session","true",S)}},[m]);const v=g.useMemo(()=>Zo({shouldShow:n,functions:e,refs:x,state:c,dispatch:f,dataToSubmit:i,intl:o}),[i,e,o,x,n,c]),_=u?!Object.values(l).every(S=>S===!0):!l.name||!l.email||["exists","pending","verify"].includes(d.boxType);return n.successMessage&&m?a.jsx(Wo,{className:t}):a.jsxs("fieldset",{className:$("signup-form-fieldset",t),"data-testid":"signup-form",children:[n.title&&a.jsx("p",{className:"signup-title",children:a.jsx(U.FormattedMessage,{id:"signup_title"})}),p&&a.jsx(Be,{variant:"error",text:o.formatMessage({id:"signup_error"})}),a.jsx(Qt,{className:"signup-form",formRef:x.form,id:"sign-up-form",fields:v,intlPath:"signup",button:{variant:"primary",size:"medium",text:r||o.formatMessage({id:"signup_button_join"}),disabled:_?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},meta:{shouldReset:!1,showRequiredLabels:!1},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{zo({refs:x,dataToSubmit:i,createAccount:e.createAccount,onSuccess:e.onSuccess,dispatch:f,state:c})},onCatch:S=>{e.handleError(S),f([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),a.jsx("button",{className:"validation-button",ref:x.hiddenValidation}),n.logInButton&&a.jsx(re,{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:"/user-onboarding/login","data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",children:o.formatMessage({id:"signup_button_login"})})]})};const Yo=({className:t,showModal:e=!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:s="Send",showIcon:o,onClose:c,reportError:f=()=>{},sendInvites:l})=>a.jsx(bt,{title:n,isOpen:e,showDivider:!1,showIcon:o,functions:{onClose:c},className:$("invite-modal",t,{success:!!n}),children:a.jsx(qa,{title:r,label:i,ctaMessage:s,onClose:c,sendInvites:l,reportError:f})});const Ko=({members:t})=>{const[e,n]=g.useState(!1),r=i=>{const{fullName:s,jobTitle:o,organisation:c,photo:f}=i||{};return a.jsxs(a.Fragment,{children:[a.jsx(Re,{name:s,src:f}),a.jsx("p",{children:s}),a.jsx("small",{className:"text-medium",children:c?`${o}, ${c}`:o})]})};return a.jsxs("div",{className:"directory-wrapper",children:[a.jsx("ul",{className:"directory",children:t.map(i=>a.jsx("li",{children:a.jsx("button",{onClick:s=>{s.preventDefault(),s.stopPropagation(),n(i)},children:r(i)})},i.fullName))}),a.jsx(bt,{isOpen:e!==!1,children:e===!1?"":a.jsxs(a.Fragment,{children:[r(e),a.jsx(mt,{children:e.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})},Go=({type:t,data:e})=>{const n=U.useIntl(),{answers:r,createdAt:i,dateHasPassed:s,isOngoingEvent:o,pill:c,readingTime:f,publishedDate:l,startDate:d}=e;if(t==="question"){const u=i&&Rn(i);return a.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),i&&a.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:u?n.formatMessage({id:`dates_${u.path}`},{number:u.number}):0})]})]})}if(d&&!s||o)return a.jsx("p",{className:"details",children:o?n.formatMessage({id:"card_bootcamp"}):oa(d)});if(c)return a.jsx(pt,{variant:c==="free"?"subtle":"highlighted",className:c,"data-testid":"course-type",children:c});if(f||l){const u=l&&Rn(l);return a.jsxs("ul",{className:"details",children:[f&&a.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:f})}),l&&a.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:u?n.formatMessage({id:`dates_${u.path}`},{number:u.number}):0})})]})}return null},Ut={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"}},Qo=({data:t,cta:e,link:n,gtmContext:r})=>{var b;const i=U.useIntl(),[s,o]=g.useState({loading:!1,registered:t.registered||!1});g.useEffect(()=>{t.registered&&o(y=>({...y,registered:!0}))},[t.registered]);const{startDate:c,dateHasPassed:f,pill:l,slug:d}=t,u=t.contentType;let m="";if((b=Ut[u])!=null&&b.gtmEvent&&(m=Ut[u].gtmEvent),c&&f)return a.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${m}-click`,children:i.formatMessage({id:"card_watch"})});if(u==="people")return a.jsx(re,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${m}-click`,children:i.formatMessage({id:"card_cta_people"})});const p=["microcourse","event"];if(e&&e.onClick&&p.includes(u)&&l!=="premium"){const y=s.loading||s.registered,x=async v=>{if(v.preventDefault(),v.stopPropagation(),!(y||!e||!e.onClick)){o(_=>({..._,loading:!0}));try{const _=await e.onClick(t);o(_==="success"?()=>({registered:!0,loading:!1}):S=>({...S,loading:!1}))}catch{o(S=>({...S,loading:!1}))}}};return a.jsx(re,{onClick:x,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:y,"data-gtm-event-context":`${r}Page-${u}: ${d}`,"data-gtm-event-type":`${r}-${u}-register-click`,"data-testid":"in-card-button",children:i.formatMessage({id:`card_cta_${u}${y?`_${s.loading?"loading":"done"}`:""}`})})}return null},Ir={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},Jo=t=>{let e=t;return Object.keys(Ir).includes(t)&&(e=Ir[t]),`url(${Ae}icons/${e}.svg)`};const Xo={title:66,text:3e3,secondaryText:1e3,partner:25},Yn=({id:t="",card:e,buildCardData:n,cta:r,gtmContext:i="Carousel",className:s=""})=>{const o=U.useIntl(),c=g.useContext(Te),f=c&&typeof c.id=="string",[l,d]=g.useState({data:null,isLoading:!0}),{data:u,isLoading:m}=l,p=g.useCallback(()=>{n(e,f).then(z=>{d(()=>({data:z,isLoading:!1}))}).catch(()=>d(z=>({...z,isLoading:!1})))},[t]);if(g.useEffect(()=>{p()},[]),m||!u)return a.jsx(xe,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});const{contentType:b}=u;if(!b||!Ut[b])return a.jsx(xe,{element:"li",className:"card-wrapper"});const{basePath:y="",className:x,length:v,gtmEvent:_}=Ut[b],S=ca(`card_label_${b}`)?o.formatMessage({id:`card_label_${b}`}):!1,T=u.slug?`${y}${u.slug}`:!1,k={...Xo,...v};let Z={className:"card"};T&&(Z={href:T,className:"card gtm-trackable","data-gtm-event-context":`${i}-CarouselCard`,"data-gtm-event-type":`${_}-click`,"data-testid":"link"},u.openInNewTab&&(Z.target="_blank"));const A=u.customIcon?{"--custom-icon":Jo(u.customIcon)}:{};return a.jsx("li",{className:$("card-wrapper text-medium",x,s,{"has-link":T,"no-link":!T,"has-custom-icon":u.customIcon,"has-image":u.banner}),style:A,"data-testid":`${b}-card`,children:g.createElement(T?"a":"div",Z,a.jsxs(a.Fragment,{children:[(u.customLabel||S)&&a.jsx("small",{className:$("card-label text-small",x),children:u.customLabel||S}),u.startDate&&!u.isOngoingEvent&&a.jsx(pt,{size:"small",variant:u.dateHasPassed?"default":"information","data-testid":"date",children:u.dateHasPassed?o.formatMessage({id:"card_ended"}):qi(u.startDate)}),u.banner?a.jsxs("p",{className:"img",children:[u.registered&&a.jsx(pt,{size:"small",variant:"registered",children:o.formatMessage({id:"card_registered"})}),a.jsx(Xe,{image:u.banner})]}):x==="people"?a.jsx(Re,{name:u.title||"",src:u.profile,"data-testid":"people-profile-picture"}):null,u.contributors&&a.jsx(Zn,{contributors:{data:u.contributors},styling:{size:"small",showGap:x!=="question",showText:!0},"data-testid":"contributors"}),u.partner&&a.jsx("p",{className:"partners","data-testid":"partners",children:Ve(u.partner.title,k.partner)}),["title","text","secondaryText"].map(z=>{const R=u[z];if(!R)return null;const D=Li(z);return a.jsx("p",{className:D,"data-testid":D,children:Ve(R,k[z])},z)}),a.jsx(Go,{type:x||"",data:u}),a.jsx(Qo,{data:u,cta:r,link:T||"",gtmContext:i})]}))})};const za=({cards:t,cardTypes:e,className:n="",...r})=>a.jsx("ul",{className:$("card-block",n),children:t.map((i,s)=>{const o=i.slug?`${i.slug}-${e[s]}`:`${e[s]}-${s}`;return a.jsx(Yn,{id:o,card:{...i,contentType:e[s]},...r},o)})}),ec=(t,e,n,r)=>{const i=e*n<=t,s=t<e*(n+1),o=r.includes(Math.floor(t/e));return i&&s||o},tc=({id:t,title:e})=>{const n=U.useIntl();if(!e||!e.text)return null;const{text:r,element:i="h2",variant:s="default",size:o="medium",link:c}=e;return g.createElement(i,{className:$("title",s,o,{"highlighted-title":s==="highlighted"}),children:a.jsxs(a.Fragment,{children:[r,c&&a.jsx("a",{href:c,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${t||window.btoa(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const vn={fourCards:1024,threeCards:769,twoCards:480};let Ct=null;const nc=({id:t,cards:e,cardTypes:n,buildCardData:r,title:i,className:s,gtmContext:o})=>{const c=U.useIntl(),[f,l]=g.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:d,isLoading:u}=f,[m,p]=g.useState({currentPage:0,loadedPages:[0]}),{currentPage:b,loadedPages:y}=m,x=e.length,v=Math.ceil(x/d),_=g.useRef(null),S=Je(!0,!0,_==null?void 0:_.current);g.useEffect(()=>{let R=1;S&&(S>=vn.fourCards?R=4:S>=vn.threeCards?R=3:S>=vn.twoCards&&(R=2),R>x&&(R=x)),l(D=>({...D,cardsPerPage:R,isLoading:!1}))},[S,x]);const T=(R="next")=>{let D=b;if(typeof R=="string")if(R==="next")if(b<v-1)D=b+1;else return;else if(b>0)D=b-1;else return;else D=R;p(C=>({...C,currentPage:D,loadedPages:[...new Set([...y,D])]}))},k=R=>{Ct=R.touches[0].clientX},Z=R=>{if(Ct===null)return;const D=R.touches[0].clientX,C=Ct-D;C>5?T("next"):C<-5&&T("previous"),Ct=null},A={"--width":`${S||0}px`,"--total-cards":x,"--cards-per-page":d,"--page":b};if(u)return a.jsx(Un,{layout:`carousel${i?"-with-title":""}`});const z=(R,D)=>{var E;let C=null;return(E=R==null?void 0:R.sys)!=null&&E.id?C=`card-${R.sys.id}`:R!=null&&R.slug?C=`card-${R.slug}`:[n[D],R.contentType].includes("customCard")&&(C=`card-${window.btoa(`${R.title} ${R.createdAt}`)}-${D}`),C};return a.jsxs("section",{ref:_,className:$("carousel-wrapper",s),"data-testid":"carousel",children:[a.jsx(tc,{id:t,title:i}),a.jsx("ul",{className:"carousel",onTouchStart:k,onTouchMove:Z,style:A,"data-testid":"carousel-list",children:e.map((R,D)=>{let C=z(R,D);return C&&ec(D,d,b,y)?a.jsx(Yn,{id:C,card:{...R,contentType:n[D]},buildCardData:r,gtmContext:o},C):(C=C||`${t}-card-${D}`,a.jsx(xe,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},C))})}),v<=1?null:a.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[a.jsx("li",{className:"arrow previous",children:a.jsx(re,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:R=>{R.preventDefault(),R.stopPropagation(),T("previous")},screenreaderText:c.formatMessage({id:"carousel_pagination_previous"}),disabled:b<=0})}),[...Array(v)].map((R,D)=>a.jsx("li",{"data-testid":"carousel-controls-button",children:a.jsx("button",{className:$("page-indicator",{selected:D===b}),onClick:C=>{C.preventDefault(),C.stopPropagation(),T(D)},children:a.jsx(ge,{showOnFocus:!1,children:c.formatMessage({id:"carousel_pagination_page"},{number:D+1,total:v})})})},`page-indicator-${D}`)),a.jsx("li",{className:"arrow next",children:a.jsx(re,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:R=>{R.preventDefault(),R.stopPropagation(),T("next")},screenreaderText:c.formatMessage({id:"carousel_pagination_next"}),disabled:b>=v-1})})]})]})},rc=({carousels:t=[],isLoading:e,title:n,className:r="",...i})=>!t||!t.length?null:t.map(({title:s,viewAllUrl:o,cards:c,cardsTypes:f},l)=>{const d=s?window.btoa(s):`carousel-${l}`,u=l===t.length-1;return e?a.jsxs(g.Fragment,{children:[a.jsx(Un,{layout:`carousel${s?"-with-title":""}`,"data-testid":"carousel-placeholder"}),u?null:a.jsx(je,{})]},`placeholder-${d}`):a.jsxs(g.Fragment,{children:[a.jsx(nc,{cards:c,cardTypes:f,title:{...n,text:s,link:o},...i}),u?null:a.jsx(je,{})]},`carousel-${d}`)});const bn="joinCommunityButton",Kn=({isMember:t=!1,isShort:e=!1,functions:{join:n,leave:r}={join:()=>{},leave:()=>{}}})=>{const i=U.useIntl(),s=g.useContext(Te),o=s&&typeof s.id=="string",[c,f]=g.useState(t),[l,d]=g.useState(t?"joined":"notJoined");g.useEffect(()=>{l==="joining"?d("joined"):l==="leaving"&&d("notJoined")},[c]);const u={},m={};return c&&l!=="leaving"&&(u["data-hover-text"]=i.formatMessage({id:`${bn}_leave`}),u["aria-label"]=i.formatMessage({id:`${bn}_member_aria`}),m["aria-hidden"]="true"),a.jsx(re,{variant:c?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:c&&l!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async p=>{o&&(p.currentTarget.blur(),c?(d("leaving"),typeof r=="function"&&await r()):(d("joining"),typeof n=="function"&&await n()),f(!c))},className:$("join-community-button",l,{active:l==="joining"}),disabled:!o,...u,children:a.jsx("span",{className:"text",...m,children:i.formatMessage({id:`${bn}${["joining","leaving"].includes(l)?`_${l}`:c?"_member":e?"_short":""}`})})})};const yn="communityDetails_",ac=({className:t="",isMember:e=!1,slug:n,members:{number:r=0,data:i=[]}={number:0,data:[]},functions:{invite:s,...o}})=>{const c=U.useIntl(),f=5,l=r||i.length,d=i.length?i:Array(f).fill({}),u=`/communities/${n}/members`===window.location.pathname;return a.jsxs("div",{className:$("community-details",t),children:[a.jsx(je,{}),a.jsxs("div",{className:"member-details",children:[a.jsxs("div",{className:"top",children:[a.jsxs("h4",{children:[c.formatMessage({id:`${yn}members`}),a.jsx("span",{className:"count",children:l})]}),!u&&a.jsx("p",{className:"text-small",children:a.jsx("a",{href:`/communities/${n}/members`,children:c.formatMessage({id:`${yn}viewAll`})})})]}),a.jsx(Zn,{contributors:{total:r,data:d},styling:{size:"medium",showGap:!0,showPlaceholders:l===0},cutoff:f})]}),a.jsx(Kn,{isMember:e,functions:{...o}}),e&&a.jsx(re,{variant:"primary",onClick:s,icon:{icon:"plus"},styling:{fullWidth:!0},children:c.formatMessage({id:`${yn}invite`})})]})};const ic=({breadcrumbs:t,cutoff:e=20,className:n=""})=>{const r=U.useIntl();return a.jsxs(a.Fragment,{children:[a.jsx(ge,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),a.jsx("ul",{className:$("breadcrumbs text-small",n),children:t.map(({text:i,href:s,current:o=!1},c)=>a.jsxs("li",{children:[o&&a.jsx(ge,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),a.jsx(et,{href:o?void 0:s,children:Ve(i,e)})]},`${window.btoa(i)}_${c}`))})]})};const sc=({options:t,allOption:e=!1,allowMultiple:n=!0,onChange:r=()=>{},className:i=""})=>{const s=U.useIntl(),o=e?[{id:"all",text:typeof e!="boolean"&&e.text||s.formatMessage({id:"filters_all"})},...t]:t,[c,f]=g.useState(e?["all"]:[]),l=(d,u)=>{let m=[];c.includes(d)?m=c.filter(p=>p!==d):d==="all"?m=["all"]:n?m=[...c.filter(p=>p!=="all"),d]:m=[d],f(p=>(r&&typeof r=="function"&&r({current:m,previous:p}),m)),u&&typeof u=="function"&&u()};return a.jsx("ul",{className:$("filters",i),children:o.map(({id:d,text:u,disabled:m=!1,callback:p=()=>{}})=>{let b={};return m&&(b={disabled:!0,"aria-label":s.formatMessage({id:"filters_disabled"},{name:u})}),a.jsx("li",{children:a.jsx("button",{className:$(d,{selected:c.includes(d)}),onClick:y=>{y.preventDefault(),y.stopPropagation(),l(d,p)},...b,children:u})},d)})})},oc=(t,e)=>{const n=String(t);if(!e||!e.length)return`/${n}`;let r="";return e.forEach(({url:i,position:s})=>{s==="before-lang"?r+=`/${i}`:(r.includes(`/${n}/`)||(r+=`/${n}`),r+=`/${i}`)}),r.includes(`/${n}/`)||(r+=`/${n}`),r};const _n={en:"English",es:"Español",fr:"Français",pt:"Português"},Nt="languageSwitcher_",cc=({currentLanguage:t,isOriginalLanguage:e=!1,isHumanTranslation:n=!1,translations:r,onChange:i=()=>{},urlParts:s,variant:o="default",label:c,className:f=""})=>{const l=U.useIntl(),[d,u]=g.useState(t);if(g.useEffect(()=>{t!==d&&u(t)},[t]),!r||!Object.values(r).some(y=>y&&y.post_name))return null;const p=Object.keys(r),b=d!==t;return a.jsxs("div",{className:$("language-switcher text-small",o,f),children:[a.jsxs("nav",{children:[o!=="short"&&a.jsx("p",{children:c||l.formatMessage({id:`${Nt}label`})}),a.jsx("ul",{children:p.map(y=>{if(!_n[y])return null;let x={className:y};return d===y?x["aria-label"]=l.formatMessage({id:`${Nt}selected`},{language:_n[y]}):x={...x,href:oc(y,s),onClick:v=>{v.preventDefault(),v.stopPropagation(),u(y),i(y)}},a.jsx("li",{children:a.jsx(et,{...x,fallbackElement:"span",children:_n[y]})},y)})}),o!=="short"&&!b&&a.jsx("p",{children:l.formatMessage({id:`${Nt}translation_${e?"original":n?"human":"machine"}`})})]}),o!=="short"&&!b&&!e&&!n&&a.jsx("small",{children:l.formatMessage({id:`${Nt}disclaimer`},{email:We.support,link:y=>{const x=`mailto:${y}`;return a.jsx("a",{href:x,children:y})}})})]})};const xn=U.createIntl({locale:"en",messages:Bn}),yt=({hasNextPage:t=!0,loadNextPage:e=()=>{},variant:n="secondary",size:r="medium",styling:i={muted:!1,fullWidth:!1},icon:s=!1,messages:o={button:xn.formatMessage({id:"loadMore_button"}),endOfFeed:xn.formatMessage({id:"loadMore_endOfFeed"}),error:xn.formatMessage({id:"loadMore_error"})},className:c="",gtmContext:f="LoadMore"})=>{const[l,d]=g.useState(""),u=async m=>{try{await e(m)}catch(p){p instanceof Error?d(p.message):d("Unknown error")}};return!l&&!t&&!o.endOfFeed?null:a.jsx("footer",{className:$("load-more",c),children:!l&&t?a.jsx(re,{variant:n,size:r,styling:i,icon:s,onClick:u,"data-gtm-event-context":f,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:o.button}):o.endOfFeed&&(!l||l!=null&&l.includes("Cannot read items"))?a.jsx("p",{children:o.endOfFeed}):l&&a.jsx("p",{className:"error",children:o.error})})};const Gn=({variant:t="default",version:e="default",className:n="",...r})=>a.jsx("p",{className:"logo-wrapper",children:a.jsx("a",{href:"/home/",className:$("logo",t,e,n),...r,children:a.jsx(ge,{children:a.jsx(U.FormattedMessage,{id:"apolitical"})})})});let $t=!1;const Za=({element:t="div",id:e="more-menu",options:n,className:r=""})=>{const i=U.useIntl(),s=g.useRef(null),[o,c]=g.useState(!1),f=l=>{s.current&&l.target instanceof HTMLElement&&!s.current.contains(l.target)&&c(!1)};return g.useEffect(()=>(document.addEventListener("click",f,!0),()=>{document.removeEventListener("click",f,!0)})),g.createElement(t,{ref:s,className:$("more-menu text-medium",r),children:a.jsxs(a.Fragment,{children:[a.jsx(re,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>c(!o),"aria-haspopup":"true","aria-expanded":o,"aria-controls":e,screenreaderText:i.formatMessage({id:"moreMenu"})}),a.jsx("ul",{id:e,hidden:!o,children:n.map(({href:l,onClick:d,text:u,icon:m,...p},b)=>{const y={...p,onClick:x=>{c(!1),typeof d=="function"&&d(x)},onFocus:()=>{$t&&(clearTimeout($t),$t=!1)},onBlur:()=>{$t=setTimeout(()=>{c(!1)},100)}};return l&&(y.href=l),a.jsx("li",{children:a.jsx(re,{variant:"tertiary",size:"medium",icon:m?{icon:m,position:"left"}:!1,...y,children:u})},`${window.btoa(u)}_${b}`)})})]})})},lc=(t,e=!1)=>e?t.replaceAll("/","")===e:typeof window<"u"&&window.location&&window.location.pathname===t;const uc=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"}],Wa=({activeLink:t})=>{const e=U.useIntl(),n=g.useContext(Te),r=n&&typeof n.id=="string";return a.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[uc.map(({key:i,href:s})=>a.jsx("li",{className:$(i,{active:lc(s,t)}),children:a.jsx("a",{href:s,"data-gtm-event-type":`${i}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:e.formatMessage({id:`navigationMenu_links_${i}`})})},i)),r&&a.jsx("li",{className:"profile","data-testid":"profile-link",children:a.jsxs("a",{href:"/profiles/me","data-gtm-event-type":"profile-click","data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:[a.jsx(Re,{name:(n==null?void 0:n.name)||"",src:n!=null&&n.image?n.image.thumbnail:""}),a.jsx("span",{children:e.formatMessage({id:"navigationMenu_profile"})})]})})]})},ot=(t,e,n)=>`${t}?share=${e}${n?`&uuid=${n}`:""}`,dc=({title:t,link:e,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${ot(e,"linkedin",n)}&src=linkedin`)}&title=${encodeURIComponent(t)}&source=Apolitical`},{key:"twitter",icon:"social_twitter",url:`https://twitter.com/share?ref_src=twsrc%5Etfw&url=${encodeURIComponent(`${ot(e,"twitter",n)}&src=twitter`)}&text=${encodeURIComponent(t)}&via=${encodeURIComponent("apoliticalco")}`},{key:"facebook",icon:"social_facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(`${ot(e,"facebook",n)}`)}&t=${t}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(t)}&body=${encodeURIComponent(`${t}
|
|
62
|
+
*/function Nr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Pr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Nr(Object(n),!0).forEach(function(r){to(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nr(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function to(t,e,n){return e=ro(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function no(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ro(t){var e=no(t,"string");return typeof e=="symbol"?e:String(e)}var Rr={activateTrap:function(e,n){if(e.length>0){var r=e[e.length-1];r!==n&&r.pause()}var i=e.indexOf(n);i===-1||e.splice(i,1),e.push(n)},deactivateTrap:function(e,n){var r=e.indexOf(n);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},ao=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},io=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},dt=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},so=function(e){return dt(e)&&!e.shiftKey},oo=function(e){return dt(e)&&e.shiftKey},Fr=function(e){return setTimeout(e,0)},Or=function(e,n){var r=-1;return e.every(function(i,s){return n(i)?(r=s,!1):!0}),r},st=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof e=="function"?e.apply(void 0,r):e},jt=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},co=[],lo=function(e,n){var r=(n==null?void 0:n.document)||document,i=(n==null?void 0:n.trapStack)||co,s=Pr({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:so,isKeyBackward:oo},n),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},c,f=function(E,w,$){return E&&E[w]!==void 0?E[w]:s[$||w]},l=function(E,w){var $=typeof(w==null?void 0:w.composedPath)=="function"?w.composedPath():void 0;return o.containerGroups.findIndex(function(L){var Z=L.container,I=L.tabbableNodes;return Z.contains(E)||($==null?void 0:$.includes(Z))||I.find(function(V){return V===E})})},d=function(E){var w=s[E];if(typeof w=="function"){for(var $=arguments.length,L=new Array($>1?$-1:0),Z=1;Z<$;Z++)L[Z-1]=arguments[Z];w=w.apply(void 0,L)}if(w===!0&&(w=void 0),!w){if(w===void 0||w===!1)return w;throw new Error("`".concat(E,"` was specified but was not a node, or did not return a node"))}var I=w;if(typeof w=="string"&&(I=r.querySelector(w),!I))throw new Error("`".concat(E,"` as selector refers to no known node"));return I},u=function(){var E=d("initialFocus");if(E===!1)return!1;if(E===void 0||!Ot(E,s.tabbableOptions))if(l(r.activeElement)>=0)E=r.activeElement;else{var w=o.tabbableGroups[0],$=w&&w.firstTabbableNode;E=$||d("fallbackFocus")}if(!E)throw new Error("Your focus-trap needs to have at least one focusable element");return E},m=function(){if(o.containerGroups=o.containers.map(function(E){var w=Na(E,s.tabbableOptions),$=Pa(E,s.tabbableOptions),L=w.length>0?w[0]:void 0,Z=w.length>0?w[w.length-1]:void 0,I=$.find(function(j){return Oe(j)}),V=$.slice().reverse().find(function(j){return Oe(j)}),J=!!w.find(function(j){return Ne(j)>0});return{container:E,tabbableNodes:w,focusableNodes:$,posTabIndexesFound:J,firstTabbableNode:L,lastTabbableNode:Z,firstDomTabbableNode:I,lastDomTabbableNode:V,nextTabbableNode:function(N){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,U=w.indexOf(N);return U<0?H?$.slice($.indexOf(N)+1).find(function(Y){return Oe(Y)}):$.slice(0,$.indexOf(N)).reverse().find(function(Y){return Oe(Y)}):w[U+(H?1:-1)]}}}),o.tabbableGroups=o.containerGroups.filter(function(E){return E.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!d("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(o.containerGroups.find(function(E){return E.posTabIndexesFound})&&o.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function M(E){var w=E.activeElement;if(w)return w.shadowRoot&&w.shadowRoot.activeElement!==null?M(w.shadowRoot):w},b=function M(E){if(E!==!1&&E!==p(document)){if(!E||!E.focus){M(u());return}E.focus({preventScroll:!!s.preventScroll}),o.mostRecentlyFocusedNode=E,ao(E)&&E.select()}},y=function(E){var w=d("setReturnFocus",E);return w||(w===!1?!1:E)},x=function(E){var w=E.target,$=E.event,L=E.isBackward,Z=L===void 0?!1:L;w=w||jt($),m();var I=null;if(o.tabbableGroups.length>0){var V=l(w,$),J=V>=0?o.containerGroups[V]:void 0;if(V<0)Z?I=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:I=o.tabbableGroups[0].firstTabbableNode;else if(Z){var j=Or(o.tabbableGroups,function(G){var K=G.firstTabbableNode;return w===K});if(j<0&&(J.container===w||Ot(w,s.tabbableOptions)&&!Oe(w,s.tabbableOptions)&&!J.nextTabbableNode(w,!1))&&(j=V),j>=0){var N=j===0?o.tabbableGroups.length-1:j-1,H=o.tabbableGroups[N];I=Ne(w)>=0?H.lastTabbableNode:H.lastDomTabbableNode}else dt($)||(I=J.nextTabbableNode(w,!1))}else{var U=Or(o.tabbableGroups,function(G){var K=G.lastTabbableNode;return w===K});if(U<0&&(J.container===w||Ot(w,s.tabbableOptions)&&!Oe(w,s.tabbableOptions)&&!J.nextTabbableNode(w))&&(U=V),U>=0){var Y=U===o.tabbableGroups.length-1?0:U+1,ee=o.tabbableGroups[Y];I=Ne(w)>=0?ee.firstTabbableNode:ee.firstDomTabbableNode}else dt($)||(I=J.nextTabbableNode(w))}}else I=d("fallbackFocus");return I},v=function(E){var w=jt(E);if(!(l(w,E)>=0)){if(st(s.clickOutsideDeactivates,E)){c.deactivate({returnFocus:s.returnFocusOnDeactivate});return}st(s.allowOutsideClick,E)||E.preventDefault()}},_=function(E){var w=jt(E),$=l(w,E)>=0;if($||w instanceof Document)$&&(o.mostRecentlyFocusedNode=w);else{E.stopImmediatePropagation();var L,Z=!0;if(o.mostRecentlyFocusedNode)if(Ne(o.mostRecentlyFocusedNode)>0){var I=l(o.mostRecentlyFocusedNode),V=o.containerGroups[I].tabbableNodes;if(V.length>0){var J=V.findIndex(function(j){return j===o.mostRecentlyFocusedNode});J>=0&&(s.isKeyForward(o.recentNavEvent)?J+1<V.length&&(L=V[J+1],Z=!1):J-1>=0&&(L=V[J-1],Z=!1))}}else o.containerGroups.some(function(j){return j.tabbableNodes.some(function(N){return Ne(N)>0})})||(Z=!1);else Z=!1;Z&&(L=x({target:o.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(o.recentNavEvent)})),b(L||o.mostRecentlyFocusedNode||u())}o.recentNavEvent=void 0},S=function(E){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;o.recentNavEvent=E;var $=x({event:E,isBackward:w});$&&(dt(E)&&E.preventDefault(),b($))},T=function(E){if(io(E)&&st(s.escapeDeactivates,E)!==!1){E.preventDefault(),c.deactivate();return}(s.isKeyForward(E)||s.isKeyBackward(E))&&S(E,s.isKeyBackward(E))},k=function(E){var w=jt(E);l(w,E)>=0||st(s.clickOutsideDeactivates,E)||st(s.allowOutsideClick,E)||(E.preventDefault(),E.stopImmediatePropagation())},W=function(){if(o.active)return Rr.activateTrap(i,c),o.delayInitialFocusTimer=s.delayInitialFocus?Fr(function(){b(u())}):b(u()),r.addEventListener("focusin",_,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",k,{capture:!0,passive:!1}),r.addEventListener("keydown",T,{capture:!0,passive:!1}),c},O=function(){if(o.active)return r.removeEventListener("focusin",_,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",k,!0),r.removeEventListener("keydown",T,!0),c},z=function(E){var w=E.some(function($){var L=Array.from($.removedNodes);return L.some(function(Z){return Z===o.mostRecentlyFocusedNode})});w&&b(u())},R=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(z):void 0,D=function(){R&&(R.disconnect(),o.active&&!o.paused&&o.containers.map(function(E){R.observe(E,{subtree:!0,childList:!0})}))};return c={get active(){return o.active},get paused(){return o.paused},activate:function(E){if(o.active)return this;var w=f(E,"onActivate"),$=f(E,"onPostActivate"),L=f(E,"checkCanFocusTrap");L||m(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,w==null||w();var Z=function(){L&&m(),W(),D(),$==null||$()};return L?(L(o.containers.concat()).then(Z,Z),this):(Z(),this)},deactivate:function(E){if(!o.active)return this;var w=Pr({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},E);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,O(),o.active=!1,o.paused=!1,D(),Rr.deactivateTrap(i,c);var $=f(w,"onDeactivate"),L=f(w,"onPostDeactivate"),Z=f(w,"checkCanReturnFocus"),I=f(w,"returnFocus","returnFocusOnDeactivate");$==null||$();var V=function(){Fr(function(){I&&b(y(o.nodeFocusedBeforeActivation)),L==null||L()})};return I&&Z?(Z(y(o.nodeFocusedBeforeActivation)).then(V,V),this):(V(),this)},pause:function(E){if(o.paused||!o.active)return this;var w=f(E,"onPause"),$=f(E,"onPostPause");return o.paused=!0,w==null||w(),O(),D(),$==null||$(),this},unpause:function(E){if(!o.paused||!o.active)return this;var w=f(E,"onUnpause"),$=f(E,"onPostUnpause");return o.paused=!1,w==null||w(),m(),W(),D(),$==null||$(),this},updateContainerElements:function(E){var w=[].concat(E).filter(Boolean);return o.containers=w.map(function($){return typeof $=="string"?r.querySelector($):$}),o.active&&m(),D(),this}},c.updateContainerElements(e),c};const uo=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:lo},Symbol.toStringTag,{value:"Module"})),fo=Qr(uo),mo=Qr(eo);function Ke(t){"@babel/helpers - typeof";return Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ke(t)}function po(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ra(r.key),r)}}function ho(t,e,n){return e&&Dr(t.prototype,e),n&&Dr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function go(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&In(t,e)}function In(t,e){return In=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},In(t,e)}function vo(t){var e=yo();return function(){var r=qt(t),i;if(e){var s=qt(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return bo(this,i)}}function bo(t,e){if(e&&(Ke(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lt(t)}function lt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qt(t){return qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qt(t)}function _o(t,e,n){return e=Ra(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ra(t){var e=xo(t,"string");return Ke(e)==="symbol"?e:String(e)}function xo(t,e){if(Ke(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Ke(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Tt=g,Q=Is,wo=fo,ko=wo.createFocusTrap,jo=mo,To=jo.isFocusable,Hn=function(t){go(n,t);var e=vo(n);function n(r){var i;po(this,n),i=e.call(this,r),_o(lt(i),"getNodeForOption",function(c){var f,l=(f=this.internalOptions[c])!==null&&f!==void 0?f:this.originalOptions[c];if(typeof l=="function"){for(var d=arguments.length,u=new Array(d>1?d-1:0),m=1;m<d;m++)u[m-1]=arguments[m];l=l.apply(void 0,u)}if(l===!0&&(l=void 0),!l){if(l===void 0||l===!1)return l;throw new Error("`".concat(c,"` was specified but was not a node, or did not return a node"))}var p=l;if(typeof l=="string"){var b;if(p=(b=this.getDocument())===null||b===void 0?void 0:b.querySelector(l),!p)throw new Error("`".concat(c,"` as selector refers to no known node"))}return p}),i.handleDeactivate=i.handleDeactivate.bind(lt(i)),i.handlePostDeactivate=i.handlePostDeactivate.bind(lt(i)),i.handleClickOutsideDeactivates=i.handleClickOutsideDeactivates.bind(lt(i)),i.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:i.handleDeactivate,onPostDeactivate:i.handlePostDeactivate,clickOutsideDeactivates:i.handleClickOutsideDeactivates},i.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var s=r.focusTrapOptions;for(var o in s)if(Object.prototype.hasOwnProperty.call(s,o)){if(o==="returnFocusOnDeactivate"||o==="onDeactivate"||o==="onPostDeactivate"||o==="checkCanReturnFocus"||o==="clickOutsideDeactivates"){i.originalOptions[o]=s[o];continue}i.internalOptions[o]=s[o]}return i.outsideClick=null,i.focusTrapElements=r.containerElements||[],i.updatePreviousElement(),i}return ho(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var i=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return i||(i===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var i=this.getDocument();i&&(this.previouslyFocusedElement=i.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(i){var s=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,i):this.originalOptions.clickOutsideDeactivates;return s&&(this.outsideClick={target:i.target,allowDeactivation:s}),s}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var i=this,s=function(){var c=i.getReturnFocusNode(),f=!!(i.originalOptions.returnFocusOnDeactivate&&c!==null&&c!==void 0&&c.focus&&(!i.outsideClick||i.outsideClick.allowDeactivation&&!To(i.outsideClick.target,i.internalOptions.tabbableOptions))),l=i.internalOptions.preventScroll,d=l===void 0?!1:l;f&&c.focus({preventScroll:d}),i.originalOptions.onPostDeactivate&&i.originalOptions.onPostDeactivate.call(null),i.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(s,s):s()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var i=this.focusTrapElements.some(Boolean);i&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(i){if(this.focusTrap){i.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var s=!i.active&&this.props.active,o=i.active&&!this.props.active,c=!i.paused&&this.props.paused,f=i.paused&&!this.props.paused;if(s&&(this.updatePreviousElement(),this.focusTrap.activate()),o){this.deactivateTrap();return}c&&this.focusTrap.pause(),f&&this.focusTrap.unpause()}else i.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var i=this,s=this.props.children?Tt.Children.only(this.props.children):void 0;if(s){if(s.type&&s.type===Tt.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var o=function(l){var d=i.props.containerElements;s&&(typeof s.ref=="function"?s.ref(l):s.ref&&(s.ref.current=l)),i.focusTrapElements=d||[l]},c=Tt.cloneElement(s,{ref:o});return c}return null}}]),n}(Tt.Component),ot=typeof Element>"u"?Function:Element;Hn.propTypes={active:Q.bool,paused:Q.bool,focusTrapOptions:Q.shape({document:Q.object,onActivate:Q.func,onPostActivate:Q.func,checkCanFocusTrap:Q.func,onPause:Q.func,onPostPause:Q.func,onUnpause:Q.func,onPostUnpause:Q.func,onDeactivate:Q.func,onPostDeactivate:Q.func,checkCanReturnFocus:Q.func,initialFocus:Q.oneOfType([Q.instanceOf(ot),Q.string,Q.bool,Q.func]),fallbackFocus:Q.oneOfType([Q.instanceOf(ot),Q.string,Q.func]),escapeDeactivates:Q.oneOfType([Q.bool,Q.func]),clickOutsideDeactivates:Q.oneOfType([Q.bool,Q.func]),returnFocusOnDeactivate:Q.bool,setReturnFocus:Q.oneOfType([Q.instanceOf(ot),Q.string,Q.bool,Q.func]),allowOutsideClick:Q.oneOfType([Q.bool,Q.func]),preventScroll:Q.bool,tabbableOptions:Q.shape({displayCheck:Q.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:Q.oneOfType([Q.bool,Q.func])}),trapStack:Q.array,isKeyForward:Q.func,isKeyBackward:Q.func}),containerElements:Q.arrayOf(Q.instanceOf(ot)),children:Q.oneOfType([Q.element,Q.instanceOf(ot)])};Hn.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:ko};var Eo=Hn;const So=Gr(Eo);const Vn=({element:t="section",children:e,className:n,...r})=>g.createElement(t,{className:C("modal",n),children:typeof e=="string"?a.jsx("p",{children:e}):e,...r});const bt=({id:t="content-overlay",isOpen:e=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:i=()=>{},onClose:s=()=>{}}={},forceShow:{error:o=!1}={},title:c,children:f,buttons:l,className:d="",gtmContext:u="Modal"})=>{const m=q.useIntl(),[p,b]=g.useState(e),y=_=>{_.key==="Escape"&&x(!1)};g.useEffect(()=>(window.addEventListener("keyup",y),()=>{window.removeEventListener("keyup",y)}));const x=_=>{b(_),_?(i(),document.body.classList.add("has-overlay")):(s(),document.body.classList.remove("has-overlay"))};g.useEffect(()=>{x(e)},[e]);const v=r?{"--max-width":`${r/16}rem`}:{};return a.jsx("div",{className:C("overlay",{open:p}),role:"dialog",children:a.jsx(Vn,{id:t,className:C("overlay-modal",d,{"has-max-width":r}),hidden:!p,style:v,children:e&&a.jsx(So,{children:a.jsxs("div",{className:"overlay-content",children:[a.jsxs("div",{className:"top",children:[c&&a.jsx("h2",{className:"modal-title",children:c}),a.jsx(re,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>x(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":u,screenreaderText:m.formatMessage({id:"overlay_close"})})]}),n&&a.jsx(je,{}),f,l&&a.jsxs("div",{className:"bottom",children:[a.jsx(je,{}),a.jsx(Xe,{buttons:l})]}),o&&a.jsx(gt,{className:"error",children:o})]})})})})},Fa=(t,e)=>({"aria-haspopup":!0,"aria-expanded":e,"aria-controls":t});const Et="emailHelperTextBox_",Oa=({type:t,email:e,redirectPath:n,resendVerificationCode:r})=>{const i=q.useIntl(),[s,o]=g.useState({path:`${Et}default`,type:"default",link:{},mail:{},error:""}),[c,f]=g.useState(!1),l=g.useCallback(p=>{p.preventDefault(),p.stopPropagation();const b=y=>{o({path:`${Et}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:x=>l(x),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:y})};if(typeof r!="function"){b(i.formatMessage({id:`${Et}error_noFunction`}));return}f(!0),r(e).then(()=>{localStorage.setItem("email",e),window.location.href=n||"/signup/verify-email"}).catch(y=>{b(y.message)}).finally(()=>{f(!1)})},[e,n,r]);g.useEffect(()=>{let p=Et,b="default",y={},x={};switch(t){case"gov":p+="autoApproved",b="success";break;case"nonGov":p+="unrecognisedEmail",b="error",y={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",b="error",x={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",b="error",y={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:v=>l(v),"data-testid":"send-verify-email-click"};break;case"exists":p+="emailAlreadyExists",b="error",y={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},x={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:p+="default",y={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}o({...s,path:p,type:b,link:y,mail:x})},[t]);const d={};return["link","mail"].forEach(p=>{d[p]=Object.keys(s[p]).length?b=>a.jsx("a",{...s[p],children:b}):b=>b}),a.jsx(va,{type:s.type,heading:c?!1:i.formatMessage({id:`${s.path}_title`}),children:c?a.jsxs(a.Fragment,{children:[a.jsx(xe,{element:"span"}),a.jsx(xe,{element:"span"})]}):i.formatMessage({id:`${s.path}_text`},{...d,strong:p=>a.jsx("strong",{children:p}),em:p=>a.jsx("em",{children:p}),br:a.jsxs(a.Fragment,{children:[a.jsx("br",{}),a.jsx("br",{})]}),error:s.error})})},ft=({className:t="",element:e="input",id:n,inputRef:r,functions:i={onChange:()=>{}},name:s=n,placeholder:o,type:c="text",value:f,...l})=>{const d=g.useRef(),u=r||d;return g.createElement(e,{ref:u,...l,type:c,id:n,name:s,className:C(t,e,{"has-scrollbar":c==="textarea"&&u.current&&u.current.clientHeight<u.current.scrollHeight}),value:f,placeholder:o,...i,onChange:m=>{const p=m.target;i.onChange(p.value)}})};const ze={UP:"ArrowUp",DOWN:"ArrowDown",ENTER:"Enter"},Co=500,Mo=({value:t,placeholder:e,functions:n={onChange:()=>{},onKeyInput:async()=>new Promise(()=>{})}})=>{const{onChange:r=()=>{},onKeyInput:i=async()=>{}}=n,[{input:s,displayInput:o,debouncedInput:c},f]=g.useState({input:t,displayInput:t,debouncedInput:t}),[{predictions:l,activePredictionIndex:d,isPredictionSelected:u},m]=g.useState({predictions:[],activePredictionIndex:-1,isPredictionSelected:!!t}),{formatMessage:p}=q.useIntl();e||(e=p({id:"inputAutocomplete_placeholder"})),g.useEffect(()=>{const v=setTimeout(()=>{u||f(_=>({..._,debouncedInput:s}))},Co);return()=>{clearTimeout(v)}},[s,u]),g.useEffect(()=>{c&&!u?(async()=>{try{const _=await i(c)||[];m(S=>({...S,predictions:_}))}catch(_){console.error("Error fetching predictions:",_),m(S=>({...S,predictions:[]}))}})():m(v=>({...v,predictions:[]}))},[c,u]),g.useEffect(()=>{d>=0&&l[d]&&f(v=>({...v,displayInput:l[d].description}))},[d,l]);const b=v=>{[ze.DOWN,ze.UP,ze.ENTER].includes(v.key)&&(v.preventDefault(),v.key===ze.DOWN&&d<l.length-1?m(_=>({..._,activePredictionIndex:d+1})):v.key===ze.UP&&d>0?m(_=>({..._,activePredictionIndex:d-1})):v.key===ze.ENTER&&d>-1&&(r(l[d].description),f(_=>({..._,input:l[d].description})),m(_=>({..._,predictions:[],isPredictionSelected:!0}))))},y=v=>{r(v.target.value),f(_=>({..._,input:v.target.value,displayInput:v.target.value})),m(_=>({..._,activePredictionIndex:-1,isPredictionSelected:!1}))},x=v=>{r(v.description),f(_=>({..._,input:v.description,displayInput:v.description})),m(_=>({..._,isPredictionSelected:!0,predictions:[]}))};return a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"text",value:o,onChange:y,onKeyDown:b,placeholder:e}),a.jsx("ul",{className:"predictions-list",children:l.map((v,_)=>a.jsx("li",{onClick:()=>x(v),onMouseEnter:()=>m(S=>({...S,activePredictionIndex:_})),className:C("predictions-list-item",{active:_===d}),children:v.description},_))})]})};const Da=({className:t="",disabled:e,element:n="p",functions:r={onChange:()=>{}},id:i,inputRef:s,intlPath:o=!1,label:c,shownValue:f=!0,type:l="checkbox",value:d,...u})=>{const m=q.useIntl(),{onChange:p,...b}=r,y=()=>{e||p(d?null:f)},x=a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:s,id:i,name:i,type:l,value:f,checked:d,onKeyDown:v=>{(v.key==="Enter"||v.code==="Space")&&(v.preventDefault(),v.stopPropagation(),y())},readOnly:!0,disabled:e}),a.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),a.jsx("label",{htmlFor:i,children:c||m.formatMessage({id:o?`${o}_${i}`:i})})]});return g.createElement(n,{onClick:v=>{const _=v.target;_.nodeName.toLowerCase()==="a"||_.parentNode&&_.parentNode.nodeName.toLowerCase()==="a"||(v.preventDefault(),v.stopPropagation(),y())},className:C("checkbox-wrapper",t),...u,...b},x)};const $o=g.memo(function({direction:e="down"}){return a.jsx(Yt,{className:C("rotating-chevron",`direction-${e}`)})});const No=({className:t,options:e,initialValue:n,value:r,functions:i={onChange:()=>{},onMultiSelectSubmit:()=>{}},gtm:{context:s}={context:""},placeholder:o,multiSelect:c,multiSelectOptions:f,id:l})=>{const d=q.useIntl(),[u,m]=g.useState(!1),p=r||n,b=Array.isArray(p)?[...p]:p?[p]:[],[y,x]=g.useState(b);let v;Array.isArray(y)&&y.length===1&&typeof y[0]=="string"?v=e&&y?e.find(O=>O.id===y[0]):e?e[0]:{id:"",label:""}:Array.isArray(y)&&y.length===1&&typeof y[0]!="string"?v=y[0]:v={id:"",label:""},g.useEffect(()=>{x(b)},[r,n]);const{onChange:_,onMultiSelectSubmit:S,...T}=i,k=O=>{if(c){let z=[];y!=null&&y.includes(O.id)?z=y.filter(R=>R!==O.id):z=[...y,O.id],x([...z]),_&&_([...z])}else x([O]),_&&_(O.id),m(!1)},W=O=>{if(O==="all"){const z=(e==null?void 0:e.map(R=>R.id))||[];x(z),_&&_(z)}else x([]),_&&_([])};return a.jsxs("div",{className:C("dropdown-wrapper",t),children:[a.jsxs("button",{className:"input","aria-expanded":u,"aria-haspopup":"listbox","aria-controls":"dropdown-list",onClick:O=>{O.preventDefault(),O.stopPropagation(),m(!u)},"data-testid":"dropdown-selector",...T,children:[c?`${o} · ${y.length}`:v.label,a.jsx($o,{direction:u?"up":"down"})]}),a.jsx("select",{defaultValue:v.id,onChange:O=>{O.preventDefault(),O.stopPropagation();const z=e&&e.find(R=>R.id===O.target.value);k(z)},hidden:!u,...T,children:e==null?void 0:e.map(O=>a.jsx("option",{value:O.id,children:O.label},O.id))}),a.jsxs("div",{className:"menu-options input dropdown-menu",role:"menu",hidden:!u,children:[a.jsxs("div",{className:"dropdown-menu-list",children:[(f==null?void 0:f.topbar)&&a.jsxs("div",{className:"action-bar",children:[a.jsx("p",{children:`${y==null?void 0:y.length} selected`}),a.jsxs("ul",{children:[a.jsx("li",{children:a.jsx(re,{variant:"tertiary",size:"small",onClick:()=>W("all"),className:"gtm-trackable",children:d.formatMessage({id:"dropdown_menu_multiselect_all"})})}),a.jsx("li",{children:a.jsx(re,{variant:"tertiary",size:"small",onClick:()=>W("none"),className:"gtm-trackable",children:d.formatMessage({id:"dropdown_menu_multiselect_none"})})})]})]}),a.jsx("ul",{children:e==null?void 0:e.map(O=>{const z=O.id===v.id||(y==null?void 0:y.includes(O))||(y==null?void 0:y.includes(O.id));return a.jsx("li",{"data-testid":"dropdown-options",children:a.jsxs("button",{className:C("gtm-trackable",{selected:z,"selected-single":z&&!c}),"data-gtm-event-type":`${O}-click`,"data-gtm-event-context":s,onClick:R=>{R.preventDefault(),R.stopPropagation(),k(O)},role:"menuitem","aria-current":z,"data-testid":z?"current-selection":"",children:[c&&a.jsx("span",{className:"pretty-checkbox","data-testid":"pretty-checkbox"}),a.jsx("span",{className:C({"menu-option-label":c}),children:O.label})]})},O.id)})})]}),(f==null?void 0:f.submitSection)&&a.jsx("p",{className:"submit",children:a.jsx(re,{variant:"secondary",onClick:()=>{S&&S(y),document.dispatchEvent(new CustomEvent("dropdownMultiSelectSubmit",{detail:{id:l||"dropdown-multi-select",value:y}})),m(!1)},children:d.formatMessage({id:"form_submit"})})})]})]})};const Po=({className:t="",functions:e={onChange:()=>{}},intlPath:n=!1,id:r,label:i,multiSelect:s=!1,name:o,options:c,required:f,type:l="checkboxes",value:d,...u})=>{const m=q.useIntl(),p=s?d:[],b=d;return a.jsx("ul",{...u,className:C("options-wrapper",t),"data-testid":`ul-${r}`,children:c==null?void 0:c.map(({id:y,label:x=!1,value:v=y,disabled:_=!1})=>{const S=`${r}_${y}`,T=()=>{if(_)return;let k;if(s){const W=p==null?void 0:p.indexOf(v);Array.isArray(p)&&W>=0?(k=p,k.splice(W,1)):(!p||p.length===0?k=[]:k=p,k.push(v))}else k=b===v?void 0:v;e.onChange(k)};return a.jsx(Da,{element:"li",id:S,type:l==="checkboxes"?"checkbox":"radio",shownValue:v,value:s?p==null?void 0:p.includes(v):b===v,functions:{...e,onChange:T},intlPath:n,label:x||m.formatMessage({id:n?`${n}_${y}`:y}),disabled:_},S)})})};const Ro=({inputRef:t,type:e="password",gtm:{context:n}={context:void 0},...r})=>{const i=q.useIntl(),s=g.useRef(),o=t||s,[c,f]=g.useState(!1),[l,d]=g.useState(e),u=()=>{var m;f(!c),d(c?"password":"text"),(m=o.current)==null||m.focus()};return a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:C("show-password gtm-trackable",{"password-visible":c}),"data-gtm-event-context":n,"data-gtm-event-type":`${c?"hide":"show"}-password-click`,onClick:u,"aria-label":i.formatMessage({id:`showpassword_aria_${c?"hide":"show"}`}),children:i.formatMessage({id:`showpassword_${c?"hide":"show"}`})}),a.jsx(ft,{inputRef:o,type:l,...r})]})};const Ze={text:{component:ft},email:{component:ft},textarea:{component:ft,props:{element:"textarea",rows:4,cols:10}},checkbox:{component:Da},checkboxes:{component:Po,props:{multiSelect:!0}},select:{component:No},password:{component:Ro},autocomplete:{component:Mo}},Fo=({id:t,intlPath:e=!1,className:n="",error:r,functions:i={onChange:()=>{}},limit:s=0,showRequiredLabels:o=!0,type:c,validation:f,value:l,...d})=>{const u=q.useIntl(),m=f&&f.some(({condition:T})=>T==="required"),p=(l==null?void 0:l.toString().length)||0,b=c&&Ze[c]&&Ze[c].component?Ze[c].component:ft,y={};c&&["checkboxes"].includes(c)?y.element="span":y.htmlFor=t;let x={...d,id:t,name:t,className:r?"error":"",type:c,required:m,"aria-required":m,functions:ut(i),value:l};s>0&&(x["data-character-limit"]=s,x.functions&&(x.functions.onChange=T=>{((T==null?void 0:T.toString().length)||0)>s&&(T=T==null?void 0:T.toString().slice(0,s)),i.onChange(T)})),c&&Ze[c]&&Ze[c].props&&(x={...x,...Ze[c].props}),c&&["checkboxes"].includes(c)&&(x.intlPath=`${e}_${t}`),r&&(x["aria-invalid"]=!0,x["aria-describedby"]=`error-${t}`);const v=d.label||u.formatMessage({id:e?`${e}_${t}`:t}),_=({...T})=>r?g.createElement(T.as||"dd",{id:`error-${t}`,className:"error text-small",role:"alert","aria-live":"assertive",...T},r):null;if(c&&["checkbox"].includes(c))return a.jsxs(a.Fragment,{children:[a.jsx(b,{...x,label:v,className:C("field-wrapper",n)}),a.jsx(_,{as:"p"})]});const S=T=>g.createElement(T.element||"label",{...T,className:"checkboxes-label text-small","data-testid":`label-${t}`});return a.jsxs("dl",{className:C("field-wrapper text-medium",n),children:[a.jsx("dt",{children:a.jsxs(S,{...y,children:[v,m&&o&&a.jsxs(a.Fragment,{children:[" ",a.jsxs("small",{children:["(",u.formatMessage({id:"form_fieldWrapper_required"}),")"]})]})]})}),a.jsxs("dd",{children:[a.jsx(b,{...x}),s>0?a.jsxs("small",{className:C("character-limit",{"near-limit":p>=.99*s,"approaching-limit":p>=.9*s&&p<.99*s}),children:[a.jsx("span",{className:"hidden",children:u.formatMessage({id:"form_fieldWrapper_characterLimit"})}),p," / ",s]}):null]}),a.jsx(_,{})]})},Oo=(t,e)=>{const{type:n,payload:r}=e,i=t.errors?ut(t.errors):{},s=t.values?ut(t.values):{};switch(n){case"toggleSubmitting":return{...t,isSubmitting:!t.isSubmitting};case"updateValue":if(r!=null&&r.key&&i[r==null?void 0:r.key]&&delete i[r==null?void 0:r.key],r!=null&&r.key){if(["isSubmitting","formSubmitted","errors"].includes(r==null?void 0:r.key))return{...t,errors:i,[r==null?void 0:r.key]:r==null?void 0:r.value};s[r==null?void 0:r.key]=r==null?void 0:r.value}return{...t,errors:i,values:s};case"addError":return r!=null&&r.key&&!i[r==null?void 0:r.key]&&(i[r==null?void 0:r.key]=r==null?void 0:r.value),{...t,errors:i};case"removeError":return r!=null&&r.key&&i[r==null?void 0:r.key]&&delete i[r==null?void 0:r.key],{...t,errors:i};case"submitForm":{const{fields:o=[],dispatch:c=()=>{},onSuccess:f=()=>{},onFailure:l=()=>{},intl:d}=r,u=ut(Object.keys(i));for(const m of o)if(m.validation)for(let p=0;p<m.validation.length;p++){const{condition:b="required",error:y=!1}=m.validation[p];let x=!1;if(typeof b=="function"){const v=b(s);v&&(x=y||v)}else{const v=s[m.id];switch(b){case"required":(!v||typeof v=="string"&&v.trim().length===0)&&(x=y||(d==null?void 0:d.formatMessage({id:"form_error_required"})));break;case"no-numbers":{v&&!/^([^0-9]*)$/.test(v)&&(x=y||(d==null?void 0:d.formatMessage({id:"form_error_numbers"})));break}case"valid-email":{v&&!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(v)&&(x=y||(d==null?void 0:d.formatMessage({id:"form_error_email"})));break}case"valid-url":{v&&!/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/.test(v)&&(x=y||(d==null?void 0:d.formatMessage({id:"form_error_url"})));break}default:console.warn("WARNING! No field validation condition has been set")}}if(x){c({type:"addError",payload:{key:m.id,value:x}}),u.push(m.id);break}}return u.length===0?f(s):l(s,u),{...t,isSubmitting:!1}}case"formSubmitted":return{...t,isSubmitting:!1,formSubmitted:!0,errors:{}};case"formSubmittedAndReset":return{isSubmitting:!1,formSubmitted:!0,errors:{}};default:return t}};let gn=null;const Qt=({fields:t,className:e="",id:n=t.length?`form__${t[0].id}`:"form",formRef:r,intlPath:i=!1,button:s={variant:"primary",size:"large",customOnSubmit:!1},secondaryActionButton:o={variant:"secondary",size:"large"},meta:{shouldShowCancelButton:c=!1,shouldReset:f=!0,showRequiredLabels:l=!0,showSuccessMessage:d=!1}={shouldShowCancelButton:!1,shouldReset:!0,showRequiredLabels:!0,showSuccessMessage:!1},gtm:u={context:"Form",event:"form-submit-click"},functions:{onSuccess:m=async()=>{},onCancel:p=()=>{},onCatch:b=()=>{},onFailure:y=()=>{}}={onSuccess:async()=>{},onCancel:()=>{},onCatch:()=>{},onFailure:()=>{}},...x})=>{const{customOnSubmit:v,hideButton:_,...S}=s,T=40,k=q.useIntl(),W={};t.length&&t.forEach(I=>{const V=I.id||I.name;V&&(W[V]=I.value||"")});const[O,z]=g.useReducer(Oo,{isSubmitting:!1,formSubmitted:!1,errors:{},values:W}),{errors:R,isSubmitting:D,formSubmitted:M,values:E}=O;g.useEffect(()=>{f&&M&&(gn=setTimeout(()=>{z({type:"updateValue",payload:{key:"formSubmitted",value:!1}})},3e3))},[M]),g.useEffect(()=>()=>{gn&&clearTimeout(gn)},[]),g.useEffect(()=>{const I=V=>{z({type:"updateValue",payload:{key:V.detail.id,value:V.detail.value}})};return document.addEventListener("dropdownMultiSelectSubmit",I),()=>{document.removeEventListener("dropdownMultiSelectSubmit",I)}},[]);const w=g.useRef(null),$=r||w;if(!t.length)return null;s.text||(s.text=k.formatMessage({id:"form_submit"}));const Z=[{...S,icon:M?{icon:"tick",position:"left"}:!1,className:"gtm-trackable",onClick:I=>{var j;if(I.preventDefault(),I.stopPropagation(),D)return;let V=0;if((j=$==null?void 0:$.current)!=null&&j.id){const N=document.getElementById($.current.id);N&&(V=N.getBoundingClientRect().top+window.scrollY)}const J=document.getElementById("header");if(J&&(V=V-J.offsetHeight-T),V<0&&(V=0),window.scrollTo({top:V,behavior:"smooth"}),z({type:"toggleSubmitting"}),s.disabled){typeof s.disabled=="object"&&s.disabled.isClickable&&z({type:"submitForm",payload:{fields:t,dispatch:z,intl:k}});return}z({type:"submitForm",payload:{fields:t,dispatch:z,onSuccess:async N=>{try{await m(N),z({type:f?"formSubmittedAndReset":"formSubmitted"})}catch(H){b(H),z({type:"updateValue",payload:{key:"isSubmitting",value:!1}})}},onFailure:(N,H)=>{y(N,H),z({type:"updateValue",payload:{key:"isSubmitting",value:!1}})},intl:k}})},disabled:D||M||s.disabled,"data-gtm-event-context":u.context,"data-gtm-event-type":u.event,children:D||M?k.formatMessage({id:`form_${D?"submitting":"submitted"}`}):s.text}];return c&&Z.unshift({...o,className:"gtm-trackable","data-gtm-event-context":u.context,"data-gtm-event-type":u.event,disabled:D||M,onClick:p,children:o.text||k.formatMessage({id:"form_cancel"})}),a.jsxs(a.Fragment,{children:[a.jsxs("form",{...x,id:n,className:C("form",e),ref:$,children:[R!=null&&R.general?a.jsx(Be,{variant:"error",text:k.formatMessage({id:"form_error_generalError"})}):null,(!D&&!M||v)&&t.map((I,V)=>{const{id:J=I.name||V,component:j,functions:N={onChange:()=>{}}}=I;if(j)return a.jsx(j,{...I.props||{}},`component-${J}-${V}`);const H=E?E[J]:"";return a.jsx(Fo,{intlPath:i,...I,showRequiredLabels:l,value:H,error:R==null?void 0:R[J],functions:{...N,onChange:U=>{z({type:"updateValue",payload:{key:J,value:U}}),N.onChange(U&&U.toString(),z)}}},J)}),_?null:(D||M)&&v?v:a.jsx(Xe,{className:C("cta",{center:D||M,submitted:M}),buttons:Z})]}),d&&M&&a.jsx(gt,{className:"success",children:typeof d=="string"?d:k.formatMessage({id:"form_success"})})]})};const St="passwordRules_",Aa="isMoreThanEightCharacters",Ia="includesNumberAndSymbol",La="includesLowerAndUppercase",Do={[Aa]:"8Characters",[Ia]:"numberSymbol",[La]:"lowercaseUppercase"},Ao=({matchingRules:t={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:e=""})=>{const n=q.useIntl();return a.jsxs("aside",{className:C("password-rules",e),children:[a.jsx("small",{children:n.formatMessage({id:`${St}intro`})}),a.jsx("ul",{children:[Aa,Ia,La].map(r=>a.jsxs("li",{className:C({matches:t[r]}),children:[a.jsxs(ge,{children:[n.formatMessage({id:`${St}rule_label`})," "]}),a.jsx("span",{children:n.formatMessage({id:`${St}rule_${Do[r]}`})}),!t[r]&&a.jsxs(ge,{element:"strong",children:[" ",n.formatMessage({id:`${St}notMet`})]})]},`rule-${r}`))})]})},Io=g.memo(Ao);const Lo=({text:t={},topRating:e=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:i=()=>{}},className:s="",hasLoaded:o=!1})=>{const c=q.useIntl(),[f,l]=g.useState({setUp:!1,id:null,rating:null,disabled:!0}),d=async()=>{try{const v=await n();l(_=>({..._,setUp:!0,id:v&&v.id,disabled:!1}))}catch(v){l(_=>({..._,setUp:!0,disabled:!0})),i(v)}};if(g.useEffect(()=>{o&&!f.setUp&&d()},[o]),!o)return a.jsx(xe,{className:"rating-placeholder"});const{id:u,rating:m,disabled:p}=f,b="ratings_",y={text:c.formatMessage({id:`${b}text`}),low:c.formatMessage({id:`${b}low`}),high:c.formatMessage({id:`${b}high`}),success:c.formatMessage({id:`${b}success`}),...t},x=async v=>{if(!(!u||p))try{l(_=>({..._,rating:v,disabled:!0})),await r({id:u,value:v})}catch(_){l(S=>({...S,rating:null})),i(_)}finally{l(_=>({..._,disabled:!1}))}};return a.jsxs("div",{className:C("rating",s),children:[a.jsx("span",{className:"label",children:y[m?"success":"text"]}),a.jsx("ol",{children:Array.from(new Array(e).keys()).map(v=>{const _=v+1;return a.jsx("li",{className:C({selected:m&&_<=m}),children:a.jsx(re,{variant:"tertiary",size:"small",icon:{icon:`star${!m||_>m?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${c.formatMessage({id:`${b}stars`},{number:_,total:e})}${_===1||_===e?` - ${y[_===1?"low":"high"]}`:""}`,onClick:S=>{S.preventDefault(),S.stopPropagation(),x(_)},disabled:p})},`rating-${_}`)})})]})};const Bo=({id:t="form-toggle",label:e,options:n,initialValue:r,functions:{onChange:i=()=>{}},isDisabled:s=!1,className:o=""})=>{const[c,f]=g.useState(typeof r=="boolean"||typeof r=="string"?r:n[0].value);g.useEffect(()=>{r&&f(r)},[r]);const l=d=>{s||(f(d),i(d))};return a.jsxs("div",{className:C("toggle",o),onClick:d=>{d.preventDefault(),d.stopPropagation(),l(c===n[0].value?n[1].value:n[0].value)},children:[a.jsx("p",{children:e}),a.jsx("ul",{className:C("toggle-options",{disabled:s,on:c===n[1].value}),children:n.map(d=>{const u=`${t}-${d.value}`;return a.jsxs("li",{className:"hidden",children:[a.jsx("input",{type:"radio",id:u,name:t,value:d.value,checked:c===d.value,onChange:()=>l(d.value),disabled:s}),a.jsx("label",{htmlFor:u,children:d.label})]},u)})})]})};function qo({className:t="",userId:e,userName:n,src:r,setUserImage:i,uploadImage:s}){const[o,c]=g.useState(!1),[f,l]=g.useState(!1),d=g.useRef(null),u=async m=>{c(!0),l(!1);try{const p=m.target.files&&m.target.files[0];if(!p||!e)throw c(!1),new Error("Image file or userID is missing");const b=await s({fileObject:p,userId:e});i(y=>({...y,image:{thumbnail:b.thumbnailURL,full:b.originalURL}}))}catch{l(!0)}finally{c(!1)}c(!1)};return a.jsxs("div",{className:C("profile-image-change-figure",t),children:[a.jsx(Re,{className:"profile-image-change-picture",name:n,src:r,"data-testid":"profile-picture"}),f&&a.jsx("p",{className:"error text-small",children:a.jsx(q.FormattedMessage,{id:"profile_image_change_error"})}),a.jsx("input",{id:"file",type:"file",accept:"image/*",ref:d,onChange:u,hidden:!0,"data-testid":"file-input"}),a.jsx(re,{onClick:()=>d.current&&d.current.click(),variant:"secondary","data-gtm-event-context":"ImageField","data-gtm-event-type":`${r?"change-photo":"add-photo"}-click`,className:"gtm-trackable",disabled:o,children:a.jsx(q.FormattedMessage,{id:o?"profile_image_change_uploading_text":r?"profile_image_change_cta_with_picture":"profile_image_change_cta_without_picture"})})]})}const Ba=({gtm:t,functions:{onSuccess:e=async()=>{},onFailure:n=()=>{}}})=>{const{context:r="FooterContactUsForm",event:i="contact-form-submit-click"}=t||{};return a.jsx(Qt,{id:"contact-us-form",fields:[{id:"name",type:"text",className:"short",validation:[{condition:"required"}]},{id:"email",type:"email",className:"short",validation:[{condition:"required"},{condition:"valid-email"}]},{id:"organisation",type:"text"},{id:"interests",type:"checkboxes",options:[{id:"publishingCourse",label:"Publishing or creating a course"},{id:"buyingCourse",label:"Buying courses for my team"},{id:"learningExperience",label:"Customised learning experiences"},{id:"somethingElse",label:"Something else"}]},{id:"message",type:"textarea",limit:1e3,validation:[{condition:"required"}]}],intlPath:"contactForm",gtm:{context:r,event:i},functions:{onSuccess:e,onFailure:n}})};const qa=({title:t,label:e,ctaMessage:n,titleColor:r,labelColor:i,backgroundColor:s,onClose:o,reportError:c,sendInvites:f,initialFormStatus:l="NOT_SUBMITTED"})=>{const[d,u]=g.useState([]),[m,p]=g.useState(!0),[b,y]=g.useState(l),{formatMessage:x}=q.useIntl(),v=async T=>{T.preventDefault();try{await f(d),u([]),y("SUCCESS")}catch(k){y("ERROR"),c(k)}},_=T=>{T.preventDefault(),y("NOT_SUBMITTED"),p(!0),u([])},S=T=>{T.preventDefault(),o(),y("CLOSED")};return b==="CLOSED"?null:b==="ERROR"||b==="SUCCESS"?a.jsxs("div",{className:"invite-form-wrapper",children:[a.jsx("div",{className:"content centred",children:b==="SUCCESS"?a.jsx("h2",{className:"success-title",children:x({id:"inviteForm_success"})}):a.jsxs("h2",{className:"error-title",children:[" ",x({id:"inviteForm_error"})]})}),a.jsx(je,{}),a.jsx("div",{className:"footer",children:b==="SUCCESS"?a.jsxs(a.Fragment,{children:[a.jsx(re,{variant:"secondary",onClick:_,children:x({id:"inviteForm_ctaSendMoreInvites"})}),a.jsx(re,{onClick:S,children:x({id:"inviteForm_ctaDone"})})]}):a.jsx(re,{onClick:_,children:x({id:"inviteForm_ctaTryAgain"})})})]}):a.jsx("div",{className:"invite-form-wrapper",children:a.jsxs("form",{style:{backgroundColor:s},onSubmit:v,className:C("invite-form gtm-trackable"),children:[a.jsxs("fieldset",{className:"content",children:[a.jsx("h2",{className:"title",style:{color:r},children:t}),a.jsx("label",{htmlFor:"email-input",className:"label",style:{color:i},children:e}),a.jsx(Mi.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:x({id:"inviteForm_email_placeholder"}),emails:d,onChange:T=>{u(T),p(!T.length)},autoFocus:!1,getLabel:(T,k,W)=>a.jsxs("div",{className:"email text-medium",children:[a.jsx("div",{"data-tag-item":!0,children:T}),a.jsx(re,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{W(k),p(!d.length)},className:"remove-email-button",screenreaderText:x({id:"overlay_close"})})]},k)})]}),a.jsx(je,{}),a.jsx("fieldset",{className:"footer",children:a.jsx(re,{className:"sendEmailsButton",disabled:m,children:n})})]})})};const Ua=({id:t="search",className:e="",handleToggle:n=!1,defaultValue:r="",gtmContext:i="search-bar",gtmEvent:s="form-submission"})=>{const{searchIsOpen:o=!0,isDesktopVersion:c=!1}=n||{},f=q.useIntl(),l=g.useRef(null);Ye(()=>{!n||c||!o||l.current&&l.current.focus()},[o]);const d=u=>{u.preventDefault(),u.stopPropagation(),!(!l.current||!l.current.value||l.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(l.current.value)}`)};return a.jsx("form",{onSubmit:d,className:C("search-form gtm-trackable",e),"data-gtm-event-context":i,"data-gtm-event-type":s,children:a.jsx("fieldset",{id:`${t}-form`,hidden:n?!o:!1,role:"search",children:a.jsxs("p",{children:[a.jsx(ge,{element:"label",htmlFor:t,children:f.formatMessage({id:"search_label"})}),a.jsx("input",{ref:l,type:"search",id:t,name:t,defaultValue:r,placeholder:f.formatMessage({id:"search_placeholder"}),onKeyDown:u=>{u.key==="Enter"&&d(u)}}),a.jsx("button",{className:"clear",onClick:u=>{u.preventDefault(),u.stopPropagation(),l.current&&l.current.value&&(l.current.value="")},children:a.jsx(ge,{children:f.formatMessage({id:"search_clear"})})}),a.jsx("button",{className:"search",onClick:d,children:a.jsx(ge,{children:f.formatMessage({id:"search_cta"})})})]})})})},Ar=async({ref:t,validateEmail:e,dispatch:n})=>{const r=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!t.current.validity.valid||!r.test(t.current.value))return n([{type:"validFields.email",value:!1}]);const i=t.current.value.toString().toLowerCase().trim(),s={valid:!1,autoApproved:!1,exists:{auth:!1,engagement:!1,registration:!1,user:!1}};let o=Object.assign({},s);try{o=await e(i),o===void 0&&(o=s)}catch{return n([{type:"shouldManuallyApprove",value:!0},{type:"emailDetails",value:{email:i,boxType:"nonGov",isEnd2End:!1}},{type:"validFields.email",value:!1}])}const{valid:c=!1,autoApproved:f=!1,exists:l}=o;let d="";return c?d=f?"gov":"nonGov":l.registration?l.engagement&&!l.user?d=l.auth?"verify":"pending":d="exists":l.auth&&(d="exists"),n([{type:"shouldManuallyApprove",value:!f},{type:"emailDetails",value:{email:i,boxType:d,isEnd2End:/testing\+[0-9]+@apolitical.co$/.test(i)}},{type:"validFields.email",value:!0}])},Uo=t=>{const e={};for(const n of t.entries())e[n[0]]=n[1];return{name:e.full_name,email:e.email_address.toString().toLowerCase().trim(),jobTitle:e.job_title,organization:e.organization,bioLink:e.url,optIn:!0,expectation:e.expectation,page:window.location.pathname,"g-recaptcha-response":e["g-recaptcha-response"]}},zo=async({refs:t,dataToSubmit:e,createAccount:n,onSuccess:r,dispatch:i,state:s})=>{if(!t.form||!t.form.current)throw new Error("No refs.form");if(!t.form.current.checkValidity()){t.hiddenValidation&&t.hiddenValidation.current&&t.hiddenValidation.current.click();return}const o=Uo(new FormData(t.form.current)),c=Object.assign(o,e);await n(c),localStorage.setItem("email",o.email),r&&r({...o,...s.values}),i([{type:"showSuccessMessage",value:!0}])},Zo=({shouldShow:t,functions:{validateEmail:e,resendVerificationCode:n},refs:r,state:i,dispatch:s,dataToSubmit:o,intl:c})=>{const{emailDetails:f}=i,l=(u,m)=>{u.current&&i.validFields[m]!==u.current.validity.valid&&s([{type:`validFields.${m}`,value:u.current.validity.valid}])},d=[{id:"full_name",type:"text",inputRef:r.name,placeholder:c.formatMessage({id:"signup_full_name_placeholder"}),functions:{onChange:()=>l(r.name,"name"),onFocus:()=>s([{type:"loadRecaptcha",value:!0}])},autoComplete:"name",validation:[{condition:"required"},{condition:"no-numbers"}],"data-testid":"signup-name-input"},{id:"email_address",type:"email",inputRef:r.email,placeholder:c.formatMessage({id:"signup_email_address_placeholder"}),functions:{onBlur:()=>{Ar({ref:r.email,validateEmail:e,dispatch:s})},onChange:(u,m)=>{m&&m({type:"updateValue",payload:{key:"terms",value:!1}})},onFocus:()=>s([{type:"loadRecaptcha",value:!0}])},autoComplete:"email",validation:[{condition:"required"},{condition:"valid-email"}],"data-testid":"signup-email-input"},{component:Oa,props:{email:f.email,type:f.boxType,resendVerificationCode:n}}];return i.shouldManuallyApprove&&(d.push({id:"job_title",type:"text",inputRef:r.jobTitle,placeholder:c.formatMessage({id:"signup_job_title_placeholder"}),functions:{onChange:()=>l(r.jobTitle,"jobTitle")},validation:[{condition:"required"}],"data-testid":"signup-job-input"},{id:"organization",type:"text",inputRef:r.organisation,placeholder:c.formatMessage({id:"signup_organization_placeholder"}),functions:{onChange:()=>{l(r.organisation,"organisation")}},validation:[{condition:"required"}],"data-testid":"signup-org-input"}),t.url&&d.push({id:"url",type:"text",label:c.formatMessage({id:"signup_url"},{small:u=>a.jsx("small",{children:u})}),placeholder:c.formatMessage({id:"signup_url_placeholder"}),validation:[{condition:"valid-url"}],"data-testid":"signup-url-input"})),t.expectation&&d.push({id:"expectation",className:"expectation",type:"text",label:c.formatMessage({id:"signup_expectation"},{small:u=>a.jsx("small",{className:"notes text-small",children:u})}),placeholder:c.formatMessage({id:"signup_expectation_placeholder"}),"data-testid":"signup-events-question"}),d.push({id:"terms",className:"text-small",type:"checkbox",inputRef:r.tc,label:c.formatMessage({id:"signup_terms"},{terms:u=>a.jsx("a",{href:"https://about.apolitical.co/terms-and-conditions","data-gtm-event-context":"SignupForm","data-gtm-event-type":"terms-of-service-click",className:"gtm-trackable",children:u}),privacy:u=>a.jsx("a",{href:"https://about.apolitical.co/privacy-policy","data-gtm-event-context":"SignupForm","data-gtm-event-type":"privacy-policy-click",className:"gtm-trackable",children:u})}),shownValue:"accepted",functions:{onChange:u=>{if(!u)return;const m=[];["name","email"].forEach(p=>{i.validFields[p]!==r[p].current.validity.valid&&(m.push({type:`validFields.${p}`,value:r[p].current.validity.valid}),p==="email"&&Ar({ref:r.email,validateEmail:e,dispatch:s}))}),m.length&&s(m)}},validation:[{condition:"required"}],"data-testid":"signup-terms-checkbox"}),d};const Wo=({className:t=""})=>a.jsxs("div",{className:C("success-message",t),"data-testid":"success-message",children:[a.jsx("p",{className:"success-title",children:a.jsx(q.FormattedMessage,{id:"signup_success_title"})}),a.jsx(q.FormattedMessage,{id:"signup_success_text",values:{p:e=>a.jsx("p",{children:e})}})]});const Ho={validFields:{name:!1,email:!1,jobTitle:!1,organisation:!1},emailDetails:{email:"",boxType:"",isEnd2End:!1},shouldManuallyApprove:!1,loadRecaptcha:!1,showSuccessMessage:!1,showError:!1},Vo=({className:t="",functions:e={validateEmail:()=>Promise.resolve(),createAccount:()=>Promise.resolve(),handleError:()=>{},resendVerificationCode:()=>{}},shouldShow:n={title:!0,expectation:!1,url:!0,logInButton:!0,successMessage:!0},submitButton:r,dataToSubmit:i={ref:"sign-up-form"},...s})=>{const o=q.useIntl(),[c,f]=g.useReducer(ra,Ho),{validFields:l,emailDetails:d,shouldManuallyApprove:u,showSuccessMessage:m,showError:p}=c,[b,y]=Ln.useCookies(["signup-this-session","functional-cookie-consent"]),x={form:g.createRef(),name:g.createRef(),email:g.createRef(),jobTitle:g.createRef(),organisation:g.createRef(),tc:g.createRef(),hiddenValidation:g.createRef()};g.useEffect(()=>{u===!0&&x.jobTitle.current&&x.jobTitle.current.focus()},[u]),g.useEffect(()=>{(s.showSuccessMessage||b["signup-this-session"])&&f([{type:"showSuccessMessage",value:!0}])},[b]),g.useEffect(()=>{if(m&&b["functional-cookie-consent"]){const S={path:"/",maxAge:3600};s.showSuccessMessage||y("signup-this-session","true",S)}},[m]);const v=g.useMemo(()=>Zo({shouldShow:n,functions:e,refs:x,state:c,dispatch:f,dataToSubmit:i,intl:o}),[i,e,o,x,n,c]),_=u?!Object.values(l).every(S=>S===!0):!l.name||!l.email||["exists","pending","verify"].includes(d.boxType);return n.successMessage&&m?a.jsx(Wo,{className:t}):a.jsxs("fieldset",{className:C("signup-form-fieldset",t),"data-testid":"signup-form",children:[n.title&&a.jsx("p",{className:"signup-title",children:a.jsx(q.FormattedMessage,{id:"signup_title"})}),p&&a.jsx(Be,{variant:"error",text:o.formatMessage({id:"signup_error"})}),a.jsx(Qt,{className:"signup-form",formRef:x.form,id:"sign-up-form",fields:v,intlPath:"signup",button:{variant:"primary",size:"medium",text:r||o.formatMessage({id:"signup_button_join"}),disabled:_?{isClickable:!0}:!1,styling:{fullWidth:!0},"data-testid":"signup-button"},meta:{shouldReset:!1,showRequiredLabels:!1},gtm:{context:"SignupForm",event:"signup-submit-click"},functions:{onSuccess:async()=>{zo({refs:x,dataToSubmit:i,createAccount:e.createAccount,onSuccess:e.onSuccess,dispatch:f,state:c})},onCatch:S=>{e.handleError(S),f([{type:"showSuccessMessage",value:!1},{type:"showError",value:!0}])}}}),a.jsx("button",{className:"validation-button",ref:x.hiddenValidation}),n.logInButton&&a.jsx(re,{className:"login-button",styling:{fullWidth:!0},variant:"tertiary",size:"medium",href:"/user-onboarding/login","data-gtm-event-context":"SignupForm","data-gtm-event-type":"login-click",children:o.formatMessage({id:"signup_button_login"})})]})};const Yo=({className:t,showModal:e=!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:s="Send",showIcon:o,onClose:c,reportError:f=()=>{},sendInvites:l})=>a.jsx(bt,{title:n,isOpen:e,showDivider:!1,showIcon:o,functions:{onClose:c},className:C("invite-modal",t,{success:!!n}),children:a.jsx(qa,{title:r,label:i,ctaMessage:s,onClose:c,sendInvites:l,reportError:f})});const Ko=({members:t})=>{const[e,n]=g.useState(!1),r=i=>{const{fullName:s,jobTitle:o,organisation:c,photo:f}=i||{};return a.jsxs(a.Fragment,{children:[a.jsx(Re,{name:s,src:f}),a.jsx("p",{children:s}),a.jsx("small",{className:"text-medium",children:c?`${o}, ${c}`:o})]})};return a.jsxs("div",{className:"directory-wrapper",children:[a.jsx("ul",{className:"directory",children:t.map(i=>a.jsx("li",{children:a.jsx("button",{onClick:s=>{s.preventDefault(),s.stopPropagation(),n(i)},children:r(i)})},i.fullName))}),a.jsx(bt,{isOpen:e!==!1,children:e===!1?"":a.jsxs(a.Fragment,{children:[r(e),a.jsx(pt,{children:e.text})]}),buttons:[{size:"small",variant:"tertiary",onClick:()=>n(!1),children:"Close"}],functions:{onClose:()=>n(!1)}})]})},Go=({type:t,data:e})=>{const n=q.useIntl(),{answers:r,createdAt:i,dateHasPassed:s,isOngoingEvent:o,pill:c,readingTime:f,publishedDate:l,startDate:d}=e;if(t==="question"){const u=i&&Rn(i);return a.jsxs("p",{className:"details answers","data-testid":"question-answers",children:[n.formatMessage({id:"card_answers"},{number:r}),i&&a.jsxs("span",{"data-testid":"question-created-at",children:[" ","·"," ",n.formatMessage({id:"card_time_ago"},{time:u?n.formatMessage({id:`dates_${u.path}`},{number:u.number}):0})]})]})}if(d&&!s||o)return a.jsx("p",{className:"details",children:o?n.formatMessage({id:"card_bootcamp"}):oa(d)});if(c)return a.jsx(ht,{variant:c==="free"?"subtle":"highlighted",className:c,"data-testid":"course-type",children:c});if(f||l){const u=l&&Rn(l);return a.jsxs("ul",{className:"details",children:[f&&a.jsx("li",{"data-testid":"reading-time",children:n.formatMessage({id:"card_time_read"},{time:f})}),l&&a.jsx("li",{"data-testid":"published-date",children:n.formatMessage({id:"card_time_ago"},{time:u?n.formatMessage({id:`dates_${u.path}`},{number:u.number}):0})})]})}return null},Ut={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"}},Qo=({data:t,cta:e,link:n,gtmContext:r})=>{var b;const i=q.useIntl(),[s,o]=g.useState({loading:!1,registered:t.registered||!1});g.useEffect(()=>{t.registered&&o(y=>({...y,registered:!0}))},[t.registered]);const{startDate:c,dateHasPassed:f,pill:l,slug:d}=t,u=t.contentType;let m="";if((b=Ut[u])!=null&&b.gtmEvent&&(m=Ut[u].gtmEvent),c&&f)return a.jsx("a",{href:n,className:"details additional-link gtm-trackable","data-gtm-event-context":`${r}-CarouselCard`,"data-gtm-event-type":`${m}-click`,children:i.formatMessage({id:"card_watch"})});if(u==="people")return a.jsx(re,{variant:"tertiary",size:"small",href:n,className:"gtm-trackable","data-gtm-event-context":`${r}-Card-Button`,"data-gtm-event-type":`${m}-click`,children:i.formatMessage({id:"card_cta_people"})});const p=["microcourse","event"];if(e&&e.onClick&&p.includes(u)&&l!=="premium"){const y=s.loading||s.registered,x=async v=>{if(v.preventDefault(),v.stopPropagation(),!(y||!e||!e.onClick)){o(_=>({..._,loading:!0}));try{const _=await e.onClick(t);o(_==="success"?()=>({registered:!0,loading:!1}):S=>({...S,loading:!1}))}catch{o(S=>({...S,loading:!1}))}}};return a.jsx(re,{onClick:x,className:"gtm-trackable",size:"small",styling:{fullWidth:!0},disabled:y,"data-gtm-event-context":`${r}Page-${u}: ${d}`,"data-gtm-event-type":`${r}-${u}-register-click`,"data-testid":"in-card-button",children:i.formatMessage({id:`card_cta_${u}${y?`_${s.loading?"loading":"done"}`:""}`})})}return null},Ir={cube:"box",graduationCap:"graduation-cap",person:"user",speech:"speech-bubble_round",star:"star_empty_thin"},Jo=t=>{let e=t;return Object.keys(Ir).includes(t)&&(e=Ir[t]),`url(${Ae}icons/${e}.svg)`};const Xo={title:66,text:3e3,secondaryText:1e3,partner:25},Yn=({id:t="",card:e,buildCardData:n,cta:r,gtmContext:i="Carousel",className:s=""})=>{const o=q.useIntl(),c=g.useContext(Te),f=c&&typeof c.id=="string",[l,d]=g.useState({data:null,isLoading:!0}),{data:u,isLoading:m}=l,p=g.useCallback(()=>{n(e,f).then(z=>{d(()=>({data:z,isLoading:!1}))}).catch(()=>d(z=>({...z,isLoading:!1})))},[t]);if(g.useEffect(()=>{p()},[]),m||!u)return a.jsx(xe,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"});const{contentType:b}=u;if(!b||!Ut[b])return a.jsx(xe,{element:"li",className:"card-wrapper"});const{basePath:y="",className:x,length:v,gtmEvent:_}=Ut[b],S=ca(`card_label_${b}`)?o.formatMessage({id:`card_label_${b}`}):!1,T=u.slug?`${y}${u.slug}`:!1,k={...Xo,...v};let W={className:"card"};T&&(W={href:T,className:"card gtm-trackable","data-gtm-event-context":`${i}-CarouselCard`,"data-gtm-event-type":`${_}-click`,"data-testid":"link"},u.openInNewTab&&(W.target="_blank"));const O=u.customIcon?{"--custom-icon":Jo(u.customIcon)}:{};return a.jsx("li",{className:C("card-wrapper text-medium",x,s,{"has-link":T,"no-link":!T,"has-custom-icon":u.customIcon,"has-image":u.banner}),style:O,"data-testid":`${b}-card`,children:g.createElement(T?"a":"div",W,a.jsxs(a.Fragment,{children:[(u.customLabel||S)&&a.jsx("small",{className:C("card-label text-small",x),children:u.customLabel||S}),u.startDate&&!u.isOngoingEvent&&a.jsx(ht,{size:"small",variant:u.dateHasPassed?"default":"information","data-testid":"date",children:u.dateHasPassed?o.formatMessage({id:"card_ended"}):qi(u.startDate)}),u.banner?a.jsxs("p",{className:"img",children:[u.registered&&a.jsx(ht,{size:"small",variant:"registered",children:o.formatMessage({id:"card_registered"})}),a.jsx(et,{image:u.banner})]}):x==="people"?a.jsx(Re,{name:u.title||"",src:u.profile,"data-testid":"people-profile-picture"}):null,u.contributors&&a.jsx(Zn,{contributors:{data:u.contributors},styling:{size:"small",showGap:x!=="question",showText:!0},"data-testid":"contributors"}),u.partner&&a.jsx("p",{className:"partners","data-testid":"partners",children:Ve(u.partner.title,k.partner)}),["title","text","secondaryText"].map(z=>{const R=u[z];if(!R)return null;const D=Li(z);return a.jsx("p",{className:D,"data-testid":D,children:Ve(R,k[z])},z)}),a.jsx(Go,{type:x||"",data:u}),a.jsx(Qo,{data:u,cta:r,link:T||"",gtmContext:i})]}))})};const za=({cards:t,cardTypes:e,className:n="",...r})=>a.jsx("ul",{className:C("card-block",n),children:t.map((i,s)=>{const o=i.slug?`${i.slug}-${e[s]}`:`${e[s]}-${s}`;return a.jsx(Yn,{id:o,card:{...i,contentType:e[s]},...r},o)})}),ec=(t,e,n,r)=>{const i=e*n<=t,s=t<e*(n+1),o=r.includes(Math.floor(t/e));return i&&s||o},tc=({id:t,title:e})=>{const n=q.useIntl();if(!e||!e.text)return null;const{text:r,element:i="h2",variant:s="default",size:o="medium",link:c}=e;return g.createElement(i,{className:C("title",s,o,{"highlighted-title":s==="highlighted"}),children:a.jsxs(a.Fragment,{children:[r,c&&a.jsx("a",{href:c,className:"text-medium gtm-trackable","data-gtm-event-context":"CarouselViewAll","data-gtm-event-type":`${t||window.btoa(r)}-view-all-click`,children:n.formatMessage({id:"card_carousel_viewAll"})})]})})};const vn={fourCards:1024,threeCards:769,twoCards:480};let Ct=null;const nc=({id:t,cards:e,cardTypes:n,buildCardData:r,title:i,className:s,gtmContext:o})=>{const c=q.useIntl(),[f,l]=g.useState({cardsPerPage:4,isLoading:!0}),{cardsPerPage:d,isLoading:u}=f,[m,p]=g.useState({currentPage:0,loadedPages:[0]}),{currentPage:b,loadedPages:y}=m,x=e.length,v=Math.ceil(x/d),_=g.useRef(null),S=Je(!0,!0,_==null?void 0:_.current);g.useEffect(()=>{let R=1;S&&(S>=vn.fourCards?R=4:S>=vn.threeCards?R=3:S>=vn.twoCards&&(R=2),R>x&&(R=x)),l(D=>({...D,cardsPerPage:R,isLoading:!1}))},[S,x]);const T=(R="next")=>{let D=b;if(typeof R=="string")if(R==="next")if(b<v-1)D=b+1;else return;else if(b>0)D=b-1;else return;else D=R;p(M=>({...M,currentPage:D,loadedPages:[...new Set([...y,D])]}))},k=R=>{Ct=R.touches[0].clientX},W=R=>{if(Ct===null)return;const D=R.touches[0].clientX,M=Ct-D;M>5?T("next"):M<-5&&T("previous"),Ct=null},O={"--width":`${S||0}px`,"--total-cards":x,"--cards-per-page":d,"--page":b};if(u)return a.jsx(Un,{layout:`carousel${i?"-with-title":""}`});const z=(R,D)=>{var E;let M=null;return(E=R==null?void 0:R.sys)!=null&&E.id?M=`card-${R.sys.id}`:R!=null&&R.slug?M=`card-${R.slug}`:[n[D],R.contentType].includes("customCard")&&(M=`card-${window.btoa(`${R.title} ${R.createdAt}`)}-${D}`),M};return a.jsxs("section",{ref:_,className:C("carousel-wrapper",s),"data-testid":"carousel",children:[a.jsx(tc,{id:t,title:i}),a.jsx("ul",{className:"carousel",onTouchStart:k,onTouchMove:W,style:O,"data-testid":"carousel-list",children:e.map((R,D)=>{let M=z(R,D);return M&&ec(D,d,b,y)?a.jsx(Yn,{id:M,card:{...R,contentType:n[D]},buildCardData:r,gtmContext:o},M):(M=M||`${t}-card-${D}`,a.jsx(xe,{element:"li",className:"card-wrapper","data-testid":"card-placeholder"},M))})}),v<=1?null:a.jsxs("ul",{className:"controls","data-testid":"carousel-controls",children:[a.jsx("li",{className:"arrow previous",children:a.jsx(re,{variant:"secondary",size:"large",icon:{icon:"chevron_left"},onClick:R=>{R.preventDefault(),R.stopPropagation(),T("previous")},screenreaderText:c.formatMessage({id:"carousel_pagination_previous"}),disabled:b<=0})}),[...Array(v)].map((R,D)=>a.jsx("li",{"data-testid":"carousel-controls-button",children:a.jsx("button",{className:C("page-indicator",{selected:D===b}),onClick:M=>{M.preventDefault(),M.stopPropagation(),T(D)},children:a.jsx(ge,{showOnFocus:!1,children:c.formatMessage({id:"carousel_pagination_page"},{number:D+1,total:v})})})},`page-indicator-${D}`)),a.jsx("li",{className:"arrow next",children:a.jsx(re,{variant:"secondary",size:"large",icon:{icon:"chevron_right"},onClick:R=>{R.preventDefault(),R.stopPropagation(),T("next")},screenreaderText:c.formatMessage({id:"carousel_pagination_next"}),disabled:b>=v-1})})]})]})},rc=({carousels:t=[],isLoading:e,title:n,className:r="",...i})=>!t||!t.length?null:t.map(({title:s,viewAllUrl:o,cards:c,cardsTypes:f},l)=>{const d=s?window.btoa(s):`carousel-${l}`,u=l===t.length-1;return e?a.jsxs(g.Fragment,{children:[a.jsx(Un,{layout:`carousel${s?"-with-title":""}`,"data-testid":"carousel-placeholder"}),u?null:a.jsx(je,{})]},`placeholder-${d}`):a.jsxs(g.Fragment,{children:[a.jsx(nc,{cards:c,cardTypes:f,title:{...n,text:s,link:o},...i}),u?null:a.jsx(je,{})]},`carousel-${d}`)});const bn="joinCommunityButton",Kn=({isMember:t=!1,isShort:e=!1,functions:{join:n,leave:r}={join:()=>{},leave:()=>{}}})=>{const i=q.useIntl(),s=g.useContext(Te),o=s&&typeof s.id=="string",[c,f]=g.useState(t),[l,d]=g.useState(t?"joined":"notJoined");g.useEffect(()=>{l==="joining"?d("joined"):l==="leaving"&&d("notJoined")},[c]);const u={},m={};return c&&l!=="leaving"&&(u["data-hover-text"]=i.formatMessage({id:`${bn}_leave`}),u["aria-label"]=i.formatMessage({id:`${bn}_member_aria`}),m["aria-hidden"]="true"),a.jsx(re,{variant:c?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:c&&l!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async p=>{o&&(p.currentTarget.blur(),c?(d("leaving"),typeof r=="function"&&await r()):(d("joining"),typeof n=="function"&&await n()),f(!c))},className:C("join-community-button",l,{active:l==="joining"}),disabled:!o,...u,children:a.jsx("span",{className:"text",...m,children:i.formatMessage({id:`${bn}${["joining","leaving"].includes(l)?`_${l}`:c?"_member":e?"_short":""}`})})})};const yn="communityDetails_",ac=({className:t="",isMember:e=!1,slug:n,members:{number:r=0,data:i=[]}={number:0,data:[]},functions:{invite:s,...o}})=>{const c=q.useIntl(),f=5,l=r||i.length,d=i.length?i:Array(f).fill({}),u=`/communities/${n}/members`===window.location.pathname;return a.jsxs("div",{className:C("community-details",t),children:[a.jsx(je,{}),a.jsxs("div",{className:"member-details",children:[a.jsxs("div",{className:"top",children:[a.jsxs("h4",{children:[c.formatMessage({id:`${yn}members`}),a.jsx("span",{className:"count",children:l})]}),!u&&a.jsx("p",{className:"text-small",children:a.jsx("a",{href:`/communities/${n}/members`,children:c.formatMessage({id:`${yn}viewAll`})})})]}),a.jsx(Zn,{contributors:{total:r,data:d},styling:{size:"medium",showGap:!0,showPlaceholders:l===0},cutoff:f})]}),a.jsx(Kn,{isMember:e,functions:{...o}}),e&&a.jsx(re,{variant:"primary",onClick:s,icon:{icon:"plus"},styling:{fullWidth:!0},children:c.formatMessage({id:`${yn}invite`})})]})};const ic=({breadcrumbs:t,cutoff:e=20,className:n=""})=>{const r=q.useIntl();return a.jsxs(a.Fragment,{children:[a.jsx(ge,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),a.jsx("ul",{className:C("breadcrumbs text-small",n),children:t.map(({text:i,href:s,current:o=!1},c)=>a.jsxs("li",{children:[o&&a.jsx(ge,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),a.jsx(tt,{href:o?void 0:s,children:Ve(i,e)})]},`${window.btoa(i)}_${c}`))})]})};const sc=({options:t,allOption:e=!1,allowMultiple:n=!0,onChange:r=()=>{},className:i=""})=>{const s=q.useIntl(),o=e?[{id:"all",text:typeof e!="boolean"&&e.text||s.formatMessage({id:"filters_all"})},...t]:t,[c,f]=g.useState(e?["all"]:[]),l=(d,u)=>{let m=[];c.includes(d)?m=c.filter(p=>p!==d):d==="all"?m=["all"]:n?m=[...c.filter(p=>p!=="all"),d]:m=[d],f(p=>(r&&typeof r=="function"&&r({current:m,previous:p}),m)),u&&typeof u=="function"&&u()};return a.jsx("ul",{className:C("filters",i),children:o.map(({id:d,text:u,disabled:m=!1,callback:p=()=>{}})=>{let b={};return m&&(b={disabled:!0,"aria-label":s.formatMessage({id:"filters_disabled"},{name:u})}),a.jsx("li",{children:a.jsx("button",{className:C(d,{selected:c.includes(d)}),onClick:y=>{y.preventDefault(),y.stopPropagation(),l(d,p)},...b,children:u})},d)})})},oc=(t,e)=>{const n=String(t);if(!e||!e.length)return`/${n}`;let r="";return e.forEach(({url:i,position:s})=>{s==="before-lang"?r+=`/${i}`:(r.includes(`/${n}/`)||(r+=`/${n}`),r+=`/${i}`)}),r.includes(`/${n}/`)||(r+=`/${n}`),r};const _n={en:"English",es:"Español",fr:"Français",pt:"Português"},Mt="languageSwitcher_",cc=({currentLanguage:t,isOriginalLanguage:e=!1,isHumanTranslation:n=!1,translations:r,onChange:i=()=>{},urlParts:s,variant:o="default",label:c,className:f=""})=>{const l=q.useIntl(),[d,u]=g.useState(t);if(g.useEffect(()=>{t!==d&&u(t)},[t]),!r||!Object.values(r).some(y=>y&&y.post_name))return null;const p=Object.keys(r),b=d!==t;return a.jsxs("div",{className:C("language-switcher text-small",o,f),children:[a.jsxs("nav",{children:[o!=="short"&&a.jsx("p",{children:c||l.formatMessage({id:`${Mt}label`})}),a.jsx("ul",{children:p.map(y=>{if(!_n[y])return null;let x={className:y};return d===y?x["aria-label"]=l.formatMessage({id:`${Mt}selected`},{language:_n[y]}):x={...x,href:oc(y,s),onClick:v=>{v.preventDefault(),v.stopPropagation(),u(y),i(y)}},a.jsx("li",{children:a.jsx(tt,{...x,fallbackElement:"span",children:_n[y]})},y)})}),o!=="short"&&!b&&a.jsx("p",{children:l.formatMessage({id:`${Mt}translation_${e?"original":n?"human":"machine"}`})})]}),o!=="short"&&!b&&!e&&!n&&a.jsx("small",{children:l.formatMessage({id:`${Mt}disclaimer`},{email:We.support,link:y=>{const x=`mailto:${y}`;return a.jsx("a",{href:x,children:y})}})})]})};const xn=q.createIntl({locale:"en",messages:Bn}),yt=({hasNextPage:t=!0,loadNextPage:e=()=>{},variant:n="secondary",size:r="medium",styling:i={muted:!1,fullWidth:!1},icon:s=!1,messages:o={button:xn.formatMessage({id:"loadMore_button"}),endOfFeed:xn.formatMessage({id:"loadMore_endOfFeed"}),error:xn.formatMessage({id:"loadMore_error"})},className:c="",gtmContext:f="LoadMore"})=>{const[l,d]=g.useState(""),u=async m=>{try{await e(m)}catch(p){p instanceof Error?d(p.message):d("Unknown error")}};return!l&&!t&&!o.endOfFeed?null:a.jsx("footer",{className:C("load-more",c),children:!l&&t?a.jsx(re,{variant:n,size:r,styling:i,icon:s,onClick:u,"data-gtm-event-context":f,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:o.button}):o.endOfFeed&&(!l||l!=null&&l.includes("Cannot read items"))?a.jsx("p",{children:o.endOfFeed}):l&&a.jsx("p",{className:"error",children:o.error})})};const Gn=({variant:t="default",version:e="default",className:n="",...r})=>a.jsx("p",{className:"logo-wrapper",children:a.jsx("a",{href:"/home/",className:C("logo",t,e,n),...r,children:a.jsx(ge,{children:a.jsx(q.FormattedMessage,{id:"apolitical"})})})});let $t=!1;const Za=({element:t="div",id:e="more-menu",options:n,className:r=""})=>{const i=q.useIntl(),s=g.useRef(null),[o,c]=g.useState(!1),f=l=>{s.current&&l.target instanceof HTMLElement&&!s.current.contains(l.target)&&c(!1)};return g.useEffect(()=>(document.addEventListener("click",f,!0),()=>{document.removeEventListener("click",f,!0)})),g.createElement(t,{ref:s,className:C("more-menu text-medium",r),children:a.jsxs(a.Fragment,{children:[a.jsx(re,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>c(!o),"aria-haspopup":"true","aria-expanded":o,"aria-controls":e,screenreaderText:i.formatMessage({id:"moreMenu"})}),a.jsx("ul",{id:e,hidden:!o,children:n.map(({href:l,onClick:d,text:u,icon:m,...p},b)=>{const y={...p,onClick:x=>{c(!1),typeof d=="function"&&d(x)},onFocus:()=>{$t&&(clearTimeout($t),$t=!1)},onBlur:()=>{$t=setTimeout(()=>{c(!1)},100)}};return l&&(y.href=l),a.jsx("li",{children:a.jsx(re,{variant:"tertiary",size:"medium",icon:m?{icon:m,position:"left"}:!1,...y,children:u})},`${window.btoa(u)}_${b}`)})})]})})},lc=(t,e=!1)=>e?t.replaceAll("/","")===e:typeof window<"u"&&window.location&&window.location.pathname===t;const uc=[{key:"homepage",href:"/home/"},{key:"events",href:"/events/"},{key:"microcourses",href:"/microcourses/"},{key:"articles",href:"/solution-articles/"}],Wa=({activeLink:t})=>{const e=q.useIntl(),n=g.useContext(Te),r=n&&typeof n.id=="string";return a.jsxs("ul",{id:"navigation-menu",className:"text-medium",children:[uc.map(({key:i,href:s})=>a.jsx("li",{className:C(i,{active:lc(s,t)}),children:a.jsx("a",{href:s,"data-gtm-event-type":`${i}-click`,"data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:e.formatMessage({id:`navigationMenu_links_${i}`})})},i)),r&&a.jsx("li",{className:"profile","data-testid":"profile-link",children:a.jsxs("a",{href:"/profiles/me","data-gtm-event-type":"profile-click","data-gtm-event-context":"NavigationMenu",className:"gtm-trackable",children:[a.jsx(Re,{name:(n==null?void 0:n.name)||"",src:n!=null&&n.image?n.image.thumbnail:""}),a.jsx("span",{children:e.formatMessage({id:"navigationMenu_profile"})})]})})]})},ct=(t,e,n)=>`${t}?share=${e}${n?`&uuid=${n}`:""}`,dc=({title:t,link:e,referrer:n})=>[{key:"linkedin",icon:"social_linkedin",url:`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(`${ct(e,"linkedin",n)}&src=linkedin`)}&title=${encodeURIComponent(t)}&source=Apolitical`},{key:"twitter",icon:"social_twitter",url:`https://twitter.com/share?ref_src=twsrc%5Etfw&url=${encodeURIComponent(`${ct(e,"twitter",n)}&src=twitter`)}&text=${encodeURIComponent(t)}&via=${encodeURIComponent("apoliticalco")}`},{key:"facebook",icon:"social_facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(`${ct(e,"facebook",n)}`)}&t=${t}`},{key:"email",icon:"share_email",url:`mailto:?subject=${encodeURIComponent(t)}&body=${encodeURIComponent(`${t}
|
|
63
63
|
|
|
64
|
-
${ot(e,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:ot(e,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,i)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(i))}];const fc="shareLinks_",mc=({title:t,link:e,referrer:n,gtmContext:r="ShareLinks",size:i="large",variant:s="default",className:o=""})=>{const c=U.useIntl(),f=dc({title:t,link:e,referrer:n});return a.jsxs("aside",{className:$("share-links",i,s,o),children:[a.jsx("p",{className:"text-small",children:c.formatMessage({id:"shareLinks_label"})}),a.jsx("ul",{children:f.map(({key:l,icon:d,url:u,shouldRender:m=!0,onClick:p})=>{if(typeof m=="function"&&!m())return null;const b={};return p&&(b.onClick=y=>p(y,u)),a.jsx("li",{children:a.jsx(re,{size:i,variant:"tertiary",icon:{icon:d||l},href:u,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${l}-click`,"data-testid":"link",screenreaderText:c.formatMessage({id:`${fc}link_${l}`}),...b})},l)})})]})};const pc=({tabs:t,className:e=""})=>{var f;const n=(l,d,u)=>(l||(l=`panel-${window.btoa(d)}-${u}`),l);let r=t.findIndex(l=>l.current===!0);if(r<0&&(r=0),window.location.hash){const l=window.location.hash.replace("#","");if(t.find(u=>u.id===l)){for(let u=0;u<t.length;u++)if(n(t[u].id,t[u].text,u)===l){r=u;break}}}const[i,s]=g.useState((f=t[r])!=null&&f.id?t[r].id:n(t[r].id,t[r].text,r));g.useEffect(()=>{if(t[r].hasCarousel){const l=new CustomEvent("hiddenSectionVisible",{detail:{id:i}});window.dispatchEvent(l)}},[i]);const o=[],c=[];return t.forEach(({id:l,text:d,content:u,href:m,hasCarousel:p},b)=>{l=n(l,d,b);const y=i===l,x={};m||(x["aria-controls"]=l,x.onClick=v=>{v.preventDefault(),v.stopPropagation(),s(l),window.location.hash=`#${l}`},c.push(a.jsx("section",{id:l,hidden:!y,role:"tabpanel","aria-labelledby":`tab-${l}`,"aria-live":y?"assertive":"off",children:typeof u=="string"?a.jsx("p",{children:u}):u},`section-${l}`))),o.push(a.jsx("li",{children:a.jsx("a",{href:m||`#${l}`,id:`tab-${l}`,className:$({selected:y}),role:"tab","aria-selected":y,...x,children:d})},`tab-${l}`))}),a.jsxs("div",{className:$("tabs-wrapper",e),children:[a.jsx("ul",{className:"tabs",role:"tablist",children:o}),a.jsx("div",{className:"tab-content",children:c})]})};const hc={"2-1":901,"1-3":769,"1-1":769},Ha=({layout:t="2-1",hideOnMobile:e=!1,className:n="",children:r})=>{const i=Je(!0);let s=r;return g.Children.count(r)===1&&(s=g.Children.toArray(r)[0],s.props&&(s=s.props.children)),a.jsx("section",{className:$("columns",`layout-${t}`,n),children:g.Children.map(s,(o,c)=>e!==!1&&c===e&&i&&i<hc[t]?null:o)})};let wn;const kn="contactFooter_",gc=({onSuccess:t=async()=>{},onFailure:e=()=>{}})=>{const n=g.useRef(null),[r,i]=g.useState(0),[s,o]=g.useState(!1),c=()=>{n.current&&i(n.current.clientHeight)},f=()=>{s||(o(!0),clearTimeout(wn),wn=setTimeout(()=>{c(),o(!1)},500))};return g.useEffect(()=>(c(),window.addEventListener("resize",f),()=>{clearTimeout(wn),window.removeEventListener("resize",f)}),[]),a.jsx(Le,{id:"contactForm",className:"contact-footer",children:a.jsxs("div",{className:"inner-wrapper",children:[a.jsx("h2",{children:a.jsx(U.FormattedMessage,{id:`${kn}title`})}),a.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:s?{}:{minHeight:r},children:[a.jsxs("aside",{children:[a.jsx("p",{children:a.jsx(U.FormattedMessage,{id:`${kn}text`})}),a.jsx(et,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:a.jsx(U.FormattedMessage,{id:`${kn}email`})})]}),a.jsx(Ba,{functions:{onSuccess:t,onFailure:e},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},vc=({activeLink:t,...e})=>a.jsx(Le,{children:a.jsx(Ha,{layout:"1-3",children:a.jsxs(a.Fragment,{children:[a.jsx(Wa,{activeLink:t}),a.jsx(ya,{...e})]})})});const jn="cookieBanner_",Tn=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],En=new Date(Date.now()+12*30*24*60*60*1e3),Va=()=>{const t=U.useIntl(),[e,n,r]=Ln.useCookies(Tn),[i,s]=g.useState(!e["apol-cookie-banner"]),o=()=>{Tn.forEach(d=>{n(d,!0,{path:"/",expires:En,domain:d==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),s(!1),window.location.reload()},c=()=>{n("apol-cookie-banner",!0,{path:"/",expires:En}),Tn.forEach(d=>{if(d==="apol-cookie-banner"){n(d,!0,{path:"/",expires:En});return}r(d)}),s(!1)};if(!i)return null;const f=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:c,gtmType:"reject-all"},{id:"accept",onClick:o,gtmType:"accepted-all"}],l=[];return f.forEach(d=>{l.push({variant:d.href?"tertiary":"primary",href:d.href,onClick:d.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${d.gtmType}-click`,children:t.formatMessage({id:`${jn}buttons_${d.id}`})})}),a.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[a.jsx("h6",{children:t.formatMessage({id:`${jn}title`})}),a.jsx("p",{children:t.formatMessage({id:`${jn}text`})}),a.jsx(vt,{buttons:l})]})},Ne={platform:{order:["events","courses","articles"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-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:We["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:We["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:We.support,gtmType:"concierge-email-click"},business:{email:We.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 He="footer_",zt="SiteFooter",Lr=({group:t})=>{const e=Ne[t].order||[];let n=!1;return"text"in Ne[t]&&(n=Ne[t].text),a.jsxs(g.Fragment,{children:[a.jsx("p",{className:"pre-title",children:a.jsx(U.FormattedMessage,{id:`${He}${t}`})}),Array.isArray(e)&&e.length>0&&a.jsx("ul",{className:"text-medium",children:e.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:s}=Ne[t][r],o={};return["legal"].includes(t)&&(o.target="_blank",o.rel="noopener"),a.jsx("li",{children:a.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":zt,"data-gtm-event-type":s,...o,children:a.jsx(U.FormattedMessage,{id:`${He}${t}_${r}`})})},`${t}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&a.jsx("dl",{className:"text-medium",children:n.order.map(r=>a.jsxs(g.Fragment,{children:[a.jsx("dt",{children:a.jsx(U.FormattedMessage,{id:`${He}${t}_${r}`})}),a.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&a.jsx("address",{children:a.jsx(U.FormattedMessage,{id:`${He}${t}_${r}_address`,values:{br:a.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&a.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":zt,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${t}-${r}`))})]},t)},Qn=()=>a.jsx("div",{id:"footer",children:a.jsxs("div",{className:"wrapper",children:[a.jsx(Yt,{element:"hr"}),a.jsx(Gn,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":zt,"data-gtm-event-type":"logo-homepage-link"}),a.jsx("footer",{children:["platform","community","company","contact"].map(t=>a.jsxs("div",{className:"group",children:[a.jsx(Lr,{group:t}),Object.keys(Ne[t]).includes("child")&&a.jsx(Lr,{group:Ne[t].child})]},t))}),a.jsx("hr",{}),a.jsxs("div",{className:"sub-footer",children:[a.jsx("ul",{children:Array.isArray(Ne.social.order)&&Ne.social.order.map(t=>{const e=Ne.social[t];return a.jsx("li",{className:t,children:a.jsx("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":zt,"data-gtm-event-type":"social-click",children:a.jsx("span",{className:"hidden",children:a.jsx(U.FormattedMessage,{id:`${He}social_${t}`})})})},t)})}),a.jsx("small",{children:a.jsx(U.FormattedMessage,{id:`${He}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),ue={timeouts:{},handlerCalled:{},getIsDesktopVersion:(t,e)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=s=>{const o=`logged${t?"In":"Out"}`;return e>=n[s][o]};let i={};return["navigation","search"].forEach(s=>{i[s]=r(s)}),i},shouldChangeHeaderIsVisible:(t,e,n)=>{Object.values(e).filter(i=>i===!0).length||n([{type:"headerIsVisible",value:t}])},handleMenus:({id:t,value:e,menus:n,dispatch:r})=>{if(n[t]===e||t==="account"&&e===!1&&n.navigation===!0)return;const i=Date.now();if(!e&&ue.handlerCalled[t]&&i-ue.handlerCalled[t]<500)return;ue.handlerCalled[t]=i;let s=[{type:`menus.${t}`,value:e}];e===!0&&Object.keys(n).forEach(o=>{o===t||n[o]===!1||s.push({type:`menus.${o}`,value:!1})}),r(s)},findFirstChild:(t,e,n=!1)=>{if(!t||!t[0])return!1;for(let r=0;r<=t.length;r++){if(!t[r])continue;if(t[r][e]&&(!n||t[r][e].includes(n)))return t[r];if(!e.includes("."))continue;const i=Kr(t[r],e);if(!(typeof i>"u")&&(!n||i[e]&&i[e].includes(n)||i.value&&i.value.includes(n)||i.toString().includes(n)))return t[r]}return t[0].children?ue.findFirstChild(t[0].children,e,n):!1},autoFocus:({menu:t,navigationRef:e,isDesktopVersion:n,focusElements:r,dispatch:i})=>{if(!e.current||!e.current.children)return;const s=n?"desktop":"default";if(r[t][s]){r[t][s].focus();return}let o,c;switch(t){case"navigation":if(n){const f=ue.findFirstChild(e.current.children,"attributes.aria-controls","navigation");o=ue.findFirstChild(f.children,"href")}else o=ue.findFirstChild(e.current.children,"href");o||(o=e.current);break;case"account":if(c=ue.findFirstChild(e.current.children,"className","account"),!c||!c.children)return;o=ue.findFirstChild(c.children,"href");break;default:return}o&&(i([{type:`focusElements.${t}.${s}`,value:o}]),o.focus())},events:{onClick:(t,{id:e,callback:n,isOpen:r})=>{t.target&&t.target.attributes&&t.target.attributes.href||(t.preventDefault(),t.stopPropagation(),clearTimeout(ue.timeouts[e]),n(e,!r))},onFocus:({id:t})=>{clearTimeout(ue.timeouts[t])},onMouseEnter:({id:t,callback:e})=>{clearTimeout(ue.timeouts[t]),e(t,!0)},onBlur:({id:t,callback:e})=>{ue.timeouts[t]=setTimeout(()=>{e(t,!1)},250)}}},gt={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"navigation",explore:{order:["events","courses","articles"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"}},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"}}}},Zt=({id:t,isLoggedIn:e=!1,isDesktopVersion:n=!1,menus:r={},callback:i=()=>{},doTrack:s=null})=>{const o=U.useIntl(),c=Kr(gt,t);if(!c||c.onlyShow&&(c.onlyShow==="logged-in"&&!e||c.onlyShow==="logged-out"&&e))return null;const f="doTrack"in c,l=s===null?f?c.doTrack:!0:s,d=t.includes("buttons.");let u=`header_${t.replaceAll(".","_")}`;c.hasVariantText&&(u+=`_logged${e?"In":"Out"}`);let m=!1;if(c.href){let _=c.gtmType||`${t}-click`;if(_.includes(".")){const S=_.split("."),T=S[S.length-2];_=`${T==="topics"?`${T}-`:""}${S[S.length-1]}`}m={href:c.href,role:"menuitem"},l&&(m={...m,className:"gtm-trackable","data-gtm-event-type":_,"data-gtm-event-context":"HeaderButtons"}),d&&(m={...m,variant:"secondary",size:{mobile:"small",881:"large"},...c.props||{}})}const p=c.order&&c.order[0]&&c[c.order[0]],b=p&&c[c.order[0]].order,y=m&&window.location.pathname===c.href;let x={},v={};if(p){const _=c.menuId||t,S={onClick:T=>ue.events.onClick(T,{id:_,callback:i,isOpen:r[_]}),onFocus:()=>ue.events.onFocus({id:_}),onBlur:()=>ue.events.onBlur({id:_,callback:i}),onMouseLeave:()=>ue.events.onBlur({id:_,callback:i}),onMouseEnter:()=>ue.events.onMouseEnter({id:_,callback:i})};n&&(b&&(x={...S,onKeyPress:T=>{T.key==="Enter"&&ue.events.onClick(T,{id:_,callback:i,isOpen:r[_]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":r[_],"aria-controls":_}),v={hidden:_ in r?!r[_]:!0}),b||(v={...v,...S})}return a.jsxs("li",{className:$({[c.className]:c.className,"has-submenu":p,parent:b,active:y}),role:"none",...x,children:[m?g.createElement(d?re:"a",m,o.formatMessage({id:u})):o.formatMessage({id:u}),c.order&&a.jsx("ul",{...v,children:c.order.map(_=>{if(!c[_])return null;const S={isLoggedIn:e,isDesktopVersion:n,menus:r,callback:i,doTrack:f?l:null};return c[_].order?a.jsxs("li",{className:$({[c[_].className]:c[_].className}),children:[o.formatMessage({id:`${u}_${_}`}),a.jsx("ul",{children:c[_].order.map(T=>a.jsx(Zt,{id:`${t}.${_}.${T}`,...S},T))})]},_):a.jsx(Zt,{id:`${t}.${_}`,...S},_)})})]},t)};const bc={height:67,height_desktop:83},Jn=({showNavigation:t=!0})=>{const e=U.useIntl(),n=g.useContext(Te),r=Je(!0,!0),i=n&&typeof n.id=="string",s=g.useMemo(()=>ue.getIsDesktopVersion(i,r),[i,r]),[o,c]=g.useReducer(ra,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:f,menus:l,focusElements:d}=o;ta({scrollPosition:bc[`height${s.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{!s&&l.navigation||ue.shouldChangeHeaderIsVisible(!0,l,c)},scrollDown:()=>{!s&&l.navigation||ue.shouldChangeHeaderIsVisible(!1,l,c)}}});const u=(p,b)=>{ue.handleMenus({id:p,value:b,menus:l,dispatch:c})},m=g.useRef(null);return Ye(()=>{l.navigation&&ue.autoFocus({menu:"navigation",navigationRef:m,isDesktopVersion:s.navigation,focusElements:d,dispatch:c})},[l.navigation]),Ye(()=>{l.account&&ue.autoFocus({menu:"account",navigationRef:m,isDesktopVersion:s.navigation,focusElements:d,dispatch:c})},[l.account]),n&&n.isLoading?null:a.jsxs(a.Fragment,{children:[a.jsxs("nav",{id:"header",className:$({"logged-in":i,"logged-out":!i,visible:f}),children:[a.jsx(ge,{element:"a",href:"#content-of-page",children:e.formatMessage({id:"header_skip"})}),a.jsx(Gn,{}),t&&a.jsxs(a.Fragment,{children:[!s.navigation&&a.jsx("button",{className:"menu-button gtm-trackable",onClick:p=>{p.preventDefault(),p.stopPropagation(),u("navigation",!l.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":l.navigation,"aria-controls":"navigation",children:a.jsx(ge,{children:e.formatMessage({id:`header_menu_${l.navigation?"hide":"show"}`})})}),a.jsx("ul",{ref:m,id:"navigation",hidden:s.navigation||l.account?!1:!l.navigation,role:"menu","data-showing":!s.navigation&&l.account?"account":"default",children:gt.order.map(p=>a.jsx(Zt,{id:p,isLoggedIn:i,isDesktopVersion:s.navigation,menus:{navigation:l.navigation,account:l.account},callback:u},p))}),!s.search&&a.jsx("button",{className:"search toggle-search-button",onClick:p=>{p.preventDefault(),p.stopPropagation(),u("search",!l.search)},"aria-haspopup":"true","aria-expanded":l.search,"aria-controls":"search-form",children:a.jsx(ge,{children:e.formatMessage({id:`header_search_${l.search?"hide":"show"}`})})}),a.jsx(Ua,{id:"global-search",handleToggle:{searchIsOpen:l.search,isDesktopVersion:s.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),i?a.jsxs("button",{className:"account-button",onClick:p=>ue.events.onClick(p,{id:"account",callback:u,isOpen:l.account}),onMouseEnter:()=>ue.events.onMouseEnter({id:"account",callback:u}),onMouseLeave:()=>ue.events.onBlur({id:"account",callback:u}),"aria-haspopup":"true","aria-expanded":l.account,"aria-controls":"navigation",children:[a.jsx(ge,{children:e.formatMessage({id:`header_account_${l.account?"hide":"show"}`})}),a.jsx(Re,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):a.jsx("ul",{className:"sign-in-buttons",children:gt.buttons.order.map(p=>a.jsx(Zt,{id:`buttons.${p}`},p))})]})]}),a.jsx("hr",{id:"content-of-page"}),a.jsx("div",{className:$("overlay",{open:l.navigation||l.account||!s.search&&l.search})})]})};const yc=()=>{const t=U.useIntl();return a.jsxs(a.Fragment,{children:[a.jsx(Jn,{}),a.jsx("div",{id:"content",children:a.jsx(Be,{variant:"error",text:t.formatMessage({id:"pageLayout_error"})})}),a.jsx(Qn,{})]})},Ya=({children:t,additionalContent:{prepended:e,appended:n}={},reportError:r,forceShow:i={},styling:s={},className:o="",locale:c="en"})=>{const{navigation:f=!0,footer:l=!0}=i,{background:d="default",variant:u="default",circle:m="default"}=s,p=Xr();g.useEffect(()=>{window.scrollTo(0,0)},[p]);const b=Ft(t,{locale:c}),y=Ft(e,{locale:c}),x=Ft(n,{locale:c}),v={};return d!=="default"&&(v[d]=!0),u!=="default"&&(v[u]=!0),m!=="default"&&(v[m]=!0),a.jsx($i.ErrorBoundary,{onError:r,fallback:a.jsx(yc,{}),children:a.jsx(g.Suspense,{fallback:null,children:a.jsxs("div",{id:"wrapper",className:$(o,v,{"has-footer":l}),children:[a.jsx(Jn,{showNavigation:f}),a.jsxs("section",{id:"content-wrapper",children:[y&&a.jsx("div",{className:"additional-content prepended",children:y}),g.createElement(d==="bold"?Vn:"div",{id:"content",children:b})]}),x&&a.jsx("div",{className:"additional-content appended",children:x}),l&&a.jsx(Qn,{}),a.jsx(Va,{})]})})})},Br={default:"tags_",headerTopics:"header_topics_topics_"},Sn={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"},_c={getTagDetails:t=>{if(t.includes("topic_")){if(t=Sn.topic[t.replace("topic_","")],t){const e=gt.topics.topics[t].href;return e?{id:t,href:e,text:`${Br.headerTopics}${t}`}:null}return null}return Sn[t]?(t=Sn[t],{id:t,text:`${Br.default}${t}`}):null}};const xc=({tags:t=[],color:e="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:i="",gtmType:s="tag-click",gtmContext:o="tags"})=>{const c=U.useIntl();if(!t||t.length<1)return null;const f=[];return t.forEach(l=>{if(!l)return;const d=_c.getTagDetails(l);d&&f.push(d)}),f.length<1?null:a.jsx("ul",{className:$("tags text-small",e,i,{"one-line":n}),children:f.map(l=>{const d=c.formatMessage({id:l.text});return a.jsx("li",{children:l.href&&r?a.jsx("a",{href:l.href,className:"gtm-trackable","data-gtm-event-type":s,"data-gtm-event-context":o,children:d}):d},l.id)})})};const wc=({members:{data:t=[],total:e=t.length},hasNextPage:n=!1,loadNextPage:r=()=>{},gtmContext:i="member",gtmType:s="member-click",className:o=""})=>{const c=U.useIntl();return t.length===0?null:a.jsxs("div",{className:$("members-list",o),children:[a.jsxs("h1",{children:[c.formatMessage({id:"membersList"}),a.jsx("span",{className:"count",children:e})]}),a.jsx("ul",{children:t.map((f,l)=>a.jsxs("li",{children:[a.jsx(Gt,{member:f,gtmContext:i,gtmType:s}),f.isAdmin&&a.jsx(pt,{children:c.formatMessage({id:"membersList_admin"})})]},l))}),n&&a.jsx(yt,{hasNextPage:n,loadNextPage:r,icon:{icon:"arrow-down",position:"right"},gtmContext:i})]})};let Mt=null;const ye="discussion_form_",Jt=({content:t={type:"response",slugs:{}},userHasPermissions:e=!0,meta:n={isLoading:!1,isInWrapper:!1,isEditing:!1,showTitle:!1,showSuccessMessage:!0},inputRef:r,placeholder:i,maxLength:s=5e4,minRows:o=4,forceShow:c={cancel:!1,error:!1},functions:f={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},props:{create:{projectNames:["questions-answers"]}}},gtmContext:l="DiscussionForm"})=>{var D,C,E;const d=U.useIntl(),u=g.useContext(Te),[m,p]=g.useState(n.isEditing&&n.isEditing.text||""),[b,y]=g.useState(c.error||!1),[x,v]=g.useState(!1),_=g.useRef(null);if(r||(r=_),n.isLoading)return a.jsx(xe,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const S=w=>{const N=w.target.value;p(N);let B;!u||!u.id?B=ke(d.formatMessage,`${ye}error_loggedOut`,t.type,"action"):e?N.length>=s&&(B=`${ye}error_tooLong`):B=ke(d.formatMessage,`${ye}error_noPermission`,t.type,"action"),B?y(B):b&&y(!1)};let T=`${t.type}-form`;if(t.type==="response"||t.type==="reply"){const w=((D=t.slugs)==null?void 0:D.reply)||((C=t.slugs)==null?void 0:C.answer)||((E=t.slugs)==null?void 0:E.question)||"";w&&(T=`${T}-${w.slice(-15)}`)}const k=async w=>{var B;if(w.preventDefault(),w.stopPropagation(),!u||!u.id||!e||A)return;Mt&&clearTimeout(Mt),v("submitting");const N=window.location.pathname;try{let F;switch(t.type){case"post":F=await f.create({content:m});break;case"question":F=await f.create({title:m,authorId:u&&u.id,...(B=f.props)==null?void 0:B.create});break;case"response":F=await f.create({question:t.slugs.question},{body:m,authorId:u&&u.id,contentPath:N});break;case"reply":F=await f.create({question:t.slugs.question,answer:t.slugs.answer},{body:m,authorId:u&&u.id,contentPath:N});break;default:break}await zi(1e3),f.callback&&await f.callback(F),Mt=setTimeout(()=>{p(""),v("submitted");const L=new Event("discussionFormSubmitted");document.dispatchEvent(L),Z()},500)}catch(F){const L=F;let K=`${ye}error`;L!=null&&L.message.includes("entry already exists")&&(K=ke(d.formatMessage,`${ye}error_alreadyExists`,t.type,"action")),L!=null&&L.message.includes("429")?K=ke(d.formatMessage,`${ye}error_tooMany`,t.type,"action"):L!=null&&L.message.includes("400")&&(K=`${ye}error`),y(K),Z()}},Z=()=>{Mt=setTimeout(()=>{y(!1),v(!1)},5e3)},A=!m||!Ki(m),z=x==="submitting",R=[];return(n.isEditing&&!z||c.cancel)&&R.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:f.handleCancel,className:"gtm-trackable","data-gtm-event-context":l,"data-gtm-event-type":`cancel-${t.type}-click`,disabled:!c.cancel&&(!u||!u.id||!m),children:d.formatMessage({id:`${ye}cancel`})}),R.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:w=>{if(n.isEditing){v("submitting"),f.handleSaveEdit&&f.handleSaveEdit(_.current&&"value"in _.current?_.current.value:"");return}k(w)},className:"gtm-trackable","data-gtm-event-context":l,"data-gtm-event-type":`${n.isEditing?"save":"submit"}-${t.type}-click`,"data-testid":"save-button",disabled:!u||!u.id||!e||A||z||n.isEditing&&m===n.isEditing.text,children:d.formatMessage({id:`${ye}${z?n.isEditing?"saving":"posting":n.isEditing?"save":"post"}`})}),a.jsxs("form",{id:T,className:$("discussion-card discussion-form",{"no-styling":n.isInWrapper&&n.isEditing}),"data-testid":`discussion-${t.type}-form`,children:[(n==null?void 0:n.showTitle)&&!n.isEditing&&["question"].includes(t.type)&&a.jsx("h2",{children:ke(d.formatMessage,`${ye}title`,t.type,"action")}),a.jsx(Gt,{member:u||"community",gtmContext:l,gtmType:"profile-click"}),a.jsx(ge,{element:"label",showOnFocus:!1,htmlFor:`${T}-input`,children:ke(d.formatMessage,`${ye}label`,t.type,"action")}),a.jsx(Mi,{ref:r,id:`${T}-input`,name:t.type,placeholder:i||ke(d.formatMessage,`${ye}placeholder`,t.type,"action"),onChange:S,value:x==="submitting"&&!b?"":m,maxLength:s,"aria-invalid":!!b,"aria-errormessage":"error-message",minRows:o,autoFocus:!!n.isEditing}),a.jsx("small",{children:ke(d.formatMessage,`${ye}explainer`,t.type,"action",{a:w=>a.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:w})})}),a.jsx(vt,{buttons:R}),x==="submitted"&&n.showSuccessMessage&&a.jsx(ht,{className:"success","data-testid":"success",children:ke(d.formatMessage,`${ye}success`,t.type,"action")}),b&&a.jsx(ht,{id:"error-message",className:"error","data-testid":"error",children:c.error?c.error:typeof b=="string"?b.includes(" ")?b:d.formatMessage({id:b},{action:d.formatMessage({id:`discussion_action_${t.type}`}),maxLength:s}):b})]})},Xn=({form:t,membershipRequiredToPost:{isMember:e,required:n,join:r,leave:i,notMemberStateText:s}})=>{if(n&&!e)return a.jsx(Be,{text:s,button:{breakpoints:{mobile:!0,901:!1},component:a.jsx(Kn,{isShort:!0,functions:{join:r,leave:i}})}});const{content:o,functions:c,meta:f,...l}=t;return a.jsx(Jt,{content:{type:(o==null?void 0:o.type)||"reply",slugs:(o==null?void 0:o.slugs)||{}},functions:{...c,create:(c==null?void 0:c.create)||(()=>{})},meta:{...f,isEditing:(f==null?void 0:f.isEditing)||!1,showSuccessMessage:!1},...l})},kc={showForm:!1},Xt=g.createContext(kc),Ka=({children:t})=>{const[e,n]=g.useState({showForm:!1});return a.jsx(Xt.Provider,{value:{...e,updateConversation:n},children:t})},jc=({question:t,answer:e,reply:n})=>({...t&&{questionSlug:t},...e&&{answerSlug:e},...n&&{replySlug:n}}),Tc=(t,e=10)=>!t||t.length===0?[]:t.slice(0,e);let ft=!1;const Cn=()=>{ft!==!1&&(clearTimeout(ft),ft=!1)},Nn=5,Ga=({element:t="div",likes:e=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:i=!1,content:s={type:"reply",slugs:{}},canLike:o=!0,functions:{createLike:c=()=>{},deleteLike:f=()=>{}}={}})=>{const l=U.useIntl();g.useEffect(()=>{p(i)},[i]);const[d,u]=g.useState(e),[m,p]=g.useState(i),[b,y]=g.useState(!1),[x,v]=g.useState(!1),_=g.useMemo(()=>Tc(n,Nn),[n]),S=k=>{if(k.preventDefault(),k.stopPropagation(),v(!1),ft)return Cn(),!1;if(Cn(),b||!o)return!1;ft=setTimeout(T,350)},T=async()=>{if(Cn(),b||!o)return!1;let k=m?d-1:d+1;k<0&&(k=0),y(!0),u(k),p(!m);try{if(s&&s.slugs){const Z=jc(s.slugs);m?await f(Z):await c(Z,{contentPath:window.location.pathname})}}catch{u(e),p(i)}finally{y(!1)}};return g.createElement(t,{className:$("likes-wrapper text-medium action-button",{"show-spinner":b,"is-liked":m,disabled:!o}),onClick:S,onMouseEnter:()=>{v(!0)},onMouseLeave:()=>{v(!1)},onFocus:()=>{v(!0)},onBlur:()=>{v(!1)},children:a.jsxs(a.Fragment,{children:[a.jsx(re,{variant:"tertiary",size:"medium",icon:{icon:m?"heart":"heart_empty",animate:"bounce"},className:$({"do-animation":m&&!i}),screenreaderText:o?l.formatMessage({id:`discussion_likes_${m?"unlike":"like"}`},{action:l.formatMessage({id:`discussion_action_${s.type}`})}):!1,onClick:S,disabled:!o,"aria-hidden":!o,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${s.type}-click`}),a.jsx("span",{className:$("number-of-likes",{"no-likes":d===0}),"data-testid":"number-of-likes",children:l.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:d})}),n&&a.jsx(ua,{isOpen:x,isLoading:n.length===0,children:n.length&&a.jsxs("ul",{children:[_.map(k=>typeof k=="string"||!k.name?null:a.jsx("li",{children:a.jsx(et,{href:k.id?`/profiles/${k.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onClick:Z=>Z==null?void 0:Z.stopPropagation(),children:k.name})},k.id||window.btoa(k.name))),e>Nn&&a.jsx("li",{children:l.formatMessage({id:"discussion_likes_more"},{number:e-Nn})})]})})]})})},qr=t=>{const e={};return Object.keys(t).forEach(n=>n.includes("Id")?e[n]=t[n]:e[`${n}Slug`]=t[n]),e},en=(t,e)=>t&&!e;const Ce="discussion_",Ec=280,_t=({element:t="div",content:e,userHasPermissions:n=!0,isLoading:r=!1,originalAuthorId:i,forceHide:s={comments:!1},functions:{content:{createContent:o,deleteContent:c,updateContent:f}={createContent:()=>{},deleteContent:()=>{},updateContent:()=>{}},likes:{createLike:l,deleteLike:d}={createLike:()=>{},deleteLike:()=>{}},comments:{openComments:u}={openComments:()=>{}}},links:m={},className:p,gtmContext:b="DiscussionAnswer",children:y,isTruncated:x=!1})=>{const v=U.useIntl(),_=g.useContext(Te),S=g.useContext(Xt),{author:T,canLike:k,createdAt:Z,id:A,likes:z=0,userLiked:R,comments:D=0}=e,C=_&&_.id&&typeof T!="string"&&T.id&&T.id===_.id||!1,E=typeof k=="boolean"?k:n?!C:!1,w=C&&(!e.createdAt||Ui(e.createdAt,10,"seconds")),N=g.useRef(null),[B,F]=g.useState({body:e&&e.body||"",isEditing:!1,didEdit:e&&e.isEdited||!1}),[L,K]=g.useState(!1),[ee,j]=g.useState(w?"highlighted":"default"),[M,H]=g.useState("");g.useEffect(()=>{const O=N.current;if(!(!O||ee==="default"))return document.addEventListener("discussionFormSubmitted",W),O.addEventListener("transitionend",V),()=>{document.removeEventListener("discussionFormSubmitted",W),O.removeEventListener("transitionend",V)}},[]),g.useEffect(()=>{F({...B,body:e&&e.body||"",didEdit:e&&e.isEdited||!1})},[e.isEdited]);const W=()=>{setTimeout(()=>{j("fading")},1e3)},V=({propertyName:O})=>{O==="background-color"&&j(ie=>(ie==="default"&&(document.removeEventListener("discussionFormSubmitted",W),N.current&&N.current.removeEventListener("transitionend",V)),ie==="fading"?"default":ie))};if(r||!e||e.type==="answer"&&(!e.slugs||!e.slugs.question))return a.jsx(xe,{className:"discussion-card discussion-post"});const X=x?Ve(B.body,Ec):B.body,G=async O=>{O||(O=""),H("");try{if(!Pi(O,B.body)){const ie=e.type==="question"?{title:O}:{body:O};await f(qr(e.slugs),ie)}F({body:O,isEditing:!1,didEdit:!0})}catch{H(`${Ce}form_error`)}},Y=()=>{S&&S.updateConversation&&S.updateConversation({showForm:!0}),setTimeout(()=>{var Ee,we,Fe;const ie=`reply-form-${(e.type==="answer"?e.slug:((Ee=e.slugs)==null?void 0:Ee.reply)||((we=e.slugs)==null?void 0:we.answer)||((Fe=e.slugs)==null?void 0:Fe.question)||"").toLowerCase().slice(-15)}`,I=document.getElementById(ie),he=document.getElementById(`${ie}-input`);he&&he.focus(),I&&I.scrollIntoView({behavior:"smooth"})},0)},J=()=>{K(!1);try{c(qr(e.slugs))}catch{H("delete-error")}},ne=[{text:v.formatMessage({id:`${Ce}moreMenu_report`}),onClick:O=>{O.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(v.formatMessage({id:`${Ce}report_subject`}))}&body=${encodeURI(v.formatMessage({id:`${Ce}report_body`},{contentType:e.type||"",contentSlug:e.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${e.slugs.question||""}`}))}`,icon:"flag"}];return n&&C&&ne.push({text:v.formatMessage({id:`${Ce}moreMenu_edit`}),onClick:()=>F({...B,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":b,"data-gtm-event-type":`edit-${e.type}-click`},{text:v.formatMessage({id:`${Ce}moreMenu_delete`}),onClick:O=>{O.preventDefault(),O.stopPropagation(),K(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":b,"data-gtm-event-type":`delete-${e.type}-click`,...Fa(`delete-${e.slug}-modal`,L)}),g.createElement(t,{className:$("discussion-post",p,{[ee]:!p||!p.includes("highlighted-text-box")}),ref:N,"data-testid":`discussion-${e.type}-thread`,children:a.jsxs(a.Fragment,{children:[a.jsxs("div",{id:A||e.slug,className:$("discussion-card",e.type,{editing:B.isEditing,"has-link":m.post&&!B.isEditing}),onClick:O=>{!m.post||B.isEditing||(O.preventDefault(),O.stopPropagation(),window.location.href=m.post)},children:[!B.isEditing&&a.jsx(Gt,{member:T,additionalContent:{createdAt:Z,didEdit:B.didEdit},className:typeof T!="string"&&T.id===i?"highlighted":"",gtmContext:b,gtmType:"profile-click"}),B.isEditing?a.jsx(Jt,{content:{type:e.type,slugs:e.slugs},userHasPermissions:n,meta:{isLoading:r,isInWrapper:!0,isEditing:{text:B.body}},maxLength:e.type==="question"?250:5e4,forceShow:{error:M!==""&&M!=="delete-error"?v.formatMessage({id:M},{action:v.formatMessage({id:`discussion_action_${e.type}`})}):!1},functions:{create:o,handleSaveEdit:G,handleCancel:()=>{H(""),F({...B,isEditing:!1})}},gtmContext:`${b}Form`}):m.post?a.jsx("a",{href:m.post,className:"gtm-trackable","data-gtm-event-context":b,"data-gtm-event-type":"title-click",children:a.jsx(mt,{options:{overrides:{a:ba}},children:X})}):a.jsx(mt,{options:{wrapper:e.type==="question"?"h1":g.Fragment,forceWrapper:e.type==="question",forceInline:e.type==="question",forceBlock:e.type!=="question"},children:X}),!B.isEditing&&a.jsxs("ul",{className:$("actions text-medium",e.type),"data-testid":`${e.type}-actions`,children:[a.jsx(Ga,{element:"li",likes:z,isShort:!1,userLiked:R,content:{type:e.type,slugs:e.slugs},canLike:E,peopleWhoLiked:e.peopleWhoLiked,functions:{createLike:l,deleteLike:d}}),!s.comments&&(["question","post"].includes(e.type)||m.comments||typeof u=="function")&&a.jsxs("li",{className:"action-button",onClick:O=>{O.preventDefault(),O.stopPropagation(),m.comments&&(window.location.href=m.comments),typeof u=="function"&&u()},children:[a.jsx(re,{variant:"tertiary",size:"medium",styling:{muted:!0},icon:{icon:"speech-bubble_square_thick"},href:m.comments?m.comments:!1,onClick:m.comments||typeof u!="function"?!1:u,className:"gtm-trackable","data-gtm-event-context":b,"data-gtm-event-type":`answer-${e.type}-click`,screenreaderText:v.formatMessage({id:`${Ce}comments_screenReader`},{count:D})}),a.jsx("span",{children:v.formatMessage({id:`${Ce}comments`},{count:D})})]}),(e.type==="answer"||e.type==="reply")&&a.jsx("li",{children:a.jsx(re,{variant:"tertiary",size:"medium",styling:{muted:!0},onClick:Y,children:v.formatMessage({id:`${Ce}reply`})})}),a.jsx(Za,{element:"li",id:`more-${e.slug}`,options:ne})]})]}),y,a.jsx(bt,{id:`delete-${e.slug}-modal`,isOpen:L,functions:{onOpen:()=>{},onClose:()=>K(!1)},forceShow:{error:M==="delete-error"?v.formatMessage({id:"discussion_delete_error"},{action:v.formatMessage({id:`discussion_action_${e.type}`})}):!1},title:v.formatMessage({id:"discussion_delete_title"},{action:v.formatMessage({id:`discussion_action_${e.type}`})}),buttons:[{variant:"secondary",onClick:()=>K(!1),children:v.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:J,children:v.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${e.type.charAt(0).toUpperCase()}${e.type.slice(1)}:${e.slug}`,children:a.jsx(U.FormattedMessage,{id:"discussion_delete_text",values:{p:O=>a.jsx("p",{children:O}),action:v.formatMessage({id:`discussion_action_${e.type}`})}})})]})})};const $n="discussion_responses_",Qa=({type:t="answer",responses:e=0})=>{const n=U.useIntl();return e=parseInt(e),a.jsxs("div",{className:"responses-heading",children:[a.jsx("h4",{children:n.formatMessage({id:`${$n}title`},{action:n.formatMessage({id:`${$n}${t}`}),count:e})}),e===0&&a.jsx("p",{children:ke(n.formatMessage,`${$n}empty`,t,t)})]})};const Ja=({loadMore:{isLoading:t,hasNextPage:e,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:i})=>{const s=U.useIntl(),o=g.useContext(Xt),c=Ft(i,{element:"li"});return a.jsxs("div",{className:"thread-wrapper",children:[!Object.is(c,null)&&a.jsx("ul",{className:"thread",children:c}),!t&&a.jsx(yt,{hasNextPage:e,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:s.formatMessage({id:"discussion_thread_loadMore"}),error:s.formatMessage({id:"loadMore_error"})}}),r&&o.showForm&&a.jsx(Jt,{...r})]})},Sc="post",Cc="reply",Xa="00000000-0000-0000-0000-000000000000";function er({queryClient:t,queryKey:e}){function n(r,i,s){t.setQueryData(e,s)}return n}function tr({queryClient:t,queryKey:e}){async function n(r){await t.cancelQueries({queryKey:e});const i=t.getQueryData(e);return t.setQueryData(e,r),i}return n}function Nc(){return{latest_reactions:{like:[],reply:[]},reaction_counts:{like:0,reply:0},own_reactions:{like:[],reply:[]}}}function $c(){return{latest_children:{like:[],reply:[]},children_counts:{like:0,reply:0},own_children:{like:[],reply:[]}}}function ei(t){const{id:e="",name:n="",organization:r="",jobTitle:i="",image:s={}}=t,{thumbnail:o=""}=s;return{id:e,data:{name:n,organization:r,jobTitle:i,thumbnail:o}}}function Mc({content:t}){return{content:t,id:Xa,time:new Date().toISOString(),verb:Sc}}function Ur({activity:t,user:e}){return{...t,actor:ei(e),...Nc()}}function Wt({activity:t,reaction:e}){var n,r,i;e?(t.latest_reactions={...t.latest_reactions||{},like:[...((r=t.latest_reactions)==null?void 0:r.like)||[],e]},t.own_reactions={...t.own_reactions||{},like:[...((i=t.own_reactions)==null?void 0:i.like)||[],e]}):t.reaction_counts={...t.reaction_counts||{},like:(n=t.reaction_counts)!=null&&n.like?t.reaction_counts.like+1:1}}function ti({activity:t,user:e}){var n,r,i;t.reaction_counts={...t.reaction_counts||{},like:(n=t.reaction_counts)!=null&&n.like?t.reaction_counts.like-1:0},e!=null&&e.id&&(t.latest_reactions={...t.latest_reactions||{},like:(((r=t.latest_reactions)==null?void 0:r.like)||[]).filter(({user_id:s})=>s!==e.id)},t.own_reactions={...t.own_reactions||{},like:(((i=t.own_reactions)==null?void 0:i.like)||[]).filter(({user_id:s})=>s!==e.id)})}function Pc({activityId:t,replyId:e,content:n}){return{activity_id:t,data:{content:n},id:Xa,kind:Cc,parent:e||""}}function zr({reply:t,user:e}){const n=ei(e);return{...t,user_id:n.id,user:n,...$c()}}function Zr({reply:t,reaction:e}){var n,r,i;e?(t.latest_children={...t.latest_children||{},like:[...((r=t.latest_children)==null?void 0:r.like)||[],e]},t.own_children={...t.own_children||{},like:[...((i=t.own_children)==null?void 0:i.like)||[],e]}):t.children_counts={...t.children_counts||{},like:(n=t.children_counts)!=null&&n.like?t.children_counts.like+1:1}}function Rc({reply:t,user:e}){var n,r,i;t.children_counts={...t.children_counts||{},like:(n=t.children_counts)!=null&&n.like?t.children_counts.like-1:0},e!=null&&e.id&&(t.latest_children={...t.latest_children||{},like:(((r=t.latest_children)==null?void 0:r.like)||[]).filter(({user_id:s})=>s!==e.id)},t.own_children={...t.own_children||{},like:(((i=t.own_children)==null?void 0:i.like)||[]).filter(({user_id:s})=>s!==e.id)})}const ni=t=>{const e=new CustomEvent("discussionPostAdded",{detail:t});document.dispatchEvent(e)};let Wr,Mn=0;const ri=()=>{g.useEffect(()=>(document.addEventListener("discussionPostAdded",t),()=>{document.removeEventListener("discussionPostAdded",t)}),[]);const t=e=>{const n=e.detail;if(!n)return;clearTimeout(Wr);const r=document.getElementById(n);if(r){r.scrollIntoView({behavior:"smooth",block:"start"}),Mn=0;return}Mn++,!(Mn>10)&&(Wr=setTimeout(()=>{t(e)},50))}},Ge=Object.freeze({id:"some-user-id-1",name:"some user name 1",organization:"some user organization 1",jobTitle:"some user job title 1",image:{thumbnail:"https://some-user-thumbnail.com/avatar1.png"},isLoading:!1}),Pe=Object.freeze({id:"some-user-id-2",name:"some user name 2",organization:"some user organization 2",jobTitle:"some user job title 2",image:{thumbnail:"https://some-user-thumbnail.com/avatar2.png"},isLoading:!1}),ai=Object.freeze({actor:`SU:${Ge.id}`,content:"some content 1",duration:"5.53ms",feed_id:"some-feed-id-1",foreign_id:"post:some-foriegn-id-1",id:"some-activity-id-1",object:"comment",time:"2023-11-24T17:52:36.162000",verb:"post"}),Fc=Object.freeze({actor:`SU:${Pe.id}`,content:"some content 2",duration:"5.53ms",feed_id:"some-feed-id-2",foreign_id:"post:some-foriegn-id-2",id:"some-activity-id-2",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"}),Oc=Object.freeze({actor:`SU:${Ge.id}`,content:"some content 3",duration:"5.53ms",feed_id:"some-feed-id-3",foreign_id:"post:some-foriegn-id-3",id:"some-activity-id-3",object:"comment",time:"2023-11-24T17:56:36.162000",verb:"post"}),Dc=Object.freeze({actor:`SU:${Pe.id}`,content:"some content 4",duration:"5.53ms",feed_id:"some-feed-id-4",foreign_id:"post:some-foriegn-id-4",id:"some-activity-id-4",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"});Object.freeze({id:"some-reaction-id-1",activity_id:ai.id,kind:"like",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:Pe.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:Pe.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-1",user_id:Pe.id,user:{id:Pe.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:ai.id,data:{content:"Some content 1..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-2",user_id:Ge.id,user:{id:Ge.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Fc.id,data:{content:"Some content 2..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:Pe.id,user:{id:Pe.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Oc.id,data:{content:"Some content 3..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:Ge.id,user:{id:Ge.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Dc.id,data:{content:"Some content 4..."},parent:"",latest_children:{},children_counts:{}});function Ac({mutationFn:t,mutationHandlers:{mutate:e,error:n},queryClient:r,queryKey:i,user:s}){const{mutate:o}=me.useMutation({mutationFn:t,onMutate:c=>e(f=>{const l=Ur({activity:Mc(c),user:s});return Hr(l,f)}),onError:n,onSuccess:(c,f,l)=>{const d=Ur({activity:c,user:s});r.setQueryData(i,Hr(d,l,!0)),setTimeout(()=>{ni(d.id)},0)}});return o}function Ic({mutationFn:t,mutationHandlers:{mutate:e,error:n}}){const{mutate:r}=me.useMutation({mutationFn:t,onMutate:({activityId:i,content:s})=>e(o=>{const c=Ht(i,o);return c&&(c.content=s),o}),onError:n});return r}function Lc({queryFns:{create:t,edit:e,like:n,list:r,remove:i,unlike:s},queryKey:o}){const c=me.useQueryClient(),f=Kt(),l={queryClient:c,queryKey:o},d={mutationHandlers:{error:er(l),mutate:tr(l)},user:f,...l},u=Ac({...d,mutationFn:t}),m=Ic({...d,mutationFn:e}),p=Bc({...d,mutationFn:n}),b=Uc({...d,mutationFn:i}),y=zc({...d,mutationFn:s}),{activities:x,...v}=qc({queryKey:o,queryFn:r});return{activities:x,mutations:{create:u,edit:m,remove:b,like:p,unlike:y},user:f,...v}}function Bc({mutationFn:t,mutationHandlers:{mutate:e,error:n},queryClient:r,queryKey:i}){const{mutate:s}=me.useMutation({mutationFn:t,onMutate:({activityId:o})=>e(c=>{const f=Ht(o,c);return f&&Wt({activity:f}),c}),onError:n,onSuccess:(o,{activityId:c},f)=>{const l=Ht(c,f);l&&Wt({activity:l,reaction:o}),r.setQueryData(i,f)}});return s}function qc({queryFn:t,queryKey:e}){const{data:n,error:r,isLoading:i,hasNextPage:s,fetchNextPage:o}=me.useInfiniteQuery({queryKey:e,queryFn:t,initialPageParam:{next:null},getNextPageParam:c=>(c==null?void 0:c.next)||null});return{activities:Wc(n),error:r,isLoading:i,hasNextPage:s,fetchNextPage:o}}function Uc({mutationFn:t,mutationHandlers:{mutate:e,error:n}}){const{mutate:r}=me.useMutation({mutationFn:t,onMutate:({activityId:i})=>e(s=>Zc(i,s)),onError:n});return r}function zc({mutationFn:t,mutationHandlers:{mutate:e,error:n},user:r}){const{mutate:i}=me.useMutation({mutationFn:t,onMutate:({activityId:s})=>e(o=>{const c=Ht(s,o);return c&&ti({activity:c,user:r}),o}),onError:n});return i}function Hr(t,e,n=!1){return e?(n?e.pages[0].results[0]=t:e.pages[0].results=[t,...e.pages[0].results],e):{pages:[{next:"",results:[t]}],pageParams:[""]}}function Ht(t,e){if(e)for(const{results:n}of e.pages){const r=n.find(({id:i})=>i===t);if(r)return r}}function Zc(t,e){for(const{results:n}of e.pages){const r=n.findIndex(({id:i})=>i===t);if(r!==-1){n.splice(r,1);break}}return e}function Wc(t){var e;return((e=t==null?void 0:t.pages)==null?void 0:e.reduce((n,{results:r})=>[...n,...r],[]))||[]}const Hc=({basePath:t,parentId:e,isMember:n,functions:{activities:r,join:i,leave:s}})=>{const o=U.useIntl(),{activities:c,error:f,fetchNextPage:l,hasNextPage:d,isLoading:u,mutations:{create:m,edit:p,remove:b,like:y,unlike:x},user:v}=Lc({queryKey:[t,e,"activities"],queryFns:r});if(ri(),f)return a.jsx(Be,{variant:"error",text:f.message});const _=(c==null?void 0:c.length)||0;return a.jsxs("section",{children:[a.jsx(Xn,{form:{content:{type:"post",slugs:{}},functions:{create:m},meta:{isEditing:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:i,leave:s,notMemberStateText:o.formatMessage({id:"community_joinToPost"})}}),c==null?void 0:c.map((S,T)=>{var B,F,L,K,ee,j,M,H;const{id:k,own_reactions:Z,latest_reactions:A,reaction_counts:z}=S,R=(((B=A==null?void 0:A.like)==null?void 0:B.length)||0)>0,D=(((F=Z==null?void 0:Z.like)==null?void 0:F.length)||0)>0,C=D?Z==null?void 0:Z.like[0].id:"",E=R?(L=A==null?void 0:A.like)==null?void 0:L.map(W=>{var V,X,G;return{id:(V=W==null?void 0:W.user)==null?void 0:V.id,name:(G=(X=W==null?void 0:W.user)==null?void 0:X.data)==null?void 0:G.name}}):!1,w=S==null?void 0:S.actor,N=(w==null?void 0:w.id)===(v==null?void 0:v.id);return a.jsxs(g.Fragment,{children:[a.jsx(_t,{content:{type:"post",body:S==null?void 0:S.content,canLike:en(n,N),createdAt:(S==null?void 0:S.time)||"",slugs:{question:`${t}/${e}`,answer:k},slug:k,author:{id:w==null?void 0:w.id,name:(K=w==null?void 0:w.data)==null?void 0:K.name,organization:(ee=w==null?void 0:w.data)==null?void 0:ee.organization,jobTitle:(j=w==null?void 0:w.data)==null?void 0:j.jobTitle,location:(M=w==null?void 0:w.data)==null?void 0:M.location,image:{thumbnail:((H=w==null?void 0:w.data)==null?void 0:H.thumbnail)||void 0}},userLiked:D,likes:(z==null?void 0:z.like)||0,comments:(z==null?void 0:z.reply)||0,peopleWhoLiked:E},links:{post:`${t}/${e}/${k}`,comments:`${t}/${e}/${k}`},functions:{content:{createContent:()=>null,deleteContent:()=>b({activityId:k}),updateContent:(W,{body:V})=>p({activityId:k,content:V})},likes:{createLike:()=>y({activityId:k}),deleteLike:()=>x({activityId:k,reactionId:C})},comments:{openComments:()=>null}},isTruncated:!0}),_>T+1&&a.jsx(je,{})]},k)}),!u&&a.jsx(yt,{hasNextPage:d,loadNextPage:()=>l(),icon:{icon:"arrow-down",position:"right"},messages:{button:o.formatMessage({id:"loadMore_button"}),error:o.formatMessage({id:"loadMore_error"})}})]})},Vc={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 16 (edited)..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 14..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 3..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 2..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 1..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 13..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 12..."},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"};function Yc({mutationFn:t,mutationHandlers:{mutate:e,error:n},queryClient:r,queryKey:i,user:s}){const{mutate:o}=me.useMutation({mutationFn:t,onMutate:c=>e(f=>{const l=zr({reply:Pc(c),user:s});return Vr(l,f,{replace:!1,append:(c==null?void 0:c.replyId)!==void 0})}),onError:n,onSuccess:(c,f,l)=>{const d=zr({reply:c,user:s});r.setQueryData(i,Vr(d,l,{replace:!0,append:(f==null?void 0:f.replyId)!==void 0})),setTimeout(()=>{ni(d.id)},0)}});return o}function Kc({mutationFn:t,mutationHandlers:{mutate:e,error:n}}){const{mutate:r}=me.useMutation({mutationFn:t,onMutate:({replyId:i,content:s})=>e(o=>{const c=Vt(i,o);return c&&(c.data.content=s),o}),onError:n});return r}function ii({queryFns:{create:t,edit:e,like:n,list:r,remove:i,unlike:s},queryKey:o}){const c=me.useQueryClient(),f=Kt(),l={queryClient:c,queryKey:o},d={mutationHandlers:{error:er(l),mutate:tr(l)},user:f,...l},u=Yc({...d,mutationFn:t}),m=Kc({...d,mutationFn:e}),p=Gc({...d,mutationFn:n}),b=Jc({...d,mutationFn:i}),y=Xc({...d,mutationFn:s}),{replies:x,...v}=Qc({queryKey:o,queryFn:r});return{replies:x,mutations:{create:u,edit:m,remove:b,like:p,unlike:y},user:f,...v}}function Gc({mutationFn:t,mutationHandlers:{mutate:e,error:n},queryClient:r,queryKey:i}){const{mutate:s}=me.useMutation({mutationFn:t,onMutate:({replyId:o})=>e(c=>{const f=Vt(o,c);return f&&Zr({reply:f}),c}),onError:n,onSuccess:(o,{replyId:c},f)=>{const l=Vt(c,f);l&&Zr({reply:l,reaction:o}),r.setQueryData(i,f)}});return s}function Qc({queryFn:t,queryKey:e}){const{data:n,error:r,isLoading:i,hasNextPage:s,fetchNextPage:o}=me.useInfiniteQuery({queryKey:e,queryFn:t,initialPageParam:{next:""},getNextPageParam:l=>(l==null?void 0:l.next)||null}),c=al(n),f=`${c.length||0}${s?"+":""}`;return{replies:c,repliesCount:f,error:r,isLoading:i,hasNextPage:s,fetchNextPage:o}}function Jc({mutationFn:t,mutationHandlers:{mutate:e,error:n}}){const{mutate:r}=me.useMutation({mutationFn:t,onMutate:({replyId:i})=>e(s=>rl(i,s)),onError:n});return r}function Xc({mutationFn:t,mutationHandlers:{mutate:e,error:n},user:r}){const{mutate:i}=me.useMutation({mutationFn:t,onMutate:({replyId:s})=>e(o=>{const c=Vt(s,o);return c&&Rc({reply:c,user:r}),o}),onError:n});return i}function el(t){return{pages:[{next:"",results:[t]}],pageParams:[""]}}function tl(t,e,n){const r=e.pages.length-1,i=e.pages[r].results.length-1;return n!=null&&n.replace?e.pages[r].results[i]=t:e.pages[r].results.push(t),e}function nl(t,e,n){return n!=null&&n.replace?e.pages[0].results[0]=t:e.pages[0].results=[t,...e.pages[0].results],e}function Vr(t,e,n){return e?n!=null&&n.append?tl(t,e,n):nl(t,e,n):el(t)}function Vt(t,e){if(e)for(const{results:n}of e.pages){const r=n.find(({id:i})=>i===t);if(r)return r}}function rl(t,e){for(const{results:n}of e.pages){const r=n.findIndex(({id:i})=>i===t);if(r!==-1){n.splice(r,1);break}}return e}function al(t){var e;return((e=t==null?void 0:t.pages)==null?void 0:e.reduce((n,r)=>[...n,...r==null?void 0:r.results],[]))||[]}const il=({basePath:t,parentId:e,activityId:n,replyId:r,isMember:i,functions:s})=>{const{replies:o,fetchNextPage:c,hasNextPage:f,isLoading:l,mutations:{create:d,edit:u,like:m,remove:p,unlike:b},user:y}=ii({queryKey:[t,e,n,r,"replies"],queryFns:{...s,list:x=>s.list({...x,reactionId:r})}});return a.jsx(Ja,{loadMore:{isLoading:l,hasNextPage:f,loadNextPage:()=>c()},form:{content:{type:"reply",slugs:{question:`${t}/${e}`,answer:n,reply:r}},functions:{create:(x,{body:v})=>d({activityId:n,replyId:r,content:v})},meta:{isEditing:!1,showSuccessMessage:!1}},children:o&&o.length>0?o==null?void 0:o.map(x=>{var B,F,L,K,ee,j,M,H,W,V,X,G;const{id:v,own_children:_,latest_children:S,children_counts:T}=x,Z=(((B=_==null?void 0:_.like)==null?void 0:B.length)||0)>0?(F=_==null?void 0:_.like)==null?void 0:F.find(Y=>{var J;return((J=Y==null?void 0:Y.user)==null?void 0:J.id)===(y==null?void 0:y.id)}):!1,A=Z?Z==null?void 0:Z.id:"",z=!!Z,D=(((L=S==null?void 0:S.like)==null?void 0:L.length)||0)>0?(K=S==null?void 0:S.like)==null?void 0:K.map(Y=>{var J,ne,O;return{id:(J=Y==null?void 0:Y.user)==null?void 0:J.id,name:(O=(ne=Y==null?void 0:Y.user)==null?void 0:ne.data)==null?void 0:O.name}}):!1,C=x==null?void 0:x.user,E=(C==null?void 0:C.id)===(y==null?void 0:y.id),w=en(i,E),N=typeof x.data.content=="string"?(ee=x==null?void 0:x.data)==null?void 0:ee.content:((M=(j=x==null?void 0:x.data)==null?void 0:j.content)==null?void 0:M.text)||"";return a.jsx(_t,{content:{id:v,type:"reply",body:N,canLike:w,createdAt:x==null?void 0:x.created_at,slugs:{question:`${t}/${e}`,answer:n,reply:x==null?void 0:x.parent},slug:"",author:{id:C==null?void 0:C.id,name:(H=C.data)==null?void 0:H.name,organization:(W=C.data)==null?void 0:W.organization,jobTitle:(V=C.data)==null?void 0:V.jobTitle,location:(X=C.data)==null?void 0:X.location,image:{thumbnail:((G=C.data)==null?void 0:G.thumbnail)||void 0}},userLiked:z,likes:(T==null?void 0:T.like)||0,peopleWhoLiked:D},functions:{content:{createContent:()=>null,deleteContent:()=>p({replyId:v}),updateContent:(Y,{body:J})=>u({replyId:v,content:J})},likes:{createLike:()=>m({replyId:v}),deleteLike:()=>b({replyId:v,reactionId:A})},comments:{}}},v)}):null})},si=({basePath:t,parentId:e,activityId:n,isMember:r,functions:{reactions:i,join:s,leave:o}})=>{const c=U.useIntl(),{replies:f,repliesCount:l,fetchNextPage:d,hasNextPage:u,isLoading:m,mutations:{create:p,edit:b,like:y,remove:x,unlike:v},user:_}=ii({queryKey:[t,e,n,"replies"],queryFns:i});return na(),ri(),a.jsxs("section",{children:[a.jsx(Qa,{type:"comment",responses:l}),a.jsx(Xn,{form:{content:{type:"reply",slugs:{}},functions:{create:(S,{body:T})=>p({activityId:n,content:T})},meta:{isEditing:!1,showSuccessMessage:!1},placeholder:c.formatMessage({id:"discussion_responses_placeholder"})},membershipRequiredToPost:{isMember:r,required:!0,join:s,leave:o,notMemberStateText:c.formatMessage({id:"community_joinToPost"})}}),f==null?void 0:f.map(S=>{var K,ee,j,M,H,W,V,X,G,Y,J,ne;const{id:T,own_children:k,latest_children:Z,children_counts:A}=S,R=(((K=k==null?void 0:k.like)==null?void 0:K.length)||0)>0?(ee=k==null?void 0:k.like)==null?void 0:ee.find(O=>{var ie;return((ie=O==null?void 0:O.user)==null?void 0:ie.id)===(_==null?void 0:_.id)}):!1,D=R?R==null?void 0:R.id:"",C=!!R,w=(((j=Z==null?void 0:Z.like)==null?void 0:j.length)||0)>0?(M=Z==null?void 0:Z.like)==null?void 0:M.map(O=>{var ie,I,he;return{id:(ie=O==null?void 0:O.user)==null?void 0:ie.id,name:(he=(I=O==null?void 0:O.user)==null?void 0:I.data)==null?void 0:he.name}}):!1,N=S==null?void 0:S.user,B=(N==null?void 0:N.id)===(_==null?void 0:_.id),F=en(r,B),L=typeof S.data.content=="string"?(H=S==null?void 0:S.data)==null?void 0:H.content:((V=(W=S==null?void 0:S.data)==null?void 0:W.content)==null?void 0:V.text)||"";return a.jsx(Ka,{children:a.jsx(_t,{content:{id:T,type:"reply",body:L,canLike:F,createdAt:S==null?void 0:S.created_at,slugs:{question:`${t}/${e}`,answer:n,reply:T},slug:T,author:{id:N==null?void 0:N.id,name:(X=N.data)==null?void 0:X.name,organization:(G=N.data)==null?void 0:G.organization,jobTitle:(Y=N.data)==null?void 0:Y.jobTitle,location:(J=N.data)==null?void 0:J.location,image:{thumbnail:((ne=N.data)==null?void 0:ne.thumbnail)||void 0}},userLiked:C,likes:(A==null?void 0:A.like)||0,peopleWhoLiked:w},functions:{content:{createContent:()=>null,deleteContent:()=>x({replyId:T}),updateContent:(O,{body:ie})=>b({replyId:T,content:ie})},likes:{createLike:()=>y({replyId:T}),deleteLike:()=>v({replyId:T,reactionId:D})},comments:{}},children:a.jsx(il,{basePath:t,parentId:e,activityId:n,replyId:T,isMember:r,functions:{...i}})},T)},T)}),!m&&a.jsx(yt,{hasNextPage:u,loadNextPage:()=>d(),icon:{icon:"arrow-down",position:"right"},messages:{button:c.formatMessage({id:"loadMore_button"}),error:c.formatMessage({id:"loadMore_error"})}})]})};function sl({mutationFn:t,mutationHandlers:{mutate:e,error:n}}){const{mutate:r}=me.useMutation({mutationFn:t,onMutate:({content:i})=>e(s=>(s&&(s.content=i),s)),onError:n});return r}function ol({queryFn:t,queryKey:e}){const{data:n,error:r,isLoading:i,isFetching:s}=me.useQuery({queryFn:t,queryKey:e});return{activity:n,error:r,isLoading:i,isFetching:s}}function cl({queryFns:{read:t,edit:e,like:n,unlike:r},queryKey:i}){const s=me.useQueryClient(),o=Kt(),c={queryClient:s,queryKey:i},f={mutationHandlers:{error:er(c),mutate:tr(c)},user:o,...c},l=sl({...f,mutationFn:e}),d=ll({...f,mutationFn:n}),u=ul({...f,mutationFn:r}),{activity:m,...p}=ol({queryKey:i,queryFn:t});return{activity:m,mutations:{edit:l,like:d,unlike:u},user:o,...p}}function ll({mutationFn:t,mutationHandlers:{mutate:e,error:n},queryClient:r,queryKey:i}){const{mutate:s}=me.useMutation({mutationFn:t,onMutate:o=>e(c=>(c&&Wt({activity:c}),c)),onError:n,onSuccess:(o,c,f)=>{f&&Wt({activity:f,reaction:o}),r.setQueryData(i,f)}});return s}function ul({mutationFn:t,mutationHandlers:{mutate:e,error:n},user:r}){const{mutate:i}=me.useMutation({mutationFn:t,onMutate:s=>e(o=>(o&&ti({activity:o,user:r}),o)),onError:n});return i}const dl=({basePath:t,parentId:e,activityId:n,isMember:r,functions:{activities:{remove:i,...s},reactions:o,join:c,leave:f}})=>{var R,D,C,E,w,N,B,F,L,K;const l=U.useIntl(),d=g.useContext(Te),{activity:u,error:m,isLoading:p,mutations:{edit:b,like:y,unlike:x}}=cl({queryFns:s,queryKey:[t,e,n]});if(p)return a.jsx(xe,{style:{height:"400px"}});if(m||!u)return a.jsx(Be,{variant:"error",text:l.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:v,latest_reactions:_}=u,S=(((R=_==null?void 0:_.like)==null?void 0:R.length)||0)>0,T=(((D=v==null?void 0:v.like)==null?void 0:D.length)||0)>0,k=T?v==null?void 0:v.like[0].id:"",Z=S?(C=_==null?void 0:_.like)==null?void 0:C.map(ee=>{var j,M,H;return{id:(j=ee==null?void 0:ee.user)==null?void 0:j.id,name:(H=(M=ee==null?void 0:ee.user)==null?void 0:M.data)==null?void 0:H.name}}):!1,A=u==null?void 0:u.actor,z=(A==null?void 0:A.id)===(d==null?void 0:d.id);return a.jsxs("section",{className:"activity-section",children:[a.jsx(_t,{className:"highlighted-text-box subtle",content:{id:n,type:"post",body:u==null?void 0:u.content,canLike:en(r,z),createdAt:(u==null?void 0:u.time)||"",slugs:{question:`${t}/${e}`,answer:u==null?void 0:u.id},slug:n,author:{id:A.id,name:(E=A.data)==null?void 0:E.name,organization:(w=A.data)==null?void 0:w.organization,jobTitle:(N=A.data)==null?void 0:N.jobTitle,location:(B=A.data)==null?void 0:B.location,image:{thumbnail:((F=A.data)==null?void 0:F.thumbnail)||void 0}},userLiked:T,likes:((L=u==null?void 0:u.reaction_counts)==null?void 0:L.like)||0,comments:((K=u==null?void 0:u.reaction_counts)==null?void 0:K.reply)||0,peopleWhoLiked:Z},originalAuthorId:A==null?void 0:A.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:i,updateContent:(ee,{body:j})=>b({content:j})},likes:{createLike:()=>y({activityId:n}),deleteLike:()=>x({activityId:n,reactionId:k})},comments:{openComments:()=>{}}}},n),a.jsx(si,{basePath:t,parentId:e,activityId:n,isMember:r,functions:{reactions:o,join:c,leave:f}})]})},fl=({id:t,data:{jobTitle:e,name:n,organization:r,thumbnail:i}})=>({id:t,name:n,jobTitle:e,organization:r,image:{thumbnail:i}}),Yr=[{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 Pt="notFoundError_",ml=()=>{const t=U.useIntl(),e=[];return Yr.forEach((n,r)=>{n.title=t.formatMessage({id:`${Pt}post_${r+1}`}),e.push("solutionArticle")}),a.jsxs(Ya,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:a.jsxs(Le,{children:[a.jsx(za,{cards:Yr,cardTypes:e,buildCardData:n=>new Promise((r,i)=>{r(n)})}),a.jsx(re,{href:"/solution-articles/",children:t.formatMessage({id:`${Pt}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[a.jsx("h1",{children:t.formatMessage({id:`${Pt}title`})}),a.jsx("p",{children:t.formatMessage({id:`${Pt}text`})})]})};exports.ASSETS_BUCKET=Ae;exports.ActivitiesFeed=Hc;exports.ActivitySection=dl;exports.AddPost=Xn;exports.Banner=ts;exports.BannerSection=cs;exports.Breadcrumbs=ic;exports.Button=re;exports.ButtonWrapper=vt;exports.CacheProvider=fa;exports.Card=Yn;exports.CardBlock=za;exports.Carousel=rc;exports.CollapsibleSection=qn;exports.Columns=Ha;exports.CommunityDetails=ac;exports.ContactFooter=gc;exports.ContactForm=Ba;exports.Contributors=Zn;exports.ConversationContext=Xt;exports.CookieBanner=Va;exports.Directory=Ko;exports.DiscussionConversation=Ka;exports.DiscussionForm=Jt;exports.DiscussionLikes=Ga;exports.DiscussionPost=_t;exports.DiscussionThread=Ja;exports.Divider=je;exports.DownloadSection=ns;exports.EMAILS=We;exports.EditSection=as;exports.EmailHelperTextBox=Oa;exports.EmptyStateBox=Be;exports.Filters=sc;exports.FlagsProvider=ma;exports.Footer=Qn;exports.Form=Qt;exports.FullWidthSection=Le;exports.GlobalProviders=ps;exports.Header=Jn;exports.HelperTextBox=va;exports.HiddenFromScreenReaders=Yt;exports.HideShowTextBox=hs;exports.HighlightSection=us;exports.HighlightedTextBox=$e;exports.ImageContainer=Xi;exports.IntlProvider=pa;exports.InviteForm=qa;exports.InviteModal=Yo;exports.JoinButton=Kn;exports.LanguageSwitcher=cc;exports.Link=et;exports.LoadMore=yt;exports.LoadingBlock=Ss;exports.LoadingPlaceholder=xe;exports.LoadingState=Un;exports.Logo=Gn;exports.LogoSection=is;exports.MarkdownText=mt;exports.MarketingBlock=ds;exports.Member=Gt;exports.MembersList=wc;exports.Modal=Vn;exports.MoreMenu=Za;exports.NUMBER_OF_USERS=Bi;exports.NavigationMenu=Wa;exports.NotFoundError=ml;exports.Overlay=bt;exports.PageHeading=ya;exports.PageLayout=Ya;exports.PasswordRules=Io;exports.Pill=pt;exports.ProfileImageChange=qo;exports.ProfilePicture=Re;exports.ProgressBar=_a;exports.Rating=Lo;exports.RepliesFeed=si;exports.ResponsesHeading=Qa;exports.ResponsiveImage=Xe;exports.ReturnToNavButton=es;exports.SearchForm=Ua;exports.ShareLinks=mc;exports.SignupForm=Vo;exports.Span=ba;exports.StatusBanner=ht;exports.Tabs=pc;exports.Tags=xc;exports.TestimonialBlock=js;exports.Toggle=Bo;exports.Tooltip=ua;exports.TopLevelPage=vc;exports.UserContext=Te;exports.UserProvider=ha;exports.VisuallyHidden=ge;exports.addAriaProps=Fa;exports.generateCssIcon=sa;exports.getMember=zn;exports.headerData=gt;exports.mapGetStreamData=fl;exports.pageReady=la;exports.passwordValidator=Gi;exports.repliesFeedMock=Vc;exports.useCurrentPath=Xr;exports.useEffectAfterMount=Ye;exports.useElementWidth=Je;exports.useScrollListener=ta;exports.useScrollToHash=na;exports.useUser=Kt;
|
|
64
|
+
${ct(e,"mailto",n)}&src=email`)}`},{key:"clipboard-copy",icon:"share_copy-link",url:ct(e,"copy",n),shouldRender:()=>navigator&&navigator.clipboard&&navigator.clipboard.writeText,onClick:(r,i)=>(r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(i))}];const fc="shareLinks_",mc=({title:t,link:e,referrer:n,gtmContext:r="ShareLinks",size:i="large",variant:s="default",className:o=""})=>{const c=q.useIntl(),f=dc({title:t,link:e,referrer:n});return a.jsxs("aside",{className:C("share-links",i,s,o),children:[a.jsx("p",{className:"text-small",children:c.formatMessage({id:"shareLinks_label"})}),a.jsx("ul",{children:f.map(({key:l,icon:d,url:u,shouldRender:m=!0,onClick:p})=>{if(typeof m=="function"&&!m())return null;const b={};return p&&(b.onClick=y=>p(y,u)),a.jsx("li",{children:a.jsx(re,{size:i,variant:"tertiary",icon:{icon:d||l},href:u,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":`${r}-SocialButtons`,"data-gtm-event-type":`${l}-click`,"data-testid":"link",screenreaderText:c.formatMessage({id:`${fc}link_${l}`}),...b})},l)})})]})};const pc=({tabs:t,className:e=""})=>{var f;const n=(l,d,u)=>(l||(l=`panel-${window.btoa(d)}-${u}`),l);let r=t.findIndex(l=>l.current===!0);if(r<0&&(r=0),window.location.hash){const l=window.location.hash.replace("#","");if(t.find(u=>u.id===l)){for(let u=0;u<t.length;u++)if(n(t[u].id,t[u].text,u)===l){r=u;break}}}const[i,s]=g.useState((f=t[r])!=null&&f.id?t[r].id:n(t[r].id,t[r].text,r));g.useEffect(()=>{if(t[r].hasCarousel){const l=new CustomEvent("hiddenSectionVisible",{detail:{id:i}});window.dispatchEvent(l)}},[i]);const o=[],c=[];return t.forEach(({id:l,text:d,content:u,href:m,hasCarousel:p},b)=>{l=n(l,d,b);const y=i===l,x={};m||(x["aria-controls"]=l,x.onClick=v=>{v.preventDefault(),v.stopPropagation(),s(l),window.location.hash=`#${l}`},c.push(a.jsx("section",{id:l,hidden:!y,role:"tabpanel","aria-labelledby":`tab-${l}`,"aria-live":y?"assertive":"off",children:typeof u=="string"?a.jsx("p",{children:u}):u},`section-${l}`))),o.push(a.jsx("li",{children:a.jsx("a",{href:m||`#${l}`,id:`tab-${l}`,className:C({selected:y}),role:"tab","aria-selected":y,...x,children:d})},`tab-${l}`))}),a.jsxs("div",{className:C("tabs-wrapper",e),children:[a.jsx("ul",{className:"tabs",role:"tablist",children:o}),a.jsx("div",{className:"tab-content",children:c})]})};const hc={"2-1":901,"1-3":769,"1-1":769},Ha=({layout:t="2-1",hideOnMobile:e=!1,className:n="",children:r})=>{const i=Je(!0);let s=r;return g.Children.count(r)===1&&(s=g.Children.toArray(r)[0],s.props&&(s=s.props.children)),a.jsx("section",{className:C("columns",`layout-${t}`,n),children:g.Children.map(s,(o,c)=>e!==!1&&c===e&&i&&i<hc[t]?null:o)})};let wn;const kn="contactFooter_",gc=({onSuccess:t=async()=>{},onFailure:e=()=>{}})=>{const n=g.useRef(null),[r,i]=g.useState(0),[s,o]=g.useState(!1),c=()=>{n.current&&i(n.current.clientHeight)},f=()=>{s||(o(!0),clearTimeout(wn),wn=setTimeout(()=>{c(),o(!1)},500))};return g.useEffect(()=>(c(),window.addEventListener("resize",f),()=>{clearTimeout(wn),window.removeEventListener("resize",f)}),[]),a.jsx(Le,{id:"contactForm",className:"contact-footer",children:a.jsxs("div",{className:"inner-wrapper",children:[a.jsx("h2",{children:a.jsx(q.FormattedMessage,{id:`${kn}title`})}),a.jsxs("div",{className:"content-wrapper",ref:n,"data-testid":"content-wrapper",style:s?{}:{minHeight:r},children:[a.jsxs("aside",{children:[a.jsx("p",{children:a.jsx(q.FormattedMessage,{id:`${kn}text`})}),a.jsx(tt,{className:"mailto-link",href:"mailto:hello@apolitical.co",children:a.jsx(q.FormattedMessage,{id:`${kn}email`})})]}),a.jsx(Ba,{functions:{onSuccess:t,onFailure:e},gtm:{context:"FooterContactUsForm",event:"contact-form-submit-click"}})]})]})})},vc=({activeLink:t,...e})=>a.jsx(Le,{children:a.jsx(Ha,{layout:"1-3",children:a.jsxs(a.Fragment,{children:[a.jsx(Wa,{activeLink:t}),a.jsx(ya,{...e})]})})});const jn="cookieBanner_",Tn=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],En=new Date(Date.now()+12*30*24*60*60*1e3),Va=()=>{const t=q.useIntl(),[e,n,r]=Ln.useCookies(Tn),[i,s]=g.useState(!e["apol-cookie-banner"]),o=()=>{Tn.forEach(d=>{n(d,!0,{path:"/",expires:En,domain:d==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),s(!1),window.location.reload()},c=()=>{n("apol-cookie-banner",!0,{path:"/",expires:En}),Tn.forEach(d=>{if(d==="apol-cookie-banner"){n(d,!0,{path:"/",expires:En});return}r(d)}),s(!1)};if(!i)return null;const f=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:c,gtmType:"reject-all"},{id:"accept",onClick:o,gtmType:"accepted-all"}],l=[];return f.forEach(d=>{l.push({variant:d.href?"tertiary":"primary",href:d.href,onClick:d.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${d.gtmType}-click`,children:t.formatMessage({id:`${jn}buttons_${d.id}`})})}),a.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[a.jsx("h6",{children:t.formatMessage({id:`${jn}title`})}),a.jsx("p",{children:t.formatMessage({id:`${jn}text`})}),a.jsx(Xe,{buttons:l})]})},Me={platform:{order:["events","courses","articles"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-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:We["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:We["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:We.support,gtmType:"concierge-email-click"},business:{email:We.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 He="footer_",zt="SiteFooter",Lr=({group:t})=>{const e=Me[t].order||[];let n=!1;return"text"in Me[t]&&(n=Me[t].text),a.jsxs(g.Fragment,{children:[a.jsx("p",{className:"pre-title",children:a.jsx(q.FormattedMessage,{id:`${He}${t}`})}),Array.isArray(e)&&e.length>0&&a.jsx("ul",{className:"text-medium",children:e.map(r=>{if(["order","child","text"].includes(r))return null;const{href:i,gtmType:s}=Me[t][r],o={};return["legal"].includes(t)&&(o.target="_blank",o.rel="noopener"),a.jsx("li",{children:a.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":zt,"data-gtm-event-type":s,...o,children:a.jsx(q.FormattedMessage,{id:`${He}${t}_${r}`})})},`${t}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&a.jsx("dl",{className:"text-medium",children:n.order.map(r=>a.jsxs(g.Fragment,{children:[a.jsx("dt",{children:a.jsx(q.FormattedMessage,{id:`${He}${t}_${r}`})}),a.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&a.jsx("address",{children:a.jsx(q.FormattedMessage,{id:`${He}${t}_${r}_address`,values:{br:a.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&a.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":zt,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${t}-${r}`))})]},t)},Qn=()=>a.jsx("div",{id:"footer",children:a.jsxs("div",{className:"wrapper",children:[a.jsx(Yt,{element:"hr"}),a.jsx(Gn,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":zt,"data-gtm-event-type":"logo-homepage-link"}),a.jsx("footer",{children:["platform","community","company","contact"].map(t=>a.jsxs("div",{className:"group",children:[a.jsx(Lr,{group:t}),Object.keys(Me[t]).includes("child")&&a.jsx(Lr,{group:Me[t].child})]},t))}),a.jsx("hr",{}),a.jsxs("div",{className:"sub-footer",children:[a.jsx("ul",{children:Array.isArray(Me.social.order)&&Me.social.order.map(t=>{const e=Me.social[t];return a.jsx("li",{className:t,children:a.jsx("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":zt,"data-gtm-event-type":"social-click",children:a.jsx("span",{className:"hidden",children:a.jsx(q.FormattedMessage,{id:`${He}social_${t}`})})})},t)})}),a.jsx("small",{children:a.jsx(q.FormattedMessage,{id:`${He}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})}),ue={timeouts:{},handlerCalled:{},getIsDesktopVersion:(t,e)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=s=>{const o=`logged${t?"In":"Out"}`;return e>=n[s][o]};let i={};return["navigation","search"].forEach(s=>{i[s]=r(s)}),i},shouldChangeHeaderIsVisible:(t,e,n)=>{Object.values(e).filter(i=>i===!0).length||n([{type:"headerIsVisible",value:t}])},handleMenus:({id:t,value:e,menus:n,dispatch:r})=>{if(n[t]===e||t==="account"&&e===!1&&n.navigation===!0)return;const i=Date.now();if(!e&&ue.handlerCalled[t]&&i-ue.handlerCalled[t]<500)return;ue.handlerCalled[t]=i;let s=[{type:`menus.${t}`,value:e}];e===!0&&Object.keys(n).forEach(o=>{o===t||n[o]===!1||s.push({type:`menus.${o}`,value:!1})}),r(s)},findFirstChild:(t,e,n=!1)=>{if(!t||!t[0])return!1;for(let r=0;r<=t.length;r++){if(!t[r])continue;if(t[r][e]&&(!n||t[r][e].includes(n)))return t[r];if(!e.includes("."))continue;const i=Kr(t[r],e);if(!(typeof i>"u")&&(!n||i[e]&&i[e].includes(n)||i.value&&i.value.includes(n)||i.toString().includes(n)))return t[r]}return t[0].children?ue.findFirstChild(t[0].children,e,n):!1},autoFocus:({menu:t,navigationRef:e,isDesktopVersion:n,focusElements:r,dispatch:i})=>{if(!e.current||!e.current.children)return;const s=n?"desktop":"default";if(r[t][s]){r[t][s].focus();return}let o,c;switch(t){case"navigation":if(n){const f=ue.findFirstChild(e.current.children,"attributes.aria-controls","navigation");o=ue.findFirstChild(f.children,"href")}else o=ue.findFirstChild(e.current.children,"href");o||(o=e.current);break;case"account":if(c=ue.findFirstChild(e.current.children,"className","account"),!c||!c.children)return;o=ue.findFirstChild(c.children,"href");break;default:return}o&&(i([{type:`focusElements.${t}.${s}`,value:o}]),o.focus())},events:{onClick:(t,{id:e,callback:n,isOpen:r})=>{t.target&&t.target.attributes&&t.target.attributes.href||(t.preventDefault(),t.stopPropagation(),clearTimeout(ue.timeouts[e]),n(e,!r))},onFocus:({id:t})=>{clearTimeout(ue.timeouts[t])},onMouseEnter:({id:t,callback:e})=>{clearTimeout(ue.timeouts[t]),e(t,!0)},onBlur:({id:t,callback:e})=>{ue.timeouts[t]=setTimeout(()=>{e(t,!1)},250)}}},vt={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"navigation",explore:{order:["events","courses","articles"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"}},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"}}}},Zt=({id:t,isLoggedIn:e=!1,isDesktopVersion:n=!1,menus:r={},callback:i=()=>{},doTrack:s=null})=>{const o=q.useIntl(),c=Kr(vt,t);if(!c||c.onlyShow&&(c.onlyShow==="logged-in"&&!e||c.onlyShow==="logged-out"&&e))return null;const f="doTrack"in c,l=s===null?f?c.doTrack:!0:s,d=t.includes("buttons.");let u=`header_${t.replaceAll(".","_")}`;c.hasVariantText&&(u+=`_logged${e?"In":"Out"}`);let m=!1;if(c.href){let _=c.gtmType||`${t}-click`;if(_.includes(".")){const S=_.split("."),T=S[S.length-2];_=`${T==="topics"?`${T}-`:""}${S[S.length-1]}`}m={href:c.href,role:"menuitem"},l&&(m={...m,className:"gtm-trackable","data-gtm-event-type":_,"data-gtm-event-context":"HeaderButtons"}),d&&(m={...m,variant:"secondary",size:{mobile:"small",881:"large"},...c.props||{}})}const p=c.order&&c.order[0]&&c[c.order[0]],b=p&&c[c.order[0]].order,y=m&&window.location.pathname===c.href;let x={},v={};if(p){const _=c.menuId||t,S={onClick:T=>ue.events.onClick(T,{id:_,callback:i,isOpen:r[_]}),onFocus:()=>ue.events.onFocus({id:_}),onBlur:()=>ue.events.onBlur({id:_,callback:i}),onMouseLeave:()=>ue.events.onBlur({id:_,callback:i}),onMouseEnter:()=>ue.events.onMouseEnter({id:_,callback:i})};n&&(b&&(x={...S,onKeyPress:T=>{T.key==="Enter"&&ue.events.onClick(T,{id:_,callback:i,isOpen:r[_]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":r[_],"aria-controls":_}),v={hidden:_ in r?!r[_]:!0}),b||(v={...v,...S})}return a.jsxs("li",{className:C({[c.className]:c.className,"has-submenu":p,parent:b,active:y}),role:"none",...x,children:[m?g.createElement(d?re:"a",m,o.formatMessage({id:u})):o.formatMessage({id:u}),c.order&&a.jsx("ul",{...v,children:c.order.map(_=>{if(!c[_])return null;const S={isLoggedIn:e,isDesktopVersion:n,menus:r,callback:i,doTrack:f?l:null};return c[_].order?a.jsxs("li",{className:C({[c[_].className]:c[_].className}),children:[o.formatMessage({id:`${u}_${_}`}),a.jsx("ul",{children:c[_].order.map(T=>a.jsx(Zt,{id:`${t}.${_}.${T}`,...S},T))})]},_):a.jsx(Zt,{id:`${t}.${_}`,...S},_)})})]},t)};const bc={height:67,height_desktop:83},Jn=({showNavigation:t=!0})=>{const e=q.useIntl(),n=g.useContext(Te),r=Je(!0,!0),i=n&&typeof n.id=="string",s=g.useMemo(()=>ue.getIsDesktopVersion(i,r),[i,r]),[o,c]=g.useReducer(ra,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:f,menus:l,focusElements:d}=o;ta({scrollPosition:bc[`height${s.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{!s&&l.navigation||ue.shouldChangeHeaderIsVisible(!0,l,c)},scrollDown:()=>{!s&&l.navigation||ue.shouldChangeHeaderIsVisible(!1,l,c)}}});const u=(p,b)=>{ue.handleMenus({id:p,value:b,menus:l,dispatch:c})},m=g.useRef(null);return Ye(()=>{l.navigation&&ue.autoFocus({menu:"navigation",navigationRef:m,isDesktopVersion:s.navigation,focusElements:d,dispatch:c})},[l.navigation]),Ye(()=>{l.account&&ue.autoFocus({menu:"account",navigationRef:m,isDesktopVersion:s.navigation,focusElements:d,dispatch:c})},[l.account]),n&&n.isLoading?null:a.jsxs(a.Fragment,{children:[a.jsxs("nav",{id:"header",className:C({"logged-in":i,"logged-out":!i,visible:f}),children:[a.jsx(ge,{element:"a",href:"#content-of-page",children:e.formatMessage({id:"header_skip"})}),a.jsx(Gn,{}),t&&a.jsxs(a.Fragment,{children:[!s.navigation&&a.jsx("button",{className:"menu-button gtm-trackable",onClick:p=>{p.preventDefault(),p.stopPropagation(),u("navigation",!l.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":l.navigation,"aria-controls":"navigation",children:a.jsx(ge,{children:e.formatMessage({id:`header_menu_${l.navigation?"hide":"show"}`})})}),a.jsx("ul",{ref:m,id:"navigation",hidden:s.navigation||l.account?!1:!l.navigation,role:"menu","data-showing":!s.navigation&&l.account?"account":"default",children:vt.order.map(p=>a.jsx(Zt,{id:p,isLoggedIn:i,isDesktopVersion:s.navigation,menus:{navigation:l.navigation,account:l.account},callback:u},p))}),!s.search&&a.jsx("button",{className:"search toggle-search-button",onClick:p=>{p.preventDefault(),p.stopPropagation(),u("search",!l.search)},"aria-haspopup":"true","aria-expanded":l.search,"aria-controls":"search-form",children:a.jsx(ge,{children:e.formatMessage({id:`header_search_${l.search?"hide":"show"}`})})}),a.jsx(Ua,{id:"global-search",handleToggle:{searchIsOpen:l.search,isDesktopVersion:s.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),i?a.jsxs("button",{className:"account-button",onClick:p=>ue.events.onClick(p,{id:"account",callback:u,isOpen:l.account}),onMouseEnter:()=>ue.events.onMouseEnter({id:"account",callback:u}),onMouseLeave:()=>ue.events.onBlur({id:"account",callback:u}),"aria-haspopup":"true","aria-expanded":l.account,"aria-controls":"navigation",children:[a.jsx(ge,{children:e.formatMessage({id:`header_account_${l.account?"hide":"show"}`})}),a.jsx(Re,{name:n&&n.name||"",src:n&&n.image&&n.image.thumbnail||""})]}):a.jsx("ul",{className:"sign-in-buttons",children:vt.buttons.order.map(p=>a.jsx(Zt,{id:`buttons.${p}`},p))})]})]}),a.jsx("hr",{id:"content-of-page"}),a.jsx("div",{className:C("overlay",{open:l.navigation||l.account||!s.search&&l.search})})]})};const yc=()=>{const t=q.useIntl();return a.jsxs(a.Fragment,{children:[a.jsx(Jn,{}),a.jsx("div",{id:"content",children:a.jsx(Be,{variant:"error",text:t.formatMessage({id:"pageLayout_error"})})}),a.jsx(Qn,{})]})},Ya=({children:t,additionalContent:{prepended:e,appended:n}={},reportError:r,forceShow:i={},styling:s={},className:o="",locale:c="en"})=>{const{navigation:f=!0,footer:l=!0}=i,{background:d="default",variant:u="default",circle:m="default"}=s,p=Xr();g.useEffect(()=>{window.scrollTo(0,0)},[p]);const b=Ft(t,{locale:c}),y=Ft(e,{locale:c}),x=Ft(n,{locale:c}),v={};return d!=="default"&&(v[d]=!0),u!=="default"&&(v[u]=!0),m!=="default"&&(v[m]=!0),a.jsx($i.ErrorBoundary,{onError:r,fallback:a.jsx(yc,{}),children:a.jsx(g.Suspense,{fallback:null,children:a.jsxs("div",{id:"wrapper",className:C(o,v,{"has-footer":l}),children:[a.jsx(Jn,{showNavigation:f}),a.jsxs("section",{id:"content-wrapper",children:[y&&a.jsx("div",{className:"additional-content prepended",children:y}),g.createElement(d==="bold"?Vn:"div",{id:"content",children:b})]}),x&&a.jsx("div",{className:"additional-content appended",children:x}),l&&a.jsx(Qn,{}),a.jsx(Va,{})]})})})},Br={default:"tags_",headerTopics:"header_topics_topics_"},Sn={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"},_c={getTagDetails:t=>{if(t.includes("topic_")){if(t=Sn.topic[t.replace("topic_","")],t){const e=vt.topics.topics[t].href;return e?{id:t,href:e,text:`${Br.headerTopics}${t}`}:null}return null}return Sn[t]?(t=Sn[t],{id:t,text:`${Br.default}${t}`}):null}};const xc=({tags:t=[],color:e="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:i="",gtmType:s="tag-click",gtmContext:o="tags"})=>{const c=q.useIntl();if(!t||t.length<1)return null;const f=[];return t.forEach(l=>{if(!l)return;const d=_c.getTagDetails(l);d&&f.push(d)}),f.length<1?null:a.jsx("ul",{className:C("tags text-small",e,i,{"one-line":n}),children:f.map(l=>{const d=c.formatMessage({id:l.text});return a.jsx("li",{children:l.href&&r?a.jsx("a",{href:l.href,className:"gtm-trackable","data-gtm-event-type":s,"data-gtm-event-context":o,children:d}):d},l.id)})})};const wc=({members:{data:t=[],total:e=t.length},hasNextPage:n=!1,loadNextPage:r=()=>{},gtmContext:i="member",gtmType:s="member-click",className:o=""})=>{const c=q.useIntl();return t.length===0?null:a.jsxs("div",{className:C("members-list",o),children:[a.jsxs("h1",{children:[c.formatMessage({id:"membersList"}),a.jsx("span",{className:"count",children:e})]}),a.jsx("ul",{children:t.map((f,l)=>a.jsxs("li",{children:[a.jsx(Gt,{member:f,gtmContext:i,gtmType:s}),f.isAdmin&&a.jsx(ht,{children:c.formatMessage({id:"membersList_admin"})})]},l))}),n&&a.jsx(yt,{hasNextPage:n,loadNextPage:r,icon:{icon:"arrow-down",position:"right"},gtmContext:i})]})};let Nt=null;const ye="discussion_form_",Jt=({content:t={type:"response",slugs:{}},userHasPermissions:e=!0,meta:n={isLoading:!1,isInWrapper:!1,isEditing:!1,showTitle:!1,showSuccessMessage:!0},inputRef:r,placeholder:i,maxLength:s=5e4,minRows:o=4,forceShow:c={cancel:!1,error:!1},functions:f={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},props:{create:{projectNames:["questions-answers"]}}},gtmContext:l="DiscussionForm"})=>{var D,M,E;const d=q.useIntl(),u=g.useContext(Te),[m,p]=g.useState(n.isEditing&&n.isEditing.text||""),[b,y]=g.useState(c.error||!1),[x,v]=g.useState(!1),_=g.useRef(null);if(r||(r=_),n.isLoading)return a.jsx(xe,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const S=w=>{const $=w.target.value;p($);let L;!u||!u.id?L=ke(d.formatMessage,`${ye}error_loggedOut`,t.type,"action"):e?$.length>=s&&(L=`${ye}error_tooLong`):L=ke(d.formatMessage,`${ye}error_noPermission`,t.type,"action"),L?y(L):b&&y(!1)};let T=`${t.type}-form`;if(t.type==="response"||t.type==="reply"){const w=((D=t.slugs)==null?void 0:D.reply)||((M=t.slugs)==null?void 0:M.answer)||((E=t.slugs)==null?void 0:E.question)||"";w&&(T=`${T}-${w.slice(-15)}`)}const k=async w=>{var L;if(w.preventDefault(),w.stopPropagation(),!u||!u.id||!e||O)return;Nt&&clearTimeout(Nt),v("submitting");const $=window.location.pathname;try{let Z;switch(t.type){case"post":Z=await f.create({content:m});break;case"question":Z=await f.create({title:m,authorId:u&&u.id,...(L=f.props)==null?void 0:L.create});break;case"response":Z=await f.create({question:t.slugs.question},{body:m,authorId:u&&u.id,contentPath:$});break;case"reply":Z=await f.create({question:t.slugs.question,answer:t.slugs.answer},{body:m,authorId:u&&u.id,contentPath:$});break;default:break}await zi(1e3),f.callback&&await f.callback(Z),Nt=setTimeout(()=>{p(""),v("submitted");const I=new Event("discussionFormSubmitted");document.dispatchEvent(I),W()},500)}catch(Z){const I=Z;let V=`${ye}error`;I!=null&&I.message.includes("entry already exists")&&(V=ke(d.formatMessage,`${ye}error_alreadyExists`,t.type,"action")),I!=null&&I.message.includes("429")?V=ke(d.formatMessage,`${ye}error_tooMany`,t.type,"action"):I!=null&&I.message.includes("400")&&(V=`${ye}error`),y(V),W()}},W=()=>{Nt=setTimeout(()=>{y(!1),v(!1)},5e3)},O=!m||!Ki(m),z=x==="submitting",R=[];return(n.isEditing&&!z||c.cancel)&&R.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:f.handleCancel,className:"gtm-trackable","data-gtm-event-context":l,"data-gtm-event-type":`cancel-${t.type}-click`,disabled:!c.cancel&&(!u||!u.id||!m),children:d.formatMessage({id:`${ye}cancel`})}),R.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:w=>{if(n.isEditing){v("submitting"),f.handleSaveEdit&&f.handleSaveEdit(_.current&&"value"in _.current?_.current.value:"");return}k(w)},className:"gtm-trackable","data-gtm-event-context":l,"data-gtm-event-type":`${n.isEditing?"save":"submit"}-${t.type}-click`,"data-testid":"save-button",disabled:!u||!u.id||!e||O||z||n.isEditing&&m===n.isEditing.text,children:d.formatMessage({id:`${ye}${z?n.isEditing?"saving":"posting":n.isEditing?"save":"post"}`})}),a.jsxs("form",{id:T,className:C("discussion-card discussion-form",{"no-styling":n.isInWrapper&&n.isEditing}),"data-testid":`discussion-${t.type}-form`,children:[(n==null?void 0:n.showTitle)&&!n.isEditing&&["question"].includes(t.type)&&a.jsx("h2",{children:ke(d.formatMessage,`${ye}title`,t.type,"action")}),a.jsx(Gt,{member:u||"community",gtmContext:l,gtmType:"profile-click"}),a.jsx(ge,{element:"label",showOnFocus:!1,htmlFor:`${T}-input`,children:ke(d.formatMessage,`${ye}label`,t.type,"action")}),a.jsx(Ni,{ref:r,id:`${T}-input`,name:t.type,placeholder:i||ke(d.formatMessage,`${ye}placeholder`,t.type,"action"),onChange:S,value:x==="submitting"&&!b?"":m,maxLength:s,"aria-invalid":!!b,"aria-errormessage":"error-message",minRows:o,autoFocus:!!n.isEditing}),a.jsx("small",{children:ke(d.formatMessage,`${ye}explainer`,t.type,"action",{a:w=>a.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:w})})}),a.jsx(Xe,{buttons:R}),x==="submitted"&&n.showSuccessMessage&&a.jsx(gt,{className:"success","data-testid":"success",children:ke(d.formatMessage,`${ye}success`,t.type,"action")}),b&&a.jsx(gt,{id:"error-message",className:"error","data-testid":"error",children:c.error?c.error:typeof b=="string"?b.includes(" ")?b:d.formatMessage({id:b},{action:d.formatMessage({id:`discussion_action_${t.type}`}),maxLength:s}):b})]})},Xn=({form:t,membershipRequiredToPost:{isMember:e,required:n,join:r,leave:i,notMemberStateText:s}})=>{if(n&&!e)return a.jsx(Be,{text:s,button:{breakpoints:{mobile:!0,901:!1},component:a.jsx(Kn,{isShort:!0,functions:{join:r,leave:i}})}});const{content:o,functions:c,meta:f,...l}=t;return a.jsx(Jt,{content:{type:(o==null?void 0:o.type)||"reply",slugs:(o==null?void 0:o.slugs)||{}},functions:{...c,create:(c==null?void 0:c.create)||(()=>{})},meta:{...f,isEditing:(f==null?void 0:f.isEditing)||!1,showSuccessMessage:!1},...l})},kc={showForm:!1},Xt=g.createContext(kc),Ka=({children:t})=>{const[e,n]=g.useState({showForm:!1});return a.jsx(Xt.Provider,{value:{...e,updateConversation:n},children:t})},jc=({question:t,answer:e,reply:n})=>({...t&&{questionSlug:t},...e&&{answerSlug:e},...n&&{replySlug:n}}),Tc=(t,e=10)=>!t||t.length===0?[]:t.slice(0,e);let mt=!1;const Cn=()=>{mt!==!1&&(clearTimeout(mt),mt=!1)},Mn=5,Ga=({element:t="div",likes:e=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:i=!1,content:s={type:"reply",slugs:{}},canLike:o=!0,functions:{createLike:c=()=>{},deleteLike:f=()=>{}}={}})=>{const l=q.useIntl();g.useEffect(()=>{p(i)},[i]);const[d,u]=g.useState(e),[m,p]=g.useState(i),[b,y]=g.useState(!1),[x,v]=g.useState(!1),_=g.useMemo(()=>Tc(n,Mn),[n]),S=k=>{if(k.preventDefault(),k.stopPropagation(),v(!1),mt)return Cn(),!1;if(Cn(),b||!o)return!1;mt=setTimeout(T,350)},T=async()=>{if(Cn(),b||!o)return!1;let k=m?d-1:d+1;k<0&&(k=0),y(!0),u(k),p(!m);try{if(s&&s.slugs){const W=jc(s.slugs);m?await f(W):await c(W,{contentPath:window.location.pathname})}}catch{u(e),p(i)}finally{y(!1)}};return g.createElement(t,{className:C("likes-wrapper text-medium action-button",{"show-spinner":b,"is-liked":m,disabled:!o}),onClick:S,onMouseEnter:()=>{v(!0)},onMouseLeave:()=>{v(!1)},onFocus:()=>{v(!0)},onBlur:()=>{v(!1)},children:a.jsxs(a.Fragment,{children:[a.jsx(re,{variant:"tertiary",size:"medium",icon:{icon:m?"heart":"heart_empty",animate:"bounce"},className:C({"do-animation":m&&!i}),screenreaderText:o?l.formatMessage({id:`discussion_likes_${m?"unlike":"like"}`},{action:l.formatMessage({id:`discussion_action_${s.type}`})}):!1,onClick:S,disabled:!o,"aria-hidden":!o,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${s.type}-click`}),a.jsx("span",{className:C("number-of-likes",{"no-likes":d===0}),"data-testid":"number-of-likes",children:l.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:d})}),n&&a.jsx(ua,{isOpen:x,isLoading:n.length===0,children:n.length&&a.jsxs("ul",{children:[_.map(k=>typeof k=="string"||!k.name?null:a.jsx("li",{children:a.jsx(tt,{href:k.id?`/profiles/${k.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",onClick:W=>W==null?void 0:W.stopPropagation(),children:k.name})},k.id||window.btoa(k.name))),e>Mn&&a.jsx("li",{children:l.formatMessage({id:"discussion_likes_more"},{number:e-Mn})})]})})]})})},qr=t=>{const e={};return Object.keys(t).forEach(n=>n.includes("Id")?e[n]=t[n]:e[`${n}Slug`]=t[n]),e},en=(t,e)=>t&&!e;const Ce="discussion_",Ec=280,_t=({element:t="div",content:e,userHasPermissions:n=!0,isLoading:r=!1,originalAuthorId:i,forceHide:s={comments:!1},functions:{content:{createContent:o,deleteContent:c,updateContent:f}={createContent:()=>{},deleteContent:()=>{},updateContent:()=>{}},likes:{createLike:l,deleteLike:d}={createLike:()=>{},deleteLike:()=>{}},comments:{openComments:u}={openComments:()=>{}}},links:m={},className:p,gtmContext:b="DiscussionAnswer",children:y,isTruncated:x=!1})=>{const v=q.useIntl(),_=g.useContext(Te),S=g.useContext(Xt),{author:T,canLike:k,createdAt:W,id:O,likes:z=0,userLiked:R,comments:D=0}=e,M=_&&_.id&&typeof T!="string"&&T.id&&T.id===_.id||!1,E=typeof k=="boolean"?k:n?!M:!1,w=M&&(!e.createdAt||Ui(e.createdAt,10,"seconds")),$=g.useRef(null),[L,Z]=g.useState({body:e&&e.body||"",isEditing:!1,didEdit:e&&e.isEdited||!1}),[I,V]=g.useState(!1),[J,j]=g.useState(w?"highlighted":"default"),[N,H]=g.useState("");g.useEffect(()=>{const F=$.current;if(!(!F||J==="default"))return document.addEventListener("discussionFormSubmitted",U),F.addEventListener("transitionend",Y),()=>{document.removeEventListener("discussionFormSubmitted",U),F.removeEventListener("transitionend",Y)}},[]),g.useEffect(()=>{Z({...L,body:e&&e.body||"",didEdit:e&&e.isEdited||!1})},[e.isEdited]);const U=()=>{setTimeout(()=>{j("fading")},1e3)},Y=({propertyName:F})=>{F==="background-color"&&j(ie=>(ie==="default"&&(document.removeEventListener("discussionFormSubmitted",U),$.current&&$.current.removeEventListener("transitionend",Y)),ie==="fading"?"default":ie))};if(r||!e||e.type==="answer"&&(!e.slugs||!e.slugs.question))return a.jsx(xe,{className:"discussion-card discussion-post"});const ee=x?Ve(L.body,Ec):L.body,G=async F=>{F||(F=""),H("");try{if(!Pi(F,L.body)){const ie=e.type==="question"?{title:F}:{body:F};await f(qr(e.slugs),ie)}Z({body:F,isEditing:!1,didEdit:!0})}catch{H(`${Ce}form_error`)}},K=()=>{S&&S.updateConversation&&S.updateConversation({showForm:!0}),setTimeout(()=>{var Ee,we,Fe;const ie=`reply-form-${(e.type==="answer"?e.slug:((Ee=e.slugs)==null?void 0:Ee.reply)||((we=e.slugs)==null?void 0:we.answer)||((Fe=e.slugs)==null?void 0:Fe.question)||"").toLowerCase().slice(-15)}`,A=document.getElementById(ie),he=document.getElementById(`${ie}-input`);he&&he.focus(),A&&A.scrollIntoView({behavior:"smooth"})},0)},X=()=>{V(!1);try{c(qr(e.slugs))}catch{H("delete-error")}},ne=[{text:v.formatMessage({id:`${Ce}moreMenu_report`}),onClick:F=>{F.stopPropagation()},href:`mailto:community@apolitical.co?subject=${encodeURI(v.formatMessage({id:`${Ce}report_subject`}))}&body=${encodeURI(v.formatMessage({id:`${Ce}report_body`},{contentType:e.type||"",contentSlug:e.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${e.slugs.question||""}`}))}`,icon:"flag"}];return n&&M&&ne.push({text:v.formatMessage({id:`${Ce}moreMenu_edit`}),onClick:()=>Z({...L,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":b,"data-gtm-event-type":`edit-${e.type}-click`},{text:v.formatMessage({id:`${Ce}moreMenu_delete`}),onClick:F=>{F.preventDefault(),F.stopPropagation(),V(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":b,"data-gtm-event-type":`delete-${e.type}-click`,...Fa(`delete-${e.slug}-modal`,I)}),g.createElement(t,{className:C("discussion-post",p,{[J]:!p||!p.includes("highlighted-text-box")}),ref:$,"data-testid":`discussion-${e.type}-thread`,children:a.jsxs(a.Fragment,{children:[a.jsxs("div",{id:O||e.slug,className:C("discussion-card",e.type,{editing:L.isEditing,"has-link":m.post&&!L.isEditing}),onClick:F=>{!m.post||L.isEditing||(F.preventDefault(),F.stopPropagation(),window.location.href=m.post)},children:[!L.isEditing&&a.jsx(Gt,{member:T,additionalContent:{createdAt:W,didEdit:L.didEdit},className:typeof T!="string"&&T.id===i?"highlighted":"",gtmContext:b,gtmType:"profile-click"}),L.isEditing?a.jsx(Jt,{content:{type:e.type,slugs:e.slugs},userHasPermissions:n,meta:{isLoading:r,isInWrapper:!0,isEditing:{text:L.body}},maxLength:e.type==="question"?250:5e4,forceShow:{error:N!==""&&N!=="delete-error"?v.formatMessage({id:N},{action:v.formatMessage({id:`discussion_action_${e.type}`})}):!1},functions:{create:o,handleSaveEdit:G,handleCancel:()=>{H(""),Z({...L,isEditing:!1})}},gtmContext:`${b}Form`}):m.post?a.jsx("a",{href:m.post,className:"gtm-trackable","data-gtm-event-context":b,"data-gtm-event-type":"title-click",children:a.jsx(pt,{options:{overrides:{a:ba}},children:ee})}):a.jsx(pt,{options:{wrapper:e.type==="question"?"h1":g.Fragment,forceWrapper:e.type==="question",forceInline:e.type==="question",forceBlock:e.type!=="question"},children:ee}),!L.isEditing&&a.jsxs("ul",{className:C("actions text-medium",e.type),"data-testid":`${e.type}-actions`,children:[a.jsx(Ga,{element:"li",likes:z,isShort:!1,userLiked:R,content:{type:e.type,slugs:e.slugs},canLike:E,peopleWhoLiked:e.peopleWhoLiked,functions:{createLike:l,deleteLike:d}}),!s.comments&&(["question","post"].includes(e.type)||m.comments||typeof u=="function")&&a.jsxs("li",{className:"action-button",onClick:F=>{F.preventDefault(),F.stopPropagation(),m.comments&&(window.location.href=m.comments),typeof u=="function"&&u()},children:[a.jsx(re,{variant:"tertiary",size:"medium",styling:{muted:!0},icon:{icon:"speech-bubble_square_thick"},href:m.comments?m.comments:!1,onClick:m.comments||typeof u!="function"?!1:u,className:"gtm-trackable","data-gtm-event-context":b,"data-gtm-event-type":`answer-${e.type}-click`,screenreaderText:v.formatMessage({id:`${Ce}comments_screenReader`},{count:D})}),a.jsx("span",{children:v.formatMessage({id:`${Ce}comments`},{count:D})})]}),(e.type==="answer"||e.type==="reply")&&a.jsx("li",{children:a.jsx(re,{variant:"tertiary",size:"medium",styling:{muted:!0},onClick:K,children:v.formatMessage({id:`${Ce}reply`})})}),a.jsx(Za,{element:"li",id:`more-${e.slug}`,options:ne})]})]}),y,a.jsx(bt,{id:`delete-${e.slug}-modal`,isOpen:I,functions:{onOpen:()=>{},onClose:()=>V(!1)},forceShow:{error:N==="delete-error"?v.formatMessage({id:"discussion_delete_error"},{action:v.formatMessage({id:`discussion_action_${e.type}`})}):!1},title:v.formatMessage({id:"discussion_delete_title"},{action:v.formatMessage({id:`discussion_action_${e.type}`})}),buttons:[{variant:"secondary",onClick:()=>V(!1),children:v.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:X,children:v.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${e.type.charAt(0).toUpperCase()}${e.type.slice(1)}:${e.slug}`,children:a.jsx(q.FormattedMessage,{id:"discussion_delete_text",values:{p:F=>a.jsx("p",{children:F}),action:v.formatMessage({id:`discussion_action_${e.type}`})}})})]})})};const $n="discussion_responses_",Qa=({type:t="answer",responses:e=0})=>{const n=q.useIntl();return e=parseInt(e),a.jsxs("div",{className:"responses-heading",children:[a.jsx("h4",{children:n.formatMessage({id:`${$n}title`},{action:n.formatMessage({id:`${$n}${t}`}),count:e})}),e===0&&a.jsx("p",{children:ke(n.formatMessage,`${$n}empty`,t,t)})]})};const Ja=({loadMore:{isLoading:t,hasNextPage:e,loadNextPage:n}={isLoading:!1,hasNextPage:!1,loadNextPage:()=>{}},form:r,children:i})=>{const s=q.useIntl(),o=g.useContext(Xt),c=Ft(i,{element:"li"});return a.jsxs("div",{className:"thread-wrapper",children:[!Object.is(c,null)&&a.jsx("ul",{className:"thread",children:c}),!t&&a.jsx(yt,{hasNextPage:e,loadNextPage:n,size:"small",styling:{muted:!0},icon:{icon:"arrow_corner-down_right",position:"left"},messages:{button:s.formatMessage({id:"discussion_thread_loadMore"}),error:s.formatMessage({id:"loadMore_error"})}}),r&&o.showForm&&a.jsx(Jt,{...r})]})},Sc="post",Cc="reply",Xa="00000000-0000-0000-0000-000000000000";function er({queryClient:t,queryKey:e}){function n(r,i,s){t.setQueryData(e,s)}return n}function tr({queryClient:t,queryKey:e}){async function n(r){await t.cancelQueries({queryKey:e});const i=t.getQueryData(e);return t.setQueryData(e,r),i}return n}function Mc(){return{latest_reactions:{like:[],reply:[]},reaction_counts:{like:0,reply:0},own_reactions:{like:[],reply:[]}}}function $c(){return{latest_children:{like:[],reply:[]},children_counts:{like:0,reply:0},own_children:{like:[],reply:[]}}}function ei(t){const{id:e="",name:n="",organization:r="",jobTitle:i="",image:s={}}=t,{thumbnail:o=""}=s;return{id:e,data:{name:n,organization:r,jobTitle:i,thumbnail:o}}}function Nc({content:t}){return{content:t,id:Xa,time:new Date().toISOString(),verb:Sc}}function Ur({activity:t,user:e}){return{...t,actor:ei(e),...Mc()}}function Wt({activity:t,reaction:e}){var n,r,i;e?(t.latest_reactions={...t.latest_reactions||{},like:[...((r=t.latest_reactions)==null?void 0:r.like)||[],e]},t.own_reactions={...t.own_reactions||{},like:[...((i=t.own_reactions)==null?void 0:i.like)||[],e]}):t.reaction_counts={...t.reaction_counts||{},like:(n=t.reaction_counts)!=null&&n.like?t.reaction_counts.like+1:1}}function ti({activity:t,user:e}){var n,r,i;t.reaction_counts={...t.reaction_counts||{},like:(n=t.reaction_counts)!=null&&n.like?t.reaction_counts.like-1:0},e!=null&&e.id&&(t.latest_reactions={...t.latest_reactions||{},like:(((r=t.latest_reactions)==null?void 0:r.like)||[]).filter(({user_id:s})=>s!==e.id)},t.own_reactions={...t.own_reactions||{},like:(((i=t.own_reactions)==null?void 0:i.like)||[]).filter(({user_id:s})=>s!==e.id)})}function Pc({activityId:t,replyId:e,content:n}){return{activity_id:t,data:{content:n},id:Xa,kind:Cc,parent:e||""}}function zr({reply:t,user:e}){const n=ei(e);return{...t,user_id:n.id,user:n,...$c()}}function Zr({reply:t,reaction:e}){var n,r,i;e?(t.latest_children={...t.latest_children||{},like:[...((r=t.latest_children)==null?void 0:r.like)||[],e]},t.own_children={...t.own_children||{},like:[...((i=t.own_children)==null?void 0:i.like)||[],e]}):t.children_counts={...t.children_counts||{},like:(n=t.children_counts)!=null&&n.like?t.children_counts.like+1:1}}function Rc({reply:t,user:e}){var n,r,i;t.children_counts={...t.children_counts||{},like:(n=t.children_counts)!=null&&n.like?t.children_counts.like-1:0},e!=null&&e.id&&(t.latest_children={...t.latest_children||{},like:(((r=t.latest_children)==null?void 0:r.like)||[]).filter(({user_id:s})=>s!==e.id)},t.own_children={...t.own_children||{},like:(((i=t.own_children)==null?void 0:i.like)||[]).filter(({user_id:s})=>s!==e.id)})}const ni=t=>{const e=new CustomEvent("discussionPostAdded",{detail:t});document.dispatchEvent(e)};let Wr,Nn=0;const ri=()=>{g.useEffect(()=>(document.addEventListener("discussionPostAdded",t),()=>{document.removeEventListener("discussionPostAdded",t)}),[]);const t=e=>{const n=e.detail;if(!n)return;clearTimeout(Wr);const r=document.getElementById(n);if(r){r.scrollIntoView({behavior:"smooth",block:"start"}),Nn=0;return}Nn++,!(Nn>10)&&(Wr=setTimeout(()=>{t(e)},50))}},Ge=Object.freeze({id:"some-user-id-1",name:"some user name 1",organization:"some user organization 1",jobTitle:"some user job title 1",image:{thumbnail:"https://some-user-thumbnail.com/avatar1.png"},isLoading:!1}),Pe=Object.freeze({id:"some-user-id-2",name:"some user name 2",organization:"some user organization 2",jobTitle:"some user job title 2",image:{thumbnail:"https://some-user-thumbnail.com/avatar2.png"},isLoading:!1}),ai=Object.freeze({actor:`SU:${Ge.id}`,content:"some content 1",duration:"5.53ms",feed_id:"some-feed-id-1",foreign_id:"post:some-foriegn-id-1",id:"some-activity-id-1",object:"comment",time:"2023-11-24T17:52:36.162000",verb:"post"}),Fc=Object.freeze({actor:`SU:${Pe.id}`,content:"some content 2",duration:"5.53ms",feed_id:"some-feed-id-2",foreign_id:"post:some-foriegn-id-2",id:"some-activity-id-2",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"}),Oc=Object.freeze({actor:`SU:${Ge.id}`,content:"some content 3",duration:"5.53ms",feed_id:"some-feed-id-3",foreign_id:"post:some-foriegn-id-3",id:"some-activity-id-3",object:"comment",time:"2023-11-24T17:56:36.162000",verb:"post"}),Dc=Object.freeze({actor:`SU:${Pe.id}`,content:"some content 4",duration:"5.53ms",feed_id:"some-feed-id-4",foreign_id:"post:some-foriegn-id-4",id:"some-activity-id-4",object:"comment",time:"2023-11-24T17:54:36.162000",verb:"post"});Object.freeze({id:"some-reaction-id-1",activity_id:ai.id,kind:"like",created_at:"2023-11-24T17:58:36.162000",data:{},parent:"",updated_at:"2023-11-24T17:58:36.162000",user_id:Pe.id,children_counts:{},latest_children:{},latest_children_extra:{},own_children:{},user:{id:Pe.id,data:{},created_at:"2023-11-24T17:58:36.162000",updated_at:"2023-11-24T17:58:36.162000"}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-1",user_id:Pe.id,user:{id:Pe.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:ai.id,data:{content:"Some content 1..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-2",user_id:Ge.id,user:{id:Ge.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Fc.id,data:{content:"Some content 2..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:Pe.id,user:{id:Pe.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Oc.id,data:{content:"Some content 3..."},parent:"",latest_children:{},children_counts:{}});Object.freeze({created_at:"2023-12-03T21:53:45.999851Z",updated_at:"2023-12-03T21:53:45.999851Z",id:"some-reply-id-3",user_id:Ge.id,user:{id:Ge.id,data:{},created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z"},kind:"reply",activity_id:Dc.id,data:{content:"Some content 4..."},parent:"",latest_children:{},children_counts:{}});function Ac({mutationFn:t,mutationHandlers:{mutate:e,error:n},queryClient:r,queryKey:i,user:s}){const{mutate:o}=me.useMutation({mutationFn:t,onMutate:c=>e(f=>{const l=Ur({activity:Nc(c),user:s});return Hr(l,f)}),onError:n,onSuccess:(c,f,l)=>{const d=Ur({activity:c,user:s});r.setQueryData(i,Hr(d,l,!0)),setTimeout(()=>{ni(d.id)},0)}});return o}function Ic({mutationFn:t,mutationHandlers:{mutate:e,error:n}}){const{mutate:r}=me.useMutation({mutationFn:t,onMutate:({activityId:i,content:s})=>e(o=>{const c=Ht(i,o);return c&&(c.content=s),o}),onError:n});return r}function Lc({queryFns:{create:t,edit:e,like:n,list:r,remove:i,unlike:s},queryKey:o}){const c=me.useQueryClient(),f=Kt(),l={queryClient:c,queryKey:o},d={mutationHandlers:{error:er(l),mutate:tr(l)},user:f,...l},u=Ac({...d,mutationFn:t}),m=Ic({...d,mutationFn:e}),p=Bc({...d,mutationFn:n}),b=Uc({...d,mutationFn:i}),y=zc({...d,mutationFn:s}),{activities:x,...v}=qc({queryKey:o,queryFn:r});return{activities:x,mutations:{create:u,edit:m,remove:b,like:p,unlike:y},user:f,...v}}function Bc({mutationFn:t,mutationHandlers:{mutate:e,error:n},queryClient:r,queryKey:i}){const{mutate:s}=me.useMutation({mutationFn:t,onMutate:({activityId:o})=>e(c=>{const f=Ht(o,c);return f&&Wt({activity:f}),c}),onError:n,onSuccess:(o,{activityId:c},f)=>{const l=Ht(c,f);l&&Wt({activity:l,reaction:o}),r.setQueryData(i,f)}});return s}function qc({queryFn:t,queryKey:e}){const{data:n,error:r,isLoading:i,hasNextPage:s,fetchNextPage:o}=me.useInfiniteQuery({queryKey:e,queryFn:t,initialPageParam:{next:null},getNextPageParam:c=>(c==null?void 0:c.next)||null});return{activities:Wc(n),error:r,isLoading:i,hasNextPage:s,fetchNextPage:o}}function Uc({mutationFn:t,mutationHandlers:{mutate:e,error:n}}){const{mutate:r}=me.useMutation({mutationFn:t,onMutate:({activityId:i})=>e(s=>Zc(i,s)),onError:n});return r}function zc({mutationFn:t,mutationHandlers:{mutate:e,error:n},user:r}){const{mutate:i}=me.useMutation({mutationFn:t,onMutate:({activityId:s})=>e(o=>{const c=Ht(s,o);return c&&ti({activity:c,user:r}),o}),onError:n});return i}function Hr(t,e,n=!1){return e?(n?e.pages[0].results[0]=t:e.pages[0].results=[t,...e.pages[0].results],e):{pages:[{next:"",results:[t]}],pageParams:[""]}}function Ht(t,e){if(e)for(const{results:n}of e.pages){const r=n.find(({id:i})=>i===t);if(r)return r}}function Zc(t,e){for(const{results:n}of e.pages){const r=n.findIndex(({id:i})=>i===t);if(r!==-1){n.splice(r,1);break}}return e}function Wc(t){var e;return((e=t==null?void 0:t.pages)==null?void 0:e.reduce((n,{results:r})=>[...n,...r],[]))||[]}const Hc=({basePath:t,parentId:e,isMember:n,functions:{activities:r,join:i,leave:s}})=>{const o=q.useIntl(),{activities:c,error:f,fetchNextPage:l,hasNextPage:d,isLoading:u,mutations:{create:m,edit:p,remove:b,like:y,unlike:x},user:v}=Lc({queryKey:[t,e,"activities"],queryFns:r});if(ri(),f)return a.jsx(Be,{variant:"error",text:f.message});const _=(c==null?void 0:c.length)||0;return a.jsxs("section",{children:[a.jsx(Xn,{form:{content:{type:"post",slugs:{}},functions:{create:m},meta:{isEditing:!1,showSuccessMessage:!1}},membershipRequiredToPost:{isMember:n,required:!0,join:i,leave:s,notMemberStateText:o.formatMessage({id:"community_joinToPost"})}}),c==null?void 0:c.map((S,T)=>{var L,Z,I,V,J,j,N,H;const{id:k,own_reactions:W,latest_reactions:O,reaction_counts:z}=S,R=(((L=O==null?void 0:O.like)==null?void 0:L.length)||0)>0,D=(((Z=W==null?void 0:W.like)==null?void 0:Z.length)||0)>0,M=D?W==null?void 0:W.like[0].id:"",E=R?(I=O==null?void 0:O.like)==null?void 0:I.map(U=>{var Y,ee,G;return{id:(Y=U==null?void 0:U.user)==null?void 0:Y.id,name:(G=(ee=U==null?void 0:U.user)==null?void 0:ee.data)==null?void 0:G.name}}):!1,w=S==null?void 0:S.actor,$=(w==null?void 0:w.id)===(v==null?void 0:v.id);return a.jsxs(g.Fragment,{children:[a.jsx(_t,{content:{type:"post",body:S==null?void 0:S.content,canLike:en(n,$),createdAt:(S==null?void 0:S.time)||"",slugs:{question:`${t}/${e}`,answer:k},slug:k,author:{id:w==null?void 0:w.id,name:(V=w==null?void 0:w.data)==null?void 0:V.name,organization:(J=w==null?void 0:w.data)==null?void 0:J.organization,jobTitle:(j=w==null?void 0:w.data)==null?void 0:j.jobTitle,location:(N=w==null?void 0:w.data)==null?void 0:N.location,image:{thumbnail:((H=w==null?void 0:w.data)==null?void 0:H.thumbnail)||void 0}},userLiked:D,likes:(z==null?void 0:z.like)||0,comments:(z==null?void 0:z.reply)||0,peopleWhoLiked:E},links:{post:`${t}/${e}/${k}`,comments:`${t}/${e}/${k}`},functions:{content:{createContent:()=>null,deleteContent:()=>b({activityId:k}),updateContent:(U,{body:Y})=>p({activityId:k,content:Y})},likes:{createLike:()=>y({activityId:k}),deleteLike:()=>x({activityId:k,reactionId:M})},comments:{openComments:()=>null}},isTruncated:!0}),_>T+1&&a.jsx(je,{})]},k)}),!u&&a.jsx(yt,{hasNextPage:d,loadNextPage:()=>l(),icon:{icon:"arrow-down",position:"right"},messages:{button:o.formatMessage({id:"loadMore_button"}),error:o.formatMessage({id:"loadMore_error"})}})]})},Vc={next:"id_lt=67ef0342-6f6e-4807-beea-5a9184ec140c&limit=5",results:[{created_at:"2023-12-03T18:47:44.081716Z",updated_at:"2023-12-03T18:47:44.081716Z",id:"256b921e-ffe6-410d-b754-ac1aaee989ce",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 17..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:02.517688Z",updated_at:"2023-12-03T18:47:24.852582Z",id:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 16 (edited)..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T19:28:09.799652Z",updated_at:"2023-12-03T19:28:09.799652Z",id:"bf1ec451-e7c3-4ebe-a60e-248b0ec2a671",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 3..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:59.756761Z",updated_at:"2023-12-03T19:27:59.756761Z",id:"7887d921-e2ba-48ef-8089-db24536dbf70",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 2..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}},{created_at:"2023-12-03T19:27:46.534650Z",updated_at:"2023-12-03T19:27:46.534650Z",id:"73f5bdf3-7080-48ac-a8dc-185f71b38b42",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 1..."},parent:"ecb077fe-9f3d-4066-aca2-1ddbc9ac6de7",latest_children:{},children_counts:{}}]},children_counts:{reply:3}},{created_at:"2023-12-03T17:47:45.107092Z",updated_at:"2023-12-03T17:47:45.107092Z",id:"27a59e8f-f094-442f-88ec-1d5ec2f72790",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 14..."},parent:"",latest_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:34.103420Z",updated_at:"2023-12-03T17:56:34.103420Z",id:"ddc28de7-4e89-4572-8122-c95dceacc2fd",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 3..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:26.410145Z",updated_at:"2023-12-03T17:56:26.410145Z",id:"916ed4b6-ad87-47bc-9e00-7b0c46180276",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 2..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:19.921740Z",updated_at:"2023-12-03T17:56:19.921740Z",id:"92cddcb2-cbdc-4e69-9c8e-5afe3a607411",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 1..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},own_children:{reply:[{created_at:"2023-12-03T18:47:10.603929Z",updated_at:"2023-12-03T18:47:10.603929Z",id:"c32b83d5-c5fc-4253-8531-eb99dcb01f28",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 8..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:47:04.856649Z",updated_at:"2023-12-03T18:47:04.856649Z",id:"5efd80e3-cb11-4748-8c64-f46b71df69c4",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 7..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:22.687552Z",updated_at:"2023-12-03T18:36:22.687552Z",id:"a3a2ebae-6df2-4dc0-beee-2296188b67aa",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 6..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T18:36:16.129336Z",updated_at:"2023-12-03T18:36:16.129336Z",id:"72948da5-bf3c-4bd5-9a21-2cee36e0ce8a",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 5..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:56:40.850756Z",updated_at:"2023-12-03T17:56:40.850756Z",id:"81ebc855-d1f6-4a2c-a788-a251bae406b6",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Reply 4..."},parent:"27a59e8f-f094-442f-88ec-1d5ec2f72790",latest_children:{},children_counts:{}}]},children_counts:{reply:8}},{created_at:"2023-12-03T17:47:40.066170Z",updated_at:"2023-12-03T17:47:40.066170Z",id:"9ed6a1d0-00b5-4a03-94d7-ac01e188e2e2",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 13..."},parent:"",latest_children:{},children_counts:{}},{created_at:"2023-12-03T17:47:33.107894Z",updated_at:"2023-12-03T17:47:33.107894Z",id:"67ef0342-6f6e-4807-beea-5a9184ec140c",user_id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",user:{created_at:"2023-08-31T07:11:38.677184Z",updated_at:"2023-08-31T07:11:38.677184Z",id:"3a1a02cf-b4d2-4425-b677-2818ec5d775c",data:{name:"Danu Tester"}},kind:"reply",activity_id:"c0ed39d0-8e0f-11ee-8080-8001137b7e08",data:{content:"Testing 12..."},parent:"",latest_children:{},children_counts:{}}],duration:"6.48ms"};function Yc({mutationFn:t,mutationHandlers:{mutate:e,error:n},queryClient:r,queryKey:i,user:s}){const{mutate:o}=me.useMutation({mutationFn:t,onMutate:c=>e(f=>{const l=zr({reply:Pc(c),user:s});return Vr(l,f,{replace:!1,append:(c==null?void 0:c.replyId)!==void 0})}),onError:n,onSuccess:(c,f,l)=>{const d=zr({reply:c,user:s});r.setQueryData(i,Vr(d,l,{replace:!0,append:(f==null?void 0:f.replyId)!==void 0})),setTimeout(()=>{ni(d.id)},0)}});return o}function Kc({mutationFn:t,mutationHandlers:{mutate:e,error:n}}){const{mutate:r}=me.useMutation({mutationFn:t,onMutate:({replyId:i,content:s})=>e(o=>{const c=Vt(i,o);return c&&(c.data.content=s),o}),onError:n});return r}function ii({queryFns:{create:t,edit:e,like:n,list:r,remove:i,unlike:s},queryKey:o}){const c=me.useQueryClient(),f=Kt(),l={queryClient:c,queryKey:o},d={mutationHandlers:{error:er(l),mutate:tr(l)},user:f,...l},u=Yc({...d,mutationFn:t}),m=Kc({...d,mutationFn:e}),p=Gc({...d,mutationFn:n}),b=Jc({...d,mutationFn:i}),y=Xc({...d,mutationFn:s}),{replies:x,...v}=Qc({queryKey:o,queryFn:r});return{replies:x,mutations:{create:u,edit:m,remove:b,like:p,unlike:y},user:f,...v}}function Gc({mutationFn:t,mutationHandlers:{mutate:e,error:n},queryClient:r,queryKey:i}){const{mutate:s}=me.useMutation({mutationFn:t,onMutate:({replyId:o})=>e(c=>{const f=Vt(o,c);return f&&Zr({reply:f}),c}),onError:n,onSuccess:(o,{replyId:c},f)=>{const l=Vt(c,f);l&&Zr({reply:l,reaction:o}),r.setQueryData(i,f)}});return s}function Qc({queryFn:t,queryKey:e}){const{data:n,error:r,isLoading:i,hasNextPage:s,fetchNextPage:o}=me.useInfiniteQuery({queryKey:e,queryFn:t,initialPageParam:{next:""},getNextPageParam:l=>(l==null?void 0:l.next)||null}),c=al(n),f=`${c.length||0}${s?"+":""}`;return{replies:c,repliesCount:f,error:r,isLoading:i,hasNextPage:s,fetchNextPage:o}}function Jc({mutationFn:t,mutationHandlers:{mutate:e,error:n}}){const{mutate:r}=me.useMutation({mutationFn:t,onMutate:({replyId:i})=>e(s=>rl(i,s)),onError:n});return r}function Xc({mutationFn:t,mutationHandlers:{mutate:e,error:n},user:r}){const{mutate:i}=me.useMutation({mutationFn:t,onMutate:({replyId:s})=>e(o=>{const c=Vt(s,o);return c&&Rc({reply:c,user:r}),o}),onError:n});return i}function el(t){return{pages:[{next:"",results:[t]}],pageParams:[""]}}function tl(t,e,n){const r=e.pages.length-1,i=e.pages[r].results.length-1;return n!=null&&n.replace?e.pages[r].results[i]=t:e.pages[r].results.push(t),e}function nl(t,e,n){return n!=null&&n.replace?e.pages[0].results[0]=t:e.pages[0].results=[t,...e.pages[0].results],e}function Vr(t,e,n){return e?n!=null&&n.append?tl(t,e,n):nl(t,e,n):el(t)}function Vt(t,e){if(e)for(const{results:n}of e.pages){const r=n.find(({id:i})=>i===t);if(r)return r}}function rl(t,e){for(const{results:n}of e.pages){const r=n.findIndex(({id:i})=>i===t);if(r!==-1){n.splice(r,1);break}}return e}function al(t){var e;return((e=t==null?void 0:t.pages)==null?void 0:e.reduce((n,r)=>[...n,...r==null?void 0:r.results],[]))||[]}const il=({basePath:t,parentId:e,activityId:n,replyId:r,isMember:i,functions:s})=>{const{replies:o,fetchNextPage:c,hasNextPage:f,isLoading:l,mutations:{create:d,edit:u,like:m,remove:p,unlike:b},user:y}=ii({queryKey:[t,e,n,r,"replies"],queryFns:{...s,list:x=>s.list({...x,reactionId:r})}});return a.jsx(Ja,{loadMore:{isLoading:l,hasNextPage:f,loadNextPage:()=>c()},form:{content:{type:"reply",slugs:{question:`${t}/${e}`,answer:n,reply:r}},functions:{create:(x,{body:v})=>d({activityId:n,replyId:r,content:v})},meta:{isEditing:!1,showSuccessMessage:!1}},children:o&&o.length>0?o==null?void 0:o.map(x=>{var L,Z,I,V,J,j,N,H,U,Y,ee,G;const{id:v,own_children:_,latest_children:S,children_counts:T}=x,W=(((L=_==null?void 0:_.like)==null?void 0:L.length)||0)>0?(Z=_==null?void 0:_.like)==null?void 0:Z.find(K=>{var X;return((X=K==null?void 0:K.user)==null?void 0:X.id)===(y==null?void 0:y.id)}):!1,O=W?W==null?void 0:W.id:"",z=!!W,D=(((I=S==null?void 0:S.like)==null?void 0:I.length)||0)>0?(V=S==null?void 0:S.like)==null?void 0:V.map(K=>{var X,ne,F;return{id:(X=K==null?void 0:K.user)==null?void 0:X.id,name:(F=(ne=K==null?void 0:K.user)==null?void 0:ne.data)==null?void 0:F.name}}):!1,M=x==null?void 0:x.user,E=(M==null?void 0:M.id)===(y==null?void 0:y.id),w=en(i,E),$=typeof x.data.content=="string"?(J=x==null?void 0:x.data)==null?void 0:J.content:((N=(j=x==null?void 0:x.data)==null?void 0:j.content)==null?void 0:N.text)||"";return a.jsx(_t,{content:{id:v,type:"reply",body:$,canLike:w,createdAt:x==null?void 0:x.created_at,slugs:{question:`${t}/${e}`,answer:n,reply:x==null?void 0:x.parent},slug:"",author:{id:M==null?void 0:M.id,name:(H=M.data)==null?void 0:H.name,organization:(U=M.data)==null?void 0:U.organization,jobTitle:(Y=M.data)==null?void 0:Y.jobTitle,location:(ee=M.data)==null?void 0:ee.location,image:{thumbnail:((G=M.data)==null?void 0:G.thumbnail)||void 0}},userLiked:z,likes:(T==null?void 0:T.like)||0,peopleWhoLiked:D},functions:{content:{createContent:()=>null,deleteContent:()=>p({replyId:v}),updateContent:(K,{body:X})=>u({replyId:v,content:X})},likes:{createLike:()=>m({replyId:v}),deleteLike:()=>b({replyId:v,reactionId:O})},comments:{}}},v)}):null})},si=({basePath:t,parentId:e,activityId:n,isMember:r,functions:{reactions:i,join:s,leave:o}})=>{const c=q.useIntl(),{replies:f,repliesCount:l,fetchNextPage:d,hasNextPage:u,isLoading:m,mutations:{create:p,edit:b,like:y,remove:x,unlike:v},user:_}=ii({queryKey:[t,e,n,"replies"],queryFns:i});return na(),ri(),a.jsxs("section",{children:[a.jsx(Qa,{type:"comment",responses:l}),a.jsx(Xn,{form:{content:{type:"reply",slugs:{}},functions:{create:(S,{body:T})=>p({activityId:n,content:T})},meta:{isEditing:!1,showSuccessMessage:!1},placeholder:c.formatMessage({id:"discussion_responses_placeholder"})},membershipRequiredToPost:{isMember:r,required:!0,join:s,leave:o,notMemberStateText:c.formatMessage({id:"community_joinToPost"})}}),f==null?void 0:f.map(S=>{var V,J,j,N,H,U,Y,ee,G,K,X,ne;const{id:T,own_children:k,latest_children:W,children_counts:O}=S,R=(((V=k==null?void 0:k.like)==null?void 0:V.length)||0)>0?(J=k==null?void 0:k.like)==null?void 0:J.find(F=>{var ie;return((ie=F==null?void 0:F.user)==null?void 0:ie.id)===(_==null?void 0:_.id)}):!1,D=R?R==null?void 0:R.id:"",M=!!R,w=(((j=W==null?void 0:W.like)==null?void 0:j.length)||0)>0?(N=W==null?void 0:W.like)==null?void 0:N.map(F=>{var ie,A,he;return{id:(ie=F==null?void 0:F.user)==null?void 0:ie.id,name:(he=(A=F==null?void 0:F.user)==null?void 0:A.data)==null?void 0:he.name}}):!1,$=S==null?void 0:S.user,L=($==null?void 0:$.id)===(_==null?void 0:_.id),Z=en(r,L),I=typeof S.data.content=="string"?(H=S==null?void 0:S.data)==null?void 0:H.content:((Y=(U=S==null?void 0:S.data)==null?void 0:U.content)==null?void 0:Y.text)||"";return a.jsx(Ka,{children:a.jsx(_t,{content:{id:T,type:"reply",body:I,canLike:Z,createdAt:S==null?void 0:S.created_at,slugs:{question:`${t}/${e}`,answer:n,reply:T},slug:T,author:{id:$==null?void 0:$.id,name:(ee=$.data)==null?void 0:ee.name,organization:(G=$.data)==null?void 0:G.organization,jobTitle:(K=$.data)==null?void 0:K.jobTitle,location:(X=$.data)==null?void 0:X.location,image:{thumbnail:((ne=$.data)==null?void 0:ne.thumbnail)||void 0}},userLiked:M,likes:(O==null?void 0:O.like)||0,peopleWhoLiked:w},functions:{content:{createContent:()=>null,deleteContent:()=>x({replyId:T}),updateContent:(F,{body:ie})=>b({replyId:T,content:ie})},likes:{createLike:()=>y({replyId:T}),deleteLike:()=>v({replyId:T,reactionId:D})},comments:{}},children:a.jsx(il,{basePath:t,parentId:e,activityId:n,replyId:T,isMember:r,functions:{...i}})},T)},T)}),!m&&a.jsx(yt,{hasNextPage:u,loadNextPage:()=>d(),icon:{icon:"arrow-down",position:"right"},messages:{button:c.formatMessage({id:"loadMore_button"}),error:c.formatMessage({id:"loadMore_error"})}})]})};function sl({mutationFn:t,mutationHandlers:{mutate:e,error:n}}){const{mutate:r}=me.useMutation({mutationFn:t,onMutate:({content:i})=>e(s=>(s&&(s.content=i),s)),onError:n});return r}function ol({queryFn:t,queryKey:e}){const{data:n,error:r,isLoading:i,isFetching:s}=me.useQuery({queryFn:t,queryKey:e});return{activity:n,error:r,isLoading:i,isFetching:s}}function cl({queryFns:{read:t,edit:e,like:n,unlike:r},queryKey:i}){const s=me.useQueryClient(),o=Kt(),c={queryClient:s,queryKey:i},f={mutationHandlers:{error:er(c),mutate:tr(c)},user:o,...c},l=sl({...f,mutationFn:e}),d=ll({...f,mutationFn:n}),u=ul({...f,mutationFn:r}),{activity:m,...p}=ol({queryKey:i,queryFn:t});return{activity:m,mutations:{edit:l,like:d,unlike:u},user:o,...p}}function ll({mutationFn:t,mutationHandlers:{mutate:e,error:n},queryClient:r,queryKey:i}){const{mutate:s}=me.useMutation({mutationFn:t,onMutate:o=>e(c=>(c&&Wt({activity:c}),c)),onError:n,onSuccess:(o,c,f)=>{f&&Wt({activity:f,reaction:o}),r.setQueryData(i,f)}});return s}function ul({mutationFn:t,mutationHandlers:{mutate:e,error:n},user:r}){const{mutate:i}=me.useMutation({mutationFn:t,onMutate:s=>e(o=>(o&&ti({activity:o,user:r}),o)),onError:n});return i}const dl=({basePath:t,parentId:e,activityId:n,isMember:r,functions:{activities:{remove:i,...s},reactions:o,join:c,leave:f}})=>{var R,D,M,E,w,$,L,Z,I,V;const l=q.useIntl(),d=g.useContext(Te),{activity:u,error:m,isLoading:p,mutations:{edit:b,like:y,unlike:x}}=cl({queryFns:s,queryKey:[t,e,n]});if(p)return a.jsx(xe,{style:{height:"400px"}});if(m||!u)return a.jsx(Be,{variant:"error",text:l.formatMessage({id:"activitySection_notFoundError"})});const{own_reactions:v,latest_reactions:_}=u,S=(((R=_==null?void 0:_.like)==null?void 0:R.length)||0)>0,T=(((D=v==null?void 0:v.like)==null?void 0:D.length)||0)>0,k=T?v==null?void 0:v.like[0].id:"",W=S?(M=_==null?void 0:_.like)==null?void 0:M.map(J=>{var j,N,H;return{id:(j=J==null?void 0:J.user)==null?void 0:j.id,name:(H=(N=J==null?void 0:J.user)==null?void 0:N.data)==null?void 0:H.name}}):!1,O=u==null?void 0:u.actor,z=(O==null?void 0:O.id)===(d==null?void 0:d.id);return a.jsxs("section",{className:"activity-section",children:[a.jsx(_t,{className:"highlighted-text-box subtle",content:{id:n,type:"post",body:u==null?void 0:u.content,canLike:en(r,z),createdAt:(u==null?void 0:u.time)||"",slugs:{question:`${t}/${e}`,answer:u==null?void 0:u.id},slug:n,author:{id:O.id,name:(E=O.data)==null?void 0:E.name,organization:(w=O.data)==null?void 0:w.organization,jobTitle:($=O.data)==null?void 0:$.jobTitle,location:(L=O.data)==null?void 0:L.location,image:{thumbnail:((Z=O.data)==null?void 0:Z.thumbnail)||void 0}},userLiked:T,likes:((I=u==null?void 0:u.reaction_counts)==null?void 0:I.like)||0,comments:((V=u==null?void 0:u.reaction_counts)==null?void 0:V.reply)||0,peopleWhoLiked:W},originalAuthorId:O==null?void 0:O.id,forceHide:{comments:!0},functions:{content:{createContent:()=>null,deleteContent:i,updateContent:(J,{body:j})=>b({content:j})},likes:{createLike:()=>y({activityId:n}),deleteLike:()=>x({activityId:n,reactionId:k})},comments:{openComments:()=>{}}}},n),a.jsx(si,{basePath:t,parentId:e,activityId:n,isMember:r,functions:{reactions:o,join:c,leave:f}})]})},fl=({id:t,data:{jobTitle:e,name:n,organization:r,thumbnail:i}})=>({id:t,name:n,jobTitle:e,organization:r,image:{thumbnail:i}}),Yr=[{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 Pt="notFoundError_",ml=()=>{const t=q.useIntl(),e=[];return Yr.forEach((n,r)=>{n.title=t.formatMessage({id:`${Pt}post_${r+1}`}),e.push("solutionArticle")}),a.jsxs(Ya,{styling:{background:"bold",circle:"small",variant:"alt-2"},additionalContent:{appended:a.jsxs(Le,{children:[a.jsx(za,{cards:Yr,cardTypes:e,buildCardData:n=>new Promise((r,i)=>{r(n)})}),a.jsx(re,{href:"/solution-articles/",children:t.formatMessage({id:`${Pt}cta`})})]})},reportError:()=>{},className:"not-found-error",children:[a.jsx("h1",{children:t.formatMessage({id:`${Pt}title`})}),a.jsx("p",{children:t.formatMessage({id:`${Pt}text`})})]})};exports.ASSETS_BUCKET=Ae;exports.ActivitiesFeed=Hc;exports.ActivitySection=dl;exports.AddPost=Xn;exports.Banner=ts;exports.BannerSection=cs;exports.Breadcrumbs=ic;exports.Button=re;exports.ButtonWrapper=Xe;exports.CacheProvider=fa;exports.Card=Yn;exports.CardBlock=za;exports.Carousel=rc;exports.CollapsibleSection=qn;exports.Columns=Ha;exports.CommunityDetails=ac;exports.ContactFooter=gc;exports.ContactForm=Ba;exports.Contributors=Zn;exports.ConversationContext=Xt;exports.CookieBanner=Va;exports.Directory=Ko;exports.DiscussionConversation=Ka;exports.DiscussionForm=Jt;exports.DiscussionLikes=Ga;exports.DiscussionPost=_t;exports.DiscussionThread=Ja;exports.Divider=je;exports.DownloadSection=ns;exports.EMAILS=We;exports.EditSection=as;exports.EmailHelperTextBox=Oa;exports.EmptyStateBox=Be;exports.Filters=sc;exports.FlagsProvider=ma;exports.Footer=Qn;exports.Form=Qt;exports.FullWidthSection=Le;exports.GlobalProviders=ps;exports.Header=Jn;exports.HelperTextBox=va;exports.HiddenFromScreenReaders=Yt;exports.HideShowTextBox=hs;exports.HighlightSection=us;exports.HighlightedTextBox=$e;exports.ImageContainer=Xi;exports.IntlProvider=pa;exports.InviteForm=qa;exports.InviteModal=Yo;exports.JoinButton=Kn;exports.LanguageSwitcher=cc;exports.Link=tt;exports.LoadMore=yt;exports.LoadingBlock=Ss;exports.LoadingPlaceholder=xe;exports.LoadingState=Un;exports.Logo=Gn;exports.LogoSection=is;exports.MarkdownText=pt;exports.MarketingBlock=ds;exports.Member=Gt;exports.MembersList=wc;exports.Modal=Vn;exports.MoreMenu=Za;exports.NUMBER_OF_USERS=Bi;exports.NavigationMenu=Wa;exports.NotFoundError=ml;exports.Overlay=bt;exports.PageHeading=ya;exports.PageLayout=Ya;exports.PasswordRules=Io;exports.Pill=ht;exports.ProfileImageChange=qo;exports.ProfilePicture=Re;exports.ProgressBar=_a;exports.Rating=Lo;exports.RepliesFeed=si;exports.ResponsesHeading=Qa;exports.ResponsiveImage=et;exports.ReturnToNavButton=es;exports.SearchForm=Ua;exports.ShareLinks=mc;exports.SignupForm=Vo;exports.Span=ba;exports.StatusBanner=gt;exports.Tabs=pc;exports.Tags=xc;exports.TestimonialBlock=js;exports.Toggle=Bo;exports.Tooltip=ua;exports.TopLevelPage=vc;exports.UserContext=Te;exports.UserProvider=ha;exports.VisuallyHidden=ge;exports.addAriaProps=Fa;exports.generateCssIcon=sa;exports.getMember=zn;exports.headerData=vt;exports.mapGetStreamData=fl;exports.pageReady=la;exports.passwordValidator=Gi;exports.repliesFeedMock=Vc;exports.useCurrentPath=Xr;exports.useEffectAfterMount=Ye;exports.useElementWidth=Je;exports.useScrollListener=ta;exports.useScrollToHash=na;exports.useUser=Kt;
|