@apolitical/component-library 1.9.5-beta.2 → 1.9.5

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.
@@ -58,7 +58,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
58
58
  *
59
59
  * @author Feross Aboukhadijeh <https://feross.org>
60
60
  * @license MIT
61
- */var em;function hx(){return em||(em=1,function(e){const t=lx(),r=fx(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=o(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const x=new Uint8Array(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,Uint8Array.prototype),Object.setPrototypeOf(x,g),x.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function a(x){if(x>i)throw new RangeError('The value "'+x+'" is invalid for option "size"');const g=new Uint8Array(x);return Object.setPrototypeOf(g,s.prototype),g}function s(x,g,E){if(typeof x=="number"){if(typeof g=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(x)}return c(x,g,E)}s.poolSize=8192;function c(x,g,E){if(typeof x=="string")return d(x,g);if(ArrayBuffer.isView(x))return p(x);if(x==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x);if(Ze(x,ArrayBuffer)||x&&Ze(x.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ze(x,SharedArrayBuffer)||x&&Ze(x.buffer,SharedArrayBuffer)))return m(x,g,E);if(typeof x=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const C=x.valueOf&&x.valueOf();if(C!=null&&C!==x)return s.from(C,g,E);const L=_(x);if(L)return L;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof x[Symbol.toPrimitive]=="function")return s.from(x[Symbol.toPrimitive]("string"),g,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x)}s.from=function(x,g,E){return c(x,g,E)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(x){if(typeof x!="number")throw new TypeError('"size" argument must be of type number');if(x<0)throw new RangeError('The value "'+x+'" is invalid for option "size"')}function u(x,g,E){return l(x),x<=0?a(x):g!==void 0?typeof E=="string"?a(x).fill(g,E):a(x).fill(g):a(x)}s.alloc=function(x,g,E){return u(x,g,E)};function h(x){return l(x),a(x<0?0:S(x)|0)}s.allocUnsafe=function(x){return h(x)},s.allocUnsafeSlow=function(x){return h(x)};function d(x,g){if((typeof g!="string"||g==="")&&(g="utf8"),!s.isEncoding(g))throw new TypeError("Unknown encoding: "+g);const E=w(x,g)|0;let C=a(E);const L=C.write(x,g);return L!==E&&(C=C.slice(0,L)),C}function f(x){const g=x.length<0?0:S(x.length)|0,E=a(g);for(let C=0;C<g;C+=1)E[C]=x[C]&255;return E}function p(x){if(Ze(x,Uint8Array)){const g=new Uint8Array(x);return m(g.buffer,g.byteOffset,g.byteLength)}return f(x)}function m(x,g,E){if(g<0||x.byteLength<g)throw new RangeError('"offset" is outside of buffer bounds');if(x.byteLength<g+(E||0))throw new RangeError('"length" is outside of buffer bounds');let C;return g===void 0&&E===void 0?C=new Uint8Array(x):E===void 0?C=new Uint8Array(x,g):C=new Uint8Array(x,g,E),Object.setPrototypeOf(C,s.prototype),C}function _(x){if(s.isBuffer(x)){const g=S(x.length)|0,E=a(g);return E.length===0||x.copy(E,0,0,g),E}if(x.length!==void 0)return typeof x.length!="number"||zt(x.length)?a(0):f(x);if(x.type==="Buffer"&&Array.isArray(x.data))return f(x.data)}function S(x){if(x>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return x|0}function v(x){return+x!=x&&(x=0),s.alloc(+x)}s.isBuffer=function(g){return g!=null&&g._isBuffer===!0&&g!==s.prototype},s.compare=function(g,E){if(Ze(g,Uint8Array)&&(g=s.from(g,g.offset,g.byteLength)),Ze(E,Uint8Array)&&(E=s.from(E,E.offset,E.byteLength)),!s.isBuffer(g)||!s.isBuffer(E))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(g===E)return 0;let C=g.length,L=E.length;for(let j=0,z=Math.min(C,L);j<z;++j)if(g[j]!==E[j]){C=g[j],L=E[j];break}return C<L?-1:L<C?1:0},s.isEncoding=function(g){switch(String(g).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(g,E){if(!Array.isArray(g))throw new TypeError('"list" argument must be an Array of Buffers');if(g.length===0)return s.alloc(0);let C;if(E===void 0)for(E=0,C=0;C<g.length;++C)E+=g[C].length;const L=s.allocUnsafe(E);let j=0;for(C=0;C<g.length;++C){let z=g[C];if(Ze(z,Uint8Array))j+z.length>L.length?(s.isBuffer(z)||(z=s.from(z)),z.copy(L,j)):Uint8Array.prototype.set.call(L,z,j);else if(s.isBuffer(z))z.copy(L,j);else throw new TypeError('"list" argument must be an Array of Buffers');j+=z.length}return L};function w(x,g){if(s.isBuffer(x))return x.length;if(ArrayBuffer.isView(x)||Ze(x,ArrayBuffer))return x.byteLength;if(typeof x!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof x);const E=x.length,C=arguments.length>2&&arguments[2]===!0;if(!C&&E===0)return 0;let L=!1;for(;;)switch(g){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return er(x).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return Wt(x).length;default:if(L)return C?-1:er(x).length;g=(""+g).toLowerCase(),L=!0}}s.byteLength=w;function A(x,g,E){let C=!1;if((g===void 0||g<0)&&(g=0),g>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,g>>>=0,E<=g))return"";for(x||(x="utf8");;)switch(x){case"hex":return fe(this,g,E);case"utf8":case"utf-8":return re(this,g,E);case"ascii":return Q(this,g,E);case"latin1":case"binary":return J(this,g,E);case"base64":return Y(this,g,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,g,E);default:if(C)throw new TypeError("Unknown encoding: "+x);x=(x+"").toLowerCase(),C=!0}}s.prototype._isBuffer=!0;function b(x,g,E){const C=x[g];x[g]=x[E],x[E]=C}s.prototype.swap16=function(){const g=this.length;if(g%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let E=0;E<g;E+=2)b(this,E,E+1);return this},s.prototype.swap32=function(){const g=this.length;if(g%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let E=0;E<g;E+=4)b(this,E,E+3),b(this,E+1,E+2);return this},s.prototype.swap64=function(){const g=this.length;if(g%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let E=0;E<g;E+=8)b(this,E,E+7),b(this,E+1,E+6),b(this,E+2,E+5),b(this,E+3,E+4);return this},s.prototype.toString=function(){const g=this.length;return g===0?"":arguments.length===0?re(this,0,g):A.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(g){if(!s.isBuffer(g))throw new TypeError("Argument must be a Buffer");return this===g?!0:s.compare(this,g)===0},s.prototype.inspect=function(){let g="";const E=e.INSPECT_MAX_BYTES;return g=this.toString("hex",0,E).replace(/(.{2})/g,"$1 ").trim(),this.length>E&&(g+=" ... "),"<Buffer "+g+">"},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(g,E,C,L,j){if(Ze(g,Uint8Array)&&(g=s.from(g,g.offset,g.byteLength)),!s.isBuffer(g))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof g);if(E===void 0&&(E=0),C===void 0&&(C=g?g.length:0),L===void 0&&(L=0),j===void 0&&(j=this.length),E<0||C>g.length||L<0||j>this.length)throw new RangeError("out of range index");if(L>=j&&E>=C)return 0;if(L>=j)return-1;if(E>=C)return 1;if(E>>>=0,C>>>=0,L>>>=0,j>>>=0,this===g)return 0;let z=j-L,me=C-E;const Ce=Math.min(z,me),Re=this.slice(L,j),Pe=g.slice(E,C);for(let Ee=0;Ee<Ce;++Ee)if(Re[Ee]!==Pe[Ee]){z=Re[Ee],me=Pe[Ee];break}return z<me?-1:me<z?1:0};function N(x,g,E,C,L){if(x.length===0)return-1;if(typeof E=="string"?(C=E,E=0):E>2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,zt(E)&&(E=L?0:x.length-1),E<0&&(E=x.length+E),E>=x.length){if(L)return-1;E=x.length-1}else if(E<0)if(L)E=0;else return-1;if(typeof g=="string"&&(g=s.from(g,C)),s.isBuffer(g))return g.length===0?-1:k(x,g,E,C,L);if(typeof g=="number")return g=g&255,typeof Uint8Array.prototype.indexOf=="function"?L?Uint8Array.prototype.indexOf.call(x,g,E):Uint8Array.prototype.lastIndexOf.call(x,g,E):k(x,[g],E,C,L);throw new TypeError("val must be string, number or Buffer")}function k(x,g,E,C,L){let j=1,z=x.length,me=g.length;if(C!==void 0&&(C=String(C).toLowerCase(),C==="ucs2"||C==="ucs-2"||C==="utf16le"||C==="utf-16le")){if(x.length<2||g.length<2)return-1;j=2,z/=2,me/=2,E/=2}function Ce(Pe,Ee){return j===1?Pe[Ee]:Pe.readUInt16BE(Ee*j)}let Re;if(L){let Pe=-1;for(Re=E;Re<z;Re++)if(Ce(x,Re)===Ce(g,Pe===-1?0:Re-Pe)){if(Pe===-1&&(Pe=Re),Re-Pe+1===me)return Pe*j}else Pe!==-1&&(Re-=Re-Pe),Pe=-1}else for(E+me>z&&(E=z-me),Re=E;Re>=0;Re--){let Pe=!0;for(let Ee=0;Ee<me;Ee++)if(Ce(x,Re+Ee)!==Ce(g,Ee)){Pe=!1;break}if(Pe)return Re}return-1}s.prototype.includes=function(g,E,C){return this.indexOf(g,E,C)!==-1},s.prototype.indexOf=function(g,E,C){return N(this,g,E,C,!0)},s.prototype.lastIndexOf=function(g,E,C){return N(this,g,E,C,!1)};function R(x,g,E,C){E=Number(E)||0;const L=x.length-E;C?(C=Number(C),C>L&&(C=L)):C=L;const j=g.length;C>j/2&&(C=j/2);let z;for(z=0;z<C;++z){const me=parseInt(g.substr(z*2,2),16);if(zt(me))return z;x[E+z]=me}return z}function $(x,g,E,C){return Mt(er(g,x.length-E),x,E,C)}function G(x,g,E,C){return Mt(kt(g),x,E,C)}function q(x,g,E,C){return Mt(Wt(g),x,E,C)}function H(x,g,E,C){return Mt(yn(g,x.length-E),x,E,C)}s.prototype.write=function(g,E,C,L){if(E===void 0)L="utf8",C=this.length,E=0;else if(C===void 0&&typeof E=="string")L=E,C=this.length,E=0;else if(isFinite(E))E=E>>>0,isFinite(C)?(C=C>>>0,L===void 0&&(L="utf8")):(L=C,C=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const j=this.length-E;if((C===void 0||C>j)&&(C=j),g.length>0&&(C<0||E<0)||E>this.length)throw new RangeError("Attempt to write outside buffer bounds");L||(L="utf8");let z=!1;for(;;)switch(L){case"hex":return R(this,g,E,C);case"utf8":case"utf-8":return $(this,g,E,C);case"ascii":case"latin1":case"binary":return G(this,g,E,C);case"base64":return q(this,g,E,C);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,g,E,C);default:if(z)throw new TypeError("Unknown encoding: "+L);L=(""+L).toLowerCase(),z=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Y(x,g,E){return g===0&&E===x.length?t.fromByteArray(x):t.fromByteArray(x.slice(g,E))}function re(x,g,E){E=Math.min(x.length,E);const C=[];let L=g;for(;L<E;){const j=x[L];let z=null,me=j>239?4:j>223?3:j>191?2:1;if(L+me<=E){let Ce,Re,Pe,Ee;switch(me){case 1:j<128&&(z=j);break;case 2:Ce=x[L+1],(Ce&192)===128&&(Ee=(j&31)<<6|Ce&63,Ee>127&&(z=Ee));break;case 3:Ce=x[L+1],Re=x[L+2],(Ce&192)===128&&(Re&192)===128&&(Ee=(j&15)<<12|(Ce&63)<<6|Re&63,Ee>2047&&(Ee<55296||Ee>57343)&&(z=Ee));break;case 4:Ce=x[L+1],Re=x[L+2],Pe=x[L+3],(Ce&192)===128&&(Re&192)===128&&(Pe&192)===128&&(Ee=(j&15)<<18|(Ce&63)<<12|(Re&63)<<6|Pe&63,Ee>65535&&Ee<1114112&&(z=Ee))}}z===null?(z=65533,me=1):z>65535&&(z-=65536,C.push(z>>>10&1023|55296),z=56320|z&1023),C.push(z),L+=me}return M(C)}const X=4096;function M(x){const g=x.length;if(g<=X)return String.fromCharCode.apply(String,x);let E="",C=0;for(;C<g;)E+=String.fromCharCode.apply(String,x.slice(C,C+=X));return E}function Q(x,g,E){let C="";E=Math.min(x.length,E);for(let L=g;L<E;++L)C+=String.fromCharCode(x[L]&127);return C}function J(x,g,E){let C="";E=Math.min(x.length,E);for(let L=g;L<E;++L)C+=String.fromCharCode(x[L]);return C}function fe(x,g,E){const C=x.length;(!g||g<0)&&(g=0),(!E||E<0||E>C)&&(E=C);let L="";for(let j=g;j<E;++j)L+=yt[x[j]];return L}function Z(x,g,E){const C=x.slice(g,E);let L="";for(let j=0;j<C.length-1;j+=2)L+=String.fromCharCode(C[j]+C[j+1]*256);return L}s.prototype.slice=function(g,E){const C=this.length;g=~~g,E=E===void 0?C:~~E,g<0?(g+=C,g<0&&(g=0)):g>C&&(g=C),E<0?(E+=C,E<0&&(E=0)):E>C&&(E=C),E<g&&(E=g);const L=this.subarray(g,E);return Object.setPrototypeOf(L,s.prototype),L};function K(x,g,E){if(x%1!==0||x<0)throw new RangeError("offset is not uint");if(x+g>E)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(g,E,C){g=g>>>0,E=E>>>0,C||K(g,E,this.length);let L=this[g],j=1,z=0;for(;++z<E&&(j*=256);)L+=this[g+z]*j;return L},s.prototype.readUintBE=s.prototype.readUIntBE=function(g,E,C){g=g>>>0,E=E>>>0,C||K(g,E,this.length);let L=this[g+--E],j=1;for(;E>0&&(j*=256);)L+=this[g+--E]*j;return L},s.prototype.readUint8=s.prototype.readUInt8=function(g,E){return g=g>>>0,E||K(g,1,this.length),this[g]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(g,E){return g=g>>>0,E||K(g,2,this.length),this[g]|this[g+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(g,E){return g=g>>>0,E||K(g,2,this.length),this[g]<<8|this[g+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(g,E){return g=g>>>0,E||K(g,4,this.length),(this[g]|this[g+1]<<8|this[g+2]<<16)+this[g+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(g,E){return g=g>>>0,E||K(g,4,this.length),this[g]*16777216+(this[g+1]<<16|this[g+2]<<8|this[g+3])},s.prototype.readBigUInt64LE=at(function(g){g=g>>>0,st(g,"offset");const E=this[g],C=this[g+7];(E===void 0||C===void 0)&&Je(g,this.length-8);const L=E+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24,j=this[++g]+this[++g]*2**8+this[++g]*2**16+C*2**24;return BigInt(L)+(BigInt(j)<<BigInt(32))}),s.prototype.readBigUInt64BE=at(function(g){g=g>>>0,st(g,"offset");const E=this[g],C=this[g+7];(E===void 0||C===void 0)&&Je(g,this.length-8);const L=E*2**24+this[++g]*2**16+this[++g]*2**8+this[++g],j=this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+C;return(BigInt(L)<<BigInt(32))+BigInt(j)}),s.prototype.readIntLE=function(g,E,C){g=g>>>0,E=E>>>0,C||K(g,E,this.length);let L=this[g],j=1,z=0;for(;++z<E&&(j*=256);)L+=this[g+z]*j;return j*=128,L>=j&&(L-=Math.pow(2,8*E)),L},s.prototype.readIntBE=function(g,E,C){g=g>>>0,E=E>>>0,C||K(g,E,this.length);let L=E,j=1,z=this[g+--L];for(;L>0&&(j*=256);)z+=this[g+--L]*j;return j*=128,z>=j&&(z-=Math.pow(2,8*E)),z},s.prototype.readInt8=function(g,E){return g=g>>>0,E||K(g,1,this.length),this[g]&128?(255-this[g]+1)*-1:this[g]},s.prototype.readInt16LE=function(g,E){g=g>>>0,E||K(g,2,this.length);const C=this[g]|this[g+1]<<8;return C&32768?C|4294901760:C},s.prototype.readInt16BE=function(g,E){g=g>>>0,E||K(g,2,this.length);const C=this[g+1]|this[g]<<8;return C&32768?C|4294901760:C},s.prototype.readInt32LE=function(g,E){return g=g>>>0,E||K(g,4,this.length),this[g]|this[g+1]<<8|this[g+2]<<16|this[g+3]<<24},s.prototype.readInt32BE=function(g,E){return g=g>>>0,E||K(g,4,this.length),this[g]<<24|this[g+1]<<16|this[g+2]<<8|this[g+3]},s.prototype.readBigInt64LE=at(function(g){g=g>>>0,st(g,"offset");const E=this[g],C=this[g+7];(E===void 0||C===void 0)&&Je(g,this.length-8);const L=this[g+4]+this[g+5]*2**8+this[g+6]*2**16+(C<<24);return(BigInt(L)<<BigInt(32))+BigInt(E+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24)}),s.prototype.readBigInt64BE=at(function(g){g=g>>>0,st(g,"offset");const E=this[g],C=this[g+7];(E===void 0||C===void 0)&&Je(g,this.length-8);const L=(E<<24)+this[++g]*2**16+this[++g]*2**8+this[++g];return(BigInt(L)<<BigInt(32))+BigInt(this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+C)}),s.prototype.readFloatLE=function(g,E){return g=g>>>0,E||K(g,4,this.length),r.read(this,g,!0,23,4)},s.prototype.readFloatBE=function(g,E){return g=g>>>0,E||K(g,4,this.length),r.read(this,g,!1,23,4)},s.prototype.readDoubleLE=function(g,E){return g=g>>>0,E||K(g,8,this.length),r.read(this,g,!0,52,8)},s.prototype.readDoubleBE=function(g,E){return g=g>>>0,E||K(g,8,this.length),r.read(this,g,!1,52,8)};function ce(x,g,E,C,L,j){if(!s.isBuffer(x))throw new TypeError('"buffer" argument must be a Buffer instance');if(g>L||g<j)throw new RangeError('"value" argument is out of bounds');if(E+C>x.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(g,E,C,L){if(g=+g,E=E>>>0,C=C>>>0,!L){const me=Math.pow(2,8*C)-1;ce(this,g,E,C,me,0)}let j=1,z=0;for(this[E]=g&255;++z<C&&(j*=256);)this[E+z]=g/j&255;return E+C},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(g,E,C,L){if(g=+g,E=E>>>0,C=C>>>0,!L){const me=Math.pow(2,8*C)-1;ce(this,g,E,C,me,0)}let j=C-1,z=1;for(this[E+j]=g&255;--j>=0&&(z*=256);)this[E+j]=g/z&255;return E+C},s.prototype.writeUint8=s.prototype.writeUInt8=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,1,255,0),this[E]=g&255,E+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,2,65535,0),this[E]=g&255,this[E+1]=g>>>8,E+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,2,65535,0),this[E]=g>>>8,this[E+1]=g&255,E+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,4,4294967295,0),this[E+3]=g>>>24,this[E+2]=g>>>16,this[E+1]=g>>>8,this[E]=g&255,E+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,4,4294967295,0),this[E]=g>>>24,this[E+1]=g>>>16,this[E+2]=g>>>8,this[E+3]=g&255,E+4};function de(x,g,E,C,L){oe(g,C,L,x,E,7);let j=Number(g&BigInt(4294967295));x[E++]=j,j=j>>8,x[E++]=j,j=j>>8,x[E++]=j,j=j>>8,x[E++]=j;let z=Number(g>>BigInt(32)&BigInt(4294967295));return x[E++]=z,z=z>>8,x[E++]=z,z=z>>8,x[E++]=z,z=z>>8,x[E++]=z,E}function Ve(x,g,E,C,L){oe(g,C,L,x,E,7);let j=Number(g&BigInt(4294967295));x[E+7]=j,j=j>>8,x[E+6]=j,j=j>>8,x[E+5]=j,j=j>>8,x[E+4]=j;let z=Number(g>>BigInt(32)&BigInt(4294967295));return x[E+3]=z,z=z>>8,x[E+2]=z,z=z>>8,x[E+1]=z,z=z>>8,x[E]=z,E+8}s.prototype.writeBigUInt64LE=at(function(g,E=0){return de(this,g,E,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=at(function(g,E=0){return Ve(this,g,E,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(g,E,C,L){if(g=+g,E=E>>>0,!L){const Ce=Math.pow(2,8*C-1);ce(this,g,E,C,Ce-1,-Ce)}let j=0,z=1,me=0;for(this[E]=g&255;++j<C&&(z*=256);)g<0&&me===0&&this[E+j-1]!==0&&(me=1),this[E+j]=(g/z>>0)-me&255;return E+C},s.prototype.writeIntBE=function(g,E,C,L){if(g=+g,E=E>>>0,!L){const Ce=Math.pow(2,8*C-1);ce(this,g,E,C,Ce-1,-Ce)}let j=C-1,z=1,me=0;for(this[E+j]=g&255;--j>=0&&(z*=256);)g<0&&me===0&&this[E+j+1]!==0&&(me=1),this[E+j]=(g/z>>0)-me&255;return E+C},s.prototype.writeInt8=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,1,127,-128),g<0&&(g=255+g+1),this[E]=g&255,E+1},s.prototype.writeInt16LE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,2,32767,-32768),this[E]=g&255,this[E+1]=g>>>8,E+2},s.prototype.writeInt16BE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,2,32767,-32768),this[E]=g>>>8,this[E+1]=g&255,E+2},s.prototype.writeInt32LE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,4,2147483647,-2147483648),this[E]=g&255,this[E+1]=g>>>8,this[E+2]=g>>>16,this[E+3]=g>>>24,E+4},s.prototype.writeInt32BE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,4,2147483647,-2147483648),g<0&&(g=4294967295+g+1),this[E]=g>>>24,this[E+1]=g>>>16,this[E+2]=g>>>8,this[E+3]=g&255,E+4},s.prototype.writeBigInt64LE=at(function(g,E=0){return de(this,g,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=at(function(g,E=0){return Ve(this,g,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function te(x,g,E,C,L,j){if(E+C>x.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function ae(x,g,E,C,L){return g=+g,E=E>>>0,L||te(x,g,E,4),r.write(x,g,E,C,23,4),E+4}s.prototype.writeFloatLE=function(g,E,C){return ae(this,g,E,!0,C)},s.prototype.writeFloatBE=function(g,E,C){return ae(this,g,E,!1,C)};function De(x,g,E,C,L){return g=+g,E=E>>>0,L||te(x,g,E,8),r.write(x,g,E,C,52,8),E+8}s.prototype.writeDoubleLE=function(g,E,C){return De(this,g,E,!0,C)},s.prototype.writeDoubleBE=function(g,E,C){return De(this,g,E,!1,C)},s.prototype.copy=function(g,E,C,L){if(!s.isBuffer(g))throw new TypeError("argument should be a Buffer");if(C||(C=0),!L&&L!==0&&(L=this.length),E>=g.length&&(E=g.length),E||(E=0),L>0&&L<C&&(L=C),L===C||g.length===0||this.length===0)return 0;if(E<0)throw new RangeError("targetStart out of bounds");if(C<0||C>=this.length)throw new RangeError("Index out of range");if(L<0)throw new RangeError("sourceEnd out of bounds");L>this.length&&(L=this.length),g.length-E<L-C&&(L=g.length-E+C);const j=L-C;return this===g&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(E,C,L):Uint8Array.prototype.set.call(g,this.subarray(C,L),E),j},s.prototype.fill=function(g,E,C,L){if(typeof g=="string"){if(typeof E=="string"?(L=E,E=0,C=this.length):typeof C=="string"&&(L=C,C=this.length),L!==void 0&&typeof L!="string")throw new TypeError("encoding must be a string");if(typeof L=="string"&&!s.isEncoding(L))throw new TypeError("Unknown encoding: "+L);if(g.length===1){const z=g.charCodeAt(0);(L==="utf8"&&z<128||L==="latin1")&&(g=z)}}else typeof g=="number"?g=g&255:typeof g=="boolean"&&(g=Number(g));if(E<0||this.length<E||this.length<C)throw new RangeError("Out of range index");if(C<=E)return this;E=E>>>0,C=C===void 0?this.length:C>>>0,g||(g=0);let j;if(typeof g=="number")for(j=E;j<C;++j)this[j]=g;else{const z=s.isBuffer(g)?g:s.from(g,L),me=z.length;if(me===0)throw new TypeError('The value "'+g+'" is invalid for argument "value"');for(j=0;j<C-E;++j)this[j+E]=z[j%me]}return this};const Ie={};function Tt(x,g,E){Ie[x]=class extends E{constructor(){super(),Object.defineProperty(this,"message",{value:g.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${x}]`,this.stack,delete this.name}get code(){return x}set code(L){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:L,writable:!0})}toString(){return`${this.name} [${x}]: ${this.message}`}}}Tt("ERR_BUFFER_OUT_OF_BOUNDS",function(x){return x?`${x} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Tt("ERR_INVALID_ARG_TYPE",function(x,g){return`The "${x}" argument must be of type number. Received type ${typeof g}`},TypeError),Tt("ERR_OUT_OF_RANGE",function(x,g,E){let C=`The value of "${x}" is out of range.`,L=E;return Number.isInteger(E)&&Math.abs(E)>2**32?L=Ct(String(E)):typeof E=="bigint"&&(L=String(E),(E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))&&(L=Ct(L)),L+="n"),C+=` It must be ${g}. Received ${L}`,C},RangeError);function Ct(x){let g="",E=x.length;const C=x[0]==="-"?1:0;for(;E>=C+4;E-=3)g=`_${x.slice(E-3,E)}${g}`;return`${x.slice(0,E)}${g}`}function Gt(x,g,E){st(g,"offset"),(x[g]===void 0||x[g+E]===void 0)&&Je(g,x.length-(E+1))}function oe(x,g,E,C,L,j){if(x>E||x<g){const z=typeof g=="bigint"?"n":"";let me;throw j>3?g===0||g===BigInt(0)?me=`>= 0${z} and < 2${z} ** ${(j+1)*8}${z}`:me=`>= -(2${z} ** ${(j+1)*8-1}${z}) and < 2 ** ${(j+1)*8-1}${z}`:me=`>= ${g}${z} and <= ${E}${z}`,new Ie.ERR_OUT_OF_RANGE("value",me,x)}Gt(C,L,j)}function st(x,g){if(typeof x!="number")throw new Ie.ERR_INVALID_ARG_TYPE(g,"number",x)}function Je(x,g,E){throw Math.floor(x)!==x?(st(x,E),new Ie.ERR_OUT_OF_RANGE(E||"offset","an integer",x)):g<0?new Ie.ERR_BUFFER_OUT_OF_BOUNDS:new Ie.ERR_OUT_OF_RANGE(E||"offset",`>= ${E?1:0} and <= ${g}`,x)}const Vt=/[^+/0-9A-Za-z-_]/g;function wr(x){if(x=x.split("=")[0],x=x.trim().replace(Vt,""),x.length<2)return"";for(;x.length%4!==0;)x=x+"=";return x}function er(x,g){g=g||1/0;let E;const C=x.length;let L=null;const j=[];for(let z=0;z<C;++z){if(E=x.charCodeAt(z),E>55295&&E<57344){if(!L){if(E>56319){(g-=3)>-1&&j.push(239,191,189);continue}else if(z+1===C){(g-=3)>-1&&j.push(239,191,189);continue}L=E;continue}if(E<56320){(g-=3)>-1&&j.push(239,191,189),L=E;continue}E=(L-55296<<10|E-56320)+65536}else L&&(g-=3)>-1&&j.push(239,191,189);if(L=null,E<128){if((g-=1)<0)break;j.push(E)}else if(E<2048){if((g-=2)<0)break;j.push(E>>6|192,E&63|128)}else if(E<65536){if((g-=3)<0)break;j.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((g-=4)<0)break;j.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return j}function kt(x){const g=[];for(let E=0;E<x.length;++E)g.push(x.charCodeAt(E)&255);return g}function yn(x,g){let E,C,L;const j=[];for(let z=0;z<x.length&&!((g-=2)<0);++z)E=x.charCodeAt(z),C=E>>8,L=E%256,j.push(L),j.push(C);return j}function Wt(x){return t.toByteArray(wr(x))}function Mt(x,g,E,C){let L;for(L=0;L<C&&!(L+E>=g.length||L>=x.length);++L)g[L+E]=x[L];return L}function Ze(x,g){return x instanceof g||x!=null&&x.constructor!=null&&x.constructor.name!=null&&x.constructor.name===g.name}function zt(x){return x!==x}const yt=function(){const x="0123456789abcdef",g=new Array(256);for(let E=0;E<16;++E){const C=E*16;for(let L=0;L<16;++L)g[C+L]=x[E]+x[L]}return g}();function at(x){return typeof BigInt>"u"?vn:x}function vn(){throw new Error("BigInt not supported")}}(Zc)),Zc}(function(e,t){(function(r,n){e.exports=n(bT(),LT(),BT(),Cg(),VT,cx(),hx())})(he,function(r,n,i,o,a,s,c){return function(){var l={809:function(f){f.exports=r},30:function(f){f.exports=n},36:function(f){f.exports=i},300:function(f){f.exports=o},408:function(f){f.exports=c},25:function(f){f.exports=a},130:function(f){f.exports=s}},u={};function h(f){var p=u[f];if(p!==void 0)return p.exports;var m=u[f]={exports:{}};return l[f](m,m.exports,h),m.exports}h.n=function(f){var p=f&&f.__esModule?function(){return f.default}:function(){return f};return h.d(p,{a:p}),p},h.d=function(f,p){for(var m in p)h.o(p,m)&&!h.o(f,m)&&Object.defineProperty(f,m,{enumerable:!0,get:p[m]})},h.o=function(f,p){return Object.prototype.hasOwnProperty.call(f,p)},h.r=function(f){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(f,"__esModule",{value:!0})};var d={};return function(){h.r(d),h.d(d,{assets:function(){return M},auth:function(){return K},buildAnswer:function(){return LE},buildCarouselCard:function(){return IE},buildQuestion:function(){return Ge},carouselCards:function(){return Si},contentInteraction:function(){return at},decodeBase64:function(){return ME},default:function(){return FE},editorialPages:function(){return W},features:function(){return E},getEntries:function(){return f.getEntries},getEntry:function(){return f.getEntry},management:function(){return _n},payments:function(){return Sn},people:function(){return rr},peopleEngagement:function(){return zr},qaQuestions:function(){return ct},reportError:function(){return p.reportError},search:function(){return bi}});var f=h(809),p=h(30),m=h(36),_={APOLITICAL:{WEBSITES:{LIVE:"https://apolitical.co",LOCALHOST:"localhost",STAGING:/https:\/\/([\w|\d|-]+)\.apolitical\.co/i,STAGING_SPLITTER:"-"},ENVIRONMENTS:{PRODUCTION:"live",LOCAL:"local"}},APIS:{ASSETS_API:{BASE_URL:"/api/assets-api",ENDPOINTS:{USERS:"/users",CERTIFICATES:"/certificates"}},AUTH_API:{BASE_URL:"/api/auth-api",ENDPOINTS:{USER_PASSWORD:"/password",USERS:"/users"}},CONTENT_INTERACTION_API:{BASE_URL:"/api/content-interaction-api",ENDPOINTS:{QUESTIONS:"/questions",ANSWERS:"/answers",REPLIES:"/replies",LIKES:"/likes"}},FEATURES_API:{BASE_URL:"/api/features-api",ENDPOINTS:{FLAGS:"/features"}},MANAGEMENT_API:{BASE_URL:"/api/management-api",ENDPOINTS:{ACCOUNTS:"/accounts",EVENT_REGISTRATIONS:"/event-registrations",LOGINS:"/logins",LOGIN_PASSWORDLESS:"/passwordless",BULK_ENROLMENTS:"/bulk-enrolments"}},PAYMENTS_API:{BASE_URL:"/api/payments-api",BASE_URL_V2:"/api/payments-api/v2",ENDPOINTS:{PRODUCTS:"/products"}},PEOPLE_API:{BASE_URL:"/api/people-api",BASE_URL_V2:"/api/people-api/v2",ENDPOINTS:{BULK_ENROLMENTS:"/bulk-enrolments",REGISTRATIONS:"/registrations",USERS:"/users",USER_ANSWERS:"/answers",USER_COURSES:"/courses",USER_EVENTS:"/events",USER_LIKES:"/likes",USER_LESSONS:"/lessons",USER_PRODUCTS:"/products",USER_RATINGS:"/ratings",USER_SUBSCRIPTIONS:"/subscriptions"}},PEOPLE_ENGAGEMENT_API:{BASE_URL:"/api/people-engagement-api",ENDPOINTS:{ENQUIRY_EMAILS:"/enquiry-emails",USERS:"/users",USER_PROPERTIES:"/properties"}},SEARCH_API:{BASE_URL:"/api/search-api",ENDPOINTS:{SEARCH:"/search"}}},CONTENTFUL:{ARTICLES:{TYPE:"solutionArticle"},CAROUSELS:{CARD_TYPES:{solutionArticle:{INCLUDE:1,SELECT:"fields.authorIds,fields.authorTag,fields.image,fields.publishedDate,fields.readingTime,fields.slug,fields.title"},microcourse:{INCLUDE:2,SELECT:"fields.banner,fields.freeCourse,fields.partnershipDetails,fields.slug,fields.title"},event:{INCLUDE:1,SELECT:"fields.bannerImage,fields.defaultStartDate,fields.slug,fields.speakers,fields.title,fields.isEventOngoing"},listPage:{INCLUDE:1,SELECT:"fields.hero,fields.slug,fields.title"},qaQuestion:{INCLUDE:0,SELECT:"fields.answers,fields.authorId,fields.slug,fields.title,sys.createdAt,fields.projectNames"},learningHub:{INCLUDE:1,SELECT:"fields.bannerSection,fields.customLabel,fields.slug,fields.title"}}},COURSES:{TYPE:"microcourse"},EDITORIAL_PAGES:{INCLUDE:1,SELECT:"fields.carousels,fields.slug",TYPE:"editorialPage"},EVENTS:{TYPE:"event"},LISTS:{TYPE:"listPage"},QUESTIONS:{TYPE:"qaQuestion",INCLUDE:1,LIMIT:10,ORDER:"-sys.createdAt",SELECT:"sys.createdAt,sys.updatedAt,fields.title,fields.slug,fields.authorId,fields.answers,fields.isEdited,fields.projectNames",SKIP:0},ANSWERS:{TYPE:"qaAnswer"},REPLIES:{TYPE:"reply"},LEARNING_HUB:{TYPE:"learningHub"}},HUBSPOT:{ENVIRONMENTS_MAPPING:{local:"SANDBOX",beta:"SANDBOX",rc:"SANDBOX",live:"LIVE"},EMAIL_IDS:{SANDBOX:{internalEmailId:49099078634,externalEmailId:55196526554},LIVE:{internalEmailId:55233583049,externalEmailId:55231159239}}},USERS:{MYSELF:"me"}};const{APOLITICAL:{WEBSITES:{LIVE:S,LOCALHOST:v,STAGING:w,STAGING_SPLITTER:A},ENVIRONMENTS:{PRODUCTION:b,LOCAL:N}}}=_,{HUBSPOT:{ENVIRONMENTS_MAPPING:k,EMAIL_IDS:R}}=_;let $={emailIds:{}};var G=h(300),q=h.n(G);const H=async F=>{try{const{message:B,response:D,request:V}=F;let ne=B;return D?ne+=` - The request was made and the server responded with ${JSON.stringify({status:D.status,data:D.data})}`:V&&(ne+=" - The request was made but no response was received"),console.warn(ne),await(0,p.reportError)(new Error(ne)),ne}catch(B){return console.warn(`Cannot handle error: ${B.message}`),B.message}},{APIS:{ASSETS_API:{BASE_URL:Y,ENDPOINTS:{USERS:re,CERTIFICATES:X}}}}=_;var M={certificates:{create:async(F,B)=>{let D=[];try{const{data:V}=await q().post(`${Y}${re}/${F}${X}`,B);V&&(D=V)}catch(V){await H(V)}return D}}};const{APIS:{AUTH_API:{BASE_URL:Q,ENDPOINTS:{USER_PASSWORD:J,USERS:fe}}},USERS:{MYSELF:Z}}=_;var K={userPassword:{update:async F=>{let B=null;try{B=await q().put(`${Q}${fe}/${Z}${J}`,F)}catch(D){B={message:(((D||{}).response||{}).data||{}).message},await H(D)}return B}}};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:ce,ENDPOINTS:{ANSWERS:de,QUESTIONS:Ve,LIKES:te}}}}=_,ae=`${ce}${Ve}`;var De={create:async({questionSlug:F},B)=>{try{await q().post(`${ae}/${encodeURIComponent(F)}${de}`,B)}catch(D){const V=await H(D);throw new Error(V)}},remove:async({questionSlug:F,answerSlug:B})=>{try{await q().delete(`${ae}/${encodeURIComponent(F)}${de}/${encodeURIComponent(B)}`)}catch(D){const V=await H(D);throw new Error(V)}},update:async({questionSlug:F,answerSlug:B},D)=>{try{return await q().put(`${ae}/${encodeURIComponent(F)}${de}/${encodeURIComponent(B)}`,D)}catch(V){const ne=await H(V);throw new Error(ne)}},like:async({questionSlug:F,answerSlug:B},D)=>{try{return await q().post(`${ae}/${encodeURIComponent(F)}${de}/${encodeURIComponent(B)}${te}`,D)}catch(V){const ne=await H(V);throw new Error(ne)}},unlike:async({questionSlug:F,answerSlug:B})=>{try{return await q().delete(`${ae}/${encodeURIComponent(F)}${de}/${encodeURIComponent(B)}${te}`)}catch(D){const V=await H(D);throw new Error(V)}}};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:Ie,ENDPOINTS:{QUESTIONS:Tt}}}}=_,Ct=`${Ie}${Tt}`;var Gt={create:async F=>{try{return await q().post(Ct,F)}catch(B){const D=await H(B);throw new Error(D)}},remove:async({questionSlug:F})=>{try{await q().delete(`${Ct}/${encodeURIComponent(F)}`)}catch(B){const D=await H(B);throw new Error(D)}},update:async({questionSlug:F},B)=>{try{return await q().put(`${Ct}/${encodeURIComponent(F)}`,B)}catch(D){const V=await H(D);throw new Error(V)}}};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:oe,ENDPOINTS:{REPLIES:st,ANSWERS:Je,QUESTIONS:Vt,LIKES:wr}}}}=_,er=`${oe}${Vt}`,kt=({questionSlug:F,answerSlug:B,replySlug:D},V=!1)=>{let ne=`${er}/${encodeURIComponent(F)}${Je}/${encodeURIComponent(B)}${st}`;return D&&(ne=`${ne}/${encodeURIComponent(D)}`,V&&(ne=`${ne}${wr}`)),ne};var yn={create:async({questionSlug:F,answerSlug:B},D)=>{try{return await q().post(kt({questionSlug:F,answerSlug:B}),D)}catch(V){const ne=await H(V);throw new Error(ne)}},update:async({questionSlug:F,answerSlug:B,replySlug:D},V)=>{try{return await q().put(kt({questionSlug:F,answerSlug:B,replySlug:D}),V)}catch(ne){const Ne=await H(ne);throw new Error(Ne)}},remove:async({questionSlug:F,answerSlug:B,replySlug:D})=>{try{await q().delete(kt({questionSlug:F,answerSlug:B,replySlug:D}))}catch(V){const ne=await H(V);throw new Error(ne)}},like:async({questionSlug:F,answerSlug:B,replySlug:D},V)=>{try{await q().post(kt({questionSlug:F,answerSlug:B,replySlug:D},!0),V)}catch(ne){const Ne=await H(ne);throw new Error(Ne)}},unlike:async({questionSlug:F,answerSlug:B,replySlug:D})=>{try{await q().delete(kt({questionSlug:F,answerSlug:B,replySlug:D},!0))}catch(V){const ne=await H(V);throw new Error(ne)}},getReplyUrl:kt};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:Wt,ENDPOINTS:{QUESTIONS:Mt,ANSWERS:Ze,LIKES:zt}}}}=_,yt=`${Wt}${Mt}`;var at={answers:De,questions:Gt,replies:yn,likes:{create:async(F,B)=>{try{return await q().post(`${yt}/${encodeURIComponent(F)}${Ze}/${encodeURIComponent(B)}${zt}`)}catch(D){const V=await H(D);throw new Error(V)}},remove:async(F,B)=>{try{return await q().delete(`${yt}/${encodeURIComponent(F)}${Ze}/${encodeURIComponent(B)}${zt}`)}catch(D){const V=await H(D);throw new Error(V)}}}};const{APIS:{FEATURES_API:{BASE_URL:vn,ENDPOINTS:{FLAGS:x}}}}=_,g=`${vn}${x}`;var E={flags:{read:async F=>{let B=null;try{const{data:D}=await q().get(`${g}/${encodeURIComponent(F)}`);D!=null&&D.name&&(D!=null&&D.featureState)&&(B=D)}catch(D){await H(D)}return B}}};const{APIS:{MANAGEMENT_API:{BASE_URL:C,ENDPOINTS:{ACCOUNTS:L}}}}=_;var j={create:async F=>{try{await q().post(`${C}${L}`,F)}catch(B){throw await H(B),B}},read:async F=>{let B=null;try{({data:B}=await q().get(`${C}${L}/${encodeURIComponent(F)}`))}catch(D){await H(D)}return B},update:async(F,B)=>{try{await q().put(`${C}${L}/${encodeURIComponent(F)}`,B)}catch(D){throw await H(D),D}}};const{APIS:{MANAGEMENT_API:{BASE_URL:z,ENDPOINTS:{BULK_ENROLMENTS:me}}}}=_;var Ce={create:async F=>{try{await q().post(`${z}${me}`,F)}catch(B){throw await H(B),B}}};const{APIS:{MANAGEMENT_API:{BASE_URL:Re,ENDPOINTS:{EVENT_REGISTRATIONS:Pe}}}}=_;var Ee={create:async F=>{try{await q().post(`${Re}${Pe}`,F)}catch(B){const D=await H(B);throw new Error(D)}}};const{APIS:{MANAGEMENT_API:{BASE_URL:Rt,ENDPOINTS:{LOGINS:Hr,LOGIN_PASSWORDLESS:En}}}}=_,Sr=`${Rt}${Hr}`;var _n={accounts:j,bulkEnrolments:Ce,eventRegistrations:Ee,passwordless:{update:async F=>{try{await q().put(`${Sr}/${encodeURIComponent(F)}${En}`)}catch(B){throw await H(B),B}}}};const{APIS:{PAYMENTS_API:{BASE_URL_V2:Tr,ENDPOINTS:{PRODUCTS:bn}}}}=_,wn=`${Tr}${bn}`;var Sn={products:{list:async F=>{let B=[],D=F?{params:F}:{params:{}};try{const{data:V}=await q().get(wn,D);V&&V.length&&(B=V)}catch(V){await H(V)}return B}}};const{APIS:{PEOPLE_API:{BASE_URL_V2:tr,ENDPOINTS:{BULK_ENROLMENTS:li}}}}=_;var Qt={list:async F=>{let B=[];try{const{data:D}=await q().get(`${tr}${li}`,{params:F});D&&D.length&&(B=D)}catch(D){await H(D)}return B}},Eo=h(25);const{OK:_o,MULTIPLE_CHOICES:bo,NOT_FOUND:fi,FORBIDDEN:Tn}=Eo.StatusCodes,We=F=>F>=_o&&F<bo||F===Tn||F===fi,{APIS:{PEOPLE_API:{BASE_URL_V2:xn,ENDPOINTS:{USERS:On}}}}=_,xr=async F=>{let B=null;try{const{data:D}=await q().get(`${xn}${On}/${encodeURIComponent(F)}`,{validateStatus:We});D&&D.id&&(B=D)}catch(D){await H(D)}return B},hi=async F=>{let B=[];try{if(F&&F.length<2)throw new Error("users list method requires at least two ids");const D=F.map(ne=>`ids=${encodeURIComponent(ne)}`).join("&"),V=await q().get(`${xn}${On}?${D}`,{validateStatus:We});V&&V.length&&(B=V)}catch(D){await H(D)}return B};var wo={read:xr,update:async(F,B)=>{let D=!1;try{const{data:V}=await q().put(`${xn}${On}/${encodeURIComponent(F)}`,B);D=!(!V||!V.id)}catch(V){await H(V)}return D},list:hi};const{APIS:{PEOPLE_API:{BASE_URL_V2:et,ENDPOINTS:{USERS:So,USER_LIKES:To}}},USERS:{MYSELF:xo}}=_,Oo=`${et}${So}/${xo}${To}`,An=async F=>{let B=[],D=F?{params:F}:{params:{}};try{const{data:V}=await q().get(Oo,D);V&&V.length&&(B=V)}catch(V){await H(V)}return B};var ht={list:An},Ao={authors:{readQuestionAuthors:async(F,B,D)=>{try{if(F.author=await xr(F.authorId),F.answers&&F.answers.length&&!D.ignoreAnswersAuthors){F.answers.sort((ne,Ne)=>new Date(Ne.updatedAt)-new Date(ne.updatedAt)),F.totalAnswers=F.answers.length;let V=F.answers;if(D.limit&&D.pageNumber){const ne=D.limit*(D.pageNumber-1);V=F.answers.slice(ne,ne+D.limit)}for(let ne of V){ne.author=ne.authorId&&await xr(ne.authorId)||{};const[Ne]=B?await An({contentType:_.CONTENTFUL.ANSWERS.TYPE,contentSlug:ne.slug}):[null];ne.userLiked=!!Ne}F.answers=V}else F.answers||(F.answers=[]);return F}catch(V){throw await H(V),new Error(`Cannot read authors for question: ${V.message}`)}},readAuthors:async(F=[])=>{let B=[];try{if(Array.isArray(F)===!1)throw new Error("authorIds is not an array!");if(F&&F.length===1){const D=await xr(F[0]);D&&B.push(D)}else if(F&&F.length>1){const D=await hi(F);D&&D.length>0&&(B=D)}}catch(D){throw await H(D),new Error(`Cannot read authors: ${D.message}`)}return B}}};const{APIS:{PEOPLE_API:{BASE_URL:Co,ENDPOINTS:{REGISTRATIONS:Ro}}}}=_;var Po={list:async F=>{let B=[];try{const{data:D}=await q().get(`${Co}${Ro}`,{params:F});D&&D.length&&(B=D)}catch(D){await H(D)}return B}};const{APIS:{PEOPLE_API:{BASE_URL_V2:No,ENDPOINTS:{USERS:qr,USER_COURSES:di}}},USERS:{MYSELF:Gr}}=_,xt=`${No}${qr}/${Gr}${di}`;var Cn={create:async F=>{try{await q().post(xt,F)}catch(B){await H(B)}},list:async F=>{let B=[],D=F?{params:F}:{params:{}};try{const{data:V}=await q().get(xt,D);V&&V.length&&(B=V)}catch(V){await H(V)}return B},update:async(F,B)=>{try{await q().put(`${xt}/${F}`,B)}catch(D){await H(D)}}};const{APIS:{PEOPLE_API:{BASE_URL_V2:Io,ENDPOINTS:{USERS:Lo,USER_EVENTS:ko}}},USERS:{MYSELF:Mo}}=_,Fo=`${Io}${Lo}/${Mo}${ko}`;var Vr={list:async F=>{let B=[],D=F?{params:F}:{params:{}};try{const{data:V}=await q().get(Fo,D);V&&V.length&&(B=V)}catch(V){await H(V)}return B}};const{APIS:{PEOPLE_API:{BASE_URL_V2:Rn,ENDPOINTS:{USERS:Or,USER_LESSONS:pi}}},USERS:{MYSELF:mi}}=_,gi=`${Rn}${Or}/${mi}${pi}`;var Do={create:async F=>{let B=null;try{B=await q().post(gi,F)}catch(D){await H(D)}return B},list:async F=>{let B=[],D=F?{params:F}:{params:{}};try{const{data:V}=await q().get(gi,D);V&&V.length&&(B=V)}catch(V){await H(V)}return B}};const{APIS:{PEOPLE_API:{BASE_URL_V2:Bo,ENDPOINTS:{USERS:Uo,USER_PRODUCTS:Pn}}},USERS:{MYSELF:$o}}=_,Nn=`${Bo}${Uo}/${$o}${Pn}`;var Ar={create:async F=>{let B=null;try{B=await q().post(Nn,F)}catch(D){await H(D)}return B},list:async F=>{let B=[],D=F?{params:F}:{params:{}};try{const{data:V}=await q().get(Nn,D);V&&V.length&&(B=V)}catch(V){await H(V)}return B},update:async(F,B)=>{try{await q().put(`${Nn}/${F}`,B)}catch(D){await H(D)}}};const{APIS:{PEOPLE_API:{BASE_URL_V2:Pt,ENDPOINTS:{USERS:Yt,USER_RATINGS:Kt}}},USERS:{MYSELF:jo}}=_,Nt=`${Pt}${Yt}/${jo}${Kt}`;var rr={bulkEnrolments:Qt,handlers:Ao,registrations:Po,users:wo,userCourses:Cn,userEvents:Vr,userLessons:Do,userLikes:ht,userProducts:Ar,userRatings:{create:async F=>{let B=null;try{const{data:D}=await q().post(Nt,F);D!=null&&D.id&&(B=D)}catch(D){await H(D)}return B},update:async(F,B)=>{try{await q().put(`${Nt}/${F}`,B)}catch(D){await H(D)}}}};const{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:Ho,ENDPOINTS:{ENQUIRY_EMAILS:qo}}}}=_;var Go={create:async F=>{let B=null;try{const{data:D}=await q().post(`${Ho}${qo}`,F);D&&(B=D)}catch(D){await H(D)}return B}},yi={forms:{sendEnquiryEmails:async F=>{let B=null;try{const{emailIds:D}=$;B=await zr.emails.create({...D,...F})}catch(D){await H(D)}return B}}};const{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:ut,ENDPOINTS:{USERS:vi,USER_PROPERTIES:Ei}}},USERS:{MYSELF:Wr}}=_;var zr={emails:Go,handlers:yi,userProperties:{update:async(F,B)=>{try{await q().put(`${ut}${vi}/${Wr}${Ei}/${F}`,B)}catch(D){await H(D)}}}},Qr=h(130);const{APIS:{SEARCH_API:{BASE_URL:Vo,ENDPOINTS:{SEARCH:_i}}}}=_,In=`${Vo}${_i}`;var bi={ask:async F=>{try{let B=null;const{data:D}=await q().get(In,{params:{question:F}});return D!=null&&D.answer&&(D!=null&&D.references)&&(D!=null&&D.version)&&(B=D),B}catch(B){const D=await H(B);throw new Error(D)}},stream:(F,B,D)=>{const V=(0,Qr.io)(void 0,{path:"/api/search-api/web-sockets"});function ne(){V.emit("search",{question:F})}function Ne(qe){D(qe),$e(),V.disconnect()}function $e(){V.off("connect",ne),V.off("update",B),V.off("result",Ne)}return V.on("connect",ne),V.on("update",B),V.on("result",Ne),$e}};const{CONTENTFUL:Ft}=_,{CARD_TYPES:Ln}=Ft.CAROUSELS;var Si={read:async(F,B)=>{try{if(!B||!B.sys||!B.sys.id)throw new Error("Invalid link to card");if(!F||!Ln[F])throw new Error("Unsupported card content type");const{INCLUDE:D,SELECT:V}=Ln[F];return await(0,f.getEntry)({content_type:F,"sys.id":B.sys.id,include:D,select:V},{assetDetails:!0})}catch(D){throw await H(D),new Error(`Cannot read carousel card: ${D.message}`)}}};const{CONTENTFUL:Wo}=_,{INCLUDE:y,SELECT:O,TYPE:I}=Wo.EDITORIAL_PAGES;var W={read:async F=>{try{return await(0,f.getEntry)({content_type:I,"fields.slug":F,include:y,select:O})}catch(B){throw await H(B),new Error(`Cannot read editorial page: ${B.message}`)}}};const{CONTENTFUL:ge}=_,{TYPE:le,ORDER:_e,SELECT:be,SKIP:He,LIMIT:Ae,INCLUDE:tt}=ge.QUESTIONS;var ct={read:async F=>{try{return await(0,f.getEntry)({content_type:le,"fields.slug":F,include:2,select:be})}catch(B){throw await H(B),new Error(`Cannot read question: ${B.message}`)}},list:async(F={})=>{try{return await(0,f.getEntries)({content_type:le,include:tt,limit:Ae,order:_e,select:be,skip:He,...F})}catch(B){throw await H(B),new Error(`Cannot list questions: ${B.message}`)}}},Ge=async(F,B,D={ignoreAnswersAuthors:!1})=>{try{let V={};return V=await ct.read(F),V=await rr.handlers.authors.readQuestionAuthors(V,B,D),V}catch(V){throw await H(V),new Error(`Cannot build question: ${V.message}`)}};const{ARTICLES:{TYPE:rt},COURSES:{TYPE:Qe},EVENTS:{TYPE:nr},LISTS:{TYPE:Xt},QUESTIONS:{TYPE:Cr},LEARNING_HUB:{TYPE:ua}}=_.CONTENTFUL,ir=F=>F&&F.url?(Object.assign(F,{aspect:"responsiveCard",query:"q=90&fit=fill"}),F):null,Yr={[rt]:async F=>{const{authorIds:B,authorTag:D,image:V,publishedDate:ne,readingTime:Ne,slug:$e,title:qe}=F,It=await rr.handlers.authors.readAuthors(B),or=It&&It.length?It:D?[D]:null;return{banner:ir(V),contributors:or,publishedDate:ne,readingTime:Ne,slug:$e,title:qe}},[Qe]:async(F,B)=>{const{banner:D,freeCourse:V,partnershipDetails:ne,slug:Ne,title:$e,registered:qe}=F,It={banner:ir(D),slug:Ne,title:$e,pill:V?"free":"premium",registered:!!qe};if(ne){const{partners:or}=ne;It.partner=or&&or.length&&ne.partners[0]}if(qe===void 0&&B){const[or]=await rr.userProducts.list({courseSlug:Ne,isEnrolled:!0,scope:"active"});It.registered=!!or}return It},[nr]:async(F,B)=>{const{bannerImage:D,defaultStartDate:V,isEventOngoing:ne,slug:Ne,speakers:$e,title:qe,registered:It}=F,or=new Date(V),DE=!!or&&or<new Date;if($e&&$e.length)for(const ca of $e)ca.image=(Mu=ca.image)&&Mu.url?`${Mu.url}?w=100&h=100&fit=thumb&f=center`:null;var Mu;const vh={banner:ir(D),dateHasPassed:DE,title:qe,slug:Ne,isOngoingEvent:ne,contributors:$e,startDate:or,registered:!!It};if(It===void 0&&B){const[ca]=await rr.userEvents.list({eventSlug:Ne});vh.registered=!!ca}return vh},[Xt]:async F=>{const{hero:B,slug:D,title:V}=F;return{banner:ir(B),slug:D,title:V}},[Cr]:async F=>{const{answers:B,authorId:D,createdAt:V,slug:ne,title:Ne}=F;let $e=null;if(D){const qe=await rr.users.read(D);qe&&($e=qe)}return{answers:B&&B.length?B.length:0,contributors:$e?[$e]:[],createdAt:V,slug:ne,title:Ne}},[ua]:F=>{const{bannerSection:B,customLabel:D,slug:V,title:ne}=F;return{banner:ir(B.image),slug:V,title:ne,customLabel:D}},people:F=>{const{id:B,name:D,jobTitle:V,location:ne,image:Ne}=F;return{profile:Ne,slug:B,title:D,text:V,secondaryText:ne}}};var IE=async({contentType:F,...B}={},D)=>{try{if(!Yr[F])throw new Error("Content type not supported");if(typeof Yr[F]!="function")throw new Error("No builder function for content type");return F!=="people"&&B.sys&&B.sys.type&&B.sys.type==="Link"&&(B=await Si.read(F,B)),{contentType:F,...await Yr[F](B,D)}}catch(V){throw await H(V),new Error(`Cannot build carousel card: ${V.message}`)}},LE=async(F,B,D={})=>{try{if(!F.replies||F.replies.length===0)return F.replies=[],F;F.replies.sort((ne,Ne)=>new Date(ne.createdAt)-new Date(Ne.createdAt)),F.totalReplies=F.totalReplies||F.replies.length;let V=F.replies;if(D.limit&&D.pageNumber){const ne=D.limit*(D.pageNumber-1);V=F.replies.slice(ne,ne+D.limit)}for(const ne of V){if(ne.authorId===F.authorId){ne.author=F.author,ne.userLiked=!1;continue}ne.author=ne.authorId&&await xr(ne.authorId)||{};const[Ne]=B?await An({contentType:_.CONTENTFUL.REPLIES.TYPE,contentSlug:ne.slug}):[null];ne.userLiked=!!Ne}return F.replies=V,F}catch(V){throw await H(V),new Error(`Cannot build replies for answer: ${V.message}`)}},kE=h(408);const ME=F=>F&&kE.Buffer.from(F,"base64").toString("ascii");function FE({contentContext:F=null,errorsContext:B=null,gtmContext:D=null,origin:V}){try{const ne=(Ne=>{let $e=null;Ne?$e=Ne:typeof window<"u"&&($e=window.origin||window.location.origin),$e||new Error("Cannot select environment: Website not defined");let qe=null;const It=$e.match(w);return It?qe=It[1].split(A)[0]:$e===S?qe=b:$e.includes(v)&&(qe=N),qe||new Error(`Cannot select environment: No rule for website ${$e}`),qe})(V);return F&&(0,f.setContext)(Object.assign({},F,{environment:ne})),B&&(0,p.setContext)(Object.assign({},B,{environment:ne})),D&&((0,m.setContext)(Object.assign({},D,{environment:ne})),(0,m.setupGTM)()),(({environment:Ne})=>{const $e=(qe=>{if(!qe)throw new Error("Cannot map environment: Environment not defined");if(!k[qe])throw new Error(`Cannot map environment: No mapping found for environment ${qe}`);return k[qe]})(Ne);$.emailIds=R[$e]})(Object.assign({},{environment:ne})),ne}catch(ne){console.warn(`Cannot load SDK: ${ne.message}`)}}}(),d}()})})(Eg);var dx=Eg.exports;const ys={Off:"off",On:"on",Cookie:"cookie"},px=e=>{const[t]=vg(),[r,n]=U.useState(null),[i,o]=U.useState(!1),[a,s]=U.useState(ys.Off);return U.useEffect(()=>{e&&dx.features.flags.read(e).then(c=>{s(c.featureState),n(null)}).catch(c=>{s(ys.Off),n(c)})},[e]),U.useEffect(()=>{switch(a){case ys.Off:o(!1);break;case ys.On:o(!0);break;case ys.Cookie:o(!!t[`feature-${e}`]);break;default:o(!1)}},[a,t]),{isFeatureActive:i,error:r}};function mx(e,t,r){var n=this,i=U.useRef(null),o=U.useRef(0),a=U.useRef(null),s=U.useRef([]),c=U.useRef(),l=U.useRef(),u=U.useRef(e),h=U.useRef(!0);U.useEffect(function(){u.current=e},[e]);var d=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var f=!!(r=r||{}).leading,p=!("trailing"in r)||!!r.trailing,m="maxWait"in r,_=m?Math.max(+r.maxWait||0,t):null;U.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var S=U.useMemo(function(){var v=function(R){var $=s.current,G=c.current;return s.current=c.current=null,o.current=R,l.current=u.current.apply(G,$)},w=function(R,$){d&&cancelAnimationFrame(a.current),a.current=d?requestAnimationFrame(R):setTimeout(R,$)},A=function(R){if(!h.current)return!1;var $=R-i.current;return!i.current||$>=t||$<0||m&&R-o.current>=_},b=function(R){return a.current=null,p&&s.current?v(R):(s.current=c.current=null,l.current)},N=function R(){var $=Date.now();if(A($))return b($);if(h.current){var G=t-($-i.current),q=m?Math.min(G,_-($-o.current)):G;w(R,q)}},k=function(){var R=Date.now(),$=A(R);if(s.current=[].slice.call(arguments),c.current=n,i.current=R,$){if(!a.current&&h.current)return o.current=i.current,w(N,t),f?v(i.current):l.current;if(m)return w(N,t),v(i.current)}return a.current||w(N,t),l.current};return k.cancel=function(){a.current&&(d?cancelAnimationFrame(a.current):clearTimeout(a.current)),o.current=0,s.current=i.current=c.current=a.current=null},k.isPending=function(){return!!a.current},k.flush=function(){return a.current?b(Date.now()):l.current},k},[f,m,t,_,p,d]);return S}function mv(e,t,r){var n=r===void 0?{}:r,i=n.leading,o=n.trailing;return mx(e,t,{maxWait:t,leading:i===void 0||i,trailing:o===void 0||o})}let el;const ra=(e=!0,t=!1)=>{if(!e)return;const[r,n]=U.useState(0)||[!1,()=>{}];U.useEffect(()=>(o(),window.addEventListener("resize",a),()=>{clearTimeout(el),a.flush(),window.removeEventListener("resize",a)}),[]);const i=()=>window.innerWidth,o=()=>{n(i())},a=mv(()=>{i()!==r&&(t&&(clearTimeout(el),document.body.classList.add("is-resizing"),el=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),o())},500,{leading:!0});return r},gv=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:r=()=>{},scrollUp:n=()=>{}}})=>{if(!window)return;const[i,o]=U.useState({current:0,past:0})||[!1,()=>{}],[a,s]=U.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];U.useEffect(()=>(c(),window.addEventListener("scroll",l),()=>{l.flush(),window.removeEventListener("scroll",l)}),[]);const c=()=>{const u=window.scrollY,h=i.current,d=u-h,f=d>0?"down":"up";if(o({current:u,past:h}),f==="down"){u>=e+t.down&&!a.scrollDown&&(!a.scrollUp||d>t.up)&&(r(),s({scrollUp:!1,scrollDown:!0}));return}Math.abs(d)>=t.up&&!a.scrollUp&&(n(),s({scrollUp:!0,scrollDown:!1}))},l=mv(()=>{c()},250);return i},gx=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const r=U.useRef(!1);ri(()=>{if(window&&window.location&&window.location.hash){if(r.current)return;const n=document.getElementById(window.location.hash.replace("#",""));n&&(n.scrollIntoView(t?{behavior:"smooth"}:null),r.current=!0)}},e)};var Za={exports:{}};Za.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object Array]",s="[object Boolean]",c="[object Date]",l="[object Error]",u="[object Function]",h="[object GeneratorFunction]",d="[object Map]",f="[object Number]",p="[object Object]",m="[object Promise]",_="[object RegExp]",S="[object Set]",v="[object String]",w="[object Symbol]",A="[object WeakMap]",b="[object ArrayBuffer]",N="[object DataView]",k="[object Float32Array]",R="[object Float64Array]",$="[object Int8Array]",G="[object Int16Array]",q="[object Int32Array]",H="[object Uint8Array]",Y="[object Uint8ClampedArray]",re="[object Uint16Array]",X="[object Uint32Array]",M=/[\\^$.*+?()[\]{}|]/g,Q=/\w*$/,J=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,Z={};Z[o]=Z[a]=Z[b]=Z[N]=Z[s]=Z[c]=Z[k]=Z[R]=Z[$]=Z[G]=Z[q]=Z[d]=Z[f]=Z[p]=Z[_]=Z[S]=Z[v]=Z[w]=Z[H]=Z[Y]=Z[re]=Z[X]=!0,Z[l]=Z[u]=Z[A]=!1;var K=typeof he=="object"&&he&&he.Object===Object&&he,ce=typeof self=="object"&&self&&self.Object===Object&&self,de=K||ce||Function("return this")(),Ve=t&&!t.nodeType&&t,te=Ve&&!0&&e&&!e.nodeType&&e,ae=te&&te.exports===Ve;function De(y,O){return y.set(O[0],O[1]),y}function Ie(y,O){return y.add(O),y}function Tt(y,O){for(var I=-1,W=y?y.length:0;++I<W&&O(y[I],I,y)!==!1;);return y}function Ct(y,O){for(var I=-1,W=O.length,ge=y.length;++I<W;)y[ge+I]=O[I];return y}function Gt(y,O,I,W){var ge=-1,le=y?y.length:0;for(W&&le&&(I=y[++ge]);++ge<le;)I=O(I,y[ge],ge,y);return I}function oe(y,O){for(var I=-1,W=Array(y);++I<y;)W[I]=O(I);return W}function st(y,O){return y==null?void 0:y[O]}function Je(y){var O=!1;if(y!=null&&typeof y.toString!="function")try{O=!!(y+"")}catch{}return O}function Vt(y){var O=-1,I=Array(y.size);return y.forEach(function(W,ge){I[++O]=[ge,W]}),I}function wr(y,O){return function(I){return y(O(I))}}function er(y){var O=-1,I=Array(y.size);return y.forEach(function(W){I[++O]=W}),I}var kt=Array.prototype,yn=Function.prototype,Wt=Object.prototype,Mt=de["__core-js_shared__"],Ze=function(){var y=/[^.]+$/.exec(Mt&&Mt.keys&&Mt.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),zt=yn.toString,yt=Wt.hasOwnProperty,at=Wt.toString,vn=RegExp("^"+zt.call(yt).replace(M,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x=ae?de.Buffer:void 0,g=de.Symbol,E=de.Uint8Array,C=wr(Object.getPrototypeOf,Object),L=Object.create,j=Wt.propertyIsEnumerable,z=kt.splice,me=Object.getOwnPropertySymbols,Ce=x?x.isBuffer:void 0,Re=wr(Object.keys,Object),Pe=Pt(de,"DataView"),Ee=Pt(de,"Map"),Rt=Pt(de,"Promise"),Hr=Pt(de,"Set"),En=Pt(de,"WeakMap"),Sr=Pt(Object,"create"),_n=ut(Pe),Tr=ut(Ee),bn=ut(Rt),wn=ut(Hr),Sn=ut(En),tr=g?g.prototype:void 0,li=tr?tr.valueOf:void 0;function Qt(y){var O=-1,I=y?y.length:0;for(this.clear();++O<I;){var W=y[O];this.set(W[0],W[1])}}function Eo(){this.__data__=Sr?Sr(null):{}}function _o(y){return this.has(y)&&delete this.__data__[y]}function bo(y){var O=this.__data__;if(Sr){var I=O[y];return I===n?void 0:I}return yt.call(O,y)?O[y]:void 0}function fi(y){var O=this.__data__;return Sr?O[y]!==void 0:yt.call(O,y)}function Tn(y,O){var I=this.__data__;return I[y]=Sr&&O===void 0?n:O,this}Qt.prototype.clear=Eo,Qt.prototype.delete=_o,Qt.prototype.get=bo,Qt.prototype.has=fi,Qt.prototype.set=Tn;function We(y){var O=-1,I=y?y.length:0;for(this.clear();++O<I;){var W=y[O];this.set(W[0],W[1])}}function xn(){this.__data__=[]}function On(y){var O=this.__data__,I=Gr(O,y);if(I<0)return!1;var W=O.length-1;return I==W?O.pop():z.call(O,I,1),!0}function xr(y){var O=this.__data__,I=Gr(O,y);return I<0?void 0:O[I][1]}function hi(y){return Gr(this.__data__,y)>-1}function wo(y,O){var I=this.__data__,W=Gr(I,y);return W<0?I.push([y,O]):I[W][1]=O,this}We.prototype.clear=xn,We.prototype.delete=On,We.prototype.get=xr,We.prototype.has=hi,We.prototype.set=wo;function et(y){var O=-1,I=y?y.length:0;for(this.clear();++O<I;){var W=y[O];this.set(W[0],W[1])}}function So(){this.__data__={hash:new Qt,map:new(Ee||We),string:new Qt}}function To(y){return Ar(this,y).delete(y)}function xo(y){return Ar(this,y).get(y)}function Oo(y){return Ar(this,y).has(y)}function An(y,O){return Ar(this,y).set(y,O),this}et.prototype.clear=So,et.prototype.delete=To,et.prototype.get=xo,et.prototype.has=Oo,et.prototype.set=An;function ht(y){this.__data__=new We(y)}function Ao(){this.__data__=new We}function Co(y){return this.__data__.delete(y)}function Ro(y){return this.__data__.get(y)}function Po(y){return this.__data__.has(y)}function No(y,O){var I=this.__data__;if(I instanceof We){var W=I.__data__;if(!Ee||W.length<r-1)return W.push([y,O]),this;I=this.__data__=new et(W)}return I.set(y,O),this}ht.prototype.clear=Ao,ht.prototype.delete=Co,ht.prototype.get=Ro,ht.prototype.has=Po,ht.prototype.set=No;function qr(y,O){var I=zr(y)||Wr(y)?oe(y.length,String):[],W=I.length,ge=!!W;for(var le in y)(O||yt.call(y,le))&&!(ge&&(le=="length"||Ho(le,W)))&&I.push(le);return I}function di(y,O,I){var W=y[O];(!(yt.call(y,O)&&Ei(W,I))||I===void 0&&!(O in y))&&(y[O]=I)}function Gr(y,O){for(var I=y.length;I--;)if(Ei(y[I][0],O))return I;return-1}function xt(y,O){return y&&Pn(O,wi(O),y)}function Cn(y,O,I,W,ge,le,_e){var be;if(W&&(be=le?W(y,ge,le,_e):W(y)),be!==void 0)return be;if(!Ft(y))return y;var He=zr(y);if(He){if(be=jo(y),!O)return Uo(y,be)}else{var Ae=Kt(y),tt=Ae==u||Ae==h;if(_i(y))return Vr(y,O);if(Ae==p||Ae==o||tt&&!le){if(Je(y))return le?y:{};if(be=Nt(tt?{}:y),!O)return $o(y,xt(be,y))}else{if(!Z[Ae])return le?y:{};be=rr(y,Ae,Cn,O)}}_e||(_e=new ht);var ct=_e.get(y);if(ct)return ct;if(_e.set(y,be),!He)var Ge=I?Nn(y):wi(y);return Tt(Ge||y,function(rt,Qe){Ge&&(Qe=rt,rt=y[Qe]),di(be,Qe,Cn(rt,O,I,W,Qe,y,_e))}),be}function Io(y){return Ft(y)?L(y):{}}function Lo(y,O,I){var W=O(y);return zr(y)?W:Ct(W,I(y))}function ko(y){return at.call(y)}function Mo(y){if(!Ft(y)||Go(y))return!1;var O=In(y)||Je(y)?vn:J;return O.test(ut(y))}function Fo(y){if(!yi(y))return Re(y);var O=[];for(var I in Object(y))yt.call(y,I)&&I!="constructor"&&O.push(I);return O}function Vr(y,O){if(O)return y.slice();var I=new y.constructor(y.length);return y.copy(I),I}function Rn(y){var O=new y.constructor(y.byteLength);return new E(O).set(new E(y)),O}function Or(y,O){var I=O?Rn(y.buffer):y.buffer;return new y.constructor(I,y.byteOffset,y.byteLength)}function pi(y,O,I){var W=O?I(Vt(y),!0):Vt(y);return Gt(W,De,new y.constructor)}function mi(y){var O=new y.constructor(y.source,Q.exec(y));return O.lastIndex=y.lastIndex,O}function gi(y,O,I){var W=O?I(er(y),!0):er(y);return Gt(W,Ie,new y.constructor)}function Do(y){return li?Object(li.call(y)):{}}function Bo(y,O){var I=O?Rn(y.buffer):y.buffer;return new y.constructor(I,y.byteOffset,y.length)}function Uo(y,O){var I=-1,W=y.length;for(O||(O=Array(W));++I<W;)O[I]=y[I];return O}function Pn(y,O,I,W){I||(I={});for(var ge=-1,le=O.length;++ge<le;){var _e=O[ge],be=W?W(I[_e],y[_e],_e,I,y):void 0;di(I,_e,be===void 0?y[_e]:be)}return I}function $o(y,O){return Pn(y,Yt(y),O)}function Nn(y){return Lo(y,wi,Yt)}function Ar(y,O){var I=y.__data__;return qo(O)?I[typeof O=="string"?"string":"hash"]:I.map}function Pt(y,O){var I=st(y,O);return Mo(I)?I:void 0}var Yt=me?wr(me,Object):Si,Kt=ko;(Pe&&Kt(new Pe(new ArrayBuffer(1)))!=N||Ee&&Kt(new Ee)!=d||Rt&&Kt(Rt.resolve())!=m||Hr&&Kt(new Hr)!=S||En&&Kt(new En)!=A)&&(Kt=function(y){var O=at.call(y),I=O==p?y.constructor:void 0,W=I?ut(I):void 0;if(W)switch(W){case _n:return N;case Tr:return d;case bn:return m;case wn:return S;case Sn:return A}return O});function jo(y){var O=y.length,I=y.constructor(O);return O&&typeof y[0]=="string"&&yt.call(y,"index")&&(I.index=y.index,I.input=y.input),I}function Nt(y){return typeof y.constructor=="function"&&!yi(y)?Io(C(y)):{}}function rr(y,O,I,W){var ge=y.constructor;switch(O){case b:return Rn(y);case s:case c:return new ge(+y);case N:return Or(y,W);case k:case R:case $:case G:case q:case H:case Y:case re:case X:return Bo(y,W);case d:return pi(y,W,I);case f:case v:return new ge(y);case _:return mi(y);case S:return gi(y,W,I);case w:return Do(y)}}function Ho(y,O){return O=O??i,!!O&&(typeof y=="number"||fe.test(y))&&y>-1&&y%1==0&&y<O}function qo(y){var O=typeof y;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?y!=="__proto__":y===null}function Go(y){return!!Ze&&Ze in y}function yi(y){var O=y&&y.constructor,I=typeof O=="function"&&O.prototype||Wt;return y===I}function ut(y){if(y!=null){try{return zt.call(y)}catch{}try{return y+""}catch{}}return""}function vi(y){return Cn(y,!0,!0)}function Ei(y,O){return y===O||y!==y&&O!==O}function Wr(y){return Vo(y)&&yt.call(y,"callee")&&(!j.call(y,"callee")||at.call(y)==o)}var zr=Array.isArray;function Qr(y){return y!=null&&bi(y.length)&&!In(y)}function Vo(y){return Ln(y)&&Qr(y)}var _i=Ce||Wo;function In(y){var O=Ft(y)?at.call(y):"";return O==u||O==h}function bi(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=i}function Ft(y){var O=typeof y;return!!y&&(O=="object"||O=="function")}function Ln(y){return!!y&&typeof y=="object"}function wi(y){return Qr(y)?qr(y):Fo(y)}function Si(){return[]}function Wo(){return!1}e.exports=vi})(Za,Za.exports);var yx=Za.exports;const vx=Er(yx);var Ex="Expected a function",yv="__lodash_hash_undefined__",vv=1/0,_x=9007199254740991,bx="[object Function]",wx="[object GeneratorFunction]",Sx="[object Symbol]",Tx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xx=/^\w*$/,Ox=/^\./,Ax=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Cx=/[\\^$.*+?()[\]{}|]/g,Rx=/\\(\\)?/g,Px=/^\[object .+?Constructor\]$/,Nx=/^(?:0|[1-9]\d*)$/,Ix=typeof he=="object"&&he&&he.Object===Object&&he,Lx=typeof self=="object"&&self&&self.Object===Object&&self,jf=Ix||Lx||Function("return this")();function kx(e,t){return e==null?void 0:e[t]}function Mx(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var Fx=Array.prototype,Dx=Function.prototype,Ev=Object.prototype,tl=jf["__core-js_shared__"],tm=function(){var e=/[^.]+$/.exec(tl&&tl.keys&&tl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),_v=Dx.toString,bu=Ev.hasOwnProperty,bv=Ev.toString,Bx=RegExp("^"+_v.call(bu).replace(Cx,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rm=jf.Symbol,Ux=Fx.splice,$x=wv(jf,"Map"),Cs=wv(Object,"create"),nm=rm?rm.prototype:void 0,im=nm?nm.toString:void 0;function ni(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function jx(){this.__data__=Cs?Cs(null):{}}function Hx(e){return this.has(e)&&delete this.__data__[e]}function qx(e){var t=this.__data__;if(Cs){var r=t[e];return r===yv?void 0:r}return bu.call(t,e)?t[e]:void 0}function Gx(e){var t=this.__data__;return Cs?t[e]!==void 0:bu.call(t,e)}function Vx(e,t){var r=this.__data__;return r[e]=Cs&&t===void 0?yv:t,this}ni.prototype.clear=jx;ni.prototype.delete=Hx;ni.prototype.get=qx;ni.prototype.has=Gx;ni.prototype.set=Vx;function po(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Wx(){this.__data__=[]}function zx(e){var t=this.__data__,r=wu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Ux.call(t,r,1),!0}function Qx(e){var t=this.__data__,r=wu(t,e);return r<0?void 0:t[r][1]}function Yx(e){return wu(this.__data__,e)>-1}function Kx(e,t){var r=this.__data__,n=wu(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}po.prototype.clear=Wx;po.prototype.delete=zx;po.prototype.get=Qx;po.prototype.has=Yx;po.prototype.set=Kx;function ai(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Xx(){this.__data__={hash:new ni,map:new($x||po),string:new ni}}function Jx(e){return Su(this,e).delete(e)}function Zx(e){return Su(this,e).get(e)}function eO(e){return Su(this,e).has(e)}function tO(e,t){return Su(this,e).set(e,t),this}ai.prototype.clear=Xx;ai.prototype.delete=Jx;ai.prototype.get=Zx;ai.prototype.has=eO;ai.prototype.set=tO;function rO(e,t,r){var n=e[t];(!(bu.call(e,t)&&Sv(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function wu(e,t){for(var r=e.length;r--;)if(Sv(e[r][0],t))return r;return-1}function nO(e){if(!eu(e)||lO(e))return!1;var t=pO(e)||Mx(e)?Bx:Px;return t.test(dO(e))}function iO(e,t,r,n){if(!eu(e))return e;t=uO(t,e)?[t]:sO(t);for(var i=-1,o=t.length,a=o-1,s=e;s!=null&&++i<o;){var c=hO(t[i]),l=r;if(i!=a){var u=s[c];l=n?n(u,c,s):void 0,l===void 0&&(l=eu(u)?u:aO(t[i+1])?[]:{})}rO(s,c,l),s=s[c]}return e}function oO(e){if(typeof e=="string")return e;if(qf(e))return im?im.call(e):"";var t=e+"";return t=="0"&&1/e==-vv?"-0":t}function sO(e){return Tv(e)?e:fO(e)}function Su(e,t){var r=e.__data__;return cO(t)?r[typeof t=="string"?"string":"hash"]:r.map}function wv(e,t){var r=kx(e,t);return nO(r)?r:void 0}function aO(e,t){return t=t??_x,!!t&&(typeof e=="number"||Nx.test(e))&&e>-1&&e%1==0&&e<t}function uO(e,t){if(Tv(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||qf(e)?!0:xx.test(e)||!Tx.test(e)||t!=null&&e in Object(t)}function cO(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function lO(e){return!!tm&&tm in e}var fO=Hf(function(e){e=gO(e);var t=[];return Ox.test(e)&&t.push(""),e.replace(Ax,function(r,n,i,o){t.push(i?o.replace(Rx,"$1"):n||r)}),t});function hO(e){if(typeof e=="string"||qf(e))return e;var t=e+"";return t=="0"&&1/e==-vv?"-0":t}function dO(e){if(e!=null){try{return _v.call(e)}catch{}try{return e+""}catch{}}return""}function Hf(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(Ex);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a),a};return r.cache=new(Hf.Cache||ai),r}Hf.Cache=ai;function Sv(e,t){return e===t||e!==e&&t!==t}var Tv=Array.isArray;function pO(e){var t=eu(e)?bv.call(e):"";return t==bx||t==wx}function eu(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function mO(e){return!!e&&typeof e=="object"}function qf(e){return typeof e=="symbol"||mO(e)&&bv.call(e)==Sx}function gO(e){return e==null?"":oO(e)}function yO(e,t,r){return e==null?e:iO(e,t,r)}var vO=yO;const EO=Er(vO),_O=(e,t)=>{Array.isArray(t)||(t=[t]);const r=vx(e);return t.forEach(({type:n,value:i})=>{EO(r,n,i)}),r},xv=e=>{const t=[];return e.forEach(r=>{const n=parseInt(r);isNaN(n)||t.push(n)}),t.sort((r,n)=>r-n)},Ov=(e,t,r)=>{let n=r.mobile;for(const i in t){const o=parseInt(String(t[i]));if(e>=o)n=r[o];else if(e<o)break}return n},bO=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),wO=e=>{let o;try{o=new Date().getTime()-new Date(e).getTime()}catch{return""}const a=o/36e5,s=Math.floor(o/864e5);if(s<1)return a<1?{path:"now"}:{path:"hours",number:Math.floor(a)};if(s<7)return{path:"days",number:s};const c=Math.floor(s/7);return c<=52?{path:"weeks",number:c}:{path:"years",number:Math.floor(s/365)}},SO=e=>new Promise(t=>setTimeout(t,e)),Gf={apolitical:"Apolitical",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",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",collapsibleSection_summary:"Find out more",communityDetails_members:"Members",communityDetails_viewAll:"View all",communityDetails_invite:"Invite colleagues",communityGeneral_join_to_post:"Join community to create a post.",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",dates_now:"now",dates_hours:"{number}h",dates_days:"{number}d",dates_weeks:"{number}w",dates_years:"{number}y",discussion_action_answer:"answer",discussion_action_comment:"comment",discussion_action_post:"post",discussion_action_response:"response",discussion_action_reply:"reply",discussion_action_question:"question",discussion_edited:"Edited",discussion_delete_title:"Delete {action}",discussion_delete_text:"<p>Are you sure you want to delete your {action}?</p><p>This can't be undone.</p>",discussion_delete_cancel:"Cancel",discussion_delete_delete:"Delete",discussion_delete_error:"We are unable to delete your {action} at the moment. Please try again later or contact us if problem persists.",discussion_reply:"Reply",discussion_report_subject:"Report a post on Apolitical",discussion_report_body:`I'd like to report the {contentType} <{contentSlug}> at {contentUrl}.
61
+ */var em;function hx(){return em||(em=1,function(e){const t=lx(),r=fx(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=o(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const x=new Uint8Array(1),g={foo:function(){return 42}};return Object.setPrototypeOf(g,Uint8Array.prototype),Object.setPrototypeOf(x,g),x.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function a(x){if(x>i)throw new RangeError('The value "'+x+'" is invalid for option "size"');const g=new Uint8Array(x);return Object.setPrototypeOf(g,s.prototype),g}function s(x,g,E){if(typeof x=="number"){if(typeof g=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(x)}return c(x,g,E)}s.poolSize=8192;function c(x,g,E){if(typeof x=="string")return d(x,g);if(ArrayBuffer.isView(x))return p(x);if(x==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x);if(Ze(x,ArrayBuffer)||x&&Ze(x.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ze(x,SharedArrayBuffer)||x&&Ze(x.buffer,SharedArrayBuffer)))return m(x,g,E);if(typeof x=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const C=x.valueOf&&x.valueOf();if(C!=null&&C!==x)return s.from(C,g,E);const L=_(x);if(L)return L;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof x[Symbol.toPrimitive]=="function")return s.from(x[Symbol.toPrimitive]("string"),g,E);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x)}s.from=function(x,g,E){return c(x,g,E)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(x){if(typeof x!="number")throw new TypeError('"size" argument must be of type number');if(x<0)throw new RangeError('The value "'+x+'" is invalid for option "size"')}function u(x,g,E){return l(x),x<=0?a(x):g!==void 0?typeof E=="string"?a(x).fill(g,E):a(x).fill(g):a(x)}s.alloc=function(x,g,E){return u(x,g,E)};function h(x){return l(x),a(x<0?0:S(x)|0)}s.allocUnsafe=function(x){return h(x)},s.allocUnsafeSlow=function(x){return h(x)};function d(x,g){if((typeof g!="string"||g==="")&&(g="utf8"),!s.isEncoding(g))throw new TypeError("Unknown encoding: "+g);const E=w(x,g)|0;let C=a(E);const L=C.write(x,g);return L!==E&&(C=C.slice(0,L)),C}function f(x){const g=x.length<0?0:S(x.length)|0,E=a(g);for(let C=0;C<g;C+=1)E[C]=x[C]&255;return E}function p(x){if(Ze(x,Uint8Array)){const g=new Uint8Array(x);return m(g.buffer,g.byteOffset,g.byteLength)}return f(x)}function m(x,g,E){if(g<0||x.byteLength<g)throw new RangeError('"offset" is outside of buffer bounds');if(x.byteLength<g+(E||0))throw new RangeError('"length" is outside of buffer bounds');let C;return g===void 0&&E===void 0?C=new Uint8Array(x):E===void 0?C=new Uint8Array(x,g):C=new Uint8Array(x,g,E),Object.setPrototypeOf(C,s.prototype),C}function _(x){if(s.isBuffer(x)){const g=S(x.length)|0,E=a(g);return E.length===0||x.copy(E,0,0,g),E}if(x.length!==void 0)return typeof x.length!="number"||zt(x.length)?a(0):f(x);if(x.type==="Buffer"&&Array.isArray(x.data))return f(x.data)}function S(x){if(x>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return x|0}function v(x){return+x!=x&&(x=0),s.alloc(+x)}s.isBuffer=function(g){return g!=null&&g._isBuffer===!0&&g!==s.prototype},s.compare=function(g,E){if(Ze(g,Uint8Array)&&(g=s.from(g,g.offset,g.byteLength)),Ze(E,Uint8Array)&&(E=s.from(E,E.offset,E.byteLength)),!s.isBuffer(g)||!s.isBuffer(E))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(g===E)return 0;let C=g.length,L=E.length;for(let j=0,z=Math.min(C,L);j<z;++j)if(g[j]!==E[j]){C=g[j],L=E[j];break}return C<L?-1:L<C?1:0},s.isEncoding=function(g){switch(String(g).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(g,E){if(!Array.isArray(g))throw new TypeError('"list" argument must be an Array of Buffers');if(g.length===0)return s.alloc(0);let C;if(E===void 0)for(E=0,C=0;C<g.length;++C)E+=g[C].length;const L=s.allocUnsafe(E);let j=0;for(C=0;C<g.length;++C){let z=g[C];if(Ze(z,Uint8Array))j+z.length>L.length?(s.isBuffer(z)||(z=s.from(z)),z.copy(L,j)):Uint8Array.prototype.set.call(L,z,j);else if(s.isBuffer(z))z.copy(L,j);else throw new TypeError('"list" argument must be an Array of Buffers');j+=z.length}return L};function w(x,g){if(s.isBuffer(x))return x.length;if(ArrayBuffer.isView(x)||Ze(x,ArrayBuffer))return x.byteLength;if(typeof x!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof x);const E=x.length,C=arguments.length>2&&arguments[2]===!0;if(!C&&E===0)return 0;let L=!1;for(;;)switch(g){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return er(x).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return Wt(x).length;default:if(L)return C?-1:er(x).length;g=(""+g).toLowerCase(),L=!0}}s.byteLength=w;function A(x,g,E){let C=!1;if((g===void 0||g<0)&&(g=0),g>this.length||((E===void 0||E>this.length)&&(E=this.length),E<=0)||(E>>>=0,g>>>=0,E<=g))return"";for(x||(x="utf8");;)switch(x){case"hex":return fe(this,g,E);case"utf8":case"utf-8":return re(this,g,E);case"ascii":return Q(this,g,E);case"latin1":case"binary":return J(this,g,E);case"base64":return Y(this,g,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,g,E);default:if(C)throw new TypeError("Unknown encoding: "+x);x=(x+"").toLowerCase(),C=!0}}s.prototype._isBuffer=!0;function b(x,g,E){const C=x[g];x[g]=x[E],x[E]=C}s.prototype.swap16=function(){const g=this.length;if(g%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let E=0;E<g;E+=2)b(this,E,E+1);return this},s.prototype.swap32=function(){const g=this.length;if(g%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let E=0;E<g;E+=4)b(this,E,E+3),b(this,E+1,E+2);return this},s.prototype.swap64=function(){const g=this.length;if(g%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let E=0;E<g;E+=8)b(this,E,E+7),b(this,E+1,E+6),b(this,E+2,E+5),b(this,E+3,E+4);return this},s.prototype.toString=function(){const g=this.length;return g===0?"":arguments.length===0?re(this,0,g):A.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(g){if(!s.isBuffer(g))throw new TypeError("Argument must be a Buffer");return this===g?!0:s.compare(this,g)===0},s.prototype.inspect=function(){let g="";const E=e.INSPECT_MAX_BYTES;return g=this.toString("hex",0,E).replace(/(.{2})/g,"$1 ").trim(),this.length>E&&(g+=" ... "),"<Buffer "+g+">"},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(g,E,C,L,j){if(Ze(g,Uint8Array)&&(g=s.from(g,g.offset,g.byteLength)),!s.isBuffer(g))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof g);if(E===void 0&&(E=0),C===void 0&&(C=g?g.length:0),L===void 0&&(L=0),j===void 0&&(j=this.length),E<0||C>g.length||L<0||j>this.length)throw new RangeError("out of range index");if(L>=j&&E>=C)return 0;if(L>=j)return-1;if(E>=C)return 1;if(E>>>=0,C>>>=0,L>>>=0,j>>>=0,this===g)return 0;let z=j-L,me=C-E;const Ce=Math.min(z,me),Re=this.slice(L,j),Pe=g.slice(E,C);for(let Ee=0;Ee<Ce;++Ee)if(Re[Ee]!==Pe[Ee]){z=Re[Ee],me=Pe[Ee];break}return z<me?-1:me<z?1:0};function N(x,g,E,C,L){if(x.length===0)return-1;if(typeof E=="string"?(C=E,E=0):E>2147483647?E=2147483647:E<-2147483648&&(E=-2147483648),E=+E,zt(E)&&(E=L?0:x.length-1),E<0&&(E=x.length+E),E>=x.length){if(L)return-1;E=x.length-1}else if(E<0)if(L)E=0;else return-1;if(typeof g=="string"&&(g=s.from(g,C)),s.isBuffer(g))return g.length===0?-1:k(x,g,E,C,L);if(typeof g=="number")return g=g&255,typeof Uint8Array.prototype.indexOf=="function"?L?Uint8Array.prototype.indexOf.call(x,g,E):Uint8Array.prototype.lastIndexOf.call(x,g,E):k(x,[g],E,C,L);throw new TypeError("val must be string, number or Buffer")}function k(x,g,E,C,L){let j=1,z=x.length,me=g.length;if(C!==void 0&&(C=String(C).toLowerCase(),C==="ucs2"||C==="ucs-2"||C==="utf16le"||C==="utf-16le")){if(x.length<2||g.length<2)return-1;j=2,z/=2,me/=2,E/=2}function Ce(Pe,Ee){return j===1?Pe[Ee]:Pe.readUInt16BE(Ee*j)}let Re;if(L){let Pe=-1;for(Re=E;Re<z;Re++)if(Ce(x,Re)===Ce(g,Pe===-1?0:Re-Pe)){if(Pe===-1&&(Pe=Re),Re-Pe+1===me)return Pe*j}else Pe!==-1&&(Re-=Re-Pe),Pe=-1}else for(E+me>z&&(E=z-me),Re=E;Re>=0;Re--){let Pe=!0;for(let Ee=0;Ee<me;Ee++)if(Ce(x,Re+Ee)!==Ce(g,Ee)){Pe=!1;break}if(Pe)return Re}return-1}s.prototype.includes=function(g,E,C){return this.indexOf(g,E,C)!==-1},s.prototype.indexOf=function(g,E,C){return N(this,g,E,C,!0)},s.prototype.lastIndexOf=function(g,E,C){return N(this,g,E,C,!1)};function R(x,g,E,C){E=Number(E)||0;const L=x.length-E;C?(C=Number(C),C>L&&(C=L)):C=L;const j=g.length;C>j/2&&(C=j/2);let z;for(z=0;z<C;++z){const me=parseInt(g.substr(z*2,2),16);if(zt(me))return z;x[E+z]=me}return z}function $(x,g,E,C){return Mt(er(g,x.length-E),x,E,C)}function G(x,g,E,C){return Mt(kt(g),x,E,C)}function q(x,g,E,C){return Mt(Wt(g),x,E,C)}function H(x,g,E,C){return Mt(yn(g,x.length-E),x,E,C)}s.prototype.write=function(g,E,C,L){if(E===void 0)L="utf8",C=this.length,E=0;else if(C===void 0&&typeof E=="string")L=E,C=this.length,E=0;else if(isFinite(E))E=E>>>0,isFinite(C)?(C=C>>>0,L===void 0&&(L="utf8")):(L=C,C=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const j=this.length-E;if((C===void 0||C>j)&&(C=j),g.length>0&&(C<0||E<0)||E>this.length)throw new RangeError("Attempt to write outside buffer bounds");L||(L="utf8");let z=!1;for(;;)switch(L){case"hex":return R(this,g,E,C);case"utf8":case"utf-8":return $(this,g,E,C);case"ascii":case"latin1":case"binary":return G(this,g,E,C);case"base64":return q(this,g,E,C);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,g,E,C);default:if(z)throw new TypeError("Unknown encoding: "+L);L=(""+L).toLowerCase(),z=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Y(x,g,E){return g===0&&E===x.length?t.fromByteArray(x):t.fromByteArray(x.slice(g,E))}function re(x,g,E){E=Math.min(x.length,E);const C=[];let L=g;for(;L<E;){const j=x[L];let z=null,me=j>239?4:j>223?3:j>191?2:1;if(L+me<=E){let Ce,Re,Pe,Ee;switch(me){case 1:j<128&&(z=j);break;case 2:Ce=x[L+1],(Ce&192)===128&&(Ee=(j&31)<<6|Ce&63,Ee>127&&(z=Ee));break;case 3:Ce=x[L+1],Re=x[L+2],(Ce&192)===128&&(Re&192)===128&&(Ee=(j&15)<<12|(Ce&63)<<6|Re&63,Ee>2047&&(Ee<55296||Ee>57343)&&(z=Ee));break;case 4:Ce=x[L+1],Re=x[L+2],Pe=x[L+3],(Ce&192)===128&&(Re&192)===128&&(Pe&192)===128&&(Ee=(j&15)<<18|(Ce&63)<<12|(Re&63)<<6|Pe&63,Ee>65535&&Ee<1114112&&(z=Ee))}}z===null?(z=65533,me=1):z>65535&&(z-=65536,C.push(z>>>10&1023|55296),z=56320|z&1023),C.push(z),L+=me}return M(C)}const X=4096;function M(x){const g=x.length;if(g<=X)return String.fromCharCode.apply(String,x);let E="",C=0;for(;C<g;)E+=String.fromCharCode.apply(String,x.slice(C,C+=X));return E}function Q(x,g,E){let C="";E=Math.min(x.length,E);for(let L=g;L<E;++L)C+=String.fromCharCode(x[L]&127);return C}function J(x,g,E){let C="";E=Math.min(x.length,E);for(let L=g;L<E;++L)C+=String.fromCharCode(x[L]);return C}function fe(x,g,E){const C=x.length;(!g||g<0)&&(g=0),(!E||E<0||E>C)&&(E=C);let L="";for(let j=g;j<E;++j)L+=yt[x[j]];return L}function Z(x,g,E){const C=x.slice(g,E);let L="";for(let j=0;j<C.length-1;j+=2)L+=String.fromCharCode(C[j]+C[j+1]*256);return L}s.prototype.slice=function(g,E){const C=this.length;g=~~g,E=E===void 0?C:~~E,g<0?(g+=C,g<0&&(g=0)):g>C&&(g=C),E<0?(E+=C,E<0&&(E=0)):E>C&&(E=C),E<g&&(E=g);const L=this.subarray(g,E);return Object.setPrototypeOf(L,s.prototype),L};function K(x,g,E){if(x%1!==0||x<0)throw new RangeError("offset is not uint");if(x+g>E)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(g,E,C){g=g>>>0,E=E>>>0,C||K(g,E,this.length);let L=this[g],j=1,z=0;for(;++z<E&&(j*=256);)L+=this[g+z]*j;return L},s.prototype.readUintBE=s.prototype.readUIntBE=function(g,E,C){g=g>>>0,E=E>>>0,C||K(g,E,this.length);let L=this[g+--E],j=1;for(;E>0&&(j*=256);)L+=this[g+--E]*j;return L},s.prototype.readUint8=s.prototype.readUInt8=function(g,E){return g=g>>>0,E||K(g,1,this.length),this[g]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(g,E){return g=g>>>0,E||K(g,2,this.length),this[g]|this[g+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(g,E){return g=g>>>0,E||K(g,2,this.length),this[g]<<8|this[g+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(g,E){return g=g>>>0,E||K(g,4,this.length),(this[g]|this[g+1]<<8|this[g+2]<<16)+this[g+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(g,E){return g=g>>>0,E||K(g,4,this.length),this[g]*16777216+(this[g+1]<<16|this[g+2]<<8|this[g+3])},s.prototype.readBigUInt64LE=at(function(g){g=g>>>0,st(g,"offset");const E=this[g],C=this[g+7];(E===void 0||C===void 0)&&Je(g,this.length-8);const L=E+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24,j=this[++g]+this[++g]*2**8+this[++g]*2**16+C*2**24;return BigInt(L)+(BigInt(j)<<BigInt(32))}),s.prototype.readBigUInt64BE=at(function(g){g=g>>>0,st(g,"offset");const E=this[g],C=this[g+7];(E===void 0||C===void 0)&&Je(g,this.length-8);const L=E*2**24+this[++g]*2**16+this[++g]*2**8+this[++g],j=this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+C;return(BigInt(L)<<BigInt(32))+BigInt(j)}),s.prototype.readIntLE=function(g,E,C){g=g>>>0,E=E>>>0,C||K(g,E,this.length);let L=this[g],j=1,z=0;for(;++z<E&&(j*=256);)L+=this[g+z]*j;return j*=128,L>=j&&(L-=Math.pow(2,8*E)),L},s.prototype.readIntBE=function(g,E,C){g=g>>>0,E=E>>>0,C||K(g,E,this.length);let L=E,j=1,z=this[g+--L];for(;L>0&&(j*=256);)z+=this[g+--L]*j;return j*=128,z>=j&&(z-=Math.pow(2,8*E)),z},s.prototype.readInt8=function(g,E){return g=g>>>0,E||K(g,1,this.length),this[g]&128?(255-this[g]+1)*-1:this[g]},s.prototype.readInt16LE=function(g,E){g=g>>>0,E||K(g,2,this.length);const C=this[g]|this[g+1]<<8;return C&32768?C|4294901760:C},s.prototype.readInt16BE=function(g,E){g=g>>>0,E||K(g,2,this.length);const C=this[g+1]|this[g]<<8;return C&32768?C|4294901760:C},s.prototype.readInt32LE=function(g,E){return g=g>>>0,E||K(g,4,this.length),this[g]|this[g+1]<<8|this[g+2]<<16|this[g+3]<<24},s.prototype.readInt32BE=function(g,E){return g=g>>>0,E||K(g,4,this.length),this[g]<<24|this[g+1]<<16|this[g+2]<<8|this[g+3]},s.prototype.readBigInt64LE=at(function(g){g=g>>>0,st(g,"offset");const E=this[g],C=this[g+7];(E===void 0||C===void 0)&&Je(g,this.length-8);const L=this[g+4]+this[g+5]*2**8+this[g+6]*2**16+(C<<24);return(BigInt(L)<<BigInt(32))+BigInt(E+this[++g]*2**8+this[++g]*2**16+this[++g]*2**24)}),s.prototype.readBigInt64BE=at(function(g){g=g>>>0,st(g,"offset");const E=this[g],C=this[g+7];(E===void 0||C===void 0)&&Je(g,this.length-8);const L=(E<<24)+this[++g]*2**16+this[++g]*2**8+this[++g];return(BigInt(L)<<BigInt(32))+BigInt(this[++g]*2**24+this[++g]*2**16+this[++g]*2**8+C)}),s.prototype.readFloatLE=function(g,E){return g=g>>>0,E||K(g,4,this.length),r.read(this,g,!0,23,4)},s.prototype.readFloatBE=function(g,E){return g=g>>>0,E||K(g,4,this.length),r.read(this,g,!1,23,4)},s.prototype.readDoubleLE=function(g,E){return g=g>>>0,E||K(g,8,this.length),r.read(this,g,!0,52,8)},s.prototype.readDoubleBE=function(g,E){return g=g>>>0,E||K(g,8,this.length),r.read(this,g,!1,52,8)};function ce(x,g,E,C,L,j){if(!s.isBuffer(x))throw new TypeError('"buffer" argument must be a Buffer instance');if(g>L||g<j)throw new RangeError('"value" argument is out of bounds');if(E+C>x.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(g,E,C,L){if(g=+g,E=E>>>0,C=C>>>0,!L){const me=Math.pow(2,8*C)-1;ce(this,g,E,C,me,0)}let j=1,z=0;for(this[E]=g&255;++z<C&&(j*=256);)this[E+z]=g/j&255;return E+C},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(g,E,C,L){if(g=+g,E=E>>>0,C=C>>>0,!L){const me=Math.pow(2,8*C)-1;ce(this,g,E,C,me,0)}let j=C-1,z=1;for(this[E+j]=g&255;--j>=0&&(z*=256);)this[E+j]=g/z&255;return E+C},s.prototype.writeUint8=s.prototype.writeUInt8=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,1,255,0),this[E]=g&255,E+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,2,65535,0),this[E]=g&255,this[E+1]=g>>>8,E+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,2,65535,0),this[E]=g>>>8,this[E+1]=g&255,E+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,4,4294967295,0),this[E+3]=g>>>24,this[E+2]=g>>>16,this[E+1]=g>>>8,this[E]=g&255,E+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,4,4294967295,0),this[E]=g>>>24,this[E+1]=g>>>16,this[E+2]=g>>>8,this[E+3]=g&255,E+4};function de(x,g,E,C,L){oe(g,C,L,x,E,7);let j=Number(g&BigInt(4294967295));x[E++]=j,j=j>>8,x[E++]=j,j=j>>8,x[E++]=j,j=j>>8,x[E++]=j;let z=Number(g>>BigInt(32)&BigInt(4294967295));return x[E++]=z,z=z>>8,x[E++]=z,z=z>>8,x[E++]=z,z=z>>8,x[E++]=z,E}function Ve(x,g,E,C,L){oe(g,C,L,x,E,7);let j=Number(g&BigInt(4294967295));x[E+7]=j,j=j>>8,x[E+6]=j,j=j>>8,x[E+5]=j,j=j>>8,x[E+4]=j;let z=Number(g>>BigInt(32)&BigInt(4294967295));return x[E+3]=z,z=z>>8,x[E+2]=z,z=z>>8,x[E+1]=z,z=z>>8,x[E]=z,E+8}s.prototype.writeBigUInt64LE=at(function(g,E=0){return de(this,g,E,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=at(function(g,E=0){return Ve(this,g,E,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(g,E,C,L){if(g=+g,E=E>>>0,!L){const Ce=Math.pow(2,8*C-1);ce(this,g,E,C,Ce-1,-Ce)}let j=0,z=1,me=0;for(this[E]=g&255;++j<C&&(z*=256);)g<0&&me===0&&this[E+j-1]!==0&&(me=1),this[E+j]=(g/z>>0)-me&255;return E+C},s.prototype.writeIntBE=function(g,E,C,L){if(g=+g,E=E>>>0,!L){const Ce=Math.pow(2,8*C-1);ce(this,g,E,C,Ce-1,-Ce)}let j=C-1,z=1,me=0;for(this[E+j]=g&255;--j>=0&&(z*=256);)g<0&&me===0&&this[E+j+1]!==0&&(me=1),this[E+j]=(g/z>>0)-me&255;return E+C},s.prototype.writeInt8=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,1,127,-128),g<0&&(g=255+g+1),this[E]=g&255,E+1},s.prototype.writeInt16LE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,2,32767,-32768),this[E]=g&255,this[E+1]=g>>>8,E+2},s.prototype.writeInt16BE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,2,32767,-32768),this[E]=g>>>8,this[E+1]=g&255,E+2},s.prototype.writeInt32LE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,4,2147483647,-2147483648),this[E]=g&255,this[E+1]=g>>>8,this[E+2]=g>>>16,this[E+3]=g>>>24,E+4},s.prototype.writeInt32BE=function(g,E,C){return g=+g,E=E>>>0,C||ce(this,g,E,4,2147483647,-2147483648),g<0&&(g=4294967295+g+1),this[E]=g>>>24,this[E+1]=g>>>16,this[E+2]=g>>>8,this[E+3]=g&255,E+4},s.prototype.writeBigInt64LE=at(function(g,E=0){return de(this,g,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=at(function(g,E=0){return Ve(this,g,E,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function te(x,g,E,C,L,j){if(E+C>x.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("Index out of range")}function ae(x,g,E,C,L){return g=+g,E=E>>>0,L||te(x,g,E,4),r.write(x,g,E,C,23,4),E+4}s.prototype.writeFloatLE=function(g,E,C){return ae(this,g,E,!0,C)},s.prototype.writeFloatBE=function(g,E,C){return ae(this,g,E,!1,C)};function De(x,g,E,C,L){return g=+g,E=E>>>0,L||te(x,g,E,8),r.write(x,g,E,C,52,8),E+8}s.prototype.writeDoubleLE=function(g,E,C){return De(this,g,E,!0,C)},s.prototype.writeDoubleBE=function(g,E,C){return De(this,g,E,!1,C)},s.prototype.copy=function(g,E,C,L){if(!s.isBuffer(g))throw new TypeError("argument should be a Buffer");if(C||(C=0),!L&&L!==0&&(L=this.length),E>=g.length&&(E=g.length),E||(E=0),L>0&&L<C&&(L=C),L===C||g.length===0||this.length===0)return 0;if(E<0)throw new RangeError("targetStart out of bounds");if(C<0||C>=this.length)throw new RangeError("Index out of range");if(L<0)throw new RangeError("sourceEnd out of bounds");L>this.length&&(L=this.length),g.length-E<L-C&&(L=g.length-E+C);const j=L-C;return this===g&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(E,C,L):Uint8Array.prototype.set.call(g,this.subarray(C,L),E),j},s.prototype.fill=function(g,E,C,L){if(typeof g=="string"){if(typeof E=="string"?(L=E,E=0,C=this.length):typeof C=="string"&&(L=C,C=this.length),L!==void 0&&typeof L!="string")throw new TypeError("encoding must be a string");if(typeof L=="string"&&!s.isEncoding(L))throw new TypeError("Unknown encoding: "+L);if(g.length===1){const z=g.charCodeAt(0);(L==="utf8"&&z<128||L==="latin1")&&(g=z)}}else typeof g=="number"?g=g&255:typeof g=="boolean"&&(g=Number(g));if(E<0||this.length<E||this.length<C)throw new RangeError("Out of range index");if(C<=E)return this;E=E>>>0,C=C===void 0?this.length:C>>>0,g||(g=0);let j;if(typeof g=="number")for(j=E;j<C;++j)this[j]=g;else{const z=s.isBuffer(g)?g:s.from(g,L),me=z.length;if(me===0)throw new TypeError('The value "'+g+'" is invalid for argument "value"');for(j=0;j<C-E;++j)this[j+E]=z[j%me]}return this};const Ie={};function Tt(x,g,E){Ie[x]=class extends E{constructor(){super(),Object.defineProperty(this,"message",{value:g.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${x}]`,this.stack,delete this.name}get code(){return x}set code(L){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:L,writable:!0})}toString(){return`${this.name} [${x}]: ${this.message}`}}}Tt("ERR_BUFFER_OUT_OF_BOUNDS",function(x){return x?`${x} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Tt("ERR_INVALID_ARG_TYPE",function(x,g){return`The "${x}" argument must be of type number. Received type ${typeof g}`},TypeError),Tt("ERR_OUT_OF_RANGE",function(x,g,E){let C=`The value of "${x}" is out of range.`,L=E;return Number.isInteger(E)&&Math.abs(E)>2**32?L=Ct(String(E)):typeof E=="bigint"&&(L=String(E),(E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))&&(L=Ct(L)),L+="n"),C+=` It must be ${g}. Received ${L}`,C},RangeError);function Ct(x){let g="",E=x.length;const C=x[0]==="-"?1:0;for(;E>=C+4;E-=3)g=`_${x.slice(E-3,E)}${g}`;return`${x.slice(0,E)}${g}`}function Gt(x,g,E){st(g,"offset"),(x[g]===void 0||x[g+E]===void 0)&&Je(g,x.length-(E+1))}function oe(x,g,E,C,L,j){if(x>E||x<g){const z=typeof g=="bigint"?"n":"";let me;throw j>3?g===0||g===BigInt(0)?me=`>= 0${z} and < 2${z} ** ${(j+1)*8}${z}`:me=`>= -(2${z} ** ${(j+1)*8-1}${z}) and < 2 ** ${(j+1)*8-1}${z}`:me=`>= ${g}${z} and <= ${E}${z}`,new Ie.ERR_OUT_OF_RANGE("value",me,x)}Gt(C,L,j)}function st(x,g){if(typeof x!="number")throw new Ie.ERR_INVALID_ARG_TYPE(g,"number",x)}function Je(x,g,E){throw Math.floor(x)!==x?(st(x,E),new Ie.ERR_OUT_OF_RANGE(E||"offset","an integer",x)):g<0?new Ie.ERR_BUFFER_OUT_OF_BOUNDS:new Ie.ERR_OUT_OF_RANGE(E||"offset",`>= ${E?1:0} and <= ${g}`,x)}const Vt=/[^+/0-9A-Za-z-_]/g;function wr(x){if(x=x.split("=")[0],x=x.trim().replace(Vt,""),x.length<2)return"";for(;x.length%4!==0;)x=x+"=";return x}function er(x,g){g=g||1/0;let E;const C=x.length;let L=null;const j=[];for(let z=0;z<C;++z){if(E=x.charCodeAt(z),E>55295&&E<57344){if(!L){if(E>56319){(g-=3)>-1&&j.push(239,191,189);continue}else if(z+1===C){(g-=3)>-1&&j.push(239,191,189);continue}L=E;continue}if(E<56320){(g-=3)>-1&&j.push(239,191,189),L=E;continue}E=(L-55296<<10|E-56320)+65536}else L&&(g-=3)>-1&&j.push(239,191,189);if(L=null,E<128){if((g-=1)<0)break;j.push(E)}else if(E<2048){if((g-=2)<0)break;j.push(E>>6|192,E&63|128)}else if(E<65536){if((g-=3)<0)break;j.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((g-=4)<0)break;j.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw new Error("Invalid code point")}return j}function kt(x){const g=[];for(let E=0;E<x.length;++E)g.push(x.charCodeAt(E)&255);return g}function yn(x,g){let E,C,L;const j=[];for(let z=0;z<x.length&&!((g-=2)<0);++z)E=x.charCodeAt(z),C=E>>8,L=E%256,j.push(L),j.push(C);return j}function Wt(x){return t.toByteArray(wr(x))}function Mt(x,g,E,C){let L;for(L=0;L<C&&!(L+E>=g.length||L>=x.length);++L)g[L+E]=x[L];return L}function Ze(x,g){return x instanceof g||x!=null&&x.constructor!=null&&x.constructor.name!=null&&x.constructor.name===g.name}function zt(x){return x!==x}const yt=function(){const x="0123456789abcdef",g=new Array(256);for(let E=0;E<16;++E){const C=E*16;for(let L=0;L<16;++L)g[C+L]=x[E]+x[L]}return g}();function at(x){return typeof BigInt>"u"?vn:x}function vn(){throw new Error("BigInt not supported")}}(Zc)),Zc}(function(e,t){(function(r,n){e.exports=n(bT(),LT(),BT(),Cg(),VT,cx(),hx())})(he,function(r,n,i,o,a,s,c){return function(){var l={809:function(f){f.exports=r},30:function(f){f.exports=n},36:function(f){f.exports=i},300:function(f){f.exports=o},408:function(f){f.exports=c},25:function(f){f.exports=a},130:function(f){f.exports=s}},u={};function h(f){var p=u[f];if(p!==void 0)return p.exports;var m=u[f]={exports:{}};return l[f](m,m.exports,h),m.exports}h.n=function(f){var p=f&&f.__esModule?function(){return f.default}:function(){return f};return h.d(p,{a:p}),p},h.d=function(f,p){for(var m in p)h.o(p,m)&&!h.o(f,m)&&Object.defineProperty(f,m,{enumerable:!0,get:p[m]})},h.o=function(f,p){return Object.prototype.hasOwnProperty.call(f,p)},h.r=function(f){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(f,"__esModule",{value:!0})};var d={};return function(){h.r(d),h.d(d,{assets:function(){return M},auth:function(){return K},buildAnswer:function(){return LE},buildCarouselCard:function(){return IE},buildQuestion:function(){return Ge},carouselCards:function(){return Si},contentInteraction:function(){return at},decodeBase64:function(){return ME},default:function(){return FE},editorialPages:function(){return W},features:function(){return E},getEntries:function(){return f.getEntries},getEntry:function(){return f.getEntry},management:function(){return _n},payments:function(){return Sn},people:function(){return rr},peopleEngagement:function(){return zr},qaQuestions:function(){return ct},reportError:function(){return p.reportError},search:function(){return bi}});var f=h(809),p=h(30),m=h(36),_={APOLITICAL:{WEBSITES:{LIVE:"https://apolitical.co",LOCALHOST:"localhost",STAGING:/https:\/\/([\w|\d|-]+)\.apolitical\.co/i,STAGING_SPLITTER:"-"},ENVIRONMENTS:{PRODUCTION:"live",LOCAL:"local"}},APIS:{ASSETS_API:{BASE_URL:"/api/assets-api",ENDPOINTS:{USERS:"/users",CERTIFICATES:"/certificates"}},AUTH_API:{BASE_URL:"/api/auth-api",ENDPOINTS:{USER_PASSWORD:"/password",USERS:"/users"}},CONTENT_INTERACTION_API:{BASE_URL:"/api/content-interaction-api",ENDPOINTS:{QUESTIONS:"/questions",ANSWERS:"/answers",REPLIES:"/replies",LIKES:"/likes"}},FEATURES_API:{BASE_URL:"/api/features-api",ENDPOINTS:{FLAGS:"/features"}},MANAGEMENT_API:{BASE_URL:"/api/management-api",ENDPOINTS:{ACCOUNTS:"/accounts",EVENT_REGISTRATIONS:"/event-registrations",LOGINS:"/logins",LOGIN_PASSWORDLESS:"/passwordless",BULK_ENROLMENTS:"/bulk-enrolments"}},PAYMENTS_API:{BASE_URL:"/api/payments-api",BASE_URL_V2:"/api/payments-api/v2",ENDPOINTS:{PRODUCTS:"/products"}},PEOPLE_API:{BASE_URL:"/api/people-api",BASE_URL_V2:"/api/people-api/v2",ENDPOINTS:{BULK_ENROLMENTS:"/bulk-enrolments",REGISTRATIONS:"/registrations",USERS:"/users",USER_ANSWERS:"/answers",USER_COURSES:"/courses",USER_EVENTS:"/events",USER_LIKES:"/likes",USER_LESSONS:"/lessons",USER_PRODUCTS:"/products",USER_RATINGS:"/ratings",USER_SUBSCRIPTIONS:"/subscriptions"}},PEOPLE_ENGAGEMENT_API:{BASE_URL:"/api/people-engagement-api",ENDPOINTS:{ENQUIRY_EMAILS:"/enquiry-emails",USERS:"/users",USER_PROPERTIES:"/properties"}},SEARCH_API:{BASE_URL:"/api/search-api",ENDPOINTS:{SEARCH:"/search"}}},CONTENTFUL:{ARTICLES:{TYPE:"solutionArticle"},CAROUSELS:{CARD_TYPES:{solutionArticle:{INCLUDE:1,SELECT:"fields.authorIds,fields.authorTag,fields.image,fields.publishedDate,fields.readingTime,fields.slug,fields.title"},microcourse:{INCLUDE:2,SELECT:"fields.banner,fields.freeCourse,fields.partnershipDetails,fields.slug,fields.title"},event:{INCLUDE:1,SELECT:"fields.bannerImage,fields.defaultStartDate,fields.slug,fields.speakers,fields.title,fields.isEventOngoing"},listPage:{INCLUDE:1,SELECT:"fields.hero,fields.slug,fields.title"},qaQuestion:{INCLUDE:0,SELECT:"fields.answers,fields.authorId,fields.slug,fields.title,sys.createdAt,fields.projectNames"},learningHub:{INCLUDE:1,SELECT:"fields.bannerSection,fields.customLabel,fields.slug,fields.title"}}},COURSES:{TYPE:"microcourse"},EDITORIAL_PAGES:{INCLUDE:1,SELECT:"fields.carousels,fields.slug",TYPE:"editorialPage"},EVENTS:{TYPE:"event"},LISTS:{TYPE:"listPage"},QUESTIONS:{TYPE:"qaQuestion",INCLUDE:1,LIMIT:10,ORDER:"-sys.createdAt",SELECT:"sys.createdAt,sys.updatedAt,fields.title,fields.slug,fields.authorId,fields.answers,fields.isEdited,fields.projectNames",SKIP:0},ANSWERS:{TYPE:"qaAnswer"},REPLIES:{TYPE:"reply"},LEARNING_HUB:{TYPE:"learningHub"}},HUBSPOT:{ENVIRONMENTS_MAPPING:{local:"SANDBOX",beta:"SANDBOX",rc:"SANDBOX",live:"LIVE"},EMAIL_IDS:{SANDBOX:{internalEmailId:49099078634,externalEmailId:55196526554},LIVE:{internalEmailId:55233583049,externalEmailId:55231159239}}},USERS:{MYSELF:"me"}};const{APOLITICAL:{WEBSITES:{LIVE:S,LOCALHOST:v,STAGING:w,STAGING_SPLITTER:A},ENVIRONMENTS:{PRODUCTION:b,LOCAL:N}}}=_,{HUBSPOT:{ENVIRONMENTS_MAPPING:k,EMAIL_IDS:R}}=_;let $={emailIds:{}};var G=h(300),q=h.n(G);const H=async F=>{try{const{message:B,response:D,request:V}=F;let ne=B;return D?ne+=` - The request was made and the server responded with ${JSON.stringify({status:D.status,data:D.data})}`:V&&(ne+=" - The request was made but no response was received"),console.warn(ne),await(0,p.reportError)(new Error(ne)),ne}catch(B){return console.warn(`Cannot handle error: ${B.message}`),B.message}},{APIS:{ASSETS_API:{BASE_URL:Y,ENDPOINTS:{USERS:re,CERTIFICATES:X}}}}=_;var M={certificates:{create:async(F,B)=>{let D=[];try{const{data:V}=await q().post(`${Y}${re}/${F}${X}`,B);V&&(D=V)}catch(V){await H(V)}return D}}};const{APIS:{AUTH_API:{BASE_URL:Q,ENDPOINTS:{USER_PASSWORD:J,USERS:fe}}},USERS:{MYSELF:Z}}=_;var K={userPassword:{update:async F=>{let B=null;try{B=await q().put(`${Q}${fe}/${Z}${J}`,F)}catch(D){B={message:(((D||{}).response||{}).data||{}).message},await H(D)}return B}}};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:ce,ENDPOINTS:{ANSWERS:de,QUESTIONS:Ve,LIKES:te}}}}=_,ae=`${ce}${Ve}`;var De={create:async({questionSlug:F},B)=>{try{await q().post(`${ae}/${encodeURIComponent(F)}${de}`,B)}catch(D){const V=await H(D);throw new Error(V)}},remove:async({questionSlug:F,answerSlug:B})=>{try{await q().delete(`${ae}/${encodeURIComponent(F)}${de}/${encodeURIComponent(B)}`)}catch(D){const V=await H(D);throw new Error(V)}},update:async({questionSlug:F,answerSlug:B},D)=>{try{return await q().put(`${ae}/${encodeURIComponent(F)}${de}/${encodeURIComponent(B)}`,D)}catch(V){const ne=await H(V);throw new Error(ne)}},like:async({questionSlug:F,answerSlug:B},D)=>{try{return await q().post(`${ae}/${encodeURIComponent(F)}${de}/${encodeURIComponent(B)}${te}`,D)}catch(V){const ne=await H(V);throw new Error(ne)}},unlike:async({questionSlug:F,answerSlug:B})=>{try{return await q().delete(`${ae}/${encodeURIComponent(F)}${de}/${encodeURIComponent(B)}${te}`)}catch(D){const V=await H(D);throw new Error(V)}}};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:Ie,ENDPOINTS:{QUESTIONS:Tt}}}}=_,Ct=`${Ie}${Tt}`;var Gt={create:async F=>{try{return await q().post(Ct,F)}catch(B){const D=await H(B);throw new Error(D)}},remove:async({questionSlug:F})=>{try{await q().delete(`${Ct}/${encodeURIComponent(F)}`)}catch(B){const D=await H(B);throw new Error(D)}},update:async({questionSlug:F},B)=>{try{return await q().put(`${Ct}/${encodeURIComponent(F)}`,B)}catch(D){const V=await H(D);throw new Error(V)}}};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:oe,ENDPOINTS:{REPLIES:st,ANSWERS:Je,QUESTIONS:Vt,LIKES:wr}}}}=_,er=`${oe}${Vt}`,kt=({questionSlug:F,answerSlug:B,replySlug:D},V=!1)=>{let ne=`${er}/${encodeURIComponent(F)}${Je}/${encodeURIComponent(B)}${st}`;return D&&(ne=`${ne}/${encodeURIComponent(D)}`,V&&(ne=`${ne}${wr}`)),ne};var yn={create:async({questionSlug:F,answerSlug:B},D)=>{try{return await q().post(kt({questionSlug:F,answerSlug:B}),D)}catch(V){const ne=await H(V);throw new Error(ne)}},update:async({questionSlug:F,answerSlug:B,replySlug:D},V)=>{try{return await q().put(kt({questionSlug:F,answerSlug:B,replySlug:D}),V)}catch(ne){const Ne=await H(ne);throw new Error(Ne)}},remove:async({questionSlug:F,answerSlug:B,replySlug:D})=>{try{await q().delete(kt({questionSlug:F,answerSlug:B,replySlug:D}))}catch(V){const ne=await H(V);throw new Error(ne)}},like:async({questionSlug:F,answerSlug:B,replySlug:D},V)=>{try{await q().post(kt({questionSlug:F,answerSlug:B,replySlug:D},!0),V)}catch(ne){const Ne=await H(ne);throw new Error(Ne)}},unlike:async({questionSlug:F,answerSlug:B,replySlug:D})=>{try{await q().delete(kt({questionSlug:F,answerSlug:B,replySlug:D},!0))}catch(V){const ne=await H(V);throw new Error(ne)}},getReplyUrl:kt};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:Wt,ENDPOINTS:{QUESTIONS:Mt,ANSWERS:Ze,LIKES:zt}}}}=_,yt=`${Wt}${Mt}`;var at={answers:De,questions:Gt,replies:yn,likes:{create:async(F,B)=>{try{return await q().post(`${yt}/${encodeURIComponent(F)}${Ze}/${encodeURIComponent(B)}${zt}`)}catch(D){const V=await H(D);throw new Error(V)}},remove:async(F,B)=>{try{return await q().delete(`${yt}/${encodeURIComponent(F)}${Ze}/${encodeURIComponent(B)}${zt}`)}catch(D){const V=await H(D);throw new Error(V)}}}};const{APIS:{FEATURES_API:{BASE_URL:vn,ENDPOINTS:{FLAGS:x}}}}=_,g=`${vn}${x}`;var E={flags:{read:async F=>{let B=null;try{const{data:D}=await q().get(`${g}/${encodeURIComponent(F)}`);D!=null&&D.name&&(D!=null&&D.featureState)&&(B=D)}catch(D){await H(D)}return B}}};const{APIS:{MANAGEMENT_API:{BASE_URL:C,ENDPOINTS:{ACCOUNTS:L}}}}=_;var j={create:async F=>{try{await q().post(`${C}${L}`,F)}catch(B){throw await H(B),B}},read:async F=>{let B=null;try{({data:B}=await q().get(`${C}${L}/${encodeURIComponent(F)}`))}catch(D){await H(D)}return B},update:async(F,B)=>{try{await q().put(`${C}${L}/${encodeURIComponent(F)}`,B)}catch(D){throw await H(D),D}}};const{APIS:{MANAGEMENT_API:{BASE_URL:z,ENDPOINTS:{BULK_ENROLMENTS:me}}}}=_;var Ce={create:async F=>{try{await q().post(`${z}${me}`,F)}catch(B){throw await H(B),B}}};const{APIS:{MANAGEMENT_API:{BASE_URL:Re,ENDPOINTS:{EVENT_REGISTRATIONS:Pe}}}}=_;var Ee={create:async F=>{try{await q().post(`${Re}${Pe}`,F)}catch(B){const D=await H(B);throw new Error(D)}}};const{APIS:{MANAGEMENT_API:{BASE_URL:Rt,ENDPOINTS:{LOGINS:Hr,LOGIN_PASSWORDLESS:En}}}}=_,Sr=`${Rt}${Hr}`;var _n={accounts:j,bulkEnrolments:Ce,eventRegistrations:Ee,passwordless:{update:async F=>{try{await q().put(`${Sr}/${encodeURIComponent(F)}${En}`)}catch(B){throw await H(B),B}}}};const{APIS:{PAYMENTS_API:{BASE_URL_V2:Tr,ENDPOINTS:{PRODUCTS:bn}}}}=_,wn=`${Tr}${bn}`;var Sn={products:{list:async F=>{let B=[],D=F?{params:F}:{params:{}};try{const{data:V}=await q().get(wn,D);V&&V.length&&(B=V)}catch(V){await H(V)}return B}}};const{APIS:{PEOPLE_API:{BASE_URL_V2:tr,ENDPOINTS:{BULK_ENROLMENTS:li}}}}=_;var Qt={list:async F=>{let B=[];try{const{data:D}=await q().get(`${tr}${li}`,{params:F});D&&D.length&&(B=D)}catch(D){await H(D)}return B}},Eo=h(25);const{OK:_o,MULTIPLE_CHOICES:bo,NOT_FOUND:fi,FORBIDDEN:Tn}=Eo.StatusCodes,We=F=>F>=_o&&F<bo||F===Tn||F===fi,{APIS:{PEOPLE_API:{BASE_URL_V2:xn,ENDPOINTS:{USERS:On}}}}=_,xr=async F=>{let B=null;try{const{data:D}=await q().get(`${xn}${On}/${encodeURIComponent(F)}`,{validateStatus:We});D&&D.id&&(B=D)}catch(D){await H(D)}return B},hi=async F=>{let B=[];try{if(F&&F.length<2)throw new Error("users list method requires at least two ids");const D=F.map(ne=>`ids=${encodeURIComponent(ne)}`).join("&"),V=await q().get(`${xn}${On}?${D}`,{validateStatus:We});V&&V.length&&(B=V)}catch(D){await H(D)}return B};var wo={read:xr,update:async(F,B)=>{let D=!1;try{const{data:V}=await q().put(`${xn}${On}/${encodeURIComponent(F)}`,B);D=!(!V||!V.id)}catch(V){await H(V)}return D},list:hi};const{APIS:{PEOPLE_API:{BASE_URL_V2:et,ENDPOINTS:{USERS:So,USER_LIKES:To}}},USERS:{MYSELF:xo}}=_,Oo=`${et}${So}/${xo}${To}`,An=async F=>{let B=[],D=F?{params:F}:{params:{}};try{const{data:V}=await q().get(Oo,D);V&&V.length&&(B=V)}catch(V){await H(V)}return B};var ht={list:An},Ao={authors:{readQuestionAuthors:async(F,B,D)=>{try{if(F.author=await xr(F.authorId),F.answers&&F.answers.length&&!D.ignoreAnswersAuthors){F.answers.sort((ne,Ne)=>new Date(Ne.updatedAt)-new Date(ne.updatedAt)),F.totalAnswers=F.answers.length;let V=F.answers;if(D.limit&&D.pageNumber){const ne=D.limit*(D.pageNumber-1);V=F.answers.slice(ne,ne+D.limit)}for(let ne of V){ne.author=ne.authorId&&await xr(ne.authorId)||{};const[Ne]=B?await An({contentType:_.CONTENTFUL.ANSWERS.TYPE,contentSlug:ne.slug}):[null];ne.userLiked=!!Ne}F.answers=V}else F.answers||(F.answers=[]);return F}catch(V){throw await H(V),new Error(`Cannot read authors for question: ${V.message}`)}},readAuthors:async(F=[])=>{let B=[];try{if(Array.isArray(F)===!1)throw new Error("authorIds is not an array!");if(F&&F.length===1){const D=await xr(F[0]);D&&B.push(D)}else if(F&&F.length>1){const D=await hi(F);D&&D.length>0&&(B=D)}}catch(D){throw await H(D),new Error(`Cannot read authors: ${D.message}`)}return B}}};const{APIS:{PEOPLE_API:{BASE_URL:Co,ENDPOINTS:{REGISTRATIONS:Ro}}}}=_;var Po={list:async F=>{let B=[];try{const{data:D}=await q().get(`${Co}${Ro}`,{params:F});D&&D.length&&(B=D)}catch(D){await H(D)}return B}};const{APIS:{PEOPLE_API:{BASE_URL_V2:No,ENDPOINTS:{USERS:qr,USER_COURSES:di}}},USERS:{MYSELF:Gr}}=_,xt=`${No}${qr}/${Gr}${di}`;var Cn={create:async F=>{try{await q().post(xt,F)}catch(B){await H(B)}},list:async F=>{let B=[],D=F?{params:F}:{params:{}};try{const{data:V}=await q().get(xt,D);V&&V.length&&(B=V)}catch(V){await H(V)}return B},update:async(F,B)=>{try{await q().put(`${xt}/${F}`,B)}catch(D){await H(D)}}};const{APIS:{PEOPLE_API:{BASE_URL_V2:Io,ENDPOINTS:{USERS:Lo,USER_EVENTS:ko}}},USERS:{MYSELF:Mo}}=_,Fo=`${Io}${Lo}/${Mo}${ko}`;var Vr={list:async F=>{let B=[],D=F?{params:F}:{params:{}};try{const{data:V}=await q().get(Fo,D);V&&V.length&&(B=V)}catch(V){await H(V)}return B}};const{APIS:{PEOPLE_API:{BASE_URL_V2:Rn,ENDPOINTS:{USERS:Or,USER_LESSONS:pi}}},USERS:{MYSELF:mi}}=_,gi=`${Rn}${Or}/${mi}${pi}`;var Do={create:async F=>{let B=null;try{B=await q().post(gi,F)}catch(D){await H(D)}return B},list:async F=>{let B=[],D=F?{params:F}:{params:{}};try{const{data:V}=await q().get(gi,D);V&&V.length&&(B=V)}catch(V){await H(V)}return B}};const{APIS:{PEOPLE_API:{BASE_URL_V2:Bo,ENDPOINTS:{USERS:Uo,USER_PRODUCTS:Pn}}},USERS:{MYSELF:$o}}=_,Nn=`${Bo}${Uo}/${$o}${Pn}`;var Ar={create:async F=>{let B=null;try{B=await q().post(Nn,F)}catch(D){await H(D)}return B},list:async F=>{let B=[],D=F?{params:F}:{params:{}};try{const{data:V}=await q().get(Nn,D);V&&V.length&&(B=V)}catch(V){await H(V)}return B},update:async(F,B)=>{try{await q().put(`${Nn}/${F}`,B)}catch(D){await H(D)}}};const{APIS:{PEOPLE_API:{BASE_URL_V2:Pt,ENDPOINTS:{USERS:Yt,USER_RATINGS:Kt}}},USERS:{MYSELF:jo}}=_,Nt=`${Pt}${Yt}/${jo}${Kt}`;var rr={bulkEnrolments:Qt,handlers:Ao,registrations:Po,users:wo,userCourses:Cn,userEvents:Vr,userLessons:Do,userLikes:ht,userProducts:Ar,userRatings:{create:async F=>{let B=null;try{const{data:D}=await q().post(Nt,F);D!=null&&D.id&&(B=D)}catch(D){await H(D)}return B},update:async(F,B)=>{try{await q().put(`${Nt}/${F}`,B)}catch(D){await H(D)}}}};const{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:Ho,ENDPOINTS:{ENQUIRY_EMAILS:qo}}}}=_;var Go={create:async F=>{let B=null;try{const{data:D}=await q().post(`${Ho}${qo}`,F);D&&(B=D)}catch(D){await H(D)}return B}},yi={forms:{sendEnquiryEmails:async F=>{let B=null;try{const{emailIds:D}=$;B=await zr.emails.create({...D,...F})}catch(D){await H(D)}return B}}};const{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:ut,ENDPOINTS:{USERS:vi,USER_PROPERTIES:Ei}}},USERS:{MYSELF:Wr}}=_;var zr={emails:Go,handlers:yi,userProperties:{update:async(F,B)=>{try{await q().put(`${ut}${vi}/${Wr}${Ei}/${F}`,B)}catch(D){await H(D)}}}},Qr=h(130);const{APIS:{SEARCH_API:{BASE_URL:Vo,ENDPOINTS:{SEARCH:_i}}}}=_,In=`${Vo}${_i}`;var bi={ask:async F=>{try{let B=null;const{data:D}=await q().get(In,{params:{question:F}});return D!=null&&D.answer&&(D!=null&&D.references)&&(D!=null&&D.version)&&(B=D),B}catch(B){const D=await H(B);throw new Error(D)}},stream:(F,B,D)=>{const V=(0,Qr.io)(void 0,{path:"/api/search-api/web-sockets"});function ne(){V.emit("search",{question:F})}function Ne(qe){D(qe),$e(),V.disconnect()}function $e(){V.off("connect",ne),V.off("update",B),V.off("result",Ne)}return V.on("connect",ne),V.on("update",B),V.on("result",Ne),$e}};const{CONTENTFUL:Ft}=_,{CARD_TYPES:Ln}=Ft.CAROUSELS;var Si={read:async(F,B)=>{try{if(!B||!B.sys||!B.sys.id)throw new Error("Invalid link to card");if(!F||!Ln[F])throw new Error("Unsupported card content type");const{INCLUDE:D,SELECT:V}=Ln[F];return await(0,f.getEntry)({content_type:F,"sys.id":B.sys.id,include:D,select:V},{assetDetails:!0})}catch(D){throw await H(D),new Error(`Cannot read carousel card: ${D.message}`)}}};const{CONTENTFUL:Wo}=_,{INCLUDE:y,SELECT:O,TYPE:I}=Wo.EDITORIAL_PAGES;var W={read:async F=>{try{return await(0,f.getEntry)({content_type:I,"fields.slug":F,include:y,select:O})}catch(B){throw await H(B),new Error(`Cannot read editorial page: ${B.message}`)}}};const{CONTENTFUL:ge}=_,{TYPE:le,ORDER:_e,SELECT:be,SKIP:He,LIMIT:Ae,INCLUDE:tt}=ge.QUESTIONS;var ct={read:async F=>{try{return await(0,f.getEntry)({content_type:le,"fields.slug":F,include:2,select:be})}catch(B){throw await H(B),new Error(`Cannot read question: ${B.message}`)}},list:async(F={})=>{try{return await(0,f.getEntries)({content_type:le,include:tt,limit:Ae,order:_e,select:be,skip:He,...F})}catch(B){throw await H(B),new Error(`Cannot list questions: ${B.message}`)}}},Ge=async(F,B,D={ignoreAnswersAuthors:!1})=>{try{let V={};return V=await ct.read(F),V=await rr.handlers.authors.readQuestionAuthors(V,B,D),V}catch(V){throw await H(V),new Error(`Cannot build question: ${V.message}`)}};const{ARTICLES:{TYPE:rt},COURSES:{TYPE:Qe},EVENTS:{TYPE:nr},LISTS:{TYPE:Xt},QUESTIONS:{TYPE:Cr},LEARNING_HUB:{TYPE:ua}}=_.CONTENTFUL,ir=F=>F&&F.url?(Object.assign(F,{aspect:"responsiveCard",query:"q=90&fit=fill"}),F):null,Yr={[rt]:async F=>{const{authorIds:B,authorTag:D,image:V,publishedDate:ne,readingTime:Ne,slug:$e,title:qe}=F,It=await rr.handlers.authors.readAuthors(B),or=It&&It.length?It:D?[D]:null;return{banner:ir(V),contributors:or,publishedDate:ne,readingTime:Ne,slug:$e,title:qe}},[Qe]:async(F,B)=>{const{banner:D,freeCourse:V,partnershipDetails:ne,slug:Ne,title:$e,registered:qe}=F,It={banner:ir(D),slug:Ne,title:$e,pill:V?"free":"premium",registered:!!qe};if(ne){const{partners:or}=ne;It.partner=or&&or.length&&ne.partners[0]}if(qe===void 0&&B){const[or]=await rr.userProducts.list({courseSlug:Ne,isEnrolled:!0,scope:"active"});It.registered=!!or}return It},[nr]:async(F,B)=>{const{bannerImage:D,defaultStartDate:V,isEventOngoing:ne,slug:Ne,speakers:$e,title:qe,registered:It}=F,or=new Date(V),DE=!!or&&or<new Date;if($e&&$e.length)for(const ca of $e)ca.image=(Mu=ca.image)&&Mu.url?`${Mu.url}?w=100&h=100&fit=thumb&f=center`:null;var Mu;const vh={banner:ir(D),dateHasPassed:DE,title:qe,slug:Ne,isOngoingEvent:ne,contributors:$e,startDate:or,registered:!!It};if(It===void 0&&B){const[ca]=await rr.userEvents.list({eventSlug:Ne});vh.registered=!!ca}return vh},[Xt]:async F=>{const{hero:B,slug:D,title:V}=F;return{banner:ir(B),slug:D,title:V}},[Cr]:async F=>{const{answers:B,authorId:D,createdAt:V,slug:ne,title:Ne}=F;let $e=null;if(D){const qe=await rr.users.read(D);qe&&($e=qe)}return{answers:B&&B.length?B.length:0,contributors:$e?[$e]:[],createdAt:V,slug:ne,title:Ne}},[ua]:F=>{const{bannerSection:B,customLabel:D,slug:V,title:ne}=F;return{banner:ir(B.image),slug:V,title:ne,customLabel:D}},people:F=>{const{id:B,name:D,jobTitle:V,location:ne,image:Ne}=F;return{profile:Ne,slug:B,title:D,text:V,secondaryText:ne}}};var IE=async({contentType:F,...B}={},D)=>{try{if(!Yr[F])throw new Error("Content type not supported");if(typeof Yr[F]!="function")throw new Error("No builder function for content type");return F!=="people"&&B.sys&&B.sys.type&&B.sys.type==="Link"&&(B=await Si.read(F,B)),{contentType:F,...await Yr[F](B,D)}}catch(V){throw await H(V),new Error(`Cannot build carousel card: ${V.message}`)}},LE=async(F,B,D={})=>{try{if(!F.replies||F.replies.length===0)return F.replies=[],F;F.replies.sort((ne,Ne)=>new Date(ne.createdAt)-new Date(Ne.createdAt)),F.totalReplies=F.totalReplies||F.replies.length;let V=F.replies;if(D.limit&&D.pageNumber){const ne=D.limit*(D.pageNumber-1);V=F.replies.slice(ne,ne+D.limit)}for(const ne of V){if(ne.authorId===F.authorId){ne.author=F.author,ne.userLiked=!1;continue}ne.author=ne.authorId&&await xr(ne.authorId)||{};const[Ne]=B?await An({contentType:_.CONTENTFUL.REPLIES.TYPE,contentSlug:ne.slug}):[null];ne.userLiked=!!Ne}return F.replies=V,F}catch(V){throw await H(V),new Error(`Cannot build replies for answer: ${V.message}`)}},kE=h(408);const ME=F=>F&&kE.Buffer.from(F,"base64").toString("ascii");function FE({contentContext:F=null,errorsContext:B=null,gtmContext:D=null,origin:V}){try{const ne=(Ne=>{let $e=null;Ne?$e=Ne:typeof window<"u"&&($e=window.origin||window.location.origin),$e||new Error("Cannot select environment: Website not defined");let qe=null;const It=$e.match(w);return It?qe=It[1].split(A)[0]:$e===S?qe=b:$e.includes(v)&&(qe=N),qe||new Error(`Cannot select environment: No rule for website ${$e}`),qe})(V);return F&&(0,f.setContext)(Object.assign({},F,{environment:ne})),B&&(0,p.setContext)(Object.assign({},B,{environment:ne})),D&&((0,m.setContext)(Object.assign({},D,{environment:ne})),(0,m.setupGTM)()),(({environment:Ne})=>{const $e=(qe=>{if(!qe)throw new Error("Cannot map environment: Environment not defined");if(!k[qe])throw new Error(`Cannot map environment: No mapping found for environment ${qe}`);return k[qe]})(Ne);$.emailIds=R[$e]})(Object.assign({},{environment:ne})),ne}catch(ne){console.warn(`Cannot load SDK: ${ne.message}`)}}}(),d}()})})(Eg);var dx=Eg.exports;const ys={Off:"off",On:"on",Cookie:"cookie"},px=e=>{const[t]=vg(),[r,n]=U.useState(null),[i,o]=U.useState(!1),[a,s]=U.useState(ys.Off);return U.useEffect(()=>{e&&dx.features.flags.read(e).then(c=>{s(c.featureState),n(null)}).catch(c=>{s(ys.Off),n(c)})},[e]),U.useEffect(()=>{switch(a){case ys.Off:o(!1);break;case ys.On:o(!0);break;case ys.Cookie:o(!!t[`feature-${e}`]);break;default:o(!1)}},[a,t]),{isFeatureActive:i,error:r}};function mx(e,t,r){var n=this,i=U.useRef(null),o=U.useRef(0),a=U.useRef(null),s=U.useRef([]),c=U.useRef(),l=U.useRef(),u=U.useRef(e),h=U.useRef(!0);U.useEffect(function(){u.current=e},[e]);var d=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var f=!!(r=r||{}).leading,p=!("trailing"in r)||!!r.trailing,m="maxWait"in r,_=m?Math.max(+r.maxWait||0,t):null;U.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var S=U.useMemo(function(){var v=function(R){var $=s.current,G=c.current;return s.current=c.current=null,o.current=R,l.current=u.current.apply(G,$)},w=function(R,$){d&&cancelAnimationFrame(a.current),a.current=d?requestAnimationFrame(R):setTimeout(R,$)},A=function(R){if(!h.current)return!1;var $=R-i.current;return!i.current||$>=t||$<0||m&&R-o.current>=_},b=function(R){return a.current=null,p&&s.current?v(R):(s.current=c.current=null,l.current)},N=function R(){var $=Date.now();if(A($))return b($);if(h.current){var G=t-($-i.current),q=m?Math.min(G,_-($-o.current)):G;w(R,q)}},k=function(){var R=Date.now(),$=A(R);if(s.current=[].slice.call(arguments),c.current=n,i.current=R,$){if(!a.current&&h.current)return o.current=i.current,w(N,t),f?v(i.current):l.current;if(m)return w(N,t),v(i.current)}return a.current||w(N,t),l.current};return k.cancel=function(){a.current&&(d?cancelAnimationFrame(a.current):clearTimeout(a.current)),o.current=0,s.current=i.current=c.current=a.current=null},k.isPending=function(){return!!a.current},k.flush=function(){return a.current?b(Date.now()):l.current},k},[f,m,t,_,p,d]);return S}function mv(e,t,r){var n=r===void 0?{}:r,i=n.leading,o=n.trailing;return mx(e,t,{maxWait:t,leading:i===void 0||i,trailing:o===void 0||o})}let el;const ra=(e=!0,t=!1)=>{if(!e)return;const[r,n]=U.useState(0)||[!1,()=>{}];U.useEffect(()=>(o(),window.addEventListener("resize",a),()=>{clearTimeout(el),a.flush(),window.removeEventListener("resize",a)}),[]);const i=()=>window.innerWidth,o=()=>{n(i())},a=mv(()=>{i()!==r&&(t&&(clearTimeout(el),document.body.classList.add("is-resizing"),el=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),o())},500,{leading:!0});return r},gv=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:r=()=>{},scrollUp:n=()=>{}}})=>{if(!window)return;const[i,o]=U.useState({current:0,past:0})||[!1,()=>{}],[a,s]=U.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];U.useEffect(()=>(c(),window.addEventListener("scroll",l),()=>{l.flush(),window.removeEventListener("scroll",l)}),[]);const c=()=>{const u=window.scrollY,h=i.current,d=u-h,f=d>0?"down":"up";if(o({current:u,past:h}),f==="down"){u>=e+t.down&&!a.scrollDown&&(!a.scrollUp||d>t.up)&&(r(),s({scrollUp:!1,scrollDown:!0}));return}Math.abs(d)>=t.up&&!a.scrollUp&&(n(),s({scrollUp:!0,scrollDown:!1}))},l=mv(()=>{c()},250);return i},gx=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const r=U.useRef(!1);ri(()=>{if(window&&window.location&&window.location.hash){if(r.current)return;const n=document.getElementById(window.location.hash.replace("#",""));n&&(n.scrollIntoView(t?{behavior:"smooth"}:null),r.current=!0)}},e)};var Za={exports:{}};Za.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object Array]",s="[object Boolean]",c="[object Date]",l="[object Error]",u="[object Function]",h="[object GeneratorFunction]",d="[object Map]",f="[object Number]",p="[object Object]",m="[object Promise]",_="[object RegExp]",S="[object Set]",v="[object String]",w="[object Symbol]",A="[object WeakMap]",b="[object ArrayBuffer]",N="[object DataView]",k="[object Float32Array]",R="[object Float64Array]",$="[object Int8Array]",G="[object Int16Array]",q="[object Int32Array]",H="[object Uint8Array]",Y="[object Uint8ClampedArray]",re="[object Uint16Array]",X="[object Uint32Array]",M=/[\\^$.*+?()[\]{}|]/g,Q=/\w*$/,J=/^\[object .+?Constructor\]$/,fe=/^(?:0|[1-9]\d*)$/,Z={};Z[o]=Z[a]=Z[b]=Z[N]=Z[s]=Z[c]=Z[k]=Z[R]=Z[$]=Z[G]=Z[q]=Z[d]=Z[f]=Z[p]=Z[_]=Z[S]=Z[v]=Z[w]=Z[H]=Z[Y]=Z[re]=Z[X]=!0,Z[l]=Z[u]=Z[A]=!1;var K=typeof he=="object"&&he&&he.Object===Object&&he,ce=typeof self=="object"&&self&&self.Object===Object&&self,de=K||ce||Function("return this")(),Ve=t&&!t.nodeType&&t,te=Ve&&!0&&e&&!e.nodeType&&e,ae=te&&te.exports===Ve;function De(y,O){return y.set(O[0],O[1]),y}function Ie(y,O){return y.add(O),y}function Tt(y,O){for(var I=-1,W=y?y.length:0;++I<W&&O(y[I],I,y)!==!1;);return y}function Ct(y,O){for(var I=-1,W=O.length,ge=y.length;++I<W;)y[ge+I]=O[I];return y}function Gt(y,O,I,W){var ge=-1,le=y?y.length:0;for(W&&le&&(I=y[++ge]);++ge<le;)I=O(I,y[ge],ge,y);return I}function oe(y,O){for(var I=-1,W=Array(y);++I<y;)W[I]=O(I);return W}function st(y,O){return y==null?void 0:y[O]}function Je(y){var O=!1;if(y!=null&&typeof y.toString!="function")try{O=!!(y+"")}catch{}return O}function Vt(y){var O=-1,I=Array(y.size);return y.forEach(function(W,ge){I[++O]=[ge,W]}),I}function wr(y,O){return function(I){return y(O(I))}}function er(y){var O=-1,I=Array(y.size);return y.forEach(function(W){I[++O]=W}),I}var kt=Array.prototype,yn=Function.prototype,Wt=Object.prototype,Mt=de["__core-js_shared__"],Ze=function(){var y=/[^.]+$/.exec(Mt&&Mt.keys&&Mt.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),zt=yn.toString,yt=Wt.hasOwnProperty,at=Wt.toString,vn=RegExp("^"+zt.call(yt).replace(M,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x=ae?de.Buffer:void 0,g=de.Symbol,E=de.Uint8Array,C=wr(Object.getPrototypeOf,Object),L=Object.create,j=Wt.propertyIsEnumerable,z=kt.splice,me=Object.getOwnPropertySymbols,Ce=x?x.isBuffer:void 0,Re=wr(Object.keys,Object),Pe=Pt(de,"DataView"),Ee=Pt(de,"Map"),Rt=Pt(de,"Promise"),Hr=Pt(de,"Set"),En=Pt(de,"WeakMap"),Sr=Pt(Object,"create"),_n=ut(Pe),Tr=ut(Ee),bn=ut(Rt),wn=ut(Hr),Sn=ut(En),tr=g?g.prototype:void 0,li=tr?tr.valueOf:void 0;function Qt(y){var O=-1,I=y?y.length:0;for(this.clear();++O<I;){var W=y[O];this.set(W[0],W[1])}}function Eo(){this.__data__=Sr?Sr(null):{}}function _o(y){return this.has(y)&&delete this.__data__[y]}function bo(y){var O=this.__data__;if(Sr){var I=O[y];return I===n?void 0:I}return yt.call(O,y)?O[y]:void 0}function fi(y){var O=this.__data__;return Sr?O[y]!==void 0:yt.call(O,y)}function Tn(y,O){var I=this.__data__;return I[y]=Sr&&O===void 0?n:O,this}Qt.prototype.clear=Eo,Qt.prototype.delete=_o,Qt.prototype.get=bo,Qt.prototype.has=fi,Qt.prototype.set=Tn;function We(y){var O=-1,I=y?y.length:0;for(this.clear();++O<I;){var W=y[O];this.set(W[0],W[1])}}function xn(){this.__data__=[]}function On(y){var O=this.__data__,I=Gr(O,y);if(I<0)return!1;var W=O.length-1;return I==W?O.pop():z.call(O,I,1),!0}function xr(y){var O=this.__data__,I=Gr(O,y);return I<0?void 0:O[I][1]}function hi(y){return Gr(this.__data__,y)>-1}function wo(y,O){var I=this.__data__,W=Gr(I,y);return W<0?I.push([y,O]):I[W][1]=O,this}We.prototype.clear=xn,We.prototype.delete=On,We.prototype.get=xr,We.prototype.has=hi,We.prototype.set=wo;function et(y){var O=-1,I=y?y.length:0;for(this.clear();++O<I;){var W=y[O];this.set(W[0],W[1])}}function So(){this.__data__={hash:new Qt,map:new(Ee||We),string:new Qt}}function To(y){return Ar(this,y).delete(y)}function xo(y){return Ar(this,y).get(y)}function Oo(y){return Ar(this,y).has(y)}function An(y,O){return Ar(this,y).set(y,O),this}et.prototype.clear=So,et.prototype.delete=To,et.prototype.get=xo,et.prototype.has=Oo,et.prototype.set=An;function ht(y){this.__data__=new We(y)}function Ao(){this.__data__=new We}function Co(y){return this.__data__.delete(y)}function Ro(y){return this.__data__.get(y)}function Po(y){return this.__data__.has(y)}function No(y,O){var I=this.__data__;if(I instanceof We){var W=I.__data__;if(!Ee||W.length<r-1)return W.push([y,O]),this;I=this.__data__=new et(W)}return I.set(y,O),this}ht.prototype.clear=Ao,ht.prototype.delete=Co,ht.prototype.get=Ro,ht.prototype.has=Po,ht.prototype.set=No;function qr(y,O){var I=zr(y)||Wr(y)?oe(y.length,String):[],W=I.length,ge=!!W;for(var le in y)(O||yt.call(y,le))&&!(ge&&(le=="length"||Ho(le,W)))&&I.push(le);return I}function di(y,O,I){var W=y[O];(!(yt.call(y,O)&&Ei(W,I))||I===void 0&&!(O in y))&&(y[O]=I)}function Gr(y,O){for(var I=y.length;I--;)if(Ei(y[I][0],O))return I;return-1}function xt(y,O){return y&&Pn(O,wi(O),y)}function Cn(y,O,I,W,ge,le,_e){var be;if(W&&(be=le?W(y,ge,le,_e):W(y)),be!==void 0)return be;if(!Ft(y))return y;var He=zr(y);if(He){if(be=jo(y),!O)return Uo(y,be)}else{var Ae=Kt(y),tt=Ae==u||Ae==h;if(_i(y))return Vr(y,O);if(Ae==p||Ae==o||tt&&!le){if(Je(y))return le?y:{};if(be=Nt(tt?{}:y),!O)return $o(y,xt(be,y))}else{if(!Z[Ae])return le?y:{};be=rr(y,Ae,Cn,O)}}_e||(_e=new ht);var ct=_e.get(y);if(ct)return ct;if(_e.set(y,be),!He)var Ge=I?Nn(y):wi(y);return Tt(Ge||y,function(rt,Qe){Ge&&(Qe=rt,rt=y[Qe]),di(be,Qe,Cn(rt,O,I,W,Qe,y,_e))}),be}function Io(y){return Ft(y)?L(y):{}}function Lo(y,O,I){var W=O(y);return zr(y)?W:Ct(W,I(y))}function ko(y){return at.call(y)}function Mo(y){if(!Ft(y)||Go(y))return!1;var O=In(y)||Je(y)?vn:J;return O.test(ut(y))}function Fo(y){if(!yi(y))return Re(y);var O=[];for(var I in Object(y))yt.call(y,I)&&I!="constructor"&&O.push(I);return O}function Vr(y,O){if(O)return y.slice();var I=new y.constructor(y.length);return y.copy(I),I}function Rn(y){var O=new y.constructor(y.byteLength);return new E(O).set(new E(y)),O}function Or(y,O){var I=O?Rn(y.buffer):y.buffer;return new y.constructor(I,y.byteOffset,y.byteLength)}function pi(y,O,I){var W=O?I(Vt(y),!0):Vt(y);return Gt(W,De,new y.constructor)}function mi(y){var O=new y.constructor(y.source,Q.exec(y));return O.lastIndex=y.lastIndex,O}function gi(y,O,I){var W=O?I(er(y),!0):er(y);return Gt(W,Ie,new y.constructor)}function Do(y){return li?Object(li.call(y)):{}}function Bo(y,O){var I=O?Rn(y.buffer):y.buffer;return new y.constructor(I,y.byteOffset,y.length)}function Uo(y,O){var I=-1,W=y.length;for(O||(O=Array(W));++I<W;)O[I]=y[I];return O}function Pn(y,O,I,W){I||(I={});for(var ge=-1,le=O.length;++ge<le;){var _e=O[ge],be=W?W(I[_e],y[_e],_e,I,y):void 0;di(I,_e,be===void 0?y[_e]:be)}return I}function $o(y,O){return Pn(y,Yt(y),O)}function Nn(y){return Lo(y,wi,Yt)}function Ar(y,O){var I=y.__data__;return qo(O)?I[typeof O=="string"?"string":"hash"]:I.map}function Pt(y,O){var I=st(y,O);return Mo(I)?I:void 0}var Yt=me?wr(me,Object):Si,Kt=ko;(Pe&&Kt(new Pe(new ArrayBuffer(1)))!=N||Ee&&Kt(new Ee)!=d||Rt&&Kt(Rt.resolve())!=m||Hr&&Kt(new Hr)!=S||En&&Kt(new En)!=A)&&(Kt=function(y){var O=at.call(y),I=O==p?y.constructor:void 0,W=I?ut(I):void 0;if(W)switch(W){case _n:return N;case Tr:return d;case bn:return m;case wn:return S;case Sn:return A}return O});function jo(y){var O=y.length,I=y.constructor(O);return O&&typeof y[0]=="string"&&yt.call(y,"index")&&(I.index=y.index,I.input=y.input),I}function Nt(y){return typeof y.constructor=="function"&&!yi(y)?Io(C(y)):{}}function rr(y,O,I,W){var ge=y.constructor;switch(O){case b:return Rn(y);case s:case c:return new ge(+y);case N:return Or(y,W);case k:case R:case $:case G:case q:case H:case Y:case re:case X:return Bo(y,W);case d:return pi(y,W,I);case f:case v:return new ge(y);case _:return mi(y);case S:return gi(y,W,I);case w:return Do(y)}}function Ho(y,O){return O=O??i,!!O&&(typeof y=="number"||fe.test(y))&&y>-1&&y%1==0&&y<O}function qo(y){var O=typeof y;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?y!=="__proto__":y===null}function Go(y){return!!Ze&&Ze in y}function yi(y){var O=y&&y.constructor,I=typeof O=="function"&&O.prototype||Wt;return y===I}function ut(y){if(y!=null){try{return zt.call(y)}catch{}try{return y+""}catch{}}return""}function vi(y){return Cn(y,!0,!0)}function Ei(y,O){return y===O||y!==y&&O!==O}function Wr(y){return Vo(y)&&yt.call(y,"callee")&&(!j.call(y,"callee")||at.call(y)==o)}var zr=Array.isArray;function Qr(y){return y!=null&&bi(y.length)&&!In(y)}function Vo(y){return Ln(y)&&Qr(y)}var _i=Ce||Wo;function In(y){var O=Ft(y)?at.call(y):"";return O==u||O==h}function bi(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=i}function Ft(y){var O=typeof y;return!!y&&(O=="object"||O=="function")}function Ln(y){return!!y&&typeof y=="object"}function wi(y){return Qr(y)?qr(y):Fo(y)}function Si(){return[]}function Wo(){return!1}e.exports=vi})(Za,Za.exports);var yx=Za.exports;const vx=Er(yx);var Ex="Expected a function",yv="__lodash_hash_undefined__",vv=1/0,_x=9007199254740991,bx="[object Function]",wx="[object GeneratorFunction]",Sx="[object Symbol]",Tx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xx=/^\w*$/,Ox=/^\./,Ax=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Cx=/[\\^$.*+?()[\]{}|]/g,Rx=/\\(\\)?/g,Px=/^\[object .+?Constructor\]$/,Nx=/^(?:0|[1-9]\d*)$/,Ix=typeof he=="object"&&he&&he.Object===Object&&he,Lx=typeof self=="object"&&self&&self.Object===Object&&self,jf=Ix||Lx||Function("return this")();function kx(e,t){return e==null?void 0:e[t]}function Mx(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var Fx=Array.prototype,Dx=Function.prototype,Ev=Object.prototype,tl=jf["__core-js_shared__"],tm=function(){var e=/[^.]+$/.exec(tl&&tl.keys&&tl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),_v=Dx.toString,bu=Ev.hasOwnProperty,bv=Ev.toString,Bx=RegExp("^"+_v.call(bu).replace(Cx,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rm=jf.Symbol,Ux=Fx.splice,$x=wv(jf,"Map"),Cs=wv(Object,"create"),nm=rm?rm.prototype:void 0,im=nm?nm.toString:void 0;function ni(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function jx(){this.__data__=Cs?Cs(null):{}}function Hx(e){return this.has(e)&&delete this.__data__[e]}function qx(e){var t=this.__data__;if(Cs){var r=t[e];return r===yv?void 0:r}return bu.call(t,e)?t[e]:void 0}function Gx(e){var t=this.__data__;return Cs?t[e]!==void 0:bu.call(t,e)}function Vx(e,t){var r=this.__data__;return r[e]=Cs&&t===void 0?yv:t,this}ni.prototype.clear=jx;ni.prototype.delete=Hx;ni.prototype.get=qx;ni.prototype.has=Gx;ni.prototype.set=Vx;function po(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Wx(){this.__data__=[]}function zx(e){var t=this.__data__,r=wu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Ux.call(t,r,1),!0}function Qx(e){var t=this.__data__,r=wu(t,e);return r<0?void 0:t[r][1]}function Yx(e){return wu(this.__data__,e)>-1}function Kx(e,t){var r=this.__data__,n=wu(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}po.prototype.clear=Wx;po.prototype.delete=zx;po.prototype.get=Qx;po.prototype.has=Yx;po.prototype.set=Kx;function ai(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Xx(){this.__data__={hash:new ni,map:new($x||po),string:new ni}}function Jx(e){return Su(this,e).delete(e)}function Zx(e){return Su(this,e).get(e)}function eO(e){return Su(this,e).has(e)}function tO(e,t){return Su(this,e).set(e,t),this}ai.prototype.clear=Xx;ai.prototype.delete=Jx;ai.prototype.get=Zx;ai.prototype.has=eO;ai.prototype.set=tO;function rO(e,t,r){var n=e[t];(!(bu.call(e,t)&&Sv(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function wu(e,t){for(var r=e.length;r--;)if(Sv(e[r][0],t))return r;return-1}function nO(e){if(!eu(e)||lO(e))return!1;var t=pO(e)||Mx(e)?Bx:Px;return t.test(dO(e))}function iO(e,t,r,n){if(!eu(e))return e;t=uO(t,e)?[t]:sO(t);for(var i=-1,o=t.length,a=o-1,s=e;s!=null&&++i<o;){var c=hO(t[i]),l=r;if(i!=a){var u=s[c];l=n?n(u,c,s):void 0,l===void 0&&(l=eu(u)?u:aO(t[i+1])?[]:{})}rO(s,c,l),s=s[c]}return e}function oO(e){if(typeof e=="string")return e;if(qf(e))return im?im.call(e):"";var t=e+"";return t=="0"&&1/e==-vv?"-0":t}function sO(e){return Tv(e)?e:fO(e)}function Su(e,t){var r=e.__data__;return cO(t)?r[typeof t=="string"?"string":"hash"]:r.map}function wv(e,t){var r=kx(e,t);return nO(r)?r:void 0}function aO(e,t){return t=t??_x,!!t&&(typeof e=="number"||Nx.test(e))&&e>-1&&e%1==0&&e<t}function uO(e,t){if(Tv(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||qf(e)?!0:xx.test(e)||!Tx.test(e)||t!=null&&e in Object(t)}function cO(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function lO(e){return!!tm&&tm in e}var fO=Hf(function(e){e=gO(e);var t=[];return Ox.test(e)&&t.push(""),e.replace(Ax,function(r,n,i,o){t.push(i?o.replace(Rx,"$1"):n||r)}),t});function hO(e){if(typeof e=="string"||qf(e))return e;var t=e+"";return t=="0"&&1/e==-vv?"-0":t}function dO(e){if(e!=null){try{return _v.call(e)}catch{}try{return e+""}catch{}}return""}function Hf(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(Ex);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a),a};return r.cache=new(Hf.Cache||ai),r}Hf.Cache=ai;function Sv(e,t){return e===t||e!==e&&t!==t}var Tv=Array.isArray;function pO(e){var t=eu(e)?bv.call(e):"";return t==bx||t==wx}function eu(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function mO(e){return!!e&&typeof e=="object"}function qf(e){return typeof e=="symbol"||mO(e)&&bv.call(e)==Sx}function gO(e){return e==null?"":oO(e)}function yO(e,t,r){return e==null?e:iO(e,t,r)}var vO=yO;const EO=Er(vO),_O=(e,t)=>{Array.isArray(t)||(t=[t]);const r=vx(e);return t.forEach(({type:n,value:i})=>{EO(r,n,i)}),r},xv=e=>{const t=[];return e.forEach(r=>{const n=parseInt(r);isNaN(n)||t.push(n)}),t.sort((r,n)=>r-n)},Ov=(e,t,r)=>{let n=r.mobile;for(const i in t){const o=parseInt(String(t[i]));if(e>=o)n=r[o];else if(e<o)break}return n},bO=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),wO=e=>{let o;try{o=new Date().getTime()-new Date(e).getTime()}catch{return""}const a=o/36e5,s=Math.floor(o/864e5);if(s<1)return a<1?{path:"now"}:{path:"hours",number:Math.floor(a)};if(s<7)return{path:"days",number:s};const c=Math.floor(s/7);return c<=52?{path:"weeks",number:c}:{path:"years",number:Math.floor(s/365)}},SO=e=>new Promise(t=>setTimeout(t,e)),Gf={apolitical:"Apolitical",breadcrumbs_label:"Go back to:",breadcrumbs_currentPage:"Current page:",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",collapsibleSection_summary:"Find out more",communityDetails_members:"Members",communityDetails_viewAll:"View all",communityDetails_invite:"Invite colleagues",community_joinToPost:"Join community to create a post.",contactFooter_title:"Contact us",contactFooter_text:"We're always open to new ideas, so please reach out to see how we can collaborate.",contactFooter_phone:"+44 203 608 2241",contactFooter_email:"hello@apolitical.co",contactForm_name:"Name",contactForm_email:"Email address",contactForm_organisation:"Government department or organisation",contactForm_interests:"I'm interested in",contactForm_interests_publishingCourse:"Publishing or creating a course",contactForm_interests_buyingCourse:"Buying courses for my team",contactForm_interests_learningExperience:"Customised learning experiences",contactForm_interests_somethingElse:"Something else",contactForm_message:"Message",cookieBanner_title:"Cookies and your privacy",cookieBanner_text:"We take your trust and privacy very seriously. Apolitical uses safe cookies (small files on your device) to run the site. You can reject non-essential cookies, but some site features may not work without them.",cookieBanner_buttons_settings:"Change my settings",cookieBanner_buttons_reject:"Reject all",cookieBanner_buttons_accept:"Accept all",dates_now:"now",dates_hours:"{number}h",dates_days:"{number}d",dates_weeks:"{number}w",dates_years:"{number}y",discussion_action_answer:"answer",discussion_action_comment:"comment",discussion_action_post:"post",discussion_action_response:"response",discussion_action_reply:"reply",discussion_action_question:"question",discussion_edited:"Edited",discussion_delete_title:"Delete {action}",discussion_delete_text:"<p>Are you sure you want to delete your {action}?</p><p>This can't be undone.</p>",discussion_delete_cancel:"Cancel",discussion_delete_delete:"Delete",discussion_delete_error:"We are unable to delete your {action} at the moment. Please try again later or contact us if problem persists.",discussion_reply:"Reply",discussion_report_subject:"Report a post on Apolitical",discussion_report_body:`I'd like to report the {contentType} <{contentSlug}> at {contentUrl}.
62
62
 
63
63
  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.
64
64
 
@@ -98,4 +98,4 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
98
98
  `},paragraph:{t:o1,i:xe.LOW,l:al,h:(f,p,m)=>n("p",{key:m.k},p(f.v,m))},ref:{t:Kr(RC),i:xe.MAX,l:f=>(s[f[1]]={B:f[2],F:f[4]},{}),h:cl},refImage:{t:Xr(PC),i:xe.MAX,l:f=>({D:f[1]||void 0,P:f[2]}),h:(f,p,m)=>n("img",{key:m.k,alt:f.D,src:Ai(s[f.P].B),title:s[f.P].F})},refLink:{t:Kr(NC),i:xe.MAX,l:(f,p,m)=>({v:p(f[1],m),Z:p(f[0].replace(IC,"\\$1"),m),P:f[2]}),h:(f,p,m)=>s[f.P]?n("a",{key:m.k,href:Ai(s[f.P].B),title:s[f.P].F},p(f.v,m)):n("span",{key:m.k},p(f.Z,m))},table:{t:Ir(p0),i:xe.HIGH,l:i1,h:(f,p,m)=>n("table",{key:m.k},n("thead",null,n("tr",null,f.L.map(function(_,S){return n("th",{key:S,style:Tm(f,S)},p(_,m))}))),n("tbody",null,f.A.map(function(_,S){return n("tr",{key:S},_.map(function(v,w){return n("td",{key:w,style:Tm(f,w)},p(v,m))}))})))},tableSeparator:{t:function(f,p){return p.$?(p._=!0,MC.exec(f)):null},i:xe.HIGH,l:function(){return{type:"tableSeparator"}},h:()=>" | "},text:{t:Es(WC),i:xe.MIN,l:f=>({v:f[0].replace(wC,(p,m)=>t.namedCodesToUnicode[m]?t.namedCodesToUnicode[m]:p)}),h:f=>f.v},textBolded:{t:Xr(jC),i:xe.MED,l:(f,p,m)=>({v:p(f[2],m)}),h:(f,p,m)=>n("strong",{key:m.k},p(f.v,m))},textEmphasized:{t:Xr(HC),i:xe.LOW,l:(f,p,m)=>({v:p(f[2],m)}),h:(f,p,m)=>n("em",{key:m.k},p(f.v,m))},textEscaped:{t:Xr(VC),i:xe.HIGH,l:f=>({v:f[1],type:"text"})},textMarked:{t:Xr(qC),i:xe.LOW,l:al,h:(f,p,m)=>n("mark",{key:m.k},p(f.v,m))},textStrikethroughed:{t:Xr(GC),i:xe.LOW,l:al,h:(f,p,m)=>n("del",{key:m.k},p(f.v,m))}};t.disableParsingRawHTML!==!0&&(c.htmlBlock={t:Es(rf),i:xe.HIGH,l(f,p,m){const[,_]=f[3].match(QC),S=new RegExp(`^${_}`,"gm"),v=f[3].replace(S,""),w=(A=v,t1.some(R=>R.test(A))?a1:Ga);var A;const b=f[1].toLowerCase(),N=uC.indexOf(b)!==-1;m.N=m.N||b==="a";const k=N?f[3]:w(p,v,m);return m.N=!1,{O:o(f[2]),v:k,G:N,H:N?b:f[1]}},h:(f,p,m)=>n(f.H,qn({key:m.k},f.O),f.G?f.v:p(f.v,m))},c.htmlSelfClosing={t:Es(nf),i:xe.HIGH,l:f=>({O:o(f[2]||""),H:f[1]}),h:(f,p,m)=>n(f.H,qn({},f.O,{key:m.k}))});const l=function(f){let p=Object.keys(f);function m(_,S){let v=[],w="";for(;_;){let A=0;for(;A<p.length;){const b=p[A],N=f[b],k=N.t(_,S,w);if(k){const R=k[0];_=_.substring(R.length);const $=N.l(k,m,S);$.type==null&&($.type=b),v.push($),w=R;break}A++}}return v}return p.sort(function(_,S){let v=f[_].i,w=f[S].i;return v!==w?v-w:_<S?-1:1}),function(_,S){return m(function(v){return v.replace(yC,`
99
99
  `).replace(_C,"").replace(kC," ")}(_),S)}}(c),u=(h=function(f){return function(p,m,_){return f[p.type].h(p,m,_)}}(c),function f(p,m={}){if(Array.isArray(p)){const _=m.k,S=[];let v=!1;for(let w=0;w<p.length;w++){m.k=w;const A=f(p[w],m),b=typeof A=="string";b&&v?S[S.length-1]+=A:A!==null&&S.push(A),v=b}return m.k=_,S}return h(p,f,m)});var h;const d=i(e);return a.length?n("div",null,d,n("footer",{key:"footer"},a.map(function(f){return n("div",{id:t.slugify(f.j),key:f.j},f.j,u(l(f.I,{_:!0})))}))):d}(function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"})(xe||(xe={}));const xu=e=>{let{children:t,options:r}=e,n=function(i,o){if(i==null)return{};var a,s,c={},l=Object.keys(i);for(s=0;s<l.length;s++)o.indexOf(a=l[s])>=0||(c[a]=i[a]);return c}(e,aC);return pe.cloneElement(c1(t,r),n)};const Br=({variant:e="primary",className:t="",children:r,...n})=>T.jsx("div",{className:se("highlighted-text-box",e,t),...n,children:r});const aa=({variant:e="empty",text:t=!1,button:r=!1,className:n=""})=>{let i=r&&!!Object.keys(r).length;const o=typeof r=="object"&&"breakpoints"in r,a=ra(o);if(o&&typeof r=="object"&&typeof a=="number"){const h=Object.assign({},r.breakpoints),d=xv(Object.keys(h));i=Ov(a,d,h)}const{breakpoints:s,text:c="",component:l,...u}=r;return T.jsx(Br,{variant:"subtle",className:se("empty-state-box",e,n),children:T.jsxs(T.Fragment,{children:[t&&T.jsx(xu,{options:{forceBlock:!0},children:t}),i&&typeof r=="object"&&(l||T.jsx(ze,{...u,variant:r.variant?r.variant:"secondary",children:c}))]})})};const of=({children:e,...t})=>T.jsx("p",{...t,children:e}),O0={q:of,blockquote:of};for(let e=1;e<=6;e++)O0[`h${e}`]={component:of,props:{className:"title"}};const A0=({type:e="default",className:t="",heading:r=!1,children:n})=>T.jsxs("div",{className:se("helper-text-box text-small",e,t),children:[r&&T.jsx("p",{className:"title",children:r}),typeof n=="string"?T.jsx(xu,{options:{wrapper:U.Fragment,forceBlock:!0,overrides:O0},children:n}):T.jsx("p",{children:n})]});const l1=({className:e="",show:t=!1,hide:r=!1,text:n,children:i})=>{const o=Se(),a=U.useRef(null),[s,c]=U.useState(""),[l,u]=U.useState("closed");U.useEffect(()=>{const f=a.current;if(f)return f.addEventListener("transitionend",h),()=>{f.removeEventListener("transitionend",h)}},[]),U.useEffect(()=>{if(!n||typeof n!="string")return;const f=n.split(`
100
100
  `);c(f.length<3?`${n.substring(0,400)}...`:f.slice(0,3).join(`
101
- `))},[n]),U.useEffect(()=>{l==="ready-to-close"&&u("closing")},[l]);const h=({propertyName:f})=>{f==="max-height"&&u(p=>p==="opening"?"open":p==="closing"?"closed":p)};if(!n)return null;const d=["opening","open"].includes(l);return T.jsxs(Br,{variant:"subtle",className:se("hide-show-text-box",e),children:[T.jsxs("div",{ref:a,className:se("content",l),children:[T.jsx(xu,{options:{forceBlock:!0},children:l==="closed"?s:n}),l!=="closed"&&i]}),T.jsx("p",{className:"cta",children:T.jsx(ze,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:se({"rotate-180":d}),onClick:()=>{u(d?"ready-to-close":"opening")},children:d?r||o.formatMessage({id:"hideShowTextBox_hide"}):t||o.formatMessage({id:"hideShowTextBox_show"})})})]})},f1=()=>U.Fragment,h1=({children:e})=>T.jsx(Br,{variant:"secondary",children:e}),d1=["span","strong","h1","h2","h3","h4","h5","h6","p"],p1=({children:e})=>{const t=Se();if(!e)return null;let r=t.formatMessage({id:"markdown_collapsibleSection_summary"});const n=[];for(const o of U.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number"))if(U.isValidElement(o)&&o.type==="summary"){if(o.props&&o.props.children){for(const a of U.Children.toArray(o.props.children))if(!(!a||typeof a=="string"||typeof a=="number")&&U.isValidElement(a)){const s=a.type;if(d1.includes(s)){for(r=a.props.children;typeof r!="string"&&(Array.isArray(r)&&r[0].props&&r[0].props.children&&r[0].props.children[0]);)r=r[0].props.children[0];break}}}}else n.push(o);const i=r?r.toString():"";return T.jsx(Xf,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:n.map(o=>o)})},m1=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return T.jsx(Br,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return T.jsx(Br,{variant:"primary",children:e});case"pink-textbox":return T.jsx(Br,{variant:"tertiary",children:e});default:return T.jsx("div",{...t,children:e})}return T.jsx("div",{...t,children:e})},g1=e=>{const t=Se(),r=Date.now().toString();let n="default";const i=e.src;return i.includes("youtube")||i.includes("vimeo")?n="video":i.includes("riddle")||i.includes("sli.do")?n="poll":i.includes("padlet")&&(n="padlet"),T.jsxs(T.Fragment,{children:[T.jsx(lt,{children:T.jsx("a",{href:`#content-after-iframe-${r}`,children:t.formatMessage({id:`markdown_skip${n==="default"?"":`_${n}`}`})})}),T.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${n==="default"?"":`_${n}`}`})}),T.jsx("span",{id:`content-after-iframe-${r}`,tabIndex:-1})]})},Om=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},y1=({children:e,...t})=>{let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let n=e,i=!1;for(const o of U.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&U.isValidElement(o)){const a=o.type;if(["button","center","span","strong"].includes(a)&&o.props&&o.props.children&&o.props.children[0])for((a==="button"||Om(o.props.children[0])==="button")&&(i=!0),n=o.props.children[0];n&&typeof n!="string"&&!(typeof n=="boolean"||typeof n=="number"||!U.isValidElement(n));)if(n.props&&n.props.children&&n.props.children[0])n=n.props.children[0],n&&Om(n)==="button"&&(i=!0);else break}return i?(r={...r,className:"button primary medium"},T.jsx("p",{className:"center",children:T.jsx(ze,{variant:"primary",size:"medium",...r,children:n})})):T.jsx("a",{...r,children:n})},C0=({children:e})=>T.jsx("span",{children:e});const sf=({className:e="",options:t={},children:r})=>{r=r.replace(/^<br\/?>/,"");const n={wrapper:U.Fragment,forceBlock:!0,overrides:{a:y1,CollapsibleSection:Xf,TextBox:Br,CaseStudy:h1,style:f1,details:p1,div:m1,iframe:g1}};return T.jsx("div",{className:se("markdown-text",e),children:T.jsx(xu,{options:{...n,...t},children:r})})};const R0=({size:e="medium",variant:t="default",className:r="",children:n})=>T.jsx("span",{className:se("pill",e,t,r),children:n});const nu=({element:e="p",children:t=null,className:r="",...n})=>U.createElement(e,{...n,className:se("status-banner text-small",r),"aria-live":"assertive"},t);const v1=({progress:e=0,text:t=!1,className:r=""})=>{const n=Se(),i=e>75?100:e>50?75:e>25?50:e>5?25:0,o={"--progress":`${e}%`};return T.jsx("span",{className:se(`progress-bar section-${i}`,r),style:o,children:T.jsx(lt,{children:t?`${e} ${t}`:n.formatMessage({id:"progressBar"},{number:e})})})},P0=U.memo(v1);const fl="loadingBlock_",E1=({progress:e=0,steps:t=!1,className:r=""})=>{const n=Se();t||(t={0:{text:n.formatMessage({id:`${fl}loading`})},75:{text:n.formatMessage({id:`${fl}almostDone`})},100:{text:n.formatMessage({id:`${fl}complete`})}});let i=null;const o=Object.keys(t);for(let s=0;s<o.length&&!(e<parseInt(o[s]));s++)i=o[s];const a=i&&t[i].icon?{"--icon":`url(${ru}icons/${t[i].icon}.svg)`}:{};return T.jsxs(Br,{className:se("loading-block",r,{"has-icon":i&&t[i].icon}),variant:"subtle",style:a,children:[i&&T.jsx("span",{className:"step",children:t[i].text}),T.jsx(P0,{progress:e})]})},_1=U.memo(E1);const yr=({element:e="div",className:t="",...r})=>T.jsx(Of,{element:e,className:se("loading-placeholder",t),...r});const af={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],cards:["card","card","card","card"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"]},N0=(e,t)=>e in af?T.jsx("div",{className:e,children:af[e].map((r,n)=>N0(r,n))},t):T.jsx(yr,{className:e},t),I0=({layout:e="overview-page"})=>T.jsx("div",{className:se("loading-state",e),children:af[e].map((t,r)=>N0(t,r))}),L0=e=>{const t=e&&e.toUpperCase().split(" ");return Array.isArray(t)&&t.length>1&&t[0]!==""?t[1]===""?t[0][0]:t[0][0]+t[t.length-1][0]:e?e.substr(0,1):""},ka=["#5AB6A3","#A2D7AF","#806056","#3962B3"],b1=e=>{const t=Math.ceil(26/ka.length),r=L0(e).toLowerCase();if(r==="")return ka[0];const n=r.charCodeAt(0)-96;for(let i=0;i<ka.length;i++)if(n<=t*(i+1))return ka[i]};const Am=256,Ou=({className:e="",src:t="",name:r,alt:n,width:i=Am,height:o=Am,...a})=>{const[s,c]=U.useState(!1),l=U.useRef(null);U.useEffect(()=>{const h=l.current;if(!h)return;const d=h.getContext("2d");if(!d)return;const f=i,p=o;typeof window<"u"&&window.devicePixelRatio&&(h.width=f*window.devicePixelRatio,h.height=p*window.devicePixelRatio,d.scale(window.devicePixelRatio,window.devicePixelRatio)),d.fillStyle=b1(r),d.fillRect(0,0,f,p),d.font=`${f/3}px Arial`,d.textAlign="center",d.fillStyle="white",d.fillText(L0(r),f/2,p/1.6)},[r]);let u=!1;return t&&t!==""&&!s&&(t.includes("http")||t.includes("//"))&&(u=!0),T.jsx("figure",{className:se("profile-picture",e,{error:s}),...a,children:u?T.jsx("img",{src:t,alt:n||r,onError:()=>{c(!0)},width:i,height:o}):T.jsx("canvas",{ref:l})})},eh=e=>e==="apolitical"?{image:`${ru}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${ru}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.country||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail},w1=({role:e="",organisation:t="",country:r="",maximumCharacters:n=80})=>{const i=e!=="",o=t!=="",a=r!=="";if(!i&&!o&&!a)return"";const s=`${e}${i&&o?` — ${t}`:t}`;let c=`${s}${(i||o)&&a?`, ${r}`:r}`;return c.length>n&&(c=s),c.length>n&&(c=Kf(c,n)),c};const Au=({element:e="div",member:t="community",additionalContent:r=!1,gtmContext:n="member",gtmType:i="member-click",className:o=""})=>{const a=Se(),s=eh(t);s.name||(s.name=a.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:c,url:l,image:u}=s,h=w1(s),d=r&&r.createdAt?wO(r.createdAt):!1,f=r&&r.createdAt?bO(r.createdAt):"";return U.createElement(e,{className:se("member text-medium",o),children:T.jsxs(ia,{href:l,gtmType:i,gtmContext:n,onClick:p=>{p==null||p.stopPropagation()},children:[T.jsx(Ou,{name:c,src:u}),T.jsxs("p",{className:"details",children:[T.jsx("strong",{children:c}),r&&T.jsxs("span",{className:"additional-content",children:[r.createdAt&&d&&T.jsx("span",{className:"date",title:f,"aria-label":f,children:a.formatMessage({id:`dates_${d.path}`},{number:d.number})}),r.didEdit&&T.jsx("em",{children:a.formatMessage({id:"discussion_edited"})})]}),h&&T.jsx("small",{children:h})]})]})})};const Cm={small:24,medium:48},k0=({element:e="div",contributors:{total:t,data:r}={total:void 0,data:[]},styling:{showText:n,size:i,showGap:o,showPlaceholders:a}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:s=2,className:c=""})=>{const l=Se();return!r||r.length===0?null:U.createElement(e,{className:se("contributors",c,i,{"has-gap":o}),children:T.jsxs(T.Fragment,{children:[T.jsx("ul",{children:r.map((u,h)=>{let d,f="";if(h<s){const{name:p="",image:m=""}=eh(u);if(a)return T.jsx(yr,{element:"li",className:"contributor"},h);d=T.jsx(Ou,{name:p,src:m,width:Cm[i||"medium"],height:Cm[i||"medium"]})}else if(h===s){const p=(t||r.length)-s;d=T.jsxs("small",{className:se({"large-number":p>99}),children:["+",CO(p,0)]}),f="number-left"}return d?T.jsx("li",{className:se("contributor",f),children:d},h):null})}),n&&T.jsx("span",{className:"label",children:typeof n=="string"?n:r.length===1?typeof r[0]=="string"?l.formatMessage({id:`member_${r[0]}`}):Kf(r[0].name||"",20):null})]})})},S1=({children:e,locale:t,messages:r})=>{const n=t||"en",i={...AO[n],...r||{}};return T.jsx(XA,{locale:n,messages:i,children:e})},$r=U.createContext(null),T1=({children:e,user:t})=>T.jsx($r.Provider,{value:t,children:e});var mo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ao=typeof window>"u"||"Deno"in window;function jt(){}function x1(e,t){return typeof e=="function"?e(t):e}function uf(e){return typeof e=="number"&&e>=0&&e!==1/0}function M0(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rm(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(n){if(t.queryHash!==th(a,t.options))return!1}else if(!Ps(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Pm(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Rs(t.options.mutationKey)!==Rs(o))return!1}else if(!Ps(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function th(e,t){return((t==null?void 0:t.queryKeyHashFn)||Rs)(e)}function Rs(e){return JSON.stringify(e,(t,r)=>cf(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Ps(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!Ps(e[r],t[r])):!1}function F0(e,t){if(e===t)return e;const r=Nm(e)&&Nm(t);if(r||cf(e)&&cf(t)){const n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),o=i.length,a=r?[]:{};let s=0;for(let c=0;c<o;c++){const l=r?c:i[c];a[l]=F0(e[l],t[l]),a[l]===e[l]&&s++}return n===o&&s===n?e:a}return t}function iu(e,t){if(e&&!t||t&&!e)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Nm(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cf(e){if(!Im(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!Im(r)||!r.hasOwnProperty("isPrototypeOf"))}function Im(e){return Object.prototype.toString.call(e)==="[object Object]"}function D0(e){return new Promise(t=>{setTimeout(t,e)})}function Lm(e){D0(0).then(e)}function lf(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?F0(e,t):t}function O1(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function A1(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Gn,en,ki,eg,C1=(eg=class extends mo{constructor(){super();ie(this,Gn,void 0);ie(this,en,void 0);ie(this,ki,void 0);ee(this,ki,t=>{if(!ao&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){P(this,en)||this.setEventListener(P(this,ki))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,en))==null||t.call(this),ee(this,en,void 0))}setEventListener(t){var r;ee(this,ki,t),(r=P(this,en))==null||r.call(this),ee(this,en,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){P(this,Gn)!==t&&(ee(this,Gn,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof P(this,Gn)=="boolean"?P(this,Gn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Gn=new WeakMap,en=new WeakMap,ki=new WeakMap,eg),ou=new C1,Mi,tn,Fi,tg,R1=(tg=class extends mo{constructor(){super();ie(this,Mi,!0);ie(this,tn,void 0);ie(this,Fi,void 0);ee(this,Fi,t=>{if(!ao&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){P(this,tn)||this.setEventListener(P(this,Fi))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,tn))==null||t.call(this),ee(this,tn,void 0))}setEventListener(t){var r;ee(this,Fi,t),(r=P(this,tn))==null||r.call(this),ee(this,tn,t(this.setOnline.bind(this)))}setOnline(t){P(this,Mi)!==t&&(ee(this,Mi,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return P(this,Mi)}},Mi=new WeakMap,tn=new WeakMap,Fi=new WeakMap,tg),Ns=new R1;function P1(e){return Math.min(1e3*2**e,3e4)}function Cu(e){return(e??"online")==="online"?Ns.isOnline():!0}var B0=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function hl(e){return e instanceof B0}function U0(e){let t=!1,r=0,n=!1,i,o,a;const s=new Promise((_,S)=>{o=_,a=S}),c=_=>{var S;n||(f(new B0(_)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},u=()=>{t=!1},h=()=>!ou.isFocused()||e.networkMode!=="always"&&!Ns.isOnline(),d=_=>{var S;n||(n=!0,(S=e.onSuccess)==null||S.call(e,_),i==null||i(),o(_))},f=_=>{var S;n||(n=!0,(S=e.onError)==null||S.call(e,_),i==null||i(),a(_))},p=()=>new Promise(_=>{var S;i=v=>{const w=n||!h();return w&&_(v),w},(S=e.onPause)==null||S.call(e)}).then(()=>{var _;i=void 0,n||(_=e.onContinue)==null||_.call(e)}),m=()=>{if(n)return;let _;try{_=e.fn()}catch(S){_=Promise.reject(S)}Promise.resolve(_).then(d).catch(S=>{var N;if(n)return;const v=e.retry??(ao?0:3),w=e.retryDelay??P1,A=typeof w=="function"?w(r,S):w,b=v===!0||typeof v=="number"&&r<v||typeof v=="function"&&v(r,S);if(t||!b){f(S);return}r++,(N=e.onFail)==null||N.call(e,r,S),D0(A).then(()=>{if(h())return p()}).then(()=>{t?f(S):m()})})};return Cu(e.networkMode)?m():p().then(m),{promise:s,cancel:c,continue:()=>(i==null?void 0:i())?s:Promise.resolve(),cancelRetry:l,continueRetry:u}}function N1(){let e=[],t=0,r=u=>{u()},n=u=>{u()};const i=u=>{let h;t++;try{h=u()}finally{t--,t||s()}return h},o=u=>{t?e.push(u):Lm(()=>{r(u)})},a=u=>(...h)=>{o(()=>{u(...h)})},s=()=>{const u=e;e=[],u.length&&Lm(()=>{n(()=>{u.forEach(h=>{r(h)})})})};return{batch:i,batchCalls:a,schedule:o,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}var Ke=N1(),Vn,rg,$0=(rg=class{constructor(){ie(this,Vn,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uf(this.gcTime)&&ee(this,Vn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ao?1/0:5*60*1e3))}clearGcTimeout(){P(this,Vn)&&(clearTimeout(P(this,Vn)),ee(this,Vn,void 0))}},Vn=new WeakMap,rg),Di,Bi,Dt,rn,Bt,it,Fs,Wn,Ui,Va,Zt,kr,ng,I1=(ng=class extends $0{constructor(t){super();ie(this,Ui);ie(this,Zt);ie(this,Di,void 0);ie(this,Bi,void 0);ie(this,Dt,void 0);ie(this,rn,void 0);ie(this,Bt,void 0);ie(this,it,void 0);ie(this,Fs,void 0);ie(this,Wn,void 0);ee(this,Wn,!1),ee(this,Fs,t.defaultOptions),ye(this,Ui,Va).call(this,t.options),ee(this,it,[]),ee(this,Dt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,Di,t.state||L1(this.options)),this.state=P(this,Di),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!P(this,it).length&&this.state.fetchStatus==="idle"&&P(this,Dt).remove(this)}setData(t,r){const n=lf(this.state.data,t,this.options);return ye(this,Zt,kr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ye(this,Zt,kr).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n;const r=P(this,rn);return(n=P(this,Bt))==null||n.cancel(t),r?r.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,Di))}isActive(){return P(this,it).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||P(this,it).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!M0(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=P(this,it).find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,Bt))==null||r.continue()}onOnline(){var r;const t=P(this,it).find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,Bt))==null||r.continue()}addObserver(t){P(this,it).includes(t)||(P(this,it).push(t),this.clearGcTimeout(),P(this,Dt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){P(this,it).includes(t)&&(ee(this,it,P(this,it).filter(r=>r!==t)),P(this,it).length||(P(this,Bt)&&(P(this,Wn)?P(this,Bt).cancel({revert:!0}):P(this,Bt).cancelRetry()),this.scheduleGc()),P(this,Dt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return P(this,it).length}invalidate(){this.state.isInvalidated||ye(this,Zt,kr).call(this,{type:"invalidate"})}fetch(t,r){var l,u,h,d;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(P(this,rn))return(l=P(this,Bt))==null||l.continueRetry(),P(this,rn)}if(t&&ye(this,Ui,Va).call(this,t),!this.options.queryFn){const f=P(this,it).find(p=>p.options.queryFn);f&&ye(this,Ui,Va).call(this,f.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(ee(this,Wn,!0),n.signal)})};o(i);const a=()=>this.options.queryFn?(ee(this,Wn,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),s={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};o(s),(u=this.options.behavior)==null||u.onFetch(s,this),ee(this,Bi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=s.fetchOptions)==null?void 0:h.meta))&&ye(this,Zt,kr).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta});const c=f=>{var p,m,_,S;hl(f)&&f.silent||ye(this,Zt,kr).call(this,{type:"error",error:f}),hl(f)||((m=(p=P(this,Dt).config).onError)==null||m.call(p,f,this),(S=(_=P(this,Dt).config).onSettled)==null||S.call(_,this.state.data,f,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return ee(this,Bt,U0({fn:s.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var p,m,_,S;if(typeof f>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),c(new Error(`${this.queryHash} data is undefined`));return}this.setData(f),(m=(p=P(this,Dt).config).onSuccess)==null||m.call(p,f,this),(S=(_=P(this,Dt).config).onSettled)==null||S.call(_,f,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(f,p)=>{ye(this,Zt,kr).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{ye(this,Zt,kr).call(this,{type:"pause"})},onContinue:()=>{ye(this,Zt,kr).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode})),ee(this,rn,P(this,Bt).promise),P(this,rn)}},Di=new WeakMap,Bi=new WeakMap,Dt=new WeakMap,rn=new WeakMap,Bt=new WeakMap,it=new WeakMap,Fs=new WeakMap,Wn=new WeakMap,Ui=new WeakSet,Va=function(t){this.options={...P(this,Fs),...t},this.updateGcTime(this.options.gcTime)},Zt=new WeakSet,kr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Cu(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return hl(i)&&i.revert&&P(this,Bi)?{...P(this,Bi),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ke.batch(()=>{P(this,it).forEach(n=>{n.onQueryUpdate()}),P(this,Dt).notify({query:this,type:"updated",action:t})})},ng);function L1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof t<"u",n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var lr,ig,k1=(ig=class extends mo{constructor(t={}){super();ie(this,lr,void 0);this.config=t,ee(this,lr,new Map)}build(t,r,n){const i=r.queryKey,o=r.queryHash??th(i,r);let a=this.get(o);return a||(a=new I1({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){P(this,lr).has(t.queryHash)||(P(this,lr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=P(this,lr).get(t.queryHash);r&&(t.destroy(),r===t&&P(this,lr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,lr).get(t)}getAll(){return[...P(this,lr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Rm(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Rm(t,n)):r}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},lr=new WeakMap,ig),fr,Ds,Lt,$i,hr,Jr,og,M1=(og=class extends $0{constructor(t){super();ie(this,hr);ie(this,fr,void 0);ie(this,Ds,void 0);ie(this,Lt,void 0);ie(this,$i,void 0);this.mutationId=t.mutationId,ee(this,Ds,t.defaultOptions),ee(this,Lt,t.mutationCache),ee(this,fr,[]),this.state=t.state||j0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...P(this,Ds),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,fr).includes(t)||(P(this,fr).push(t),this.clearGcTimeout(),P(this,Lt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,fr,P(this,fr).filter(r=>r!==t)),this.scheduleGc(),P(this,Lt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,fr).length||(this.state.status==="pending"?this.scheduleGc():P(this,Lt).remove(this))}continue(){var t;return((t=P(this,$i))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,a,s,c,l,u,h,d,f,p,m,_,S,v,w,A,b,N,k;const r=()=>(ee(this,$i,U0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(R,$)=>{ye(this,hr,Jr).call(this,{type:"failed",failureCount:R,error:$})},onPause:()=>{ye(this,hr,Jr).call(this,{type:"pause"})},onContinue:()=>{ye(this,hr,Jr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),P(this,$i).promise),n=this.state.status==="pending";try{if(!n){ye(this,hr,Jr).call(this,{type:"pending",variables:t}),await((o=(i=P(this,Lt).config).onMutate)==null?void 0:o.call(i,t,this));const $=await((s=(a=this.options).onMutate)==null?void 0:s.call(a,t));$!==this.state.context&&ye(this,hr,Jr).call(this,{type:"pending",context:$,variables:t})}const R=await r();return await((l=(c=P(this,Lt).config).onSuccess)==null?void 0:l.call(c,R,t,this.state.context,this)),await((h=(u=this.options).onSuccess)==null?void 0:h.call(u,R,t,this.state.context)),await((f=(d=P(this,Lt).config).onSettled)==null?void 0:f.call(d,R,null,this.state.variables,this.state.context,this)),await((m=(p=this.options).onSettled)==null?void 0:m.call(p,R,null,t,this.state.context)),ye(this,hr,Jr).call(this,{type:"success",data:R}),R}catch(R){try{throw await((S=(_=P(this,Lt).config).onError)==null?void 0:S.call(_,R,t,this.state.context,this)),await((w=(v=this.options).onError)==null?void 0:w.call(v,R,t,this.state.context)),await((b=(A=P(this,Lt).config).onSettled)==null?void 0:b.call(A,void 0,R,this.state.variables,this.state.context,this)),await((k=(N=this.options).onSettled)==null?void 0:k.call(N,void 0,R,t,this.state.context)),R}finally{ye(this,hr,Jr).call(this,{type:"error",error:R})}}}},fr=new WeakMap,Ds=new WeakMap,Lt=new WeakMap,$i=new WeakMap,hr=new WeakSet,Jr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Cu(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ke.batch(()=>{P(this,fr).forEach(n=>{n.onMutationUpdate(t)}),P(this,Lt).notify({mutation:this,type:"updated",action:t})})},og);function j0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ut,Bs,zn,sg,F1=(sg=class extends mo{constructor(t={}){super();ie(this,Ut,void 0);ie(this,Bs,void 0);ie(this,zn,void 0);this.config=t,ee(this,Ut,[]),ee(this,Bs,0)}build(t,r,n){const i=new M1({mutationCache:this,mutationId:++la(this,Bs)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){P(this,Ut).push(t),this.notify({type:"added",mutation:t})}remove(t){ee(this,Ut,P(this,Ut).filter(r=>r!==t)),this.notify({type:"removed",mutation:t})}clear(){Ke.batch(()=>{P(this,Ut).forEach(t=>{this.remove(t)})})}getAll(){return P(this,Ut)}find(t){const r={exact:!0,...t};return P(this,Ut).find(n=>Pm(r,n))}findAll(t={}){return P(this,Ut).filter(r=>Pm(t,r))}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){return ee(this,zn,(P(this,zn)??Promise.resolve()).then(()=>{const t=P(this,Ut).filter(r=>r.state.isPaused);return Ke.batch(()=>t.reduce((r,n)=>r.then(()=>n.continue().catch(jt)),Promise.resolve()))}).then(()=>{ee(this,zn,void 0)})),P(this,zn)}},Ut=new WeakMap,Bs=new WeakMap,zn=new WeakMap,sg);function D1(e){return{onFetch:(t,r)=>{const n=async()=>{var p,m,_,S,v;const i=t.options,o=(_=(m=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:m.fetchMore)==null?void 0:_.direction,a=((S=t.state.data)==null?void 0:S.pages)||[],s=((v=t.state.data)==null?void 0:v.pageParams)||[],c={pages:[],pageParams:[]};let l=!1;const u=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?l=!0:t.signal.addEventListener("abort",()=>{l=!0}),t.signal)})},h=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),d=async(w,A,b)=>{if(l)return Promise.reject();if(A==null&&w.pages.length)return Promise.resolve(w);const N={queryKey:t.queryKey,pageParam:A,direction:b?"backward":"forward",meta:t.options.meta};u(N);const k=await h(N),{maxPages:R}=t.options,$=b?A1:O1;return{pages:$(w.pages,k,R),pageParams:$(w.pageParams,A,R)}};let f;if(o&&a.length){const w=o==="backward",A=w?B1:km,b={pages:a,pageParams:s},N=A(i,b);f=await d(b,N,w)}else{f=await d(c,s[0]??i.initialPageParam);const w=e??a.length;for(let A=1;A<w;A++){const b=km(i,f);f=await d(f,b)}}return f};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,n,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=n}}}function km(e,{pages:t,pageParams:r}){const n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function B1(e,{pages:t,pageParams:r}){var n;return(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r)}var Ye,nn,on,ji,Hi,sn,qi,Gi,ag,U1=(ag=class{constructor(e={}){ie(this,Ye,void 0);ie(this,nn,void 0);ie(this,on,void 0);ie(this,ji,void 0);ie(this,Hi,void 0);ie(this,sn,void 0);ie(this,qi,void 0);ie(this,Gi,void 0);ee(this,Ye,e.queryCache||new k1),ee(this,nn,e.mutationCache||new F1),ee(this,on,e.defaultOptions||{}),ee(this,ji,new Map),ee(this,Hi,new Map),ee(this,sn,0)}mount(){la(this,sn)._++,P(this,sn)===1&&(ee(this,qi,ou.subscribe(()=>{ou.isFocused()&&(this.resumePausedMutations(),P(this,Ye).onFocus())})),ee(this,Gi,Ns.subscribe(()=>{Ns.isOnline()&&(this.resumePausedMutations(),P(this,Ye).onOnline())})))}unmount(){var e,t;la(this,sn)._--,P(this,sn)===0&&((e=P(this,qi))==null||e.call(this),ee(this,qi,void 0),(t=P(this,Gi))==null||t.call(this),ee(this,Gi,void 0))}isFetching(e){return P(this,Ye).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,nn).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=P(this,Ye).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=P(this,Ye).find({queryKey:e}),i=n==null?void 0:n.state.data,o=x1(t,i);if(typeof o>"u")return;const a=this.defaultQueryOptions({queryKey:e});return P(this,Ye).build(this,a).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Ke.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var t;return(t=P(this,Ye).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=P(this,Ye);Ke.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=P(this,Ye),n={type:"active",...e};return Ke.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=Ke.batch(()=>P(this,Ye).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(jt).catch(jt)}invalidateQueries(e={},t={}){return Ke.batch(()=>{if(P(this,Ye).findAll(e).forEach(n=>{n.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){const r={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},n=Ke.batch(()=>P(this,Ye).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(jt)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const r=P(this,Ye).build(this,t);return r.isStaleByTime(t.staleTime)?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=D1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}resumePausedMutations(){return P(this,nn).resumePausedMutations()}getQueryCache(){return P(this,Ye)}getMutationCache(){return P(this,nn)}getDefaultOptions(){return P(this,on)}setDefaultOptions(e){ee(this,on,e)}setQueryDefaults(e,t){P(this,ji).set(Rs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,ji).values()];let r={};return t.forEach(n=>{Ps(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){P(this,Hi).set(Rs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Hi).values()];let r={};return t.forEach(n=>{Ps(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...P(this,on).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=th(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,on).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,Ye).clear(),P(this,nn).clear()}},Ye=new WeakMap,nn=new WeakMap,on=new WeakMap,ji=new WeakMap,Hi=new WeakMap,sn=new WeakMap,qi=new WeakMap,Gi=new WeakMap,ag),At,Be,Vi,pt,Qn,Wi,dr,Us,zi,Qi,Yn,Kn,an,Xn,Jn,_s,$s,ff,js,hf,Hs,df,qs,pf,Gs,mf,Vs,gf,Ws,yf,gu,H0,ug,$1=(ug=class extends mo{constructor(t,r){super();ie(this,Jn);ie(this,$s);ie(this,js);ie(this,Hs);ie(this,qs);ie(this,Gs);ie(this,Vs);ie(this,Ws);ie(this,gu);ie(this,At,void 0);ie(this,Be,void 0);ie(this,Vi,void 0);ie(this,pt,void 0);ie(this,Qn,void 0);ie(this,Wi,void 0);ie(this,dr,void 0);ie(this,Us,void 0);ie(this,zi,void 0);ie(this,Qi,void 0);ie(this,Yn,void 0);ie(this,Kn,void 0);ie(this,an,void 0);ie(this,Xn,void 0);ee(this,Be,void 0),ee(this,Vi,void 0),ee(this,pt,void 0),ee(this,Xn,new Set),ee(this,At,t),this.options=r,ee(this,dr,null),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,Be).addObserver(this),Mm(P(this,Be),this.options)&&ye(this,Jn,_s).call(this),ye(this,qs,pf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vf(P(this,Be),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vf(P(this,Be),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ye(this,Gs,mf).call(this),ye(this,Vs,gf).call(this),P(this,Be).removeObserver(this)}setOptions(t,r){const n=this.options,i=P(this,Be);if(this.options=P(this,At).defaultQueryOptions(t),iu(n,this.options)||P(this,At).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,Be),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),ye(this,Ws,yf).call(this);const o=this.hasListeners();o&&Fm(P(this,Be),i,this.options,n)&&ye(this,Jn,_s).call(this),this.updateResult(r),o&&(P(this,Be)!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&ye(this,$s,ff).call(this);const a=ye(this,js,hf).call(this);o&&(P(this,Be)!==i||this.options.enabled!==n.enabled||a!==P(this,an))&&ye(this,Hs,df).call(this,a)}getOptimisticResult(t){const r=P(this,At).getQueryCache().build(P(this,At),t),n=this.createResult(r,t);return H1(this,n)&&(ee(this,pt,n),ee(this,Wi,this.options),ee(this,Qn,P(this,Be).state)),n}getCurrentResult(){return P(this,pt)}trackResult(t){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(P(this,Xn).add(n),t[n])})}),r}getCurrentQuery(){return P(this,Be)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=P(this,At).defaultQueryOptions(t),n=P(this,At).getQueryCache().build(P(this,At),r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ye(this,Jn,_s).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,pt)))}createResult(t,r){var N;const n=P(this,Be),i=this.options,o=P(this,pt),a=P(this,Qn),s=P(this,Wi),l=t!==n?t.state:P(this,Vi),{state:u}=t;let{error:h,errorUpdatedAt:d,fetchStatus:f,status:p}=u,m=!1,_;if(r._optimisticResults){const k=this.hasListeners(),R=!k&&Mm(t,r),$=k&&Fm(t,n,r,i);(R||$)&&(f=Cu(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(p="pending")),r._optimisticResults==="isRestoring"&&(f="idle")}if(r.select&&typeof u.data<"u")if(o&&u.data===(a==null?void 0:a.data)&&r.select===P(this,Us))_=P(this,zi);else try{ee(this,Us,r.select),_=r.select(u.data),_=lf(o==null?void 0:o.data,_,r),ee(this,zi,_),ee(this,dr,null)}catch(k){ee(this,dr,k)}else _=u.data;if(typeof r.placeholderData<"u"&&typeof _>"u"&&p==="pending"){let k;if(o!=null&&o.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData))k=o.data;else if(k=typeof r.placeholderData=="function"?r.placeholderData((N=P(this,Qi))==null?void 0:N.state.data,P(this,Qi)):r.placeholderData,r.select&&typeof k<"u")try{k=r.select(k),ee(this,dr,null)}catch(R){ee(this,dr,R)}typeof k<"u"&&(p="success",_=lf(o==null?void 0:o.data,k,r),m=!0)}P(this,dr)&&(h=P(this,dr),_=P(this,zi),d=Date.now(),p="error");const S=f==="fetching",v=p==="pending",w=p==="error",A=v&&S;return{status:p,fetchStatus:f,isPending:v,isSuccess:p==="success",isError:w,isInitialLoading:A,isLoading:A,data:_,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:d,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:S,isRefetching:S&&!v,isLoadingError:w&&u.dataUpdatedAt===0,isPaused:f==="paused",isPlaceholderData:m,isRefetchError:w&&u.dataUpdatedAt!==0,isStale:rh(t,r),refetch:this.refetch}}updateResult(t){const r=P(this,pt),n=this.createResult(P(this,Be),this.options);if(ee(this,Qn,P(this,Be).state),ee(this,Wi,this.options),iu(n,r))return;P(this,Qn).data!==void 0&&ee(this,Qi,P(this,Be)),ee(this,pt,n);const i={},o=()=>{if(!r)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!P(this,Xn).size)return!0;const c=new Set(s??P(this,Xn));return this.options.throwOnError&&c.add("error"),Object.keys(P(this,pt)).some(l=>{const u=l;return P(this,pt)[u]!==r[u]&&c.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),ye(this,gu,H0).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ye(this,qs,pf).call(this)}},At=new WeakMap,Be=new WeakMap,Vi=new WeakMap,pt=new WeakMap,Qn=new WeakMap,Wi=new WeakMap,dr=new WeakMap,Us=new WeakMap,zi=new WeakMap,Qi=new WeakMap,Yn=new WeakMap,Kn=new WeakMap,an=new WeakMap,Xn=new WeakMap,Jn=new WeakSet,_s=function(t){ye(this,Ws,yf).call(this);let r=P(this,Be).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(jt)),r},$s=new WeakSet,ff=function(){if(ye(this,Gs,mf).call(this),ao||P(this,pt).isStale||!uf(this.options.staleTime))return;const r=M0(P(this,pt).dataUpdatedAt,this.options.staleTime)+1;ee(this,Yn,setTimeout(()=>{P(this,pt).isStale||this.updateResult()},r))},js=new WeakSet,hf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,Be)):this.options.refetchInterval)??!1},Hs=new WeakSet,df=function(t){ye(this,Vs,gf).call(this),ee(this,an,t),!(ao||this.options.enabled===!1||!uf(P(this,an))||P(this,an)===0)&&ee(this,Kn,setInterval(()=>{(this.options.refetchIntervalInBackground||ou.isFocused())&&ye(this,Jn,_s).call(this)},P(this,an)))},qs=new WeakSet,pf=function(){ye(this,$s,ff).call(this),ye(this,Hs,df).call(this,ye(this,js,hf).call(this))},Gs=new WeakSet,mf=function(){P(this,Yn)&&(clearTimeout(P(this,Yn)),ee(this,Yn,void 0))},Vs=new WeakSet,gf=function(){P(this,Kn)&&(clearInterval(P(this,Kn)),ee(this,Kn,void 0))},Ws=new WeakSet,yf=function(){const t=P(this,At).getQueryCache().build(P(this,At),this.options);if(t===P(this,Be))return;const r=P(this,Be);ee(this,Be,t),ee(this,Vi,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},gu=new WeakSet,H0=function(t){Ke.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(P(this,pt))}),P(this,At).getQueryCache().notify({query:P(this,Be),type:"observerResultsUpdated"})})},ug);function j1(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Mm(e,t){return j1(e,t)||e.state.dataUpdatedAt>0&&vf(e,t,t.refetchOnMount)}function vf(e,t,r){if(t.enabled!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&rh(e,t)}return!1}function Fm(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&rh(e,r)}function rh(e,t){return e.isStaleByTime(t.staleTime)}function H1(e,t){return!iu(e.getCurrentResult(),t)}var un,Et,$t,Fr,Yi,Wa,zs,Ef,cg,q1=(cg=class extends mo{constructor(t,r){super();ie(this,Yi);ie(this,zs);ie(this,un,void 0);ie(this,Et,void 0);ie(this,$t,void 0);ie(this,Fr,void 0);ee(this,Et,void 0),ee(this,un,t),this.setOptions(r),this.bindMethods(),ye(this,Yi,Wa).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=P(this,un).defaultMutationOptions(t),iu(r,this.options)||P(this,un).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,$t),observer:this}),(n=P(this,$t))==null||n.setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=P(this,$t))==null||t.removeObserver(this)}onMutationUpdate(t){ye(this,Yi,Wa).call(this),ye(this,zs,Ef).call(this,t)}getCurrentResult(){return P(this,Et)}reset(){ee(this,$t,void 0),ye(this,Yi,Wa).call(this),ye(this,zs,Ef).call(this)}mutate(t,r){var n;return ee(this,Fr,r),(n=P(this,$t))==null||n.removeObserver(this),ee(this,$t,P(this,un).getMutationCache().build(P(this,un),this.options)),P(this,$t).addObserver(this),P(this,$t).execute(t)}},un=new WeakMap,Et=new WeakMap,$t=new WeakMap,Fr=new WeakMap,Yi=new WeakSet,Wa=function(){var r;const t=((r=P(this,$t))==null?void 0:r.state)??j0();ee(this,Et,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},zs=new WeakSet,Ef=function(t){Ke.batch(()=>{var r,n,i,o,a,s,c,l;P(this,Fr)&&this.hasListeners()&&((t==null?void 0:t.type)==="success"?((n=(r=P(this,Fr)).onSuccess)==null||n.call(r,t.data,P(this,Et).variables,P(this,Et).context),(o=(i=P(this,Fr)).onSettled)==null||o.call(i,t.data,null,P(this,Et).variables,P(this,Et).context)):(t==null?void 0:t.type)==="error"&&((s=(a=P(this,Fr)).onError)==null||s.call(a,t.error,P(this,Et).variables,P(this,Et).context),(l=(c=P(this,Fr)).onSettled)==null||l.call(c,void 0,t.error,P(this,Et).variables,P(this,Et).context))),this.listeners.forEach(u=>{u(P(this,Et))})})},cg),q0=pe.createContext(void 0),go=e=>{const t=pe.useContext(q0);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},G1=({client:e,children:t})=>(pe.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),pe.createElement(q0.Provider,{value:e},t)),G0=pe.createContext(!1),V1=()=>pe.useContext(G0);G0.Provider;function W1(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var z1=pe.createContext(W1()),Q1=()=>pe.useContext(z1);function V0(e,t){return typeof e=="function"?e(...t):!!e}var Y1=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},K1=e=>{pe.useEffect(()=>{e.clearReset()},[e])},X1=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&V0(r,[e.error,n]),J1=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},Z1=(e,t)=>e.isLoading&&e.isFetching&&!t,eR=(e,t,r)=>(e==null?void 0:e.suspense)&&Z1(t,r),tR=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function rR(e,t,r){const n=go(r),i=V1(),o=Q1(),a=n.defaultQueryOptions(e);a._optimisticResults=i?"isRestoring":"optimistic",J1(a),Y1(a,o),K1(o);const[s]=pe.useState(()=>new t(n,a)),c=s.getOptimisticResult(a);if(pe.useSyncExternalStore(pe.useCallback(l=>{const u=i?()=>{}:s.subscribe(Ke.batchCalls(l));return s.updateResult(),u},[s,i]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),pe.useEffect(()=>{s.setOptions(a,{listeners:!1})},[a,s]),eR(a,c,i))throw tR(a,s,o);if(X1({result:c,errorResetBoundary:o,throwOnError:a.throwOnError,query:s.getCurrentQuery()}))throw c.error;return a.notifyOnChangeProps?c:s.trackResult(c)}function W0(e,t){return rR(e,$1,t)}function fn(e,t){const r=go(t),[n]=pe.useState(()=>new q1(r,e));pe.useEffect(()=>{n.setOptions(e)},[n,e]);const i=pe.useSyncExternalStore(pe.useCallback(a=>n.subscribe(Ke.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=pe.useCallback((a,s)=>{n.mutate(a,s).catch(nR)},[n]);if(i.error&&V0(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function nR(){}var ve={context:void 0,registry:void 0};function bs(e){ve.context=e}var iR=(e,t)=>e===t,Is=Symbol("solid-proxy"),nh=Symbol("solid-track"),oR=Symbol("solid-dev-component"),su={equals:iR},z0=X0,jr=1,au=2,Q0={owned:null,cleanups:null,context:null,owner:null},dl={},Ue=null,pl=null,Me=null,mt=null,Ur=null,Ru=0,[sR,lI]=bt(!1);function hn(e,t){const r=Me,n=Ue,i=e.length===0,o=i?Q0:{owned:null,cleanups:null,context:null,owner:t===void 0?n:t},a=i?e:()=>e(()=>Xe(()=>Nu(o)));Ue=o,Me=null;try{return vr(a,!0)}finally{Me=r,Ue=n}}function bt(e,t){t=t?Object.assign({},su,t):su;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=i=>(typeof i=="function"&&(i=i(r.value)),K0(r,i));return[Y0.bind(r),n]}function _f(e,t,r){const n=Pu(e,t,!0,jr);yo(n)}function dn(e,t,r){const n=Pu(e,t,!1,jr);yo(n)}function ih(e,t,r){z0=_R;const n=Pu(e,t,!1,jr);(!r||!r.render)&&(n.user=!0),Ur?Ur.push(n):yo(n)}function St(e,t,r){r=r?Object.assign({},su,r):su;const n=Pu(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,yo(n),Y0.bind(n)}function aR(e,t,r){let n,i,o;arguments.length===2&&typeof t=="object"||arguments.length===1?(n=!0,i=e,o=t||{}):(n=e,i=t,o=r||{});let a=null,s=dl,c=null,l=!1,u="initialValue"in o,h=typeof n=="function"&&St(n);const d=new Set,[f,p]=(o.storage||bt)(o.initialValue),[m,_]=bt(void 0),[S,v]=bt(void 0,{equals:!1}),[w,A]=bt(u?"ready":"unresolved");if(ve.context){c=`${ve.context.id}${ve.context.count++}`;let $;o.ssrLoadFrom==="initial"?s=o.initialValue:ve.load&&($=ve.load(c))&&(s=$[0])}function b($,G,q,H){return a===$&&(a=null,H!==void 0&&(u=!0),($===s||G===s)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(H,{value:G})),s=dl,N(G,q)),G}function N($,G){vr(()=>{G===void 0&&p(()=>$),A(G!==void 0?"errored":u?"ready":"unresolved"),_(G);for(const q of d.keys())q.decrement();d.clear()},!1)}function k(){const $=yR,G=f(),q=m();if(q!==void 0&&!a)throw q;return Me&&!Me.user&&$&&_f(()=>{S(),a&&($.resolved||d.has($)||($.increment(),d.add($)))}),G}function R($=!0){if($!==!1&&l)return;l=!1;const G=h?h():n;if(G==null||G===!1){b(a,Xe(f));return}const q=s!==dl?s:Xe(()=>i(G,{value:f(),refetching:$}));return typeof q!="object"||!(q&&"then"in q)?(b(a,q,void 0,G),q):(a=q,l=!0,queueMicrotask(()=>l=!1),vr(()=>{A(u?"refreshing":"pending"),v()},!1),q.then(H=>b(q,H,void 0,G),H=>b(q,void 0,Z0(H),G)))}return Object.defineProperties(k,{state:{get:()=>w()},error:{get:()=>m()},loading:{get(){const $=w();return $==="pending"||$==="refreshing"}},latest:{get(){if(!u)return k();const $=m();if($&&!a)throw $;return f()}}}),h?_f(()=>R(!1)):R(!1),[k,{refetch:R,mutate:p}]}function uR(e){return vr(e,!1)}function Xe(e){if(Me===null)return e();const t=Me;Me=null;try{return e()}finally{Me=t}}function cR(e,t,r){const n=Array.isArray(e);let i,o=r&&r.defer;return a=>{let s;if(n){s=Array(e.length);for(let l=0;l<e.length;l++)s[l]=e[l]()}else s=e();if(o){o=!1;return}const c=Xe(()=>t(s,i,a));return i=s,c}}function lR(e){ih(()=>Xe(e))}function Ls(e){return Ue===null||(Ue.cleanups===null?Ue.cleanups=[e]:Ue.cleanups.push(e)),e}function fR(){return Me}function Dm(){return Ue}function hR(e,t){const r=Ue,n=Me;Ue=e,Me=null;try{return vr(t,!0)}catch(i){sh(i)}finally{Ue=r,Me=n}}function dR(e){const t=Me,r=Ue;return Promise.resolve().then(()=>{Me=t,Ue=r;let n;return vr(e,!1),Me=Ue=null,n?n.done:void 0})}function pR(){return[sR,dR]}function mR(e,t){const r=Symbol("context");return{id:r,Provider:bR(r),defaultValue:e}}function gR(e){let t;return(t=eE(Ue,e.id))!==void 0?t:e.defaultValue}function oh(e){const t=St(e),r=St(()=>bf(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}var yR;function Y0(){if(this.sources&&this.state)if(this.state===jr)yo(this);else{const e=mt;mt=null,vr(()=>cu(this),!1),mt=e}if(Me){const e=this.observers?this.observers.length:0;Me.sources?(Me.sources.push(this),Me.sourceSlots.push(e)):(Me.sources=[this],Me.sourceSlots=[e]),this.observers?(this.observers.push(Me),this.observerSlots.push(Me.sources.length-1)):(this.observers=[Me],this.observerSlots=[Me.sources.length-1])}return this.value}function K0(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&vr(()=>{for(let i=0;i<e.observers.length;i+=1){const o=e.observers[i],a=pl&&pl.running;a&&pl.disposed.has(o),(a?!o.tState:!o.state)&&(o.pure?mt.push(o):Ur.push(o),o.observers&&J0(o)),a||(o.state=jr)}if(mt.length>1e6)throw mt=[],new Error},!1)),t}function yo(e){if(!e.fn)return;Nu(e);const t=Ue,r=Me,n=Ru;Me=Ue=e,vR(e,e.value,n),Me=r,Ue=t}function vR(e,t,r){let n;try{n=e.fn(t)}catch(i){return e.pure&&(e.state=jr,e.owned&&e.owned.forEach(Nu),e.owned=null),e.updatedAt=r+1,sh(i)}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?K0(e,n):e.value=n,e.updatedAt=r)}function Pu(e,t,r,n=jr,i){const o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Ue,context:null,pure:r};return Ue===null||Ue!==Q0&&(Ue.owned?Ue.owned.push(o):Ue.owned=[o]),o}function uu(e){if(e.state===0)return;if(e.state===au)return cu(e);if(e.suspense&&Xe(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ru);)e.state&&t.push(e);for(let r=t.length-1;r>=0;r--)if(e=t[r],e.state===jr)yo(e);else if(e.state===au){const n=mt;mt=null,vr(()=>cu(e,t[0]),!1),mt=n}}function vr(e,t){if(mt)return e();let r=!1;t||(mt=[]),Ur?r=!0:Ur=[],Ru++;try{const n=e();return ER(r),n}catch(n){r||(Ur=null),mt=null,sh(n)}}function ER(e){if(mt&&(X0(mt),mt=null),e)return;const t=Ur;Ur=null,t.length&&vr(()=>z0(t),!1)}function X0(e){for(let t=0;t<e.length;t++)uu(e[t])}function _R(e){let t,r=0;for(t=0;t<e.length;t++){const n=e[t];n.user?e[r++]=n:uu(n)}if(ve.context){if(ve.count){ve.effects||(ve.effects=[]),ve.effects.push(...e.slice(0,r));return}else ve.effects&&(e=[...ve.effects,...e],r+=ve.effects.length,delete ve.effects);bs()}for(t=0;t<r;t++)uu(e[t])}function cu(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){const n=e.sources[r];if(n.sources){const i=n.state;i===jr?n!==t&&(!n.updatedAt||n.updatedAt<Ru)&&uu(n):i===au&&cu(n,t)}}}function J0(e){for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t];r.state||(r.state=au,r.pure?mt.push(r):Ur.push(r),r.observers&&J0(r))}}function Nu(e){let t;if(e.sources)for(;e.sources.length;){const r=e.sources.pop(),n=e.sourceSlots.pop(),i=r.observers;if(i&&i.length){const o=i.pop(),a=r.observerSlots.pop();n<i.length&&(o.sourceSlots[a]=n,i[n]=o,r.observerSlots[n]=a)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Nu(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function Z0(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function sh(e,t=Ue){throw Z0(e)}function eE(e,t){return e?e.context&&e.context[t]!==void 0?e.context[t]:eE(e.owner,t):void 0}function bf(e){if(typeof e=="function"&&!e.length)return bf(e());if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++){const n=bf(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function bR(e,t){return function(n){let i;return dn(()=>i=Xe(()=>(Ue.context={[e]:n.value},oh(()=>n.children))),void 0),i}}var wf=Symbol("fallback");function lu(e){for(let t=0;t<e.length;t++)e[t]()}function wR(e,t,r={}){let n=[],i=[],o=[],a=0,s=t.length>1?[]:null;return Ls(()=>lu(o)),()=>{let c=e()||[],l,u;return c[nh],Xe(()=>{let d=c.length,f,p,m,_,S,v,w,A,b;if(d===0)a!==0&&(lu(o),o=[],n=[],i=[],a=0,s&&(s=[])),r.fallback&&(n=[wf],i[0]=hn(N=>(o[0]=N,r.fallback())),a=1);else if(a===0){for(i=new Array(d),u=0;u<d;u++)n[u]=c[u],i[u]=hn(h);a=d}else{for(m=new Array(d),_=new Array(d),s&&(S=new Array(d)),v=0,w=Math.min(a,d);v<w&&n[v]===c[v];v++);for(w=a-1,A=d-1;w>=v&&A>=v&&n[w]===c[A];w--,A--)m[A]=i[w],_[A]=o[w],s&&(S[A]=s[w]);for(f=new Map,p=new Array(A+1),u=A;u>=v;u--)b=c[u],l=f.get(b),p[u]=l===void 0?-1:l,f.set(b,u);for(l=v;l<=w;l++)b=n[l],u=f.get(b),u!==void 0&&u!==-1?(m[u]=i[l],_[u]=o[l],s&&(S[u]=s[l]),u=p[u],f.set(b,u)):o[l]();for(u=v;u<d;u++)u in m?(i[u]=m[u],o[u]=_[u],s&&(s[u]=S[u],s[u](u))):i[u]=hn(h);i=i.slice(0,a=d),n=c.slice(0)}return i});function h(d){if(o[u]=d,s){const[f,p]=bt(u);return s[u]=p,t(c[u],f)}return t(c[u])}}}function SR(e,t,r={}){let n=[],i=[],o=[],a=[],s=0,c;return Ls(()=>lu(o)),()=>{const l=e()||[];return l[nh],Xe(()=>{if(l.length===0)return s!==0&&(lu(o),o=[],n=[],i=[],s=0,a=[]),r.fallback&&(n=[wf],i[0]=hn(h=>(o[0]=h,r.fallback())),s=1),i;for(n[0]===wf&&(o[0](),o=[],n=[],i=[],s=0),c=0;c<l.length;c++)c<n.length&&n[c]!==l[c]?a[c](()=>l[c]):c>=n.length&&(i[c]=hn(u));for(;c<n.length;c++)o[c]();return s=a.length=o.length=l.length,n=l.slice(0),i=i.slice(0,s)});function u(h){o[c]=h;const[d,f]=bt(l[c]);return a[c]=f,t(d,c)}}}function tE(e,t){return Xe(()=>e(t||{}))}function Ma(){return!0}var Sf={get(e,t,r){return t===Is?r:e.get(t)},has(e,t){return t===Is?!0:e.has(t)},set:Ma,deleteProperty:Ma,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Ma,deleteProperty:Ma}},ownKeys(e){return e.keys()}};function ml(e){return(e=typeof e=="function"?e():e)?e:{}}function TR(){for(let e=0,t=this.length;e<t;++e){const r=this[e]();if(r!==void 0)return r}}function rE(...e){let t=!1;for(let o=0;o<e.length;o++){const a=e[o];t=t||!!a&&Is in a,e[o]=typeof a=="function"?(t=!0,St(a)):a}if(t)return new Proxy({get(o){for(let a=e.length-1;a>=0;a--){const s=ml(e[a])[o];if(s!==void 0)return s}},has(o){for(let a=e.length-1;a>=0;a--)if(o in ml(e[a]))return!0;return!1},keys(){const o=[];for(let a=0;a<e.length;a++)o.push(...Object.keys(ml(e[a])));return[...new Set(o)]}},Sf);const r={},n={},i=new Set;for(let o=e.length-1;o>=0;o--){const a=e[o];if(!a)continue;const s=Object.getOwnPropertyNames(a);for(let c=0,l=s.length;c<l;c++){const u=s[c];if(u==="__proto__"||u==="constructor")continue;const h=Object.getOwnPropertyDescriptor(a,u);if(!i.has(u))h.get?(i.add(u),Object.defineProperty(r,u,{enumerable:!0,configurable:!0,get:TR.bind(n[u]=[h.get.bind(a)])})):(h.value!==void 0&&i.add(u),r[u]=h.value);else{const d=n[u];d?h.get?d.push(h.get.bind(a)):h.value!==void 0&&d.push(()=>h.value):r[u]===void 0&&(r[u]=h.value)}}}return r}function nE(e,...t){if(Is in e){const i=new Set(t.length>1?t.flat():t[0]),o=t.map(a=>new Proxy({get(s){return a.includes(s)?e[s]:void 0},has(s){return a.includes(s)&&s in e},keys(){return a.filter(s=>s in e)}},Sf));return o.push(new Proxy({get(a){return i.has(a)?void 0:e[a]},has(a){return i.has(a)?!1:a in e},keys(){return Object.keys(e).filter(a=>!i.has(a))}},Sf)),o}const r={},n=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const o=Object.getOwnPropertyDescriptor(e,i),a=!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable;let s=!1,c=0;for(const l of t)l.includes(i)&&(s=!0,a?n[c][i]=o.value:Object.defineProperty(n[c],i,o)),++c;s||(a?r[i]=o.value:Object.defineProperty(r,i,o))}return[...n,r]}function xR(e){let t,r;const n=i=>{const o=ve.context;if(o){const[s,c]=bt();ve.count||(ve.count=0),ve.count++,(r||(r=e())).then(l=>{bs(o),ve.count--,c(()=>l.default),bs()}),t=s}else if(!t){const[s]=aR(()=>(r||(r=e())).then(c=>c.default));t=s}let a;return St(()=>(a=t())&&Xe(()=>{if(!o)return a(i);const s=ve.context;bs(o);const c=a(i);return bs(s),c}))};return n.preload=()=>r||((r=e()).then(i=>t=()=>i.default),r),n}var OR=0;function AR(){const e=ve.context;return e?`${e.id}${e.count++}`:`cl-${OR++}`}var iE=e=>`Stale read from <${e}>.`;function CR(e){const t="fallback"in e&&{fallback:()=>e.fallback};return St(wR(()=>e.each,e.children,t||void 0))}function RR(e){const t="fallback"in e&&{fallback:()=>e.fallback};return St(SR(()=>e.each,e.children,t||void 0))}function PR(e){const t=e.keyed,r=St(()=>e.when,void 0,{equals:(n,i)=>t?n===i:!n==!i});return St(()=>{const n=r();if(n){const i=e.children;return typeof i=="function"&&i.length>0?Xe(()=>i(t?n:()=>{if(!Xe(r))throw iE("Show");return e.when})):i}return e.fallback},void 0,void 0)}function NR(e){let t=!1;const r=(o,a)=>o[0]===a[0]&&(t?o[1]===a[1]:!o[1]==!a[1])&&o[2]===a[2],n=oh(()=>e.children),i=St(()=>{let o=n();Array.isArray(o)||(o=[o]);for(let a=0;a<o.length;a++){const s=o[a].when;if(s)return t=!!o[a].keyed,[a,s,o[a]]}return[-1]},void 0,{equals:r});return St(()=>{const[o,a,s]=i();if(o<0)return e.fallback;const c=s.children;return typeof c=="function"&&c.length>0?Xe(()=>c(t?a:()=>{if(Xe(i)[0]!==o)throw iE("Match");return s.when})):c},void 0,void 0)}function IR(e){return e}var LR=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],kR=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...LR]),MR=new Set(["innerHTML","textContent","innerText","children"]),FR=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),DR=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function BR(e,t){const r=DR[e];return typeof r=="object"?r[t]?r.$:void 0:r}var UR=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),$R=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),jR={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function HR(e,t,r){let n=r.length,i=t.length,o=n,a=0,s=0,c=t[i-1].nextSibling,l=null;for(;a<i||s<o;){if(t[a]===r[s]){a++,s++;continue}for(;t[i-1]===r[o-1];)i--,o--;if(i===a){const u=o<n?s?r[s-1].nextSibling:r[o-s]:c;for(;s<o;)e.insertBefore(r[s++],u)}else if(o===s)for(;a<i;)(!l||!l.has(t[a]))&&t[a].remove(),a++;else if(t[a]===r[o-1]&&r[s]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(r[s++],t[a++].nextSibling),e.insertBefore(r[--o],u),t[i]=r[o]}else{if(!l){l=new Map;let h=s;for(;h<o;)l.set(r[h],h++)}const u=l.get(t[a]);if(u!=null)if(s<u&&u<o){let h=a,d=1,f;for(;++h<i&&h<o&&!((f=l.get(t[h]))==null||f!==u+d);)d++;if(d>u-s){const p=t[a];for(;s<u;)e.insertBefore(r[s++],p)}else e.replaceChild(r[s++],t[a++])}else a++;else t[a++].remove()}}}var Bm="_$DX_DELEGATE";function qR(e,t,r,n={}){let i;return hn(o=>{i=o,t===document?e():hu(t,e(),t.firstChild?null:void 0,r)},n.owner),()=>{i(),t.textContent=""}}function GR(e,t,r){let n;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,r?a.content.firstChild.firstChild:a.content.firstChild},o=t?()=>Xe(()=>document.importNode(n||(n=i()),!0)):()=>(n||(n=i())).cloneNode(!0);return o.cloneNode=o,o}function oE(e,t=window.document){const r=t[Bm]||(t[Bm]=new Set);for(let n=0,i=e.length;n<i;n++){const o=e[n];r.has(o)||(r.add(o),t.addEventListener(o,JR))}}function fu(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}function VR(e,t,r,n){n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n)}function sE(e,t){t==null?e.removeAttribute("class"):e.className=t}function aE(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){const i=r[0];e.addEventListener(t,r[0]=o=>i.call(e,r[1],o))}else e.addEventListener(t,r)}function WR(e,t,r={}){const n=Object.keys(t||{}),i=Object.keys(r);let o,a;for(o=0,a=i.length;o<a;o++){const s=i[o];!s||s==="undefined"||t[s]||(Um(e,s,!1),delete r[s])}for(o=0,a=n.length;o<a;o++){const s=n[o],c=!!t[s];!s||s==="undefined"||r[s]===c||!c||(Um(e,s,!0),r[s]=c)}return r}function zR(e,t,r){if(!t)return r?fu(e,"style"):t;const n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let i,o;for(o in r)t[o]==null&&n.removeProperty(o),delete r[o];for(o in t)i=t[o],i!==r[o]&&(n.setProperty(o,i),r[o]=i);return r}function uE(e,t={},r,n){const i={};return n||dn(()=>i.children=uo(e,t.children,i.children)),dn(()=>t.ref&&t.ref(e)),dn(()=>YR(e,t,r,!0,i,!0)),i}function QR(e,t,r){return Xe(()=>e(t,r))}function hu(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return uo(e,t,n,r);dn(i=>uo(e,t(),i,r),n)}function YR(e,t,r,n,i={},o=!1){t||(t={});for(const a in i)if(!(a in t)){if(a==="children")continue;i[a]=$m(e,a,null,i[a],r,o)}for(const a in t){if(a==="children"){n||uo(e,t.children);continue}const s=t[a];i[a]=$m(e,a,s,i[a],r,o)}}function KR(e){let t,r;if(!ve.context||!(t=ve.registry.get(r=ZR()))){if(ve.context,!e)throw new Error("Unrecoverable Hydration Mismatch. No template for key: "+r);return e()}return ve.completed&&ve.completed.add(t),ve.registry.delete(r),t}function XR(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function Um(e,t,r){const n=t.trim().split(/\s+/);for(let i=0,o=n.length;i<o;i++)e.classList.toggle(n[i],r)}function $m(e,t,r,n,i,o){let a,s,c,l,u;if(t==="style")return zR(e,r,n);if(t==="classList")return WR(e,r,n);if(r===n)return n;if(t==="ref")o||r(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);n&&e.removeEventListener(h,n),r&&e.addEventListener(h,r)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);n&&e.removeEventListener(h,n,!0),r&&e.addEventListener(h,r,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),d=UR.has(h);if(!d&&n){const f=Array.isArray(n)?n[0]:n;e.removeEventListener(h,f)}(d||r)&&(aE(e,h,r,d),d&&oE([h]))}else if(t.slice(0,5)==="attr:")fu(e,t.slice(5),r);else if((u=t.slice(0,5)==="prop:")||(c=MR.has(t))||!i&&((l=BR(t,e.tagName))||(s=kR.has(t)))||(a=e.nodeName.includes("-")))u&&(t=t.slice(5),s=!0),t==="class"||t==="className"?sE(e,r):a&&!s&&!c?e[XR(t)]=r:e[l||t]=r;else{const h=i&&t.indexOf(":")>-1&&jR[t.split(":")[0]];h?VR(e,h,t,r):fu(e,FR[t]||t,r)}return r}function JR(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return r||document}}),ve.registry&&!ve.done&&(ve.done=_$HY.done=!0);r;){const n=r[t];if(n&&!r.disabled){const i=r[`${t}Data`];if(i!==void 0?n.call(r,i,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function uo(e,t,r,n,i){if(ve.context){!r&&(r=[...e.childNodes]);let s=[];for(let c=0;c<r.length;c++){const l=r[c];l.nodeType===8&&l.data.slice(0,2)==="!$"?l.remove():s.push(l)}r=s}for(;typeof r=="function";)r=r();if(t===r)return r;const o=typeof t,a=n!==void 0;if(e=a&&r[0]&&r[0].parentNode||e,o==="string"||o==="number"){if(ve.context)return r;if(o==="number"&&(t=t.toString()),a){let s=r[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),r=Ci(e,r,n,s)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||o==="boolean"){if(ve.context)return r;r=Ci(e,r,n)}else{if(o==="function")return dn(()=>{let s=t();for(;typeof s=="function";)s=s();r=uo(e,s,r,n)}),()=>r;if(Array.isArray(t)){const s=[],c=r&&Array.isArray(r);if(Tf(s,t,r,i))return dn(()=>r=uo(e,s,r,n,!0)),()=>r;if(ve.context){if(!s.length)return r;for(let l=0;l<s.length;l++)if(s[l].parentNode)return r=s}if(s.length===0){if(r=Ci(e,r,n),a)return r}else c?r.length===0?jm(e,s,n):HR(e,r,s):(r&&Ci(e),jm(e,s));r=s}else if(t.nodeType){if(ve.context&&t.parentNode)return r=a?[t]:t;if(Array.isArray(r)){if(a)return r=Ci(e,r,n,t);Ci(e,r,null,t)}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t}}return r}function Tf(e,t,r,n){let i=!1;for(let o=0,a=t.length;o<a;o++){let s=t[o],c=r&&r[o],l;if(!(s==null||s===!0||s===!1))if((l=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=Tf(e,s,c)||i;else if(l==="function")if(n){for(;typeof s=="function";)s=s();i=Tf(e,Array.isArray(s)?s:[s],Array.isArray(c)?c:[c])||i}else e.push(s),i=!0;else{const u=String(s);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u))}}return i}function jm(e,t,r=null){for(let n=0,i=t.length;n<i;n++)e.insertBefore(t[n],r)}function Ci(e,t,r,n){if(r===void 0)return e.textContent="";const i=n||document.createTextNode("");if(t.length){let o=!1;for(let a=t.length-1;a>=0;a--){const s=t[a];if(i!==s){const c=s.parentNode===e;!o&&!a?c?e.replaceChild(i,s):e.insertBefore(i,r):c&&s.remove()}else o=!0}}else e.insertBefore(i,r);return[i]}function ZR(){const e=ve.context;return`${e.id}${e.count++}`}var eP="http://www.w3.org/2000/svg";function cE(e,t=!1){return t?document.createElementNS(eP,e):document.createElement(e)}function tP(e){const{useShadow:t}=e,r=document.createTextNode(""),n=()=>e.mount||document.body,i=Dm();let o,a=!!ve.context;return ih(()=>{a&&(Dm().user=a=!1),o||(o=hR(i,()=>St(()=>e.children)));const s=n();if(s instanceof HTMLHeadElement){const[c,l]=bt(!1),u=()=>l(!0);hn(h=>hu(s,()=>c()?h():o(),null)),Ls(u)}else{const c=cE(e.isSVG?"g":"div",e.isSVG),l=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return r.parentNode},configurable:!0}),hu(l,o),s.appendChild(c),e.ref&&e.ref(c),Ls(()=>s.removeChild(c))}},void 0,{render:!a}),r}function rP(e){const[t,r]=nE(e,["component"]),n=St(()=>t.component);return St(()=>{const i=n();switch(typeof i){case"function":return Object.assign(i,{[oR]:!0}),Xe(()=>i(r));case"string":const o=$R.has(i),a=ve.context?KR():cE(i,o);return uE(a,r,o),a}})}var Ki,Qs,Ys,Ks,Zn,Xi,Ji,Zi,eo,to,Xs,lg,nP=(lg=class{constructor(e){ie(this,Ki,void 0);ie(this,Qs,void 0);ie(this,Ys,void 0);ie(this,Ks,void 0);ie(this,Zn,!1);ie(this,Xi,void 0);ie(this,Ji,void 0);ie(this,Zi,void 0);ie(this,eo,void 0);ie(this,to,void 0);ie(this,Xs,void 0);const{client:t,queryFlavor:r,version:n,onlineManager:i,buttonPosition:o,position:a,initialIsOpen:s,errorTypes:c}=e;ee(this,Ki,bt(t)),ee(this,Ys,r),ee(this,Ks,n),ee(this,Qs,i),ee(this,Xi,bt(o)),ee(this,Ji,bt(a)),ee(this,Zi,bt(s)),ee(this,eo,bt(c))}setButtonPosition(e){P(this,Xi)[1](e)}setPosition(e){P(this,Ji)[1](e)}setInitialIsOpen(e){P(this,Zi)[1](e)}setErrorTypes(e){P(this,eo)[1](e)}setClient(e){P(this,Ki)[1](e)}mount(e){if(P(this,Zn))throw new Error("Devtools is already mounted");const t=qR(()=>{const[r]=P(this,Xi),[n]=P(this,Ji),[i]=P(this,Zi),[o]=P(this,eo),[a]=P(this,Ki);let s;P(this,to)?s=P(this,to):(s=xR(()=>Promise.resolve().then(()=>require("./4TNE5QTO-22a725ec.js"))),ee(this,to,s));const c=this;return tE(s,rE({get queryFlavor(){return P(c,Ys)},get version(){return P(c,Ks)},get onlineManager(){return P(c,Qs)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return n()},get initialIsOpen(){return i()},get errorTypes(){return o()}}))},e);ee(this,Zn,!0),ee(this,Xs,t)}unmount(){var e;if(!P(this,Zn))throw new Error("Devtools is not mounted");(e=P(this,Xs))==null||e.call(this),ee(this,Zn,!1)}},Ki=new WeakMap,Qs=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,Zn=new WeakMap,Xi=new WeakMap,Ji=new WeakMap,Zi=new WeakMap,eo=new WeakMap,to=new WeakMap,Xs=new WeakMap,lg);function iP(e){const t=go(),r=e.client||t,n=U.useRef(null),{buttonPosition:i,position:o,initialIsOpen:a,errorTypes:s}=e,[c]=U.useState(new nP({client:r,queryFlavor:"React Query",version:"5",onlineManager:Ns,buttonPosition:i,position:o,initialIsOpen:a,errorTypes:s}));return U.useEffect(()=>{c.setClient(r)},[r,c]),U.useEffect(()=>{i&&c.setButtonPosition(i)},[i,c]),U.useEffect(()=>{o&&c.setPosition(o)},[o,c]),U.useEffect(()=>{c.setInitialIsOpen(a||!1)},[a,c]),U.useEffect(()=>{c.setErrorTypes(s||[])},[s,c]),U.useEffect(()=>(n.current&&c.mount(n.current),()=>{c.unmount()}),[c]),U.createElement("div",{className:"tsqd-parent-container",ref:n})}var oP=process.env.NODE_ENV!=="development"?function(){return null}:iP;const sP=({showDevTools:e=!0,children:t})=>{const r=new U1({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return T.jsxs(G1,{client:r,children:[t,e&&T.jsx(oP,{initialIsOpen:!1})]})};const gl="joinCommunityButton",ah=({isMember:e=!1,isShort:t=!1,functions:{join:r,leave:n}={join:()=>{},leave:()=>{}}})=>{const i=Se(),o=U.useContext($r),a=o&&typeof o.id=="string",[s,c]=U.useState(e),[l,u]=U.useState(e?"joined":"notJoined");U.useEffect(()=>{l==="joining"?u("joined"):l==="leaving"&&u("notJoined")},[s]);const h={},d={};return s&&l!=="leaving"&&(h["data-hover-text"]=i.formatMessage({id:`${gl}_leave`}),h["aria-label"]=i.formatMessage({id:`${gl}_member_aria`}),d["aria-hidden"]="true"),T.jsx(ze,{variant:s?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:s&&l!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async f=>{a&&(f.currentTarget.blur(),s?(u("leaving"),typeof n=="function"&&await n()):(u("joining"),typeof r=="function"&&await r()),c(!s))},className:se("join-community-button",l,{active:l==="joining"}),disabled:!a,...h,children:T.jsx("span",{className:"text",...d,children:i.formatMessage({id:`${gl}${["joining","leaving"].includes(l)?`_${l}`:s?"_member":t?"_short":""}`})})})};const yl="communityDetails_",aP=({isMember:e=!1,slug:t,members:{number:r,data:n}={number:void 0,data:[]},className:i="",...o})=>{const a=Se(),s=r||(n==null?void 0:n.length)||0;return T.jsxs("div",{className:se("community-details",i),children:[T.jsx(tu,{}),T.jsxs("div",{className:"member-details",children:[T.jsxs("div",{className:"top",children:[T.jsxs("h3",{children:[a.formatMessage({id:`${yl}members`}),T.jsx("span",{className:"count",children:s})]}),T.jsx("p",{className:"text-small",children:T.jsx("a",{href:`/communities/${t}/members`,children:a.formatMessage({id:`${yl}viewAll`})})})]}),T.jsx(k0,{contributors:{total:r,data:n!=null&&n.length?n:[{},{},{},{},{}]},styling:{size:"medium",showGap:!0,showPlaceholders:s===0},cutoff:5})]}),T.jsx(ah,{isMember:e,...o}),e&&T.jsx(ze,{variant:"primary",icon:{icon:"plus"},styling:{fullWidth:!0},children:a.formatMessage({id:`${yl}invite`})})]})};const uP=({breadcrumbs:e,cutoff:t=20,className:r=""})=>{const n=Se();return T.jsxs(T.Fragment,{children:[T.jsx(lt,{element:"p",children:n.formatMessage({id:"breadcrumbs_label"})}),T.jsx("ul",{className:se("breadcrumbs text-small",r),children:e.map(({text:i,href:o,current:a=!1},s)=>T.jsxs("li",{children:[a&&T.jsx(lt,{element:"span",children:n.formatMessage({id:"breadcrumbs_currentPage"})}),T.jsx(ia,{href:a?void 0:o,children:Kf(i,t)})]},`${window.btoa(i)}_${s}`))})]})};const cP=({options:e,allOption:t=!1,allowMultiple:r=!0,onChange:n=()=>{},className:i=""})=>{const o=Se(),a=t?[{id:"all",text:typeof t!="boolean"&&t.text||o.formatMessage({id:"filters_all"})},...e]:e,[s,c]=U.useState(t?["all"]:[]),l=(u,h)=>{let d=[];s.includes(u)?d=s.filter(f=>f!==u):u==="all"?d=["all"]:r?d=[...s.filter(f=>f!=="all"),u]:d=[u],c(f=>(n&&typeof n=="function"&&n({current:d,previous:f}),d)),h&&typeof h=="function"&&h()};return T.jsx("ul",{className:se("filters",i),children:a.map(({id:u,text:h,disabled:d=!1,callback:f=()=>{}})=>{let p={};return d&&(p={disabled:!0,"aria-label":o.formatMessage({id:"filters_disabled"},{name:h})}),T.jsx("li",{children:T.jsx("button",{className:se(u,{selected:s.includes(u)}),onClick:m=>{m.preventDefault(),m.stopPropagation(),l(u,f)},...p,children:h})},u)})})},lP=(e,t)=>{const r=String(e);if(!t||!t.length)return`/${r}`;let n="";return t.forEach(({url:i,position:o})=>{o==="before-lang"?n+=`/${i}`:(n.includes(`/${r}/`)||(n+=`/${r}`),n+=`/${i}`)}),n.includes(`/${r}/`)||(n+=`/${r}`),n};const vl={en:"English",es:"Español",fr:"Français",pt:"Português"},Fa="languageSwitcher_",fP=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:r=!1,translations:n,onChange:i=()=>{},urlParts:o,variant:a="default",label:s,className:c=""})=>{const l=Se(),[u,h]=U.useState(e);if(U.useEffect(()=>{e!==u&&h(e)},[e]),!n||!Object.values(n).some(m=>m&&m.post_name))return null;const f=Object.keys(n),p=u!==e;return T.jsxs("div",{className:se("language-switcher text-small",a,c),children:[T.jsxs("nav",{children:[a!=="short"&&T.jsx("p",{children:s||l.formatMessage({id:`${Fa}label`})}),T.jsx("ul",{children:f.map(m=>{if(!vl[m])return null;let _={className:m};return u===m?_["aria-label"]=l.formatMessage({id:`${Fa}selected`},{language:vl[m]}):_={..._,href:lP(m,o),onClick:S=>{S.preventDefault(),S.stopPropagation(),h(m),i(m)}},T.jsx("li",{children:T.jsx(ia,{..._,fallbackElement:"span",children:vl[m]})},m)})}),a!=="short"&&!p&&T.jsx("p",{children:l.formatMessage({id:`${Fa}translation_${t?"original":r?"human":"machine"}`})})]}),a!=="short"&&!p&&!t&&!r&&T.jsx("small",{children:l.formatMessage({id:`${Fa}disclaimer`},{email:Ni.support,link:m=>{const _=`mailto:${m}`;return T.jsx("a",{href:_,children:m})}})})]})};const El=tf({locale:"en",messages:Gf}),lE=({page:e=1,length:t=0,limit:r=10,loadNextPage:n=()=>{},icon:i=!1,messages:o={button:El.formatMessage({id:"loadMore_button"}),endOfFeed:El.formatMessage({id:"loadMore_endOfFeed"}),error:El.formatMessage({id:"loadMore_error"})},className:a="",gtmContext:s="LoadMore"})=>{const[c,l]=U.useState(!1),[u,h]=U.useState(!1);if(t<=0||t<r*e)return null;const d=async f=>{try{await n(f)}catch(p){p instanceof Error&&p.message&&p.message.includes("Cannot read items")?h(!0):l(!0)}};return T.jsxs("footer",{className:se("load-more",a),children:[c&&T.jsx("p",{className:"error",children:o.error}),u?T.jsx("p",{children:o.endOfFeed}):T.jsx(ze,{variant:"secondary",icon:i,onClick:d,"data-gtm-event-context":s,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:o.button})]})};let Da=!1;const fE=({element:e="div",id:t="more-menu",options:r,className:n=""})=>{const i=Se(),o=U.useRef(null),[a,s]=U.useState(!1),c=l=>{o.current&&l.target instanceof HTMLElement&&!o.current.contains(l.target)&&s(!1)};return U.useEffect(()=>(document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)})),U.createElement(e,{ref:o,className:se("more-menu text-medium",n),children:T.jsxs(T.Fragment,{children:[T.jsx(ze,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>s(!a),"aria-haspopup":"true","aria-expanded":a,"aria-controls":t,screenreaderText:i.formatMessage({id:"moreMenu"})}),T.jsx("ul",{id:t,hidden:!a,children:r.map(({href:l,onClick:u,text:h,icon:d,...f},p)=>{const m={...f,onClick:_=>{s(!1),typeof u=="function"&&u(_)},onFocus:()=>{Da&&(clearTimeout(Da),Da=!1)},onBlur:()=>{Da=setTimeout(()=>{s(!1)},100)}};return l&&(m.href=l),T.jsx("li",{children:T.jsx(ze,{variant:"tertiary",size:"medium",icon:d?{icon:d,position:"left"}:!1,...m,children:h})},`${window.btoa(h)}_${p}`)})})]})})};const uh=({variant:e="default",version:t="default",className:r="",...n})=>T.jsx("p",{className:"logo-wrapper",children:T.jsx("a",{href:"/home/",className:se("logo",e,t,r),...n,children:T.jsx(lt,{children:T.jsx(ln,{id:"apolitical"})})})});const hP={"2-1":901},dP=({layout:e="2-1",hideOnMobile:t=!1,className:r="",children:n})=>{const i=ra(!0);let o=n;return U.Children.count(n)===1&&(o=U.Children.toArray(n)[0],o.props&&(o=o.props.children)),T.jsx("section",{className:se("columns",`layout-${e}`,r),children:U.Children.map(o,(a,s)=>t!==!1&&s===t&&i&&i<hP[e]?null:a)})};const _l="cookieBanner_",bl=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],wl=new Date(Date.now()+12*30*24*60*60*1e3),hE=()=>{const e=Se(),[t,r,n]=vg(bl),[i,o]=U.useState(!t["apol-cookie-banner"]),a=()=>{bl.forEach(u=>{r(u,!0,{path:"/",expires:wl,domain:u==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),o(!1),window.location.reload()},s=()=>{r("apol-cookie-banner",!0,{path:"/",expires:wl}),bl.forEach(u=>{if(u==="apol-cookie-banner"){r(u,!0,{path:"/",expires:wl});return}n(u)}),o(!1)};if(!i)return null;const c=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:s,gtmType:"reject-all"},{id:"accept",onClick:a,gtmType:"accepted-all"}],l=[];return c.forEach(u=>{l.push({variant:u.href?"tertiary":"primary",href:u.href,onClick:u.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${u.gtmType}-click`,children:e.formatMessage({id:`${_l}buttons_${u.id}`})})}),T.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[T.jsx("h6",{children:e.formatMessage({id:`${_l}title`})}),T.jsx("p",{children:e.formatMessage({id:`${_l}text`})}),T.jsx(na,{buttons:l})]})},Dr={platform:{order:["events","courses","qanda","articles"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},qanda:{href:"/questions-answers/",gtmType:"q-and-a-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["story","team","careers","partner","contact"],story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:Ni["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Ni["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:Ni.support,gtmType:"concierge-email-click"},business:{email:Ni.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 Ii="footer_",du="SiteFooter",Hm=({group:e})=>{const t=Dr[e].order||[];let r=!1;return"text"in Dr[e]&&(r=Dr[e].text),T.jsxs(U.Fragment,{children:[T.jsx("p",{className:"pre-title",children:T.jsx(ln,{id:`${Ii}${e}`})}),Array.isArray(t)&&t.length>0&&T.jsx("ul",{className:"text-medium",children:t.map(n=>{if(["order","child","text"].includes(n))return null;const{href:i,gtmType:o}=Dr[e][n],a={};return["legal"].includes(e)&&(a.target="_blank",a.rel="noopener"),T.jsx("li",{children:T.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":o,...a,children:T.jsx(ln,{id:`${Ii}${e}_${n}`})})},`${e}_${n}`)})}),typeof r!="boolean"&&"order"in r&&Array.isArray(r.order)&&T.jsx("dl",{className:"text-medium",children:r.order.map(n=>T.jsxs(U.Fragment,{children:[T.jsx("dt",{children:T.jsx(ln,{id:`${Ii}${e}_${n}`})}),T.jsxs("dd",{children:[typeof r!="boolean"&&r[n].address&&T.jsx("address",{children:T.jsx(ln,{id:`${Ii}${e}_${n}_address`,values:{br:T.jsx("br",{})}})}),typeof r!="boolean"&&r[n].email&&T.jsx("a",{href:`mailto:${r[n].email}`,className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":r[n].gtmType,children:r[n].email})]})]},`dl-${e}-${n}`))})]},e)},ch=()=>T.jsx("div",{id:"footer",children:T.jsxs("div",{className:"wrapper",children:[T.jsx(Of,{element:"hr"}),T.jsx(uh,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":"logo-homepage-link"}),T.jsx("footer",{children:["platform","community","company","contact"].map(e=>T.jsxs("div",{className:"group",children:[T.jsx(Hm,{group:e}),Object.keys(Dr[e]).includes("child")&&T.jsx(Hm,{group:Dr[e].child})]},e))}),T.jsx("hr",{}),T.jsxs("div",{className:"sub-footer",children:[T.jsx("ul",{children:Array.isArray(Dr.social.order)&&Dr.social.order.map(e=>{const t=Dr.social[e];return T.jsx("li",{className:e,children:T.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":"social-click",children:T.jsx("span",{className:"hidden",children:T.jsx(ln,{id:`${Ii}social_${e}`})})})},e)})}),T.jsx("small",{children:T.jsx(ln,{id:`${Ii}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})});const Ba="emailHelperTextBox_",pP=({type:e,email:t,redirectPath:r,resendVerificationCode:n})=>{const i=Se(),[o,a]=U.useState({path:`${Ba}default`,type:"default",link:{},mail:{},error:""}),[s,c]=U.useState(!1),l=U.useCallback(f=>{f.preventDefault(),f.stopPropagation();const p=m=>{a({path:`${Ba}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:_=>l(_),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:m})};if(typeof n!="function"){p(i.formatMessage({id:`${Ba}error_noFunction`}));return}c(!0),n(t).then(()=>{localStorage.setItem("email",t),window.location.href=r||"/signup/verify-email"}).catch(m=>{p(m.message)}).finally(()=>{c(!1)})},[t,r,n]);U.useEffect(()=>{let f=Ba,p="default",m={},_={};switch(e){case"gov":f+="autoApproved",p="success";break;case"nonGov":f+="unrecognisedEmail",p="error",m={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":f+="pendingApproval",p="error",_={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":f+="emailUnverified",p="error",m={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:S=>l(S),"data-testid":"send-verify-email-click"};break;case"exists":f+="emailAlreadyExists",p="error",m={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},_={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:f+="default",m={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}a({...o,path:f,type:p,link:m,mail:_})},[e]);const u={};return["link","mail"].forEach(f=>{u[f]=Object.keys(o[f]).length?p=>T.jsx("a",{...o[f],children:p}):p=>p}),T.jsx(A0,{type:o.type,heading:s?!1:i.formatMessage({id:`${o.path}_title`}),children:s?T.jsxs(T.Fragment,{children:[T.jsx(yr,{element:"span"}),T.jsx(yr,{element:"span"})]}):i.formatMessage({id:`${o.path}_text`},{...u,strong:f=>T.jsx("strong",{children:f}),em:f=>T.jsx("em",{children:f}),br:T.jsxs(T.Fragment,{children:[T.jsx("br",{}),T.jsx("br",{})]}),error:o.error})})};const Ua="passwordRules_",dE="isMoreThanEightCharacters",pE="includesNumberAndSymbol",mE="includesLowerAndUppercase",mP={[dE]:"8Characters",[pE]:"numberSymbol",[mE]:"lowercaseUppercase"},gP=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const r=Se();return T.jsxs("aside",{className:se("password-rules",t),children:[T.jsx("small",{children:r.formatMessage({id:`${Ua}intro`})}),T.jsx("ul",{children:[dE,pE,mE].map(n=>T.jsxs("li",{className:se({matches:e[n]}),children:[T.jsxs(lt,{children:[r.formatMessage({id:`${Ua}rule_label`})," "]}),T.jsx("span",{children:r.formatMessage({id:`${Ua}rule_${mP[n]}`})}),!e[n]&&T.jsxs(lt,{element:"strong",children:[" "," ",r.formatMessage({id:`${Ua}notMet`})]})]},`rule-${n}`))})]})},yP=U.memo(gP);const vP=({text:e={},topRating:t=5,functions:{createRating:r=()=>null,updateRating:n=()=>{},reportError:i=()=>{}},className:o="",hasLoaded:a=!1})=>{const s=Se(),[c,l]=U.useState({setUp:!1,id:null,rating:null,disabled:!0}),u=async()=>{try{const S=await r();l(v=>({...v,setUp:!0,id:S&&S.id,disabled:!1}))}catch(S){l(v=>({...v,setUp:!0,disabled:!0})),i(S)}};if(U.useEffect(()=>{a&&!c.setUp&&u()},[a]),!a)return T.jsx(yr,{className:"rating-placeholder"});const{id:h,rating:d,disabled:f}=c,p="ratings_",m={text:s.formatMessage({id:`${p}text`}),low:s.formatMessage({id:`${p}low`}),high:s.formatMessage({id:`${p}high`}),success:s.formatMessage({id:`${p}success`}),...e},_=async S=>{if(!(!h||f))try{l(v=>({...v,rating:S,disabled:!0})),await n({id:h,value:S})}catch(v){l(w=>({...w,rating:null})),i(v)}finally{l(v=>({...v,disabled:!1}))}};return T.jsxs("div",{className:se("rating",o),children:[T.jsx("span",{className:"label",children:m[d?"success":"text"]}),T.jsx("ol",{children:Array.from(new Array(t).keys()).map(S=>{const v=S+1;return T.jsx("li",{className:se({selected:d&&v<=d}),children:T.jsx(ze,{variant:"tertiary",size:"small",icon:{icon:`star${!d||v>d?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${s.formatMessage({id:`${p}stars`},{number:v,total:t})}${v===1||v===t?` - ${m[v===1?"low":"high"]}`:""}`,onClick:w=>{w.preventDefault(),w.stopPropagation(),_(v)},disabled:f})},`rating-${v}`)})})]})};const gE=({id:e="search",className:t="",handleToggle:r=!1,defaultValue:n="",gtmContext:i="search-bar",gtmEvent:o="form-submission"})=>{const{searchIsOpen:a=!0,isDesktopVersion:s=!1}=r||{},c=Se(),l=U.useRef(null);ri(()=>{!r||s||!a||l.current&&l.current.focus()},[a]);const u=h=>{h.preventDefault(),h.stopPropagation(),!(!l.current||!l.current.value||l.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(l.current.value)}`)};return T.jsx("form",{onSubmit:u,className:se("search-form gtm-trackable",t),"data-gtm-event-context":i,"data-gtm-event-type":o,children:T.jsx("fieldset",{id:`${e}-form`,hidden:r?!a:!1,role:"search",children:T.jsxs("p",{children:[T.jsx(lt,{element:"label",htmlFor:e,children:c.formatMessage({id:"search_label"})}),T.jsx("input",{ref:l,type:"search",id:e,name:e,defaultValue:n,placeholder:c.formatMessage({id:"search_placeholder"}),onKeyDown:h=>{h.key==="Enter"&&u(h)}}),T.jsx("button",{className:"clear",onClick:h=>{h.preventDefault(),h.stopPropagation(),l.current&&l.current.value&&(l.current.value="")},children:T.jsx(lt,{children:c.formatMessage({id:"search_clear"})})}),T.jsx("button",{className:"search",onClick:u,children:T.jsx(lt,{children:c.formatMessage({id:"search_cta"})})})]})})})};var EP="Expected a function",yE="__lodash_hash_undefined__",vE=1/0,_P="[object Function]",bP="[object GeneratorFunction]",wP="[object Symbol]",SP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TP=/^\w*$/,xP=/^\./,OP=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AP=/[\\^$.*+?()[\]{}|]/g,CP=/\\(\\)?/g,RP=/^\[object .+?Constructor\]$/,PP=typeof he=="object"&&he&&he.Object===Object&&he,NP=typeof self=="object"&&self&&self.Object===Object&&self,lh=PP||NP||Function("return this")();function IP(e,t){return e==null?void 0:e[t]}function LP(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var kP=Array.prototype,MP=Function.prototype,EE=Object.prototype,Sl=lh["__core-js_shared__"],qm=function(){var e=/[^.]+$/.exec(Sl&&Sl.keys&&Sl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),_E=MP.toString,fh=EE.hasOwnProperty,bE=EE.toString,FP=RegExp("^"+_E.call(fh).replace(AP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gm=lh.Symbol,DP=kP.splice,BP=wE(lh,"Map"),ks=wE(Object,"create"),Vm=Gm?Gm.prototype:void 0,Wm=Vm?Vm.toString:void 0;function oi(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function UP(){this.__data__=ks?ks(null):{}}function $P(e){return this.has(e)&&delete this.__data__[e]}function jP(e){var t=this.__data__;if(ks){var r=t[e];return r===yE?void 0:r}return fh.call(t,e)?t[e]:void 0}function HP(e){var t=this.__data__;return ks?t[e]!==void 0:fh.call(t,e)}function qP(e,t){var r=this.__data__;return r[e]=ks&&t===void 0?yE:t,this}oi.prototype.clear=UP;oi.prototype.delete=$P;oi.prototype.get=jP;oi.prototype.has=HP;oi.prototype.set=qP;function vo(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function GP(){this.__data__=[]}function VP(e){var t=this.__data__,r=Iu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():DP.call(t,r,1),!0}function WP(e){var t=this.__data__,r=Iu(t,e);return r<0?void 0:t[r][1]}function zP(e){return Iu(this.__data__,e)>-1}function QP(e,t){var r=this.__data__,n=Iu(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}vo.prototype.clear=GP;vo.prototype.delete=VP;vo.prototype.get=WP;vo.prototype.has=zP;vo.prototype.set=QP;function ci(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function YP(){this.__data__={hash:new oi,map:new(BP||vo),string:new oi}}function KP(e){return Lu(this,e).delete(e)}function XP(e){return Lu(this,e).get(e)}function JP(e){return Lu(this,e).has(e)}function ZP(e,t){return Lu(this,e).set(e,t),this}ci.prototype.clear=YP;ci.prototype.delete=KP;ci.prototype.get=XP;ci.prototype.has=JP;ci.prototype.set=ZP;function Iu(e,t){for(var r=e.length;r--;)if(lN(e[r][0],t))return r;return-1}function eN(e,t){t=iN(t,e)?[t]:nN(t);for(var r=0,n=t.length;e!=null&&r<n;)e=e[uN(t[r++])];return r&&r==n?e:void 0}function tN(e){if(!TE(e)||sN(e))return!1;var t=fN(e)||LP(e)?FP:RP;return t.test(cN(e))}function rN(e){if(typeof e=="string")return e;if(dh(e))return Wm?Wm.call(e):"";var t=e+"";return t=="0"&&1/e==-vE?"-0":t}function nN(e){return SE(e)?e:aN(e)}function Lu(e,t){var r=e.__data__;return oN(t)?r[typeof t=="string"?"string":"hash"]:r.map}function wE(e,t){var r=IP(e,t);return tN(r)?r:void 0}function iN(e,t){if(SE(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||dh(e)?!0:TP.test(e)||!SP.test(e)||t!=null&&e in Object(t)}function oN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function sN(e){return!!qm&&qm in e}var aN=hh(function(e){e=dN(e);var t=[];return xP.test(e)&&t.push(""),e.replace(OP,function(r,n,i,o){t.push(i?o.replace(CP,"$1"):n||r)}),t});function uN(e){if(typeof e=="string"||dh(e))return e;var t=e+"";return t=="0"&&1/e==-vE?"-0":t}function cN(e){if(e!=null){try{return _E.call(e)}catch{}try{return e+""}catch{}}return""}function hh(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(EP);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a),a};return r.cache=new(hh.Cache||ci),r}hh.Cache=ci;function lN(e,t){return e===t||e!==e&&t!==t}var SE=Array.isArray;function fN(e){var t=TE(e)?bE.call(e):"";return t==_P||t==bP}function TE(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function hN(e){return!!e&&typeof e=="object"}function dh(e){return typeof e=="symbol"||hN(e)&&bE.call(e)==wP}function dN(e){return e==null?"":rN(e)}function pN(e,t,r){var n=e==null?void 0:eN(e,t);return n===void 0?r:n}var mN=pN;const xE=Er(mN),Fe={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const r={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},n=o=>{const a=`logged${e?"In":"Out"}`;return t>=r[o][a]};let i={};return["navigation","search"].forEach(o=>{i[o]=n(o)}),i},shouldChangeHeaderIsVisible:(e,t,r)=>{Object.values(t).filter(i=>i===!0).length||r([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:r,dispatch:n})=>{if(r[e]===t||e==="account"&&t===!1&&r.navigation===!0)return;const i=Date.now();if(!t&&Fe.handlerCalled[e]&&i-Fe.handlerCalled[e]<500)return;Fe.handlerCalled[e]=i;let o=[{type:`menus.${e}`,value:t}];t===!0&&Object.keys(r).forEach(a=>{a===e||r[a]===!1||o.push({type:`menus.${a}`,value:!1})}),n(o)},findFirstChild:(e,t,r=!1)=>{if(!e||!e[0])return!1;for(let n=0;n<=e.length;n++){if(!e[n])continue;if(e[n][t]&&(!r||e[n][t].includes(r)))return e[n];if(!t.includes("."))continue;const i=xE(e[n],t);if(!(typeof i>"u")&&(!r||i[t]&&i[t].includes(r)||i.value&&i.value.includes(r)||i.toString().includes(r)))return e[n]}return e[0].children?Fe.findFirstChild(e[0].children,t,r):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:r,focusElements:n,dispatch:i})=>{if(!t.current||!t.current.children)return;const o=r?"desktop":"default";if(n[e][o]){n[e][o].focus();return}let a,s;switch(e){case"navigation":if(r){const c=Fe.findFirstChild(t.current.children,"attributes.aria-controls","navigation");a=Fe.findFirstChild(c.children,"href")}else a=Fe.findFirstChild(t.current.children,"href");a||(a=t.current);break;case"account":if(s=Fe.findFirstChild(t.current.children,"className","account"),!s||!s.children)return;a=Fe.findFirstChild(s.children,"href");break;default:return}a&&(i([{type:`focusElements.${e}.${o}`,value:a}]),a.focus())},events:{onClick:(e,{id:t,callback:r,isOpen:n})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(Fe.timeouts[t]),r(t,!n))},onFocus:({id:e})=>{clearTimeout(Fe.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Fe.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Fe.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},Ms={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"navigation",explore:{order:["events","courses","q-and-a","articles"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},"q-and-a":{href:"/questions-answers/",className:"icon q-and-a"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup/?ref=header-banner",props:{variant:"primary"}}}},pu=({id:e,isLoggedIn:t=!1,isDesktopVersion:r=!1,menus:n={},callback:i=()=>{},doTrack:o=null})=>{const a=Se(),s=xE(Ms,e);if(!s||s.onlyShow&&(s.onlyShow==="logged-in"&&!t||s.onlyShow==="logged-out"&&t))return null;const c="doTrack"in s,l=o===null?c?s.doTrack:!0:o,u=e.includes("buttons.");let h=`header_${e.replaceAll(".","_")}`;s.hasVariantText&&(h+=`_logged${t?"In":"Out"}`);let d=!1;if(s.href){let v=s.gtmType||`${e}-click`;if(v.includes(".")){const w=v.split("."),A=w[w.length-2];v=`${A==="topics"?`${A}-`:""}${w[w.length-1]}`}d={href:s.href,role:"menuitem"},l&&(d={...d,className:"gtm-trackable","data-gtm-event-type":v,"data-gtm-event-context":"HeaderButtons"}),u&&(d={...d,variant:"secondary",size:{mobile:"small",881:"large"},...s.props||{}})}const f=s.order&&s.order[0]&&s[s.order[0]],p=f&&s[s.order[0]].order,m=d&&window.location.pathname===s.href;let _={},S={};if(f){const v=s.menuId||e,w={onClick:A=>Fe.events.onClick(A,{id:v,callback:i,isOpen:n[v]}),onFocus:()=>Fe.events.onFocus({id:v}),onBlur:()=>Fe.events.onBlur({id:v,callback:i}),onMouseLeave:()=>Fe.events.onBlur({id:v,callback:i}),onMouseEnter:()=>Fe.events.onMouseEnter({id:v,callback:i})};r&&(p&&(_={...w,onKeyPress:A=>{A.key==="Enter"&&Fe.events.onClick(A,{id:v,callback:i,isOpen:n[v]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":n[v],"aria-controls":v}),S={hidden:v in n?!n[v]:!0}),p||(S={...S,...w})}return T.jsxs("li",{className:se({[s.className]:s.className,"has-submenu":f,parent:p,active:m}),role:"none",..._,children:[d?U.createElement(u?ze:"a",d,a.formatMessage({id:h})):a.formatMessage({id:h}),s.order&&T.jsx("ul",{...S,children:s.order.map(v=>{if(!s[v])return null;const w={isLoggedIn:t,isDesktopVersion:r,menus:n,callback:i,doTrack:c?l:null};return s[v].order?T.jsxs("li",{className:se({[s[v].className]:s[v].className}),children:[a.formatMessage({id:`${h}_${v}`}),T.jsx("ul",{children:s[v].order.map(A=>T.jsx(pu,{id:`${e}.${v}.${A}`,...w},A))})]},v):T.jsx(pu,{id:`${e}.${v}`,...w},v)})})]},e)};const gN={height:67,height_desktop:83},ph=()=>{const e=Se(),t=U.useContext($r),r=ra(!0,!0),n=t&&typeof t.id=="string",i=U.useMemo(()=>Fe.getIsDesktopVersion(n,r),[n,r]),[o,a]=U.useReducer(_O,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:s,menus:c,focusElements:l}=o;gv({scrollPosition:gN[`height${i.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{!i&&c.navigation||Fe.shouldChangeHeaderIsVisible(!0,c,a)},scrollDown:()=>{!i&&c.navigation||Fe.shouldChangeHeaderIsVisible(!1,c,a)}}});const u=(d,f)=>{Fe.handleMenus({id:d,value:f,menus:c,dispatch:a})},h=U.useRef(null);return ri(()=>{c.navigation&&Fe.autoFocus({menu:"navigation",navigationRef:h,isDesktopVersion:i.navigation,focusElements:l,dispatch:a})},[c.navigation]),ri(()=>{c.account&&Fe.autoFocus({menu:"account",navigationRef:h,isDesktopVersion:i.navigation,focusElements:l,dispatch:a})},[c.account]),t&&t.isLoading?null:T.jsxs(T.Fragment,{children:[T.jsxs("nav",{id:"header",className:se({"logged-in":n,"logged-out":!n,visible:s}),children:[T.jsx(lt,{element:"a",href:"#content-of-page",children:e.formatMessage({id:"header_skip"})}),T.jsx(uh,{}),!i.navigation&&T.jsx("button",{className:"menu-button gtm-trackable",onClick:d=>{d.preventDefault(),d.stopPropagation(),u("navigation",!c.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":c.navigation,"aria-controls":"navigation",children:T.jsx(lt,{children:e.formatMessage({id:`header_menu_${c.navigation?"hide":"show"}`})})}),T.jsx("ul",{ref:h,id:"navigation",hidden:i.navigation||c.account?!1:!c.navigation,role:"menu","data-showing":!i.navigation&&c.account?"account":"default",children:Ms.order.map(d=>T.jsx(pu,{id:d,isLoggedIn:n,isDesktopVersion:i.navigation,menus:{navigation:c.navigation,account:c.account},callback:u},d))}),!i.search&&T.jsx("button",{className:"search toggle-search-button",onClick:d=>{d.preventDefault(),d.stopPropagation(),u("search",!c.search)},"aria-haspopup":"true","aria-expanded":c.search,"aria-controls":"search-form",children:T.jsx(lt,{children:e.formatMessage({id:`header_search_${c.search?"hide":"show"}`})})}),T.jsx(gE,{id:"global-search",handleToggle:{searchIsOpen:c.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),n?T.jsxs("button",{className:"account-button",onClick:d=>Fe.events.onClick(d,{id:"account",callback:u,isOpen:c.account}),onMouseEnter:()=>Fe.events.onMouseEnter({id:"account",callback:u}),onMouseLeave:()=>Fe.events.onBlur({id:"account",callback:u}),"aria-haspopup":"true","aria-expanded":c.account,"aria-controls":"navigation",children:[T.jsx(lt,{children:e.formatMessage({id:`header_account_${c.account?"hide":"show"}`})}),T.jsx(Ou,{name:t&&t.name||"",src:t&&t.image&&t.image.thumbnail||""})]}):T.jsx("ul",{className:"sign-in-buttons",children:Ms.buttons.order.map(d=>T.jsx(pu,{id:`buttons.${d}`},d))})]}),T.jsx("hr",{id:"content-of-page"}),T.jsx("div",{className:se("overlay",{open:c.navigation||c.account||!i.search&&c.search})})]})},yN=U.createContext(null),Tl={didCatch:!1,error:null};class vN extends U.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Tl}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:o,reason:"imperative-api"}),this.setState(Tl)}}componentDidCatch(t,r){var n,i;(n=(i=this.props).onError)===null||n===void 0||n.call(i,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:i}=this.props;if(n&&r.error!==null&&EN(t.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(Tl)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=t;if(o){const c={error:a,resetErrorBoundary:this.resetErrorBoundary};if(U.isValidElement(i))s=i;else if(typeof r=="function")s=r(c);else if(n)s=U.createElement(n,c);else throw a}return U.createElement(yN.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function EN(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}const _N=()=>{const e=Se();return T.jsxs(T.Fragment,{children:[T.jsx(ph,{}),T.jsx("div",{className:"content",children:T.jsx(aa,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),T.jsx(ch,{})]})},bN=({children:e,reportError:t,showFooter:r=!0,background:n="default",className:i="",locale:o="en"})=>{const a=hg();U.useEffect(()=>{window.scrollTo(0,0)},[a]);const s=Av(e,{locale:o});return T.jsx(vN,{onError:t,fallback:T.jsx(_N,{}),children:T.jsx(U.Suspense,{fallback:T.jsx(I0,{layout:"overview-page"}),children:T.jsx("div",{id:"wrapper",className:se(i,{[n]:n!=="default"}),children:T.jsxs(e_,{children:[T.jsx(ph,{}),T.jsx("div",{className:"content",children:s}),r&&T.jsx(ch,{}),T.jsx(hE,{})]})})})})},zm={default:"tags_",headerTopics:"header_topics_topics_"},xl={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"},wN={getTagDetails:e=>{if(e.includes("topic_")){if(e=xl.topic[e.replace("topic_","")],e){const t=Ms.topics.topics[e].href;return t?{id:e,href:t,text:`${zm.headerTopics}${e}`}:null}return null}return xl[e]?(e=xl[e],{id:e,text:`${zm.default}${e}`}):null}};const SN=({tags:e=[],color:t="default",forceOneLine:r=!1,canHaveLinks:n=!0,className:i="",gtmType:o="tag-click",gtmContext:a="tags"})=>{const s=Se();if(!e||e.length<1)return null;const c=[];return e.forEach(l=>{if(!l)return;const u=wN.getTagDetails(l);u&&c.push(u)}),c.length<1?null:T.jsx("ul",{className:se("tags text-small",t,i,{"one-line":r}),children:c.map(l=>{const u=s.formatMessage({id:l.text});return T.jsx("li",{children:l.href&&n?T.jsx("a",{href:l.href,className:"gtm-trackable","data-gtm-event-type":o,"data-gtm-event-context":a,children:u}):u},l.id)})})};const TN=({members:{total:e,data:t=[]},pagination:r,gtmContext:n="member",gtmType:i="member-click",className:o=""})=>{const a=Se();return t.length===0?null:(e||(e=t.length),T.jsxs("div",{className:se("members-list",o),children:[T.jsxs("h1",{children:[a.formatMessage({id:"membersList"}),T.jsx("span",{className:"count",children:e})]}),T.jsx("ul",{children:t.map((s,c)=>T.jsxs("li",{children:[T.jsx(Au,{member:s,gtmContext:n,gtmType:i}),s.isAdmin&&T.jsx(R0,{children:a.formatMessage({id:"membersList_admin"})})]},c))}),r&&T.jsx(lE,{...r,icon:{icon:"arrow-down",position:"right"},gtmContext:n})]}))};function xf(){return xf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xf.apply(this,arguments)}function xN(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var ON=U.useLayoutEffect,AN=function(t){var r=pe.useRef(t);return ON(function(){r.current=t}),r},Qm=function(t,r){if(typeof t=="function"){t(r);return}t.current=r},CN=function(t,r){var n=U.useRef();return U.useCallback(function(i){t.current=i,n.current&&Qm(n.current,null),n.current=r,r&&Qm(r,i)},[r])},Ym={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},RN=function(t){Object.keys(Ym).forEach(function(r){t.style.setProperty(r,Ym[r],"important")})},Km=RN,vt=null,Xm=function(t,r){var n=t.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function PN(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),vt||(vt=document.createElement("textarea"),vt.setAttribute("tabindex","-1"),vt.setAttribute("aria-hidden","true"),Km(vt)),vt.parentNode===null&&document.body.appendChild(vt);var i=e.paddingSize,o=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(d){var f=d;vt.style[f]=a[f]}),Km(vt),vt.value=t;var c=Xm(vt,e);vt.value=t,c=Xm(vt,e),vt.value="x";var l=vt.scrollHeight-i,u=l*r;s==="border-box"&&(u=u+i+o),c=Math.max(u,c);var h=l*n;return s==="border-box"&&(h=h+i+o),c=Math.min(h,c),[c,l]}var Jm=function(){},NN=function(t,r){return t.reduce(function(n,i){return n[i]=r[i],n},{})},IN=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],LN=!!document.documentElement.currentStyle,kN=function(t){var r=window.getComputedStyle(t);if(r===null)return null;var n=NN(IN,r),i=n.boxSizing;if(i==="")return null;LN&&i==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var o=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),a=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:o,borderSize:a}},MN=kN;function OE(e,t,r){var n=AN(r);pe.useLayoutEffect(function(){var i=function(a){return n.current(a)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var FN=function(t){OE(window,"resize",t)},DN=function(t){OE(document.fonts,"loadingdone",t)},BN=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],UN=function(t,r){var n=t.cacheMeasurements,i=t.maxRows,o=t.minRows,a=t.onChange,s=a===void 0?Jm:a,c=t.onHeightChange,l=c===void 0?Jm:c,u=xN(t,BN),h=u.value!==void 0,d=pe.useRef(null),f=CN(d,r),p=pe.useRef(0),m=pe.useRef(),_=function(){var w=d.current,A=n&&m.current?m.current:MN(w);if(A){m.current=A;var b=PN(A,w.value||w.placeholder||"x",o,i),N=b[0],k=b[1];p.current!==N&&(p.current=N,w.style.setProperty("height",N+"px","important"),l(N,{rowHeight:k}))}},S=function(w){h||_(),s(w)};return pe.useLayoutEffect(_),FN(_),DN(_),pe.createElement("textarea",xf({},u,{onChange:S,ref:f}))},$N=pe.forwardRef(UN);let $a=null;const Ot="discussion_form_",mh=({content:e={type:"response",slugs:{}},userHasPermissions:t=!0,meta:r={isLoading:!1,isInWrapper:!1,isEditing:!1,showTitle:!1},inputRef:n,maxLength:i=5e4,minRows:o=4,forceShow:a={cancel:!1,error:!1},functions:s={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},props:{create:{projectNames:["questions-answers"]}}},gtmContext:c="DiscussionForm"})=>{var $,G;const l=Se(),u=U.useContext($r),[h,d]=U.useState(r.isEditing&&r.isEditing.text||""),[f,p]=U.useState(a.error||!1),[m,_]=U.useState(!1),S=U.useRef(null);if(n||(n=S),r.isLoading)return T.jsx(yr,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const v=q=>{const H=q.target.value;d(H);let Y;!u||!u.id?Y=ar(l.formatMessage,`${Ot}error_loggedOut`,e.type,"action"):t?H.length>=i&&(Y=`${Ot}error_tooLong`):Y=ar(l.formatMessage,`${Ot}error_noPermission`,e.type,"action"),Y?p(Y):f&&p(!1)};let w=`${e.type}-form`;if(e.type==="response"||e.type==="reply"){const q=e.type==="response"?(($=e.slugs)==null?void 0:$.question)||"":((G=e.slugs)==null?void 0:G.answer)||"";q&&(w=`${w}-${q.slice(-15)}`)}const A=async q=>{var Y;if(q.preventDefault(),q.stopPropagation(),!u||!u.id||!t||N)return;$a&&clearTimeout($a),_("submitting");const H=window.location.pathname;try{let re;switch(e.type){case"post":re=await s.create({content:h});break;case"question":re=await s.create({title:h,authorId:u&&u.id,...(Y=s.props)==null?void 0:Y.create});break;case"response":re=await s.create({question:e.slugs.question},{body:h,authorId:u&&u.id,contentPath:H});break;case"reply":re=await s.create({question:e.slugs.question,answer:e.slugs.answer},{body:h,authorId:u&&u.id,contentPath:H});break;default:break}await SO(1e3),s.callback&&await s.callback(re),$a=setTimeout(()=>{d(""),_("submitted"),b()},500)}catch(re){const X=re;let M=`${Ot}error`;X.message.includes("entry already exists")&&(M=ar(l.formatMessage,`${Ot}error_alreadyExists`,e.type,"action")),X.message.includes("429")?M=ar(l.formatMessage,`${Ot}error_tooMany`,e.type,"action"):X.message.includes("400")&&(M=`${Ot}error`),p(M),b()}},b=()=>{$a=setTimeout(()=>{p(!1),_(!1)},5e3)},N=!h||!RO(h),k=m==="submitting",R=[];return(r.isEditing&&!k||a.cancel)&&R.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:s.handleCancel,className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`cancel-${e.type}-click`,disabled:!a.cancel&&(!u||!u.id||!h),children:l.formatMessage({id:`${Ot}cancel`})}),R.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:q=>{if(r.isEditing){_("submitting"),s.handleSaveEdit&&s.handleSaveEdit(S.current&&"value"in S.current?S.current.value:"");return}A(q)},className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`${r.isEditing?"save":"submit"}-${e.type}-click`,"data-testid":"save-button",disabled:!u||!u.id||!t||N||k||r.isEditing&&h===r.isEditing.text,children:l.formatMessage({id:`${Ot}${k?r.isEditing?"saving":"posting":r.isEditing?"save":"post"}`})}),T.jsxs("form",{id:w,className:se("discussion-card discussion-form",{"no-styling":r.isInWrapper&&r.isEditing}),"data-testid":`discussion-${e.type}-form`,children:[(r==null?void 0:r.showTitle)&&!r.isEditing&&["question"].includes(e.type)&&T.jsx("h2",{children:ar(l.formatMessage,`${Ot}title`,e.type,"action")}),T.jsx(Au,{member:u||"community",gtmContext:c,gtmType:"profile-click"}),T.jsx(lt,{element:"label",showOnFocus:!1,htmlFor:`${w}-input`,children:ar(l.formatMessage,`${Ot}label`,e.type,"action")}),T.jsx($N,{ref:n,id:`${w}-input`,name:e.type,placeholder:ar(l.formatMessage,`${Ot}placeholder`,e.type,"action"),onChange:v,value:h,maxLength:i,"aria-invalid":!!f,"aria-errormessage":"error-message",minRows:o,autoFocus:!!r.isEditing}),T.jsx("small",{children:ar(l.formatMessage,`${Ot}explainer`,e.type,"action",{a:q=>T.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":"community-guidelines-link",children:q})})}),T.jsx(na,{buttons:R}),m==="submitted"&&T.jsx(nu,{className:"success","data-testid":"success",children:ar(l.formatMessage,`${Ot}success`,e.type,"action")}),f&&T.jsx(nu,{id:"error-message",className:"error","data-testid":"error",children:a.error?a.error:typeof f=="string"?f.includes(" ")?f:l.formatMessage({id:f},{action:l.formatMessage({id:`discussion_action_${e.type}`}),maxLength:i}):f})]})},gh=({contentType:e,createPost:t,membershipRequiredToPost:{isMember:r,required:n,join:i,leave:o,notMemberStateText:a}})=>n&&!r?T.jsx(aa,{text:a,button:{component:T.jsx(ah,{functions:{join:i,leave:o}})}}):T.jsx(mh,{content:{type:e,slugs:{}},functions:{create:t}}),jN={showThread:!1,showForm:!1},yh=U.createContext(jN),HN=({children:e})=>{const[t,r]=U.useState({showThread:!1,showForm:!1});return T.jsx(yh.Provider,{value:{...t,updateConversation:r},children:e})},qN=({question:e,answer:t,reply:r})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...r&&{replySlug:r}}),GN=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);let Os=!1;const Ol=()=>{Os!==!1&&(clearTimeout(Os),Os=!1)},Al=10,AE=({element:e="div",likes:t=0,peopleWhoLiked:r=!1,isShort:n=!0,userLiked:i=!1,content:o={type:"reply",slugs:{}},canLike:a=!0,functions:{createLike:s=()=>{},deleteLike:c=()=>{}}={}})=>{const l=Se();U.useEffect(()=>{f(i)},[i]);const[u,h]=U.useState(t),[d,f]=U.useState(i),[p,m]=U.useState(!1),[_,S]=U.useState(!1),v=U.useMemo(()=>GN(r,Al),[r]),w=b=>{if(b.preventDefault(),b.stopPropagation(),S(!1),Os)return Ol(),!1;if(Ol(),p||!a)return!1;Os=setTimeout(A,350)},A=async()=>{if(Ol(),p||!a)return!1;let b=d?u-1:u+1;b<0&&(b=0),m(!0),h(b),f(!d);try{if(o&&o.slugs){const N=qN(o.slugs);d?await c(N):await s(N,{contentPath:window.location.pathname})}}catch{h(t),f(i)}finally{m(!1)}};return U.createElement(e,{className:se("likes-wrapper text-medium action-button",{"show-spinner":p,"is-liked":d,disabled:!a}),onClick:w,onMouseEnter:()=>{S(!0)},onMouseLeave:()=>{S(!1)},onFocus:()=>{S(!0)},onBlur:()=>{S(!1)},children:T.jsxs(T.Fragment,{children:[T.jsx(ze,{variant:"tertiary",size:"medium",icon:{icon:d?"heart":"heart_empty",animate:"bounce"},className:se({"do-animation":d&&!i}),screenreaderText:a?l.formatMessage({id:`discussion_likes_${d?"unlike":"like"}`},{action:l.formatMessage({id:`discussion_action_${o.type}`})}):!1,onClick:w,disabled:!a,"aria-hidden":!a,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${o.type}-click`}),T.jsx("span",{className:se("number-of-likes",{"no-likes":u===0}),"data-testid":"number-of-likes",children:l.formatMessage({id:`discussion_likes${n?"_short":""}`},{number:u})}),r&&T.jsx(o0,{isOpen:_,isLoading:r.length===0,children:r.length&&T.jsxs("ul",{children:[v.map(b=>typeof b=="string"||!b.name?null:T.jsx("li",{children:T.jsx(ia,{href:b.id?`/profiles/${b.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",children:b.name})},b.id||window.btoa(b.name))),r.length>Al&&T.jsx("li",{children:l.formatMessage({id:"discussion_likes_more"},{number:r.length-Al})})]})})]})})};var mu={exports:{}};mu.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=1,o=2,a=9007199254740991,s="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",h="[object Date]",d="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",_="[object Number]",S="[object Null]",v="[object Object]",w="[object Promise]",A="[object Proxy]",b="[object RegExp]",N="[object Set]",k="[object String]",R="[object Symbol]",$="[object Undefined]",G="[object WeakMap]",q="[object ArrayBuffer]",H="[object DataView]",Y="[object Float32Array]",re="[object Float64Array]",X="[object Int8Array]",M="[object Int16Array]",Q="[object Int32Array]",J="[object Uint8Array]",fe="[object Uint8ClampedArray]",Z="[object Uint16Array]",K="[object Uint32Array]",ce=/[\\^$.*+?()[\]{}|]/g,de=/^\[object .+?Constructor\]$/,Ve=/^(?:0|[1-9]\d*)$/,te={};te[Y]=te[re]=te[X]=te[M]=te[Q]=te[J]=te[fe]=te[Z]=te[K]=!0,te[s]=te[c]=te[q]=te[u]=te[H]=te[h]=te[d]=te[f]=te[m]=te[_]=te[v]=te[b]=te[N]=te[k]=te[G]=!1;var ae=typeof he=="object"&&he&&he.Object===Object&&he,De=typeof self=="object"&&self&&self.Object===Object&&self,Ie=ae||De||Function("return this")(),Tt=t&&!t.nodeType&&t,Ct=Tt&&!0&&e&&!e.nodeType&&e,Gt=Ct&&Ct.exports===Tt,oe=Gt&&ae.process,st=function(){try{return oe&&oe.binding&&oe.binding("util")}catch{}}(),Je=st&&st.isTypedArray;function Vt(y,O){for(var I=-1,W=y==null?0:y.length,ge=0,le=[];++I<W;){var _e=y[I];O(_e,I,y)&&(le[ge++]=_e)}return le}function wr(y,O){for(var I=-1,W=O.length,ge=y.length;++I<W;)y[ge+I]=O[I];return y}function er(y,O){for(var I=-1,W=y==null?0:y.length;++I<W;)if(O(y[I],I,y))return!0;return!1}function kt(y,O){for(var I=-1,W=Array(y);++I<y;)W[I]=O(I);return W}function yn(y){return function(O){return y(O)}}function Wt(y,O){return y.has(O)}function Mt(y,O){return y==null?void 0:y[O]}function Ze(y){var O=-1,I=Array(y.size);return y.forEach(function(W,ge){I[++O]=[ge,W]}),I}function zt(y,O){return function(I){return y(O(I))}}function yt(y){var O=-1,I=Array(y.size);return y.forEach(function(W){I[++O]=W}),I}var at=Array.prototype,vn=Function.prototype,x=Object.prototype,g=Ie["__core-js_shared__"],E=vn.toString,C=x.hasOwnProperty,L=function(){var y=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),j=x.toString,z=RegExp("^"+E.call(C).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),me=Gt?Ie.Buffer:void 0,Ce=Ie.Symbol,Re=Ie.Uint8Array,Pe=x.propertyIsEnumerable,Ee=at.splice,Rt=Ce?Ce.toStringTag:void 0,Hr=Object.getOwnPropertySymbols,En=me?me.isBuffer:void 0,Sr=zt(Object.keys,Object),_n=Yt(Ie,"DataView"),Tr=Yt(Ie,"Map"),bn=Yt(Ie,"Promise"),wn=Yt(Ie,"Set"),Sn=Yt(Ie,"WeakMap"),tr=Yt(Object,"create"),li=ut(_n),Qt=ut(Tr),Eo=ut(bn),_o=ut(wn),bo=ut(Sn),fi=Ce?Ce.prototype:void 0,Tn=fi?fi.valueOf:void 0;function We(y){var O=-1,I=y==null?0:y.length;for(this.clear();++O<I;){var W=y[O];this.set(W[0],W[1])}}function xn(){this.__data__=tr?tr(null):{},this.size=0}function On(y){var O=this.has(y)&&delete this.__data__[y];return this.size-=O?1:0,O}function xr(y){var O=this.__data__;if(tr){var I=O[y];return I===n?void 0:I}return C.call(O,y)?O[y]:void 0}function hi(y){var O=this.__data__;return tr?O[y]!==void 0:C.call(O,y)}function wo(y,O){var I=this.__data__;return this.size+=this.has(y)?0:1,I[y]=tr&&O===void 0?n:O,this}We.prototype.clear=xn,We.prototype.delete=On,We.prototype.get=xr,We.prototype.has=hi,We.prototype.set=wo;function et(y){var O=-1,I=y==null?0:y.length;for(this.clear();++O<I;){var W=y[O];this.set(W[0],W[1])}}function So(){this.__data__=[],this.size=0}function To(y){var O=this.__data__,I=Vr(O,y);if(I<0)return!1;var W=O.length-1;return I==W?O.pop():Ee.call(O,I,1),--this.size,!0}function xo(y){var O=this.__data__,I=Vr(O,y);return I<0?void 0:O[I][1]}function Oo(y){return Vr(this.__data__,y)>-1}function An(y,O){var I=this.__data__,W=Vr(I,y);return W<0?(++this.size,I.push([y,O])):I[W][1]=O,this}et.prototype.clear=So,et.prototype.delete=To,et.prototype.get=xo,et.prototype.has=Oo,et.prototype.set=An;function ht(y){var O=-1,I=y==null?0:y.length;for(this.clear();++O<I;){var W=y[O];this.set(W[0],W[1])}}function Ao(){this.size=0,this.__data__={hash:new We,map:new(Tr||et),string:new We}}function Co(y){var O=Pt(this,y).delete(y);return this.size-=O?1:0,O}function Ro(y){return Pt(this,y).get(y)}function Po(y){return Pt(this,y).has(y)}function No(y,O){var I=Pt(this,y),W=I.size;return I.set(y,O),this.size+=I.size==W?0:1,this}ht.prototype.clear=Ao,ht.prototype.delete=Co,ht.prototype.get=Ro,ht.prototype.has=Po,ht.prototype.set=No;function qr(y){var O=-1,I=y==null?0:y.length;for(this.__data__=new ht;++O<I;)this.add(y[O])}function di(y){return this.__data__.set(y,n),this}function Gr(y){return this.__data__.has(y)}qr.prototype.add=qr.prototype.push=di,qr.prototype.has=Gr;function xt(y){var O=this.__data__=new et(y);this.size=O.size}function Cn(){this.__data__=new et,this.size=0}function Io(y){var O=this.__data__,I=O.delete(y);return this.size=O.size,I}function Lo(y){return this.__data__.get(y)}function ko(y){return this.__data__.has(y)}function Mo(y,O){var I=this.__data__;if(I instanceof et){var W=I.__data__;if(!Tr||W.length<r-1)return W.push([y,O]),this.size=++I.size,this;I=this.__data__=new ht(W)}return I.set(y,O),this.size=I.size,this}xt.prototype.clear=Cn,xt.prototype.delete=Io,xt.prototype.get=Lo,xt.prototype.has=ko,xt.prototype.set=Mo;function Fo(y,O){var I=Wr(y),W=!I&&Ei(y),ge=!I&&!W&&Qr(y),le=!I&&!W&&!ge&&Ln(y),_e=I||W||ge||le,be=_e?kt(y.length,String):[],He=be.length;for(var Ae in y)(O||C.call(y,Ae))&&!(_e&&(Ae=="length"||ge&&(Ae=="offset"||Ae=="parent")||le&&(Ae=="buffer"||Ae=="byteLength"||Ae=="byteOffset")||rr(Ae,He)))&&be.push(Ae);return be}function Vr(y,O){for(var I=y.length;I--;)if(vi(y[I][0],O))return I;return-1}function Rn(y,O,I){var W=O(y);return Wr(y)?W:wr(W,I(y))}function Or(y){return y==null?y===void 0?$:S:Rt&&Rt in Object(y)?Kt(y):yi(y)}function pi(y){return Ft(y)&&Or(y)==s}function mi(y,O,I,W,ge){return y===O?!0:y==null||O==null||!Ft(y)&&!Ft(O)?y!==y&&O!==O:gi(y,O,I,W,mi,ge)}function gi(y,O,I,W,ge,le){var _e=Wr(y),be=Wr(O),He=_e?c:Nt(y),Ae=be?c:Nt(O);He=He==s?v:He,Ae=Ae==s?v:Ae;var tt=He==v,ct=Ae==v,Ge=He==Ae;if(Ge&&Qr(y)){if(!Qr(O))return!1;_e=!0,tt=!1}if(Ge&&!tt)return le||(le=new xt),_e||Ln(y)?Pn(y,O,I,W,ge,le):$o(y,O,He,I,W,ge,le);if(!(I&i)){var rt=tt&&C.call(y,"__wrapped__"),Qe=ct&&C.call(O,"__wrapped__");if(rt||Qe){var nr=rt?y.value():y,Xt=Qe?O.value():O;return le||(le=new xt),ge(nr,Xt,I,W,le)}}return Ge?(le||(le=new xt),Nn(y,O,I,W,ge,le)):!1}function Do(y){if(!bi(y)||qo(y))return!1;var O=_i(y)?z:de;return O.test(ut(y))}function Bo(y){return Ft(y)&&In(y.length)&&!!te[Or(y)]}function Uo(y){if(!Go(y))return Sr(y);var O=[];for(var I in Object(y))C.call(y,I)&&I!="constructor"&&O.push(I);return O}function Pn(y,O,I,W,ge,le){var _e=I&i,be=y.length,He=O.length;if(be!=He&&!(_e&&He>be))return!1;var Ae=le.get(y);if(Ae&&le.get(O))return Ae==O;var tt=-1,ct=!0,Ge=I&o?new qr:void 0;for(le.set(y,O),le.set(O,y);++tt<be;){var rt=y[tt],Qe=O[tt];if(W)var nr=_e?W(Qe,rt,tt,O,y,le):W(rt,Qe,tt,y,O,le);if(nr!==void 0){if(nr)continue;ct=!1;break}if(Ge){if(!er(O,function(Xt,Cr){if(!Wt(Ge,Cr)&&(rt===Xt||ge(rt,Xt,I,W,le)))return Ge.push(Cr)})){ct=!1;break}}else if(!(rt===Qe||ge(rt,Qe,I,W,le))){ct=!1;break}}return le.delete(y),le.delete(O),ct}function $o(y,O,I,W,ge,le,_e){switch(I){case H:if(y.byteLength!=O.byteLength||y.byteOffset!=O.byteOffset)return!1;y=y.buffer,O=O.buffer;case q:return!(y.byteLength!=O.byteLength||!le(new Re(y),new Re(O)));case u:case h:case _:return vi(+y,+O);case d:return y.name==O.name&&y.message==O.message;case b:case k:return y==O+"";case m:var be=Ze;case N:var He=W&i;if(be||(be=yt),y.size!=O.size&&!He)return!1;var Ae=_e.get(y);if(Ae)return Ae==O;W|=o,_e.set(y,O);var tt=Pn(be(y),be(O),W,ge,le,_e);return _e.delete(y),tt;case R:if(Tn)return Tn.call(y)==Tn.call(O)}return!1}function Nn(y,O,I,W,ge,le){var _e=I&i,be=Ar(y),He=be.length,Ae=Ar(O),tt=Ae.length;if(He!=tt&&!_e)return!1;for(var ct=He;ct--;){var Ge=be[ct];if(!(_e?Ge in O:C.call(O,Ge)))return!1}var rt=le.get(y);if(rt&&le.get(O))return rt==O;var Qe=!0;le.set(y,O),le.set(O,y);for(var nr=_e;++ct<He;){Ge=be[ct];var Xt=y[Ge],Cr=O[Ge];if(W)var ua=_e?W(Cr,Xt,Ge,O,y,le):W(Xt,Cr,Ge,y,O,le);if(!(ua===void 0?Xt===Cr||ge(Xt,Cr,I,W,le):ua)){Qe=!1;break}nr||(nr=Ge=="constructor")}if(Qe&&!nr){var ir=y.constructor,Yr=O.constructor;ir!=Yr&&"constructor"in y&&"constructor"in O&&!(typeof ir=="function"&&ir instanceof ir&&typeof Yr=="function"&&Yr instanceof Yr)&&(Qe=!1)}return le.delete(y),le.delete(O),Qe}function Ar(y){return Rn(y,wi,jo)}function Pt(y,O){var I=y.__data__;return Ho(O)?I[typeof O=="string"?"string":"hash"]:I.map}function Yt(y,O){var I=Mt(y,O);return Do(I)?I:void 0}function Kt(y){var O=C.call(y,Rt),I=y[Rt];try{y[Rt]=void 0;var W=!0}catch{}var ge=j.call(y);return W&&(O?y[Rt]=I:delete y[Rt]),ge}var jo=Hr?function(y){return y==null?[]:(y=Object(y),Vt(Hr(y),function(O){return Pe.call(y,O)}))}:Si,Nt=Or;(_n&&Nt(new _n(new ArrayBuffer(1)))!=H||Tr&&Nt(new Tr)!=m||bn&&Nt(bn.resolve())!=w||wn&&Nt(new wn)!=N||Sn&&Nt(new Sn)!=G)&&(Nt=function(y){var O=Or(y),I=O==v?y.constructor:void 0,W=I?ut(I):"";if(W)switch(W){case li:return H;case Qt:return m;case Eo:return w;case _o:return N;case bo:return G}return O});function rr(y,O){return O=O??a,!!O&&(typeof y=="number"||Ve.test(y))&&y>-1&&y%1==0&&y<O}function Ho(y){var O=typeof y;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?y!=="__proto__":y===null}function qo(y){return!!L&&L in y}function Go(y){var O=y&&y.constructor,I=typeof O=="function"&&O.prototype||x;return y===I}function yi(y){return j.call(y)}function ut(y){if(y!=null){try{return E.call(y)}catch{}try{return y+""}catch{}}return""}function vi(y,O){return y===O||y!==y&&O!==O}var Ei=pi(function(){return arguments}())?pi:function(y){return Ft(y)&&C.call(y,"callee")&&!Pe.call(y,"callee")},Wr=Array.isArray;function zr(y){return y!=null&&In(y.length)&&!_i(y)}var Qr=En||Wo;function Vo(y,O){return mi(y,O)}function _i(y){if(!bi(y))return!1;var O=Or(y);return O==f||O==p||O==l||O==A}function In(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=a}function bi(y){var O=typeof y;return y!=null&&(O=="object"||O=="function")}function Ft(y){return y!=null&&typeof y=="object"}var Ln=Je?yn(Je):Bo;function wi(y){return zr(y)?Fo(y):Uo(y)}function Si(){return[]}function Wo(){return!1}e.exports=Vo})(mu,mu.exports);var VN=mu.exports;const WN=Er(VN);const CE=({element:e="section",children:t,className:r,...n})=>U.createElement(e,{className:se("modal",r),children:typeof t=="string"?T.jsx("p",{children:t}):t,...n});const RE=({id:e="content-overlay",isOpen:t=!1,maxWidth:r,functions:{onOpen:n=()=>{},onClose:i=()=>{}}={},forceShow:{error:o=!1}={},title:a,children:s,buttons:c,className:l="",gtmContext:u="Modal"})=>{const h=Se(),[d,f]=U.useState(t),p=_=>{f(_),_?(n(),document.body.classList.add("has-overlay")):(i(),document.body.classList.remove("has-overlay"))};U.useEffect(()=>{p(t)},[t]);const m=r?{"--max-width":`${r/16}rem`}:{};return T.jsx("div",{className:se("overlay",{open:d}),children:T.jsx(CE,{id:e,className:se("overlay-modal",l,{"has-max-width":r}),hidden:!d,style:m,children:t&&T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"top",children:[T.jsx("h2",{children:a}),T.jsx(ze,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>p(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":u,screenreaderText:h.formatMessage({id:"overlay_button"})})]}),T.jsx(tu,{}),s,c&&T.jsxs("div",{className:"bottom",children:[T.jsx(tu,{}),T.jsx(na,{buttons:c})]}),o&&T.jsx(nu,{className:"error",children:o})]})})})},PE=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e}),Zm=e=>{const t={};return Object.keys(e).forEach(r=>{t[`${r}Slug`]=e[r]}),t};const Lr="discussion_",ku=({element:e="div",content:t,userHasPermissions:r=!0,isLoading:n=!1,originalAuthorId:i,functions:{content:{createContent:o,deleteContent:a,updateContent:s}={createContent:()=>{},deleteContent:()=>{},updateContent:()=>{}},likes:{createLike:c,deleteLike:l}={createLike:()=>{},deleteLike:()=>{}},comments:{openComments:u}={openComments:()=>{}}},links:h={},className:d,gtmContext:f="DiscussionAnswer",children:p})=>{const m=Se(),_=U.useContext($r),S=U.useContext(yh),[v,w]=U.useState({body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1}),[A,b]=U.useState(!1),[N,k]=U.useState("");if(U.useEffect(()=>{w({...v,body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),n||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question))return T.jsx(yr,{className:"discussion-card discussion-post"});const{author:R,canLike:$,createdAt:G,id:q,likes:H=0,userLiked:Y,comments:re=0}=t,X=_&&_.id&&typeof R!="string"&&R.id&&R.id===_.id||!1,M=typeof $=="boolean"?$:r?!X:!1,Q=async K=>{K||(K=""),k("");try{if(!WN(K,v.body)){const ce=t.type==="question"?{title:K}:{body:K};await s(Zm(t.slugs),ce)}w({body:K,isEditing:!1,didEdit:!0})}catch{k(`${Lr}form_error`)}},J=()=>{S&&S.updateConversation&&S.updateConversation({showThread:!0,showForm:!0}),setTimeout(()=>{const ce=`reply-form-${(t.type==="answer"?t.slug:t.slugs.answer||"").toLowerCase().slice(-15)}`,de=document.getElementById(ce),Ve=document.getElementById(`${ce}-input`);Ve&&Ve.focus(),de&&de.scrollIntoView({behavior:"smooth"})},0)},fe=()=>{try{a(Zm(t.slugs))}catch{k("delete-error")}},Z=[{text:m.formatMessage({id:`${Lr}moreMenu_report`}),href:`mailto:community@apolitical.co?subject=${encodeURI(m.formatMessage({id:`${Lr}report_subject`}))}&body=${encodeURI(m.formatMessage({id:`${Lr}report_body`},{contentType:t.type||"",contentSlug:t.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}))}`,icon:"flag"}];return r&&X&&Z.push({text:m.formatMessage({id:`${Lr}moreMenu_edit`}),onClick:()=>w({...v,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":`edit-${t.type}-click`},{text:m.formatMessage({id:`${Lr}moreMenu_delete`}),onClick:K=>{K.preventDefault(),K.stopPropagation(),b(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":`delete-${t.type}-click`,...PE(`delete-${t.slug}-modal`,A)}),U.createElement(e,{className:se("discussion-post",d),"data-testid":`discussion-${t.type}-thread`,children:T.jsxs(T.Fragment,{children:[T.jsxs("div",{id:q||t.slug,className:se("discussion-card",t.type,{editing:v.isEditing,"has-link":h.post&&!v.isEditing}),onClick:K=>{!h.post||v.isEditing||(K.preventDefault(),K.stopPropagation(),window.location.href=h.post)},children:[!v.isEditing&&T.jsx(Au,{member:R,additionalContent:{createdAt:G,didEdit:v.didEdit},className:typeof R!="string"&&R.id===i?"highlighted":"",gtmContext:f,gtmType:"profile-click"}),v.isEditing?T.jsx(mh,{content:{type:t.type,slugs:t.slugs},userHasPermissions:r,meta:{isLoading:n,isInWrapper:!0,isEditing:{text:v.body}},maxLength:t.type==="question"?250:5e4,forceShow:{error:N!==""&&N!=="delete-error"?m.formatMessage({id:N},{action:m.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:o,handleSaveEdit:Q,handleCancel:()=>{k(""),w({...v,isEditing:!1})}},gtmContext:`${f}Form`}):h.post?T.jsx("a",{href:h.post,className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":"title-click",children:T.jsx(sf,{options:{overrides:{a:C0}},children:v.body})}):T.jsx(sf,{options:{wrapper:t.type==="question"?"h1":U.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question"},children:v.body}),!v.isEditing&&T.jsxs("ul",{className:se("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[T.jsx(AE,{element:"li",likes:H,isShort:!1,userLiked:Y,content:{type:t.type,slugs:t.slugs},canLike:M,functions:{createLike:c,deleteLike:l}}),(["question","post"].includes(t.type)||h.comments||typeof u=="function")&&T.jsxs("li",{className:"action-button",onClick:K=>{K.preventDefault(),K.stopPropagation(),h.comments&&(window.location.href=h.comments),typeof u=="function"&&u()},children:[T.jsx(ze,{variant:"tertiary",size:"medium",styling:{muted:!0},icon:{icon:"speech-bubble_square_thick"},href:h.comments?h.comments:!1,onClick:h.comments||typeof u!="function"?!1:u,className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:m.formatMessage({id:`${Lr}comments_screenReader`},{count:re})}),T.jsx("span",{children:m.formatMessage({id:`${Lr}comments`},{count:re})})]}),(t.type==="answer"||t.type==="reply")&&T.jsx("li",{children:T.jsx(ze,{variant:"tertiary",size:"medium",styling:{muted:!0},onClick:J,children:m.formatMessage({id:`${Lr}reply`})})}),T.jsx(fE,{element:"li",id:`more-${t.slug}`,options:Z})]})]}),p,T.jsx(RE,{id:`delete-${t.slug}-modal`,isOpen:A,functions:{onOpen:()=>{},onClose:()=>b(!1)},forceShow:{error:N==="delete-error"?m.formatMessage({id:"discussion_delete_error"},{action:m.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:m.formatMessage({id:"discussion_delete_title"},{action:m.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>b(!1),children:m.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:fe,children:m.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:T.jsx(ln,{id:"discussion_delete_text",values:{p:K=>T.jsx("p",{children:K}),action:m.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const Cl="discussion_responses_",zN=({type:e="answer",responses:t=0})=>{const r=Se();return T.jsxs("div",{className:"responses-heading",children:[T.jsx("h3",{children:r.formatMessage({id:`${Cl}title`},{action:r.formatMessage({id:`${Cl}${e}`}),count:t})}),t===0&&T.jsx("p",{children:ar(r.formatMessage,`${Cl}empty`,e,e)})]})};const QN=({isOpen:e=!1,count:t=0,children:r})=>{const n=Se(),i=U.useRef(null),[o,a]=U.useState(e),[s,c]=U.useState("closed");U.useEffect(()=>{const d=i.current;if(d)return d.addEventListener("transitionend",l),()=>{d.removeEventListener("transitionend",l)}},[]),ri(()=>{s==="closed"&&!o||c(["opening","open"].includes(s)?"ready-to-close":"opening")},[o]),U.useEffect(()=>{s==="ready-to-close"&&c("closing")},[s]);const l=({propertyName:d})=>{d==="max-height"&&c(f=>f==="opening"?"open":f==="closing"?"closed":f)},u=["opening","open"].includes(s),h=Av(r,{element:"li"});return T.jsxs("div",{className:"thread-wrapper",children:[T.jsx(ze,{variant:"secondary",size:"small",styling:{muted:!0},icon:{icon:`arrow_corner-down_${u?"left":"right"}`},onClick:()=>{a(!o)},children:n.formatMessage({id:`discussion_thread_${u?"hide":"show"}`},{count:t})}),T.jsx("ul",{ref:i,className:se("thread",s),hidden:!o,children:h})]})},YN=({user:e,content:t,verb:r="post"})=>({actor:{id:e.id,data:{name:e.name,organization:e==null?void 0:e.organization,jobTitle:e==null?void 0:e.jobTitle}},content:t,latest_reactions:{like:[]},reaction_counts:{like:0},verb:r}),KN=({queryClient:e,queryKey:t,user:r,mutationFn:n})=>({mutationFn:n,onMutate:async({content:s})=>{if(!r)return;const c=YN({user:r,content:s,verb:"post"});await e.cancelQueries({queryKey:t});const l=e.getQueryData(t);return e.setQueryData(t,u=>[...u,c]),{previousActivities:l}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivities)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),XN=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async({activityId:s})=>{await e.cancelQueries({queryKey:t});const c=e.getQueryData(t),l=c==null?void 0:c.map(u=>{var h;return(u==null?void 0:u.id)===s&&((h=u.reaction_counts)!=null&&h.like?u.reaction_counts.like+=1:u.reaction_counts.like=1),u});return e.setQueryData(t,()=>l&&[...l]),{previousActivities:l}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivities)},onSuccess:s=>{const c=e.getQueryData(t),l=c==null?void 0:c.map(u=>((u==null?void 0:u.id)===(s==null?void 0:s.activity_id)&&(u.latest_reactions.like?u.latest_reactions.like.push(s):u.latest_reactions.like=[s]),u));return e.setQueryData(t,()=>l&&[...l]),{previousActivities:c}},onSettled:(s,c,l)=>{e.invalidateQueries({queryKey:[...t,l.activityId]})}}),JN=({queryClient:e,queryKey:t,user:r,mutationFn:n})=>({mutationFn:n,onMutate:async({activityId:c})=>{await e.cancelQueries({queryKey:t});const l=e.getQueryData(t),u=l==null?void 0:l.map(h=>{var d;return(h==null?void 0:h.id)===c&&(d=h.reaction_counts)!=null&&d.like&&(h.reaction_counts.like-=1),h});return e.setQueryData(t,()=>u&&[...u]),{previousActivities:u}},onError:(c,l,u)=>{e.setQueryData(t,u.previousActivities)},onSuccess:(c,{activityId:l})=>{const u=e.getQueryData(t),h=u==null?void 0:u.map(d=>{var f,p,m,_;if(d.id===l){const S=(m=(p=(f=d.latest_reactions)==null?void 0:f.like)==null?void 0:p.find(v=>v.user_id===(r==null?void 0:r.id)))==null?void 0:m.id;return d.latest_reactions.like=(_=d.latest_reactions.like)==null?void 0:_.filter(v=>v.id!==S),d}else return d});return e.setQueryData(t,()=>h&&[...h]),{previousActivities:u}},onSettled:(c,l,u)=>{e.invalidateQueries({queryKey:[...t,u.activityId]})}}),ZN=({basePath:e,parentId:t,isMember:r,functions:{list:n,create:i,like:o,unlike:a,join:s,leave:c}})=>{const l=Se(),u=go(),h=U.useContext($r),{data:d,error:f,isLoading:p,isFetching:m}=W0({queryKey:[e,t],queryFn:n}),_=KN({queryClient:u,queryKey:[e,t],user:h,mutationFn:i}),{mutate:S}=fn(_),v=XN({queryClient:u,queryKey:[e,t],mutationFn:o}),{mutate:w}=fn(v),A=JN({queryClient:u,queryKey:[e,t],user:h,mutationFn:async({activityId:R})=>{var q,H,Y;const $=d&&(d==null?void 0:d.find(re=>re.id===R)),G=(Y=(H=(q=$==null?void 0:$.latest_reactions)==null?void 0:q.like)==null?void 0:H.find(re=>re.user_id===(h==null?void 0:h.id)))==null?void 0:Y.id;await a({reactionId:G||"",activityId:R})}}),{mutate:b}=fn(A),N=U.useCallback(({activityId:R})=>w({activityId:R}),[w]),k=U.useCallback(({activityId:R})=>b({activityId:R}),[b]);return f?T.jsx(aa,{variant:"error",text:f.message}):p?T.jsx(yr,{style:{height:"400px"}}):T.jsxs(T.Fragment,{children:[T.jsx(gh,{contentType:"post",createPost:S,membershipRequiredToPost:{isMember:r,required:!0,join:s,leave:c,notMemberStateText:l.formatMessage({id:"communityGeneral_join_to_post"})}}),!m&&Array.isArray(d)&&(d==null?void 0:d.map(R=>{var $,G,q,H,Y,re,X,M,Q,J,fe;return T.jsx(ku,{content:{type:"post",body:R==null?void 0:R.content,createdAt:(R==null?void 0:R.time)||"",slugs:{question:t},slug:R==null?void 0:R.id,author:{id:($=R==null?void 0:R.actor)==null?void 0:$.id,name:(q=(G=R==null?void 0:R.actor)==null?void 0:G.data)==null?void 0:q.name,organization:(Y=(H=R==null?void 0:R.actor)==null?void 0:H.data)==null?void 0:Y.organization,jobTitle:(X=(re=R==null?void 0:R.actor)==null?void 0:re.data)==null?void 0:X.jobTitle,image:{thumbnail:((Q=(M=R==null?void 0:R.actor)==null?void 0:M.data)==null?void 0:Q.thumbnail)||void 0}},userLiked:((J=R==null?void 0:R.own_reactions)==null?void 0:J.like)&&((fe=R==null?void 0:R.own_reactions)==null?void 0:fe.like.length)>0,likes:(R==null?void 0:R.reaction_counts.like)||0,comments:(R==null?void 0:R.reaction_counts.reply)||0},links:{post:`${e}/${t}/${R==null?void 0:R.id}`,comments:`${e}/${t}/${R==null?void 0:R.id}`},functions:{content:{createContent:()=>null,deleteContent:()=>null,updateContent:()=>null},likes:{createLike:()=>{N({activityId:R==null?void 0:R.id})},deleteLike:()=>{k({activityId:R==null?void 0:R.id})}},comments:{openComments:()=>null}}},R==null?void 0:R.id)}))]})},eI=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async()=>{await e.cancelQueries({queryKey:t})},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:s=>{var l;const c=e.getQueryData(t);if(c)return(l=c==null?void 0:c.latest_reactions)!=null&&l.reply?(c.latest_reactions.reply.unshift(s),c&&(c.reaction_counts={reply:c.latest_reactions.reply.length})):(c.latest_reactions={reply:[s]},c.reaction_counts={reply:1}),e.setQueryData(t,()=>({...c})),{previousActivity:c}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),tI=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async({replyId:a})=>{var l,u;await e.cancelQueries({queryKey:t});const s=e.getQueryData(t),c=(u=(l=s==null?void 0:s.latest_reactions)==null?void 0:l.reply)==null?void 0:u.map(h=>{var d;return h.id===a&&((d=h.children_counts)!=null&&d.like?h.children_counts.like+=1:h.children_counts={like:1}),h});return e.setQueryData(t,()=>({...s,latest_reactions:{reply:c}})),{previousActivity:s}},onError:(a,s,c)=>{e.setQueryData(t,c.previousActivity)},onSuccess:a=>{var l;const s=e.getQueryData(t),c=(l=s==null?void 0:s.latest_reactions.reply)==null?void 0:l.map(u=>(u.id===a.id&&(u.latest_children.like?u.latest_children.like.push(a):u.latest_children.like=[a]),u));return e.setQueryData(t,()=>({...s,latest_reactions:{reply:c}})),{previousActivity:s}}}),rI=({queryClient:e,queryKey:t,user:r,mutationFn:n})=>({mutationFn:n,onMutate:async({replyId:s})=>{var u;await e.cancelQueries({queryKey:t});const c=e.getQueryData(t);if(!c)return;const l=(u=c.latest_reactions.reply)==null?void 0:u.map(h=>(h.id===s&&h.children_counts.like&&(h.children_counts.like-=1),h));return e.setQueryData(t,()=>({...c,latest_reactions:{reply:l}})),{previousActivity:c}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:(s,{replyId:c})=>{var h;const l=e.getQueryData(t);if(!l)return;const u=(h=l.latest_reactions.reply)==null?void 0:h.map(d=>{var f;return d.id===c?(f=d.latest_children.reply)==null?void 0:f.filter(m=>m.user_id!==(r==null?void 0:r.id)):d});return e.setQueryData(t,()=>({...l,latest_reactions:{reply:u}})),{previousActivity:l}}}),NE=({basePath:e,parentId:t,activityId:r,repliesList:n,isMember:i,functions:{createReply:o,like:a,unlike:s,join:c,leave:l}})=>{const u=Se(),h=go(),d=U.useContext($r),f=eI({queryClient:h,queryKey:[e,t,r],mutationFn:o}),{mutate:p}=fn(f),m=tI({queryClient:h,queryKey:[e,t,r],mutationFn:a}),{mutate:_}=fn(m),S=rI({queryClient:h,queryKey:[e,t,r],user:d,mutationFn:s}),{mutate:v}=fn(S),w=U.useCallback(({replyId:b})=>_({replyId:b}),[_]),A=U.useCallback(({replyId:b})=>v({replyId:b}),[v]);return T.jsxs(T.Fragment,{children:[T.jsx(gh,{contentType:"post",createPost:p,membershipRequiredToPost:{isMember:i,required:!0,join:c,leave:l,notMemberStateText:u.formatMessage({id:"communityGeneral_join_to_post"})}}),(n==null?void 0:n.length)===0||(n==null?void 0:n.map(b=>{var k,R,$,G,q,H,Y,re,X,M,Q,J,fe,Z,K,ce;const N=((k=b==null?void 0:b.latest_children)==null?void 0:k.like)&&((R=b==null?void 0:b.latest_children)==null?void 0:R.like.filter(de=>de.user_id===(d==null?void 0:d.id)));return T.jsx(ku,{content:{type:"post",body:typeof b.data.content=="string"?($=b==null?void 0:b.data)==null?void 0:$.content:((q=(G=b==null?void 0:b.data)==null?void 0:G.content)==null?void 0:q.text)||"",createdAt:b==null?void 0:b.created_at,slugs:{question:`${e}/${t}/${r}`,reply:b==null?void 0:b.id},slug:`${e}/${t}/${r}#${b==null?void 0:b.id}`,author:{id:(H=b==null?void 0:b.user)==null?void 0:H.id,name:(re=(Y=b==null?void 0:b.user)==null?void 0:Y.data)==null?void 0:re.name,organization:(M=(X=b==null?void 0:b.user)==null?void 0:X.data)==null?void 0:M.organization,jobTitle:(J=(Q=b==null?void 0:b.user)==null?void 0:Q.data)==null?void 0:J.jobTitle,image:{thumbnail:((Z=(fe=b==null?void 0:b.user)==null?void 0:fe.data)==null?void 0:Z.thumbnail)||void 0}},userLiked:!!(N!=null&&N.length),likes:((K=b==null?void 0:b.children_counts)==null?void 0:K.like)||0,comments:((ce=b==null?void 0:b.children_counts)==null?void 0:ce.reply)||0},functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>console.log("delete"),updateContent:()=>console.log("update")},likes:{createLike:()=>w({replyId:b==null?void 0:b.id}),deleteLike:()=>A({replyId:b==null?void 0:b.id})},comments:{openComments:()=>{}}}},b==null?void 0:b.id)}))]})},nI=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async()=>{var c;await e.cancelQueries({queryKey:t});const s=e.getQueryData(t);return(c=s==null?void 0:s.reaction_counts)!=null&&c.like?s.reaction_counts.like+=1:s&&(s.reaction_counts={like:1}),e.setQueryData(t,()=>({...s})),{previousActivity:s}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:s=>{const c=e.getQueryData(t);return c!=null&&c.latest_reactions.like?c.latest_reactions.like.push(s):c&&(c.latest_reactions={like:[s]}),e.setQueryData(t,()=>({...c})),{previousActivity:c}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),iI=({queryClient:e,queryKey:t,user:r,activity:n,mutationFn:i})=>({mutationFn:i,onMutate:async()=>{var u;await e.cancelQueries({queryKey:t});const l=e.getQueryData(t);return(u=l==null?void 0:l.reaction_counts)!=null&&u.like&&l.reaction_counts.like>0&&(l.reaction_counts.like-=1),e.setQueryData(t,()=>({...l})),{previousActivity:l}},onError:(l,u,h)=>{e.setQueryData(t,h.previousActivity)},onSuccess:()=>{var h,d,f;if(!n)return;const l=(f=(d=(h=n.latest_reactions)==null?void 0:h.like)==null?void 0:d.find(p=>p.user_id===(r==null?void 0:r.id)))==null?void 0:f.id,u=e.getQueryData(t);if(u!=null&&u.latest_reactions.like)return u.latest_reactions.like=u.latest_reactions.like.filter(p=>p.id!==l),e.setQueryData(t,()=>({...u})),{previousActivity:u}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),oI=({basePath:e,parentId:t,activityId:r,isMember:n,functions:{get:i,likeActivity:o,unlikeActivity:a,createReply:s,likeReply:c,unlikeReply:l,join:u,leave:h}})=>{var R,$,G,q,H,Y,re,X,M,Q;const d=U.useContext($r),f=go(),{data:p,error:m,isLoading:_,isFetching:S}=W0({queryKey:[e,t,r],queryFn:i}),v=nI({queryClient:f,queryKey:[e,t,r],mutationFn:o}),{mutate:w}=fn(v),A=iI({queryClient:f,queryKey:[e,t,r],user:d,mutationFn:async()=>{var fe,Z,K;const J=(K=(Z=(fe=p==null?void 0:p.latest_reactions)==null?void 0:fe.like)==null?void 0:Z.find(ce=>ce.user_id===(d==null?void 0:d.id)))==null?void 0:K.id;await a({activityId:r,reactionId:J})},activity:p}),{mutate:b}=fn(A),N=U.useCallback(({activityId:J})=>w({activityId:J}),[w]),k=U.useCallback(async({activityId:J})=>b({activityId:J}),[b]);return m?T.jsx(aa,{variant:"error",text:m.message}):_||S?T.jsx(yr,{style:{height:"400px"}}):T.jsx(ku,{content:{type:"post",body:p==null?void 0:p.content,createdAt:(p==null?void 0:p.time)||"",slugs:{question:`${t}/${r}`},slug:r,author:{id:(R=p==null?void 0:p.actor)==null?void 0:R.id,name:($=p==null?void 0:p.actor)==null?void 0:$.data.name,organization:(G=p==null?void 0:p.actor)==null?void 0:G.data.organization,jobTitle:(q=p==null?void 0:p.actor)==null?void 0:q.data.jobTitle,image:{thumbnail:((H=p==null?void 0:p.actor)==null?void 0:H.data.thumbnail)||void 0}},userLiked:((Y=p==null?void 0:p.own_reactions)==null?void 0:Y.like)&&((re=p==null?void 0:p.own_reactions)==null?void 0:re.like.length)>0,likes:p&&(p==null?void 0:p.reaction_counts.like),comments:p&&(p==null?void 0:p.reaction_counts.reply)},originalAuthorId:(X=p==null?void 0:p.actor)==null?void 0:X.id,functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>console.log("delete"),updateContent:()=>console.log("update")},likes:{createLike:()=>N({activityId:r}),deleteLike:()=>k({activityId:r})},comments:{openComments:()=>{}}},children:T.jsxs(T.Fragment,{children:[T.jsxs("h3",{children:["Comments (",((M=p==null?void 0:p.reaction_counts)==null?void 0:M.reply)||0,")"]}),T.jsx(NE,{basePath:e,parentId:t,activityId:r,repliesList:(Q=p==null?void 0:p.latest_reactions)==null?void 0:Q.reply,isMember:n,functions:{createReply:s,like:c,unlike:l,join:u,leave:h}})]})},r)},sI=({id:e,data:{jobTitle:t,name:r,organization:n,thumbnail:i}})=>({id:e,name:r,jobTitle:t,organization:n,image:{thumbnail:i}});exports.$PROXY=Is;exports.$TRACK=nh;exports.ASSETS_BUCKET=ru;exports.ActivitiesFeed=ZN;exports.ActivitySection=oI;exports.AddPost=gh;exports.Breadcrumbs=uP;exports.Button=ze;exports.ButtonWrapper=na;exports.CollapsibleSection=Xf;exports.Columns=dP;exports.CommunityDetails=aP;exports.Contributors=k0;exports.Conversation=HN;exports.ConversationContext=yh;exports.CookieBanner=hE;exports.Divider=tu;exports.DownloadSection=ZA;exports.Dynamic=rP;exports.EMAILS=Ni;exports.EmailHelperTextBox=pP;exports.EmptyStateBox=aa;exports.Filters=cP;exports.Footer=ch;exports.For=CR;exports.Form=mh;exports.FullWidthSection=Yf;exports.Header=ph;exports.HelperTextBox=A0;exports.HiddenFromScreenReaders=Of;exports.HideShowTextBox=l1;exports.HighlightedTextBoxWrapper=Br;exports.Index=RR;exports.IntlProvider=S1;exports.JoinButton=ah;exports.LanguageSwitcher=fP;exports.Likes=AE;exports.Link=ia;exports.LoadMore=lE;exports.LoadingPlaceholder=yr;exports.LoadingState=I0;exports.Logo=uh;exports.LogoSection=eC;exports.MarkdownText=sf;exports.MarketingBlock=iC;exports.Match=IR;exports.Member=Au;exports.MembersList=TN;exports.Modal=CE;exports.MoreMenu=fE;exports.NUMBER_OF_USERS=sC;exports.Overlay=RE;exports.PageLayout=bN;exports.Pill=R0;exports.Portal=tP;exports.Post=ku;exports.ProfilePicture=Ou;exports.ProgressBar=P0;exports.Rating=vP;exports.ReactQueryProvider=sP;exports.RepliesFeed=NE;exports.ResponsesHeading=zN;exports.ResponsiveImage=Cv;exports.SearchForm=gE;exports.Show=PR;exports.Span=C0;exports.StatusBanner=nu;exports.Switch=NR;exports.Tags=SN;exports.Thread=QN;exports.Tooltip=o0;exports.UserContext=$r;exports.UserProvider=T1;exports.VisuallyHidden=lt;exports.addAriaProps=PE;exports.addEventListener=aE;exports.bannerSection=nC;exports.batch=uR;exports.children=oh;exports.className=sE;exports.createComponent=tE;exports.createComputed=_f;exports.createContext=mR;exports.createEffect=ih;exports.createMemo=St;exports.createRenderEffect=dn;exports.createRoot=hn;exports.createSignal=bt;exports.createUniqueId=AR;exports.delegateEvents=oE;exports.getListener=fR;exports.getMember=eh;exports.headerData=Ms;exports.insert=hu;exports.loadingBlock=_1;exports.mapGetSteamData=sI;exports.mergeProps=rE;exports.on=cR;exports.onCleanup=Ls;exports.onMount=lR;exports.passwordRules=yP;exports.setAttribute=fu;exports.splitProps=nE;exports.spread=uE;exports.template=GR;exports.untrack=Xe;exports.use=QR;exports.useContext=gR;exports.useCurrentPath=hg;exports.useEffectAfterMount=ri;exports.useFeatureFlag=px;exports.useScreenWidth=ra;exports.useScrollListener=gv;exports.useScrollToHash=gx;exports.useTransition=pR;
101
+ `))},[n]),U.useEffect(()=>{l==="ready-to-close"&&u("closing")},[l]);const h=({propertyName:f})=>{f==="max-height"&&u(p=>p==="opening"?"open":p==="closing"?"closed":p)};if(!n)return null;const d=["opening","open"].includes(l);return T.jsxs(Br,{variant:"subtle",className:se("hide-show-text-box",e),children:[T.jsxs("div",{ref:a,className:se("content",l),children:[T.jsx(xu,{options:{forceBlock:!0},children:l==="closed"?s:n}),l!=="closed"&&i]}),T.jsx("p",{className:"cta",children:T.jsx(ze,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:se({"rotate-180":d}),onClick:()=>{u(d?"ready-to-close":"opening")},children:d?r||o.formatMessage({id:"hideShowTextBox_hide"}):t||o.formatMessage({id:"hideShowTextBox_show"})})})]})},f1=()=>U.Fragment,h1=({children:e})=>T.jsx(Br,{variant:"secondary",children:e}),d1=["span","strong","h1","h2","h3","h4","h5","h6","p"],p1=({children:e})=>{const t=Se();if(!e)return null;let r=t.formatMessage({id:"markdown_collapsibleSection_summary"});const n=[];for(const o of U.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number"))if(U.isValidElement(o)&&o.type==="summary"){if(o.props&&o.props.children){for(const a of U.Children.toArray(o.props.children))if(!(!a||typeof a=="string"||typeof a=="number")&&U.isValidElement(a)){const s=a.type;if(d1.includes(s)){for(r=a.props.children;typeof r!="string"&&(Array.isArray(r)&&r[0].props&&r[0].props.children&&r[0].props.children[0]);)r=r[0].props.children[0];break}}}}else n.push(o);const i=r?r.toString():"";return T.jsx(Xf,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:n.map(o=>o)})},m1=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return T.jsx(Br,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return T.jsx(Br,{variant:"primary",children:e});case"pink-textbox":return T.jsx(Br,{variant:"tertiary",children:e});default:return T.jsx("div",{...t,children:e})}return T.jsx("div",{...t,children:e})},g1=e=>{const t=Se(),r=Date.now().toString();let n="default";const i=e.src;return i.includes("youtube")||i.includes("vimeo")?n="video":i.includes("riddle")||i.includes("sli.do")?n="poll":i.includes("padlet")&&(n="padlet"),T.jsxs(T.Fragment,{children:[T.jsx(lt,{children:T.jsx("a",{href:`#content-after-iframe-${r}`,children:t.formatMessage({id:`markdown_skip${n==="default"?"":`_${n}`}`})})}),T.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${n==="default"?"":`_${n}`}`})}),T.jsx("span",{id:`content-after-iframe-${r}`,tabIndex:-1})]})},Om=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},y1=({children:e,...t})=>{let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let n=e,i=!1;for(const o of U.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&U.isValidElement(o)){const a=o.type;if(["button","center","span","strong"].includes(a)&&o.props&&o.props.children&&o.props.children[0])for((a==="button"||Om(o.props.children[0])==="button")&&(i=!0),n=o.props.children[0];n&&typeof n!="string"&&!(typeof n=="boolean"||typeof n=="number"||!U.isValidElement(n));)if(n.props&&n.props.children&&n.props.children[0])n=n.props.children[0],n&&Om(n)==="button"&&(i=!0);else break}return i?(r={...r,className:"button primary medium"},T.jsx("p",{className:"center",children:T.jsx(ze,{variant:"primary",size:"medium",...r,children:n})})):T.jsx("a",{...r,children:n})},C0=({children:e})=>T.jsx("span",{children:e});const sf=({className:e="",options:t={},children:r})=>{r=r.replace(/^<br\/?>/,"");const n={wrapper:U.Fragment,forceBlock:!0,overrides:{a:y1,CollapsibleSection:Xf,TextBox:Br,CaseStudy:h1,style:f1,details:p1,div:m1,iframe:g1}};return T.jsx("div",{className:se("markdown-text",e),children:T.jsx(xu,{options:{...n,...t},children:r})})};const R0=({size:e="medium",variant:t="default",className:r="",children:n})=>T.jsx("span",{className:se("pill",e,t,r),children:n});const nu=({element:e="p",children:t=null,className:r="",...n})=>U.createElement(e,{...n,className:se("status-banner text-small",r),"aria-live":"assertive"},t);const v1=({progress:e=0,text:t=!1,className:r=""})=>{const n=Se(),i=e>75?100:e>50?75:e>25?50:e>5?25:0,o={"--progress":`${e}%`};return T.jsx("span",{className:se(`progress-bar section-${i}`,r),style:o,children:T.jsx(lt,{children:t?`${e} ${t}`:n.formatMessage({id:"progressBar"},{number:e})})})},P0=U.memo(v1);const fl="loadingBlock_",E1=({progress:e=0,steps:t=!1,className:r=""})=>{const n=Se();t||(t={0:{text:n.formatMessage({id:`${fl}loading`})},75:{text:n.formatMessage({id:`${fl}almostDone`})},100:{text:n.formatMessage({id:`${fl}complete`})}});let i=null;const o=Object.keys(t);for(let s=0;s<o.length&&!(e<parseInt(o[s]));s++)i=o[s];const a=i&&t[i].icon?{"--icon":`url(${ru}icons/${t[i].icon}.svg)`}:{};return T.jsxs(Br,{className:se("loading-block",r,{"has-icon":i&&t[i].icon}),variant:"subtle",style:a,children:[i&&T.jsx("span",{className:"step",children:t[i].text}),T.jsx(P0,{progress:e})]})},_1=U.memo(E1);const yr=({element:e="div",className:t="",...r})=>T.jsx(Of,{element:e,className:se("loading-placeholder",t),...r});const af={header:["logo","link","link","search"],sidebar:["text","text","text","text","text"],"cards-section":["subtitle","cards"],cards:["card","card","card","card"],"overview-page":["header","sidebar","title","text","cards-section","cards-section","footer"]},N0=(e,t)=>e in af?T.jsx("div",{className:e,children:af[e].map((r,n)=>N0(r,n))},t):T.jsx(yr,{className:e},t),I0=({layout:e="overview-page"})=>T.jsx("div",{className:se("loading-state",e),children:af[e].map((t,r)=>N0(t,r))}),L0=e=>{const t=e&&e.toUpperCase().split(" ");return Array.isArray(t)&&t.length>1&&t[0]!==""?t[1]===""?t[0][0]:t[0][0]+t[t.length-1][0]:e?e.substr(0,1):""},ka=["#5AB6A3","#A2D7AF","#806056","#3962B3"],b1=e=>{const t=Math.ceil(26/ka.length),r=L0(e).toLowerCase();if(r==="")return ka[0];const n=r.charCodeAt(0)-96;for(let i=0;i<ka.length;i++)if(n<=t*(i+1))return ka[i]};const Am=256,Ou=({className:e="",src:t="",name:r,alt:n,width:i=Am,height:o=Am,...a})=>{const[s,c]=U.useState(!1),l=U.useRef(null);U.useEffect(()=>{const h=l.current;if(!h)return;const d=h.getContext("2d");if(!d)return;const f=i,p=o;typeof window<"u"&&window.devicePixelRatio&&(h.width=f*window.devicePixelRatio,h.height=p*window.devicePixelRatio,d.scale(window.devicePixelRatio,window.devicePixelRatio)),d.fillStyle=b1(r),d.fillRect(0,0,f,p),d.font=`${f/3}px Arial`,d.textAlign="center",d.fillStyle="white",d.fillText(L0(r),f/2,p/1.6)},[r]);let u=!1;return t&&t!==""&&!s&&(t.includes("http")||t.includes("//"))&&(u=!0),T.jsx("figure",{className:se("profile-picture",e,{error:s}),...a,children:u?T.jsx("img",{src:t,alt:n||r,onError:()=>{c(!0)},width:i,height:o}):T.jsx("canvas",{ref:l})})},eh=e=>e==="apolitical"?{image:`${ru}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${ru}logos/member_community.svg`}:{name:e.name,role:e.jobTitle||"",organisation:e.organization||"",country:e.location&&e.location.country||"",url:`/profiles/${e.id}`,image:e.image&&e.image.thumbnail},w1=({role:e="",organisation:t="",country:r="",maximumCharacters:n=80})=>{const i=e!=="",o=t!=="",a=r!=="";if(!i&&!o&&!a)return"";const s=`${e}${i&&o?` — ${t}`:t}`;let c=`${s}${(i||o)&&a?`, ${r}`:r}`;return c.length>n&&(c=s),c.length>n&&(c=Kf(c,n)),c};const Au=({element:e="div",member:t="community",additionalContent:r=!1,gtmContext:n="member",gtmType:i="member-click",className:o=""})=>{const a=Se(),s=eh(t);s.name||(s.name=a.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:c,url:l,image:u}=s,h=w1(s),d=r&&r.createdAt?wO(r.createdAt):!1,f=r&&r.createdAt?bO(r.createdAt):"";return U.createElement(e,{className:se("member text-medium",o),children:T.jsxs(ia,{href:l,gtmType:i,gtmContext:n,onClick:p=>{p==null||p.stopPropagation()},children:[T.jsx(Ou,{name:c,src:u}),T.jsxs("p",{className:"details",children:[T.jsx("strong",{children:c}),r&&T.jsxs("span",{className:"additional-content",children:[r.createdAt&&d&&T.jsx("span",{className:"date",title:f,"aria-label":f,children:a.formatMessage({id:`dates_${d.path}`},{number:d.number})}),r.didEdit&&T.jsx("em",{children:a.formatMessage({id:"discussion_edited"})})]}),h&&T.jsx("small",{children:h})]})]})})};const Cm={small:24,medium:48},k0=({element:e="div",contributors:{total:t,data:r}={total:void 0,data:[]},styling:{showText:n,size:i,showGap:o,showPlaceholders:a}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:s=2,className:c=""})=>{const l=Se();return!r||r.length===0?null:U.createElement(e,{className:se("contributors",c,i,{"has-gap":o}),children:T.jsxs(T.Fragment,{children:[T.jsx("ul",{children:r.map((u,h)=>{let d,f="";if(h<s){const{name:p="",image:m=""}=eh(u);if(a)return T.jsx(yr,{element:"li",className:"contributor"},h);d=T.jsx(Ou,{name:p,src:m,width:Cm[i||"medium"],height:Cm[i||"medium"]})}else if(h===s){const p=(t||r.length)-s;d=T.jsxs("small",{className:se({"large-number":p>99}),children:["+",CO(p,0)]}),f="number-left"}return d?T.jsx("li",{className:se("contributor",f),children:d},h):null})}),n&&T.jsx("span",{className:"label",children:typeof n=="string"?n:r.length===1?typeof r[0]=="string"?l.formatMessage({id:`member_${r[0]}`}):Kf(r[0].name||"",20):null})]})})},S1=({children:e,locale:t,messages:r})=>{const n=t||"en",i={...AO[n],...r||{}};return T.jsx(XA,{locale:n,messages:i,children:e})},$r=U.createContext(null),T1=({children:e,user:t})=>T.jsx($r.Provider,{value:t,children:e});var mo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ao=typeof window>"u"||"Deno"in window;function jt(){}function x1(e,t){return typeof e=="function"?e(t):e}function uf(e){return typeof e=="number"&&e>=0&&e!==1/0}function M0(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rm(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(n){if(t.queryHash!==th(a,t.options))return!1}else if(!Ps(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Pm(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Rs(t.options.mutationKey)!==Rs(o))return!1}else if(!Ps(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function th(e,t){return((t==null?void 0:t.queryKeyHashFn)||Rs)(e)}function Rs(e){return JSON.stringify(e,(t,r)=>cf(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Ps(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!Ps(e[r],t[r])):!1}function F0(e,t){if(e===t)return e;const r=Nm(e)&&Nm(t);if(r||cf(e)&&cf(t)){const n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),o=i.length,a=r?[]:{};let s=0;for(let c=0;c<o;c++){const l=r?c:i[c];a[l]=F0(e[l],t[l]),a[l]===e[l]&&s++}return n===o&&s===n?e:a}return t}function iu(e,t){if(e&&!t||t&&!e)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Nm(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cf(e){if(!Im(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!Im(r)||!r.hasOwnProperty("isPrototypeOf"))}function Im(e){return Object.prototype.toString.call(e)==="[object Object]"}function D0(e){return new Promise(t=>{setTimeout(t,e)})}function Lm(e){D0(0).then(e)}function lf(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?F0(e,t):t}function O1(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function A1(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Gn,en,ki,eg,C1=(eg=class extends mo{constructor(){super();ie(this,Gn,void 0);ie(this,en,void 0);ie(this,ki,void 0);ee(this,ki,t=>{if(!ao&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){P(this,en)||this.setEventListener(P(this,ki))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,en))==null||t.call(this),ee(this,en,void 0))}setEventListener(t){var r;ee(this,ki,t),(r=P(this,en))==null||r.call(this),ee(this,en,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){P(this,Gn)!==t&&(ee(this,Gn,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof P(this,Gn)=="boolean"?P(this,Gn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Gn=new WeakMap,en=new WeakMap,ki=new WeakMap,eg),ou=new C1,Mi,tn,Fi,tg,R1=(tg=class extends mo{constructor(){super();ie(this,Mi,!0);ie(this,tn,void 0);ie(this,Fi,void 0);ee(this,Fi,t=>{if(!ao&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){P(this,tn)||this.setEventListener(P(this,Fi))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,tn))==null||t.call(this),ee(this,tn,void 0))}setEventListener(t){var r;ee(this,Fi,t),(r=P(this,tn))==null||r.call(this),ee(this,tn,t(this.setOnline.bind(this)))}setOnline(t){P(this,Mi)!==t&&(ee(this,Mi,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return P(this,Mi)}},Mi=new WeakMap,tn=new WeakMap,Fi=new WeakMap,tg),Ns=new R1;function P1(e){return Math.min(1e3*2**e,3e4)}function Cu(e){return(e??"online")==="online"?Ns.isOnline():!0}var B0=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function hl(e){return e instanceof B0}function U0(e){let t=!1,r=0,n=!1,i,o,a;const s=new Promise((_,S)=>{o=_,a=S}),c=_=>{var S;n||(f(new B0(_)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},u=()=>{t=!1},h=()=>!ou.isFocused()||e.networkMode!=="always"&&!Ns.isOnline(),d=_=>{var S;n||(n=!0,(S=e.onSuccess)==null||S.call(e,_),i==null||i(),o(_))},f=_=>{var S;n||(n=!0,(S=e.onError)==null||S.call(e,_),i==null||i(),a(_))},p=()=>new Promise(_=>{var S;i=v=>{const w=n||!h();return w&&_(v),w},(S=e.onPause)==null||S.call(e)}).then(()=>{var _;i=void 0,n||(_=e.onContinue)==null||_.call(e)}),m=()=>{if(n)return;let _;try{_=e.fn()}catch(S){_=Promise.reject(S)}Promise.resolve(_).then(d).catch(S=>{var N;if(n)return;const v=e.retry??(ao?0:3),w=e.retryDelay??P1,A=typeof w=="function"?w(r,S):w,b=v===!0||typeof v=="number"&&r<v||typeof v=="function"&&v(r,S);if(t||!b){f(S);return}r++,(N=e.onFail)==null||N.call(e,r,S),D0(A).then(()=>{if(h())return p()}).then(()=>{t?f(S):m()})})};return Cu(e.networkMode)?m():p().then(m),{promise:s,cancel:c,continue:()=>(i==null?void 0:i())?s:Promise.resolve(),cancelRetry:l,continueRetry:u}}function N1(){let e=[],t=0,r=u=>{u()},n=u=>{u()};const i=u=>{let h;t++;try{h=u()}finally{t--,t||s()}return h},o=u=>{t?e.push(u):Lm(()=>{r(u)})},a=u=>(...h)=>{o(()=>{u(...h)})},s=()=>{const u=e;e=[],u.length&&Lm(()=>{n(()=>{u.forEach(h=>{r(h)})})})};return{batch:i,batchCalls:a,schedule:o,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}var Ke=N1(),Vn,rg,$0=(rg=class{constructor(){ie(this,Vn,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uf(this.gcTime)&&ee(this,Vn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ao?1/0:5*60*1e3))}clearGcTimeout(){P(this,Vn)&&(clearTimeout(P(this,Vn)),ee(this,Vn,void 0))}},Vn=new WeakMap,rg),Di,Bi,Dt,rn,Bt,it,Fs,Wn,Ui,Va,Zt,kr,ng,I1=(ng=class extends $0{constructor(t){super();ie(this,Ui);ie(this,Zt);ie(this,Di,void 0);ie(this,Bi,void 0);ie(this,Dt,void 0);ie(this,rn,void 0);ie(this,Bt,void 0);ie(this,it,void 0);ie(this,Fs,void 0);ie(this,Wn,void 0);ee(this,Wn,!1),ee(this,Fs,t.defaultOptions),ye(this,Ui,Va).call(this,t.options),ee(this,it,[]),ee(this,Dt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,Di,t.state||L1(this.options)),this.state=P(this,Di),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!P(this,it).length&&this.state.fetchStatus==="idle"&&P(this,Dt).remove(this)}setData(t,r){const n=lf(this.state.data,t,this.options);return ye(this,Zt,kr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ye(this,Zt,kr).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n;const r=P(this,rn);return(n=P(this,Bt))==null||n.cancel(t),r?r.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,Di))}isActive(){return P(this,it).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||P(this,it).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!M0(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=P(this,it).find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,Bt))==null||r.continue()}onOnline(){var r;const t=P(this,it).find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=P(this,Bt))==null||r.continue()}addObserver(t){P(this,it).includes(t)||(P(this,it).push(t),this.clearGcTimeout(),P(this,Dt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){P(this,it).includes(t)&&(ee(this,it,P(this,it).filter(r=>r!==t)),P(this,it).length||(P(this,Bt)&&(P(this,Wn)?P(this,Bt).cancel({revert:!0}):P(this,Bt).cancelRetry()),this.scheduleGc()),P(this,Dt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return P(this,it).length}invalidate(){this.state.isInvalidated||ye(this,Zt,kr).call(this,{type:"invalidate"})}fetch(t,r){var l,u,h,d;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(P(this,rn))return(l=P(this,Bt))==null||l.continueRetry(),P(this,rn)}if(t&&ye(this,Ui,Va).call(this,t),!this.options.queryFn){const f=P(this,it).find(p=>p.options.queryFn);f&&ye(this,Ui,Va).call(this,f.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(ee(this,Wn,!0),n.signal)})};o(i);const a=()=>this.options.queryFn?(ee(this,Wn,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),s={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};o(s),(u=this.options.behavior)==null||u.onFetch(s,this),ee(this,Bi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=s.fetchOptions)==null?void 0:h.meta))&&ye(this,Zt,kr).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta});const c=f=>{var p,m,_,S;hl(f)&&f.silent||ye(this,Zt,kr).call(this,{type:"error",error:f}),hl(f)||((m=(p=P(this,Dt).config).onError)==null||m.call(p,f,this),(S=(_=P(this,Dt).config).onSettled)==null||S.call(_,this.state.data,f,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return ee(this,Bt,U0({fn:s.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var p,m,_,S;if(typeof f>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),c(new Error(`${this.queryHash} data is undefined`));return}this.setData(f),(m=(p=P(this,Dt).config).onSuccess)==null||m.call(p,f,this),(S=(_=P(this,Dt).config).onSettled)==null||S.call(_,f,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(f,p)=>{ye(this,Zt,kr).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{ye(this,Zt,kr).call(this,{type:"pause"})},onContinue:()=>{ye(this,Zt,kr).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode})),ee(this,rn,P(this,Bt).promise),P(this,rn)}},Di=new WeakMap,Bi=new WeakMap,Dt=new WeakMap,rn=new WeakMap,Bt=new WeakMap,it=new WeakMap,Fs=new WeakMap,Wn=new WeakMap,Ui=new WeakSet,Va=function(t){this.options={...P(this,Fs),...t},this.updateGcTime(this.options.gcTime)},Zt=new WeakSet,kr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Cu(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return hl(i)&&i.revert&&P(this,Bi)?{...P(this,Bi),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ke.batch(()=>{P(this,it).forEach(n=>{n.onQueryUpdate()}),P(this,Dt).notify({query:this,type:"updated",action:t})})},ng);function L1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof t<"u",n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var lr,ig,k1=(ig=class extends mo{constructor(t={}){super();ie(this,lr,void 0);this.config=t,ee(this,lr,new Map)}build(t,r,n){const i=r.queryKey,o=r.queryHash??th(i,r);let a=this.get(o);return a||(a=new I1({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){P(this,lr).has(t.queryHash)||(P(this,lr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=P(this,lr).get(t.queryHash);r&&(t.destroy(),r===t&&P(this,lr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ke.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,lr).get(t)}getAll(){return[...P(this,lr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Rm(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Rm(t,n)):r}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},lr=new WeakMap,ig),fr,Ds,Lt,$i,hr,Jr,og,M1=(og=class extends $0{constructor(t){super();ie(this,hr);ie(this,fr,void 0);ie(this,Ds,void 0);ie(this,Lt,void 0);ie(this,$i,void 0);this.mutationId=t.mutationId,ee(this,Ds,t.defaultOptions),ee(this,Lt,t.mutationCache),ee(this,fr,[]),this.state=t.state||j0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...P(this,Ds),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,fr).includes(t)||(P(this,fr).push(t),this.clearGcTimeout(),P(this,Lt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,fr,P(this,fr).filter(r=>r!==t)),this.scheduleGc(),P(this,Lt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,fr).length||(this.state.status==="pending"?this.scheduleGc():P(this,Lt).remove(this))}continue(){var t;return((t=P(this,$i))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,a,s,c,l,u,h,d,f,p,m,_,S,v,w,A,b,N,k;const r=()=>(ee(this,$i,U0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(R,$)=>{ye(this,hr,Jr).call(this,{type:"failed",failureCount:R,error:$})},onPause:()=>{ye(this,hr,Jr).call(this,{type:"pause"})},onContinue:()=>{ye(this,hr,Jr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),P(this,$i).promise),n=this.state.status==="pending";try{if(!n){ye(this,hr,Jr).call(this,{type:"pending",variables:t}),await((o=(i=P(this,Lt).config).onMutate)==null?void 0:o.call(i,t,this));const $=await((s=(a=this.options).onMutate)==null?void 0:s.call(a,t));$!==this.state.context&&ye(this,hr,Jr).call(this,{type:"pending",context:$,variables:t})}const R=await r();return await((l=(c=P(this,Lt).config).onSuccess)==null?void 0:l.call(c,R,t,this.state.context,this)),await((h=(u=this.options).onSuccess)==null?void 0:h.call(u,R,t,this.state.context)),await((f=(d=P(this,Lt).config).onSettled)==null?void 0:f.call(d,R,null,this.state.variables,this.state.context,this)),await((m=(p=this.options).onSettled)==null?void 0:m.call(p,R,null,t,this.state.context)),ye(this,hr,Jr).call(this,{type:"success",data:R}),R}catch(R){try{throw await((S=(_=P(this,Lt).config).onError)==null?void 0:S.call(_,R,t,this.state.context,this)),await((w=(v=this.options).onError)==null?void 0:w.call(v,R,t,this.state.context)),await((b=(A=P(this,Lt).config).onSettled)==null?void 0:b.call(A,void 0,R,this.state.variables,this.state.context,this)),await((k=(N=this.options).onSettled)==null?void 0:k.call(N,void 0,R,t,this.state.context)),R}finally{ye(this,hr,Jr).call(this,{type:"error",error:R})}}}},fr=new WeakMap,Ds=new WeakMap,Lt=new WeakMap,$i=new WeakMap,hr=new WeakSet,Jr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Cu(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ke.batch(()=>{P(this,fr).forEach(n=>{n.onMutationUpdate(t)}),P(this,Lt).notify({mutation:this,type:"updated",action:t})})},og);function j0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ut,Bs,zn,sg,F1=(sg=class extends mo{constructor(t={}){super();ie(this,Ut,void 0);ie(this,Bs,void 0);ie(this,zn,void 0);this.config=t,ee(this,Ut,[]),ee(this,Bs,0)}build(t,r,n){const i=new M1({mutationCache:this,mutationId:++la(this,Bs)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){P(this,Ut).push(t),this.notify({type:"added",mutation:t})}remove(t){ee(this,Ut,P(this,Ut).filter(r=>r!==t)),this.notify({type:"removed",mutation:t})}clear(){Ke.batch(()=>{P(this,Ut).forEach(t=>{this.remove(t)})})}getAll(){return P(this,Ut)}find(t){const r={exact:!0,...t};return P(this,Ut).find(n=>Pm(r,n))}findAll(t={}){return P(this,Ut).filter(r=>Pm(t,r))}notify(t){Ke.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){return ee(this,zn,(P(this,zn)??Promise.resolve()).then(()=>{const t=P(this,Ut).filter(r=>r.state.isPaused);return Ke.batch(()=>t.reduce((r,n)=>r.then(()=>n.continue().catch(jt)),Promise.resolve()))}).then(()=>{ee(this,zn,void 0)})),P(this,zn)}},Ut=new WeakMap,Bs=new WeakMap,zn=new WeakMap,sg);function D1(e){return{onFetch:(t,r)=>{const n=async()=>{var p,m,_,S,v;const i=t.options,o=(_=(m=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:m.fetchMore)==null?void 0:_.direction,a=((S=t.state.data)==null?void 0:S.pages)||[],s=((v=t.state.data)==null?void 0:v.pageParams)||[],c={pages:[],pageParams:[]};let l=!1;const u=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?l=!0:t.signal.addEventListener("abort",()=>{l=!0}),t.signal)})},h=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),d=async(w,A,b)=>{if(l)return Promise.reject();if(A==null&&w.pages.length)return Promise.resolve(w);const N={queryKey:t.queryKey,pageParam:A,direction:b?"backward":"forward",meta:t.options.meta};u(N);const k=await h(N),{maxPages:R}=t.options,$=b?A1:O1;return{pages:$(w.pages,k,R),pageParams:$(w.pageParams,A,R)}};let f;if(o&&a.length){const w=o==="backward",A=w?B1:km,b={pages:a,pageParams:s},N=A(i,b);f=await d(b,N,w)}else{f=await d(c,s[0]??i.initialPageParam);const w=e??a.length;for(let A=1;A<w;A++){const b=km(i,f);f=await d(f,b)}}return f};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,n,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=n}}}function km(e,{pages:t,pageParams:r}){const n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function B1(e,{pages:t,pageParams:r}){var n;return(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r)}var Ye,nn,on,ji,Hi,sn,qi,Gi,ag,U1=(ag=class{constructor(e={}){ie(this,Ye,void 0);ie(this,nn,void 0);ie(this,on,void 0);ie(this,ji,void 0);ie(this,Hi,void 0);ie(this,sn,void 0);ie(this,qi,void 0);ie(this,Gi,void 0);ee(this,Ye,e.queryCache||new k1),ee(this,nn,e.mutationCache||new F1),ee(this,on,e.defaultOptions||{}),ee(this,ji,new Map),ee(this,Hi,new Map),ee(this,sn,0)}mount(){la(this,sn)._++,P(this,sn)===1&&(ee(this,qi,ou.subscribe(()=>{ou.isFocused()&&(this.resumePausedMutations(),P(this,Ye).onFocus())})),ee(this,Gi,Ns.subscribe(()=>{Ns.isOnline()&&(this.resumePausedMutations(),P(this,Ye).onOnline())})))}unmount(){var e,t;la(this,sn)._--,P(this,sn)===0&&((e=P(this,qi))==null||e.call(this),ee(this,qi,void 0),(t=P(this,Gi))==null||t.call(this),ee(this,Gi,void 0))}isFetching(e){return P(this,Ye).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,nn).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=P(this,Ye).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=P(this,Ye).find({queryKey:e}),i=n==null?void 0:n.state.data,o=x1(t,i);if(typeof o>"u")return;const a=this.defaultQueryOptions({queryKey:e});return P(this,Ye).build(this,a).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Ke.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var t;return(t=P(this,Ye).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=P(this,Ye);Ke.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=P(this,Ye),n={type:"active",...e};return Ke.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=Ke.batch(()=>P(this,Ye).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(jt).catch(jt)}invalidateQueries(e={},t={}){return Ke.batch(()=>{if(P(this,Ye).findAll(e).forEach(n=>{n.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){const r={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},n=Ke.batch(()=>P(this,Ye).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(jt)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const r=P(this,Ye).build(this,t);return r.isStaleByTime(t.staleTime)?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jt).catch(jt)}fetchInfiniteQuery(e){return e.behavior=D1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jt).catch(jt)}resumePausedMutations(){return P(this,nn).resumePausedMutations()}getQueryCache(){return P(this,Ye)}getMutationCache(){return P(this,nn)}getDefaultOptions(){return P(this,on)}setDefaultOptions(e){ee(this,on,e)}setQueryDefaults(e,t){P(this,ji).set(Rs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,ji).values()];let r={};return t.forEach(n=>{Ps(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){P(this,Hi).set(Rs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Hi).values()];let r={};return t.forEach(n=>{Ps(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...P(this,on).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=th(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,on).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,Ye).clear(),P(this,nn).clear()}},Ye=new WeakMap,nn=new WeakMap,on=new WeakMap,ji=new WeakMap,Hi=new WeakMap,sn=new WeakMap,qi=new WeakMap,Gi=new WeakMap,ag),At,Be,Vi,pt,Qn,Wi,dr,Us,zi,Qi,Yn,Kn,an,Xn,Jn,_s,$s,ff,js,hf,Hs,df,qs,pf,Gs,mf,Vs,gf,Ws,yf,gu,H0,ug,$1=(ug=class extends mo{constructor(t,r){super();ie(this,Jn);ie(this,$s);ie(this,js);ie(this,Hs);ie(this,qs);ie(this,Gs);ie(this,Vs);ie(this,Ws);ie(this,gu);ie(this,At,void 0);ie(this,Be,void 0);ie(this,Vi,void 0);ie(this,pt,void 0);ie(this,Qn,void 0);ie(this,Wi,void 0);ie(this,dr,void 0);ie(this,Us,void 0);ie(this,zi,void 0);ie(this,Qi,void 0);ie(this,Yn,void 0);ie(this,Kn,void 0);ie(this,an,void 0);ie(this,Xn,void 0);ee(this,Be,void 0),ee(this,Vi,void 0),ee(this,pt,void 0),ee(this,Xn,new Set),ee(this,At,t),this.options=r,ee(this,dr,null),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,Be).addObserver(this),Mm(P(this,Be),this.options)&&ye(this,Jn,_s).call(this),ye(this,qs,pf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vf(P(this,Be),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vf(P(this,Be),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ye(this,Gs,mf).call(this),ye(this,Vs,gf).call(this),P(this,Be).removeObserver(this)}setOptions(t,r){const n=this.options,i=P(this,Be);if(this.options=P(this,At).defaultQueryOptions(t),iu(n,this.options)||P(this,At).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,Be),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),ye(this,Ws,yf).call(this);const o=this.hasListeners();o&&Fm(P(this,Be),i,this.options,n)&&ye(this,Jn,_s).call(this),this.updateResult(r),o&&(P(this,Be)!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&ye(this,$s,ff).call(this);const a=ye(this,js,hf).call(this);o&&(P(this,Be)!==i||this.options.enabled!==n.enabled||a!==P(this,an))&&ye(this,Hs,df).call(this,a)}getOptimisticResult(t){const r=P(this,At).getQueryCache().build(P(this,At),t),n=this.createResult(r,t);return H1(this,n)&&(ee(this,pt,n),ee(this,Wi,this.options),ee(this,Qn,P(this,Be).state)),n}getCurrentResult(){return P(this,pt)}trackResult(t){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(P(this,Xn).add(n),t[n])})}),r}getCurrentQuery(){return P(this,Be)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=P(this,At).defaultQueryOptions(t),n=P(this,At).getQueryCache().build(P(this,At),r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ye(this,Jn,_s).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,pt)))}createResult(t,r){var N;const n=P(this,Be),i=this.options,o=P(this,pt),a=P(this,Qn),s=P(this,Wi),l=t!==n?t.state:P(this,Vi),{state:u}=t;let{error:h,errorUpdatedAt:d,fetchStatus:f,status:p}=u,m=!1,_;if(r._optimisticResults){const k=this.hasListeners(),R=!k&&Mm(t,r),$=k&&Fm(t,n,r,i);(R||$)&&(f=Cu(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(p="pending")),r._optimisticResults==="isRestoring"&&(f="idle")}if(r.select&&typeof u.data<"u")if(o&&u.data===(a==null?void 0:a.data)&&r.select===P(this,Us))_=P(this,zi);else try{ee(this,Us,r.select),_=r.select(u.data),_=lf(o==null?void 0:o.data,_,r),ee(this,zi,_),ee(this,dr,null)}catch(k){ee(this,dr,k)}else _=u.data;if(typeof r.placeholderData<"u"&&typeof _>"u"&&p==="pending"){let k;if(o!=null&&o.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData))k=o.data;else if(k=typeof r.placeholderData=="function"?r.placeholderData((N=P(this,Qi))==null?void 0:N.state.data,P(this,Qi)):r.placeholderData,r.select&&typeof k<"u")try{k=r.select(k),ee(this,dr,null)}catch(R){ee(this,dr,R)}typeof k<"u"&&(p="success",_=lf(o==null?void 0:o.data,k,r),m=!0)}P(this,dr)&&(h=P(this,dr),_=P(this,zi),d=Date.now(),p="error");const S=f==="fetching",v=p==="pending",w=p==="error",A=v&&S;return{status:p,fetchStatus:f,isPending:v,isSuccess:p==="success",isError:w,isInitialLoading:A,isLoading:A,data:_,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:d,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>l.dataUpdateCount||u.errorUpdateCount>l.errorUpdateCount,isFetching:S,isRefetching:S&&!v,isLoadingError:w&&u.dataUpdatedAt===0,isPaused:f==="paused",isPlaceholderData:m,isRefetchError:w&&u.dataUpdatedAt!==0,isStale:rh(t,r),refetch:this.refetch}}updateResult(t){const r=P(this,pt),n=this.createResult(P(this,Be),this.options);if(ee(this,Qn,P(this,Be).state),ee(this,Wi,this.options),iu(n,r))return;P(this,Qn).data!==void 0&&ee(this,Qi,P(this,Be)),ee(this,pt,n);const i={},o=()=>{if(!r)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!P(this,Xn).size)return!0;const c=new Set(s??P(this,Xn));return this.options.throwOnError&&c.add("error"),Object.keys(P(this,pt)).some(l=>{const u=l;return P(this,pt)[u]!==r[u]&&c.has(u)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),ye(this,gu,H0).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ye(this,qs,pf).call(this)}},At=new WeakMap,Be=new WeakMap,Vi=new WeakMap,pt=new WeakMap,Qn=new WeakMap,Wi=new WeakMap,dr=new WeakMap,Us=new WeakMap,zi=new WeakMap,Qi=new WeakMap,Yn=new WeakMap,Kn=new WeakMap,an=new WeakMap,Xn=new WeakMap,Jn=new WeakSet,_s=function(t){ye(this,Ws,yf).call(this);let r=P(this,Be).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(jt)),r},$s=new WeakSet,ff=function(){if(ye(this,Gs,mf).call(this),ao||P(this,pt).isStale||!uf(this.options.staleTime))return;const r=M0(P(this,pt).dataUpdatedAt,this.options.staleTime)+1;ee(this,Yn,setTimeout(()=>{P(this,pt).isStale||this.updateResult()},r))},js=new WeakSet,hf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,Be)):this.options.refetchInterval)??!1},Hs=new WeakSet,df=function(t){ye(this,Vs,gf).call(this),ee(this,an,t),!(ao||this.options.enabled===!1||!uf(P(this,an))||P(this,an)===0)&&ee(this,Kn,setInterval(()=>{(this.options.refetchIntervalInBackground||ou.isFocused())&&ye(this,Jn,_s).call(this)},P(this,an)))},qs=new WeakSet,pf=function(){ye(this,$s,ff).call(this),ye(this,Hs,df).call(this,ye(this,js,hf).call(this))},Gs=new WeakSet,mf=function(){P(this,Yn)&&(clearTimeout(P(this,Yn)),ee(this,Yn,void 0))},Vs=new WeakSet,gf=function(){P(this,Kn)&&(clearInterval(P(this,Kn)),ee(this,Kn,void 0))},Ws=new WeakSet,yf=function(){const t=P(this,At).getQueryCache().build(P(this,At),this.options);if(t===P(this,Be))return;const r=P(this,Be);ee(this,Be,t),ee(this,Vi,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},gu=new WeakSet,H0=function(t){Ke.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(P(this,pt))}),P(this,At).getQueryCache().notify({query:P(this,Be),type:"observerResultsUpdated"})})},ug);function j1(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Mm(e,t){return j1(e,t)||e.state.dataUpdatedAt>0&&vf(e,t,t.refetchOnMount)}function vf(e,t,r){if(t.enabled!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&rh(e,t)}return!1}function Fm(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&rh(e,r)}function rh(e,t){return e.isStaleByTime(t.staleTime)}function H1(e,t){return!iu(e.getCurrentResult(),t)}var un,Et,$t,Fr,Yi,Wa,zs,Ef,cg,q1=(cg=class extends mo{constructor(t,r){super();ie(this,Yi);ie(this,zs);ie(this,un,void 0);ie(this,Et,void 0);ie(this,$t,void 0);ie(this,Fr,void 0);ee(this,Et,void 0),ee(this,un,t),this.setOptions(r),this.bindMethods(),ye(this,Yi,Wa).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=P(this,un).defaultMutationOptions(t),iu(r,this.options)||P(this,un).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,$t),observer:this}),(n=P(this,$t))==null||n.setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=P(this,$t))==null||t.removeObserver(this)}onMutationUpdate(t){ye(this,Yi,Wa).call(this),ye(this,zs,Ef).call(this,t)}getCurrentResult(){return P(this,Et)}reset(){ee(this,$t,void 0),ye(this,Yi,Wa).call(this),ye(this,zs,Ef).call(this)}mutate(t,r){var n;return ee(this,Fr,r),(n=P(this,$t))==null||n.removeObserver(this),ee(this,$t,P(this,un).getMutationCache().build(P(this,un),this.options)),P(this,$t).addObserver(this),P(this,$t).execute(t)}},un=new WeakMap,Et=new WeakMap,$t=new WeakMap,Fr=new WeakMap,Yi=new WeakSet,Wa=function(){var r;const t=((r=P(this,$t))==null?void 0:r.state)??j0();ee(this,Et,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},zs=new WeakSet,Ef=function(t){Ke.batch(()=>{var r,n,i,o,a,s,c,l;P(this,Fr)&&this.hasListeners()&&((t==null?void 0:t.type)==="success"?((n=(r=P(this,Fr)).onSuccess)==null||n.call(r,t.data,P(this,Et).variables,P(this,Et).context),(o=(i=P(this,Fr)).onSettled)==null||o.call(i,t.data,null,P(this,Et).variables,P(this,Et).context)):(t==null?void 0:t.type)==="error"&&((s=(a=P(this,Fr)).onError)==null||s.call(a,t.error,P(this,Et).variables,P(this,Et).context),(l=(c=P(this,Fr)).onSettled)==null||l.call(c,void 0,t.error,P(this,Et).variables,P(this,Et).context))),this.listeners.forEach(u=>{u(P(this,Et))})})},cg),q0=pe.createContext(void 0),go=e=>{const t=pe.useContext(q0);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},G1=({client:e,children:t})=>(pe.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),pe.createElement(q0.Provider,{value:e},t)),G0=pe.createContext(!1),V1=()=>pe.useContext(G0);G0.Provider;function W1(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var z1=pe.createContext(W1()),Q1=()=>pe.useContext(z1);function V0(e,t){return typeof e=="function"?e(...t):!!e}var Y1=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},K1=e=>{pe.useEffect(()=>{e.clearReset()},[e])},X1=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&V0(r,[e.error,n]),J1=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},Z1=(e,t)=>e.isLoading&&e.isFetching&&!t,eR=(e,t,r)=>(e==null?void 0:e.suspense)&&Z1(t,r),tR=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function rR(e,t,r){const n=go(r),i=V1(),o=Q1(),a=n.defaultQueryOptions(e);a._optimisticResults=i?"isRestoring":"optimistic",J1(a),Y1(a,o),K1(o);const[s]=pe.useState(()=>new t(n,a)),c=s.getOptimisticResult(a);if(pe.useSyncExternalStore(pe.useCallback(l=>{const u=i?()=>{}:s.subscribe(Ke.batchCalls(l));return s.updateResult(),u},[s,i]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),pe.useEffect(()=>{s.setOptions(a,{listeners:!1})},[a,s]),eR(a,c,i))throw tR(a,s,o);if(X1({result:c,errorResetBoundary:o,throwOnError:a.throwOnError,query:s.getCurrentQuery()}))throw c.error;return a.notifyOnChangeProps?c:s.trackResult(c)}function W0(e,t){return rR(e,$1,t)}function fn(e,t){const r=go(t),[n]=pe.useState(()=>new q1(r,e));pe.useEffect(()=>{n.setOptions(e)},[n,e]);const i=pe.useSyncExternalStore(pe.useCallback(a=>n.subscribe(Ke.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=pe.useCallback((a,s)=>{n.mutate(a,s).catch(nR)},[n]);if(i.error&&V0(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function nR(){}var ve={context:void 0,registry:void 0};function bs(e){ve.context=e}var iR=(e,t)=>e===t,Is=Symbol("solid-proxy"),nh=Symbol("solid-track"),oR=Symbol("solid-dev-component"),su={equals:iR},z0=X0,jr=1,au=2,Q0={owned:null,cleanups:null,context:null,owner:null},dl={},Ue=null,pl=null,Me=null,mt=null,Ur=null,Ru=0,[sR,lI]=bt(!1);function hn(e,t){const r=Me,n=Ue,i=e.length===0,o=i?Q0:{owned:null,cleanups:null,context:null,owner:t===void 0?n:t},a=i?e:()=>e(()=>Xe(()=>Nu(o)));Ue=o,Me=null;try{return vr(a,!0)}finally{Me=r,Ue=n}}function bt(e,t){t=t?Object.assign({},su,t):su;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=i=>(typeof i=="function"&&(i=i(r.value)),K0(r,i));return[Y0.bind(r),n]}function _f(e,t,r){const n=Pu(e,t,!0,jr);yo(n)}function dn(e,t,r){const n=Pu(e,t,!1,jr);yo(n)}function ih(e,t,r){z0=_R;const n=Pu(e,t,!1,jr);(!r||!r.render)&&(n.user=!0),Ur?Ur.push(n):yo(n)}function St(e,t,r){r=r?Object.assign({},su,r):su;const n=Pu(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,yo(n),Y0.bind(n)}function aR(e,t,r){let n,i,o;arguments.length===2&&typeof t=="object"||arguments.length===1?(n=!0,i=e,o=t||{}):(n=e,i=t,o=r||{});let a=null,s=dl,c=null,l=!1,u="initialValue"in o,h=typeof n=="function"&&St(n);const d=new Set,[f,p]=(o.storage||bt)(o.initialValue),[m,_]=bt(void 0),[S,v]=bt(void 0,{equals:!1}),[w,A]=bt(u?"ready":"unresolved");if(ve.context){c=`${ve.context.id}${ve.context.count++}`;let $;o.ssrLoadFrom==="initial"?s=o.initialValue:ve.load&&($=ve.load(c))&&(s=$[0])}function b($,G,q,H){return a===$&&(a=null,H!==void 0&&(u=!0),($===s||G===s)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(H,{value:G})),s=dl,N(G,q)),G}function N($,G){vr(()=>{G===void 0&&p(()=>$),A(G!==void 0?"errored":u?"ready":"unresolved"),_(G);for(const q of d.keys())q.decrement();d.clear()},!1)}function k(){const $=yR,G=f(),q=m();if(q!==void 0&&!a)throw q;return Me&&!Me.user&&$&&_f(()=>{S(),a&&($.resolved||d.has($)||($.increment(),d.add($)))}),G}function R($=!0){if($!==!1&&l)return;l=!1;const G=h?h():n;if(G==null||G===!1){b(a,Xe(f));return}const q=s!==dl?s:Xe(()=>i(G,{value:f(),refetching:$}));return typeof q!="object"||!(q&&"then"in q)?(b(a,q,void 0,G),q):(a=q,l=!0,queueMicrotask(()=>l=!1),vr(()=>{A(u?"refreshing":"pending"),v()},!1),q.then(H=>b(q,H,void 0,G),H=>b(q,void 0,Z0(H),G)))}return Object.defineProperties(k,{state:{get:()=>w()},error:{get:()=>m()},loading:{get(){const $=w();return $==="pending"||$==="refreshing"}},latest:{get(){if(!u)return k();const $=m();if($&&!a)throw $;return f()}}}),h?_f(()=>R(!1)):R(!1),[k,{refetch:R,mutate:p}]}function uR(e){return vr(e,!1)}function Xe(e){if(Me===null)return e();const t=Me;Me=null;try{return e()}finally{Me=t}}function cR(e,t,r){const n=Array.isArray(e);let i,o=r&&r.defer;return a=>{let s;if(n){s=Array(e.length);for(let l=0;l<e.length;l++)s[l]=e[l]()}else s=e();if(o){o=!1;return}const c=Xe(()=>t(s,i,a));return i=s,c}}function lR(e){ih(()=>Xe(e))}function Ls(e){return Ue===null||(Ue.cleanups===null?Ue.cleanups=[e]:Ue.cleanups.push(e)),e}function fR(){return Me}function Dm(){return Ue}function hR(e,t){const r=Ue,n=Me;Ue=e,Me=null;try{return vr(t,!0)}catch(i){sh(i)}finally{Ue=r,Me=n}}function dR(e){const t=Me,r=Ue;return Promise.resolve().then(()=>{Me=t,Ue=r;let n;return vr(e,!1),Me=Ue=null,n?n.done:void 0})}function pR(){return[sR,dR]}function mR(e,t){const r=Symbol("context");return{id:r,Provider:bR(r),defaultValue:e}}function gR(e){let t;return(t=eE(Ue,e.id))!==void 0?t:e.defaultValue}function oh(e){const t=St(e),r=St(()=>bf(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}var yR;function Y0(){if(this.sources&&this.state)if(this.state===jr)yo(this);else{const e=mt;mt=null,vr(()=>cu(this),!1),mt=e}if(Me){const e=this.observers?this.observers.length:0;Me.sources?(Me.sources.push(this),Me.sourceSlots.push(e)):(Me.sources=[this],Me.sourceSlots=[e]),this.observers?(this.observers.push(Me),this.observerSlots.push(Me.sources.length-1)):(this.observers=[Me],this.observerSlots=[Me.sources.length-1])}return this.value}function K0(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&vr(()=>{for(let i=0;i<e.observers.length;i+=1){const o=e.observers[i],a=pl&&pl.running;a&&pl.disposed.has(o),(a?!o.tState:!o.state)&&(o.pure?mt.push(o):Ur.push(o),o.observers&&J0(o)),a||(o.state=jr)}if(mt.length>1e6)throw mt=[],new Error},!1)),t}function yo(e){if(!e.fn)return;Nu(e);const t=Ue,r=Me,n=Ru;Me=Ue=e,vR(e,e.value,n),Me=r,Ue=t}function vR(e,t,r){let n;try{n=e.fn(t)}catch(i){return e.pure&&(e.state=jr,e.owned&&e.owned.forEach(Nu),e.owned=null),e.updatedAt=r+1,sh(i)}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?K0(e,n):e.value=n,e.updatedAt=r)}function Pu(e,t,r,n=jr,i){const o={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Ue,context:null,pure:r};return Ue===null||Ue!==Q0&&(Ue.owned?Ue.owned.push(o):Ue.owned=[o]),o}function uu(e){if(e.state===0)return;if(e.state===au)return cu(e);if(e.suspense&&Xe(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ru);)e.state&&t.push(e);for(let r=t.length-1;r>=0;r--)if(e=t[r],e.state===jr)yo(e);else if(e.state===au){const n=mt;mt=null,vr(()=>cu(e,t[0]),!1),mt=n}}function vr(e,t){if(mt)return e();let r=!1;t||(mt=[]),Ur?r=!0:Ur=[],Ru++;try{const n=e();return ER(r),n}catch(n){r||(Ur=null),mt=null,sh(n)}}function ER(e){if(mt&&(X0(mt),mt=null),e)return;const t=Ur;Ur=null,t.length&&vr(()=>z0(t),!1)}function X0(e){for(let t=0;t<e.length;t++)uu(e[t])}function _R(e){let t,r=0;for(t=0;t<e.length;t++){const n=e[t];n.user?e[r++]=n:uu(n)}if(ve.context){if(ve.count){ve.effects||(ve.effects=[]),ve.effects.push(...e.slice(0,r));return}else ve.effects&&(e=[...ve.effects,...e],r+=ve.effects.length,delete ve.effects);bs()}for(t=0;t<r;t++)uu(e[t])}function cu(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){const n=e.sources[r];if(n.sources){const i=n.state;i===jr?n!==t&&(!n.updatedAt||n.updatedAt<Ru)&&uu(n):i===au&&cu(n,t)}}}function J0(e){for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t];r.state||(r.state=au,r.pure?mt.push(r):Ur.push(r),r.observers&&J0(r))}}function Nu(e){let t;if(e.sources)for(;e.sources.length;){const r=e.sources.pop(),n=e.sourceSlots.pop(),i=r.observers;if(i&&i.length){const o=i.pop(),a=r.observerSlots.pop();n<i.length&&(o.sourceSlots[a]=n,i[n]=o,r.observerSlots[n]=a)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Nu(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function Z0(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function sh(e,t=Ue){throw Z0(e)}function eE(e,t){return e?e.context&&e.context[t]!==void 0?e.context[t]:eE(e.owner,t):void 0}function bf(e){if(typeof e=="function"&&!e.length)return bf(e());if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++){const n=bf(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function bR(e,t){return function(n){let i;return dn(()=>i=Xe(()=>(Ue.context={[e]:n.value},oh(()=>n.children))),void 0),i}}var wf=Symbol("fallback");function lu(e){for(let t=0;t<e.length;t++)e[t]()}function wR(e,t,r={}){let n=[],i=[],o=[],a=0,s=t.length>1?[]:null;return Ls(()=>lu(o)),()=>{let c=e()||[],l,u;return c[nh],Xe(()=>{let d=c.length,f,p,m,_,S,v,w,A,b;if(d===0)a!==0&&(lu(o),o=[],n=[],i=[],a=0,s&&(s=[])),r.fallback&&(n=[wf],i[0]=hn(N=>(o[0]=N,r.fallback())),a=1);else if(a===0){for(i=new Array(d),u=0;u<d;u++)n[u]=c[u],i[u]=hn(h);a=d}else{for(m=new Array(d),_=new Array(d),s&&(S=new Array(d)),v=0,w=Math.min(a,d);v<w&&n[v]===c[v];v++);for(w=a-1,A=d-1;w>=v&&A>=v&&n[w]===c[A];w--,A--)m[A]=i[w],_[A]=o[w],s&&(S[A]=s[w]);for(f=new Map,p=new Array(A+1),u=A;u>=v;u--)b=c[u],l=f.get(b),p[u]=l===void 0?-1:l,f.set(b,u);for(l=v;l<=w;l++)b=n[l],u=f.get(b),u!==void 0&&u!==-1?(m[u]=i[l],_[u]=o[l],s&&(S[u]=s[l]),u=p[u],f.set(b,u)):o[l]();for(u=v;u<d;u++)u in m?(i[u]=m[u],o[u]=_[u],s&&(s[u]=S[u],s[u](u))):i[u]=hn(h);i=i.slice(0,a=d),n=c.slice(0)}return i});function h(d){if(o[u]=d,s){const[f,p]=bt(u);return s[u]=p,t(c[u],f)}return t(c[u])}}}function SR(e,t,r={}){let n=[],i=[],o=[],a=[],s=0,c;return Ls(()=>lu(o)),()=>{const l=e()||[];return l[nh],Xe(()=>{if(l.length===0)return s!==0&&(lu(o),o=[],n=[],i=[],s=0,a=[]),r.fallback&&(n=[wf],i[0]=hn(h=>(o[0]=h,r.fallback())),s=1),i;for(n[0]===wf&&(o[0](),o=[],n=[],i=[],s=0),c=0;c<l.length;c++)c<n.length&&n[c]!==l[c]?a[c](()=>l[c]):c>=n.length&&(i[c]=hn(u));for(;c<n.length;c++)o[c]();return s=a.length=o.length=l.length,n=l.slice(0),i=i.slice(0,s)});function u(h){o[c]=h;const[d,f]=bt(l[c]);return a[c]=f,t(d,c)}}}function tE(e,t){return Xe(()=>e(t||{}))}function Ma(){return!0}var Sf={get(e,t,r){return t===Is?r:e.get(t)},has(e,t){return t===Is?!0:e.has(t)},set:Ma,deleteProperty:Ma,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Ma,deleteProperty:Ma}},ownKeys(e){return e.keys()}};function ml(e){return(e=typeof e=="function"?e():e)?e:{}}function TR(){for(let e=0,t=this.length;e<t;++e){const r=this[e]();if(r!==void 0)return r}}function rE(...e){let t=!1;for(let o=0;o<e.length;o++){const a=e[o];t=t||!!a&&Is in a,e[o]=typeof a=="function"?(t=!0,St(a)):a}if(t)return new Proxy({get(o){for(let a=e.length-1;a>=0;a--){const s=ml(e[a])[o];if(s!==void 0)return s}},has(o){for(let a=e.length-1;a>=0;a--)if(o in ml(e[a]))return!0;return!1},keys(){const o=[];for(let a=0;a<e.length;a++)o.push(...Object.keys(ml(e[a])));return[...new Set(o)]}},Sf);const r={},n={},i=new Set;for(let o=e.length-1;o>=0;o--){const a=e[o];if(!a)continue;const s=Object.getOwnPropertyNames(a);for(let c=0,l=s.length;c<l;c++){const u=s[c];if(u==="__proto__"||u==="constructor")continue;const h=Object.getOwnPropertyDescriptor(a,u);if(!i.has(u))h.get?(i.add(u),Object.defineProperty(r,u,{enumerable:!0,configurable:!0,get:TR.bind(n[u]=[h.get.bind(a)])})):(h.value!==void 0&&i.add(u),r[u]=h.value);else{const d=n[u];d?h.get?d.push(h.get.bind(a)):h.value!==void 0&&d.push(()=>h.value):r[u]===void 0&&(r[u]=h.value)}}}return r}function nE(e,...t){if(Is in e){const i=new Set(t.length>1?t.flat():t[0]),o=t.map(a=>new Proxy({get(s){return a.includes(s)?e[s]:void 0},has(s){return a.includes(s)&&s in e},keys(){return a.filter(s=>s in e)}},Sf));return o.push(new Proxy({get(a){return i.has(a)?void 0:e[a]},has(a){return i.has(a)?!1:a in e},keys(){return Object.keys(e).filter(a=>!i.has(a))}},Sf)),o}const r={},n=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const o=Object.getOwnPropertyDescriptor(e,i),a=!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable;let s=!1,c=0;for(const l of t)l.includes(i)&&(s=!0,a?n[c][i]=o.value:Object.defineProperty(n[c],i,o)),++c;s||(a?r[i]=o.value:Object.defineProperty(r,i,o))}return[...n,r]}function xR(e){let t,r;const n=i=>{const o=ve.context;if(o){const[s,c]=bt();ve.count||(ve.count=0),ve.count++,(r||(r=e())).then(l=>{bs(o),ve.count--,c(()=>l.default),bs()}),t=s}else if(!t){const[s]=aR(()=>(r||(r=e())).then(c=>c.default));t=s}let a;return St(()=>(a=t())&&Xe(()=>{if(!o)return a(i);const s=ve.context;bs(o);const c=a(i);return bs(s),c}))};return n.preload=()=>r||((r=e()).then(i=>t=()=>i.default),r),n}var OR=0;function AR(){const e=ve.context;return e?`${e.id}${e.count++}`:`cl-${OR++}`}var iE=e=>`Stale read from <${e}>.`;function CR(e){const t="fallback"in e&&{fallback:()=>e.fallback};return St(wR(()=>e.each,e.children,t||void 0))}function RR(e){const t="fallback"in e&&{fallback:()=>e.fallback};return St(SR(()=>e.each,e.children,t||void 0))}function PR(e){const t=e.keyed,r=St(()=>e.when,void 0,{equals:(n,i)=>t?n===i:!n==!i});return St(()=>{const n=r();if(n){const i=e.children;return typeof i=="function"&&i.length>0?Xe(()=>i(t?n:()=>{if(!Xe(r))throw iE("Show");return e.when})):i}return e.fallback},void 0,void 0)}function NR(e){let t=!1;const r=(o,a)=>o[0]===a[0]&&(t?o[1]===a[1]:!o[1]==!a[1])&&o[2]===a[2],n=oh(()=>e.children),i=St(()=>{let o=n();Array.isArray(o)||(o=[o]);for(let a=0;a<o.length;a++){const s=o[a].when;if(s)return t=!!o[a].keyed,[a,s,o[a]]}return[-1]},void 0,{equals:r});return St(()=>{const[o,a,s]=i();if(o<0)return e.fallback;const c=s.children;return typeof c=="function"&&c.length>0?Xe(()=>c(t?a:()=>{if(Xe(i)[0]!==o)throw iE("Match");return s.when})):c},void 0,void 0)}function IR(e){return e}var LR=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],kR=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...LR]),MR=new Set(["innerHTML","textContent","innerText","children"]),FR=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),DR=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function BR(e,t){const r=DR[e];return typeof r=="object"?r[t]?r.$:void 0:r}var UR=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),$R=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),jR={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function HR(e,t,r){let n=r.length,i=t.length,o=n,a=0,s=0,c=t[i-1].nextSibling,l=null;for(;a<i||s<o;){if(t[a]===r[s]){a++,s++;continue}for(;t[i-1]===r[o-1];)i--,o--;if(i===a){const u=o<n?s?r[s-1].nextSibling:r[o-s]:c;for(;s<o;)e.insertBefore(r[s++],u)}else if(o===s)for(;a<i;)(!l||!l.has(t[a]))&&t[a].remove(),a++;else if(t[a]===r[o-1]&&r[s]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(r[s++],t[a++].nextSibling),e.insertBefore(r[--o],u),t[i]=r[o]}else{if(!l){l=new Map;let h=s;for(;h<o;)l.set(r[h],h++)}const u=l.get(t[a]);if(u!=null)if(s<u&&u<o){let h=a,d=1,f;for(;++h<i&&h<o&&!((f=l.get(t[h]))==null||f!==u+d);)d++;if(d>u-s){const p=t[a];for(;s<u;)e.insertBefore(r[s++],p)}else e.replaceChild(r[s++],t[a++])}else a++;else t[a++].remove()}}}var Bm="_$DX_DELEGATE";function qR(e,t,r,n={}){let i;return hn(o=>{i=o,t===document?e():hu(t,e(),t.firstChild?null:void 0,r)},n.owner),()=>{i(),t.textContent=""}}function GR(e,t,r){let n;const i=()=>{const a=document.createElement("template");return a.innerHTML=e,r?a.content.firstChild.firstChild:a.content.firstChild},o=t?()=>Xe(()=>document.importNode(n||(n=i()),!0)):()=>(n||(n=i())).cloneNode(!0);return o.cloneNode=o,o}function oE(e,t=window.document){const r=t[Bm]||(t[Bm]=new Set);for(let n=0,i=e.length;n<i;n++){const o=e[n];r.has(o)||(r.add(o),t.addEventListener(o,JR))}}function fu(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}function VR(e,t,r,n){n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n)}function sE(e,t){t==null?e.removeAttribute("class"):e.className=t}function aE(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){const i=r[0];e.addEventListener(t,r[0]=o=>i.call(e,r[1],o))}else e.addEventListener(t,r)}function WR(e,t,r={}){const n=Object.keys(t||{}),i=Object.keys(r);let o,a;for(o=0,a=i.length;o<a;o++){const s=i[o];!s||s==="undefined"||t[s]||(Um(e,s,!1),delete r[s])}for(o=0,a=n.length;o<a;o++){const s=n[o],c=!!t[s];!s||s==="undefined"||r[s]===c||!c||(Um(e,s,!0),r[s]=c)}return r}function zR(e,t,r){if(!t)return r?fu(e,"style"):t;const n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let i,o;for(o in r)t[o]==null&&n.removeProperty(o),delete r[o];for(o in t)i=t[o],i!==r[o]&&(n.setProperty(o,i),r[o]=i);return r}function uE(e,t={},r,n){const i={};return n||dn(()=>i.children=uo(e,t.children,i.children)),dn(()=>t.ref&&t.ref(e)),dn(()=>YR(e,t,r,!0,i,!0)),i}function QR(e,t,r){return Xe(()=>e(t,r))}function hu(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return uo(e,t,n,r);dn(i=>uo(e,t(),i,r),n)}function YR(e,t,r,n,i={},o=!1){t||(t={});for(const a in i)if(!(a in t)){if(a==="children")continue;i[a]=$m(e,a,null,i[a],r,o)}for(const a in t){if(a==="children"){n||uo(e,t.children);continue}const s=t[a];i[a]=$m(e,a,s,i[a],r,o)}}function KR(e){let t,r;if(!ve.context||!(t=ve.registry.get(r=ZR()))){if(ve.context,!e)throw new Error("Unrecoverable Hydration Mismatch. No template for key: "+r);return e()}return ve.completed&&ve.completed.add(t),ve.registry.delete(r),t}function XR(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function Um(e,t,r){const n=t.trim().split(/\s+/);for(let i=0,o=n.length;i<o;i++)e.classList.toggle(n[i],r)}function $m(e,t,r,n,i,o){let a,s,c,l,u;if(t==="style")return zR(e,r,n);if(t==="classList")return WR(e,r,n);if(r===n)return n;if(t==="ref")o||r(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);n&&e.removeEventListener(h,n),r&&e.addEventListener(h,r)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);n&&e.removeEventListener(h,n,!0),r&&e.addEventListener(h,r,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),d=UR.has(h);if(!d&&n){const f=Array.isArray(n)?n[0]:n;e.removeEventListener(h,f)}(d||r)&&(aE(e,h,r,d),d&&oE([h]))}else if(t.slice(0,5)==="attr:")fu(e,t.slice(5),r);else if((u=t.slice(0,5)==="prop:")||(c=MR.has(t))||!i&&((l=BR(t,e.tagName))||(s=kR.has(t)))||(a=e.nodeName.includes("-")))u&&(t=t.slice(5),s=!0),t==="class"||t==="className"?sE(e,r):a&&!s&&!c?e[XR(t)]=r:e[l||t]=r;else{const h=i&&t.indexOf(":")>-1&&jR[t.split(":")[0]];h?VR(e,h,t,r):fu(e,FR[t]||t,r)}return r}function JR(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return r||document}}),ve.registry&&!ve.done&&(ve.done=_$HY.done=!0);r;){const n=r[t];if(n&&!r.disabled){const i=r[`${t}Data`];if(i!==void 0?n.call(r,i,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function uo(e,t,r,n,i){if(ve.context){!r&&(r=[...e.childNodes]);let s=[];for(let c=0;c<r.length;c++){const l=r[c];l.nodeType===8&&l.data.slice(0,2)==="!$"?l.remove():s.push(l)}r=s}for(;typeof r=="function";)r=r();if(t===r)return r;const o=typeof t,a=n!==void 0;if(e=a&&r[0]&&r[0].parentNode||e,o==="string"||o==="number"){if(ve.context)return r;if(o==="number"&&(t=t.toString()),a){let s=r[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),r=Ci(e,r,n,s)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||o==="boolean"){if(ve.context)return r;r=Ci(e,r,n)}else{if(o==="function")return dn(()=>{let s=t();for(;typeof s=="function";)s=s();r=uo(e,s,r,n)}),()=>r;if(Array.isArray(t)){const s=[],c=r&&Array.isArray(r);if(Tf(s,t,r,i))return dn(()=>r=uo(e,s,r,n,!0)),()=>r;if(ve.context){if(!s.length)return r;for(let l=0;l<s.length;l++)if(s[l].parentNode)return r=s}if(s.length===0){if(r=Ci(e,r,n),a)return r}else c?r.length===0?jm(e,s,n):HR(e,r,s):(r&&Ci(e),jm(e,s));r=s}else if(t.nodeType){if(ve.context&&t.parentNode)return r=a?[t]:t;if(Array.isArray(r)){if(a)return r=Ci(e,r,n,t);Ci(e,r,null,t)}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t}}return r}function Tf(e,t,r,n){let i=!1;for(let o=0,a=t.length;o<a;o++){let s=t[o],c=r&&r[o],l;if(!(s==null||s===!0||s===!1))if((l=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=Tf(e,s,c)||i;else if(l==="function")if(n){for(;typeof s=="function";)s=s();i=Tf(e,Array.isArray(s)?s:[s],Array.isArray(c)?c:[c])||i}else e.push(s),i=!0;else{const u=String(s);c&&c.nodeType===3&&c.data===u?e.push(c):e.push(document.createTextNode(u))}}return i}function jm(e,t,r=null){for(let n=0,i=t.length;n<i;n++)e.insertBefore(t[n],r)}function Ci(e,t,r,n){if(r===void 0)return e.textContent="";const i=n||document.createTextNode("");if(t.length){let o=!1;for(let a=t.length-1;a>=0;a--){const s=t[a];if(i!==s){const c=s.parentNode===e;!o&&!a?c?e.replaceChild(i,s):e.insertBefore(i,r):c&&s.remove()}else o=!0}}else e.insertBefore(i,r);return[i]}function ZR(){const e=ve.context;return`${e.id}${e.count++}`}var eP="http://www.w3.org/2000/svg";function cE(e,t=!1){return t?document.createElementNS(eP,e):document.createElement(e)}function tP(e){const{useShadow:t}=e,r=document.createTextNode(""),n=()=>e.mount||document.body,i=Dm();let o,a=!!ve.context;return ih(()=>{a&&(Dm().user=a=!1),o||(o=hR(i,()=>St(()=>e.children)));const s=n();if(s instanceof HTMLHeadElement){const[c,l]=bt(!1),u=()=>l(!0);hn(h=>hu(s,()=>c()?h():o(),null)),Ls(u)}else{const c=cE(e.isSVG?"g":"div",e.isSVG),l=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return r.parentNode},configurable:!0}),hu(l,o),s.appendChild(c),e.ref&&e.ref(c),Ls(()=>s.removeChild(c))}},void 0,{render:!a}),r}function rP(e){const[t,r]=nE(e,["component"]),n=St(()=>t.component);return St(()=>{const i=n();switch(typeof i){case"function":return Object.assign(i,{[oR]:!0}),Xe(()=>i(r));case"string":const o=$R.has(i),a=ve.context?KR():cE(i,o);return uE(a,r,o),a}})}var Ki,Qs,Ys,Ks,Zn,Xi,Ji,Zi,eo,to,Xs,lg,nP=(lg=class{constructor(e){ie(this,Ki,void 0);ie(this,Qs,void 0);ie(this,Ys,void 0);ie(this,Ks,void 0);ie(this,Zn,!1);ie(this,Xi,void 0);ie(this,Ji,void 0);ie(this,Zi,void 0);ie(this,eo,void 0);ie(this,to,void 0);ie(this,Xs,void 0);const{client:t,queryFlavor:r,version:n,onlineManager:i,buttonPosition:o,position:a,initialIsOpen:s,errorTypes:c}=e;ee(this,Ki,bt(t)),ee(this,Ys,r),ee(this,Ks,n),ee(this,Qs,i),ee(this,Xi,bt(o)),ee(this,Ji,bt(a)),ee(this,Zi,bt(s)),ee(this,eo,bt(c))}setButtonPosition(e){P(this,Xi)[1](e)}setPosition(e){P(this,Ji)[1](e)}setInitialIsOpen(e){P(this,Zi)[1](e)}setErrorTypes(e){P(this,eo)[1](e)}setClient(e){P(this,Ki)[1](e)}mount(e){if(P(this,Zn))throw new Error("Devtools is already mounted");const t=qR(()=>{const[r]=P(this,Xi),[n]=P(this,Ji),[i]=P(this,Zi),[o]=P(this,eo),[a]=P(this,Ki);let s;P(this,to)?s=P(this,to):(s=xR(()=>Promise.resolve().then(()=>require("./4TNE5QTO-b7979539.js"))),ee(this,to,s));const c=this;return tE(s,rE({get queryFlavor(){return P(c,Ys)},get version(){return P(c,Ks)},get onlineManager(){return P(c,Qs)}},{get client(){return a()},get buttonPosition(){return r()},get position(){return n()},get initialIsOpen(){return i()},get errorTypes(){return o()}}))},e);ee(this,Zn,!0),ee(this,Xs,t)}unmount(){var e;if(!P(this,Zn))throw new Error("Devtools is not mounted");(e=P(this,Xs))==null||e.call(this),ee(this,Zn,!1)}},Ki=new WeakMap,Qs=new WeakMap,Ys=new WeakMap,Ks=new WeakMap,Zn=new WeakMap,Xi=new WeakMap,Ji=new WeakMap,Zi=new WeakMap,eo=new WeakMap,to=new WeakMap,Xs=new WeakMap,lg);function iP(e){const t=go(),r=e.client||t,n=U.useRef(null),{buttonPosition:i,position:o,initialIsOpen:a,errorTypes:s}=e,[c]=U.useState(new nP({client:r,queryFlavor:"React Query",version:"5",onlineManager:Ns,buttonPosition:i,position:o,initialIsOpen:a,errorTypes:s}));return U.useEffect(()=>{c.setClient(r)},[r,c]),U.useEffect(()=>{i&&c.setButtonPosition(i)},[i,c]),U.useEffect(()=>{o&&c.setPosition(o)},[o,c]),U.useEffect(()=>{c.setInitialIsOpen(a||!1)},[a,c]),U.useEffect(()=>{c.setErrorTypes(s||[])},[s,c]),U.useEffect(()=>(n.current&&c.mount(n.current),()=>{c.unmount()}),[c]),U.createElement("div",{className:"tsqd-parent-container",ref:n})}var oP=process.env.NODE_ENV!=="development"?function(){return null}:iP;const sP=({showDevTools:e=!0,children:t})=>{const r=new U1({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return T.jsxs(G1,{client:r,children:[t,e&&T.jsx(oP,{initialIsOpen:!1})]})};const gl="joinCommunityButton",ah=({isMember:e=!1,isShort:t=!1,functions:{join:r,leave:n}={join:()=>{},leave:()=>{}}})=>{const i=Se(),o=U.useContext($r),a=o&&typeof o.id=="string",[s,c]=U.useState(e),[l,u]=U.useState(e?"joined":"notJoined");U.useEffect(()=>{l==="joining"?u("joined"):l==="leaving"&&u("notJoined")},[s]);const h={},d={};return s&&l!=="leaving"&&(h["data-hover-text"]=i.formatMessage({id:`${gl}_leave`}),h["aria-label"]=i.formatMessage({id:`${gl}_member_aria`}),d["aria-hidden"]="true"),T.jsx(ze,{variant:s?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:s&&l!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async f=>{a&&(f.currentTarget.blur(),s?(u("leaving"),typeof n=="function"&&await n()):(u("joining"),typeof r=="function"&&await r()),c(!s))},className:se("join-community-button",l,{active:l==="joining"}),disabled:!a,...h,children:T.jsx("span",{className:"text",...d,children:i.formatMessage({id:`${gl}${["joining","leaving"].includes(l)?`_${l}`:s?"_member":t?"_short":""}`})})})};const yl="communityDetails_",aP=({isMember:e=!1,slug:t,members:{number:r,data:n}={number:void 0,data:[]},className:i="",...o})=>{const a=Se(),s=r||(n==null?void 0:n.length)||0;return T.jsxs("div",{className:se("community-details",i),children:[T.jsx(tu,{}),T.jsxs("div",{className:"member-details",children:[T.jsxs("div",{className:"top",children:[T.jsxs("h3",{children:[a.formatMessage({id:`${yl}members`}),T.jsx("span",{className:"count",children:s})]}),T.jsx("p",{className:"text-small",children:T.jsx("a",{href:`/communities/${t}/members`,children:a.formatMessage({id:`${yl}viewAll`})})})]}),T.jsx(k0,{contributors:{total:r,data:n!=null&&n.length?n:[{},{},{},{},{}]},styling:{size:"medium",showGap:!0,showPlaceholders:s===0},cutoff:5})]}),T.jsx(ah,{isMember:e,...o}),e&&T.jsx(ze,{variant:"primary",icon:{icon:"plus"},styling:{fullWidth:!0},children:a.formatMessage({id:`${yl}invite`})})]})};const uP=({breadcrumbs:e,cutoff:t=20,className:r=""})=>{const n=Se();return T.jsxs(T.Fragment,{children:[T.jsx(lt,{element:"p",children:n.formatMessage({id:"breadcrumbs_label"})}),T.jsx("ul",{className:se("breadcrumbs text-small",r),children:e.map(({text:i,href:o,current:a=!1},s)=>T.jsxs("li",{children:[a&&T.jsx(lt,{element:"span",children:n.formatMessage({id:"breadcrumbs_currentPage"})}),T.jsx(ia,{href:a?void 0:o,children:Kf(i,t)})]},`${window.btoa(i)}_${s}`))})]})};const cP=({options:e,allOption:t=!1,allowMultiple:r=!0,onChange:n=()=>{},className:i=""})=>{const o=Se(),a=t?[{id:"all",text:typeof t!="boolean"&&t.text||o.formatMessage({id:"filters_all"})},...e]:e,[s,c]=U.useState(t?["all"]:[]),l=(u,h)=>{let d=[];s.includes(u)?d=s.filter(f=>f!==u):u==="all"?d=["all"]:r?d=[...s.filter(f=>f!=="all"),u]:d=[u],c(f=>(n&&typeof n=="function"&&n({current:d,previous:f}),d)),h&&typeof h=="function"&&h()};return T.jsx("ul",{className:se("filters",i),children:a.map(({id:u,text:h,disabled:d=!1,callback:f=()=>{}})=>{let p={};return d&&(p={disabled:!0,"aria-label":o.formatMessage({id:"filters_disabled"},{name:h})}),T.jsx("li",{children:T.jsx("button",{className:se(u,{selected:s.includes(u)}),onClick:m=>{m.preventDefault(),m.stopPropagation(),l(u,f)},...p,children:h})},u)})})},lP=(e,t)=>{const r=String(e);if(!t||!t.length)return`/${r}`;let n="";return t.forEach(({url:i,position:o})=>{o==="before-lang"?n+=`/${i}`:(n.includes(`/${r}/`)||(n+=`/${r}`),n+=`/${i}`)}),n.includes(`/${r}/`)||(n+=`/${r}`),n};const vl={en:"English",es:"Español",fr:"Français",pt:"Português"},Fa="languageSwitcher_",fP=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:r=!1,translations:n,onChange:i=()=>{},urlParts:o,variant:a="default",label:s,className:c=""})=>{const l=Se(),[u,h]=U.useState(e);if(U.useEffect(()=>{e!==u&&h(e)},[e]),!n||!Object.values(n).some(m=>m&&m.post_name))return null;const f=Object.keys(n),p=u!==e;return T.jsxs("div",{className:se("language-switcher text-small",a,c),children:[T.jsxs("nav",{children:[a!=="short"&&T.jsx("p",{children:s||l.formatMessage({id:`${Fa}label`})}),T.jsx("ul",{children:f.map(m=>{if(!vl[m])return null;let _={className:m};return u===m?_["aria-label"]=l.formatMessage({id:`${Fa}selected`},{language:vl[m]}):_={..._,href:lP(m,o),onClick:S=>{S.preventDefault(),S.stopPropagation(),h(m),i(m)}},T.jsx("li",{children:T.jsx(ia,{..._,fallbackElement:"span",children:vl[m]})},m)})}),a!=="short"&&!p&&T.jsx("p",{children:l.formatMessage({id:`${Fa}translation_${t?"original":r?"human":"machine"}`})})]}),a!=="short"&&!p&&!t&&!r&&T.jsx("small",{children:l.formatMessage({id:`${Fa}disclaimer`},{email:Ni.support,link:m=>{const _=`mailto:${m}`;return T.jsx("a",{href:_,children:m})}})})]})};const El=tf({locale:"en",messages:Gf}),lE=({page:e=1,length:t=0,limit:r=10,loadNextPage:n=()=>{},icon:i=!1,messages:o={button:El.formatMessage({id:"loadMore_button"}),endOfFeed:El.formatMessage({id:"loadMore_endOfFeed"}),error:El.formatMessage({id:"loadMore_error"})},className:a="",gtmContext:s="LoadMore"})=>{const[c,l]=U.useState(!1),[u,h]=U.useState(!1);if(t<=0||t<r*e)return null;const d=async f=>{try{await n(f)}catch(p){p instanceof Error&&p.message&&p.message.includes("Cannot read items")?h(!0):l(!0)}};return T.jsxs("footer",{className:se("load-more",a),children:[c&&T.jsx("p",{className:"error",children:o.error}),u?T.jsx("p",{children:o.endOfFeed}):T.jsx(ze,{variant:"secondary",icon:i,onClick:d,"data-gtm-event-context":s,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:o.button})]})};let Da=!1;const fE=({element:e="div",id:t="more-menu",options:r,className:n=""})=>{const i=Se(),o=U.useRef(null),[a,s]=U.useState(!1),c=l=>{o.current&&l.target instanceof HTMLElement&&!o.current.contains(l.target)&&s(!1)};return U.useEffect(()=>(document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)})),U.createElement(e,{ref:o,className:se("more-menu text-medium",n),children:T.jsxs(T.Fragment,{children:[T.jsx(ze,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>s(!a),"aria-haspopup":"true","aria-expanded":a,"aria-controls":t,screenreaderText:i.formatMessage({id:"moreMenu"})}),T.jsx("ul",{id:t,hidden:!a,children:r.map(({href:l,onClick:u,text:h,icon:d,...f},p)=>{const m={...f,onClick:_=>{s(!1),typeof u=="function"&&u(_)},onFocus:()=>{Da&&(clearTimeout(Da),Da=!1)},onBlur:()=>{Da=setTimeout(()=>{s(!1)},100)}};return l&&(m.href=l),T.jsx("li",{children:T.jsx(ze,{variant:"tertiary",size:"medium",icon:d?{icon:d,position:"left"}:!1,...m,children:h})},`${window.btoa(h)}_${p}`)})})]})})};const uh=({variant:e="default",version:t="default",className:r="",...n})=>T.jsx("p",{className:"logo-wrapper",children:T.jsx("a",{href:"/home/",className:se("logo",e,t,r),...n,children:T.jsx(lt,{children:T.jsx(ln,{id:"apolitical"})})})});const hP={"2-1":901},dP=({layout:e="2-1",hideOnMobile:t=!1,className:r="",children:n})=>{const i=ra(!0);let o=n;return U.Children.count(n)===1&&(o=U.Children.toArray(n)[0],o.props&&(o=o.props.children)),T.jsx("section",{className:se("columns",`layout-${e}`,r),children:U.Children.map(o,(a,s)=>t!==!1&&s===t&&i&&i<hP[e]?null:a)})};const _l="cookieBanner_",bl=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],wl=new Date(Date.now()+12*30*24*60*60*1e3),hE=()=>{const e=Se(),[t,r,n]=vg(bl),[i,o]=U.useState(!t["apol-cookie-banner"]),a=()=>{bl.forEach(u=>{r(u,!0,{path:"/",expires:wl,domain:u==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),o(!1),window.location.reload()},s=()=>{r("apol-cookie-banner",!0,{path:"/",expires:wl}),bl.forEach(u=>{if(u==="apol-cookie-banner"){r(u,!0,{path:"/",expires:wl});return}n(u)}),o(!1)};if(!i)return null;const c=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:s,gtmType:"reject-all"},{id:"accept",onClick:a,gtmType:"accepted-all"}],l=[];return c.forEach(u=>{l.push({variant:u.href?"tertiary":"primary",href:u.href,onClick:u.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${u.gtmType}-click`,children:e.formatMessage({id:`${_l}buttons_${u.id}`})})}),T.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[T.jsx("h6",{children:e.formatMessage({id:`${_l}title`})}),T.jsx("p",{children:e.formatMessage({id:`${_l}text`})}),T.jsx(na,{buttons:l})]})},Dr={platform:{order:["events","courses","qanda","articles"],events:{href:"/events/",gtmType:"events-click"},courses:{href:"/microcourses/",gtmType:"microcourses-click"},qanda:{href:"/questions-answers/",gtmType:"q-and-a-click"},articles:{href:"/solution-articles/",gtmType:"articles-click"}},community:{order:["support","post","join","guidelines"],support:{name:"Support FAQ",href:"/pages/support-faq",gtmType:"support-faq-click"},post:{href:"/pages/post-an-article",gtmType:"post-an-article-click"},join:{href:"/pages/who-can-join-the-community",gtmType:"who-can-join-click"},guidelines:{href:"/pages/values-and-guidelines",gtmType:"guidelines-and-values-click"}},company:{order:["story","team","careers","partner","contact"],story:{href:"/pages/our-story",gtmType:"our-story-click"},team:{href:"/pages/meet-our-team",gtmType:"team-click"},careers:{href:"/pages/careers",gtmType:"careers-click"},partner:{href:"/partnerships/",gtmType:"partner-with-us-click"},contact:{href:"/pages/get-in-touch",gtmType:"contact-click"},child:"legal"},legal:{order:["privacy","terms","cookie","accessibility"],privacy:{href:"https://about.apolitical.co/privacy-policy",gtmType:"privacy-policy-link"},terms:{href:"https://about.apolitical.co/terms-and-conditions",gtmType:"terms-conditions-link"},cookie:{href:"/pages/cookie-policy",gtmType:"cookie-policy-link"},accessibility:{href:"/pages/accessibility-statement",gtmType:"accessibility-link"},text:{order:["dataProtection","euDataProtection"],dataProtection:{email:Ni["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Ni["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:Ni.support,gtmType:"concierge-email-click"},business:{email:Ni.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 Ii="footer_",du="SiteFooter",Hm=({group:e})=>{const t=Dr[e].order||[];let r=!1;return"text"in Dr[e]&&(r=Dr[e].text),T.jsxs(U.Fragment,{children:[T.jsx("p",{className:"pre-title",children:T.jsx(ln,{id:`${Ii}${e}`})}),Array.isArray(t)&&t.length>0&&T.jsx("ul",{className:"text-medium",children:t.map(n=>{if(["order","child","text"].includes(n))return null;const{href:i,gtmType:o}=Dr[e][n],a={};return["legal"].includes(e)&&(a.target="_blank",a.rel="noopener"),T.jsx("li",{children:T.jsx("a",{href:i,className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":o,...a,children:T.jsx(ln,{id:`${Ii}${e}_${n}`})})},`${e}_${n}`)})}),typeof r!="boolean"&&"order"in r&&Array.isArray(r.order)&&T.jsx("dl",{className:"text-medium",children:r.order.map(n=>T.jsxs(U.Fragment,{children:[T.jsx("dt",{children:T.jsx(ln,{id:`${Ii}${e}_${n}`})}),T.jsxs("dd",{children:[typeof r!="boolean"&&r[n].address&&T.jsx("address",{children:T.jsx(ln,{id:`${Ii}${e}_${n}_address`,values:{br:T.jsx("br",{})}})}),typeof r!="boolean"&&r[n].email&&T.jsx("a",{href:`mailto:${r[n].email}`,className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":r[n].gtmType,children:r[n].email})]})]},`dl-${e}-${n}`))})]},e)},ch=()=>T.jsx("div",{id:"footer",children:T.jsxs("div",{className:"wrapper",children:[T.jsx(Of,{element:"hr"}),T.jsx(uh,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":"logo-homepage-link"}),T.jsx("footer",{children:["platform","community","company","contact"].map(e=>T.jsxs("div",{className:"group",children:[T.jsx(Hm,{group:e}),Object.keys(Dr[e]).includes("child")&&T.jsx(Hm,{group:Dr[e].child})]},e))}),T.jsx("hr",{}),T.jsxs("div",{className:"sub-footer",children:[T.jsx("ul",{children:Array.isArray(Dr.social.order)&&Dr.social.order.map(e=>{const t=Dr.social[e];return T.jsx("li",{className:e,children:T.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":du,"data-gtm-event-type":"social-click",children:T.jsx("span",{className:"hidden",children:T.jsx(ln,{id:`${Ii}social_${e}`})})})},e)})}),T.jsx("small",{children:T.jsx(ln,{id:`${Ii}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})});const Ba="emailHelperTextBox_",pP=({type:e,email:t,redirectPath:r,resendVerificationCode:n})=>{const i=Se(),[o,a]=U.useState({path:`${Ba}default`,type:"default",link:{},mail:{},error:""}),[s,c]=U.useState(!1),l=U.useCallback(f=>{f.preventDefault(),f.stopPropagation();const p=m=>{a({path:`${Ba}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:_=>l(_),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:m})};if(typeof n!="function"){p(i.formatMessage({id:`${Ba}error_noFunction`}));return}c(!0),n(t).then(()=>{localStorage.setItem("email",t),window.location.href=r||"/signup/verify-email"}).catch(m=>{p(m.message)}).finally(()=>{c(!1)})},[t,r,n]);U.useEffect(()=>{let f=Ba,p="default",m={},_={};switch(e){case"gov":f+="autoApproved",p="success";break;case"nonGov":f+="unrecognisedEmail",p="error",m={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":f+="pendingApproval",p="error",_={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":f+="emailUnverified",p="error",m={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:S=>l(S),"data-testid":"send-verify-email-click"};break;case"exists":f+="emailAlreadyExists",p="error",m={href:"/user-onboarding/login","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"login-click"},_={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;default:f+="default",m={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}a({...o,path:f,type:p,link:m,mail:_})},[e]);const u={};return["link","mail"].forEach(f=>{u[f]=Object.keys(o[f]).length?p=>T.jsx("a",{...o[f],children:p}):p=>p}),T.jsx(A0,{type:o.type,heading:s?!1:i.formatMessage({id:`${o.path}_title`}),children:s?T.jsxs(T.Fragment,{children:[T.jsx(yr,{element:"span"}),T.jsx(yr,{element:"span"})]}):i.formatMessage({id:`${o.path}_text`},{...u,strong:f=>T.jsx("strong",{children:f}),em:f=>T.jsx("em",{children:f}),br:T.jsxs(T.Fragment,{children:[T.jsx("br",{}),T.jsx("br",{})]}),error:o.error})})};const Ua="passwordRules_",dE="isMoreThanEightCharacters",pE="includesNumberAndSymbol",mE="includesLowerAndUppercase",mP={[dE]:"8Characters",[pE]:"numberSymbol",[mE]:"lowercaseUppercase"},gP=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const r=Se();return T.jsxs("aside",{className:se("password-rules",t),children:[T.jsx("small",{children:r.formatMessage({id:`${Ua}intro`})}),T.jsx("ul",{children:[dE,pE,mE].map(n=>T.jsxs("li",{className:se({matches:e[n]}),children:[T.jsxs(lt,{children:[r.formatMessage({id:`${Ua}rule_label`})," "]}),T.jsx("span",{children:r.formatMessage({id:`${Ua}rule_${mP[n]}`})}),!e[n]&&T.jsxs(lt,{element:"strong",children:[" "," ",r.formatMessage({id:`${Ua}notMet`})]})]},`rule-${n}`))})]})},yP=U.memo(gP);const vP=({text:e={},topRating:t=5,functions:{createRating:r=()=>null,updateRating:n=()=>{},reportError:i=()=>{}},className:o="",hasLoaded:a=!1})=>{const s=Se(),[c,l]=U.useState({setUp:!1,id:null,rating:null,disabled:!0}),u=async()=>{try{const S=await r();l(v=>({...v,setUp:!0,id:S&&S.id,disabled:!1}))}catch(S){l(v=>({...v,setUp:!0,disabled:!0})),i(S)}};if(U.useEffect(()=>{a&&!c.setUp&&u()},[a]),!a)return T.jsx(yr,{className:"rating-placeholder"});const{id:h,rating:d,disabled:f}=c,p="ratings_",m={text:s.formatMessage({id:`${p}text`}),low:s.formatMessage({id:`${p}low`}),high:s.formatMessage({id:`${p}high`}),success:s.formatMessage({id:`${p}success`}),...e},_=async S=>{if(!(!h||f))try{l(v=>({...v,rating:S,disabled:!0})),await n({id:h,value:S})}catch(v){l(w=>({...w,rating:null})),i(v)}finally{l(v=>({...v,disabled:!1}))}};return T.jsxs("div",{className:se("rating",o),children:[T.jsx("span",{className:"label",children:m[d?"success":"text"]}),T.jsx("ol",{children:Array.from(new Array(t).keys()).map(S=>{const v=S+1;return T.jsx("li",{className:se({selected:d&&v<=d}),children:T.jsx(ze,{variant:"tertiary",size:"small",icon:{icon:`star${!d||v>d?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${s.formatMessage({id:`${p}stars`},{number:v,total:t})}${v===1||v===t?` - ${m[v===1?"low":"high"]}`:""}`,onClick:w=>{w.preventDefault(),w.stopPropagation(),_(v)},disabled:f})},`rating-${v}`)})})]})};const gE=({id:e="search",className:t="",handleToggle:r=!1,defaultValue:n="",gtmContext:i="search-bar",gtmEvent:o="form-submission"})=>{const{searchIsOpen:a=!0,isDesktopVersion:s=!1}=r||{},c=Se(),l=U.useRef(null);ri(()=>{!r||s||!a||l.current&&l.current.focus()},[a]);const u=h=>{h.preventDefault(),h.stopPropagation(),!(!l.current||!l.current.value||l.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(l.current.value)}`)};return T.jsx("form",{onSubmit:u,className:se("search-form gtm-trackable",t),"data-gtm-event-context":i,"data-gtm-event-type":o,children:T.jsx("fieldset",{id:`${e}-form`,hidden:r?!a:!1,role:"search",children:T.jsxs("p",{children:[T.jsx(lt,{element:"label",htmlFor:e,children:c.formatMessage({id:"search_label"})}),T.jsx("input",{ref:l,type:"search",id:e,name:e,defaultValue:n,placeholder:c.formatMessage({id:"search_placeholder"}),onKeyDown:h=>{h.key==="Enter"&&u(h)}}),T.jsx("button",{className:"clear",onClick:h=>{h.preventDefault(),h.stopPropagation(),l.current&&l.current.value&&(l.current.value="")},children:T.jsx(lt,{children:c.formatMessage({id:"search_clear"})})}),T.jsx("button",{className:"search",onClick:u,children:T.jsx(lt,{children:c.formatMessage({id:"search_cta"})})})]})})})};var EP="Expected a function",yE="__lodash_hash_undefined__",vE=1/0,_P="[object Function]",bP="[object GeneratorFunction]",wP="[object Symbol]",SP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TP=/^\w*$/,xP=/^\./,OP=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AP=/[\\^$.*+?()[\]{}|]/g,CP=/\\(\\)?/g,RP=/^\[object .+?Constructor\]$/,PP=typeof he=="object"&&he&&he.Object===Object&&he,NP=typeof self=="object"&&self&&self.Object===Object&&self,lh=PP||NP||Function("return this")();function IP(e,t){return e==null?void 0:e[t]}function LP(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var kP=Array.prototype,MP=Function.prototype,EE=Object.prototype,Sl=lh["__core-js_shared__"],qm=function(){var e=/[^.]+$/.exec(Sl&&Sl.keys&&Sl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),_E=MP.toString,fh=EE.hasOwnProperty,bE=EE.toString,FP=RegExp("^"+_E.call(fh).replace(AP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gm=lh.Symbol,DP=kP.splice,BP=wE(lh,"Map"),ks=wE(Object,"create"),Vm=Gm?Gm.prototype:void 0,Wm=Vm?Vm.toString:void 0;function oi(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function UP(){this.__data__=ks?ks(null):{}}function $P(e){return this.has(e)&&delete this.__data__[e]}function jP(e){var t=this.__data__;if(ks){var r=t[e];return r===yE?void 0:r}return fh.call(t,e)?t[e]:void 0}function HP(e){var t=this.__data__;return ks?t[e]!==void 0:fh.call(t,e)}function qP(e,t){var r=this.__data__;return r[e]=ks&&t===void 0?yE:t,this}oi.prototype.clear=UP;oi.prototype.delete=$P;oi.prototype.get=jP;oi.prototype.has=HP;oi.prototype.set=qP;function vo(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function GP(){this.__data__=[]}function VP(e){var t=this.__data__,r=Iu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():DP.call(t,r,1),!0}function WP(e){var t=this.__data__,r=Iu(t,e);return r<0?void 0:t[r][1]}function zP(e){return Iu(this.__data__,e)>-1}function QP(e,t){var r=this.__data__,n=Iu(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}vo.prototype.clear=GP;vo.prototype.delete=VP;vo.prototype.get=WP;vo.prototype.has=zP;vo.prototype.set=QP;function ci(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function YP(){this.__data__={hash:new oi,map:new(BP||vo),string:new oi}}function KP(e){return Lu(this,e).delete(e)}function XP(e){return Lu(this,e).get(e)}function JP(e){return Lu(this,e).has(e)}function ZP(e,t){return Lu(this,e).set(e,t),this}ci.prototype.clear=YP;ci.prototype.delete=KP;ci.prototype.get=XP;ci.prototype.has=JP;ci.prototype.set=ZP;function Iu(e,t){for(var r=e.length;r--;)if(lN(e[r][0],t))return r;return-1}function eN(e,t){t=iN(t,e)?[t]:nN(t);for(var r=0,n=t.length;e!=null&&r<n;)e=e[uN(t[r++])];return r&&r==n?e:void 0}function tN(e){if(!TE(e)||sN(e))return!1;var t=fN(e)||LP(e)?FP:RP;return t.test(cN(e))}function rN(e){if(typeof e=="string")return e;if(dh(e))return Wm?Wm.call(e):"";var t=e+"";return t=="0"&&1/e==-vE?"-0":t}function nN(e){return SE(e)?e:aN(e)}function Lu(e,t){var r=e.__data__;return oN(t)?r[typeof t=="string"?"string":"hash"]:r.map}function wE(e,t){var r=IP(e,t);return tN(r)?r:void 0}function iN(e,t){if(SE(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||dh(e)?!0:TP.test(e)||!SP.test(e)||t!=null&&e in Object(t)}function oN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function sN(e){return!!qm&&qm in e}var aN=hh(function(e){e=dN(e);var t=[];return xP.test(e)&&t.push(""),e.replace(OP,function(r,n,i,o){t.push(i?o.replace(CP,"$1"):n||r)}),t});function uN(e){if(typeof e=="string"||dh(e))return e;var t=e+"";return t=="0"&&1/e==-vE?"-0":t}function cN(e){if(e!=null){try{return _E.call(e)}catch{}try{return e+""}catch{}}return""}function hh(e,t){if(typeof e!="function"||t&&typeof t!="function")throw new TypeError(EP);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a),a};return r.cache=new(hh.Cache||ci),r}hh.Cache=ci;function lN(e,t){return e===t||e!==e&&t!==t}var SE=Array.isArray;function fN(e){var t=TE(e)?bE.call(e):"";return t==_P||t==bP}function TE(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function hN(e){return!!e&&typeof e=="object"}function dh(e){return typeof e=="symbol"||hN(e)&&bE.call(e)==wP}function dN(e){return e==null?"":rN(e)}function pN(e,t,r){var n=e==null?void 0:eN(e,t);return n===void 0?r:n}var mN=pN;const xE=Er(mN),Fe={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const r={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},n=o=>{const a=`logged${e?"In":"Out"}`;return t>=r[o][a]};let i={};return["navigation","search"].forEach(o=>{i[o]=n(o)}),i},shouldChangeHeaderIsVisible:(e,t,r)=>{Object.values(t).filter(i=>i===!0).length||r([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:r,dispatch:n})=>{if(r[e]===t||e==="account"&&t===!1&&r.navigation===!0)return;const i=Date.now();if(!t&&Fe.handlerCalled[e]&&i-Fe.handlerCalled[e]<500)return;Fe.handlerCalled[e]=i;let o=[{type:`menus.${e}`,value:t}];t===!0&&Object.keys(r).forEach(a=>{a===e||r[a]===!1||o.push({type:`menus.${a}`,value:!1})}),n(o)},findFirstChild:(e,t,r=!1)=>{if(!e||!e[0])return!1;for(let n=0;n<=e.length;n++){if(!e[n])continue;if(e[n][t]&&(!r||e[n][t].includes(r)))return e[n];if(!t.includes("."))continue;const i=xE(e[n],t);if(!(typeof i>"u")&&(!r||i[t]&&i[t].includes(r)||i.value&&i.value.includes(r)||i.toString().includes(r)))return e[n]}return e[0].children?Fe.findFirstChild(e[0].children,t,r):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:r,focusElements:n,dispatch:i})=>{if(!t.current||!t.current.children)return;const o=r?"desktop":"default";if(n[e][o]){n[e][o].focus();return}let a,s;switch(e){case"navigation":if(r){const c=Fe.findFirstChild(t.current.children,"attributes.aria-controls","navigation");a=Fe.findFirstChild(c.children,"href")}else a=Fe.findFirstChild(t.current.children,"href");a||(a=t.current);break;case"account":if(s=Fe.findFirstChild(t.current.children,"className","account"),!s||!s.children)return;a=Fe.findFirstChild(s.children,"href");break;default:return}a&&(i([{type:`focusElements.${e}.${o}`,value:a}]),a.focus())},events:{onClick:(e,{id:t,callback:r,isOpen:n})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(Fe.timeouts[t]),r(t,!n))},onFocus:({id:e})=>{clearTimeout(Fe.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Fe.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Fe.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},Ms={order:["home","topics","partners","account"],home:{href:"/home/",hasVariantText:!0,gtmType:"homepage-click"},topics:{order:["explore","topics"],menuId:"navigation",explore:{order:["events","courses","q-and-a","articles"],events:{href:"/events/",className:"icon events"},courses:{href:"/microcourses/",gtmType:"microcourses-click",className:"icon courses"},"q-and-a":{href:"/questions-answers/",className:"icon q-and-a"},articles:{href:"/solution-articles/",gtmType:"articles-click",className:"icon articles"}},topics:{order:["climate","cities-and-local-government","digital-and-data","education","equity-justice-and-inclusion","health-and-social-care","innovation","leadership-and-skills","life-in-government","policymaking","transport-and-infrastructure","work-and-the-economy"],className:"columns",climate:{href:"/topics/climate/"},"cities-and-local-government":{href:"/topics/cities-and-local-government/"},"digital-and-data":{href:"/topics/digital-and-data/"},education:{href:"/topics/education/"},"equity-justice-and-inclusion":{href:"/topics/equity-justice-and-inclusion/"},"health-and-social-care":{href:"/topics/health-and-social-care/"},innovation:{href:"/topics/innovation/"},"leadership-and-skills":{href:"/topics/leadership-and-skills/"},"life-in-government":{href:"/topics/life-in-government/"},policymaking:{href:"/topics/policymaking/"},"transport-and-infrastructure":{href:"/topics/transport-and-infrastructure/"},"work-and-the-economy":{href:"/topics/work-and-the-economy/"}}},partners:{href:"/partnerships/",onlyShow:"logged-out"},account:{order:["profile","settings","log-out"],className:"account",onlyShow:"logged-in",doTrack:!1,profile:{href:"/profiles/me"},settings:{href:"/profiles/me/manage-account"},"log-out":{href:"/user-onboarding/logout",className:"divider"}},buttons:{order:["login","signup"],login:{href:"/user-onboarding/login"},signup:{href:"/signup/?ref=header-banner",props:{variant:"primary"}}}},pu=({id:e,isLoggedIn:t=!1,isDesktopVersion:r=!1,menus:n={},callback:i=()=>{},doTrack:o=null})=>{const a=Se(),s=xE(Ms,e);if(!s||s.onlyShow&&(s.onlyShow==="logged-in"&&!t||s.onlyShow==="logged-out"&&t))return null;const c="doTrack"in s,l=o===null?c?s.doTrack:!0:o,u=e.includes("buttons.");let h=`header_${e.replaceAll(".","_")}`;s.hasVariantText&&(h+=`_logged${t?"In":"Out"}`);let d=!1;if(s.href){let v=s.gtmType||`${e}-click`;if(v.includes(".")){const w=v.split("."),A=w[w.length-2];v=`${A==="topics"?`${A}-`:""}${w[w.length-1]}`}d={href:s.href,role:"menuitem"},l&&(d={...d,className:"gtm-trackable","data-gtm-event-type":v,"data-gtm-event-context":"HeaderButtons"}),u&&(d={...d,variant:"secondary",size:{mobile:"small",881:"large"},...s.props||{}})}const f=s.order&&s.order[0]&&s[s.order[0]],p=f&&s[s.order[0]].order,m=d&&window.location.pathname===s.href;let _={},S={};if(f){const v=s.menuId||e,w={onClick:A=>Fe.events.onClick(A,{id:v,callback:i,isOpen:n[v]}),onFocus:()=>Fe.events.onFocus({id:v}),onBlur:()=>Fe.events.onBlur({id:v,callback:i}),onMouseLeave:()=>Fe.events.onBlur({id:v,callback:i}),onMouseEnter:()=>Fe.events.onMouseEnter({id:v,callback:i})};r&&(p&&(_={...w,onKeyPress:A=>{A.key==="Enter"&&Fe.events.onClick(A,{id:v,callback:i,isOpen:n[v]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":n[v],"aria-controls":v}),S={hidden:v in n?!n[v]:!0}),p||(S={...S,...w})}return T.jsxs("li",{className:se({[s.className]:s.className,"has-submenu":f,parent:p,active:m}),role:"none",..._,children:[d?U.createElement(u?ze:"a",d,a.formatMessage({id:h})):a.formatMessage({id:h}),s.order&&T.jsx("ul",{...S,children:s.order.map(v=>{if(!s[v])return null;const w={isLoggedIn:t,isDesktopVersion:r,menus:n,callback:i,doTrack:c?l:null};return s[v].order?T.jsxs("li",{className:se({[s[v].className]:s[v].className}),children:[a.formatMessage({id:`${h}_${v}`}),T.jsx("ul",{children:s[v].order.map(A=>T.jsx(pu,{id:`${e}.${v}.${A}`,...w},A))})]},v):T.jsx(pu,{id:`${e}.${v}`,...w},v)})})]},e)};const gN={height:67,height_desktop:83},ph=()=>{const e=Se(),t=U.useContext($r),r=ra(!0,!0),n=t&&typeof t.id=="string",i=U.useMemo(()=>Fe.getIsDesktopVersion(n,r),[n,r]),[o,a]=U.useReducer(_O,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:s,menus:c,focusElements:l}=o;gv({scrollPosition:gN[`height${i.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{!i&&c.navigation||Fe.shouldChangeHeaderIsVisible(!0,c,a)},scrollDown:()=>{!i&&c.navigation||Fe.shouldChangeHeaderIsVisible(!1,c,a)}}});const u=(d,f)=>{Fe.handleMenus({id:d,value:f,menus:c,dispatch:a})},h=U.useRef(null);return ri(()=>{c.navigation&&Fe.autoFocus({menu:"navigation",navigationRef:h,isDesktopVersion:i.navigation,focusElements:l,dispatch:a})},[c.navigation]),ri(()=>{c.account&&Fe.autoFocus({menu:"account",navigationRef:h,isDesktopVersion:i.navigation,focusElements:l,dispatch:a})},[c.account]),t&&t.isLoading?null:T.jsxs(T.Fragment,{children:[T.jsxs("nav",{id:"header",className:se({"logged-in":n,"logged-out":!n,visible:s}),children:[T.jsx(lt,{element:"a",href:"#content-of-page",children:e.formatMessage({id:"header_skip"})}),T.jsx(uh,{}),!i.navigation&&T.jsx("button",{className:"menu-button gtm-trackable",onClick:d=>{d.preventDefault(),d.stopPropagation(),u("navigation",!c.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":c.navigation,"aria-controls":"navigation",children:T.jsx(lt,{children:e.formatMessage({id:`header_menu_${c.navigation?"hide":"show"}`})})}),T.jsx("ul",{ref:h,id:"navigation",hidden:i.navigation||c.account?!1:!c.navigation,role:"menu","data-showing":!i.navigation&&c.account?"account":"default",children:Ms.order.map(d=>T.jsx(pu,{id:d,isLoggedIn:n,isDesktopVersion:i.navigation,menus:{navigation:c.navigation,account:c.account},callback:u},d))}),!i.search&&T.jsx("button",{className:"search toggle-search-button",onClick:d=>{d.preventDefault(),d.stopPropagation(),u("search",!c.search)},"aria-haspopup":"true","aria-expanded":c.search,"aria-controls":"search-form",children:T.jsx(lt,{children:e.formatMessage({id:`header_search_${c.search?"hide":"show"}`})})}),T.jsx(gE,{id:"global-search",handleToggle:{searchIsOpen:c.search,isDesktopVersion:i.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),n?T.jsxs("button",{className:"account-button",onClick:d=>Fe.events.onClick(d,{id:"account",callback:u,isOpen:c.account}),onMouseEnter:()=>Fe.events.onMouseEnter({id:"account",callback:u}),onMouseLeave:()=>Fe.events.onBlur({id:"account",callback:u}),"aria-haspopup":"true","aria-expanded":c.account,"aria-controls":"navigation",children:[T.jsx(lt,{children:e.formatMessage({id:`header_account_${c.account?"hide":"show"}`})}),T.jsx(Ou,{name:t&&t.name||"",src:t&&t.image&&t.image.thumbnail||""})]}):T.jsx("ul",{className:"sign-in-buttons",children:Ms.buttons.order.map(d=>T.jsx(pu,{id:`buttons.${d}`},d))})]}),T.jsx("hr",{id:"content-of-page"}),T.jsx("div",{className:se("overlay",{open:c.navigation||c.account||!i.search&&c.search})})]})},yN=U.createContext(null),Tl={didCatch:!1,error:null};class vN extends U.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Tl}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:o,reason:"imperative-api"}),this.setState(Tl)}}componentDidCatch(t,r){var n,i;(n=(i=this.props).onError)===null||n===void 0||n.call(i,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:i}=this.props;if(n&&r.error!==null&&EN(t.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(Tl)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=t;if(o){const c={error:a,resetErrorBoundary:this.resetErrorBoundary};if(U.isValidElement(i))s=i;else if(typeof r=="function")s=r(c);else if(n)s=U.createElement(n,c);else throw a}return U.createElement(yN.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function EN(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}const _N=()=>{const e=Se();return T.jsxs(T.Fragment,{children:[T.jsx(ph,{}),T.jsx("div",{className:"content",children:T.jsx(aa,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),T.jsx(ch,{})]})},bN=({children:e,reportError:t,showFooter:r=!0,background:n="default",className:i="",locale:o="en"})=>{const a=hg();U.useEffect(()=>{window.scrollTo(0,0)},[a]);const s=Av(e,{locale:o});return T.jsx(vN,{onError:t,fallback:T.jsx(_N,{}),children:T.jsx(U.Suspense,{fallback:T.jsx(I0,{layout:"overview-page"}),children:T.jsx("div",{id:"wrapper",className:se(i,{[n]:n!=="default"}),children:T.jsxs(e_,{children:[T.jsx(ph,{}),T.jsx("div",{className:"content",children:s}),r&&T.jsx(ch,{}),T.jsx(hE,{})]})})})})},zm={default:"tags_",headerTopics:"header_topics_topics_"},xl={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"},wN={getTagDetails:e=>{if(e.includes("topic_")){if(e=xl.topic[e.replace("topic_","")],e){const t=Ms.topics.topics[e].href;return t?{id:e,href:t,text:`${zm.headerTopics}${e}`}:null}return null}return xl[e]?(e=xl[e],{id:e,text:`${zm.default}${e}`}):null}};const SN=({tags:e=[],color:t="default",forceOneLine:r=!1,canHaveLinks:n=!0,className:i="",gtmType:o="tag-click",gtmContext:a="tags"})=>{const s=Se();if(!e||e.length<1)return null;const c=[];return e.forEach(l=>{if(!l)return;const u=wN.getTagDetails(l);u&&c.push(u)}),c.length<1?null:T.jsx("ul",{className:se("tags text-small",t,i,{"one-line":r}),children:c.map(l=>{const u=s.formatMessage({id:l.text});return T.jsx("li",{children:l.href&&n?T.jsx("a",{href:l.href,className:"gtm-trackable","data-gtm-event-type":o,"data-gtm-event-context":a,children:u}):u},l.id)})})};const TN=({members:{total:e,data:t=[]},pagination:r,gtmContext:n="member",gtmType:i="member-click",className:o=""})=>{const a=Se();return t.length===0?null:(e||(e=t.length),T.jsxs("div",{className:se("members-list",o),children:[T.jsxs("h1",{children:[a.formatMessage({id:"membersList"}),T.jsx("span",{className:"count",children:e})]}),T.jsx("ul",{children:t.map((s,c)=>T.jsxs("li",{children:[T.jsx(Au,{member:s,gtmContext:n,gtmType:i}),s.isAdmin&&T.jsx(R0,{children:a.formatMessage({id:"membersList_admin"})})]},c))}),r&&T.jsx(lE,{...r,icon:{icon:"arrow-down",position:"right"},gtmContext:n})]}))};function xf(){return xf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xf.apply(this,arguments)}function xN(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var ON=U.useLayoutEffect,AN=function(t){var r=pe.useRef(t);return ON(function(){r.current=t}),r},Qm=function(t,r){if(typeof t=="function"){t(r);return}t.current=r},CN=function(t,r){var n=U.useRef();return U.useCallback(function(i){t.current=i,n.current&&Qm(n.current,null),n.current=r,r&&Qm(r,i)},[r])},Ym={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},RN=function(t){Object.keys(Ym).forEach(function(r){t.style.setProperty(r,Ym[r],"important")})},Km=RN,vt=null,Xm=function(t,r){var n=t.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function PN(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),vt||(vt=document.createElement("textarea"),vt.setAttribute("tabindex","-1"),vt.setAttribute("aria-hidden","true"),Km(vt)),vt.parentNode===null&&document.body.appendChild(vt);var i=e.paddingSize,o=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(d){var f=d;vt.style[f]=a[f]}),Km(vt),vt.value=t;var c=Xm(vt,e);vt.value=t,c=Xm(vt,e),vt.value="x";var l=vt.scrollHeight-i,u=l*r;s==="border-box"&&(u=u+i+o),c=Math.max(u,c);var h=l*n;return s==="border-box"&&(h=h+i+o),c=Math.min(h,c),[c,l]}var Jm=function(){},NN=function(t,r){return t.reduce(function(n,i){return n[i]=r[i],n},{})},IN=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],LN=!!document.documentElement.currentStyle,kN=function(t){var r=window.getComputedStyle(t);if(r===null)return null;var n=NN(IN,r),i=n.boxSizing;if(i==="")return null;LN&&i==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var o=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),a=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:o,borderSize:a}},MN=kN;function OE(e,t,r){var n=AN(r);pe.useLayoutEffect(function(){var i=function(a){return n.current(a)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var FN=function(t){OE(window,"resize",t)},DN=function(t){OE(document.fonts,"loadingdone",t)},BN=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],UN=function(t,r){var n=t.cacheMeasurements,i=t.maxRows,o=t.minRows,a=t.onChange,s=a===void 0?Jm:a,c=t.onHeightChange,l=c===void 0?Jm:c,u=xN(t,BN),h=u.value!==void 0,d=pe.useRef(null),f=CN(d,r),p=pe.useRef(0),m=pe.useRef(),_=function(){var w=d.current,A=n&&m.current?m.current:MN(w);if(A){m.current=A;var b=PN(A,w.value||w.placeholder||"x",o,i),N=b[0],k=b[1];p.current!==N&&(p.current=N,w.style.setProperty("height",N+"px","important"),l(N,{rowHeight:k}))}},S=function(w){h||_(),s(w)};return pe.useLayoutEffect(_),FN(_),DN(_),pe.createElement("textarea",xf({},u,{onChange:S,ref:f}))},$N=pe.forwardRef(UN);let $a=null;const Ot="discussion_form_",mh=({content:e={type:"response",slugs:{}},userHasPermissions:t=!0,meta:r={isLoading:!1,isInWrapper:!1,isEditing:!1,showTitle:!1},inputRef:n,maxLength:i=5e4,minRows:o=4,forceShow:a={cancel:!1,error:!1},functions:s={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},props:{create:{projectNames:["questions-answers"]}}},gtmContext:c="DiscussionForm"})=>{var $,G;const l=Se(),u=U.useContext($r),[h,d]=U.useState(r.isEditing&&r.isEditing.text||""),[f,p]=U.useState(a.error||!1),[m,_]=U.useState(!1),S=U.useRef(null);if(n||(n=S),r.isLoading)return T.jsx(yr,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const v=q=>{const H=q.target.value;d(H);let Y;!u||!u.id?Y=ar(l.formatMessage,`${Ot}error_loggedOut`,e.type,"action"):t?H.length>=i&&(Y=`${Ot}error_tooLong`):Y=ar(l.formatMessage,`${Ot}error_noPermission`,e.type,"action"),Y?p(Y):f&&p(!1)};let w=`${e.type}-form`;if(e.type==="response"||e.type==="reply"){const q=e.type==="response"?(($=e.slugs)==null?void 0:$.question)||"":((G=e.slugs)==null?void 0:G.answer)||"";q&&(w=`${w}-${q.slice(-15)}`)}const A=async q=>{var Y;if(q.preventDefault(),q.stopPropagation(),!u||!u.id||!t||N)return;$a&&clearTimeout($a),_("submitting");const H=window.location.pathname;try{let re;switch(e.type){case"post":re=await s.create({content:h});break;case"question":re=await s.create({title:h,authorId:u&&u.id,...(Y=s.props)==null?void 0:Y.create});break;case"response":re=await s.create({question:e.slugs.question},{body:h,authorId:u&&u.id,contentPath:H});break;case"reply":re=await s.create({question:e.slugs.question,answer:e.slugs.answer},{body:h,authorId:u&&u.id,contentPath:H});break;default:break}await SO(1e3),s.callback&&await s.callback(re),$a=setTimeout(()=>{d(""),_("submitted"),b()},500)}catch(re){const X=re;let M=`${Ot}error`;X.message.includes("entry already exists")&&(M=ar(l.formatMessage,`${Ot}error_alreadyExists`,e.type,"action")),X.message.includes("429")?M=ar(l.formatMessage,`${Ot}error_tooMany`,e.type,"action"):X.message.includes("400")&&(M=`${Ot}error`),p(M),b()}},b=()=>{$a=setTimeout(()=>{p(!1),_(!1)},5e3)},N=!h||!RO(h),k=m==="submitting",R=[];return(r.isEditing&&!k||a.cancel)&&R.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:s.handleCancel,className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`cancel-${e.type}-click`,disabled:!a.cancel&&(!u||!u.id||!h),children:l.formatMessage({id:`${Ot}cancel`})}),R.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:q=>{if(r.isEditing){_("submitting"),s.handleSaveEdit&&s.handleSaveEdit(S.current&&"value"in S.current?S.current.value:"");return}A(q)},className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":`${r.isEditing?"save":"submit"}-${e.type}-click`,"data-testid":"save-button",disabled:!u||!u.id||!t||N||k||r.isEditing&&h===r.isEditing.text,children:l.formatMessage({id:`${Ot}${k?r.isEditing?"saving":"posting":r.isEditing?"save":"post"}`})}),T.jsxs("form",{id:w,className:se("discussion-card discussion-form",{"no-styling":r.isInWrapper&&r.isEditing}),"data-testid":`discussion-${e.type}-form`,children:[(r==null?void 0:r.showTitle)&&!r.isEditing&&["question"].includes(e.type)&&T.jsx("h2",{children:ar(l.formatMessage,`${Ot}title`,e.type,"action")}),T.jsx(Au,{member:u||"community",gtmContext:c,gtmType:"profile-click"}),T.jsx(lt,{element:"label",showOnFocus:!1,htmlFor:`${w}-input`,children:ar(l.formatMessage,`${Ot}label`,e.type,"action")}),T.jsx($N,{ref:n,id:`${w}-input`,name:e.type,placeholder:ar(l.formatMessage,`${Ot}placeholder`,e.type,"action"),onChange:v,value:h,maxLength:i,"aria-invalid":!!f,"aria-errormessage":"error-message",minRows:o,autoFocus:!!r.isEditing}),T.jsx("small",{children:ar(l.formatMessage,`${Ot}explainer`,e.type,"action",{a:q=>T.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":c,"data-gtm-event-type":"community-guidelines-link",children:q})})}),T.jsx(na,{buttons:R}),m==="submitted"&&T.jsx(nu,{className:"success","data-testid":"success",children:ar(l.formatMessage,`${Ot}success`,e.type,"action")}),f&&T.jsx(nu,{id:"error-message",className:"error","data-testid":"error",children:a.error?a.error:typeof f=="string"?f.includes(" ")?f:l.formatMessage({id:f},{action:l.formatMessage({id:`discussion_action_${e.type}`}),maxLength:i}):f})]})},gh=({contentType:e,createPost:t,membershipRequiredToPost:{isMember:r,required:n,join:i,leave:o,notMemberStateText:a}})=>n&&!r?T.jsx(aa,{text:a,button:{component:T.jsx(ah,{functions:{join:i,leave:o}})}}):T.jsx(mh,{content:{type:e,slugs:{}},functions:{create:t}}),jN={showThread:!1,showForm:!1},yh=U.createContext(jN),HN=({children:e})=>{const[t,r]=U.useState({showThread:!1,showForm:!1});return T.jsx(yh.Provider,{value:{...t,updateConversation:r},children:e})},qN=({question:e,answer:t,reply:r})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...r&&{replySlug:r}}),GN=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);let Os=!1;const Ol=()=>{Os!==!1&&(clearTimeout(Os),Os=!1)},Al=10,AE=({element:e="div",likes:t=0,peopleWhoLiked:r=!1,isShort:n=!0,userLiked:i=!1,content:o={type:"reply",slugs:{}},canLike:a=!0,functions:{createLike:s=()=>{},deleteLike:c=()=>{}}={}})=>{const l=Se();U.useEffect(()=>{f(i)},[i]);const[u,h]=U.useState(t),[d,f]=U.useState(i),[p,m]=U.useState(!1),[_,S]=U.useState(!1),v=U.useMemo(()=>GN(r,Al),[r]),w=b=>{if(b.preventDefault(),b.stopPropagation(),S(!1),Os)return Ol(),!1;if(Ol(),p||!a)return!1;Os=setTimeout(A,350)},A=async()=>{if(Ol(),p||!a)return!1;let b=d?u-1:u+1;b<0&&(b=0),m(!0),h(b),f(!d);try{if(o&&o.slugs){const N=qN(o.slugs);d?await c(N):await s(N,{contentPath:window.location.pathname})}}catch{h(t),f(i)}finally{m(!1)}};return U.createElement(e,{className:se("likes-wrapper text-medium action-button",{"show-spinner":p,"is-liked":d,disabled:!a}),onClick:w,onMouseEnter:()=>{S(!0)},onMouseLeave:()=>{S(!1)},onFocus:()=>{S(!0)},onBlur:()=>{S(!1)},children:T.jsxs(T.Fragment,{children:[T.jsx(ze,{variant:"tertiary",size:"medium",icon:{icon:d?"heart":"heart_empty",animate:"bounce"},className:se({"do-animation":d&&!i}),screenreaderText:a?l.formatMessage({id:`discussion_likes_${d?"unlike":"like"}`},{action:l.formatMessage({id:`discussion_action_${o.type}`})}):!1,onClick:w,disabled:!a,"aria-hidden":!a,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${o.type}-click`}),T.jsx("span",{className:se("number-of-likes",{"no-likes":u===0}),"data-testid":"number-of-likes",children:l.formatMessage({id:`discussion_likes${n?"_short":""}`},{number:u})}),r&&T.jsx(o0,{isOpen:_,isLoading:r.length===0,children:r.length&&T.jsxs("ul",{children:[v.map(b=>typeof b=="string"||!b.name?null:T.jsx("li",{children:T.jsx(ia,{href:b.id?`/profiles/${b.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",children:b.name})},b.id||window.btoa(b.name))),r.length>Al&&T.jsx("li",{children:l.formatMessage({id:"discussion_likes_more"},{number:r.length-Al})})]})})]})})};var mu={exports:{}};mu.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=1,o=2,a=9007199254740991,s="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",h="[object Date]",d="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",_="[object Number]",S="[object Null]",v="[object Object]",w="[object Promise]",A="[object Proxy]",b="[object RegExp]",N="[object Set]",k="[object String]",R="[object Symbol]",$="[object Undefined]",G="[object WeakMap]",q="[object ArrayBuffer]",H="[object DataView]",Y="[object Float32Array]",re="[object Float64Array]",X="[object Int8Array]",M="[object Int16Array]",Q="[object Int32Array]",J="[object Uint8Array]",fe="[object Uint8ClampedArray]",Z="[object Uint16Array]",K="[object Uint32Array]",ce=/[\\^$.*+?()[\]{}|]/g,de=/^\[object .+?Constructor\]$/,Ve=/^(?:0|[1-9]\d*)$/,te={};te[Y]=te[re]=te[X]=te[M]=te[Q]=te[J]=te[fe]=te[Z]=te[K]=!0,te[s]=te[c]=te[q]=te[u]=te[H]=te[h]=te[d]=te[f]=te[m]=te[_]=te[v]=te[b]=te[N]=te[k]=te[G]=!1;var ae=typeof he=="object"&&he&&he.Object===Object&&he,De=typeof self=="object"&&self&&self.Object===Object&&self,Ie=ae||De||Function("return this")(),Tt=t&&!t.nodeType&&t,Ct=Tt&&!0&&e&&!e.nodeType&&e,Gt=Ct&&Ct.exports===Tt,oe=Gt&&ae.process,st=function(){try{return oe&&oe.binding&&oe.binding("util")}catch{}}(),Je=st&&st.isTypedArray;function Vt(y,O){for(var I=-1,W=y==null?0:y.length,ge=0,le=[];++I<W;){var _e=y[I];O(_e,I,y)&&(le[ge++]=_e)}return le}function wr(y,O){for(var I=-1,W=O.length,ge=y.length;++I<W;)y[ge+I]=O[I];return y}function er(y,O){for(var I=-1,W=y==null?0:y.length;++I<W;)if(O(y[I],I,y))return!0;return!1}function kt(y,O){for(var I=-1,W=Array(y);++I<y;)W[I]=O(I);return W}function yn(y){return function(O){return y(O)}}function Wt(y,O){return y.has(O)}function Mt(y,O){return y==null?void 0:y[O]}function Ze(y){var O=-1,I=Array(y.size);return y.forEach(function(W,ge){I[++O]=[ge,W]}),I}function zt(y,O){return function(I){return y(O(I))}}function yt(y){var O=-1,I=Array(y.size);return y.forEach(function(W){I[++O]=W}),I}var at=Array.prototype,vn=Function.prototype,x=Object.prototype,g=Ie["__core-js_shared__"],E=vn.toString,C=x.hasOwnProperty,L=function(){var y=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),j=x.toString,z=RegExp("^"+E.call(C).replace(ce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),me=Gt?Ie.Buffer:void 0,Ce=Ie.Symbol,Re=Ie.Uint8Array,Pe=x.propertyIsEnumerable,Ee=at.splice,Rt=Ce?Ce.toStringTag:void 0,Hr=Object.getOwnPropertySymbols,En=me?me.isBuffer:void 0,Sr=zt(Object.keys,Object),_n=Yt(Ie,"DataView"),Tr=Yt(Ie,"Map"),bn=Yt(Ie,"Promise"),wn=Yt(Ie,"Set"),Sn=Yt(Ie,"WeakMap"),tr=Yt(Object,"create"),li=ut(_n),Qt=ut(Tr),Eo=ut(bn),_o=ut(wn),bo=ut(Sn),fi=Ce?Ce.prototype:void 0,Tn=fi?fi.valueOf:void 0;function We(y){var O=-1,I=y==null?0:y.length;for(this.clear();++O<I;){var W=y[O];this.set(W[0],W[1])}}function xn(){this.__data__=tr?tr(null):{},this.size=0}function On(y){var O=this.has(y)&&delete this.__data__[y];return this.size-=O?1:0,O}function xr(y){var O=this.__data__;if(tr){var I=O[y];return I===n?void 0:I}return C.call(O,y)?O[y]:void 0}function hi(y){var O=this.__data__;return tr?O[y]!==void 0:C.call(O,y)}function wo(y,O){var I=this.__data__;return this.size+=this.has(y)?0:1,I[y]=tr&&O===void 0?n:O,this}We.prototype.clear=xn,We.prototype.delete=On,We.prototype.get=xr,We.prototype.has=hi,We.prototype.set=wo;function et(y){var O=-1,I=y==null?0:y.length;for(this.clear();++O<I;){var W=y[O];this.set(W[0],W[1])}}function So(){this.__data__=[],this.size=0}function To(y){var O=this.__data__,I=Vr(O,y);if(I<0)return!1;var W=O.length-1;return I==W?O.pop():Ee.call(O,I,1),--this.size,!0}function xo(y){var O=this.__data__,I=Vr(O,y);return I<0?void 0:O[I][1]}function Oo(y){return Vr(this.__data__,y)>-1}function An(y,O){var I=this.__data__,W=Vr(I,y);return W<0?(++this.size,I.push([y,O])):I[W][1]=O,this}et.prototype.clear=So,et.prototype.delete=To,et.prototype.get=xo,et.prototype.has=Oo,et.prototype.set=An;function ht(y){var O=-1,I=y==null?0:y.length;for(this.clear();++O<I;){var W=y[O];this.set(W[0],W[1])}}function Ao(){this.size=0,this.__data__={hash:new We,map:new(Tr||et),string:new We}}function Co(y){var O=Pt(this,y).delete(y);return this.size-=O?1:0,O}function Ro(y){return Pt(this,y).get(y)}function Po(y){return Pt(this,y).has(y)}function No(y,O){var I=Pt(this,y),W=I.size;return I.set(y,O),this.size+=I.size==W?0:1,this}ht.prototype.clear=Ao,ht.prototype.delete=Co,ht.prototype.get=Ro,ht.prototype.has=Po,ht.prototype.set=No;function qr(y){var O=-1,I=y==null?0:y.length;for(this.__data__=new ht;++O<I;)this.add(y[O])}function di(y){return this.__data__.set(y,n),this}function Gr(y){return this.__data__.has(y)}qr.prototype.add=qr.prototype.push=di,qr.prototype.has=Gr;function xt(y){var O=this.__data__=new et(y);this.size=O.size}function Cn(){this.__data__=new et,this.size=0}function Io(y){var O=this.__data__,I=O.delete(y);return this.size=O.size,I}function Lo(y){return this.__data__.get(y)}function ko(y){return this.__data__.has(y)}function Mo(y,O){var I=this.__data__;if(I instanceof et){var W=I.__data__;if(!Tr||W.length<r-1)return W.push([y,O]),this.size=++I.size,this;I=this.__data__=new ht(W)}return I.set(y,O),this.size=I.size,this}xt.prototype.clear=Cn,xt.prototype.delete=Io,xt.prototype.get=Lo,xt.prototype.has=ko,xt.prototype.set=Mo;function Fo(y,O){var I=Wr(y),W=!I&&Ei(y),ge=!I&&!W&&Qr(y),le=!I&&!W&&!ge&&Ln(y),_e=I||W||ge||le,be=_e?kt(y.length,String):[],He=be.length;for(var Ae in y)(O||C.call(y,Ae))&&!(_e&&(Ae=="length"||ge&&(Ae=="offset"||Ae=="parent")||le&&(Ae=="buffer"||Ae=="byteLength"||Ae=="byteOffset")||rr(Ae,He)))&&be.push(Ae);return be}function Vr(y,O){for(var I=y.length;I--;)if(vi(y[I][0],O))return I;return-1}function Rn(y,O,I){var W=O(y);return Wr(y)?W:wr(W,I(y))}function Or(y){return y==null?y===void 0?$:S:Rt&&Rt in Object(y)?Kt(y):yi(y)}function pi(y){return Ft(y)&&Or(y)==s}function mi(y,O,I,W,ge){return y===O?!0:y==null||O==null||!Ft(y)&&!Ft(O)?y!==y&&O!==O:gi(y,O,I,W,mi,ge)}function gi(y,O,I,W,ge,le){var _e=Wr(y),be=Wr(O),He=_e?c:Nt(y),Ae=be?c:Nt(O);He=He==s?v:He,Ae=Ae==s?v:Ae;var tt=He==v,ct=Ae==v,Ge=He==Ae;if(Ge&&Qr(y)){if(!Qr(O))return!1;_e=!0,tt=!1}if(Ge&&!tt)return le||(le=new xt),_e||Ln(y)?Pn(y,O,I,W,ge,le):$o(y,O,He,I,W,ge,le);if(!(I&i)){var rt=tt&&C.call(y,"__wrapped__"),Qe=ct&&C.call(O,"__wrapped__");if(rt||Qe){var nr=rt?y.value():y,Xt=Qe?O.value():O;return le||(le=new xt),ge(nr,Xt,I,W,le)}}return Ge?(le||(le=new xt),Nn(y,O,I,W,ge,le)):!1}function Do(y){if(!bi(y)||qo(y))return!1;var O=_i(y)?z:de;return O.test(ut(y))}function Bo(y){return Ft(y)&&In(y.length)&&!!te[Or(y)]}function Uo(y){if(!Go(y))return Sr(y);var O=[];for(var I in Object(y))C.call(y,I)&&I!="constructor"&&O.push(I);return O}function Pn(y,O,I,W,ge,le){var _e=I&i,be=y.length,He=O.length;if(be!=He&&!(_e&&He>be))return!1;var Ae=le.get(y);if(Ae&&le.get(O))return Ae==O;var tt=-1,ct=!0,Ge=I&o?new qr:void 0;for(le.set(y,O),le.set(O,y);++tt<be;){var rt=y[tt],Qe=O[tt];if(W)var nr=_e?W(Qe,rt,tt,O,y,le):W(rt,Qe,tt,y,O,le);if(nr!==void 0){if(nr)continue;ct=!1;break}if(Ge){if(!er(O,function(Xt,Cr){if(!Wt(Ge,Cr)&&(rt===Xt||ge(rt,Xt,I,W,le)))return Ge.push(Cr)})){ct=!1;break}}else if(!(rt===Qe||ge(rt,Qe,I,W,le))){ct=!1;break}}return le.delete(y),le.delete(O),ct}function $o(y,O,I,W,ge,le,_e){switch(I){case H:if(y.byteLength!=O.byteLength||y.byteOffset!=O.byteOffset)return!1;y=y.buffer,O=O.buffer;case q:return!(y.byteLength!=O.byteLength||!le(new Re(y),new Re(O)));case u:case h:case _:return vi(+y,+O);case d:return y.name==O.name&&y.message==O.message;case b:case k:return y==O+"";case m:var be=Ze;case N:var He=W&i;if(be||(be=yt),y.size!=O.size&&!He)return!1;var Ae=_e.get(y);if(Ae)return Ae==O;W|=o,_e.set(y,O);var tt=Pn(be(y),be(O),W,ge,le,_e);return _e.delete(y),tt;case R:if(Tn)return Tn.call(y)==Tn.call(O)}return!1}function Nn(y,O,I,W,ge,le){var _e=I&i,be=Ar(y),He=be.length,Ae=Ar(O),tt=Ae.length;if(He!=tt&&!_e)return!1;for(var ct=He;ct--;){var Ge=be[ct];if(!(_e?Ge in O:C.call(O,Ge)))return!1}var rt=le.get(y);if(rt&&le.get(O))return rt==O;var Qe=!0;le.set(y,O),le.set(O,y);for(var nr=_e;++ct<He;){Ge=be[ct];var Xt=y[Ge],Cr=O[Ge];if(W)var ua=_e?W(Cr,Xt,Ge,O,y,le):W(Xt,Cr,Ge,y,O,le);if(!(ua===void 0?Xt===Cr||ge(Xt,Cr,I,W,le):ua)){Qe=!1;break}nr||(nr=Ge=="constructor")}if(Qe&&!nr){var ir=y.constructor,Yr=O.constructor;ir!=Yr&&"constructor"in y&&"constructor"in O&&!(typeof ir=="function"&&ir instanceof ir&&typeof Yr=="function"&&Yr instanceof Yr)&&(Qe=!1)}return le.delete(y),le.delete(O),Qe}function Ar(y){return Rn(y,wi,jo)}function Pt(y,O){var I=y.__data__;return Ho(O)?I[typeof O=="string"?"string":"hash"]:I.map}function Yt(y,O){var I=Mt(y,O);return Do(I)?I:void 0}function Kt(y){var O=C.call(y,Rt),I=y[Rt];try{y[Rt]=void 0;var W=!0}catch{}var ge=j.call(y);return W&&(O?y[Rt]=I:delete y[Rt]),ge}var jo=Hr?function(y){return y==null?[]:(y=Object(y),Vt(Hr(y),function(O){return Pe.call(y,O)}))}:Si,Nt=Or;(_n&&Nt(new _n(new ArrayBuffer(1)))!=H||Tr&&Nt(new Tr)!=m||bn&&Nt(bn.resolve())!=w||wn&&Nt(new wn)!=N||Sn&&Nt(new Sn)!=G)&&(Nt=function(y){var O=Or(y),I=O==v?y.constructor:void 0,W=I?ut(I):"";if(W)switch(W){case li:return H;case Qt:return m;case Eo:return w;case _o:return N;case bo:return G}return O});function rr(y,O){return O=O??a,!!O&&(typeof y=="number"||Ve.test(y))&&y>-1&&y%1==0&&y<O}function Ho(y){var O=typeof y;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?y!=="__proto__":y===null}function qo(y){return!!L&&L in y}function Go(y){var O=y&&y.constructor,I=typeof O=="function"&&O.prototype||x;return y===I}function yi(y){return j.call(y)}function ut(y){if(y!=null){try{return E.call(y)}catch{}try{return y+""}catch{}}return""}function vi(y,O){return y===O||y!==y&&O!==O}var Ei=pi(function(){return arguments}())?pi:function(y){return Ft(y)&&C.call(y,"callee")&&!Pe.call(y,"callee")},Wr=Array.isArray;function zr(y){return y!=null&&In(y.length)&&!_i(y)}var Qr=En||Wo;function Vo(y,O){return mi(y,O)}function _i(y){if(!bi(y))return!1;var O=Or(y);return O==f||O==p||O==l||O==A}function In(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=a}function bi(y){var O=typeof y;return y!=null&&(O=="object"||O=="function")}function Ft(y){return y!=null&&typeof y=="object"}var Ln=Je?yn(Je):Bo;function wi(y){return zr(y)?Fo(y):Uo(y)}function Si(){return[]}function Wo(){return!1}e.exports=Vo})(mu,mu.exports);var VN=mu.exports;const WN=Er(VN);const CE=({element:e="section",children:t,className:r,...n})=>U.createElement(e,{className:se("modal",r),children:typeof t=="string"?T.jsx("p",{children:t}):t,...n});const RE=({id:e="content-overlay",isOpen:t=!1,maxWidth:r,functions:{onOpen:n=()=>{},onClose:i=()=>{}}={},forceShow:{error:o=!1}={},title:a,children:s,buttons:c,className:l="",gtmContext:u="Modal"})=>{const h=Se(),[d,f]=U.useState(t),p=_=>{f(_),_?(n(),document.body.classList.add("has-overlay")):(i(),document.body.classList.remove("has-overlay"))};U.useEffect(()=>{p(t)},[t]);const m=r?{"--max-width":`${r/16}rem`}:{};return T.jsx("div",{className:se("overlay",{open:d}),children:T.jsx(CE,{id:e,className:se("overlay-modal",l,{"has-max-width":r}),hidden:!d,style:m,children:t&&T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"top",children:[T.jsx("h2",{children:a}),T.jsx(ze,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>p(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":u,screenreaderText:h.formatMessage({id:"overlay_button"})})]}),T.jsx(tu,{}),s,c&&T.jsxs("div",{className:"bottom",children:[T.jsx(tu,{}),T.jsx(na,{buttons:c})]}),o&&T.jsx(nu,{className:"error",children:o})]})})})},PE=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e}),Zm=e=>{const t={};return Object.keys(e).forEach(r=>{t[`${r}Slug`]=e[r]}),t};const Lr="discussion_",ku=({element:e="div",content:t,userHasPermissions:r=!0,isLoading:n=!1,originalAuthorId:i,functions:{content:{createContent:o,deleteContent:a,updateContent:s}={createContent:()=>{},deleteContent:()=>{},updateContent:()=>{}},likes:{createLike:c,deleteLike:l}={createLike:()=>{},deleteLike:()=>{}},comments:{openComments:u}={openComments:()=>{}}},links:h={},className:d,gtmContext:f="DiscussionAnswer",children:p})=>{const m=Se(),_=U.useContext($r),S=U.useContext(yh),[v,w]=U.useState({body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1}),[A,b]=U.useState(!1),[N,k]=U.useState("");if(U.useEffect(()=>{w({...v,body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),n||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question))return T.jsx(yr,{className:"discussion-card discussion-post"});const{author:R,canLike:$,createdAt:G,id:q,likes:H=0,userLiked:Y,comments:re=0}=t,X=_&&_.id&&typeof R!="string"&&R.id&&R.id===_.id||!1,M=typeof $=="boolean"?$:r?!X:!1,Q=async K=>{K||(K=""),k("");try{if(!WN(K,v.body)){const ce=t.type==="question"?{title:K}:{body:K};await s(Zm(t.slugs),ce)}w({body:K,isEditing:!1,didEdit:!0})}catch{k(`${Lr}form_error`)}},J=()=>{S&&S.updateConversation&&S.updateConversation({showThread:!0,showForm:!0}),setTimeout(()=>{const ce=`reply-form-${(t.type==="answer"?t.slug:t.slugs.answer||"").toLowerCase().slice(-15)}`,de=document.getElementById(ce),Ve=document.getElementById(`${ce}-input`);Ve&&Ve.focus(),de&&de.scrollIntoView({behavior:"smooth"})},0)},fe=()=>{try{a(Zm(t.slugs))}catch{k("delete-error")}},Z=[{text:m.formatMessage({id:`${Lr}moreMenu_report`}),href:`mailto:community@apolitical.co?subject=${encodeURI(m.formatMessage({id:`${Lr}report_subject`}))}&body=${encodeURI(m.formatMessage({id:`${Lr}report_body`},{contentType:t.type||"",contentSlug:t.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}))}`,icon:"flag"}];return r&&X&&Z.push({text:m.formatMessage({id:`${Lr}moreMenu_edit`}),onClick:()=>w({...v,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":`edit-${t.type}-click`},{text:m.formatMessage({id:`${Lr}moreMenu_delete`}),onClick:K=>{K.preventDefault(),K.stopPropagation(),b(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":`delete-${t.type}-click`,...PE(`delete-${t.slug}-modal`,A)}),U.createElement(e,{className:se("discussion-post",d),"data-testid":`discussion-${t.type}-thread`,children:T.jsxs(T.Fragment,{children:[T.jsxs("div",{id:q||t.slug,className:se("discussion-card",t.type,{editing:v.isEditing,"has-link":h.post&&!v.isEditing}),onClick:K=>{!h.post||v.isEditing||(K.preventDefault(),K.stopPropagation(),window.location.href=h.post)},children:[!v.isEditing&&T.jsx(Au,{member:R,additionalContent:{createdAt:G,didEdit:v.didEdit},className:typeof R!="string"&&R.id===i?"highlighted":"",gtmContext:f,gtmType:"profile-click"}),v.isEditing?T.jsx(mh,{content:{type:t.type,slugs:t.slugs},userHasPermissions:r,meta:{isLoading:n,isInWrapper:!0,isEditing:{text:v.body}},maxLength:t.type==="question"?250:5e4,forceShow:{error:N!==""&&N!=="delete-error"?m.formatMessage({id:N},{action:m.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:o,handleSaveEdit:Q,handleCancel:()=>{k(""),w({...v,isEditing:!1})}},gtmContext:`${f}Form`}):h.post?T.jsx("a",{href:h.post,className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":"title-click",children:T.jsx(sf,{options:{overrides:{a:C0}},children:v.body})}):T.jsx(sf,{options:{wrapper:t.type==="question"?"h1":U.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question"},children:v.body}),!v.isEditing&&T.jsxs("ul",{className:se("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[T.jsx(AE,{element:"li",likes:H,isShort:!1,userLiked:Y,content:{type:t.type,slugs:t.slugs},canLike:M,functions:{createLike:c,deleteLike:l}}),(["question","post"].includes(t.type)||h.comments||typeof u=="function")&&T.jsxs("li",{className:"action-button",onClick:K=>{K.preventDefault(),K.stopPropagation(),h.comments&&(window.location.href=h.comments),typeof u=="function"&&u()},children:[T.jsx(ze,{variant:"tertiary",size:"medium",styling:{muted:!0},icon:{icon:"speech-bubble_square_thick"},href:h.comments?h.comments:!1,onClick:h.comments||typeof u!="function"?!1:u,className:"gtm-trackable","data-gtm-event-context":f,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:m.formatMessage({id:`${Lr}comments_screenReader`},{count:re})}),T.jsx("span",{children:m.formatMessage({id:`${Lr}comments`},{count:re})})]}),(t.type==="answer"||t.type==="reply")&&T.jsx("li",{children:T.jsx(ze,{variant:"tertiary",size:"medium",styling:{muted:!0},onClick:J,children:m.formatMessage({id:`${Lr}reply`})})}),T.jsx(fE,{element:"li",id:`more-${t.slug}`,options:Z})]})]}),p,T.jsx(RE,{id:`delete-${t.slug}-modal`,isOpen:A,functions:{onOpen:()=>{},onClose:()=>b(!1)},forceShow:{error:N==="delete-error"?m.formatMessage({id:"discussion_delete_error"},{action:m.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:m.formatMessage({id:"discussion_delete_title"},{action:m.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>b(!1),children:m.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:fe,children:m.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:T.jsx(ln,{id:"discussion_delete_text",values:{p:K=>T.jsx("p",{children:K}),action:m.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const Cl="discussion_responses_",zN=({type:e="answer",responses:t=0})=>{const r=Se();return T.jsxs("div",{className:"responses-heading",children:[T.jsx("h3",{children:r.formatMessage({id:`${Cl}title`},{action:r.formatMessage({id:`${Cl}${e}`}),count:t})}),t===0&&T.jsx("p",{children:ar(r.formatMessage,`${Cl}empty`,e,e)})]})};const QN=({isOpen:e=!1,count:t=0,children:r})=>{const n=Se(),i=U.useRef(null),[o,a]=U.useState(e),[s,c]=U.useState("closed");U.useEffect(()=>{const d=i.current;if(d)return d.addEventListener("transitionend",l),()=>{d.removeEventListener("transitionend",l)}},[]),ri(()=>{s==="closed"&&!o||c(["opening","open"].includes(s)?"ready-to-close":"opening")},[o]),U.useEffect(()=>{s==="ready-to-close"&&c("closing")},[s]);const l=({propertyName:d})=>{d==="max-height"&&c(f=>f==="opening"?"open":f==="closing"?"closed":f)},u=["opening","open"].includes(s),h=Av(r,{element:"li"});return T.jsxs("div",{className:"thread-wrapper",children:[T.jsx(ze,{variant:"secondary",size:"small",styling:{muted:!0},icon:{icon:`arrow_corner-down_${u?"left":"right"}`},onClick:()=>{a(!o)},children:n.formatMessage({id:`discussion_thread_${u?"hide":"show"}`},{count:t})}),T.jsx("ul",{ref:i,className:se("thread",s),hidden:!o,children:h})]})},YN=({user:e,content:t,verb:r="post"})=>({actor:{id:e.id,data:{name:e.name,organization:e==null?void 0:e.organization,jobTitle:e==null?void 0:e.jobTitle}},content:t,latest_reactions:{like:[]},reaction_counts:{like:0},verb:r}),KN=({queryClient:e,queryKey:t,user:r,mutationFn:n})=>({mutationFn:n,onMutate:async({content:s})=>{if(!r)return;const c=YN({user:r,content:s,verb:"post"});await e.cancelQueries({queryKey:t});const l=e.getQueryData(t);return e.setQueryData(t,u=>[...u,c]),{previousActivities:l}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivities)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),XN=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async({activityId:s})=>{await e.cancelQueries({queryKey:t});const c=e.getQueryData(t),l=c==null?void 0:c.map(u=>{var h;return(u==null?void 0:u.id)===s&&((h=u.reaction_counts)!=null&&h.like?u.reaction_counts.like+=1:u.reaction_counts.like=1),u});return e.setQueryData(t,()=>l&&[...l]),{previousActivities:l}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivities)},onSuccess:s=>{const c=e.getQueryData(t),l=c==null?void 0:c.map(u=>((u==null?void 0:u.id)===(s==null?void 0:s.activity_id)&&(u.latest_reactions.like?u.latest_reactions.like.push(s):u.latest_reactions.like=[s]),u));return e.setQueryData(t,()=>l&&[...l]),{previousActivities:c}},onSettled:(s,c,l)=>{e.invalidateQueries({queryKey:[...t,l.activityId]})}}),JN=({queryClient:e,queryKey:t,user:r,mutationFn:n})=>({mutationFn:n,onMutate:async({activityId:c})=>{await e.cancelQueries({queryKey:t});const l=e.getQueryData(t),u=l==null?void 0:l.map(h=>{var d;return(h==null?void 0:h.id)===c&&(d=h.reaction_counts)!=null&&d.like&&(h.reaction_counts.like-=1),h});return e.setQueryData(t,()=>u&&[...u]),{previousActivities:u}},onError:(c,l,u)=>{e.setQueryData(t,u.previousActivities)},onSuccess:(c,{activityId:l})=>{const u=e.getQueryData(t),h=u==null?void 0:u.map(d=>{var f,p,m,_;if(d.id===l){const S=(m=(p=(f=d.latest_reactions)==null?void 0:f.like)==null?void 0:p.find(v=>v.user_id===(r==null?void 0:r.id)))==null?void 0:m.id;return d.latest_reactions.like=(_=d.latest_reactions.like)==null?void 0:_.filter(v=>v.id!==S),d}else return d});return e.setQueryData(t,()=>h&&[...h]),{previousActivities:u}},onSettled:(c,l,u)=>{e.invalidateQueries({queryKey:[...t,u.activityId]})}}),ZN=({basePath:e,parentId:t,isMember:r,functions:{list:n,create:i,like:o,unlike:a,join:s,leave:c}})=>{const l=Se(),u=go(),h=U.useContext($r),{data:d,error:f,isLoading:p,isFetching:m}=W0({queryKey:[e,t],queryFn:n}),_=KN({queryClient:u,queryKey:[e,t],user:h,mutationFn:i}),{mutate:S}=fn(_),v=XN({queryClient:u,queryKey:[e,t],mutationFn:o}),{mutate:w}=fn(v),A=JN({queryClient:u,queryKey:[e,t],user:h,mutationFn:async({activityId:R})=>{var q,H,Y;const $=d&&(d==null?void 0:d.find(re=>re.id===R)),G=(Y=(H=(q=$==null?void 0:$.latest_reactions)==null?void 0:q.like)==null?void 0:H.find(re=>re.user_id===(h==null?void 0:h.id)))==null?void 0:Y.id;await a({reactionId:G||"",activityId:R})}}),{mutate:b}=fn(A),N=U.useCallback(({activityId:R})=>w({activityId:R}),[w]),k=U.useCallback(({activityId:R})=>b({activityId:R}),[b]);return f?T.jsx(aa,{variant:"error",text:f.message}):p?T.jsx(yr,{style:{height:"400px"}}):T.jsxs(T.Fragment,{children:[T.jsx(gh,{contentType:"post",createPost:S,membershipRequiredToPost:{isMember:r,required:!0,join:s,leave:c,notMemberStateText:l.formatMessage({id:"community_joinToPost"})}}),!m&&Array.isArray(d)&&(d==null?void 0:d.map(R=>{var $,G,q,H,Y,re,X,M,Q,J,fe;return T.jsx(ku,{content:{type:"post",body:R==null?void 0:R.content,createdAt:(R==null?void 0:R.time)||"",slugs:{question:t},slug:R==null?void 0:R.id,author:{id:($=R==null?void 0:R.actor)==null?void 0:$.id,name:(q=(G=R==null?void 0:R.actor)==null?void 0:G.data)==null?void 0:q.name,organization:(Y=(H=R==null?void 0:R.actor)==null?void 0:H.data)==null?void 0:Y.organization,jobTitle:(X=(re=R==null?void 0:R.actor)==null?void 0:re.data)==null?void 0:X.jobTitle,image:{thumbnail:((Q=(M=R==null?void 0:R.actor)==null?void 0:M.data)==null?void 0:Q.thumbnail)||void 0}},userLiked:((J=R==null?void 0:R.own_reactions)==null?void 0:J.like)&&((fe=R==null?void 0:R.own_reactions)==null?void 0:fe.like.length)>0,likes:(R==null?void 0:R.reaction_counts.like)||0,comments:(R==null?void 0:R.reaction_counts.reply)||0},links:{post:`${e}/${t}/${R==null?void 0:R.id}`,comments:`${e}/${t}/${R==null?void 0:R.id}`},functions:{content:{createContent:()=>null,deleteContent:()=>null,updateContent:()=>null},likes:{createLike:()=>{N({activityId:R==null?void 0:R.id})},deleteLike:()=>{k({activityId:R==null?void 0:R.id})}},comments:{openComments:()=>null}}},R==null?void 0:R.id)}))]})},eI=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async()=>{await e.cancelQueries({queryKey:t})},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:s=>{var l;const c=e.getQueryData(t);if(c)return(l=c==null?void 0:c.latest_reactions)!=null&&l.reply?(c.latest_reactions.reply.unshift(s),c&&(c.reaction_counts={reply:c.latest_reactions.reply.length})):(c.latest_reactions={reply:[s]},c.reaction_counts={reply:1}),e.setQueryData(t,()=>({...c})),{previousActivity:c}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),tI=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async({replyId:a})=>{var l,u;await e.cancelQueries({queryKey:t});const s=e.getQueryData(t),c=(u=(l=s==null?void 0:s.latest_reactions)==null?void 0:l.reply)==null?void 0:u.map(h=>{var d;return h.id===a&&((d=h.children_counts)!=null&&d.like?h.children_counts.like+=1:h.children_counts={like:1}),h});return e.setQueryData(t,()=>({...s,latest_reactions:{reply:c}})),{previousActivity:s}},onError:(a,s,c)=>{e.setQueryData(t,c.previousActivity)},onSuccess:a=>{var l;const s=e.getQueryData(t),c=(l=s==null?void 0:s.latest_reactions.reply)==null?void 0:l.map(u=>(u.id===a.id&&(u.latest_children.like?u.latest_children.like.push(a):u.latest_children.like=[a]),u));return e.setQueryData(t,()=>({...s,latest_reactions:{reply:c}})),{previousActivity:s}}}),rI=({queryClient:e,queryKey:t,user:r,mutationFn:n})=>({mutationFn:n,onMutate:async({replyId:s})=>{var u;await e.cancelQueries({queryKey:t});const c=e.getQueryData(t);if(!c)return;const l=(u=c.latest_reactions.reply)==null?void 0:u.map(h=>(h.id===s&&h.children_counts.like&&(h.children_counts.like-=1),h));return e.setQueryData(t,()=>({...c,latest_reactions:{reply:l}})),{previousActivity:c}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:(s,{replyId:c})=>{var h;const l=e.getQueryData(t);if(!l)return;const u=(h=l.latest_reactions.reply)==null?void 0:h.map(d=>{var f;return d.id===c?(f=d.latest_children.reply)==null?void 0:f.filter(m=>m.user_id!==(r==null?void 0:r.id)):d});return e.setQueryData(t,()=>({...l,latest_reactions:{reply:u}})),{previousActivity:l}}}),NE=({basePath:e,parentId:t,activityId:r,repliesList:n,isMember:i,functions:{createReply:o,like:a,unlike:s,join:c,leave:l}})=>{const u=Se(),h=go(),d=U.useContext($r),f=eI({queryClient:h,queryKey:[e,t,r],mutationFn:o}),{mutate:p}=fn(f),m=tI({queryClient:h,queryKey:[e,t,r],mutationFn:a}),{mutate:_}=fn(m),S=rI({queryClient:h,queryKey:[e,t,r],user:d,mutationFn:s}),{mutate:v}=fn(S),w=U.useCallback(({replyId:b})=>_({replyId:b}),[_]),A=U.useCallback(({replyId:b})=>v({replyId:b}),[v]);return T.jsxs(T.Fragment,{children:[T.jsx(gh,{contentType:"post",createPost:p,membershipRequiredToPost:{isMember:i,required:!0,join:c,leave:l,notMemberStateText:u.formatMessage({id:"community_joinToPost"})}}),(n==null?void 0:n.length)===0||(n==null?void 0:n.map(b=>{var k,R,$,G,q,H,Y,re,X,M,Q,J,fe,Z,K,ce;const N=((k=b==null?void 0:b.latest_children)==null?void 0:k.like)&&((R=b==null?void 0:b.latest_children)==null?void 0:R.like.filter(de=>de.user_id===(d==null?void 0:d.id)));return T.jsx(ku,{content:{type:"post",body:typeof b.data.content=="string"?($=b==null?void 0:b.data)==null?void 0:$.content:((q=(G=b==null?void 0:b.data)==null?void 0:G.content)==null?void 0:q.text)||"",createdAt:b==null?void 0:b.created_at,slugs:{question:`${e}/${t}/${r}`,reply:b==null?void 0:b.id},slug:`${e}/${t}/${r}#${b==null?void 0:b.id}`,author:{id:(H=b==null?void 0:b.user)==null?void 0:H.id,name:(re=(Y=b==null?void 0:b.user)==null?void 0:Y.data)==null?void 0:re.name,organization:(M=(X=b==null?void 0:b.user)==null?void 0:X.data)==null?void 0:M.organization,jobTitle:(J=(Q=b==null?void 0:b.user)==null?void 0:Q.data)==null?void 0:J.jobTitle,image:{thumbnail:((Z=(fe=b==null?void 0:b.user)==null?void 0:fe.data)==null?void 0:Z.thumbnail)||void 0}},userLiked:!!(N!=null&&N.length),likes:((K=b==null?void 0:b.children_counts)==null?void 0:K.like)||0,comments:((ce=b==null?void 0:b.children_counts)==null?void 0:ce.reply)||0},functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>console.log("delete"),updateContent:()=>console.log("update")},likes:{createLike:()=>w({replyId:b==null?void 0:b.id}),deleteLike:()=>A({replyId:b==null?void 0:b.id})},comments:{openComments:()=>{}}}},b==null?void 0:b.id)}))]})},nI=({queryClient:e,queryKey:t,mutationFn:r})=>({mutationFn:r,onMutate:async()=>{var c;await e.cancelQueries({queryKey:t});const s=e.getQueryData(t);return(c=s==null?void 0:s.reaction_counts)!=null&&c.like?s.reaction_counts.like+=1:s&&(s.reaction_counts={like:1}),e.setQueryData(t,()=>({...s})),{previousActivity:s}},onError:(s,c,l)=>{e.setQueryData(t,l.previousActivity)},onSuccess:s=>{const c=e.getQueryData(t);return c!=null&&c.latest_reactions.like?c.latest_reactions.like.push(s):c&&(c.latest_reactions={like:[s]}),e.setQueryData(t,()=>({...c})),{previousActivity:c}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),iI=({queryClient:e,queryKey:t,user:r,activity:n,mutationFn:i})=>({mutationFn:i,onMutate:async()=>{var u;await e.cancelQueries({queryKey:t});const l=e.getQueryData(t);return(u=l==null?void 0:l.reaction_counts)!=null&&u.like&&l.reaction_counts.like>0&&(l.reaction_counts.like-=1),e.setQueryData(t,()=>({...l})),{previousActivity:l}},onError:(l,u,h)=>{e.setQueryData(t,h.previousActivity)},onSuccess:()=>{var h,d,f;if(!n)return;const l=(f=(d=(h=n.latest_reactions)==null?void 0:h.like)==null?void 0:d.find(p=>p.user_id===(r==null?void 0:r.id)))==null?void 0:f.id,u=e.getQueryData(t);if(u!=null&&u.latest_reactions.like)return u.latest_reactions.like=u.latest_reactions.like.filter(p=>p.id!==l),e.setQueryData(t,()=>({...u})),{previousActivity:u}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),oI=({basePath:e,parentId:t,activityId:r,isMember:n,functions:{get:i,likeActivity:o,unlikeActivity:a,createReply:s,likeReply:c,unlikeReply:l,join:u,leave:h}})=>{var R,$,G,q,H,Y,re,X,M,Q;const d=U.useContext($r),f=go(),{data:p,error:m,isLoading:_,isFetching:S}=W0({queryKey:[e,t,r],queryFn:i}),v=nI({queryClient:f,queryKey:[e,t,r],mutationFn:o}),{mutate:w}=fn(v),A=iI({queryClient:f,queryKey:[e,t,r],user:d,mutationFn:async()=>{var fe,Z,K;const J=(K=(Z=(fe=p==null?void 0:p.latest_reactions)==null?void 0:fe.like)==null?void 0:Z.find(ce=>ce.user_id===(d==null?void 0:d.id)))==null?void 0:K.id;await a({activityId:r,reactionId:J})},activity:p}),{mutate:b}=fn(A),N=U.useCallback(({activityId:J})=>w({activityId:J}),[w]),k=U.useCallback(async({activityId:J})=>b({activityId:J}),[b]);return m?T.jsx(aa,{variant:"error",text:m.message}):_||S?T.jsx(yr,{style:{height:"400px"}}):T.jsx(ku,{content:{type:"post",body:p==null?void 0:p.content,createdAt:(p==null?void 0:p.time)||"",slugs:{question:`${t}/${r}`},slug:r,author:{id:(R=p==null?void 0:p.actor)==null?void 0:R.id,name:($=p==null?void 0:p.actor)==null?void 0:$.data.name,organization:(G=p==null?void 0:p.actor)==null?void 0:G.data.organization,jobTitle:(q=p==null?void 0:p.actor)==null?void 0:q.data.jobTitle,image:{thumbnail:((H=p==null?void 0:p.actor)==null?void 0:H.data.thumbnail)||void 0}},userLiked:((Y=p==null?void 0:p.own_reactions)==null?void 0:Y.like)&&((re=p==null?void 0:p.own_reactions)==null?void 0:re.like.length)>0,likes:p&&(p==null?void 0:p.reaction_counts.like),comments:p&&(p==null?void 0:p.reaction_counts.reply)},originalAuthorId:(X=p==null?void 0:p.actor)==null?void 0:X.id,functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>console.log("delete"),updateContent:()=>console.log("update")},likes:{createLike:()=>N({activityId:r}),deleteLike:()=>k({activityId:r})},comments:{openComments:()=>{}}},children:T.jsxs(T.Fragment,{children:[T.jsxs("h3",{children:["Comments (",((M=p==null?void 0:p.reaction_counts)==null?void 0:M.reply)||0,")"]}),T.jsx(NE,{basePath:e,parentId:t,activityId:r,repliesList:(Q=p==null?void 0:p.latest_reactions)==null?void 0:Q.reply,isMember:n,functions:{createReply:s,like:c,unlike:l,join:u,leave:h}})]})},r)},sI=({id:e,data:{jobTitle:t,name:r,organization:n,thumbnail:i}})=>({id:e,name:r,jobTitle:t,organization:n,image:{thumbnail:i}});exports.$PROXY=Is;exports.$TRACK=nh;exports.ASSETS_BUCKET=ru;exports.ActivitiesFeed=ZN;exports.ActivitySection=oI;exports.AddPost=gh;exports.Breadcrumbs=uP;exports.Button=ze;exports.ButtonWrapper=na;exports.CollapsibleSection=Xf;exports.Columns=dP;exports.CommunityDetails=aP;exports.Contributors=k0;exports.Conversation=HN;exports.ConversationContext=yh;exports.CookieBanner=hE;exports.Divider=tu;exports.DownloadSection=ZA;exports.Dynamic=rP;exports.EMAILS=Ni;exports.EmailHelperTextBox=pP;exports.EmptyStateBox=aa;exports.Filters=cP;exports.Footer=ch;exports.For=CR;exports.Form=mh;exports.FullWidthSection=Yf;exports.Header=ph;exports.HelperTextBox=A0;exports.HiddenFromScreenReaders=Of;exports.HideShowTextBox=l1;exports.HighlightedTextBoxWrapper=Br;exports.Index=RR;exports.IntlProvider=S1;exports.JoinButton=ah;exports.LanguageSwitcher=fP;exports.Likes=AE;exports.Link=ia;exports.LoadMore=lE;exports.LoadingPlaceholder=yr;exports.LoadingState=I0;exports.Logo=uh;exports.LogoSection=eC;exports.MarkdownText=sf;exports.MarketingBlock=iC;exports.Match=IR;exports.Member=Au;exports.MembersList=TN;exports.Modal=CE;exports.MoreMenu=fE;exports.NUMBER_OF_USERS=sC;exports.Overlay=RE;exports.PageLayout=bN;exports.Pill=R0;exports.Portal=tP;exports.Post=ku;exports.ProfilePicture=Ou;exports.ProgressBar=P0;exports.Rating=vP;exports.ReactQueryProvider=sP;exports.RepliesFeed=NE;exports.ResponsesHeading=zN;exports.ResponsiveImage=Cv;exports.SearchForm=gE;exports.Show=PR;exports.Span=C0;exports.StatusBanner=nu;exports.Switch=NR;exports.Tags=SN;exports.Thread=QN;exports.Tooltip=o0;exports.UserContext=$r;exports.UserProvider=T1;exports.VisuallyHidden=lt;exports.addAriaProps=PE;exports.addEventListener=aE;exports.bannerSection=nC;exports.batch=uR;exports.children=oh;exports.className=sE;exports.createComponent=tE;exports.createComputed=_f;exports.createContext=mR;exports.createEffect=ih;exports.createMemo=St;exports.createRenderEffect=dn;exports.createRoot=hn;exports.createSignal=bt;exports.createUniqueId=AR;exports.delegateEvents=oE;exports.getListener=fR;exports.getMember=eh;exports.headerData=Ms;exports.insert=hu;exports.loadingBlock=_1;exports.mapGetSteamData=sI;exports.mergeProps=rE;exports.on=cR;exports.onCleanup=Ls;exports.onMount=lR;exports.passwordRules=yP;exports.setAttribute=fu;exports.splitProps=nE;exports.spread=uE;exports.template=GR;exports.untrack=Xe;exports.use=QR;exports.useContext=gR;exports.useCurrentPath=hg;exports.useEffectAfterMount=ri;exports.useFeatureFlag=px;exports.useScreenWidth=ra;exports.useScrollListener=gv;exports.useScrollToHash=gx;exports.useTransition=pR;