@apolitical/component-library 1.12.2 → 1.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/discussion/discussion.helpers.d.ts +1 -0
- package/index.js +22 -22
- package/index.mjs +2561 -2552
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),ia=require("react-cookie"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),ia=require("react-cookie"),dp=require("lodash.clonedeep"),pp=require("lodash.set"),ue=require("react-intl"),oa=require("truncate"),Wn=require("markdown-to-jsx"),Fe=require("@tanstack/react-query"),hp=require("@tanstack/react-query-devtools"),Au=require("lodash.get"),mp=require("react-error-boundary"),gp=require("react-textarea-autosize"),yp=require("lodash.isequal");var ce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function qr(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var Ru={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],s=0;s<arguments.length;s++){var o=arguments[s];if(o){var l=typeof o;if(l==="string"||l==="number")r.push(o);else if(Array.isArray(o)){if(o.length){var i=n.apply(null,o);i&&r.push(i)}}else if(l==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var u in o)t.call(o,u)&&o[u]&&r.push(u)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(
|
|
5
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],s=0;s<arguments.length;s++){var o=arguments[s];if(o){var l=typeof o;if(l==="string"||l==="number")r.push(o);else if(Array.isArray(o)){if(o.length){var i=n.apply(null,o);i&&r.push(i)}}else if(l==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var u in o)t.call(o,u)&&o[u]&&r.push(u)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Ru);var vp=Ru.exports;const ne=$r(vp),_p=({element:e="span",showOnFocus:t=!0,children:n,...r})=>j.createElement(e,{...r,className:ne("hidden",{"show-on-focus":t}),children:n}),Be=j.memo(_p),Ep=({element:e="span",children:t=null,...n})=>j.createElement(e,{...n,"aria-hidden":!0},t),aa=j.memo(Ep);var qo={exports:{}},ar={};/**
|
|
6
6
|
* @license React
|
|
7
7
|
* react-jsx-runtime.production.min.js
|
|
8
8
|
*
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* This source code is licensed under the MIT license found in the
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/var
|
|
13
|
+
*/var Ha;function wp(){if(Ha)return ar;Ha=1;var e=j,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(i,u,c){var a,d={},f=null,p=null;c!==void 0&&(f=""+c),u.key!==void 0&&(f=""+u.key),u.ref!==void 0&&(p=u.ref);for(a in u)r.call(u,a)&&!o.hasOwnProperty(a)&&(d[a]=u[a]);if(i&&i.defaultProps)for(a in u=i.defaultProps,u)d[a]===void 0&&(d[a]=u[a]);return{$$typeof:t,type:i,key:f,ref:p,props:d,_owner:s.current}}return ar.Fragment=n,ar.jsx=l,ar.jsxs=l,ar}var sr={};/**
|
|
14
14
|
* @license React
|
|
15
15
|
* react-jsx-runtime.development.js
|
|
16
16
|
*
|
|
@@ -18,27 +18,27 @@
|
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the MIT license found in the
|
|
20
20
|
* LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/var
|
|
22
|
-
`+
|
|
23
|
-
`),
|
|
24
|
-
`),
|
|
25
|
-
`+fe[
|
|
21
|
+
*/var Wa;function bp(){return Wa||(Wa=1,process.env.NODE_ENV!=="production"&&function(){var e=j,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),i=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),a=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,y="@@iterator";function _(A){if(A===null||typeof A!="object")return null;var z=h&&A[h]||A[y];return typeof z=="function"?z:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(A){{for(var z=arguments.length,J=new Array(z>1?z-1:0),se=1;se<z;se++)J[se-1]=arguments[se];w("error",A,J)}}function w(A,z,J){{var se=S.ReactDebugCurrentFrame,me=se.getStackAddendum();me!==""&&(z+="%s",J=J.concat([me]));var ve=J.map(function(de){return String(de)});ve.unshift("Warning: "+z),Function.prototype.apply.call(console[A],console,ve)}}var x=!1,O=!1,F=!1,D=!1,R=!1,W;W=Symbol.for("react.module.reference");function Q(A){return!!(typeof A=="string"||typeof A=="function"||A===r||A===o||R||A===s||A===c||A===a||D||A===p||x||O||F||typeof A=="object"&&A!==null&&(A.$$typeof===f||A.$$typeof===d||A.$$typeof===l||A.$$typeof===i||A.$$typeof===u||A.$$typeof===W||A.getModuleId!==void 0))}function k(A,z,J){var se=A.displayName;if(se)return se;var me=z.displayName||z.name||"";return me!==""?J+"("+me+")":J}function U(A){return A.displayName||"Context"}function $(A){if(A==null)return null;if(typeof A.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof A=="function")return A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case s:return"StrictMode";case c:return"Suspense";case a:return"SuspenseList"}if(typeof A=="object")switch(A.$$typeof){case i:var z=A;return U(z)+".Consumer";case l:var J=A;return U(J._context)+".Provider";case u:return k(A,A.render,"ForwardRef");case d:var se=A.displayName||null;return se!==null?se:$(A.type)||"Memo";case f:{var me=A,ve=me._payload,de=me._init;try{return $(de(ve))}catch{return null}}}return null}var K=Object.assign,V=0,C,q,Y,oe,re,G,ie;function ae(){}ae.__reactDisabledLog=!0;function be(){{if(V===0){C=console.log,q=console.info,Y=console.warn,oe=console.error,re=console.group,G=console.groupCollapsed,ie=console.groupEnd;var A={configurable:!0,enumerable:!0,value:ae,writable:!0};Object.defineProperties(console,{info:A,log:A,warn:A,error:A,group:A,groupCollapsed:A,groupEnd:A})}V++}}function ee(){{if(V--,V===0){var A={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:K({},A,{value:C}),info:K({},A,{value:q}),warn:K({},A,{value:Y}),error:K({},A,{value:oe}),group:K({},A,{value:re}),groupCollapsed:K({},A,{value:G}),groupEnd:K({},A,{value:ie})})}V<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=S.ReactCurrentDispatcher,Z;function he(A,z,J){{if(Z===void 0)try{throw Error()}catch(me){var se=me.stack.trim().match(/\n( *(at )?)/);Z=se&&se[1]||""}return`
|
|
22
|
+
`+Z+A}}var Ae=!1,Pe;{var je=typeof WeakMap=="function"?WeakMap:Map;Pe=new je}function tt(A,z){if(!A||Ae)return"";{var J=Pe.get(A);if(J!==void 0)return J}var se;Ae=!0;var me=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ve;ve=te.current,te.current=null,be();try{if(z){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(Ze){se=Ze}Reflect.construct(A,[],de)}else{try{de.call()}catch(Ze){se=Ze}A.call(de.prototype)}}else{try{throw Error()}catch(Ze){se=Ze}A()}}catch(Ze){if(Ze&&se&&typeof Ze.stack=="string"){for(var fe=Ze.stack.split(`
|
|
23
|
+
`),Ue=se.stack.split(`
|
|
24
|
+
`),Ce=fe.length-1,Re=Ue.length-1;Ce>=1&&Re>=0&&fe[Ce]!==Ue[Re];)Re--;for(;Ce>=1&&Re>=0;Ce--,Re--)if(fe[Ce]!==Ue[Re]){if(Ce!==1||Re!==1)do if(Ce--,Re--,Re<0||fe[Ce]!==Ue[Re]){var ze=`
|
|
25
|
+
`+fe[Ce].replace(" at new "," at ");return A.displayName&&ze.includes("<anonymous>")&&(ze=ze.replace("<anonymous>",A.displayName)),typeof A=="function"&&Pe.set(A,ze),ze}while(Ce>=1&&Re>=0);break}}}finally{Ae=!1,te.current=ve,ee(),Error.prepareStackTrace=me}var wt=A?A.displayName||A.name:"",on=wt?he(wt):"";return typeof A=="function"&&Pe.set(A,on),on}function Ge(A,z,J){return tt(A,!1)}function qe(A){var z=A.prototype;return!!(z&&z.isReactComponent)}function Ve(A,z,J){if(A==null)return"";if(typeof A=="function")return tt(A,qe(A));if(typeof A=="string")return he(A);switch(A){case c:return he("Suspense");case a:return he("SuspenseList")}if(typeof A=="object")switch(A.$$typeof){case u:return Ge(A.render);case d:return Ve(A.type,z,J);case f:{var se=A,me=se._payload,ve=se._init;try{return Ve(ve(me),z,J)}catch{}}}return""}var _e=Object.prototype.hasOwnProperty,Me={},Xe=S.ReactDebugCurrentFrame;function rt(A){if(A){var z=A._owner,J=Ve(A.type,A._source,z?z.type:null);Xe.setExtraStackFrame(J)}else Xe.setExtraStackFrame(null)}function Mt(A,z,J,se,me){{var ve=Function.call.bind(_e);for(var de in A)if(ve(A,de)){var fe=void 0;try{if(typeof A[de]!="function"){var Ue=Error((se||"React class")+": "+J+" type `"+de+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof A[de]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ue.name="Invariant Violation",Ue}fe=A[de](z,de,se,J,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ce){fe=Ce}fe&&!(fe instanceof Error)&&(rt(me),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",se||"React class",J,de,typeof fe),rt(null)),fe instanceof Error&&!(fe.message in Me)&&(Me[fe.message]=!0,rt(me),v("Failed %s type: %s",J,fe.message),rt(null))}}}var vt=Array.isArray;function De(A){return vt(A)}function _t(A){{var z=typeof Symbol=="function"&&Symbol.toStringTag,J=z&&A[Symbol.toStringTag]||A.constructor.name||"Object";return J}}function Dt(A){try{return Ke(A),!1}catch{return!0}}function Ke(A){return""+A}function Ut(A){if(Dt(A))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",_t(A)),Ke(A)}var b=S.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0},g,T,N;N={};function M(A){if(_e.call(A,"ref")){var z=Object.getOwnPropertyDescriptor(A,"ref").get;if(z&&z.isReactWarning)return!1}return A.ref!==void 0}function H(A){if(_e.call(A,"key")){var z=Object.getOwnPropertyDescriptor(A,"key").get;if(z&&z.isReactWarning)return!1}return A.key!==void 0}function le(A,z){if(typeof A.ref=="string"&&b.current&&z&&b.current.stateNode!==z){var J=$(b.current.type);N[J]||(v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',$(b.current.type),A.ref),N[J]=!0)}}function Se(A,z){{var J=function(){g||(g=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",z))};J.isReactWarning=!0,Object.defineProperty(A,"key",{get:J,configurable:!0})}}function Ee(A,z){{var J=function(){T||(T=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",z))};J.isReactWarning=!0,Object.defineProperty(A,"ref",{get:J,configurable:!0})}}var Oe=function(A,z,J,se,me,ve,de){var fe={$$typeof:t,type:A,key:z,ref:J,props:de,_owner:ve};return fe._store={},Object.defineProperty(fe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(fe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:se}),Object.defineProperty(fe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:me}),Object.freeze&&(Object.freeze(fe.props),Object.freeze(fe)),fe};function ge(A,z,J,se,me){{var ve,de={},fe=null,Ue=null;J!==void 0&&(Ut(J),fe=""+J),H(z)&&(Ut(z.key),fe=""+z.key),M(z)&&(Ue=z.ref,le(z,me));for(ve in z)_e.call(z,ve)&&!m.hasOwnProperty(ve)&&(de[ve]=z[ve]);if(A&&A.defaultProps){var Ce=A.defaultProps;for(ve in Ce)de[ve]===void 0&&(de[ve]=Ce[ve])}if(fe||Ue){var Re=typeof A=="function"?A.displayName||A.name||"Unknown":A;fe&&Se(de,Re),Ue&&Ee(de,Re)}return Oe(A,fe,Ue,me,se,b.current,de)}}var rr=S.ReactCurrentOwner,Jr=S.ReactDebugCurrentFrame;function Et(A){if(A){var z=A._owner,J=Ve(A.type,A._source,z?z.type:null);Jr.setExtraStackFrame(J)}else Jr.setExtraStackFrame(null)}var nr;nr=!1;function ir(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function Xr(){{if(rr.current){var A=$(rr.current.type);if(A)return`
|
|
26
26
|
|
|
27
27
|
Check the render method of \``+A+"`."}return""}}function Zn(A){{if(A!==void 0){var z=A.fileName.replace(/^.*[\\\/]/,""),J=A.lineNumber;return`
|
|
28
28
|
|
|
29
29
|
Check your code at `+z+":"+J+"."}return""}}var Zr={};function ei(A){{var z=Xr();if(!z){var J=typeof A=="string"?A:A.displayName||A.name;J&&(z=`
|
|
30
30
|
|
|
31
|
-
Check the top-level render call using <`+J+">.")}return z}}function en(A,z){{if(!A._store||A._store.validated||A.key!=null)return;A._store.validated=!0;var J=ei(z);if(Zr[J])return;Zr[J]=!0;var se="";A&&A._owner&&A._owner!==rr.current&&(se=" It was passed a child from "+$(A._owner.type)+"."),Et(A),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',J,se),Et(null)}}function tn(A,z){{if(typeof A!="object")return;if(Me(A))for(var J=0;J<A.length;J++){var se=A[J];ir(se)&&en(se,z)}else if(ir(A))A._store&&(A._store.validated=!0);else if(A){var he=_(A);if(typeof he=="function"&&he!==A.entries)for(var ye=he.call(A),de;!(de=ye.next()).done;)ir(de.value)&&en(de.value,z)}}}function ti(A){{var z=A.type;if(z==null||typeof z=="string")return;var J;if(typeof z=="function")J=z.propTypes;else if(typeof z=="object"&&(z.$$typeof===u||z.$$typeof===d))J=z.propTypes;else return;if(J){var se=$(z);Mt(J,A.props,"prop",se,A)}else if(z.PropTypes!==void 0&&!nr){nr=!0;var he=$(z);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",he||"Unknown")}typeof z.getDefaultProps=="function"&&!z.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ri(A){{for(var z=Object.keys(A.props),J=0;J<z.length;J++){var se=z[J];if(se!=="children"&&se!=="key"){Et(A),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",se),Et(null);break}}A.ref!==null&&(Et(A),v("Invalid attribute `ref` supplied to `React.Fragment`."),Et(null))}}function rn(A,z,J,se,he,ye){{var de=V(A);if(!de){var fe="";(A===void 0||typeof A=="object"&&A!==null&&Object.keys(A).length===0)&&(fe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var De=Zn(he);De?fe+=De:fe+=Xr();var Re;A===null?Re="null":Me(A)?Re="array":A!==void 0&&A.$$typeof===t?(Re="<"+($(A.type)||"Unknown")+" />",fe=" Did you accidentally export a JSX literal instead of a component?"):Re=typeof A,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Re,fe)}var Ae=me(A,z,J,he,ye);if(Ae==null)return Ae;if(de){var ze=z.children;if(ze!==void 0)if(se)if(Me(ze)){for(var wt=0;wt<ze.length;wt++)tn(ze[wt],A);Object.freeze&&Object.freeze(ze)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else tn(ze,A)}return A===r?ri(Ae):ti(Ae),Ae}}function ni(A,z,J){return rn(A,z,J,!0)}function ii(A,z,J){return rn(A,z,J,!1)}var oi=ii,nn=ni;sr.Fragment=r,sr.jsx=oi,sr.jsxs=nn}()),sr}process.env.NODE_ENV==="production"?qo.exports=Ep():qo.exports=wp();var E=qo.exports;const Ru=()=>{const[e,t]=j.useState(window.location.pathname),n=()=>{const r=window.location.pathname;t(r)};return j.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),e},jt=(e,t)=>{const n=j.useRef(!1);j.useEffect(()=>{n.current?e():n.current=!0},t)};var Cu={exports:{}},li={exports:{}},sn={},cn={exports:{}},fi,Wa;function Nu(){return Wa||(Wa=1,fi=function(t,n){return function(){for(var s=new Array(arguments.length),o=0;o<s.length;o++)s[o]=arguments[o];return t.apply(n,s)}}),fi}var di,Ga;function Be(){if(Ga)return di;Ga=1;var e=Nu(),t=Object.prototype.toString,n=function(C){return function(q){var Y=t.call(q);return C[Y]||(C[Y]=Y.slice(8,-1).toLowerCase())}}(Object.create(null));function r(C){return C=C.toLowerCase(),function(Y){return n(Y)===C}}function s(C){return Array.isArray(C)}function o(C){return typeof C>"u"}function l(C){return C!==null&&!o(C)&&C.constructor!==null&&!o(C.constructor)&&typeof C.constructor.isBuffer=="function"&&C.constructor.isBuffer(C)}var i=r("ArrayBuffer");function u(C){var q;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?q=ArrayBuffer.isView(C):q=C&&C.buffer&&i(C.buffer),q}function c(C){return typeof C=="string"}function a(C){return typeof C=="number"}function d(C){return C!==null&&typeof C=="object"}function f(C){if(n(C)!=="object")return!1;var q=Object.getPrototypeOf(C);return q===null||q===Object.prototype}var p=r("Date"),h=r("File"),y=r("Blob"),_=r("FileList");function S(C){return t.call(C)==="[object Function]"}function v(C){return d(C)&&S(C.pipe)}function w(C){var q="[object FormData]";return C&&(typeof FormData=="function"&&C instanceof FormData||t.call(C)===q||S(C.toString)&&C.toString()===q)}var x=r("URLSearchParams");function O(C){return C.trim?C.trim():C.replace(/^\s+|\s+$/g,"")}function F(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function D(C,q){if(!(C===null||typeof C>"u"))if(typeof C!="object"&&(C=[C]),s(C))for(var Y=0,oe=C.length;Y<oe;Y++)q.call(null,C[Y],Y,C);else for(var ee in C)Object.prototype.hasOwnProperty.call(C,ee)&&q.call(null,C[ee],ee,C)}function R(){var C={};function q(ee,G){f(C[G])&&f(ee)?C[G]=R(C[G],ee):f(ee)?C[G]=R({},ee):s(ee)?C[G]=ee.slice():C[G]=ee}for(var Y=0,oe=arguments.length;Y<oe;Y++)D(arguments[Y],q);return C}function W(C,q,Y){return D(q,function(ee,G){Y&&typeof ee=="function"?C[G]=e(ee,Y):C[G]=ee}),C}function V(C){return C.charCodeAt(0)===65279&&(C=C.slice(1)),C}function L(C,q,Y,oe){C.prototype=Object.create(q.prototype,oe),C.prototype.constructor=C,Y&&Object.assign(C.prototype,Y)}function U(C,q,Y){var oe,ee,G,Z={};q=q||{};do{for(oe=Object.getOwnPropertyNames(C),ee=oe.length;ee-- >0;)G=oe[ee],Z[G]||(q[G]=C[G],Z[G]=!0);C=Object.getPrototypeOf(C)}while(C&&(!Y||Y(C,q))&&C!==Object.prototype);return q}function $(C,q,Y){C=String(C),(Y===void 0||Y>C.length)&&(Y=C.length),Y-=q.length;var oe=C.indexOf(q,Y);return oe!==-1&&oe===Y}function K(C){if(!C)return null;var q=C.length;if(o(q))return null;for(var Y=new Array(q);q-- >0;)Y[q]=C[q];return Y}var Q=function(C){return function(q){return C&&q instanceof C}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));return di={isArray:s,isArrayBuffer:i,isBuffer:l,isFormData:w,isArrayBufferView:u,isString:c,isNumber:a,isObject:d,isPlainObject:f,isUndefined:o,isDate:p,isFile:h,isBlob:y,isFunction:S,isStream:v,isURLSearchParams:x,isStandardBrowserEnv:F,forEach:D,merge:R,extend:W,trim:O,stripBOM:V,inherits:L,toFlatObject:U,kindOf:n,kindOfTest:r,endsWith:$,toArray:K,isTypedArray:Q,isFileList:_},di}var pi,Va;function Pu(){if(Va)return pi;Va=1;var e=Be();function t(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}return pi=function(r,s,o){if(!s)return r;var l;if(o)l=o(s);else if(e.isURLSearchParams(s))l=s.toString();else{var i=[];e.forEach(s,function(a,d){a===null||typeof a>"u"||(e.isArray(a)?d=d+"[]":a=[a],e.forEach(a,function(p){e.isDate(p)?p=p.toISOString():e.isObject(p)&&(p=JSON.stringify(p)),i.push(t(d)+"="+t(p))}))}),l=i.join("&")}if(l){var u=r.indexOf("#");u!==-1&&(r=r.slice(0,u)),r+=(r.indexOf("?")===-1?"?":"&")+l}return r},pi}var hi,Qa;function bp(){if(Qa)return hi;Qa=1;var e=Be();function t(){this.handlers=[]}return t.prototype.use=function(r,s,o){return this.handlers.push({fulfilled:r,rejected:s,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1},t.prototype.eject=function(r){this.handlers[r]&&(this.handlers[r]=null)},t.prototype.forEach=function(r){e.forEach(this.handlers,function(o){o!==null&&r(o)})},hi=t,hi}var mi,za;function Sp(){if(za)return mi;za=1;var e=Be();return mi=function(n,r){e.forEach(n,function(o,l){l!==r&&l.toUpperCase()===r.toUpperCase()&&(n[r]=o,delete n[l])})},mi}var gi,Ya;function Xt(){if(Ya)return gi;Ya=1;var e=Be();function t(s,o,l,i,u){Error.call(this),this.message=s,this.name="AxiosError",o&&(this.code=o),l&&(this.config=l),i&&(this.request=i),u&&(this.response=u)}e.inherits(t,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var n=t.prototype,r={};return["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(s){r[s]={value:s}}),Object.defineProperties(t,r),Object.defineProperty(n,"isAxiosError",{value:!0}),t.from=function(s,o,l,i,u,c){var a=Object.create(n);return e.toFlatObject(s,a,function(f){return f!==Error.prototype}),t.call(a,s.message,o,l,i,u),a.name=s.name,c&&Object.assign(a,c),a},gi=t,gi}var yi,Ka;function Iu(){return Ka||(Ka=1,yi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}),yi}var vi,Ja;function ku(){if(Ja)return vi;Ja=1;var e=Be();function t(n,r){r=r||new FormData;var s=[];function o(i){return i===null?"":e.isDate(i)?i.toISOString():e.isArrayBuffer(i)||e.isTypedArray(i)?typeof Blob=="function"?new Blob([i]):Buffer.from(i):i}function l(i,u){if(e.isPlainObject(i)||e.isArray(i)){if(s.indexOf(i)!==-1)throw Error("Circular reference detected in "+u);s.push(i),e.forEach(i,function(a,d){if(!e.isUndefined(a)){var f=u?u+"."+d:d,p;if(a&&!u&&typeof a=="object"){if(e.endsWith(d,"{}"))a=JSON.stringify(a);else if(e.endsWith(d,"[]")&&(p=e.toArray(a))){p.forEach(function(h){!e.isUndefined(h)&&r.append(f,o(h))});return}}l(a,f)}}),s.pop()}else r.append(u,o(i))}return l(n),r}return vi=t,vi}var _i,Xa;function Op(){if(Xa)return _i;Xa=1;var e=Xt();return _i=function(n,r,s){var o=s.config.validateStatus;!s.status||!o||o(s.status)?n(s):r(new e("Request failed with status code "+s.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))},_i}var Ei,Za;function Tp(){if(Za)return Ei;Za=1;var e=Be();return Ei=e.isStandardBrowserEnv()?function(){return{write:function(r,s,o,l,i,u){var c=[];c.push(r+"="+encodeURIComponent(s)),e.isNumber(o)&&c.push("expires="+new Date(o).toGMTString()),e.isString(l)&&c.push("path="+l),e.isString(i)&&c.push("domain="+i),u===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(r){var s=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Ei}var wi,es;function xp(){return es||(es=1,wi=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}),wi}var bi,ts;function Ap(){return ts||(ts=1,bi=function(t,n){return n?t.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):t}),bi}var Si,rs;function Lu(){if(rs)return Si;rs=1;var e=xp(),t=Ap();return Si=function(r,s){return r&&!e(s)?t(r,s):s},Si}var Oi,ns;function Rp(){if(ns)return Oi;ns=1;var e=Be(),t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Oi=function(r){var s={},o,l,i;return r&&e.forEach(r.split(`
|
|
32
|
-
`),function(c){if(i=c.indexOf(":"),o=e.trim(c.substr(0,i)).toLowerCase(),l=e.trim(c.substr(i+1)),o){if(s[o]&&t.indexOf(o)>=0)return;o==="set-cookie"?s[o]=(s[o]?s[o]:[]).concat([l]):s[o]=s[o]?s[o]+", "+l:l}}),s},Oi}var Ti,is;function Cp(){if(is)return Ti;is=1;var e=Be();return Ti=e.isStandardBrowserEnv()?function(){var n=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),s;function o(l){var i=l;return n&&(r.setAttribute("href",i),i=r.href),r.setAttribute("href",i),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return s=o(window.location.href),function(i){var u=e.isString(i)?o(i):i;return u.protocol===s.protocol&&u.host===s.host}}():function(){return function(){return!0}}(),Ti}var xi,os;function Gn(){if(os)return xi;os=1;var e=Xt(),t=Be();function n(r){e.call(this,r??"canceled",e.ERR_CANCELED),this.name="CanceledError"}return t.inherits(n,e,{__CANCEL__:!0}),xi=n,xi}var Ai,as;function Np(){return as||(as=1,Ai=function(t){var n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}),Ai}var Ri,ss;function cs(){if(ss)return Ri;ss=1;var e=Be(),t=Op(),n=Tp(),r=Pu(),s=Lu(),o=Rp(),l=Cp(),i=Iu(),u=Xt(),c=Gn(),a=Np();return Ri=function(f){return new Promise(function(h,y){var _=f.data,S=f.headers,v=f.responseType,w;function x(){f.cancelToken&&f.cancelToken.unsubscribe(w),f.signal&&f.signal.removeEventListener("abort",w)}e.isFormData(_)&&e.isStandardBrowserEnv()&&delete S["Content-Type"];var O=new XMLHttpRequest;if(f.auth){var F=f.auth.username||"",D=f.auth.password?unescape(encodeURIComponent(f.auth.password)):"";S.Authorization="Basic "+btoa(F+":"+D)}var R=s(f.baseURL,f.url);O.open(f.method.toUpperCase(),r(R,f.params,f.paramsSerializer),!0),O.timeout=f.timeout;function W(){if(O){var U="getAllResponseHeaders"in O?o(O.getAllResponseHeaders()):null,$=!v||v==="text"||v==="json"?O.responseText:O.response,K={data:$,status:O.status,statusText:O.statusText,headers:U,config:f,request:O};t(function(C){h(C),x()},function(C){y(C),x()},K),O=null}}if("onloadend"in O?O.onloadend=W:O.onreadystatechange=function(){!O||O.readyState!==4||O.status===0&&!(O.responseURL&&O.responseURL.indexOf("file:")===0)||setTimeout(W)},O.onabort=function(){O&&(y(new u("Request aborted",u.ECONNABORTED,f,O)),O=null)},O.onerror=function(){y(new u("Network Error",u.ERR_NETWORK,f,O,O)),O=null},O.ontimeout=function(){var $=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded",K=f.transitional||i;f.timeoutErrorMessage&&($=f.timeoutErrorMessage),y(new u($,K.clarifyTimeoutError?u.ETIMEDOUT:u.ECONNABORTED,f,O)),O=null},e.isStandardBrowserEnv()){var V=(f.withCredentials||l(R))&&f.xsrfCookieName?n.read(f.xsrfCookieName):void 0;V&&(S[f.xsrfHeaderName]=V)}"setRequestHeader"in O&&e.forEach(S,function($,K){typeof _>"u"&&K.toLowerCase()==="content-type"?delete S[K]:O.setRequestHeader(K,$)}),e.isUndefined(f.withCredentials)||(O.withCredentials=!!f.withCredentials),v&&v!=="json"&&(O.responseType=f.responseType),typeof f.onDownloadProgress=="function"&&O.addEventListener("progress",f.onDownloadProgress),typeof f.onUploadProgress=="function"&&O.upload&&O.upload.addEventListener("progress",f.onUploadProgress),(f.cancelToken||f.signal)&&(w=function(U){O&&(y(!U||U&&U.type?new c:U),O.abort(),O=null)},f.cancelToken&&f.cancelToken.subscribe(w),f.signal&&(f.signal.aborted?w():f.signal.addEventListener("abort",w))),_||(_=null);var L=a(R);if(L&&["http","https","file"].indexOf(L)===-1){y(new u("Unsupported protocol "+L+":",u.ERR_BAD_REQUEST,f));return}O.send(_)})},Ri}var Ci,us;function Pp(){return us||(us=1,Ci=null),Ci}var Ni,ls;function sa(){if(ls)return Ni;ls=1;var e=Be(),t=Sp(),n=Xt(),r=Iu(),s=ku(),o={"Content-Type":"application/x-www-form-urlencoded"};function l(a,d){!e.isUndefined(a)&&e.isUndefined(a["Content-Type"])&&(a["Content-Type"]=d)}function i(){var a;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(a=cs()),a}function u(a,d,f){if(e.isString(a))try{return(d||JSON.parse)(a),e.trim(a)}catch(p){if(p.name!=="SyntaxError")throw p}return(f||JSON.stringify)(a)}var c={transitional:r,adapter:i(),transformRequest:[function(d,f){if(t(f,"Accept"),t(f,"Content-Type"),e.isFormData(d)||e.isArrayBuffer(d)||e.isBuffer(d)||e.isStream(d)||e.isFile(d)||e.isBlob(d))return d;if(e.isArrayBufferView(d))return d.buffer;if(e.isURLSearchParams(d))return l(f,"application/x-www-form-urlencoded;charset=utf-8"),d.toString();var p=e.isObject(d),h=f&&f["Content-Type"],y;if((y=e.isFileList(d))||p&&h==="multipart/form-data"){var _=this.env&&this.env.FormData;return s(y?{"files[]":d}:d,_&&new _)}else if(p||h==="application/json")return l(f,"application/json"),u(d);return d}],transformResponse:[function(d){var f=this.transitional||c.transitional,p=f&&f.silentJSONParsing,h=f&&f.forcedJSONParsing,y=!p&&this.responseType==="json";if(y||h&&e.isString(d)&&d.length)try{return JSON.parse(d)}catch(_){if(y)throw _.name==="SyntaxError"?n.from(_,n.ERR_BAD_RESPONSE,this,null,this.response):_}return d}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pp()},validateStatus:function(d){return d>=200&&d<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return e.forEach(["delete","get","head"],function(d){c.headers[d]={}}),e.forEach(["post","put","patch"],function(d){c.headers[d]=e.merge(o)}),Ni=c,Ni}var Pi,fs;function Ip(){if(fs)return Pi;fs=1;var e=Be(),t=sa();return Pi=function(r,s,o){var l=this||t;return e.forEach(o,function(u){r=u.call(l,r,s)}),r},Pi}var Ii,ds;function Fu(){return ds||(ds=1,Ii=function(t){return!!(t&&t.__CANCEL__)}),Ii}var ki,ps;function kp(){if(ps)return ki;ps=1;var e=Be(),t=Ip(),n=Fu(),r=sa(),s=Gn();function o(l){if(l.cancelToken&&l.cancelToken.throwIfRequested(),l.signal&&l.signal.aborted)throw new s}return ki=function(i){o(i),i.headers=i.headers||{},i.data=t.call(i,i.data,i.headers,i.transformRequest),i.headers=e.merge(i.headers.common||{},i.headers[i.method]||{},i.headers),e.forEach(["delete","get","head","post","put","patch","common"],function(a){delete i.headers[a]});var u=i.adapter||r.adapter;return u(i).then(function(a){return o(i),a.data=t.call(i,a.data,a.headers,i.transformResponse),a},function(a){return n(a)||(o(i),a&&a.response&&(a.response.data=t.call(i,a.response.data,a.response.headers,i.transformResponse))),Promise.reject(a)})},ki}var Li,hs;function ju(){if(hs)return Li;hs=1;var e=Be();return Li=function(n,r){r=r||{};var s={};function o(d,f){return e.isPlainObject(d)&&e.isPlainObject(f)?e.merge(d,f):e.isPlainObject(f)?e.merge({},f):e.isArray(f)?f.slice():f}function l(d){if(e.isUndefined(r[d])){if(!e.isUndefined(n[d]))return o(void 0,n[d])}else return o(n[d],r[d])}function i(d){if(!e.isUndefined(r[d]))return o(void 0,r[d])}function u(d){if(e.isUndefined(r[d])){if(!e.isUndefined(n[d]))return o(void 0,n[d])}else return o(void 0,r[d])}function c(d){if(d in r)return o(n[d],r[d]);if(d in n)return o(void 0,n[d])}var a={url:i,method:i,data:i,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:c};return e.forEach(Object.keys(n).concat(Object.keys(r)),function(f){var p=a[f]||l,h=p(f);e.isUndefined(h)&&p!==c||(s[f]=h)}),s},Li}var Fi,ms;function Mu(){return ms||(ms=1,Fi={version:"0.27.2"}),Fi}var ji,gs;function Lp(){if(gs)return ji;gs=1;var e=Mu().version,t=Xt(),n={};["object","boolean","number","function","string","symbol"].forEach(function(o,l){n[o]=function(u){return typeof u===o||"a"+(l<1?"n ":" ")+o}});var r={};n.transitional=function(l,i,u){function c(a,d){return"[Axios v"+e+"] Transitional option '"+a+"'"+d+(u?". "+u:"")}return function(a,d,f){if(l===!1)throw new t(c(d," has been removed"+(i?" in "+i:"")),t.ERR_DEPRECATED);return i&&!r[d]&&(r[d]=!0,console.warn(c(d," has been deprecated since v"+i+" and will be removed in the near future"))),l?l(a,d,f):!0}};function s(o,l,i){if(typeof o!="object")throw new t("options must be an object",t.ERR_BAD_OPTION_VALUE);for(var u=Object.keys(o),c=u.length;c-- >0;){var a=u[c],d=l[a];if(d){var f=o[a],p=f===void 0||d(f,a,o);if(p!==!0)throw new t("option "+a+" must be "+p,t.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new t("Unknown option "+a,t.ERR_BAD_OPTION)}}return ji={assertOptions:s,validators:n},ji}var Mi,ys;function Fp(){if(ys)return Mi;ys=1;var e=Be(),t=Pu(),n=bp(),r=kp(),s=ju(),o=Lu(),l=Lp(),i=l.validators;function u(c){this.defaults=c,this.interceptors={request:new n,response:new n}}return u.prototype.request=function(a,d){typeof a=="string"?(d=d||{},d.url=a):d=a||{},d=s(this.defaults,d),d.method?d.method=d.method.toLowerCase():this.defaults.method?d.method=this.defaults.method.toLowerCase():d.method="get";var f=d.transitional;f!==void 0&&l.assertOptions(f,{silentJSONParsing:i.transitional(i.boolean),forcedJSONParsing:i.transitional(i.boolean),clarifyTimeoutError:i.transitional(i.boolean)},!1);var p=[],h=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(d)===!1||(h=h&&F.synchronous,p.unshift(F.fulfilled,F.rejected))});var y=[];this.interceptors.response.forEach(function(F){y.push(F.fulfilled,F.rejected)});var _;if(!h){var S=[r,void 0];for(Array.prototype.unshift.apply(S,p),S=S.concat(y),_=Promise.resolve(d);S.length;)_=_.then(S.shift(),S.shift());return _}for(var v=d;p.length;){var w=p.shift(),x=p.shift();try{v=w(v)}catch(O){x(O);break}}try{_=r(v)}catch(O){return Promise.reject(O)}for(;y.length;)_=_.then(y.shift(),y.shift());return _},u.prototype.getUri=function(a){a=s(this.defaults,a);var d=o(a.baseURL,a.url);return t(d,a.params,a.paramsSerializer)},e.forEach(["delete","get","head","options"],function(a){u.prototype[a]=function(d,f){return this.request(s(f||{},{method:a,url:d,data:(f||{}).data}))}}),e.forEach(["post","put","patch"],function(a){function d(f){return function(h,y,_){return this.request(s(_||{},{method:a,headers:f?{"Content-Type":"multipart/form-data"}:{},url:h,data:y}))}}u.prototype[a]=d(),u.prototype[a+"Form"]=d(!0)}),Mi=u,Mi}var Di,vs;function jp(){if(vs)return Di;vs=1;var e=Gn();function t(n){if(typeof n!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(l){r=l});var s=this;this.promise.then(function(o){if(s._listeners){var l,i=s._listeners.length;for(l=0;l<i;l++)s._listeners[l](o);s._listeners=null}}),this.promise.then=function(o){var l,i=new Promise(function(u){s.subscribe(u),l=u}).then(o);return i.cancel=function(){s.unsubscribe(l)},i},n(function(l){s.reason||(s.reason=new e(l),r(s.reason))})}return t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t.prototype.subscribe=function(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]},t.prototype.unsubscribe=function(r){if(this._listeners){var s=this._listeners.indexOf(r);s!==-1&&this._listeners.splice(s,1)}},t.source=function(){var r,s=new t(function(l){r=l});return{token:s,cancel:r}},Di=t,Di}var Ui,_s;function Mp(){return _s||(_s=1,Ui=function(t){return function(r){return t.apply(null,r)}}),Ui}var Bi,Es;function Dp(){if(Es)return Bi;Es=1;var e=Be();return Bi=function(n){return e.isObject(n)&&n.isAxiosError===!0},Bi}var ws;function Up(){if(ws)return cn.exports;ws=1;var e=Be(),t=Nu(),n=Fp(),r=ju(),s=sa();function o(i){var u=new n(i),c=t(n.prototype.request,u);return e.extend(c,n.prototype,u),e.extend(c,u),c.create=function(d){return o(r(i,d))},c}var l=o(s);return l.Axios=n,l.CanceledError=Gn(),l.CancelToken=jp(),l.isCancel=Fu(),l.VERSION=Mu().version,l.toFormData=ku(),l.AxiosError=Xt(),l.Cancel=l.CanceledError,l.all=function(u){return Promise.all(u)},l.spread=Mp(),l.isAxiosError=Dp(),cn.exports=l,cn.exports.default=l,cn.exports}var $i,bs;function Du(){return bs||(bs=1,$i=Up()),$i}var Bp=Function.prototype.toString,qi=Object.create,$p=Object.defineProperty,qp=Object.getOwnPropertyDescriptor,Ss=Object.getOwnPropertyNames,ca=Object.getOwnPropertySymbols,Hp=Object.getPrototypeOf,Uu=Object.prototype,Wp=Uu.hasOwnProperty,Gp=Uu.propertyIsEnumerable,Bu=typeof ca=="function",Vp=typeof WeakMap=="function",Qp=function(){if(Vp)return function(){return new WeakMap};var e=function(){function t(){this._keys=[],this._values=[]}return t.prototype.has=function(n){return!!~this._keys.indexOf(n)},t.prototype.get=function(n){return this._values[this._keys.indexOf(n)]},t.prototype.set=function(n,r){this._keys.push(n),this._values.push(r)},t}();return function(){return new e}}(),$u=function(e,t){var n=e.__proto__||Hp(e);if(!n)return qi(null);var r=n.constructor;if(r===t.Object)return n===t.Object.prototype?{}:qi(n);if(~Bp.call(r).indexOf("[native code]"))try{return new r}catch{}return qi(n)},zp=function(e,t,n,r){var s=$u(e,t);r.set(e,s);for(var o in e)Wp.call(e,o)&&(s[o]=n(e[o],r));if(Bu)for(var l=ca(e),i=0,u=l.length,c=void 0;i<u;++i)c=l[i],Gp.call(e,c)&&(s[c]=n(e[c],r));return s},Os=function(e,t,n,r){var s=$u(e,t);r.set(e,s);for(var o=Bu?Ss(e).concat(ca(e)):Ss(e),l=0,i=o.length,u=void 0,c=void 0;l<i;++l)if(u=o[l],u!=="callee"&&u!=="caller")if(c=qp(e,u),c){!c.get&&!c.set&&(c.value=n(e[u],r));try{$p(s,u,c)}catch{s[u]=c.value}}else s[u]=n(e[u],r);return s},Yp=function(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Kp=Array.isArray,Jp=Object.getPrototypeOf,Xp=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:(console&&console.error&&console.error('Unable to locate global object, returning "this".'),this)}();function Ot(e,t){var n=!!(t&&t.isStrict),r=t&&t.realm||Xp,s=n?Os:zp,o=function(l,i){if(!l||typeof l!="object")return l;if(i.has(l))return i.get(l);var u=l.__proto__||Jp(l),c=u&&u.constructor;if(!c||c===r.Object)return s(l,r,o,i);var a;if(Kp(l)){if(n)return Os(l,r,o,i);a=new c,i.set(l,a);for(var d=0,f=l.length;d<f;++d)a[d]=o(l[d],i);return a}if(l instanceof r.Date)return new c(l.getTime());if(l instanceof r.RegExp)return a=new c(l.source,l.flags||Yp(l)),a.lastIndex=l.lastIndex,a;if(r.Map&&l instanceof r.Map)return a=new c,i.set(l,a),l.forEach(function(p,h){a.set(h,o(p,i))}),a;if(r.Set&&l instanceof r.Set)return a=new c,i.set(l,a),l.forEach(function(p){a.add(o(p,i))}),a;if(r.Blob&&l instanceof r.Blob)return l.slice(0,l.size,l.type);if(r.Buffer&&r.Buffer.isBuffer(l))return a=r.Buffer.allocUnsafe?r.Buffer.allocUnsafe(l.length):new c(l.length),i.set(l,a),l.copy(a),a;if(r.ArrayBuffer){if(r.ArrayBuffer.isView(l))return a=new c(l.buffer.slice(0)),i.set(l,a),a;if(l instanceof r.ArrayBuffer)return a=l.slice(0),i.set(l,a),a}return typeof l.then=="function"||l instanceof Error||r.WeakMap&&l instanceof r.WeakMap||r.WeakSet&&l instanceof r.WeakSet?l:s(l,r,o,i)};return o(e,Qp())}Ot.default=Ot;Ot.strict=function(t,n){return Ot(t,{isStrict:!0,realm:n?n.realm:void 0})};var Zp=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var s=42;t[n]=s;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,n);if(l.value!==s||l.enumerable!==!0)return!1}return!0},Ts=typeof Symbol<"u"&&Symbol,eh=Zp,th=function(){return typeof Ts!="function"||typeof Symbol!="function"||typeof Ts("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:eh()},xs={foo:{}},rh=Object,nh=function(){return{__proto__:xs}.foo===xs.foo&&!({__proto__:null}instanceof rh)},ih="Function.prototype.bind called on incompatible ",Hi=Array.prototype.slice,oh=Object.prototype.toString,ah="[object Function]",sh=function(t){var n=this;if(typeof n!="function"||oh.call(n)!==ah)throw new TypeError(ih+n);for(var r=Hi.call(arguments,1),s,o=function(){if(this instanceof s){var a=n.apply(this,r.concat(Hi.call(arguments)));return Object(a)===a?a:this}else return n.apply(t,r.concat(Hi.call(arguments)))},l=Math.max(0,n.length-r.length),i=[],u=0;u<l;u++)i.push("$"+u);if(s=Function("binder","return function ("+i.join(",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var c=function(){};c.prototype=n.prototype,s.prototype=new c,c.prototype=null}return s},ch=sh,ua=Function.prototype.bind||ch,uh=ua,lh=uh.call(Function.call,Object.prototype.hasOwnProperty),pe,zt=SyntaxError,qu=Function,Qt=TypeError,Wi=function(e){try{return qu('"use strict"; return ('+e+").constructor;")()}catch{}},Lt=Object.getOwnPropertyDescriptor;if(Lt)try{Lt({},"")}catch{Lt=null}var Gi=function(){throw new Qt},fh=Lt?function(){try{return arguments.callee,Gi}catch{try{return Lt(arguments,"callee").get}catch{return Gi}}}():Gi,$t=th(),dh=nh(),ke=Object.getPrototypeOf||(dh?function(e){return e.__proto__}:null),Ht={},ph=typeof Uint8Array>"u"||!ke?pe:ke(Uint8Array),Ft={"%AggregateError%":typeof AggregateError>"u"?pe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?pe:ArrayBuffer,"%ArrayIteratorPrototype%":$t&&ke?ke([][Symbol.iterator]()):pe,"%AsyncFromSyncIteratorPrototype%":pe,"%AsyncFunction%":Ht,"%AsyncGenerator%":Ht,"%AsyncGeneratorFunction%":Ht,"%AsyncIteratorPrototype%":Ht,"%Atomics%":typeof Atomics>"u"?pe:Atomics,"%BigInt%":typeof BigInt>"u"?pe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?pe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?pe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?pe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?pe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?pe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?pe:FinalizationRegistry,"%Function%":qu,"%GeneratorFunction%":Ht,"%Int8Array%":typeof Int8Array>"u"?pe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?pe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?pe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":$t&&ke?ke(ke([][Symbol.iterator]())):pe,"%JSON%":typeof JSON=="object"?JSON:pe,"%Map%":typeof Map>"u"?pe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!$t||!ke?pe:ke(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?pe:Promise,"%Proxy%":typeof Proxy>"u"?pe:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?pe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?pe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!$t||!ke?pe:ke(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?pe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":$t&&ke?ke(""[Symbol.iterator]()):pe,"%Symbol%":$t?Symbol:pe,"%SyntaxError%":zt,"%ThrowTypeError%":fh,"%TypedArray%":ph,"%TypeError%":Qt,"%Uint8Array%":typeof Uint8Array>"u"?pe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?pe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?pe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?pe:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?pe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?pe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?pe:WeakSet};if(ke)try{null.error}catch(e){var hh=ke(ke(e));Ft["%Error.prototype%"]=hh}var mh=function e(t){var n;if(t==="%AsyncFunction%")n=Wi("async function () {}");else if(t==="%GeneratorFunction%")n=Wi("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=Wi("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=e("%AsyncGenerator%");s&&ke&&(n=ke(s.prototype))}return Ft[t]=n,n},As={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Hr=ua,Ln=lh,gh=Hr.call(Function.call,Array.prototype.concat),yh=Hr.call(Function.apply,Array.prototype.splice),Rs=Hr.call(Function.call,String.prototype.replace),Fn=Hr.call(Function.call,String.prototype.slice),vh=Hr.call(Function.call,RegExp.prototype.exec),_h=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Eh=/\\(\\)?/g,wh=function(t){var n=Fn(t,0,1),r=Fn(t,-1);if(n==="%"&&r!=="%")throw new zt("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new zt("invalid intrinsic syntax, expected opening `%`");var s=[];return Rs(t,_h,function(o,l,i,u){s[s.length]=i?Rs(u,Eh,"$1"):l||o}),s},bh=function(t,n){var r=t,s;if(Ln(As,r)&&(s=As[r],r="%"+s[0]+"%"),Ln(Ft,r)){var o=Ft[r];if(o===Ht&&(o=mh(r)),typeof o>"u"&&!n)throw new Qt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:r,value:o}}throw new zt("intrinsic "+t+" does not exist!")},la=function(t,n){if(typeof t!="string"||t.length===0)throw new Qt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Qt('"allowMissing" argument must be a boolean');if(vh(/^%?[^%]*%?$/,t)===null)throw new zt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=wh(t),s=r.length>0?r[0]:"",o=bh("%"+s+"%",n),l=o.name,i=o.value,u=!1,c=o.alias;c&&(s=c[0],yh(r,gh([0,1],c)));for(var a=1,d=!0;a<r.length;a+=1){var f=r[a],p=Fn(f,0,1),h=Fn(f,-1);if((p==='"'||p==="'"||p==="`"||h==='"'||h==="'"||h==="`")&&p!==h)throw new zt("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(u=!0),s+="."+f,l="%"+s+"%",Ln(Ft,l))i=Ft[l];else if(i!=null){if(!(f in i)){if(!n)throw new Qt("base intrinsic for "+t+" exists, but the property is not available.");return}if(Lt&&a+1>=r.length){var y=Lt(i,f);d=!!y,d&&"get"in y&&!("originalValue"in y.get)?i=y.get:i=i[f]}else d=Ln(i,f),i=i[f];d&&!u&&(Ft[l]=i)}}return i},Hu={exports:{}};(function(e){var t=ua,n=la,r=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),o=n("%Reflect.apply%",!0)||t.call(s,r),l=n("%Object.getOwnPropertyDescriptor%",!0),i=n("%Object.defineProperty%",!0),u=n("%Math.max%");if(i)try{i({},"a",{value:1})}catch{i=null}e.exports=function(d){var f=o(t,s,arguments);if(l&&i){var p=l(f,"length");p.configurable&&i(f,"length",{value:1+u(0,d.length-(arguments.length-1))})}return f};var c=function(){return o(t,r,arguments)};i?i(e.exports,"apply",{value:c}):e.exports.apply=c})(Hu);var Sh=Hu.exports,Wu=la,Gu=Sh,Oh=Gu(Wu("String.prototype.indexOf")),Th=function(t,n){var r=Wu(t,!!n);return typeof r=="function"&&Oh(t,".prototype.")>-1?Gu(r):r};const xh={},Ah=Object.freeze(Object.defineProperty({__proto__:null,default:xh},Symbol.toStringTag,{value:"Module"})),Rh=qr(Ah);var fa=typeof Map=="function"&&Map.prototype,Vi=Object.getOwnPropertyDescriptor&&fa?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,jn=fa&&Vi&&typeof Vi.get=="function"?Vi.get:null,Cs=fa&&Map.prototype.forEach,da=typeof Set=="function"&&Set.prototype,Qi=Object.getOwnPropertyDescriptor&&da?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Mn=da&&Qi&&typeof Qi.get=="function"?Qi.get:null,Ns=da&&Set.prototype.forEach,Ch=typeof WeakMap=="function"&&WeakMap.prototype,Fr=Ch?WeakMap.prototype.has:null,Nh=typeof WeakSet=="function"&&WeakSet.prototype,jr=Nh?WeakSet.prototype.has:null,Ph=typeof WeakRef=="function"&&WeakRef.prototype,Ps=Ph?WeakRef.prototype.deref:null,Ih=Boolean.prototype.valueOf,kh=Object.prototype.toString,Lh=Function.prototype.toString,Fh=String.prototype.match,pa=String.prototype.slice,St=String.prototype.replace,jh=String.prototype.toUpperCase,Is=String.prototype.toLowerCase,Vu=RegExp.prototype.test,ks=Array.prototype.concat,at=Array.prototype.join,Mh=Array.prototype.slice,Ls=Math.floor,Ho=typeof BigInt=="function"?BigInt.prototype.valueOf:null,zi=Object.getOwnPropertySymbols,Wo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Yt=typeof Symbol=="function"&&typeof Symbol.iterator=="object",We=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Yt||"symbol")?Symbol.toStringTag:null,Qu=Object.prototype.propertyIsEnumerable,Fs=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function js(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Vu.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-Ls(-e):Ls(e);if(r!==e){var s=String(r),o=pa.call(t,s.length+1);return St.call(s,n,"$&_")+"."+St.call(St.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return St.call(t,n,"$&_")}var Go=Rh,Ms=Go.custom,Ds=Yu(Ms)?Ms:null,Dh=function e(t,n,r,s){var o=n||{};if(bt(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(bt(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=bt(o,"customInspect")?o.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(bt(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(bt(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var i=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Ju(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var u=String(t);return i?js(t,u):u}if(typeof t=="bigint"){var c=String(t)+"n";return i?js(t,c):c}var a=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=a&&a>0&&typeof t=="object")return Vo(t)?"[Array]":"[Object]";var d=rm(o,r);if(typeof s>"u")s=[];else if(Ku(s,t)>=0)return"[Circular]";function f($,K,Q){if(K&&(s=Mh.call(s),s.push(K)),Q){var C={depth:o.depth};return bt(o,"quoteStyle")&&(C.quoteStyle=o.quoteStyle),e($,C,r+1,s)}return e($,o,r+1,s)}if(typeof t=="function"&&!Us(t)){var p=Qh(t),h=un(t,f);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(h.length>0?" { "+at.call(h,", ")+" }":"")}if(Yu(t)){var y=Yt?St.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Wo.call(t);return typeof t=="object"&&!Yt?cr(y):y}if(Zh(t)){for(var _="<"+Is.call(String(t.nodeName)),S=t.attributes||[],v=0;v<S.length;v++)_+=" "+S[v].name+"="+zu(Uh(S[v].value),"double",o);return _+=">",t.childNodes&&t.childNodes.length&&(_+="..."),_+="</"+Is.call(String(t.nodeName))+">",_}if(Vo(t)){if(t.length===0)return"[]";var w=un(t,f);return d&&!tm(w)?"["+Qo(w,d)+"]":"[ "+at.call(w,", ")+" ]"}if($h(t)){var x=un(t,f);return!("cause"in Error.prototype)&&"cause"in t&&!Qu.call(t,"cause")?"{ ["+String(t)+"] "+at.call(ks.call("[cause]: "+f(t.cause),x),", ")+" }":x.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+at.call(x,", ")+" }"}if(typeof t=="object"&&l){if(Ds&&typeof t[Ds]=="function"&&Go)return Go(t,{depth:a-r});if(l!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(zh(t)){var O=[];return Cs&&Cs.call(t,function($,K){O.push(f(K,t,!0)+" => "+f($,t))}),Bs("Map",jn.call(t),O,d)}if(Jh(t)){var F=[];return Ns&&Ns.call(t,function($){F.push(f($,t))}),Bs("Set",Mn.call(t),F,d)}if(Yh(t))return Yi("WeakMap");if(Xh(t))return Yi("WeakSet");if(Kh(t))return Yi("WeakRef");if(Hh(t))return cr(f(Number(t)));if(Gh(t))return cr(f(Ho.call(t)));if(Wh(t))return cr(Ih.call(t));if(qh(t))return cr(f(String(t)));if(!Bh(t)&&!Us(t)){var D=un(t,f),R=Fs?Fs(t)===Object.prototype:t instanceof Object||t.constructor===Object,W=t instanceof Object?"":"null prototype",V=!R&&We&&Object(t)===t&&We in t?pa.call(Tt(t),8,-1):W?"Object":"",L=R||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",U=L+(V||W?"["+at.call(ks.call([],V||[],W||[]),": ")+"] ":"");return D.length===0?U+"{}":d?U+"{"+Qo(D,d)+"}":U+"{ "+at.call(D,", ")+" }"}return String(t)};function zu(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function Uh(e){return St.call(String(e),/"/g,""")}function Vo(e){return Tt(e)==="[object Array]"&&(!We||!(typeof e=="object"&&We in e))}function Bh(e){return Tt(e)==="[object Date]"&&(!We||!(typeof e=="object"&&We in e))}function Us(e){return Tt(e)==="[object RegExp]"&&(!We||!(typeof e=="object"&&We in e))}function $h(e){return Tt(e)==="[object Error]"&&(!We||!(typeof e=="object"&&We in e))}function qh(e){return Tt(e)==="[object String]"&&(!We||!(typeof e=="object"&&We in e))}function Hh(e){return Tt(e)==="[object Number]"&&(!We||!(typeof e=="object"&&We in e))}function Wh(e){return Tt(e)==="[object Boolean]"&&(!We||!(typeof e=="object"&&We in e))}function Yu(e){if(Yt)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Wo)return!1;try{return Wo.call(e),!0}catch{}return!1}function Gh(e){if(!e||typeof e!="object"||!Ho)return!1;try{return Ho.call(e),!0}catch{}return!1}var Vh=Object.prototype.hasOwnProperty||function(e){return e in this};function bt(e,t){return Vh.call(e,t)}function Tt(e){return kh.call(e)}function Qh(e){if(e.name)return e.name;var t=Fh.call(Lh.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function Ku(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function zh(e){if(!jn||!e||typeof e!="object")return!1;try{jn.call(e);try{Mn.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function Yh(e){if(!Fr||!e||typeof e!="object")return!1;try{Fr.call(e,Fr);try{jr.call(e,jr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function Kh(e){if(!Ps||!e||typeof e!="object")return!1;try{return Ps.call(e),!0}catch{}return!1}function Jh(e){if(!Mn||!e||typeof e!="object")return!1;try{Mn.call(e);try{jn.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function Xh(e){if(!jr||!e||typeof e!="object")return!1;try{jr.call(e,jr);try{Fr.call(e,Fr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function Zh(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function Ju(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Ju(pa.call(e,0,t.maxStringLength),t)+r}var s=St.call(St.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,em);return zu(s,"single",t)}function em(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+jh.call(t.toString(16))}function cr(e){return"Object("+e+")"}function Yi(e){return e+" { ? }"}function Bs(e,t,n,r){var s=r?Qo(n,r):at.call(n,", ");return e+" ("+t+") {"+s+"}"}function tm(e){for(var t=0;t<e.length;t++)if(Ku(e[t],`
|
|
33
|
-
`)>=0)return!1;return!0}function
|
|
31
|
+
Check the top-level render call using <`+J+">.")}return z}}function en(A,z){{if(!A._store||A._store.validated||A.key!=null)return;A._store.validated=!0;var J=ei(z);if(Zr[J])return;Zr[J]=!0;var se="";A&&A._owner&&A._owner!==rr.current&&(se=" It was passed a child from "+$(A._owner.type)+"."),Et(A),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',J,se),Et(null)}}function tn(A,z){{if(typeof A!="object")return;if(De(A))for(var J=0;J<A.length;J++){var se=A[J];ir(se)&&en(se,z)}else if(ir(A))A._store&&(A._store.validated=!0);else if(A){var me=_(A);if(typeof me=="function"&&me!==A.entries)for(var ve=me.call(A),de;!(de=ve.next()).done;)ir(de.value)&&en(de.value,z)}}}function ti(A){{var z=A.type;if(z==null||typeof z=="string")return;var J;if(typeof z=="function")J=z.propTypes;else if(typeof z=="object"&&(z.$$typeof===u||z.$$typeof===d))J=z.propTypes;else return;if(J){var se=$(z);Mt(J,A.props,"prop",se,A)}else if(z.PropTypes!==void 0&&!nr){nr=!0;var me=$(z);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",me||"Unknown")}typeof z.getDefaultProps=="function"&&!z.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ri(A){{for(var z=Object.keys(A.props),J=0;J<z.length;J++){var se=z[J];if(se!=="children"&&se!=="key"){Et(A),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",se),Et(null);break}}A.ref!==null&&(Et(A),v("Invalid attribute `ref` supplied to `React.Fragment`."),Et(null))}}function rn(A,z,J,se,me,ve){{var de=Q(A);if(!de){var fe="";(A===void 0||typeof A=="object"&&A!==null&&Object.keys(A).length===0)&&(fe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ue=Zn(me);Ue?fe+=Ue:fe+=Xr();var Ce;A===null?Ce="null":De(A)?Ce="array":A!==void 0&&A.$$typeof===t?(Ce="<"+($(A.type)||"Unknown")+" />",fe=" Did you accidentally export a JSX literal instead of a component?"):Ce=typeof A,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ce,fe)}var Re=ge(A,z,J,me,ve);if(Re==null)return Re;if(de){var ze=z.children;if(ze!==void 0)if(se)if(De(ze)){for(var wt=0;wt<ze.length;wt++)tn(ze[wt],A);Object.freeze&&Object.freeze(ze)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else tn(ze,A)}return A===r?ri(Re):ti(Re),Re}}function ni(A,z,J){return rn(A,z,J,!0)}function ii(A,z,J){return rn(A,z,J,!1)}var oi=ii,nn=ni;sr.Fragment=r,sr.jsx=oi,sr.jsxs=nn}()),sr}process.env.NODE_ENV==="production"?qo.exports=wp():qo.exports=bp();var E=qo.exports;const Cu=()=>{const[e,t]=j.useState(window.location.pathname),n=()=>{const r=window.location.pathname;t(r)};return j.useEffect(()=>(window.addEventListener("popstate",n),()=>{window.removeEventListener("popstate",n)}),[]),e},jt=(e,t)=>{const n=j.useRef(!1);j.useEffect(()=>{n.current?e():n.current=!0},t)};var Nu={exports:{}},li={exports:{}},sn={},cn={exports:{}},fi,Ga;function Pu(){return Ga||(Ga=1,fi=function(t,n){return function(){for(var s=new Array(arguments.length),o=0;o<s.length;o++)s[o]=arguments[o];return t.apply(n,s)}}),fi}var di,Va;function $e(){if(Va)return di;Va=1;var e=Pu(),t=Object.prototype.toString,n=function(C){return function(q){var Y=t.call(q);return C[Y]||(C[Y]=Y.slice(8,-1).toLowerCase())}}(Object.create(null));function r(C){return C=C.toLowerCase(),function(Y){return n(Y)===C}}function s(C){return Array.isArray(C)}function o(C){return typeof C>"u"}function l(C){return C!==null&&!o(C)&&C.constructor!==null&&!o(C.constructor)&&typeof C.constructor.isBuffer=="function"&&C.constructor.isBuffer(C)}var i=r("ArrayBuffer");function u(C){var q;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?q=ArrayBuffer.isView(C):q=C&&C.buffer&&i(C.buffer),q}function c(C){return typeof C=="string"}function a(C){return typeof C=="number"}function d(C){return C!==null&&typeof C=="object"}function f(C){if(n(C)!=="object")return!1;var q=Object.getPrototypeOf(C);return q===null||q===Object.prototype}var p=r("Date"),h=r("File"),y=r("Blob"),_=r("FileList");function S(C){return t.call(C)==="[object Function]"}function v(C){return d(C)&&S(C.pipe)}function w(C){var q="[object FormData]";return C&&(typeof FormData=="function"&&C instanceof FormData||t.call(C)===q||S(C.toString)&&C.toString()===q)}var x=r("URLSearchParams");function O(C){return C.trim?C.trim():C.replace(/^\s+|\s+$/g,"")}function F(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function D(C,q){if(!(C===null||typeof C>"u"))if(typeof C!="object"&&(C=[C]),s(C))for(var Y=0,oe=C.length;Y<oe;Y++)q.call(null,C[Y],Y,C);else for(var re in C)Object.prototype.hasOwnProperty.call(C,re)&&q.call(null,C[re],re,C)}function R(){var C={};function q(re,G){f(C[G])&&f(re)?C[G]=R(C[G],re):f(re)?C[G]=R({},re):s(re)?C[G]=re.slice():C[G]=re}for(var Y=0,oe=arguments.length;Y<oe;Y++)D(arguments[Y],q);return C}function W(C,q,Y){return D(q,function(re,G){Y&&typeof re=="function"?C[G]=e(re,Y):C[G]=re}),C}function Q(C){return C.charCodeAt(0)===65279&&(C=C.slice(1)),C}function k(C,q,Y,oe){C.prototype=Object.create(q.prototype,oe),C.prototype.constructor=C,Y&&Object.assign(C.prototype,Y)}function U(C,q,Y){var oe,re,G,ie={};q=q||{};do{for(oe=Object.getOwnPropertyNames(C),re=oe.length;re-- >0;)G=oe[re],ie[G]||(q[G]=C[G],ie[G]=!0);C=Object.getPrototypeOf(C)}while(C&&(!Y||Y(C,q))&&C!==Object.prototype);return q}function $(C,q,Y){C=String(C),(Y===void 0||Y>C.length)&&(Y=C.length),Y-=q.length;var oe=C.indexOf(q,Y);return oe!==-1&&oe===Y}function K(C){if(!C)return null;var q=C.length;if(o(q))return null;for(var Y=new Array(q);q-- >0;)Y[q]=C[q];return Y}var V=function(C){return function(q){return C&&q instanceof C}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));return di={isArray:s,isArrayBuffer:i,isBuffer:l,isFormData:w,isArrayBufferView:u,isString:c,isNumber:a,isObject:d,isPlainObject:f,isUndefined:o,isDate:p,isFile:h,isBlob:y,isFunction:S,isStream:v,isURLSearchParams:x,isStandardBrowserEnv:F,forEach:D,merge:R,extend:W,trim:O,stripBOM:Q,inherits:k,toFlatObject:U,kindOf:n,kindOfTest:r,endsWith:$,toArray:K,isTypedArray:V,isFileList:_},di}var pi,Qa;function Iu(){if(Qa)return pi;Qa=1;var e=$e();function t(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}return pi=function(r,s,o){if(!s)return r;var l;if(o)l=o(s);else if(e.isURLSearchParams(s))l=s.toString();else{var i=[];e.forEach(s,function(a,d){a===null||typeof a>"u"||(e.isArray(a)?d=d+"[]":a=[a],e.forEach(a,function(p){e.isDate(p)?p=p.toISOString():e.isObject(p)&&(p=JSON.stringify(p)),i.push(t(d)+"="+t(p))}))}),l=i.join("&")}if(l){var u=r.indexOf("#");u!==-1&&(r=r.slice(0,u)),r+=(r.indexOf("?")===-1?"?":"&")+l}return r},pi}var hi,za;function Sp(){if(za)return hi;za=1;var e=$e();function t(){this.handlers=[]}return t.prototype.use=function(r,s,o){return this.handlers.push({fulfilled:r,rejected:s,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1},t.prototype.eject=function(r){this.handlers[r]&&(this.handlers[r]=null)},t.prototype.forEach=function(r){e.forEach(this.handlers,function(o){o!==null&&r(o)})},hi=t,hi}var mi,Ya;function Op(){if(Ya)return mi;Ya=1;var e=$e();return mi=function(n,r){e.forEach(n,function(o,l){l!==r&&l.toUpperCase()===r.toUpperCase()&&(n[r]=o,delete n[l])})},mi}var gi,Ka;function Xt(){if(Ka)return gi;Ka=1;var e=$e();function t(s,o,l,i,u){Error.call(this),this.message=s,this.name="AxiosError",o&&(this.code=o),l&&(this.config=l),i&&(this.request=i),u&&(this.response=u)}e.inherits(t,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var n=t.prototype,r={};return["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(s){r[s]={value:s}}),Object.defineProperties(t,r),Object.defineProperty(n,"isAxiosError",{value:!0}),t.from=function(s,o,l,i,u,c){var a=Object.create(n);return e.toFlatObject(s,a,function(f){return f!==Error.prototype}),t.call(a,s.message,o,l,i,u),a.name=s.name,c&&Object.assign(a,c),a},gi=t,gi}var yi,Ja;function ku(){return Ja||(Ja=1,yi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}),yi}var vi,Xa;function Lu(){if(Xa)return vi;Xa=1;var e=$e();function t(n,r){r=r||new FormData;var s=[];function o(i){return i===null?"":e.isDate(i)?i.toISOString():e.isArrayBuffer(i)||e.isTypedArray(i)?typeof Blob=="function"?new Blob([i]):Buffer.from(i):i}function l(i,u){if(e.isPlainObject(i)||e.isArray(i)){if(s.indexOf(i)!==-1)throw Error("Circular reference detected in "+u);s.push(i),e.forEach(i,function(a,d){if(!e.isUndefined(a)){var f=u?u+"."+d:d,p;if(a&&!u&&typeof a=="object"){if(e.endsWith(d,"{}"))a=JSON.stringify(a);else if(e.endsWith(d,"[]")&&(p=e.toArray(a))){p.forEach(function(h){!e.isUndefined(h)&&r.append(f,o(h))});return}}l(a,f)}}),s.pop()}else r.append(u,o(i))}return l(n),r}return vi=t,vi}var _i,Za;function Tp(){if(Za)return _i;Za=1;var e=Xt();return _i=function(n,r,s){var o=s.config.validateStatus;!s.status||!o||o(s.status)?n(s):r(new e("Request failed with status code "+s.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))},_i}var Ei,es;function xp(){if(es)return Ei;es=1;var e=$e();return Ei=e.isStandardBrowserEnv()?function(){return{write:function(r,s,o,l,i,u){var c=[];c.push(r+"="+encodeURIComponent(s)),e.isNumber(o)&&c.push("expires="+new Date(o).toGMTString()),e.isString(l)&&c.push("path="+l),e.isString(i)&&c.push("domain="+i),u===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(r){var s=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Ei}var wi,ts;function Ap(){return ts||(ts=1,wi=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}),wi}var bi,rs;function Rp(){return rs||(rs=1,bi=function(t,n){return n?t.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):t}),bi}var Si,ns;function Fu(){if(ns)return Si;ns=1;var e=Ap(),t=Rp();return Si=function(r,s){return r&&!e(s)?t(r,s):s},Si}var Oi,is;function Cp(){if(is)return Oi;is=1;var e=$e(),t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Oi=function(r){var s={},o,l,i;return r&&e.forEach(r.split(`
|
|
32
|
+
`),function(c){if(i=c.indexOf(":"),o=e.trim(c.substr(0,i)).toLowerCase(),l=e.trim(c.substr(i+1)),o){if(s[o]&&t.indexOf(o)>=0)return;o==="set-cookie"?s[o]=(s[o]?s[o]:[]).concat([l]):s[o]=s[o]?s[o]+", "+l:l}}),s},Oi}var Ti,os;function Np(){if(os)return Ti;os=1;var e=$e();return Ti=e.isStandardBrowserEnv()?function(){var n=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),s;function o(l){var i=l;return n&&(r.setAttribute("href",i),i=r.href),r.setAttribute("href",i),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return s=o(window.location.href),function(i){var u=e.isString(i)?o(i):i;return u.protocol===s.protocol&&u.host===s.host}}():function(){return function(){return!0}}(),Ti}var xi,as;function Gn(){if(as)return xi;as=1;var e=Xt(),t=$e();function n(r){e.call(this,r??"canceled",e.ERR_CANCELED),this.name="CanceledError"}return t.inherits(n,e,{__CANCEL__:!0}),xi=n,xi}var Ai,ss;function Pp(){return ss||(ss=1,Ai=function(t){var n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}),Ai}var Ri,cs;function us(){if(cs)return Ri;cs=1;var e=$e(),t=Tp(),n=xp(),r=Iu(),s=Fu(),o=Cp(),l=Np(),i=ku(),u=Xt(),c=Gn(),a=Pp();return Ri=function(f){return new Promise(function(h,y){var _=f.data,S=f.headers,v=f.responseType,w;function x(){f.cancelToken&&f.cancelToken.unsubscribe(w),f.signal&&f.signal.removeEventListener("abort",w)}e.isFormData(_)&&e.isStandardBrowserEnv()&&delete S["Content-Type"];var O=new XMLHttpRequest;if(f.auth){var F=f.auth.username||"",D=f.auth.password?unescape(encodeURIComponent(f.auth.password)):"";S.Authorization="Basic "+btoa(F+":"+D)}var R=s(f.baseURL,f.url);O.open(f.method.toUpperCase(),r(R,f.params,f.paramsSerializer),!0),O.timeout=f.timeout;function W(){if(O){var U="getAllResponseHeaders"in O?o(O.getAllResponseHeaders()):null,$=!v||v==="text"||v==="json"?O.responseText:O.response,K={data:$,status:O.status,statusText:O.statusText,headers:U,config:f,request:O};t(function(C){h(C),x()},function(C){y(C),x()},K),O=null}}if("onloadend"in O?O.onloadend=W:O.onreadystatechange=function(){!O||O.readyState!==4||O.status===0&&!(O.responseURL&&O.responseURL.indexOf("file:")===0)||setTimeout(W)},O.onabort=function(){O&&(y(new u("Request aborted",u.ECONNABORTED,f,O)),O=null)},O.onerror=function(){y(new u("Network Error",u.ERR_NETWORK,f,O,O)),O=null},O.ontimeout=function(){var $=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded",K=f.transitional||i;f.timeoutErrorMessage&&($=f.timeoutErrorMessage),y(new u($,K.clarifyTimeoutError?u.ETIMEDOUT:u.ECONNABORTED,f,O)),O=null},e.isStandardBrowserEnv()){var Q=(f.withCredentials||l(R))&&f.xsrfCookieName?n.read(f.xsrfCookieName):void 0;Q&&(S[f.xsrfHeaderName]=Q)}"setRequestHeader"in O&&e.forEach(S,function($,K){typeof _>"u"&&K.toLowerCase()==="content-type"?delete S[K]:O.setRequestHeader(K,$)}),e.isUndefined(f.withCredentials)||(O.withCredentials=!!f.withCredentials),v&&v!=="json"&&(O.responseType=f.responseType),typeof f.onDownloadProgress=="function"&&O.addEventListener("progress",f.onDownloadProgress),typeof f.onUploadProgress=="function"&&O.upload&&O.upload.addEventListener("progress",f.onUploadProgress),(f.cancelToken||f.signal)&&(w=function(U){O&&(y(!U||U&&U.type?new c:U),O.abort(),O=null)},f.cancelToken&&f.cancelToken.subscribe(w),f.signal&&(f.signal.aborted?w():f.signal.addEventListener("abort",w))),_||(_=null);var k=a(R);if(k&&["http","https","file"].indexOf(k)===-1){y(new u("Unsupported protocol "+k+":",u.ERR_BAD_REQUEST,f));return}O.send(_)})},Ri}var Ci,ls;function Ip(){return ls||(ls=1,Ci=null),Ci}var Ni,fs;function sa(){if(fs)return Ni;fs=1;var e=$e(),t=Op(),n=Xt(),r=ku(),s=Lu(),o={"Content-Type":"application/x-www-form-urlencoded"};function l(a,d){!e.isUndefined(a)&&e.isUndefined(a["Content-Type"])&&(a["Content-Type"]=d)}function i(){var a;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(a=us()),a}function u(a,d,f){if(e.isString(a))try{return(d||JSON.parse)(a),e.trim(a)}catch(p){if(p.name!=="SyntaxError")throw p}return(f||JSON.stringify)(a)}var c={transitional:r,adapter:i(),transformRequest:[function(d,f){if(t(f,"Accept"),t(f,"Content-Type"),e.isFormData(d)||e.isArrayBuffer(d)||e.isBuffer(d)||e.isStream(d)||e.isFile(d)||e.isBlob(d))return d;if(e.isArrayBufferView(d))return d.buffer;if(e.isURLSearchParams(d))return l(f,"application/x-www-form-urlencoded;charset=utf-8"),d.toString();var p=e.isObject(d),h=f&&f["Content-Type"],y;if((y=e.isFileList(d))||p&&h==="multipart/form-data"){var _=this.env&&this.env.FormData;return s(y?{"files[]":d}:d,_&&new _)}else if(p||h==="application/json")return l(f,"application/json"),u(d);return d}],transformResponse:[function(d){var f=this.transitional||c.transitional,p=f&&f.silentJSONParsing,h=f&&f.forcedJSONParsing,y=!p&&this.responseType==="json";if(y||h&&e.isString(d)&&d.length)try{return JSON.parse(d)}catch(_){if(y)throw _.name==="SyntaxError"?n.from(_,n.ERR_BAD_RESPONSE,this,null,this.response):_}return d}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ip()},validateStatus:function(d){return d>=200&&d<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return e.forEach(["delete","get","head"],function(d){c.headers[d]={}}),e.forEach(["post","put","patch"],function(d){c.headers[d]=e.merge(o)}),Ni=c,Ni}var Pi,ds;function kp(){if(ds)return Pi;ds=1;var e=$e(),t=sa();return Pi=function(r,s,o){var l=this||t;return e.forEach(o,function(u){r=u.call(l,r,s)}),r},Pi}var Ii,ps;function ju(){return ps||(ps=1,Ii=function(t){return!!(t&&t.__CANCEL__)}),Ii}var ki,hs;function Lp(){if(hs)return ki;hs=1;var e=$e(),t=kp(),n=ju(),r=sa(),s=Gn();function o(l){if(l.cancelToken&&l.cancelToken.throwIfRequested(),l.signal&&l.signal.aborted)throw new s}return ki=function(i){o(i),i.headers=i.headers||{},i.data=t.call(i,i.data,i.headers,i.transformRequest),i.headers=e.merge(i.headers.common||{},i.headers[i.method]||{},i.headers),e.forEach(["delete","get","head","post","put","patch","common"],function(a){delete i.headers[a]});var u=i.adapter||r.adapter;return u(i).then(function(a){return o(i),a.data=t.call(i,a.data,a.headers,i.transformResponse),a},function(a){return n(a)||(o(i),a&&a.response&&(a.response.data=t.call(i,a.response.data,a.response.headers,i.transformResponse))),Promise.reject(a)})},ki}var Li,ms;function Mu(){if(ms)return Li;ms=1;var e=$e();return Li=function(n,r){r=r||{};var s={};function o(d,f){return e.isPlainObject(d)&&e.isPlainObject(f)?e.merge(d,f):e.isPlainObject(f)?e.merge({},f):e.isArray(f)?f.slice():f}function l(d){if(e.isUndefined(r[d])){if(!e.isUndefined(n[d]))return o(void 0,n[d])}else return o(n[d],r[d])}function i(d){if(!e.isUndefined(r[d]))return o(void 0,r[d])}function u(d){if(e.isUndefined(r[d])){if(!e.isUndefined(n[d]))return o(void 0,n[d])}else return o(void 0,r[d])}function c(d){if(d in r)return o(n[d],r[d]);if(d in n)return o(void 0,n[d])}var a={url:i,method:i,data:i,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:c};return e.forEach(Object.keys(n).concat(Object.keys(r)),function(f){var p=a[f]||l,h=p(f);e.isUndefined(h)&&p!==c||(s[f]=h)}),s},Li}var Fi,gs;function Du(){return gs||(gs=1,Fi={version:"0.27.2"}),Fi}var ji,ys;function Fp(){if(ys)return ji;ys=1;var e=Du().version,t=Xt(),n={};["object","boolean","number","function","string","symbol"].forEach(function(o,l){n[o]=function(u){return typeof u===o||"a"+(l<1?"n ":" ")+o}});var r={};n.transitional=function(l,i,u){function c(a,d){return"[Axios v"+e+"] Transitional option '"+a+"'"+d+(u?". "+u:"")}return function(a,d,f){if(l===!1)throw new t(c(d," has been removed"+(i?" in "+i:"")),t.ERR_DEPRECATED);return i&&!r[d]&&(r[d]=!0,console.warn(c(d," has been deprecated since v"+i+" and will be removed in the near future"))),l?l(a,d,f):!0}};function s(o,l,i){if(typeof o!="object")throw new t("options must be an object",t.ERR_BAD_OPTION_VALUE);for(var u=Object.keys(o),c=u.length;c-- >0;){var a=u[c],d=l[a];if(d){var f=o[a],p=f===void 0||d(f,a,o);if(p!==!0)throw new t("option "+a+" must be "+p,t.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new t("Unknown option "+a,t.ERR_BAD_OPTION)}}return ji={assertOptions:s,validators:n},ji}var Mi,vs;function jp(){if(vs)return Mi;vs=1;var e=$e(),t=Iu(),n=Sp(),r=Lp(),s=Mu(),o=Fu(),l=Fp(),i=l.validators;function u(c){this.defaults=c,this.interceptors={request:new n,response:new n}}return u.prototype.request=function(a,d){typeof a=="string"?(d=d||{},d.url=a):d=a||{},d=s(this.defaults,d),d.method?d.method=d.method.toLowerCase():this.defaults.method?d.method=this.defaults.method.toLowerCase():d.method="get";var f=d.transitional;f!==void 0&&l.assertOptions(f,{silentJSONParsing:i.transitional(i.boolean),forcedJSONParsing:i.transitional(i.boolean),clarifyTimeoutError:i.transitional(i.boolean)},!1);var p=[],h=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(d)===!1||(h=h&&F.synchronous,p.unshift(F.fulfilled,F.rejected))});var y=[];this.interceptors.response.forEach(function(F){y.push(F.fulfilled,F.rejected)});var _;if(!h){var S=[r,void 0];for(Array.prototype.unshift.apply(S,p),S=S.concat(y),_=Promise.resolve(d);S.length;)_=_.then(S.shift(),S.shift());return _}for(var v=d;p.length;){var w=p.shift(),x=p.shift();try{v=w(v)}catch(O){x(O);break}}try{_=r(v)}catch(O){return Promise.reject(O)}for(;y.length;)_=_.then(y.shift(),y.shift());return _},u.prototype.getUri=function(a){a=s(this.defaults,a);var d=o(a.baseURL,a.url);return t(d,a.params,a.paramsSerializer)},e.forEach(["delete","get","head","options"],function(a){u.prototype[a]=function(d,f){return this.request(s(f||{},{method:a,url:d,data:(f||{}).data}))}}),e.forEach(["post","put","patch"],function(a){function d(f){return function(h,y,_){return this.request(s(_||{},{method:a,headers:f?{"Content-Type":"multipart/form-data"}:{},url:h,data:y}))}}u.prototype[a]=d(),u.prototype[a+"Form"]=d(!0)}),Mi=u,Mi}var Di,_s;function Mp(){if(_s)return Di;_s=1;var e=Gn();function t(n){if(typeof n!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(l){r=l});var s=this;this.promise.then(function(o){if(s._listeners){var l,i=s._listeners.length;for(l=0;l<i;l++)s._listeners[l](o);s._listeners=null}}),this.promise.then=function(o){var l,i=new Promise(function(u){s.subscribe(u),l=u}).then(o);return i.cancel=function(){s.unsubscribe(l)},i},n(function(l){s.reason||(s.reason=new e(l),r(s.reason))})}return t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t.prototype.subscribe=function(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]},t.prototype.unsubscribe=function(r){if(this._listeners){var s=this._listeners.indexOf(r);s!==-1&&this._listeners.splice(s,1)}},t.source=function(){var r,s=new t(function(l){r=l});return{token:s,cancel:r}},Di=t,Di}var Ui,Es;function Dp(){return Es||(Es=1,Ui=function(t){return function(r){return t.apply(null,r)}}),Ui}var Bi,ws;function Up(){if(ws)return Bi;ws=1;var e=$e();return Bi=function(n){return e.isObject(n)&&n.isAxiosError===!0},Bi}var bs;function Bp(){if(bs)return cn.exports;bs=1;var e=$e(),t=Pu(),n=jp(),r=Mu(),s=sa();function o(i){var u=new n(i),c=t(n.prototype.request,u);return e.extend(c,n.prototype,u),e.extend(c,u),c.create=function(d){return o(r(i,d))},c}var l=o(s);return l.Axios=n,l.CanceledError=Gn(),l.CancelToken=Mp(),l.isCancel=ju(),l.VERSION=Du().version,l.toFormData=Lu(),l.AxiosError=Xt(),l.Cancel=l.CanceledError,l.all=function(u){return Promise.all(u)},l.spread=Dp(),l.isAxiosError=Up(),cn.exports=l,cn.exports.default=l,cn.exports}var $i,Ss;function Uu(){return Ss||(Ss=1,$i=Bp()),$i}var $p=Function.prototype.toString,qi=Object.create,qp=Object.defineProperty,Hp=Object.getOwnPropertyDescriptor,Os=Object.getOwnPropertyNames,ca=Object.getOwnPropertySymbols,Wp=Object.getPrototypeOf,Bu=Object.prototype,Gp=Bu.hasOwnProperty,Vp=Bu.propertyIsEnumerable,$u=typeof ca=="function",Qp=typeof WeakMap=="function",zp=function(){if(Qp)return function(){return new WeakMap};var e=function(){function t(){this._keys=[],this._values=[]}return t.prototype.has=function(n){return!!~this._keys.indexOf(n)},t.prototype.get=function(n){return this._values[this._keys.indexOf(n)]},t.prototype.set=function(n,r){this._keys.push(n),this._values.push(r)},t}();return function(){return new e}}(),qu=function(e,t){var n=e.__proto__||Wp(e);if(!n)return qi(null);var r=n.constructor;if(r===t.Object)return n===t.Object.prototype?{}:qi(n);if(~$p.call(r).indexOf("[native code]"))try{return new r}catch{}return qi(n)},Yp=function(e,t,n,r){var s=qu(e,t);r.set(e,s);for(var o in e)Gp.call(e,o)&&(s[o]=n(e[o],r));if($u)for(var l=ca(e),i=0,u=l.length,c=void 0;i<u;++i)c=l[i],Vp.call(e,c)&&(s[c]=n(e[c],r));return s},Ts=function(e,t,n,r){var s=qu(e,t);r.set(e,s);for(var o=$u?Os(e).concat(ca(e)):Os(e),l=0,i=o.length,u=void 0,c=void 0;l<i;++l)if(u=o[l],u!=="callee"&&u!=="caller")if(c=Hp(e,u),c){!c.get&&!c.set&&(c.value=n(e[u],r));try{qp(s,u,c)}catch{s[u]=c.value}}else s[u]=n(e[u],r);return s},Kp=function(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Jp=Array.isArray,Xp=Object.getPrototypeOf,Zp=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:(console&&console.error&&console.error('Unable to locate global object, returning "this".'),this)}();function Ot(e,t){var n=!!(t&&t.isStrict),r=t&&t.realm||Zp,s=n?Ts:Yp,o=function(l,i){if(!l||typeof l!="object")return l;if(i.has(l))return i.get(l);var u=l.__proto__||Xp(l),c=u&&u.constructor;if(!c||c===r.Object)return s(l,r,o,i);var a;if(Jp(l)){if(n)return Ts(l,r,o,i);a=new c,i.set(l,a);for(var d=0,f=l.length;d<f;++d)a[d]=o(l[d],i);return a}if(l instanceof r.Date)return new c(l.getTime());if(l instanceof r.RegExp)return a=new c(l.source,l.flags||Kp(l)),a.lastIndex=l.lastIndex,a;if(r.Map&&l instanceof r.Map)return a=new c,i.set(l,a),l.forEach(function(p,h){a.set(h,o(p,i))}),a;if(r.Set&&l instanceof r.Set)return a=new c,i.set(l,a),l.forEach(function(p){a.add(o(p,i))}),a;if(r.Blob&&l instanceof r.Blob)return l.slice(0,l.size,l.type);if(r.Buffer&&r.Buffer.isBuffer(l))return a=r.Buffer.allocUnsafe?r.Buffer.allocUnsafe(l.length):new c(l.length),i.set(l,a),l.copy(a),a;if(r.ArrayBuffer){if(r.ArrayBuffer.isView(l))return a=new c(l.buffer.slice(0)),i.set(l,a),a;if(l instanceof r.ArrayBuffer)return a=l.slice(0),i.set(l,a),a}return typeof l.then=="function"||l instanceof Error||r.WeakMap&&l instanceof r.WeakMap||r.WeakSet&&l instanceof r.WeakSet?l:s(l,r,o,i)};return o(e,zp())}Ot.default=Ot;Ot.strict=function(t,n){return Ot(t,{isStrict:!0,realm:n?n.realm:void 0})};var eh=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var s=42;t[n]=s;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,n);if(l.value!==s||l.enumerable!==!0)return!1}return!0},xs=typeof Symbol<"u"&&Symbol,th=eh,rh=function(){return typeof xs!="function"||typeof Symbol!="function"||typeof xs("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:th()},As={foo:{}},nh=Object,ih=function(){return{__proto__:As}.foo===As.foo&&!({__proto__:null}instanceof nh)},oh="Function.prototype.bind called on incompatible ",Hi=Array.prototype.slice,ah=Object.prototype.toString,sh="[object Function]",ch=function(t){var n=this;if(typeof n!="function"||ah.call(n)!==sh)throw new TypeError(oh+n);for(var r=Hi.call(arguments,1),s,o=function(){if(this instanceof s){var a=n.apply(this,r.concat(Hi.call(arguments)));return Object(a)===a?a:this}else return n.apply(t,r.concat(Hi.call(arguments)))},l=Math.max(0,n.length-r.length),i=[],u=0;u<l;u++)i.push("$"+u);if(s=Function("binder","return function ("+i.join(",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var c=function(){};c.prototype=n.prototype,s.prototype=new c,c.prototype=null}return s},uh=ch,ua=Function.prototype.bind||uh,lh=ua,fh=lh.call(Function.call,Object.prototype.hasOwnProperty),pe,zt=SyntaxError,Hu=Function,Qt=TypeError,Wi=function(e){try{return Hu('"use strict"; return ('+e+").constructor;")()}catch{}},Lt=Object.getOwnPropertyDescriptor;if(Lt)try{Lt({},"")}catch{Lt=null}var Gi=function(){throw new Qt},dh=Lt?function(){try{return arguments.callee,Gi}catch{try{return Lt(arguments,"callee").get}catch{return Gi}}}():Gi,$t=rh(),ph=ih(),Le=Object.getPrototypeOf||(ph?function(e){return e.__proto__}:null),Ht={},hh=typeof Uint8Array>"u"||!Le?pe:Le(Uint8Array),Ft={"%AggregateError%":typeof AggregateError>"u"?pe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?pe:ArrayBuffer,"%ArrayIteratorPrototype%":$t&&Le?Le([][Symbol.iterator]()):pe,"%AsyncFromSyncIteratorPrototype%":pe,"%AsyncFunction%":Ht,"%AsyncGenerator%":Ht,"%AsyncGeneratorFunction%":Ht,"%AsyncIteratorPrototype%":Ht,"%Atomics%":typeof Atomics>"u"?pe:Atomics,"%BigInt%":typeof BigInt>"u"?pe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?pe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?pe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?pe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?pe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?pe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?pe:FinalizationRegistry,"%Function%":Hu,"%GeneratorFunction%":Ht,"%Int8Array%":typeof Int8Array>"u"?pe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?pe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?pe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":$t&&Le?Le(Le([][Symbol.iterator]())):pe,"%JSON%":typeof JSON=="object"?JSON:pe,"%Map%":typeof Map>"u"?pe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!$t||!Le?pe:Le(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?pe:Promise,"%Proxy%":typeof Proxy>"u"?pe:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?pe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?pe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!$t||!Le?pe:Le(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?pe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":$t&&Le?Le(""[Symbol.iterator]()):pe,"%Symbol%":$t?Symbol:pe,"%SyntaxError%":zt,"%ThrowTypeError%":dh,"%TypedArray%":hh,"%TypeError%":Qt,"%Uint8Array%":typeof Uint8Array>"u"?pe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?pe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?pe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?pe:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?pe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?pe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?pe:WeakSet};if(Le)try{null.error}catch(e){var mh=Le(Le(e));Ft["%Error.prototype%"]=mh}var gh=function e(t){var n;if(t==="%AsyncFunction%")n=Wi("async function () {}");else if(t==="%GeneratorFunction%")n=Wi("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=Wi("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=e("%AsyncGenerator%");s&&Le&&(n=Le(s.prototype))}return Ft[t]=n,n},Rs={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Hr=ua,Ln=fh,yh=Hr.call(Function.call,Array.prototype.concat),vh=Hr.call(Function.apply,Array.prototype.splice),Cs=Hr.call(Function.call,String.prototype.replace),Fn=Hr.call(Function.call,String.prototype.slice),_h=Hr.call(Function.call,RegExp.prototype.exec),Eh=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,wh=/\\(\\)?/g,bh=function(t){var n=Fn(t,0,1),r=Fn(t,-1);if(n==="%"&&r!=="%")throw new zt("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new zt("invalid intrinsic syntax, expected opening `%`");var s=[];return Cs(t,Eh,function(o,l,i,u){s[s.length]=i?Cs(u,wh,"$1"):l||o}),s},Sh=function(t,n){var r=t,s;if(Ln(Rs,r)&&(s=Rs[r],r="%"+s[0]+"%"),Ln(Ft,r)){var o=Ft[r];if(o===Ht&&(o=gh(r)),typeof o>"u"&&!n)throw new Qt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:r,value:o}}throw new zt("intrinsic "+t+" does not exist!")},la=function(t,n){if(typeof t!="string"||t.length===0)throw new Qt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Qt('"allowMissing" argument must be a boolean');if(_h(/^%?[^%]*%?$/,t)===null)throw new zt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=bh(t),s=r.length>0?r[0]:"",o=Sh("%"+s+"%",n),l=o.name,i=o.value,u=!1,c=o.alias;c&&(s=c[0],vh(r,yh([0,1],c)));for(var a=1,d=!0;a<r.length;a+=1){var f=r[a],p=Fn(f,0,1),h=Fn(f,-1);if((p==='"'||p==="'"||p==="`"||h==='"'||h==="'"||h==="`")&&p!==h)throw new zt("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(u=!0),s+="."+f,l="%"+s+"%",Ln(Ft,l))i=Ft[l];else if(i!=null){if(!(f in i)){if(!n)throw new Qt("base intrinsic for "+t+" exists, but the property is not available.");return}if(Lt&&a+1>=r.length){var y=Lt(i,f);d=!!y,d&&"get"in y&&!("originalValue"in y.get)?i=y.get:i=i[f]}else d=Ln(i,f),i=i[f];d&&!u&&(Ft[l]=i)}}return i},Wu={exports:{}};(function(e){var t=ua,n=la,r=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),o=n("%Reflect.apply%",!0)||t.call(s,r),l=n("%Object.getOwnPropertyDescriptor%",!0),i=n("%Object.defineProperty%",!0),u=n("%Math.max%");if(i)try{i({},"a",{value:1})}catch{i=null}e.exports=function(d){var f=o(t,s,arguments);if(l&&i){var p=l(f,"length");p.configurable&&i(f,"length",{value:1+u(0,d.length-(arguments.length-1))})}return f};var c=function(){return o(t,r,arguments)};i?i(e.exports,"apply",{value:c}):e.exports.apply=c})(Wu);var Oh=Wu.exports,Gu=la,Vu=Oh,Th=Vu(Gu("String.prototype.indexOf")),xh=function(t,n){var r=Gu(t,!!n);return typeof r=="function"&&Th(t,".prototype.")>-1?Vu(r):r};const Ah={},Rh=Object.freeze(Object.defineProperty({__proto__:null,default:Ah},Symbol.toStringTag,{value:"Module"})),Ch=qr(Rh);var fa=typeof Map=="function"&&Map.prototype,Vi=Object.getOwnPropertyDescriptor&&fa?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,jn=fa&&Vi&&typeof Vi.get=="function"?Vi.get:null,Ns=fa&&Map.prototype.forEach,da=typeof Set=="function"&&Set.prototype,Qi=Object.getOwnPropertyDescriptor&&da?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Mn=da&&Qi&&typeof Qi.get=="function"?Qi.get:null,Ps=da&&Set.prototype.forEach,Nh=typeof WeakMap=="function"&&WeakMap.prototype,Fr=Nh?WeakMap.prototype.has:null,Ph=typeof WeakSet=="function"&&WeakSet.prototype,jr=Ph?WeakSet.prototype.has:null,Ih=typeof WeakRef=="function"&&WeakRef.prototype,Is=Ih?WeakRef.prototype.deref:null,kh=Boolean.prototype.valueOf,Lh=Object.prototype.toString,Fh=Function.prototype.toString,jh=String.prototype.match,pa=String.prototype.slice,St=String.prototype.replace,Mh=String.prototype.toUpperCase,ks=String.prototype.toLowerCase,Qu=RegExp.prototype.test,Ls=Array.prototype.concat,at=Array.prototype.join,Dh=Array.prototype.slice,Fs=Math.floor,Ho=typeof BigInt=="function"?BigInt.prototype.valueOf:null,zi=Object.getOwnPropertySymbols,Wo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Yt=typeof Symbol=="function"&&typeof Symbol.iterator=="object",We=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Yt||"symbol")?Symbol.toStringTag:null,zu=Object.prototype.propertyIsEnumerable,js=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Ms(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Qu.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-Fs(-e):Fs(e);if(r!==e){var s=String(r),o=pa.call(t,s.length+1);return St.call(s,n,"$&_")+"."+St.call(St.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return St.call(t,n,"$&_")}var Go=Ch,Ds=Go.custom,Us=Ku(Ds)?Ds:null,Uh=function e(t,n,r,s){var o=n||{};if(bt(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(bt(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=bt(o,"customInspect")?o.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(bt(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(bt(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var i=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Xu(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var u=String(t);return i?Ms(t,u):u}if(typeof t=="bigint"){var c=String(t)+"n";return i?Ms(t,c):c}var a=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=a&&a>0&&typeof t=="object")return Vo(t)?"[Array]":"[Object]";var d=nm(o,r);if(typeof s>"u")s=[];else if(Ju(s,t)>=0)return"[Circular]";function f($,K,V){if(K&&(s=Dh.call(s),s.push(K)),V){var C={depth:o.depth};return bt(o,"quoteStyle")&&(C.quoteStyle=o.quoteStyle),e($,C,r+1,s)}return e($,o,r+1,s)}if(typeof t=="function"&&!Bs(t)){var p=zh(t),h=un(t,f);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(h.length>0?" { "+at.call(h,", ")+" }":"")}if(Ku(t)){var y=Yt?St.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Wo.call(t);return typeof t=="object"&&!Yt?cr(y):y}if(em(t)){for(var _="<"+ks.call(String(t.nodeName)),S=t.attributes||[],v=0;v<S.length;v++)_+=" "+S[v].name+"="+Yu(Bh(S[v].value),"double",o);return _+=">",t.childNodes&&t.childNodes.length&&(_+="..."),_+="</"+ks.call(String(t.nodeName))+">",_}if(Vo(t)){if(t.length===0)return"[]";var w=un(t,f);return d&&!rm(w)?"["+Qo(w,d)+"]":"[ "+at.call(w,", ")+" ]"}if(qh(t)){var x=un(t,f);return!("cause"in Error.prototype)&&"cause"in t&&!zu.call(t,"cause")?"{ ["+String(t)+"] "+at.call(Ls.call("[cause]: "+f(t.cause),x),", ")+" }":x.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+at.call(x,", ")+" }"}if(typeof t=="object"&&l){if(Us&&typeof t[Us]=="function"&&Go)return Go(t,{depth:a-r});if(l!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(Yh(t)){var O=[];return Ns&&Ns.call(t,function($,K){O.push(f(K,t,!0)+" => "+f($,t))}),$s("Map",jn.call(t),O,d)}if(Xh(t)){var F=[];return Ps&&Ps.call(t,function($){F.push(f($,t))}),$s("Set",Mn.call(t),F,d)}if(Kh(t))return Yi("WeakMap");if(Zh(t))return Yi("WeakSet");if(Jh(t))return Yi("WeakRef");if(Wh(t))return cr(f(Number(t)));if(Vh(t))return cr(f(Ho.call(t)));if(Gh(t))return cr(kh.call(t));if(Hh(t))return cr(f(String(t)));if(!$h(t)&&!Bs(t)){var D=un(t,f),R=js?js(t)===Object.prototype:t instanceof Object||t.constructor===Object,W=t instanceof Object?"":"null prototype",Q=!R&&We&&Object(t)===t&&We in t?pa.call(Tt(t),8,-1):W?"Object":"",k=R||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",U=k+(Q||W?"["+at.call(Ls.call([],Q||[],W||[]),": ")+"] ":"");return D.length===0?U+"{}":d?U+"{"+Qo(D,d)+"}":U+"{ "+at.call(D,", ")+" }"}return String(t)};function Yu(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function Bh(e){return St.call(String(e),/"/g,""")}function Vo(e){return Tt(e)==="[object Array]"&&(!We||!(typeof e=="object"&&We in e))}function $h(e){return Tt(e)==="[object Date]"&&(!We||!(typeof e=="object"&&We in e))}function Bs(e){return Tt(e)==="[object RegExp]"&&(!We||!(typeof e=="object"&&We in e))}function qh(e){return Tt(e)==="[object Error]"&&(!We||!(typeof e=="object"&&We in e))}function Hh(e){return Tt(e)==="[object String]"&&(!We||!(typeof e=="object"&&We in e))}function Wh(e){return Tt(e)==="[object Number]"&&(!We||!(typeof e=="object"&&We in e))}function Gh(e){return Tt(e)==="[object Boolean]"&&(!We||!(typeof e=="object"&&We in e))}function Ku(e){if(Yt)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Wo)return!1;try{return Wo.call(e),!0}catch{}return!1}function Vh(e){if(!e||typeof e!="object"||!Ho)return!1;try{return Ho.call(e),!0}catch{}return!1}var Qh=Object.prototype.hasOwnProperty||function(e){return e in this};function bt(e,t){return Qh.call(e,t)}function Tt(e){return Lh.call(e)}function zh(e){if(e.name)return e.name;var t=jh.call(Fh.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function Ju(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function Yh(e){if(!jn||!e||typeof e!="object")return!1;try{jn.call(e);try{Mn.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function Kh(e){if(!Fr||!e||typeof e!="object")return!1;try{Fr.call(e,Fr);try{jr.call(e,jr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function Jh(e){if(!Is||!e||typeof e!="object")return!1;try{return Is.call(e),!0}catch{}return!1}function Xh(e){if(!Mn||!e||typeof e!="object")return!1;try{Mn.call(e);try{jn.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function Zh(e){if(!jr||!e||typeof e!="object")return!1;try{jr.call(e,jr);try{Fr.call(e,Fr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function em(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function Xu(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Xu(pa.call(e,0,t.maxStringLength),t)+r}var s=St.call(St.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,tm);return Yu(s,"single",t)}function tm(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+Mh.call(t.toString(16))}function cr(e){return"Object("+e+")"}function Yi(e){return e+" { ? }"}function $s(e,t,n,r){var s=r?Qo(n,r):at.call(n,", ");return e+" ("+t+") {"+s+"}"}function rm(e){for(var t=0;t<e.length;t++)if(Ju(e[t],`
|
|
33
|
+
`)>=0)return!1;return!0}function nm(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=at.call(Array(e.indent+1)," ");else return null;return{base:n,prev:at.call(Array(t+1),n)}}function Qo(e,t){if(e.length===0)return"";var n=`
|
|
34
34
|
`+t.prev+t.base;return n+at.call(e,","+n)+`
|
|
35
|
-
`+t.prev}function un(e,t){var n=Vo(e),r=[];if(n){r.length=e.length;for(var s=0;s<e.length;s++)r[s]=bt(e,s)?t(e[s],e):""}var o=typeof zi=="function"?zi(e):[],l;if(Yt){l={};for(var i=0;i<o.length;i++)l["$"+o[i]]=o[i]}for(var u in e)bt(e,u)&&(n&&String(Number(u))===u&&u<e.length||Yt&&l["$"+u]instanceof Symbol||(Vu.call(/[^\w$]/,u)?r.push(t(u,e)+": "+t(e[u],e)):r.push(u+": "+t(e[u],e))));if(typeof zi=="function")for(var c=0;c<o.length;c++)Qu.call(e,o[c])&&r.push("["+t(o[c])+"]: "+t(e[o[c]],e));return r}var ha=la,Zt=Th,nm=Dh,im=ha("%TypeError%"),ln=ha("%WeakMap%",!0),fn=ha("%Map%",!0),om=Zt("WeakMap.prototype.get",!0),am=Zt("WeakMap.prototype.set",!0),sm=Zt("WeakMap.prototype.has",!0),cm=Zt("Map.prototype.get",!0),um=Zt("Map.prototype.set",!0),lm=Zt("Map.prototype.has",!0),ma=function(e,t){for(var n=e,r;(r=n.next)!==null;n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},fm=function(e,t){var n=ma(e,t);return n&&n.value},dm=function(e,t,n){var r=ma(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},pm=function(e,t){return!!ma(e,t)},hm=function(){var t,n,r,s={assert:function(o){if(!s.has(o))throw new im("Side channel does not contain "+nm(o))},get:function(o){if(ln&&o&&(typeof o=="object"||typeof o=="function")){if(t)return om(t,o)}else if(fn){if(n)return cm(n,o)}else if(r)return fm(r,o)},has:function(o){if(ln&&o&&(typeof o=="object"||typeof o=="function")){if(t)return sm(t,o)}else if(fn){if(n)return lm(n,o)}else if(r)return pm(r,o);return!1},set:function(o,l){ln&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new ln),am(t,o,l)):fn?(n||(n=new fn),um(n,o,l)):(r||(r={key:{},next:null}),dm(r,o,l))}};return s},mm=String.prototype.replace,gm=/%20/g,Ki={RFC1738:"RFC1738",RFC3986:"RFC3986"},ga={default:Ki.RFC3986,formatters:{RFC1738:function(e){return mm.call(e,gm,"+")},RFC3986:function(e){return String(e)}},RFC1738:Ki.RFC1738,RFC3986:Ki.RFC3986},ym=ga,Ji=Object.prototype.hasOwnProperty,kt=Array.isArray,it=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),vm=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(kt(r)){for(var s=[],o=0;o<r.length;++o)typeof r[o]<"u"&&s.push(r[o]);n.obj[n.prop]=s}}},Xu=function(t,n){for(var r=n&&n.plainObjects?Object.create(null):{},s=0;s<t.length;++s)typeof t[s]<"u"&&(r[s]=t[s]);return r},_m=function e(t,n,r){if(!n)return t;if(typeof n!="object"){if(kt(t))t.push(n);else if(t&&typeof t=="object")(r&&(r.plainObjects||r.allowPrototypes)||!Ji.call(Object.prototype,n))&&(t[n]=!0);else return[t,n];return t}if(!t||typeof t!="object")return[t].concat(n);var s=t;return kt(t)&&!kt(n)&&(s=Xu(t,r)),kt(t)&&kt(n)?(n.forEach(function(o,l){if(Ji.call(t,l)){var i=t[l];i&&typeof i=="object"&&o&&typeof o=="object"?t[l]=e(i,o,r):t.push(o)}else t[l]=o}),t):Object.keys(n).reduce(function(o,l){var i=n[l];return Ji.call(o,l)?o[l]=e(o[l],i,r):o[l]=i,o},s)},Em=function(t,n){return Object.keys(n).reduce(function(r,s){return r[s]=n[s],r},t)},wm=function(e,t,n){var r=e.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},bm=function(t,n,r,s,o){if(t.length===0)return t;var l=t;if(typeof t=="symbol"?l=Symbol.prototype.toString.call(t):typeof t!="string"&&(l=String(t)),r==="iso-8859-1")return escape(l).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});for(var i="",u=0;u<l.length;++u){var c=l.charCodeAt(u);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===ym.RFC1738&&(c===40||c===41)){i+=l.charAt(u);continue}if(c<128){i=i+it[c];continue}if(c<2048){i=i+(it[192|c>>6]+it[128|c&63]);continue}if(c<55296||c>=57344){i=i+(it[224|c>>12]+it[128|c>>6&63]+it[128|c&63]);continue}u+=1,c=65536+((c&1023)<<10|l.charCodeAt(u)&1023),i+=it[240|c>>18]+it[128|c>>12&63]+it[128|c>>6&63]+it[128|c&63]}return i},Sm=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],s=0;s<n.length;++s)for(var o=n[s],l=o.obj[o.prop],i=Object.keys(l),u=0;u<i.length;++u){var c=i[u],a=l[c];typeof a=="object"&&a!==null&&r.indexOf(a)===-1&&(n.push({obj:l,prop:c}),r.push(a))}return vm(n),t},Om=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},Tm=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},xm=function(t,n){return[].concat(t,n)},Am=function(t,n){if(kt(t)){for(var r=[],s=0;s<t.length;s+=1)r.push(n(t[s]));return r}return n(t)},Zu={arrayToObject:Xu,assign:Em,combine:xm,compact:Sm,decode:wm,encode:bm,isBuffer:Tm,isRegExp:Om,maybeMap:Am,merge:_m},el=hm,kn=Zu,Mr=ga,Rm=Object.prototype.hasOwnProperty,$s={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},ht=Array.isArray,Cm=Array.prototype.push,tl=function(e,t){Cm.apply(e,ht(t)?t:[t])},Nm=Date.prototype.toISOString,qs=Mr.default,He={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:kn.encode,encodeValuesOnly:!1,format:qs,formatter:Mr.formatters[qs],indices:!1,serializeDate:function(t){return Nm.call(t)},skipNulls:!1,strictNullHandling:!1},Pm=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Xi={},Im=function e(t,n,r,s,o,l,i,u,c,a,d,f,p,h,y,_){for(var S=t,v=_,w=0,x=!1;(v=v.get(Xi))!==void 0&&!x;){var O=v.get(t);if(w+=1,typeof O<"u"){if(O===w)throw new RangeError("Cyclic object value");x=!0}typeof v.get(Xi)>"u"&&(w=0)}if(typeof u=="function"?S=u(n,S):S instanceof Date?S=d(S):r==="comma"&&ht(S)&&(S=kn.maybeMap(S,function(C){return C instanceof Date?d(C):C})),S===null){if(o)return i&&!h?i(n,He.encoder,y,"key",f):n;S=""}if(Pm(S)||kn.isBuffer(S)){if(i){var F=h?n:i(n,He.encoder,y,"key",f);return[p(F)+"="+p(i(S,He.encoder,y,"value",f))]}return[p(n)+"="+p(String(S))]}var D=[];if(typeof S>"u")return D;var R;if(r==="comma"&&ht(S))h&&i&&(S=kn.maybeMap(S,i)),R=[{value:S.length>0?S.join(",")||null:void 0}];else if(ht(u))R=u;else{var W=Object.keys(S);R=c?W.sort(c):W}for(var V=s&&ht(S)&&S.length===1?n+"[]":n,L=0;L<R.length;++L){var U=R[L],$=typeof U=="object"&&typeof U.value<"u"?U.value:S[U];if(!(l&&$===null)){var K=ht(S)?typeof r=="function"?r(V,U):V:V+(a?"."+U:"["+U+"]");_.set(t,w);var Q=el();Q.set(Xi,_),tl(D,e($,K,r,s,o,l,r==="comma"&&h&&ht(S)?null:i,u,c,a,d,f,p,h,y,Q))}}return D},km=function(t){if(!t)return He;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||He.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Mr.default;if(typeof t.format<"u"){if(!Rm.call(Mr.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var s=Mr.formatters[r],o=He.filter;return(typeof t.filter=="function"||ht(t.filter))&&(o=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:He.addQueryPrefix,allowDots:typeof t.allowDots>"u"?He.allowDots:!!t.allowDots,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:He.charsetSentinel,delimiter:typeof t.delimiter>"u"?He.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:He.encode,encoder:typeof t.encoder=="function"?t.encoder:He.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:He.encodeValuesOnly,filter:o,format:r,formatter:s,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:He.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:He.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:He.strictNullHandling}},Lm=function(e,t){var n=e,r=km(t),s,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):ht(r.filter)&&(o=r.filter,s=o);var l=[];if(typeof n!="object"||n===null)return"";var i;t&&t.arrayFormat in $s?i=t.arrayFormat:t&&"indices"in t?i=t.indices?"indices":"repeat":i="indices";var u=$s[i];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=u==="comma"&&t&&t.commaRoundTrip;s||(s=Object.keys(n)),r.sort&&s.sort(r.sort);for(var a=el(),d=0;d<s.length;++d){var f=s[d];r.skipNulls&&n[f]===null||tl(l,Im(n[f],f,u,c,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,a))}var p=l.join(r.delimiter),h=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),p.length>0?h+p:""},Kt=Zu,zo=Object.prototype.hasOwnProperty,Fm=Array.isArray,Ie={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Kt.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},jm=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},rl=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},Mm="utf8=%26%2310003%3B",Dm="utf8=%E2%9C%93",Um=function(t,n){var r={__proto__:null},s=n.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=n.parameterLimit===1/0?void 0:n.parameterLimit,l=s.split(n.delimiter,o),i=-1,u,c=n.charset;if(n.charsetSentinel)for(u=0;u<l.length;++u)l[u].indexOf("utf8=")===0&&(l[u]===Dm?c="utf-8":l[u]===Mm&&(c="iso-8859-1"),i=u,u=l.length);for(u=0;u<l.length;++u)if(u!==i){var a=l[u],d=a.indexOf("]="),f=d===-1?a.indexOf("="):d+1,p,h;f===-1?(p=n.decoder(a,Ie.decoder,c,"key"),h=n.strictNullHandling?null:""):(p=n.decoder(a.slice(0,f),Ie.decoder,c,"key"),h=Kt.maybeMap(rl(a.slice(f+1),n),function(y){return n.decoder(y,Ie.decoder,c,"value")})),h&&n.interpretNumericEntities&&c==="iso-8859-1"&&(h=jm(h)),a.indexOf("[]=")>-1&&(h=Fm(h)?[h]:h),zo.call(r,p)?r[p]=Kt.combine(r[p],h):r[p]=h}return r},Bm=function(e,t,n,r){for(var s=r?t:rl(t,n),o=e.length-1;o>=0;--o){var l,i=e[o];if(i==="[]"&&n.parseArrays)l=[].concat(s);else{l=n.plainObjects?Object.create(null):{};var u=i.charAt(0)==="["&&i.charAt(i.length-1)==="]"?i.slice(1,-1):i,c=parseInt(u,10);!n.parseArrays&&u===""?l={0:s}:!isNaN(c)&&i!==u&&String(c)===u&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(l=[],l[c]=s):u!=="__proto__"&&(l[u]=s)}s=l}return s},$m=function(t,n,r,s){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,l=/(\[[^[\]]*])/,i=/(\[[^[\]]*])/g,u=r.depth>0&&l.exec(o),c=u?o.slice(0,u.index):o,a=[];if(c){if(!r.plainObjects&&zo.call(Object.prototype,c)&&!r.allowPrototypes)return;a.push(c)}for(var d=0;r.depth>0&&(u=i.exec(o))!==null&&d<r.depth;){if(d+=1,!r.plainObjects&&zo.call(Object.prototype,u[1].slice(1,-1))&&!r.allowPrototypes)return;a.push(u[1])}return u&&a.push("["+o.slice(u.index)+"]"),Bm(a,n,r,s)}},qm=function(t){if(!t)return Ie;if(t.decoder!==null&&t.decoder!==void 0&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof t.charset>"u"?Ie.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?Ie.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Ie.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Ie.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Ie.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Ie.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Ie.comma,decoder:typeof t.decoder=="function"?t.decoder:Ie.decoder,delimiter:typeof t.delimiter=="string"||Kt.isRegExp(t.delimiter)?t.delimiter:Ie.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Ie.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Ie.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Ie.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Ie.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Ie.strictNullHandling}},Hm=function(e,t){var n=qm(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?Um(e,n):e,s=n.plainObjects?Object.create(null):{},o=Object.keys(r),l=0;l<o.length;++l){var i=o[l],u=$m(i,r[i],n,typeof e=="string");s=Kt.merge(s,u,n)}return n.allowSparse===!0?s:Kt.compact(s)},Wm=Lm,Gm=Hm,Vm=ga,Qm={formats:Vm,parse:Gm,stringify:Wm};const zm=$r(Qm);var Ym="[object String]",Km=Object.prototype,Jm=Km.toString,Xm=Array.isArray;function Zm(e){return!!e&&typeof e=="object"}function eg(e){return typeof e=="string"||!Xm(e)&&Zm(e)&&Jm.call(e)==Ym}var tg=eg;const Hs=$r(tg);var ya={exports:{}};class nl extends Error{constructor(){super("Throttled function aborted"),this.name="AbortError"}}const rg=({limit:e,interval:t,strict:n})=>{if(!Number.isFinite(e))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(t))throw new TypeError("Expected `interval` to be a finite number");const r=new Map;let s=0,o=0;function l(){const a=Date.now();return a-s>t?(o=1,s=a,0):(o<e?o++:(s+=t,o=1),s-a)}const i=[];function u(){const a=Date.now();if(i.length<e)return i.push(a),0;const d=i.shift()+t;return a>=d?(i.push(a),0):(i.push(d),d-a)}const c=n?u:l;return a=>{const d=function(...f){if(!d.isEnabled)return(async()=>a.apply(this,f))();let p;return new Promise((h,y)=>{p=setTimeout(()=>{h(a.apply(this,f)),r.delete(p)},c()),r.set(p,y)})};return d.abort=()=>{for(const f of r.keys())clearTimeout(f),r.get(f)(new nl);r.clear(),i.splice(0,i.length)},d.isEnabled=!0,d}};ya.exports=rg;ya.exports.AbortError=nl;var ng=ya.exports;const ig=$r(ng);var og="[object Object]";function ag(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function sg(e,t){return function(n){return e(t(n))}}var cg=Function.prototype,il=Object.prototype,ol=cg.toString,ug=il.hasOwnProperty,lg=ol.call(Object),fg=il.toString,dg=sg(Object.getPrototypeOf,Object);function pg(e){return!!e&&typeof e=="object"}function hg(e){if(!pg(e)||fg.call(e)!=og||ag(e))return!1;var t=dg(e);if(t===null)return!0;var n=ug.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ol.call(n)==lg}var mg=hg;const dn=$r(mg);function gg(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,l,i=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(i.push(r.value),i.length!==t);u=!0);}catch(a){c=!0,s=a}finally{try{if(!u&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw s}}return i}}function Ws(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ws(Object(n),!0).forEach(function(r){yg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ws(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yo(e){"@babel/helpers - typeof";return Yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yo(e)}function Ko(){Ko=function(s,o){return new n(s,void 0,o)};var e=RegExp.prototype,t=new WeakMap;function n(s,o,l){var i=new RegExp(s,o);return t.set(i,l||t.get(s)),Dn(i,n.prototype)}function r(s,o){var l=t.get(o);return Object.keys(l).reduce(function(i,u){var c=l[u];if(typeof c=="number")i[u]=s[c];else{for(var a=0;s[c[a]]===void 0&&a+1<c.length;)a++;i[u]=s[c[a]]}return i},Object.create(null))}return vg(n,RegExp),n.prototype.exec=function(s){var o=e.exec.call(this,s);if(o){o.groups=r(o,this);var l=o.indices;l&&(l.groups=r(l,this))}return o},n.prototype[Symbol.replace]=function(s,o){if(typeof o=="string"){var l=t.get(this);return e[Symbol.replace].call(this,s,o.replace(/\$<([^>]+)>/g,function(u,c){var a=l[c];return"$"+(Array.isArray(a)?a.join("$"):a)}))}if(typeof o=="function"){var i=this;return e[Symbol.replace].call(this,s,function(){var u=arguments;return typeof u[u.length-1]!="object"&&(u=[].slice.call(u)).push(r(u,i)),o.apply(this,u)})}return e[Symbol.replace].call(this,s,o)},Ko.apply(this,arguments)}function yg(e,t,n){return t=Og(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vg(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dn(e,t)}function Dn(e,t){return Dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Dn(e,t)}function _g(e,t){return Eg(e)||gg(e,t)||al(e,t)||wg()}function Eg(e){if(Array.isArray(e))return e}function al(e,t){if(e){if(typeof e=="string")return Gs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gs(e,t)}}function Gs(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
36
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
37
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,l=!1,i;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return o=u.done,u},e:function(u){l=!0,i=u},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(l)throw i}}}}function
|
|
35
|
+
`+t.prev}function un(e,t){var n=Vo(e),r=[];if(n){r.length=e.length;for(var s=0;s<e.length;s++)r[s]=bt(e,s)?t(e[s],e):""}var o=typeof zi=="function"?zi(e):[],l;if(Yt){l={};for(var i=0;i<o.length;i++)l["$"+o[i]]=o[i]}for(var u in e)bt(e,u)&&(n&&String(Number(u))===u&&u<e.length||Yt&&l["$"+u]instanceof Symbol||(Qu.call(/[^\w$]/,u)?r.push(t(u,e)+": "+t(e[u],e)):r.push(u+": "+t(e[u],e))));if(typeof zi=="function")for(var c=0;c<o.length;c++)zu.call(e,o[c])&&r.push("["+t(o[c])+"]: "+t(e[o[c]],e));return r}var ha=la,Zt=xh,im=Uh,om=ha("%TypeError%"),ln=ha("%WeakMap%",!0),fn=ha("%Map%",!0),am=Zt("WeakMap.prototype.get",!0),sm=Zt("WeakMap.prototype.set",!0),cm=Zt("WeakMap.prototype.has",!0),um=Zt("Map.prototype.get",!0),lm=Zt("Map.prototype.set",!0),fm=Zt("Map.prototype.has",!0),ma=function(e,t){for(var n=e,r;(r=n.next)!==null;n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},dm=function(e,t){var n=ma(e,t);return n&&n.value},pm=function(e,t,n){var r=ma(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},hm=function(e,t){return!!ma(e,t)},mm=function(){var t,n,r,s={assert:function(o){if(!s.has(o))throw new om("Side channel does not contain "+im(o))},get:function(o){if(ln&&o&&(typeof o=="object"||typeof o=="function")){if(t)return am(t,o)}else if(fn){if(n)return um(n,o)}else if(r)return dm(r,o)},has:function(o){if(ln&&o&&(typeof o=="object"||typeof o=="function")){if(t)return cm(t,o)}else if(fn){if(n)return fm(n,o)}else if(r)return hm(r,o);return!1},set:function(o,l){ln&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new ln),sm(t,o,l)):fn?(n||(n=new fn),lm(n,o,l)):(r||(r={key:{},next:null}),pm(r,o,l))}};return s},gm=String.prototype.replace,ym=/%20/g,Ki={RFC1738:"RFC1738",RFC3986:"RFC3986"},ga={default:Ki.RFC3986,formatters:{RFC1738:function(e){return gm.call(e,ym,"+")},RFC3986:function(e){return String(e)}},RFC1738:Ki.RFC1738,RFC3986:Ki.RFC3986},vm=ga,Ji=Object.prototype.hasOwnProperty,kt=Array.isArray,it=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),_m=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(kt(r)){for(var s=[],o=0;o<r.length;++o)typeof r[o]<"u"&&s.push(r[o]);n.obj[n.prop]=s}}},Zu=function(t,n){for(var r=n&&n.plainObjects?Object.create(null):{},s=0;s<t.length;++s)typeof t[s]<"u"&&(r[s]=t[s]);return r},Em=function e(t,n,r){if(!n)return t;if(typeof n!="object"){if(kt(t))t.push(n);else if(t&&typeof t=="object")(r&&(r.plainObjects||r.allowPrototypes)||!Ji.call(Object.prototype,n))&&(t[n]=!0);else return[t,n];return t}if(!t||typeof t!="object")return[t].concat(n);var s=t;return kt(t)&&!kt(n)&&(s=Zu(t,r)),kt(t)&&kt(n)?(n.forEach(function(o,l){if(Ji.call(t,l)){var i=t[l];i&&typeof i=="object"&&o&&typeof o=="object"?t[l]=e(i,o,r):t.push(o)}else t[l]=o}),t):Object.keys(n).reduce(function(o,l){var i=n[l];return Ji.call(o,l)?o[l]=e(o[l],i,r):o[l]=i,o},s)},wm=function(t,n){return Object.keys(n).reduce(function(r,s){return r[s]=n[s],r},t)},bm=function(e,t,n){var r=e.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},Sm=function(t,n,r,s,o){if(t.length===0)return t;var l=t;if(typeof t=="symbol"?l=Symbol.prototype.toString.call(t):typeof t!="string"&&(l=String(t)),r==="iso-8859-1")return escape(l).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});for(var i="",u=0;u<l.length;++u){var c=l.charCodeAt(u);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===vm.RFC1738&&(c===40||c===41)){i+=l.charAt(u);continue}if(c<128){i=i+it[c];continue}if(c<2048){i=i+(it[192|c>>6]+it[128|c&63]);continue}if(c<55296||c>=57344){i=i+(it[224|c>>12]+it[128|c>>6&63]+it[128|c&63]);continue}u+=1,c=65536+((c&1023)<<10|l.charCodeAt(u)&1023),i+=it[240|c>>18]+it[128|c>>12&63]+it[128|c>>6&63]+it[128|c&63]}return i},Om=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],s=0;s<n.length;++s)for(var o=n[s],l=o.obj[o.prop],i=Object.keys(l),u=0;u<i.length;++u){var c=i[u],a=l[c];typeof a=="object"&&a!==null&&r.indexOf(a)===-1&&(n.push({obj:l,prop:c}),r.push(a))}return _m(n),t},Tm=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},xm=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},Am=function(t,n){return[].concat(t,n)},Rm=function(t,n){if(kt(t)){for(var r=[],s=0;s<t.length;s+=1)r.push(n(t[s]));return r}return n(t)},el={arrayToObject:Zu,assign:wm,combine:Am,compact:Om,decode:bm,encode:Sm,isBuffer:xm,isRegExp:Tm,maybeMap:Rm,merge:Em},tl=mm,kn=el,Mr=ga,Cm=Object.prototype.hasOwnProperty,qs={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},ht=Array.isArray,Nm=Array.prototype.push,rl=function(e,t){Nm.apply(e,ht(t)?t:[t])},Pm=Date.prototype.toISOString,Hs=Mr.default,He={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:kn.encode,encodeValuesOnly:!1,format:Hs,formatter:Mr.formatters[Hs],indices:!1,serializeDate:function(t){return Pm.call(t)},skipNulls:!1,strictNullHandling:!1},Im=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Xi={},km=function e(t,n,r,s,o,l,i,u,c,a,d,f,p,h,y,_){for(var S=t,v=_,w=0,x=!1;(v=v.get(Xi))!==void 0&&!x;){var O=v.get(t);if(w+=1,typeof O<"u"){if(O===w)throw new RangeError("Cyclic object value");x=!0}typeof v.get(Xi)>"u"&&(w=0)}if(typeof u=="function"?S=u(n,S):S instanceof Date?S=d(S):r==="comma"&&ht(S)&&(S=kn.maybeMap(S,function(C){return C instanceof Date?d(C):C})),S===null){if(o)return i&&!h?i(n,He.encoder,y,"key",f):n;S=""}if(Im(S)||kn.isBuffer(S)){if(i){var F=h?n:i(n,He.encoder,y,"key",f);return[p(F)+"="+p(i(S,He.encoder,y,"value",f))]}return[p(n)+"="+p(String(S))]}var D=[];if(typeof S>"u")return D;var R;if(r==="comma"&&ht(S))h&&i&&(S=kn.maybeMap(S,i)),R=[{value:S.length>0?S.join(",")||null:void 0}];else if(ht(u))R=u;else{var W=Object.keys(S);R=c?W.sort(c):W}for(var Q=s&&ht(S)&&S.length===1?n+"[]":n,k=0;k<R.length;++k){var U=R[k],$=typeof U=="object"&&typeof U.value<"u"?U.value:S[U];if(!(l&&$===null)){var K=ht(S)?typeof r=="function"?r(Q,U):Q:Q+(a?"."+U:"["+U+"]");_.set(t,w);var V=tl();V.set(Xi,_),rl(D,e($,K,r,s,o,l,r==="comma"&&h&&ht(S)?null:i,u,c,a,d,f,p,h,y,V))}}return D},Lm=function(t){if(!t)return He;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||He.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Mr.default;if(typeof t.format<"u"){if(!Cm.call(Mr.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var s=Mr.formatters[r],o=He.filter;return(typeof t.filter=="function"||ht(t.filter))&&(o=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:He.addQueryPrefix,allowDots:typeof t.allowDots>"u"?He.allowDots:!!t.allowDots,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:He.charsetSentinel,delimiter:typeof t.delimiter>"u"?He.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:He.encode,encoder:typeof t.encoder=="function"?t.encoder:He.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:He.encodeValuesOnly,filter:o,format:r,formatter:s,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:He.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:He.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:He.strictNullHandling}},Fm=function(e,t){var n=e,r=Lm(t),s,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):ht(r.filter)&&(o=r.filter,s=o);var l=[];if(typeof n!="object"||n===null)return"";var i;t&&t.arrayFormat in qs?i=t.arrayFormat:t&&"indices"in t?i=t.indices?"indices":"repeat":i="indices";var u=qs[i];if(t&&"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=u==="comma"&&t&&t.commaRoundTrip;s||(s=Object.keys(n)),r.sort&&s.sort(r.sort);for(var a=tl(),d=0;d<s.length;++d){var f=s[d];r.skipNulls&&n[f]===null||rl(l,km(n[f],f,u,c,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,a))}var p=l.join(r.delimiter),h=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),p.length>0?h+p:""},Kt=el,zo=Object.prototype.hasOwnProperty,jm=Array.isArray,ke={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Kt.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Mm=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},nl=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},Dm="utf8=%26%2310003%3B",Um="utf8=%E2%9C%93",Bm=function(t,n){var r={__proto__:null},s=n.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=n.parameterLimit===1/0?void 0:n.parameterLimit,l=s.split(n.delimiter,o),i=-1,u,c=n.charset;if(n.charsetSentinel)for(u=0;u<l.length;++u)l[u].indexOf("utf8=")===0&&(l[u]===Um?c="utf-8":l[u]===Dm&&(c="iso-8859-1"),i=u,u=l.length);for(u=0;u<l.length;++u)if(u!==i){var a=l[u],d=a.indexOf("]="),f=d===-1?a.indexOf("="):d+1,p,h;f===-1?(p=n.decoder(a,ke.decoder,c,"key"),h=n.strictNullHandling?null:""):(p=n.decoder(a.slice(0,f),ke.decoder,c,"key"),h=Kt.maybeMap(nl(a.slice(f+1),n),function(y){return n.decoder(y,ke.decoder,c,"value")})),h&&n.interpretNumericEntities&&c==="iso-8859-1"&&(h=Mm(h)),a.indexOf("[]=")>-1&&(h=jm(h)?[h]:h),zo.call(r,p)?r[p]=Kt.combine(r[p],h):r[p]=h}return r},$m=function(e,t,n,r){for(var s=r?t:nl(t,n),o=e.length-1;o>=0;--o){var l,i=e[o];if(i==="[]"&&n.parseArrays)l=[].concat(s);else{l=n.plainObjects?Object.create(null):{};var u=i.charAt(0)==="["&&i.charAt(i.length-1)==="]"?i.slice(1,-1):i,c=parseInt(u,10);!n.parseArrays&&u===""?l={0:s}:!isNaN(c)&&i!==u&&String(c)===u&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(l=[],l[c]=s):u!=="__proto__"&&(l[u]=s)}s=l}return s},qm=function(t,n,r,s){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,l=/(\[[^[\]]*])/,i=/(\[[^[\]]*])/g,u=r.depth>0&&l.exec(o),c=u?o.slice(0,u.index):o,a=[];if(c){if(!r.plainObjects&&zo.call(Object.prototype,c)&&!r.allowPrototypes)return;a.push(c)}for(var d=0;r.depth>0&&(u=i.exec(o))!==null&&d<r.depth;){if(d+=1,!r.plainObjects&&zo.call(Object.prototype,u[1].slice(1,-1))&&!r.allowPrototypes)return;a.push(u[1])}return u&&a.push("["+o.slice(u.index)+"]"),$m(a,n,r,s)}},Hm=function(t){if(!t)return ke;if(t.decoder!==null&&t.decoder!==void 0&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof t.charset>"u"?ke.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?ke.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:ke.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:ke.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:ke.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:ke.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:ke.comma,decoder:typeof t.decoder=="function"?t.decoder:ke.decoder,delimiter:typeof t.delimiter=="string"||Kt.isRegExp(t.delimiter)?t.delimiter:ke.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:ke.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:ke.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:ke.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:ke.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:ke.strictNullHandling}},Wm=function(e,t){var n=Hm(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?Bm(e,n):e,s=n.plainObjects?Object.create(null):{},o=Object.keys(r),l=0;l<o.length;++l){var i=o[l],u=qm(i,r[i],n,typeof e=="string");s=Kt.merge(s,u,n)}return n.allowSparse===!0?s:Kt.compact(s)},Gm=Fm,Vm=Wm,Qm=ga,zm={formats:Qm,parse:Vm,stringify:Gm};const Ym=$r(zm);var Km="[object String]",Jm=Object.prototype,Xm=Jm.toString,Zm=Array.isArray;function eg(e){return!!e&&typeof e=="object"}function tg(e){return typeof e=="string"||!Zm(e)&&eg(e)&&Xm.call(e)==Km}var rg=tg;const Ws=$r(rg);var ya={exports:{}};class il extends Error{constructor(){super("Throttled function aborted"),this.name="AbortError"}}const ng=({limit:e,interval:t,strict:n})=>{if(!Number.isFinite(e))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(t))throw new TypeError("Expected `interval` to be a finite number");const r=new Map;let s=0,o=0;function l(){const a=Date.now();return a-s>t?(o=1,s=a,0):(o<e?o++:(s+=t,o=1),s-a)}const i=[];function u(){const a=Date.now();if(i.length<e)return i.push(a),0;const d=i.shift()+t;return a>=d?(i.push(a),0):(i.push(d),d-a)}const c=n?u:l;return a=>{const d=function(...f){if(!d.isEnabled)return(async()=>a.apply(this,f))();let p;return new Promise((h,y)=>{p=setTimeout(()=>{h(a.apply(this,f)),r.delete(p)},c()),r.set(p,y)})};return d.abort=()=>{for(const f of r.keys())clearTimeout(f),r.get(f)(new il);r.clear(),i.splice(0,i.length)},d.isEnabled=!0,d}};ya.exports=ng;ya.exports.AbortError=il;var ig=ya.exports;const og=$r(ig);var ag="[object Object]";function sg(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function cg(e,t){return function(n){return e(t(n))}}var ug=Function.prototype,ol=Object.prototype,al=ug.toString,lg=ol.hasOwnProperty,fg=al.call(Object),dg=ol.toString,pg=cg(Object.getPrototypeOf,Object);function hg(e){return!!e&&typeof e=="object"}function mg(e){if(!hg(e)||dg.call(e)!=ag||sg(e))return!1;var t=pg(e);if(t===null)return!0;var n=lg.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&al.call(n)==fg}var gg=mg;const dn=$r(gg);function yg(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,l,i=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(i.push(r.value),i.length!==t);u=!0);}catch(a){c=!0,s=a}finally{try{if(!u&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw s}}return i}}function Gs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gs(Object(n),!0).forEach(function(r){vg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gs(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yo(e){"@babel/helpers - typeof";return Yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yo(e)}function Ko(){Ko=function(s,o){return new n(s,void 0,o)};var e=RegExp.prototype,t=new WeakMap;function n(s,o,l){var i=new RegExp(s,o);return t.set(i,l||t.get(s)),Dn(i,n.prototype)}function r(s,o){var l=t.get(o);return Object.keys(l).reduce(function(i,u){var c=l[u];if(typeof c=="number")i[u]=s[c];else{for(var a=0;s[c[a]]===void 0&&a+1<c.length;)a++;i[u]=s[c[a]]}return i},Object.create(null))}return _g(n,RegExp),n.prototype.exec=function(s){var o=e.exec.call(this,s);if(o){o.groups=r(o,this);var l=o.indices;l&&(l.groups=r(l,this))}return o},n.prototype[Symbol.replace]=function(s,o){if(typeof o=="string"){var l=t.get(this);return e[Symbol.replace].call(this,s,o.replace(/\$<([^>]+)>/g,function(u,c){var a=l[c];return"$"+(Array.isArray(a)?a.join("$"):a)}))}if(typeof o=="function"){var i=this;return e[Symbol.replace].call(this,s,function(){var u=arguments;return typeof u[u.length-1]!="object"&&(u=[].slice.call(u)).push(r(u,i)),o.apply(this,u)})}return e[Symbol.replace].call(this,s,o)},Ko.apply(this,arguments)}function vg(e,t,n){return t=Tg(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _g(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dn(e,t)}function Dn(e,t){return Dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Dn(e,t)}function Eg(e,t){return wg(e)||yg(e,t)||sl(e,t)||bg()}function wg(e){if(Array.isArray(e))return e}function sl(e,t){if(e){if(typeof e=="string")return Vs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vs(e,t)}}function Vs(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
36
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sg(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=sl(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,s=function(){};return{s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
37
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,l=!1,i;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return o=u.done,u},e:function(u){l=!0,i=u},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(l)throw i}}}}function Og(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tg(e){var t=Og(e,"string");return typeof t=="symbol"?t:String(t)}function xg(){return typeof process<"u"&&!process.browser}function Ag(){return typeof window<"u"&&"navigator"in window&&"product"in window.navigator&&window.navigator.product==="ReactNative"}function Rg(){return process.versions&&process.versions.node?"v".concat(process.versions.node):process.version}function Cg(){return window}function Jo(){}var Xo=Ko(/(\d+)(%)/,{value:1});function Zi(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:7,n=t;if(Xo.test(e)){var r,s=(r=e.match(Xo))===null||r===void 0?void 0:r.groups;if(s&&s.value){var o=parseInt(s.value)/100;n=Math.round(t*o)}}return Math.min(30,Math.max(1,n))}function Qs(e,t){return t("info","Throttle request to ".concat(e,"/s")),og({limit:e,interval:1e3,strict:!1})}var Ng=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto",n=e.defaults.logHandler,r=n===void 0?Jo:n,s=Ws(t)?Zi(t):Zi("auto",t),o=Qs(s,r),l=!1,i=e.interceptors.request.use(function(c){return o(function(){return c})()},function(c){return Promise.reject(c)}),u=e.interceptors.response.use(function(c){if(!l&&Ws(t)&&(t==="auto"||Xo.test(t))&&c.headers&&c.headers["x-contentful-ratelimit-second-limit"]){var a=parseInt(c.headers["x-contentful-ratelimit-second-limit"]),d=Zi(t,a);d!==s&&(i&&e.interceptors.request.eject(i),s=d,o=Qs(d,r),i=e.interceptors.request.use(function(f){return o(function(){return f})()},function(f){return Promise.reject(f)})),l=!0}return c},function(c){return Promise.reject(c)});return function(){e.interceptors.request.eject(i),e.interceptors.response.eject(u)}},Pg=function(t){return new Promise(function(n){setTimeout(n,t)})},Ig=function(t){return Math.pow(Math.SQRT2,t)};function kg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5,n=e.defaults,r=n.responseLogger,s=r===void 0?Jo:r,o=n.requestLogger,l=o===void 0?Jo:o;e.interceptors.request.use(function(i){return l(i),i},function(i){return l(i),Promise.reject(i)}),e.interceptors.response.use(function(i){return s(i),i},function(i){var u=i.response,c=i.config;if(s(i),!c||!e.defaults.retryOnError)return Promise.reject(i);var a=c.attempts||1;if(a>t)return i.attempts=c.attempts,Promise.reject(i);var d=null,f=Ig(a);return u?u.status>=500&&u.status<600?d="Server ".concat(u.status):u.status===429&&(d="Rate limit",u.headers&&i.response.headers["x-contentful-ratelimit-reset"]&&(f=u.headers["x-contentful-ratelimit-reset"])):d="Connection",d?(f=Math.floor(f*1e3+Math.random()*200+500),e.defaults.logHandler("warning","".concat(d," error occurred. Waiting for ").concat(f," ms before retrying...")),c.attempts=a+1,delete c.httpAgent,delete c.httpsAgent,Pg(f).then(function(){return e(c)})):Promise.reject(i)})}function Lg(e,t){e.interceptors.request.use(function(n){return t().then(function(r){return n.headers=Wt(Wt({},n.headers),{},{Authorization:"Bearer ".concat(r)}),n})})}var Fg=/^(?!\w+:\/\/)([^\s:]+\.?[^\s:]+)(?::(\d+))?(?!:)$/;function cl(e,t){var n={insecure:!1,retryOnError:!0,logHandler:function(y,_){if(y==="error"&&_){var S=[_.name,_.message].filter(function(v){return v}).join(" - ");console.error("[error] ".concat(S)),console.error(_);return}console.log("[".concat(y,"] ").concat(_))},headers:{},httpAgent:!1,httpsAgent:!1,timeout:3e4,throttle:0,proxy:!1,basePath:"",adapter:void 0,maxContentLength:1073741824,maxBodyLength:1073741824},r=Wt(Wt({},n),t);if(!r.accessToken){var s=new TypeError("Expected parameter accessToken");throw r.logHandler("error",s),s}var o=r.insecure?"http":"https",l=r.space?"".concat(r.space,"/"):"",i=r.defaultHostname,u=r.insecure?80:443;if(r.host&&Fg.test(r.host)){var c=r.host.split(":");if(c.length===2){var a=Eg(c,2);i=a[0],u=a[1]}else i=c[0]}r.basePath&&(r.basePath="/".concat(r.basePath.split("/").filter(Boolean).join("/")));var d=t.baseURL||"".concat(o,"://").concat(i,":").concat(u).concat(r.basePath,"/spaces/").concat(l);!r.headers.Authorization&&typeof r.accessToken!="function"&&(r.headers.Authorization="Bearer "+r.accessToken);var f={baseURL:d,headers:r.headers,httpAgent:r.httpAgent,httpsAgent:r.httpsAgent,paramsSerializer:Ym.stringify,proxy:r.proxy,timeout:r.timeout,adapter:r.adapter,maxContentLength:r.maxContentLength,maxBodyLength:r.maxBodyLength,logHandler:r.logHandler,responseLogger:r.responseLogger,requestLogger:r.requestLogger,retryOnError:r.retryOnError},p=e.create(f);return p.httpClientParams=t,p.cloneWithNewParams=function(h){return cl(e,Wt(Wt({},Ot(t)),h))},r.onBeforeRequest&&p.interceptors.request.use(r.onBeforeRequest),typeof r.accessToken=="function"&&Lg(p,r.accessToken),r.throttle&&Ng(p,r.throttle),kg(p,r.retryLimit),r.onError&&p.interceptors.response.use(function(h){return h},r.onError),p}function jg(e){var t=e.query,n={};return delete t.resolveLinks,n.params=Ot(t),n}function Mg(e,t){if(!(t in e)){var n=new Error;throw n.name="PropertyMissing",n.message="Required property ".concat(t,` missing from:
|
|
38
38
|
|
|
39
39
|
`).concat(JSON.stringify(e),`
|
|
40
40
|
|
|
41
|
-
`),n}return!0}function cl(e){var t=Object.getOwnPropertyNames(e),n=bg(t),r;try{for(n.s();!(r=n.n()).done;){var s=r.value,o=e[s];o&&Yo(o)==="object"&&cl(o)}}catch(l){n.e(l)}finally{n.f()}return Object.freeze(e)}function Mg(e){return cl(e.sys||{}),e}function Qs(){var e=Rg();if(!e)return null;var t=e.navigator.userAgent,n=e.navigator.platform,r=["Macintosh","MacIntel","MacPPC","Mac68K"],s=["Win32","Win64","Windows","WinCE"],o=["iPhone","iPad","iPod"];return r.indexOf(n)!==-1?"macOS":o.indexOf(n)!==-1?"iOS":s.indexOf(n)!==-1?"Windows":/Android/.test(t)?"Android":/Linux/.test(n)?"Linux":null}function Dg(){var e=process.platform||"linux",t=process.version||"0.0.0",n={android:"Android",aix:"Linux",darwin:"macOS",freebsd:"Linux",linux:"Linux",openbsd:"Linux",sunos:"Linux",win32:"Windows"};return e in n?"".concat(n[e]||"Linux","/").concat(t):null}function Ug(e,t,n,r){var s=[];t&&s.push("app ".concat(t)),n&&s.push("integration ".concat(n)),r&&s.push("feature "+r),s.push("sdk ".concat(e));var o=null;try{xg()?(o=Qs(),s.push("platform ReactNative")):Tg()?(o=Dg(),s.push("platform node.js/".concat(Ag()))):(o=Qs(),s.push("platform browser"))}catch{o=null}return o&&s.push("os ".concat(o)),"".concat(s.filter(function(l){return l!==""}).join("; "),";")}function Bg(e){return Object.defineProperty(e,"toPlainObject",{enumerable:!1,configurable:!1,writable:!1,value:function(){return Ot(this)}})}function $g(e){var t=e.config,n=e.response,r;if(t&&t.headers&&t.headers.Authorization){var s="...".concat(t.headers.Authorization.toString().substr(-5));t.headers.Authorization="Bearer ".concat(s)}if(!dn(n)||!dn(t))throw e;var o=n==null?void 0:n.data,l={status:n==null?void 0:n.status,statusText:n==null?void 0:n.statusText,message:"",details:{}};dn(t)&&(l.request={url:t.url,headers:t.headers,method:t.method,payloadData:t.data}),o&&dn(o)&&("requestId"in o&&(l.requestId=o.requestId||"UNKNOWN"),"message"in o&&(l.message=o.message||""),"details"in o&&(l.details=o.details||{}),"sys"in o&&"id"in o.sys&&(r=o.sys.id));var i=new Error;i.name=r&&r!=="Unknown"?r:"".concat(n==null?void 0:n.status," ").concat(n==null?void 0:n.statusText);try{i.message=JSON.stringify(l,null," ")}catch{var u;i.message=(u=l==null?void 0:l.message)!==null&&u!==void 0?u:""}throw i}const qg=Object.freeze(Object.defineProperty({__proto__:null,createHttpClient:sl,createRequestConfig:Fg,enforceObjPath:jg,errorHandler:$g,freezeSys:Mg,getUserAgentHeader:Ug,toPlainObject:Bg},Symbol.toStringTag,{value:"Module"})),ct=qr(qg);var pn={},ur={},hn={},zs;function Hg(){if(zs)return hn;zs=1,Object.defineProperty(hn,"__esModule",{value:!0}),hn.wrapSpace=t;var e=ct;function t(n){return(0,e.freezeSys)((0,e.toPlainObject)(n))}return hn}var lr={},eo={exports:{}},Ys;function er(){return Ys||(Ys=1,function(e,t){(function(n,r){e.exports=r()})(ce,function(){var n=Function.prototype.toString,r=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,u=Object.getPrototypeOf,c=Object.prototype,a=c.hasOwnProperty,d=c.propertyIsEnumerable,f=typeof i=="function",p=typeof WeakMap=="function",h=function(){if(p)return function(){return new WeakMap};var D=function(){function R(){this._keys=[],this._values=[]}return R.prototype.has=function(W){return!!~this._keys.indexOf(W)},R.prototype.get=function(W){return this._values[this._keys.indexOf(W)]},R.prototype.set=function(W,V){this._keys.push(W),this._values.push(V)},R}();return function(){return new D}}(),y=function(D,R){var W=D.__proto__||u(D);if(!W)return r(null);var V=W.constructor;if(V===R.Object)return W===R.Object.prototype?{}:r(W);if(~n.call(V).indexOf("[native code]"))try{return new V}catch{}return r(W)},_=function(D,R,W,V){var L=y(D,R);V.set(D,L);for(var U in D)a.call(D,U)&&(L[U]=W(D[U],V));if(f)for(var $=i(D),K=0,Q=$.length,C=void 0;K<Q;++K)C=$[K],d.call(D,C)&&(L[C]=W(D[C],V));return L},S=function(D,R,W,V){var L=y(D,R);V.set(D,L);for(var U=f?l(D).concat(i(D)):l(D),$=0,K=U.length,Q=void 0,C=void 0;$<K;++$)if(Q=U[$],Q!=="callee"&&Q!=="caller")if(C=o(D,Q),C){!C.get&&!C.set&&(C.value=W(D[Q],V));try{s(L,Q,C)}catch{L[Q]=C.value}}else L[Q]=W(D[Q],V);return L},v=function(D){var R="";return D.global&&(R+="g"),D.ignoreCase&&(R+="i"),D.multiline&&(R+="m"),D.unicode&&(R+="u"),D.sticky&&(R+="y"),R},w=Array.isArray,x=Object.getPrototypeOf,O=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof ce<"u"?ce:(console&&console.error&&console.error('Unable to locate global object, returning "this".'),this)}();function F(D,R){var W=!!(R&&R.isStrict),V=R&&R.realm||O,L=W?S:_,U=function($,K){if(!$||typeof $!="object")return $;if(K.has($))return K.get($);var Q=$.__proto__||x($),C=Q&&Q.constructor;if(!C||C===V.Object)return L($,V,U,K);var q;if(w($)){if(W)return S($,V,U,K);q=new C,K.set($,q);for(var Y=0,oe=$.length;Y<oe;++Y)q[Y]=U($[Y],K);return q}if($ instanceof V.Date)return new C($.getTime());if($ instanceof V.RegExp)return q=new C($.source,$.flags||v($)),q.lastIndex=$.lastIndex,q;if(V.Map&&$ instanceof V.Map)return q=new C,K.set($,q),$.forEach(function(ee,G){q.set(G,U(ee,K))}),q;if(V.Set&&$ instanceof V.Set)return q=new C,K.set($,q),$.forEach(function(ee){q.add(U(ee,K))}),q;if(V.Blob&&$ instanceof V.Blob)return $.slice(0,$.size,$.type);if(V.Buffer&&V.Buffer.isBuffer($))return q=V.Buffer.allocUnsafe?V.Buffer.allocUnsafe($.length):new C($.length),K.set($,q),$.copy(q),q;if(V.ArrayBuffer){if(V.ArrayBuffer.isView($))return q=new C($.buffer.slice(0)),K.set($,q),q;if($ instanceof V.ArrayBuffer)return q=$.slice(0),K.set($,q),q}return typeof $.then=="function"||$ instanceof Error||V.WeakMap&&$ instanceof V.WeakMap||V.WeakSet&&$ instanceof V.WeakSet?$:L($,V,U,K)};return U(D,h())}return F.default=F,F.strict=function(R,W){return F(R,{isStrict:!0,realm:W?W.realm:void 0})},F})}(eo)),eo.exports}var mn={},gn={exports:{}},Ks;function Wg(){return Ks||(Ks=1,function(e,t){t=e.exports=n,t.getSerialize=r;function n(s,o,l,i){return JSON.stringify(s,r(o,i),l)}function r(s,o){var l=[],i=[];return o==null&&(o=function(u,c){return l[0]===c?"[Circular ~]":"[Circular ~."+i.slice(0,l.indexOf(c)).join(".")+"]"}),function(u,c){if(l.length>0){var a=l.indexOf(this);~a?l.splice(a+1):l.push(this),~a?i.splice(a,1/0,u):i.push(u),~l.indexOf(c)&&(c=o.call(this,u,c))}else l.push(c);return s==null?c:s.call(this,u,c)}}}(gn,gn.exports)),gn.exports}var Js;function ul(){if(Js)return mn;Js=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.default=n;var e=t(Wg());function t(r){return r&&r.__esModule?r:{default:r}}function n(r){return Object.defineProperty(r,"stringifySafe",{enumerable:!1,configurable:!1,writable:!1,value:function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,e.default)(this,s,o,(l,i)=>({sys:{type:"Link",linkType:"Entry",id:i.sys.id,circular:!0}}))}})}return mn}var Gg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vg=function(){function e(t,n){var r=[],s=!0,o=!1,l=void 0;try{for(var i=t[Symbol.iterator](),u;!(s=(u=i.next()).done)&&(r.push(u.value),!(n&&r.length===n));s=!0);}catch(c){o=!0,l=c}finally{try{!s&&i.return&&i.return()}finally{if(o)throw l}}return r}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function fr(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)}var Ur={},Qg=function(t){return t&&t.sys&&t.sys.type==="Link"},zg=function(t){return t&&t.sys&&t.sys.type==="ResourceLink"},Yg=function(t){return t.space&&t.environment?[t.type+"!"+t.id,t.space.sys.id+"!"+t.environment.sys.id+"!"+t.type+"!"+t.id]:[t.type+"!"+t.id]},Xs=function(t,n){var r=n.entryId,s=n.linkType,o=n.spaceId,l=n.environmentId;return o&&l?t.get(o+"!"+l+"!"+s+"!"+r):t.get(s+"!"+r)},Kg=function(t){var n=/.*:spaces\/([^/]+)(?:\/environments\/([^/]+))?\/entries\/([^/]+)$/;if(n.test(t)){var r=t.match(n),s=Vg(r,4);s[0];var o=s[1],l=s[2],i=l===void 0?"master":l,u=s[3];return{spaceId:o,environmentId:i,entryId:u}}},Jg=function(t,n){var r=n.sys,s=r.type,o=r.linkType;if(s==="ResourceLink"){var l=n.sys.urn,i=Kg(l),u=i.spaceId,c=i.environmentId,a=i.entryId,d=o.split(":")[1];return Xs(t,{linkType:d,entryId:a,spaceId:u,environmentId:c})||Ur}var f=n.sys.id;return Xs(t,{linkType:o,entryId:f})||Ur},Xg=function(t){if(Array.isArray(t))return t.filter(function(r){return r!==Ur});for(var n in t)t[n]===Ur&&delete t[n];return t},Zg=function e(t,n,r,s){if(n(t))return r(t);if(t&&(typeof t>"u"?"undefined":Gg(t))==="object"){for(var o in t)t.hasOwnProperty(o)&&(t[o]=e(t[o],n,r,s));s&&(t=Xg(t))}return t},ey=function(t,n,r){var s=Jg(t,n);return s===Ur?r?s:n:s},ty=function(t,n){if(!Array.isArray(n))return t;var r=Object.keys(t).filter(function(s){return n.indexOf(s)!==-1});return r.reduce(function(s,o){return s[o]=t[o],s},{})},ry=function(t,n){if(n=n||{},!t.items)return[];var r=Ot(t),s=Object.keys(r.includes||{}).reduce(function(i,u){return[].concat(fr(i),fr(t.includes[u]))},[]),o=[].concat(fr(r.items),fr(s)).filter(function(i){return!!i.sys}),l=new Map(o.reduce(function(i,u){var c=Yg(u.sys).map(function(a){return[a,u]});return i.push.apply(i,fr(c)),i},[]));return o.forEach(function(i){var u=ty(i,n.itemEntryPoints);Object.assign(i,Zg(u,function(c){return Qg(c)||zg(c)},function(c){return ey(l,c,n.removeUnresolved)},n.removeUnresolved))}),r.items};const ny=Object.freeze(Object.defineProperty({__proto__:null,default:ry},Symbol.toStringTag,{value:"Module"})),ll=qr(ny);var Zs;function iy(){if(Zs)return lr;Zs=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.wrapEntry=o,lr.wrapEntryCollection=l;var e=s(er()),t=ct,n=s(ul()),r=s(ll);function s(i){return i&&i.__esModule?i:{default:i}}function o(i){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(i)))}function l(i,u){let{resolveLinks:c,removeUnresolved:a}=u;const d=(0,n.default)((0,t.toPlainObject)((0,e.default)(i)));return c&&(d.items=(0,r.default)(d,{removeUnresolved:a,itemEntryPoints:["fields"]})),(0,t.freezeSys)(d)}return lr}var dr={},ec;function oy(){if(ec)return dr;ec=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.wrapAsset=r,dr.wrapAssetCollection=s;var e=n(er()),t=ct;function n(o){return o&&o.__esModule?o:{default:o}}function r(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}function s(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}return dr}var yn={},tc;function ay(){if(tc)return yn;tc=1,Object.defineProperty(yn,"__esModule",{value:!0}),yn.wrapAssetKey=r;var e=n(er()),t=ct;function n(s){return s&&s.__esModule?s:{default:s}}function r(s){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(s)))}return yn}var pr={},rc;function sy(){if(rc)return pr;rc=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.wrapContentType=r,pr.wrapContentTypeCollection=s;var e=n(er()),t=ct;function n(o){return o&&o.__esModule?o:{default:o}}function r(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}function s(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}return pr}var hr={},nc;function cy(){if(nc)return hr;nc=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.wrapLocale=r,hr.wrapLocaleCollection=s;var e=n(er()),t=ct;function n(o){return o&&o.__esModule?o:{default:o}}function r(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}function s(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}return hr}var mr={},ic;function uy(){if(ic)return mr;ic=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.wrapTag=r,mr.wrapTagCollection=s;var e=n(er()),t=ct;function n(o){return o&&o.__esModule?o:{default:o}}function r(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}function s(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}return mr}var oc;function ly(){if(oc)return ur;oc=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.default=void 0;var e=u(Hg()),t=u(iy()),n=u(oy()),r=u(ay()),s=u(sy()),o=u(cy()),l=u(uy());function i(a){if(typeof WeakMap!="function")return null;var d=new WeakMap,f=new WeakMap;return(i=function(p){return p?f:d})(a)}function u(a,d){if(!d&&a&&a.__esModule)return a;if(a===null||typeof a!="object"&&typeof a!="function")return{default:a};var f=i(d);if(f&&f.has(a))return f.get(a);var p={},h=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in a)if(y!=="default"&&Object.prototype.hasOwnProperty.call(a,y)){var _=h?Object.getOwnPropertyDescriptor(a,y):null;_&&(_.get||_.set)?Object.defineProperty(p,y,_):p[y]=a[y]}return p.default=a,f&&f.set(a,p),p}var c={space:e,entry:t,asset:n,assetKey:r,contentType:s,locale:o,tag:l};return ur.default=c,ur}var vn={},ac;function fy(){if(ac)return vn;ac=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.default=i;var e=ct,t=r(ll),n=r(ul());function r(d){return d&&d.__esModule?d:{default:d}}function s(d,f){var p=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);f&&(h=h.filter(function(y){return Object.getOwnPropertyDescriptor(d,y).enumerable})),p.push.apply(p,h)}return p}function o(d){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?s(Object(p),!0).forEach(function(h){l(d,h,p[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(p)):s(Object(p)).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(p,h))})}return d}function l(d,f,p){return f in d?Object.defineProperty(d,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[f]=p,d}async function i(d,f){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!f||!f.initial&&!f.nextSyncToken&&!f.nextPageToken)throw new Error("Please provide one of `initial`, `nextSyncToken` or `nextPageToken` parameters for syncing");if(f&&f.content_type&&!f.type)f.type="Entry";else if(f&&f.content_type&&f.type&&f.type!=="Entry")throw new Error("When using the `content_type` filter your `type` parameter cannot be different from `Entry`.");const h={resolveLinks:!0,removeUnresolved:!1,paginate:!0},{resolveLinks:y,removeUnresolved:_,paginate:S}=o(o({},h),p),w=await c(d,[],f,{paginate:S});y&&(w.items=(0,t.default)(w,{removeUnresolved:_,itemEntryPoints:["fields"]}));const x=u(w.items);return w.nextSyncToken&&(x.nextSyncToken=w.nextSyncToken),w.nextPageToken&&(x.nextPageToken=w.nextPageToken),(0,e.freezeSys)((0,n.default)((0,e.toPlainObject)(x)))}function u(d){const f=p=>(h,y)=>(y.sys.type===p&&h.push((0,e.toPlainObject)(y)),h);return{entries:d.reduce(f("Entry"),[]),assets:d.reduce(f("Asset"),[]),deletedEntries:d.reduce(f("DeletedEntry"),[]),deletedAssets:d.reduce(f("DeletedAsset"),[])}}async function c(d,f,p,h){let{paginate:y}=h;p.nextSyncToken&&(p.sync_token=p.nextSyncToken,delete p.nextSyncToken),p.nextPageToken&&(p.sync_token=p.nextPageToken,delete p.nextPageToken),p.sync_token&&(delete p.initial,delete p.type,delete p.content_type,delete p.limit);const S=(await d.get("sync",(0,e.createRequestConfig)({query:p}))).data||{};return f=f.concat(S.items||[]),S.nextPageUrl?y?(delete p.initial,p.sync_token=a(S.nextPageUrl),c(d,f,p,{paginate:y})):{items:f,nextPageToken:a(S.nextPageUrl)}:S.nextSyncUrl?{items:f,nextSyncToken:a(S.nextSyncUrl)}:{items:[]}}function a(d){const f=d.split("?");return f.length>0?f[1].replace("sync_token=",""):""}return vn}var _n={},sc;function dy(){if(sc)return _n;sc=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.default=r;function e(s,o){var l=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);o&&(i=i.filter(function(u){return Object.getOwnPropertyDescriptor(s,u).enumerable})),l.push.apply(l,i)}return l}function t(s){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?e(Object(l),!0).forEach(function(i){n(s,i,l[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(l)):e(Object(l)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(l,i))})}return s}function n(s,o,l){return o in s?Object.defineProperty(s,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[o]=l,s}function r(s){if(!s.select)return s;const o=Array.isArray(s.select)?s.select:s.select.split(","),l=new Set(o);return l.has("sys")?s:(l.add("sys.id"),l.add("sys.type"),t(t({},s),{},{select:[...l].join(",")}))}return _n}var qt={},cc;function py(){if(cc)return qt;cc=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.ValidationError=void 0,qt.default=t;class e extends Error{constructor(r,s){super(`Invalid "${r}" provided, `+s),this.name="ValidationError"}}qt.ValidationError=e;function t(n,r,s){if(s=s||{},typeof r!="number")throw new e(n,`only numeric values are allowed for timestamps, provided type was "${typeof r}"`);if(s.maximum&&r>s.maximum)throw new e(n,`value (${r}) cannot be further in the future than expected maximum (${s.maximum})`);if(s.now&&r<s.now)throw new e(n,`value (${r}) cannot be in the past, current time was ${s.now}`)}return qt}var uc;function hy(){if(uc)return pn;uc=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.default=a;var e=ct,t=o(ly()),n=o(fy()),r=o(dy()),s=o(py());function o(d){return d&&d.__esModule?d:{default:d}}function l(d,f){var p=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);f&&(h=h.filter(function(y){return Object.getOwnPropertyDescriptor(d,y).enumerable})),p.push.apply(p,h)}return p}function i(d){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?l(Object(p),!0).forEach(function(h){u(d,h,p[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(p)):l(Object(p)).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(p,h))})}return d}function u(d,f,p){return f in d?Object.defineProperty(d,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[f]=p,d}const c=48*60*60;function a(d){let{http:f,getGlobalOptions:p}=d;const{wrapSpace:h}=t.default.space,{wrapContentType:y,wrapContentTypeCollection:_}=t.default.contentType,{wrapEntry:S,wrapEntryCollection:v}=t.default.entry,{wrapAsset:w,wrapAssetCollection:x}=t.default.asset,{wrapTag:O,wrapTagCollection:F}=t.default.tag,{wrapAssetKey:D}=t.default.assetKey,{wrapLocaleCollection:R}=t.default.locale,W=ie=>{const re=new Error("The resource could not be found.");return re.sys={type:"Error",id:"NotFound"},re.details={type:"Entry",id:ie,environment:p().environment,space:p().space},re};async function V(){Oe(f);try{const ie=await f.get("/");return h(ie.data)}catch(ie){(0,e.errorHandler)(ie)}}async function L(ie){ae(f);try{const re=await f.get(`content_types/${ie}`);return y(re.data)}catch(re){(0,e.errorHandler)(re)}}async function U(){let ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ae(f);try{const re=await f.get("content_types",(0,e.createRequestConfig)({query:ie}));return _(re.data)}catch(re){(0,e.errorHandler)(re)}}async function $(ie){let re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!ie)throw W(ie);try{const te=await this.getEntries(i({"sys.id":ie},re));if(te.items.length>0)return S(te.items[0]);throw W(ie)}catch(te){(0,e.errorHandler)(te)}}async function K(){let ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ae(f);const{resolveLinks:re,removeUnresolved:te}=p(ie);ie=(0,r.default)(ie);try{const we=await f.get("entries",(0,e.createRequestConfig)({query:ie}));return v(we.data,{resolveLinks:re,removeUnresolved:te})}catch(we){(0,e.errorHandler)(we)}}async function Q(ie){let re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ae(f),re=(0,r.default)(re);try{const te=await f.get(`assets/${ie}`,(0,e.createRequestConfig)({query:re}));return w(te.data)}catch(te){(0,e.errorHandler)(te)}}async function C(){let ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ae(f),ie=(0,r.default)(ie);try{const re=await f.get("assets",(0,e.createRequestConfig)({query:ie}));return x(re.data)}catch(re){(0,e.errorHandler)(re)}}async function q(ie){ae(f);try{const re=await f.get(`tags/${ie}`);return O(re.data)}catch(re){(0,e.errorHandler)(re)}}async function Y(){let ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ae(f),ie=(0,r.default)(ie);try{const re=await f.get("tags",(0,e.createRequestConfig)({query:ie}));return F(re.data)}catch(re){(0,e.errorHandler)(re)}}async function oe(ie){ae(f);try{const re=Math.floor(Date.now()/1e3),te=re+c;(0,s.default)("expiresAt",ie,{maximum:te,now:re});const we={expiresAt:ie},Ne=await f.post("asset_keys",we);return D(Ne.data)}catch(re){(0,e.errorHandler)(re)}}async function ee(){let ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ae(f);try{const re=await f.get("locales",(0,e.createRequestConfig)({query:ie}));return R(re.data)}catch(re){(0,e.errorHandler)(re)}}async function G(){let ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{paginate:!0};const{resolveLinks:te,removeUnresolved:we}=p(ie);return ae(f),(0,n.default)(f,ie,i({resolveLinks:te,removeUnresolved:we},re))}function Z(ie){const{resolveLinks:re,removeUnresolved:te}=p({});return v(ie,{resolveLinks:re,removeUnresolved:te})}function ae(ie){ie.defaults.baseURL=p().environmentBaseUrl}function Oe(ie){ie.defaults.baseURL=p().spaceBaseUrl}return{getSpace:V,getContentType:L,getContentTypes:U,getEntry:$,getEntries:K,getAsset:Q,getAssets:C,getTag:q,getTags:Y,createAssetKey:oe,getLocales:ee,parseEntries:Z,sync:G}}return pn}var En={},lc;function my(){if(lc)return En;lc=1,Object.defineProperty(En,"__esModule",{value:!0}),En.default=e;function e(t){return function(r){return Object.assign({},t,r)}}return En}var fc;function gy(){if(fc)return sn;fc=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.createClient=u;var e=s(Du()),t=ct,n=s(hy()),r=s(my());function s(c){return c&&c.__esModule?c:{default:c}}function o(c,a){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(c);a&&(f=f.filter(function(p){return Object.getOwnPropertyDescriptor(c,p).enumerable})),d.push.apply(d,f)}return d}function l(c){for(var a=1;a<arguments.length;a++){var d=arguments[a]!=null?arguments[a]:{};a%2?o(Object(d),!0).forEach(function(f){i(c,f,d[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):o(Object(d)).forEach(function(f){Object.defineProperty(c,f,Object.getOwnPropertyDescriptor(d,f))})}return c}function i(c,a,d){return a in c?Object.defineProperty(c,a,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[a]=d,c}function u(c){if(!c.accessToken)throw new TypeError("Expected parameter accessToken");if(!c.space)throw new TypeError("Expected parameter space");const d=l(l({},{resolveLinks:!0,removeUnresolved:!1,defaultHostname:"cdn.contentful.com",environment:"master"}),c),f=(0,t.getUserAgentHeader)("contentful.js/9.1.34",d.application,d.integration);d.headers=l(l({},d.headers),{},{"Content-Type":"application/vnd.contentful.delivery.v1+json","X-Contentful-User-Agent":f});const p=(0,t.createHttpClient)(e.default,d),h=(0,r.default)({resolveLinks:d.resolveLinks,environment:d.environment,removeUnresolved:d.removeUnresolved,spaceBaseUrl:p.defaults.baseURL,environmentBaseUrl:`${p.defaults.baseURL}environments/${d.environment}`});return p.defaults.baseURL=h().environmentBaseUrl,(0,n.default)({http:p,getGlobalOptions:h})}return sn}var to={},ro,dc;function yy(){return dc||(dc=1,ro=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),ro}var no,pc;function vy(){if(pc)return no;pc=1;var e="%[a-f0-9]{2}",t=new RegExp("("+e+")|([^%]+?)","gi"),n=new RegExp("("+e+")+","gi");function r(l,i){try{return[decodeURIComponent(l.join(""))]}catch{}if(l.length===1)return l;i=i||1;var u=l.slice(0,i),c=l.slice(i);return Array.prototype.concat.call([],r(u),r(c))}function s(l){try{return decodeURIComponent(l)}catch{for(var i=l.match(t)||[],u=1;u<i.length;u++)l=r(i,u).join(""),i=l.match(t)||[];return l}}function o(l){for(var i={"%FE%FF":"��","%FF%FE":"��"},u=n.exec(l);u;){try{i[u[0]]=decodeURIComponent(u[0])}catch{var c=s(u[0]);c!==u[0]&&(i[u[0]]=c)}u=n.exec(l)}i["%C2"]="�";for(var a=Object.keys(i),d=0;d<a.length;d++){var f=a[d];l=l.replace(new RegExp(f,"g"),i[f])}return l}return no=function(l){if(typeof l!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof l+"`");try{return l=l.replace(/\+/g," "),decodeURIComponent(l)}catch{return o(l)}},no}var io,hc;function _y(){return hc||(hc=1,io=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const n=e.indexOf(t);return n===-1?[e]:[e.slice(0,n),e.slice(n+t.length)]}),io}var oo,mc;function Ey(){return mc||(mc=1,oo=function(e,t){for(var n={},r=Object.keys(e),s=Array.isArray(t),o=0;o<r.length;o++){var l=r[o],i=e[l];(s?t.indexOf(l)!==-1:t(l,i,e))&&(n[l]=i)}return n}),oo}var gc;function wy(){return gc||(gc=1,function(e){const t=yy(),n=vy(),r=_y(),s=Ey(),o=v=>v==null,l=Symbol("encodeFragmentIdentifier");function i(v){switch(v.arrayFormat){case"index":return w=>(x,O)=>{const F=x.length;return O===void 0||v.skipNull&&O===null||v.skipEmptyString&&O===""?x:O===null?[...x,[a(w,v),"[",F,"]"].join("")]:[...x,[a(w,v),"[",a(F,v),"]=",a(O,v)].join("")]};case"bracket":return w=>(x,O)=>O===void 0||v.skipNull&&O===null||v.skipEmptyString&&O===""?x:O===null?[...x,[a(w,v),"[]"].join("")]:[...x,[a(w,v),"[]=",a(O,v)].join("")];case"colon-list-separator":return w=>(x,O)=>O===void 0||v.skipNull&&O===null||v.skipEmptyString&&O===""?x:O===null?[...x,[a(w,v),":list="].join("")]:[...x,[a(w,v),":list=",a(O,v)].join("")];case"comma":case"separator":case"bracket-separator":{const w=v.arrayFormat==="bracket-separator"?"[]=":"=";return x=>(O,F)=>F===void 0||v.skipNull&&F===null||v.skipEmptyString&&F===""?O:(F=F===null?"":F,O.length===0?[[a(x,v),w,a(F,v)].join("")]:[[O,a(F,v)].join(v.arrayFormatSeparator)])}default:return w=>(x,O)=>O===void 0||v.skipNull&&O===null||v.skipEmptyString&&O===""?x:O===null?[...x,a(w,v)]:[...x,[a(w,v),"=",a(O,v)].join("")]}}function u(v){let w;switch(v.arrayFormat){case"index":return(x,O,F)=>{if(w=/\[(\d*)\]$/.exec(x),x=x.replace(/\[\d*\]$/,""),!w){F[x]=O;return}F[x]===void 0&&(F[x]={}),F[x][w[1]]=O};case"bracket":return(x,O,F)=>{if(w=/(\[\])$/.exec(x),x=x.replace(/\[\]$/,""),!w){F[x]=O;return}if(F[x]===void 0){F[x]=[O];return}F[x]=[].concat(F[x],O)};case"colon-list-separator":return(x,O,F)=>{if(w=/(:list)$/.exec(x),x=x.replace(/:list$/,""),!w){F[x]=O;return}if(F[x]===void 0){F[x]=[O];return}F[x]=[].concat(F[x],O)};case"comma":case"separator":return(x,O,F)=>{const D=typeof O=="string"&&O.includes(v.arrayFormatSeparator),R=typeof O=="string"&&!D&&d(O,v).includes(v.arrayFormatSeparator);O=R?d(O,v):O;const W=D||R?O.split(v.arrayFormatSeparator).map(V=>d(V,v)):O===null?O:d(O,v);F[x]=W};case"bracket-separator":return(x,O,F)=>{const D=/(\[\])$/.test(x);if(x=x.replace(/\[\]$/,""),!D){F[x]=O&&d(O,v);return}const R=O===null?[]:O.split(v.arrayFormatSeparator).map(W=>d(W,v));if(F[x]===void 0){F[x]=R;return}F[x]=[].concat(F[x],R)};default:return(x,O,F)=>{if(F[x]===void 0){F[x]=O;return}F[x]=[].concat(F[x],O)}}}function c(v){if(typeof v!="string"||v.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function a(v,w){return w.encode?w.strict?t(v):encodeURIComponent(v):v}function d(v,w){return w.decode?n(v):v}function f(v){return Array.isArray(v)?v.sort():typeof v=="object"?f(Object.keys(v)).sort((w,x)=>Number(w)-Number(x)).map(w=>v[w]):v}function p(v){const w=v.indexOf("#");return w!==-1&&(v=v.slice(0,w)),v}function h(v){let w="";const x=v.indexOf("#");return x!==-1&&(w=v.slice(x)),w}function y(v){v=p(v);const w=v.indexOf("?");return w===-1?"":v.slice(w+1)}function _(v,w){return w.parseNumbers&&!Number.isNaN(Number(v))&&typeof v=="string"&&v.trim()!==""?v=Number(v):w.parseBooleans&&v!==null&&(v.toLowerCase()==="true"||v.toLowerCase()==="false")&&(v=v.toLowerCase()==="true"),v}function S(v,w){w=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},w),c(w.arrayFormatSeparator);const x=u(w),O=Object.create(null);if(typeof v!="string"||(v=v.trim().replace(/^[?#&]/,""),!v))return O;for(const F of v.split("&")){if(F==="")continue;let[D,R]=r(w.decode?F.replace(/\+/g," "):F,"=");R=R===void 0?null:["comma","separator","bracket-separator"].includes(w.arrayFormat)?R:d(R,w),x(d(D,w),R,O)}for(const F of Object.keys(O)){const D=O[F];if(typeof D=="object"&&D!==null)for(const R of Object.keys(D))D[R]=_(D[R],w);else O[F]=_(D,w)}return w.sort===!1?O:(w.sort===!0?Object.keys(O).sort():Object.keys(O).sort(w.sort)).reduce((F,D)=>{const R=O[D];return R&&typeof R=="object"&&!Array.isArray(R)?F[D]=f(R):F[D]=R,F},Object.create(null))}e.extract=y,e.parse=S,e.stringify=(v,w)=>{if(!v)return"";w=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},w),c(w.arrayFormatSeparator);const x=R=>w.skipNull&&o(v[R])||w.skipEmptyString&&v[R]==="",O=i(w),F={};for(const R of Object.keys(v))x(R)||(F[R]=v[R]);const D=Object.keys(F);return w.sort!==!1&&D.sort(w.sort),D.map(R=>{const W=v[R];return W===void 0?"":W===null?a(R,w):Array.isArray(W)?W.length===0&&w.arrayFormat==="bracket-separator"?a(R,w)+"[]":W.reduce(O(R),[]).join("&"):a(R,w)+"="+a(W,w)}).filter(R=>R.length>0).join("&")},e.parseUrl=(v,w)=>{w=Object.assign({decode:!0},w);const[x,O]=r(v,"#");return Object.assign({url:x.split("?")[0]||"",query:S(y(v),w)},w&&w.parseFragmentIdentifier&&O?{fragmentIdentifier:d(O,w)}:{})},e.stringifyUrl=(v,w)=>{w=Object.assign({encode:!0,strict:!0,[l]:!0},w);const x=p(v.url).split("?")[0]||"",O=e.extract(v.url),F=e.parse(O,{sort:!1}),D=Object.assign(F,v.query);let R=e.stringify(D,w);R&&(R=`?${R}`);let W=h(v.url);return v.fragmentIdentifier&&(W=`#${w[l]?a(v.fragmentIdentifier,w):v.fragmentIdentifier}`),`${x}${R}${W}`},e.pick=(v,w,x)=>{x=Object.assign({parseFragmentIdentifier:!0,[l]:!1},x);const{url:O,query:F,fragmentIdentifier:D}=e.parseUrl(v,x);return e.stringifyUrl({url:O,query:s(F,w),fragmentIdentifier:D},x)},e.exclude=(v,w,x)=>{const O=Array.isArray(w)?F=>!w.includes(F):(F,D)=>!w(F,D);return e.pick(v,O,x)}}(to)),to}var yc;function by(){return yc||(yc=1,function(e,t){(function(n,r){e.exports=r(gy(),wy())})(ce,function(n,r){return function(){var s={897:function(u){u.exports=n},48:function(u){u.exports=r}},o={};function l(u){var c=o[u];if(c!==void 0)return c.exports;var a=o[u]={exports:{}};return s[u](a,a.exports,l),a.exports}l.d=function(u,c){for(var a in c)l.o(c,a)&&!l.o(u,a)&&Object.defineProperty(u,a,{enumerable:!0,get:c[a]})},l.o=function(u,c){return Object.prototype.hasOwnProperty.call(u,c)},l.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})};var i={};return function(){l.r(i),l.d(i,{getEntries:function(){return K},getEntry:function(){return $},setContext:function(){return y}});var u=l(897),c=l(48),a={CONTENTFUL:{ENVIRONMENTS_MAPING:{beta:"beta",rc:"rc",live:"master",local:"beta"},LOCALES:{DEFAULT:"en",SUPPORTED:["en","es","fr","pt"]},SPACE:"txbhe1wabmyx",HOSTS:{CDN:"cdn.contentful.com",PREVIEW:"preview.contentful.com"}}};const{CONTENTFUL:{ENVIRONMENTS_MAPING:d,SPACE:f,HOSTS:p}}=a;let h={apiKey:null,previewKey:null,environment:null,isPreview:!1,host:p.CDN,space:f};const y=({apiKey:Q,environment:C,isPreview:q=!1,location:Y,previewKey:oe,space:ee=null})=>{h.apiKey=Q,h.previewKey=oe,h.environment=(G=>{if(!G)throw new Error("Cannot map environment: Environment not defined");if(!d[G])throw new Error(`Cannot map environment: No mapping found for environment ${G}`);return d[G]})(C),h.isPreview=q||(G=>{let Z=!1;if(G&&G.search){const ae=(0,c.parse)(G.search);Z=ae.isPreview&&ae.isPreview==="true"}return Z})(Y),h.space=ee||f},_=(Q=!1)=>{const{apiKey:C,environment:q,isPreview:Y,previewKey:oe,space:ee}=h;return Y===!0||Q===!0?{accessToken:oe,environment:q,host:p.PREVIEW,space:ee}:{accessToken:C,environment:q,host:p.CDN,space:ee}},S=Q=>typeof Q=="object"&&Q!==null,v=Q=>Array.isArray(Q)&&Q.length,w=Q=>{if(!S(Q))throw new Error("Cannot flatten fields");const{fields:C,sys:q}=Q;if(!C)throw new Error("Cannot flatten fields");let Y={...C};if(S(q)){const{contentType:oe,createdAt:ee,updatedAt:G}=q;oe&&Object.assign(Y,{contentType:oe.sys.id}),ee&&Object.assign(Y,{createdAt:ee}),G&&Object.assign(Y,{updatedAt:G})}return Y},{CONTENTFUL:{LOCALES:x}}=a,O=(Q,C)=>S(Q)&&((q,Y)=>Object.prototype.hasOwnProperty.call(q,Y))(Q,C),F=(Q,C)=>{const q=(Y=>x.SUPPORTED.includes(Y)?Y:x.DEFAULT)(C);return O(Q,q)?Q[q]:O(Q,x.DEFAULT)?Q[x.DEFAULT]:Q},D=Q=>S(Q)&&Q.sys&&Q.sys.type==="Asset",R=(Q,C,q)=>{const{title:Y,file:oe}=w(Q);if(!oe)throw new Error("Cannot flatten asset");const{contentType:ee,fileName:G,url:Z,details:ae}=F(oe,C);if(!Z)throw new Error("Cannot flatten asset");return q?{description:Y||G,height:ae&&ae.image&&ae.image.height,type:ee,url:Z,width:ae&&ae.image&&ae.image.width}:Z},W=Q=>S(Q)&&Q.sys&&Q.sys.type==="Entry",V=(Q,C,q)=>{const Y={},oe=((ee,G)=>{const Z={};for(const[ae,Oe]of Object.entries(ee))Z[ae]=F(Oe,G);return Z})(w(Q),C);for(const[ee,G]of Object.entries(oe))D(G)?Y[ee]=R(G,C,q):W(G)?Y[ee]=V(G,C,q):v(G)?Y[ee]=G.map(Z=>D(Z)?R(Z,C,q):W(Z)?V(Z,C,q):Z):Y[ee]=G;return Y},L=({items:Q})=>{if(!v(Q))throw new Error("Cannot read items");return Q},U=async(Q,C)=>{const q=_(C);return await(await(0,u.createClient)(q)).getEntries(Q)},$=async(Q={},C={},q=!1)=>((Y,{flatten:oe=!0,locale:ee="en",assetDetails:G=!1})=>{const Z=L(Y);return oe?V(Z[0],ee,G):Z[0]})(await U(Q,q),{...Q,...C}),K=async(Q={},C={},q=!1)=>((Y,{flatten:oe=!0,locale:ee="en",assetDetails:G=!1})=>{const Z=L(Y);return oe?((ae,Oe,ie)=>ae.map(re=>V(re,Oe,ie)))(Z,ee,G):Z})(await U(Q,q),{...Q,...C})}(),i}()})}(li)),li.exports}var ao={exports:{}},so={exports:{}},co={exports:{}},uo={exports:{}},vc;function va(){return vc||(vc=1,function(e,t){(function(n,r){e.exports=r()})(ce,function(){function n(y){return!isNaN(parseFloat(y))&&isFinite(y)}function r(y){return y.charAt(0).toUpperCase()+y.substring(1)}function s(y){return function(){return this[y]}}var o=["isConstructor","isEval","isNative","isToplevel"],l=["columnNumber","lineNumber"],i=["fileName","functionName","source"],u=["args"],c=["evalOrigin"],a=o.concat(l,i,u,c);function d(y){if(y)for(var _=0;_<a.length;_++)y[a[_]]!==void 0&&this["set"+r(a[_])](y[a[_]])}d.prototype={getArgs:function(){return this.args},setArgs:function(y){if(Object.prototype.toString.call(y)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=y},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(y){if(y instanceof d)this.evalOrigin=y;else if(y instanceof Object)this.evalOrigin=new d(y);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var y=this.getFileName()||"",_=this.getLineNumber()||"",S=this.getColumnNumber()||"",v=this.getFunctionName()||"";return this.getIsEval()?y?"[eval] ("+y+":"+_+":"+S+")":"[eval]:"+_+":"+S:v?v+" ("+y+":"+_+":"+S+")":y+":"+_+":"+S}},d.fromString=function(_){var S=_.indexOf("("),v=_.lastIndexOf(")"),w=_.substring(0,S),x=_.substring(S+1,v).split(","),O=_.substring(v+1);if(O.indexOf("@")===0)var F=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(O,""),D=F[1],R=F[2],W=F[3];return new d({functionName:w,args:x||void 0,fileName:D,lineNumber:R||void 0,columnNumber:W||void 0})};for(var f=0;f<o.length;f++)d.prototype["get"+r(o[f])]=s(o[f]),d.prototype["set"+r(o[f])]=function(y){return function(_){this[y]=!!_}}(o[f]);for(var p=0;p<l.length;p++)d.prototype["get"+r(l[p])]=s(l[p]),d.prototype["set"+r(l[p])]=function(y){return function(_){if(!n(_))throw new TypeError(y+" must be a Number");this[y]=Number(_)}}(l[p]);for(var h=0;h<i.length;h++)d.prototype["get"+r(i[h])]=s(i[h]),d.prototype["set"+r(i[h])]=function(y){return function(_){this[y]=String(_)}}(i[h]);return d})}(uo)),uo.exports}var _c;function Sy(){return _c||(_c=1,function(e,t){(function(n,r){e.exports=r(va())})(ce,function(r){var s=/(^|@)\S+:\d+/,o=/^\s*at .*(\S+:\d+|\(native\))/m,l=/^(eval@)?(\[native code])?$/;return{parse:function(u){if(typeof u.stacktrace<"u"||typeof u["opera#sourceloc"]<"u")return this.parseOpera(u);if(u.stack&&u.stack.match(o))return this.parseV8OrIE(u);if(u.stack)return this.parseFFOrSafari(u);throw new Error("Cannot parse given Error object")},extractLocation:function(u){if(u.indexOf(":")===-1)return[u];var c=/(.+?)(?::(\d+))?(?::(\d+))?$/,a=c.exec(u.replace(/[()]/g,""));return[a[1],a[2]||void 0,a[3]||void 0]},parseV8OrIE:function(u){var c=u.stack.split(`
|
|
41
|
+
`),n}return!0}function ul(e){var t=Object.getOwnPropertyNames(e),n=Sg(t),r;try{for(n.s();!(r=n.n()).done;){var s=r.value,o=e[s];o&&Yo(o)==="object"&&ul(o)}}catch(l){n.e(l)}finally{n.f()}return Object.freeze(e)}function Dg(e){return ul(e.sys||{}),e}function zs(){var e=Cg();if(!e)return null;var t=e.navigator.userAgent,n=e.navigator.platform,r=["Macintosh","MacIntel","MacPPC","Mac68K"],s=["Win32","Win64","Windows","WinCE"],o=["iPhone","iPad","iPod"];return r.indexOf(n)!==-1?"macOS":o.indexOf(n)!==-1?"iOS":s.indexOf(n)!==-1?"Windows":/Android/.test(t)?"Android":/Linux/.test(n)?"Linux":null}function Ug(){var e=process.platform||"linux",t=process.version||"0.0.0",n={android:"Android",aix:"Linux",darwin:"macOS",freebsd:"Linux",linux:"Linux",openbsd:"Linux",sunos:"Linux",win32:"Windows"};return e in n?"".concat(n[e]||"Linux","/").concat(t):null}function Bg(e,t,n,r){var s=[];t&&s.push("app ".concat(t)),n&&s.push("integration ".concat(n)),r&&s.push("feature "+r),s.push("sdk ".concat(e));var o=null;try{Ag()?(o=zs(),s.push("platform ReactNative")):xg()?(o=Ug(),s.push("platform node.js/".concat(Rg()))):(o=zs(),s.push("platform browser"))}catch{o=null}return o&&s.push("os ".concat(o)),"".concat(s.filter(function(l){return l!==""}).join("; "),";")}function $g(e){return Object.defineProperty(e,"toPlainObject",{enumerable:!1,configurable:!1,writable:!1,value:function(){return Ot(this)}})}function qg(e){var t=e.config,n=e.response,r;if(t&&t.headers&&t.headers.Authorization){var s="...".concat(t.headers.Authorization.toString().substr(-5));t.headers.Authorization="Bearer ".concat(s)}if(!dn(n)||!dn(t))throw e;var o=n==null?void 0:n.data,l={status:n==null?void 0:n.status,statusText:n==null?void 0:n.statusText,message:"",details:{}};dn(t)&&(l.request={url:t.url,headers:t.headers,method:t.method,payloadData:t.data}),o&&dn(o)&&("requestId"in o&&(l.requestId=o.requestId||"UNKNOWN"),"message"in o&&(l.message=o.message||""),"details"in o&&(l.details=o.details||{}),"sys"in o&&"id"in o.sys&&(r=o.sys.id));var i=new Error;i.name=r&&r!=="Unknown"?r:"".concat(n==null?void 0:n.status," ").concat(n==null?void 0:n.statusText);try{i.message=JSON.stringify(l,null," ")}catch{var u;i.message=(u=l==null?void 0:l.message)!==null&&u!==void 0?u:""}throw i}const Hg=Object.freeze(Object.defineProperty({__proto__:null,createHttpClient:cl,createRequestConfig:jg,enforceObjPath:Mg,errorHandler:qg,freezeSys:Dg,getUserAgentHeader:Bg,toPlainObject:$g},Symbol.toStringTag,{value:"Module"})),ct=qr(Hg);var pn={},ur={},hn={},Ys;function Wg(){if(Ys)return hn;Ys=1,Object.defineProperty(hn,"__esModule",{value:!0}),hn.wrapSpace=t;var e=ct;function t(n){return(0,e.freezeSys)((0,e.toPlainObject)(n))}return hn}var lr={},eo={exports:{}},Ks;function er(){return Ks||(Ks=1,function(e,t){(function(n,r){e.exports=r()})(ce,function(){var n=Function.prototype.toString,r=Object.create,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,u=Object.getPrototypeOf,c=Object.prototype,a=c.hasOwnProperty,d=c.propertyIsEnumerable,f=typeof i=="function",p=typeof WeakMap=="function",h=function(){if(p)return function(){return new WeakMap};var D=function(){function R(){this._keys=[],this._values=[]}return R.prototype.has=function(W){return!!~this._keys.indexOf(W)},R.prototype.get=function(W){return this._values[this._keys.indexOf(W)]},R.prototype.set=function(W,Q){this._keys.push(W),this._values.push(Q)},R}();return function(){return new D}}(),y=function(D,R){var W=D.__proto__||u(D);if(!W)return r(null);var Q=W.constructor;if(Q===R.Object)return W===R.Object.prototype?{}:r(W);if(~n.call(Q).indexOf("[native code]"))try{return new Q}catch{}return r(W)},_=function(D,R,W,Q){var k=y(D,R);Q.set(D,k);for(var U in D)a.call(D,U)&&(k[U]=W(D[U],Q));if(f)for(var $=i(D),K=0,V=$.length,C=void 0;K<V;++K)C=$[K],d.call(D,C)&&(k[C]=W(D[C],Q));return k},S=function(D,R,W,Q){var k=y(D,R);Q.set(D,k);for(var U=f?l(D).concat(i(D)):l(D),$=0,K=U.length,V=void 0,C=void 0;$<K;++$)if(V=U[$],V!=="callee"&&V!=="caller")if(C=o(D,V),C){!C.get&&!C.set&&(C.value=W(D[V],Q));try{s(k,V,C)}catch{k[V]=C.value}}else k[V]=W(D[V],Q);return k},v=function(D){var R="";return D.global&&(R+="g"),D.ignoreCase&&(R+="i"),D.multiline&&(R+="m"),D.unicode&&(R+="u"),D.sticky&&(R+="y"),R},w=Array.isArray,x=Object.getPrototypeOf,O=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof ce<"u"?ce:(console&&console.error&&console.error('Unable to locate global object, returning "this".'),this)}();function F(D,R){var W=!!(R&&R.isStrict),Q=R&&R.realm||O,k=W?S:_,U=function($,K){if(!$||typeof $!="object")return $;if(K.has($))return K.get($);var V=$.__proto__||x($),C=V&&V.constructor;if(!C||C===Q.Object)return k($,Q,U,K);var q;if(w($)){if(W)return S($,Q,U,K);q=new C,K.set($,q);for(var Y=0,oe=$.length;Y<oe;++Y)q[Y]=U($[Y],K);return q}if($ instanceof Q.Date)return new C($.getTime());if($ instanceof Q.RegExp)return q=new C($.source,$.flags||v($)),q.lastIndex=$.lastIndex,q;if(Q.Map&&$ instanceof Q.Map)return q=new C,K.set($,q),$.forEach(function(re,G){q.set(G,U(re,K))}),q;if(Q.Set&&$ instanceof Q.Set)return q=new C,K.set($,q),$.forEach(function(re){q.add(U(re,K))}),q;if(Q.Blob&&$ instanceof Q.Blob)return $.slice(0,$.size,$.type);if(Q.Buffer&&Q.Buffer.isBuffer($))return q=Q.Buffer.allocUnsafe?Q.Buffer.allocUnsafe($.length):new C($.length),K.set($,q),$.copy(q),q;if(Q.ArrayBuffer){if(Q.ArrayBuffer.isView($))return q=new C($.buffer.slice(0)),K.set($,q),q;if($ instanceof Q.ArrayBuffer)return q=$.slice(0),K.set($,q),q}return typeof $.then=="function"||$ instanceof Error||Q.WeakMap&&$ instanceof Q.WeakMap||Q.WeakSet&&$ instanceof Q.WeakSet?$:k($,Q,U,K)};return U(D,h())}return F.default=F,F.strict=function(R,W){return F(R,{isStrict:!0,realm:W?W.realm:void 0})},F})}(eo)),eo.exports}var mn={},gn={exports:{}},Js;function Gg(){return Js||(Js=1,function(e,t){t=e.exports=n,t.getSerialize=r;function n(s,o,l,i){return JSON.stringify(s,r(o,i),l)}function r(s,o){var l=[],i=[];return o==null&&(o=function(u,c){return l[0]===c?"[Circular ~]":"[Circular ~."+i.slice(0,l.indexOf(c)).join(".")+"]"}),function(u,c){if(l.length>0){var a=l.indexOf(this);~a?l.splice(a+1):l.push(this),~a?i.splice(a,1/0,u):i.push(u),~l.indexOf(c)&&(c=o.call(this,u,c))}else l.push(c);return s==null?c:s.call(this,u,c)}}}(gn,gn.exports)),gn.exports}var Xs;function ll(){if(Xs)return mn;Xs=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.default=n;var e=t(Gg());function t(r){return r&&r.__esModule?r:{default:r}}function n(r){return Object.defineProperty(r,"stringifySafe",{enumerable:!1,configurable:!1,writable:!1,value:function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,e.default)(this,s,o,(l,i)=>({sys:{type:"Link",linkType:"Entry",id:i.sys.id,circular:!0}}))}})}return mn}var Vg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qg=function(){function e(t,n){var r=[],s=!0,o=!1,l=void 0;try{for(var i=t[Symbol.iterator](),u;!(s=(u=i.next()).done)&&(r.push(u.value),!(n&&r.length===n));s=!0);}catch(c){o=!0,l=c}finally{try{!s&&i.return&&i.return()}finally{if(o)throw l}}return r}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function fr(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)}var Ur={},zg=function(t){return t&&t.sys&&t.sys.type==="Link"},Yg=function(t){return t&&t.sys&&t.sys.type==="ResourceLink"},Kg=function(t){return t.space&&t.environment?[t.type+"!"+t.id,t.space.sys.id+"!"+t.environment.sys.id+"!"+t.type+"!"+t.id]:[t.type+"!"+t.id]},Zs=function(t,n){var r=n.entryId,s=n.linkType,o=n.spaceId,l=n.environmentId;return o&&l?t.get(o+"!"+l+"!"+s+"!"+r):t.get(s+"!"+r)},Jg=function(t){var n=/.*:spaces\/([^/]+)(?:\/environments\/([^/]+))?\/entries\/([^/]+)$/;if(n.test(t)){var r=t.match(n),s=Qg(r,4);s[0];var o=s[1],l=s[2],i=l===void 0?"master":l,u=s[3];return{spaceId:o,environmentId:i,entryId:u}}},Xg=function(t,n){var r=n.sys,s=r.type,o=r.linkType;if(s==="ResourceLink"){var l=n.sys.urn,i=Jg(l),u=i.spaceId,c=i.environmentId,a=i.entryId,d=o.split(":")[1];return Zs(t,{linkType:d,entryId:a,spaceId:u,environmentId:c})||Ur}var f=n.sys.id;return Zs(t,{linkType:o,entryId:f})||Ur},Zg=function(t){if(Array.isArray(t))return t.filter(function(r){return r!==Ur});for(var n in t)t[n]===Ur&&delete t[n];return t},ey=function e(t,n,r,s){if(n(t))return r(t);if(t&&(typeof t>"u"?"undefined":Vg(t))==="object"){for(var o in t)t.hasOwnProperty(o)&&(t[o]=e(t[o],n,r,s));s&&(t=Zg(t))}return t},ty=function(t,n,r){var s=Xg(t,n);return s===Ur?r?s:n:s},ry=function(t,n){if(!Array.isArray(n))return t;var r=Object.keys(t).filter(function(s){return n.indexOf(s)!==-1});return r.reduce(function(s,o){return s[o]=t[o],s},{})},ny=function(t,n){if(n=n||{},!t.items)return[];var r=Ot(t),s=Object.keys(r.includes||{}).reduce(function(i,u){return[].concat(fr(i),fr(t.includes[u]))},[]),o=[].concat(fr(r.items),fr(s)).filter(function(i){return!!i.sys}),l=new Map(o.reduce(function(i,u){var c=Kg(u.sys).map(function(a){return[a,u]});return i.push.apply(i,fr(c)),i},[]));return o.forEach(function(i){var u=ry(i,n.itemEntryPoints);Object.assign(i,ey(u,function(c){return zg(c)||Yg(c)},function(c){return ty(l,c,n.removeUnresolved)},n.removeUnresolved))}),r.items};const iy=Object.freeze(Object.defineProperty({__proto__:null,default:ny},Symbol.toStringTag,{value:"Module"})),fl=qr(iy);var ec;function oy(){if(ec)return lr;ec=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.wrapEntry=o,lr.wrapEntryCollection=l;var e=s(er()),t=ct,n=s(ll()),r=s(fl);function s(i){return i&&i.__esModule?i:{default:i}}function o(i){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(i)))}function l(i,u){let{resolveLinks:c,removeUnresolved:a}=u;const d=(0,n.default)((0,t.toPlainObject)((0,e.default)(i)));return c&&(d.items=(0,r.default)(d,{removeUnresolved:a,itemEntryPoints:["fields"]})),(0,t.freezeSys)(d)}return lr}var dr={},tc;function ay(){if(tc)return dr;tc=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.wrapAsset=r,dr.wrapAssetCollection=s;var e=n(er()),t=ct;function n(o){return o&&o.__esModule?o:{default:o}}function r(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}function s(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}return dr}var yn={},rc;function sy(){if(rc)return yn;rc=1,Object.defineProperty(yn,"__esModule",{value:!0}),yn.wrapAssetKey=r;var e=n(er()),t=ct;function n(s){return s&&s.__esModule?s:{default:s}}function r(s){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(s)))}return yn}var pr={},nc;function cy(){if(nc)return pr;nc=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.wrapContentType=r,pr.wrapContentTypeCollection=s;var e=n(er()),t=ct;function n(o){return o&&o.__esModule?o:{default:o}}function r(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}function s(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}return pr}var hr={},ic;function uy(){if(ic)return hr;ic=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.wrapLocale=r,hr.wrapLocaleCollection=s;var e=n(er()),t=ct;function n(o){return o&&o.__esModule?o:{default:o}}function r(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}function s(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}return hr}var mr={},oc;function ly(){if(oc)return mr;oc=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.wrapTag=r,mr.wrapTagCollection=s;var e=n(er()),t=ct;function n(o){return o&&o.__esModule?o:{default:o}}function r(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}function s(o){return(0,t.freezeSys)((0,t.toPlainObject)((0,e.default)(o)))}return mr}var ac;function fy(){if(ac)return ur;ac=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.default=void 0;var e=u(Wg()),t=u(oy()),n=u(ay()),r=u(sy()),s=u(cy()),o=u(uy()),l=u(ly());function i(a){if(typeof WeakMap!="function")return null;var d=new WeakMap,f=new WeakMap;return(i=function(p){return p?f:d})(a)}function u(a,d){if(!d&&a&&a.__esModule)return a;if(a===null||typeof a!="object"&&typeof a!="function")return{default:a};var f=i(d);if(f&&f.has(a))return f.get(a);var p={},h=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in a)if(y!=="default"&&Object.prototype.hasOwnProperty.call(a,y)){var _=h?Object.getOwnPropertyDescriptor(a,y):null;_&&(_.get||_.set)?Object.defineProperty(p,y,_):p[y]=a[y]}return p.default=a,f&&f.set(a,p),p}var c={space:e,entry:t,asset:n,assetKey:r,contentType:s,locale:o,tag:l};return ur.default=c,ur}var vn={},sc;function dy(){if(sc)return vn;sc=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.default=i;var e=ct,t=r(fl),n=r(ll());function r(d){return d&&d.__esModule?d:{default:d}}function s(d,f){var p=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);f&&(h=h.filter(function(y){return Object.getOwnPropertyDescriptor(d,y).enumerable})),p.push.apply(p,h)}return p}function o(d){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?s(Object(p),!0).forEach(function(h){l(d,h,p[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(p)):s(Object(p)).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(p,h))})}return d}function l(d,f,p){return f in d?Object.defineProperty(d,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[f]=p,d}async function i(d,f){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!f||!f.initial&&!f.nextSyncToken&&!f.nextPageToken)throw new Error("Please provide one of `initial`, `nextSyncToken` or `nextPageToken` parameters for syncing");if(f&&f.content_type&&!f.type)f.type="Entry";else if(f&&f.content_type&&f.type&&f.type!=="Entry")throw new Error("When using the `content_type` filter your `type` parameter cannot be different from `Entry`.");const h={resolveLinks:!0,removeUnresolved:!1,paginate:!0},{resolveLinks:y,removeUnresolved:_,paginate:S}=o(o({},h),p),w=await c(d,[],f,{paginate:S});y&&(w.items=(0,t.default)(w,{removeUnresolved:_,itemEntryPoints:["fields"]}));const x=u(w.items);return w.nextSyncToken&&(x.nextSyncToken=w.nextSyncToken),w.nextPageToken&&(x.nextPageToken=w.nextPageToken),(0,e.freezeSys)((0,n.default)((0,e.toPlainObject)(x)))}function u(d){const f=p=>(h,y)=>(y.sys.type===p&&h.push((0,e.toPlainObject)(y)),h);return{entries:d.reduce(f("Entry"),[]),assets:d.reduce(f("Asset"),[]),deletedEntries:d.reduce(f("DeletedEntry"),[]),deletedAssets:d.reduce(f("DeletedAsset"),[])}}async function c(d,f,p,h){let{paginate:y}=h;p.nextSyncToken&&(p.sync_token=p.nextSyncToken,delete p.nextSyncToken),p.nextPageToken&&(p.sync_token=p.nextPageToken,delete p.nextPageToken),p.sync_token&&(delete p.initial,delete p.type,delete p.content_type,delete p.limit);const S=(await d.get("sync",(0,e.createRequestConfig)({query:p}))).data||{};return f=f.concat(S.items||[]),S.nextPageUrl?y?(delete p.initial,p.sync_token=a(S.nextPageUrl),c(d,f,p,{paginate:y})):{items:f,nextPageToken:a(S.nextPageUrl)}:S.nextSyncUrl?{items:f,nextSyncToken:a(S.nextSyncUrl)}:{items:[]}}function a(d){const f=d.split("?");return f.length>0?f[1].replace("sync_token=",""):""}return vn}var _n={},cc;function py(){if(cc)return _n;cc=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.default=r;function e(s,o){var l=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);o&&(i=i.filter(function(u){return Object.getOwnPropertyDescriptor(s,u).enumerable})),l.push.apply(l,i)}return l}function t(s){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?e(Object(l),!0).forEach(function(i){n(s,i,l[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(l)):e(Object(l)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(l,i))})}return s}function n(s,o,l){return o in s?Object.defineProperty(s,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[o]=l,s}function r(s){if(!s.select)return s;const o=Array.isArray(s.select)?s.select:s.select.split(","),l=new Set(o);return l.has("sys")?s:(l.add("sys.id"),l.add("sys.type"),t(t({},s),{},{select:[...l].join(",")}))}return _n}var qt={},uc;function hy(){if(uc)return qt;uc=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.ValidationError=void 0,qt.default=t;class e extends Error{constructor(r,s){super(`Invalid "${r}" provided, `+s),this.name="ValidationError"}}qt.ValidationError=e;function t(n,r,s){if(s=s||{},typeof r!="number")throw new e(n,`only numeric values are allowed for timestamps, provided type was "${typeof r}"`);if(s.maximum&&r>s.maximum)throw new e(n,`value (${r}) cannot be further in the future than expected maximum (${s.maximum})`);if(s.now&&r<s.now)throw new e(n,`value (${r}) cannot be in the past, current time was ${s.now}`)}return qt}var lc;function my(){if(lc)return pn;lc=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.default=a;var e=ct,t=o(fy()),n=o(dy()),r=o(py()),s=o(hy());function o(d){return d&&d.__esModule?d:{default:d}}function l(d,f){var p=Object.keys(d);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(d);f&&(h=h.filter(function(y){return Object.getOwnPropertyDescriptor(d,y).enumerable})),p.push.apply(p,h)}return p}function i(d){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?l(Object(p),!0).forEach(function(h){u(d,h,p[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(p)):l(Object(p)).forEach(function(h){Object.defineProperty(d,h,Object.getOwnPropertyDescriptor(p,h))})}return d}function u(d,f,p){return f in d?Object.defineProperty(d,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[f]=p,d}const c=48*60*60;function a(d){let{http:f,getGlobalOptions:p}=d;const{wrapSpace:h}=t.default.space,{wrapContentType:y,wrapContentTypeCollection:_}=t.default.contentType,{wrapEntry:S,wrapEntryCollection:v}=t.default.entry,{wrapAsset:w,wrapAssetCollection:x}=t.default.asset,{wrapTag:O,wrapTagCollection:F}=t.default.tag,{wrapAssetKey:D}=t.default.assetKey,{wrapLocaleCollection:R}=t.default.locale,W=ee=>{const te=new Error("The resource could not be found.");return te.sys={type:"Error",id:"NotFound"},te.details={type:"Entry",id:ee,environment:p().environment,space:p().space},te};async function Q(){be(f);try{const ee=await f.get("/");return h(ee.data)}catch(ee){(0,e.errorHandler)(ee)}}async function k(ee){ae(f);try{const te=await f.get(`content_types/${ee}`);return y(te.data)}catch(te){(0,e.errorHandler)(te)}}async function U(){let ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ae(f);try{const te=await f.get("content_types",(0,e.createRequestConfig)({query:ee}));return _(te.data)}catch(te){(0,e.errorHandler)(te)}}async function $(ee){let te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!ee)throw W(ee);try{const Z=await this.getEntries(i({"sys.id":ee},te));if(Z.items.length>0)return S(Z.items[0]);throw W(ee)}catch(Z){(0,e.errorHandler)(Z)}}async function K(){let ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ae(f);const{resolveLinks:te,removeUnresolved:Z}=p(ee);ee=(0,r.default)(ee);try{const he=await f.get("entries",(0,e.createRequestConfig)({query:ee}));return v(he.data,{resolveLinks:te,removeUnresolved:Z})}catch(he){(0,e.errorHandler)(he)}}async function V(ee){let te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ae(f),te=(0,r.default)(te);try{const Z=await f.get(`assets/${ee}`,(0,e.createRequestConfig)({query:te}));return w(Z.data)}catch(Z){(0,e.errorHandler)(Z)}}async function C(){let ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ae(f),ee=(0,r.default)(ee);try{const te=await f.get("assets",(0,e.createRequestConfig)({query:ee}));return x(te.data)}catch(te){(0,e.errorHandler)(te)}}async function q(ee){ae(f);try{const te=await f.get(`tags/${ee}`);return O(te.data)}catch(te){(0,e.errorHandler)(te)}}async function Y(){let ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ae(f),ee=(0,r.default)(ee);try{const te=await f.get("tags",(0,e.createRequestConfig)({query:ee}));return F(te.data)}catch(te){(0,e.errorHandler)(te)}}async function oe(ee){ae(f);try{const te=Math.floor(Date.now()/1e3),Z=te+c;(0,s.default)("expiresAt",ee,{maximum:Z,now:te});const he={expiresAt:ee},Ae=await f.post("asset_keys",he);return D(Ae.data)}catch(te){(0,e.errorHandler)(te)}}async function re(){let ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ae(f);try{const te=await f.get("locales",(0,e.createRequestConfig)({query:ee}));return R(te.data)}catch(te){(0,e.errorHandler)(te)}}async function G(){let ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{paginate:!0};const{resolveLinks:Z,removeUnresolved:he}=p(ee);return ae(f),(0,n.default)(f,ee,i({resolveLinks:Z,removeUnresolved:he},te))}function ie(ee){const{resolveLinks:te,removeUnresolved:Z}=p({});return v(ee,{resolveLinks:te,removeUnresolved:Z})}function ae(ee){ee.defaults.baseURL=p().environmentBaseUrl}function be(ee){ee.defaults.baseURL=p().spaceBaseUrl}return{getSpace:Q,getContentType:k,getContentTypes:U,getEntry:$,getEntries:K,getAsset:V,getAssets:C,getTag:q,getTags:Y,createAssetKey:oe,getLocales:re,parseEntries:ie,sync:G}}return pn}var En={},fc;function gy(){if(fc)return En;fc=1,Object.defineProperty(En,"__esModule",{value:!0}),En.default=e;function e(t){return function(r){return Object.assign({},t,r)}}return En}var dc;function yy(){if(dc)return sn;dc=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.createClient=u;var e=s(Uu()),t=ct,n=s(my()),r=s(gy());function s(c){return c&&c.__esModule?c:{default:c}}function o(c,a){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(c);a&&(f=f.filter(function(p){return Object.getOwnPropertyDescriptor(c,p).enumerable})),d.push.apply(d,f)}return d}function l(c){for(var a=1;a<arguments.length;a++){var d=arguments[a]!=null?arguments[a]:{};a%2?o(Object(d),!0).forEach(function(f){i(c,f,d[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):o(Object(d)).forEach(function(f){Object.defineProperty(c,f,Object.getOwnPropertyDescriptor(d,f))})}return c}function i(c,a,d){return a in c?Object.defineProperty(c,a,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[a]=d,c}function u(c){if(!c.accessToken)throw new TypeError("Expected parameter accessToken");if(!c.space)throw new TypeError("Expected parameter space");const d=l(l({},{resolveLinks:!0,removeUnresolved:!1,defaultHostname:"cdn.contentful.com",environment:"master"}),c),f=(0,t.getUserAgentHeader)("contentful.js/9.1.34",d.application,d.integration);d.headers=l(l({},d.headers),{},{"Content-Type":"application/vnd.contentful.delivery.v1+json","X-Contentful-User-Agent":f});const p=(0,t.createHttpClient)(e.default,d),h=(0,r.default)({resolveLinks:d.resolveLinks,environment:d.environment,removeUnresolved:d.removeUnresolved,spaceBaseUrl:p.defaults.baseURL,environmentBaseUrl:`${p.defaults.baseURL}environments/${d.environment}`});return p.defaults.baseURL=h().environmentBaseUrl,(0,n.default)({http:p,getGlobalOptions:h})}return sn}var to={},ro,pc;function vy(){return pc||(pc=1,ro=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)),ro}var no,hc;function _y(){if(hc)return no;hc=1;var e="%[a-f0-9]{2}",t=new RegExp("("+e+")|([^%]+?)","gi"),n=new RegExp("("+e+")+","gi");function r(l,i){try{return[decodeURIComponent(l.join(""))]}catch{}if(l.length===1)return l;i=i||1;var u=l.slice(0,i),c=l.slice(i);return Array.prototype.concat.call([],r(u),r(c))}function s(l){try{return decodeURIComponent(l)}catch{for(var i=l.match(t)||[],u=1;u<i.length;u++)l=r(i,u).join(""),i=l.match(t)||[];return l}}function o(l){for(var i={"%FE%FF":"��","%FF%FE":"��"},u=n.exec(l);u;){try{i[u[0]]=decodeURIComponent(u[0])}catch{var c=s(u[0]);c!==u[0]&&(i[u[0]]=c)}u=n.exec(l)}i["%C2"]="�";for(var a=Object.keys(i),d=0;d<a.length;d++){var f=a[d];l=l.replace(new RegExp(f,"g"),i[f])}return l}return no=function(l){if(typeof l!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof l+"`");try{return l=l.replace(/\+/g," "),decodeURIComponent(l)}catch{return o(l)}},no}var io,mc;function Ey(){return mc||(mc=1,io=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const n=e.indexOf(t);return n===-1?[e]:[e.slice(0,n),e.slice(n+t.length)]}),io}var oo,gc;function wy(){return gc||(gc=1,oo=function(e,t){for(var n={},r=Object.keys(e),s=Array.isArray(t),o=0;o<r.length;o++){var l=r[o],i=e[l];(s?t.indexOf(l)!==-1:t(l,i,e))&&(n[l]=i)}return n}),oo}var yc;function by(){return yc||(yc=1,function(e){const t=vy(),n=_y(),r=Ey(),s=wy(),o=v=>v==null,l=Symbol("encodeFragmentIdentifier");function i(v){switch(v.arrayFormat){case"index":return w=>(x,O)=>{const F=x.length;return O===void 0||v.skipNull&&O===null||v.skipEmptyString&&O===""?x:O===null?[...x,[a(w,v),"[",F,"]"].join("")]:[...x,[a(w,v),"[",a(F,v),"]=",a(O,v)].join("")]};case"bracket":return w=>(x,O)=>O===void 0||v.skipNull&&O===null||v.skipEmptyString&&O===""?x:O===null?[...x,[a(w,v),"[]"].join("")]:[...x,[a(w,v),"[]=",a(O,v)].join("")];case"colon-list-separator":return w=>(x,O)=>O===void 0||v.skipNull&&O===null||v.skipEmptyString&&O===""?x:O===null?[...x,[a(w,v),":list="].join("")]:[...x,[a(w,v),":list=",a(O,v)].join("")];case"comma":case"separator":case"bracket-separator":{const w=v.arrayFormat==="bracket-separator"?"[]=":"=";return x=>(O,F)=>F===void 0||v.skipNull&&F===null||v.skipEmptyString&&F===""?O:(F=F===null?"":F,O.length===0?[[a(x,v),w,a(F,v)].join("")]:[[O,a(F,v)].join(v.arrayFormatSeparator)])}default:return w=>(x,O)=>O===void 0||v.skipNull&&O===null||v.skipEmptyString&&O===""?x:O===null?[...x,a(w,v)]:[...x,[a(w,v),"=",a(O,v)].join("")]}}function u(v){let w;switch(v.arrayFormat){case"index":return(x,O,F)=>{if(w=/\[(\d*)\]$/.exec(x),x=x.replace(/\[\d*\]$/,""),!w){F[x]=O;return}F[x]===void 0&&(F[x]={}),F[x][w[1]]=O};case"bracket":return(x,O,F)=>{if(w=/(\[\])$/.exec(x),x=x.replace(/\[\]$/,""),!w){F[x]=O;return}if(F[x]===void 0){F[x]=[O];return}F[x]=[].concat(F[x],O)};case"colon-list-separator":return(x,O,F)=>{if(w=/(:list)$/.exec(x),x=x.replace(/:list$/,""),!w){F[x]=O;return}if(F[x]===void 0){F[x]=[O];return}F[x]=[].concat(F[x],O)};case"comma":case"separator":return(x,O,F)=>{const D=typeof O=="string"&&O.includes(v.arrayFormatSeparator),R=typeof O=="string"&&!D&&d(O,v).includes(v.arrayFormatSeparator);O=R?d(O,v):O;const W=D||R?O.split(v.arrayFormatSeparator).map(Q=>d(Q,v)):O===null?O:d(O,v);F[x]=W};case"bracket-separator":return(x,O,F)=>{const D=/(\[\])$/.test(x);if(x=x.replace(/\[\]$/,""),!D){F[x]=O&&d(O,v);return}const R=O===null?[]:O.split(v.arrayFormatSeparator).map(W=>d(W,v));if(F[x]===void 0){F[x]=R;return}F[x]=[].concat(F[x],R)};default:return(x,O,F)=>{if(F[x]===void 0){F[x]=O;return}F[x]=[].concat(F[x],O)}}}function c(v){if(typeof v!="string"||v.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function a(v,w){return w.encode?w.strict?t(v):encodeURIComponent(v):v}function d(v,w){return w.decode?n(v):v}function f(v){return Array.isArray(v)?v.sort():typeof v=="object"?f(Object.keys(v)).sort((w,x)=>Number(w)-Number(x)).map(w=>v[w]):v}function p(v){const w=v.indexOf("#");return w!==-1&&(v=v.slice(0,w)),v}function h(v){let w="";const x=v.indexOf("#");return x!==-1&&(w=v.slice(x)),w}function y(v){v=p(v);const w=v.indexOf("?");return w===-1?"":v.slice(w+1)}function _(v,w){return w.parseNumbers&&!Number.isNaN(Number(v))&&typeof v=="string"&&v.trim()!==""?v=Number(v):w.parseBooleans&&v!==null&&(v.toLowerCase()==="true"||v.toLowerCase()==="false")&&(v=v.toLowerCase()==="true"),v}function S(v,w){w=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},w),c(w.arrayFormatSeparator);const x=u(w),O=Object.create(null);if(typeof v!="string"||(v=v.trim().replace(/^[?#&]/,""),!v))return O;for(const F of v.split("&")){if(F==="")continue;let[D,R]=r(w.decode?F.replace(/\+/g," "):F,"=");R=R===void 0?null:["comma","separator","bracket-separator"].includes(w.arrayFormat)?R:d(R,w),x(d(D,w),R,O)}for(const F of Object.keys(O)){const D=O[F];if(typeof D=="object"&&D!==null)for(const R of Object.keys(D))D[R]=_(D[R],w);else O[F]=_(D,w)}return w.sort===!1?O:(w.sort===!0?Object.keys(O).sort():Object.keys(O).sort(w.sort)).reduce((F,D)=>{const R=O[D];return R&&typeof R=="object"&&!Array.isArray(R)?F[D]=f(R):F[D]=R,F},Object.create(null))}e.extract=y,e.parse=S,e.stringify=(v,w)=>{if(!v)return"";w=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},w),c(w.arrayFormatSeparator);const x=R=>w.skipNull&&o(v[R])||w.skipEmptyString&&v[R]==="",O=i(w),F={};for(const R of Object.keys(v))x(R)||(F[R]=v[R]);const D=Object.keys(F);return w.sort!==!1&&D.sort(w.sort),D.map(R=>{const W=v[R];return W===void 0?"":W===null?a(R,w):Array.isArray(W)?W.length===0&&w.arrayFormat==="bracket-separator"?a(R,w)+"[]":W.reduce(O(R),[]).join("&"):a(R,w)+"="+a(W,w)}).filter(R=>R.length>0).join("&")},e.parseUrl=(v,w)=>{w=Object.assign({decode:!0},w);const[x,O]=r(v,"#");return Object.assign({url:x.split("?")[0]||"",query:S(y(v),w)},w&&w.parseFragmentIdentifier&&O?{fragmentIdentifier:d(O,w)}:{})},e.stringifyUrl=(v,w)=>{w=Object.assign({encode:!0,strict:!0,[l]:!0},w);const x=p(v.url).split("?")[0]||"",O=e.extract(v.url),F=e.parse(O,{sort:!1}),D=Object.assign(F,v.query);let R=e.stringify(D,w);R&&(R=`?${R}`);let W=h(v.url);return v.fragmentIdentifier&&(W=`#${w[l]?a(v.fragmentIdentifier,w):v.fragmentIdentifier}`),`${x}${R}${W}`},e.pick=(v,w,x)=>{x=Object.assign({parseFragmentIdentifier:!0,[l]:!1},x);const{url:O,query:F,fragmentIdentifier:D}=e.parseUrl(v,x);return e.stringifyUrl({url:O,query:s(F,w),fragmentIdentifier:D},x)},e.exclude=(v,w,x)=>{const O=Array.isArray(w)?F=>!w.includes(F):(F,D)=>!w(F,D);return e.pick(v,O,x)}}(to)),to}var vc;function Sy(){return vc||(vc=1,function(e,t){(function(n,r){e.exports=r(yy(),by())})(ce,function(n,r){return function(){var s={897:function(u){u.exports=n},48:function(u){u.exports=r}},o={};function l(u){var c=o[u];if(c!==void 0)return c.exports;var a=o[u]={exports:{}};return s[u](a,a.exports,l),a.exports}l.d=function(u,c){for(var a in c)l.o(c,a)&&!l.o(u,a)&&Object.defineProperty(u,a,{enumerable:!0,get:c[a]})},l.o=function(u,c){return Object.prototype.hasOwnProperty.call(u,c)},l.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})};var i={};return function(){l.r(i),l.d(i,{getEntries:function(){return K},getEntry:function(){return $},setContext:function(){return y}});var u=l(897),c=l(48),a={CONTENTFUL:{ENVIRONMENTS_MAPING:{beta:"beta",rc:"rc",live:"master",local:"beta"},LOCALES:{DEFAULT:"en",SUPPORTED:["en","es","fr","pt"]},SPACE:"txbhe1wabmyx",HOSTS:{CDN:"cdn.contentful.com",PREVIEW:"preview.contentful.com"}}};const{CONTENTFUL:{ENVIRONMENTS_MAPING:d,SPACE:f,HOSTS:p}}=a;let h={apiKey:null,previewKey:null,environment:null,isPreview:!1,host:p.CDN,space:f};const y=({apiKey:V,environment:C,isPreview:q=!1,location:Y,previewKey:oe,space:re=null})=>{h.apiKey=V,h.previewKey=oe,h.environment=(G=>{if(!G)throw new Error("Cannot map environment: Environment not defined");if(!d[G])throw new Error(`Cannot map environment: No mapping found for environment ${G}`);return d[G]})(C),h.isPreview=q||(G=>{let ie=!1;if(G&&G.search){const ae=(0,c.parse)(G.search);ie=ae.isPreview&&ae.isPreview==="true"}return ie})(Y),h.space=re||f},_=(V=!1)=>{const{apiKey:C,environment:q,isPreview:Y,previewKey:oe,space:re}=h;return Y===!0||V===!0?{accessToken:oe,environment:q,host:p.PREVIEW,space:re}:{accessToken:C,environment:q,host:p.CDN,space:re}},S=V=>typeof V=="object"&&V!==null,v=V=>Array.isArray(V)&&V.length,w=V=>{if(!S(V))throw new Error("Cannot flatten fields");const{fields:C,sys:q}=V;if(!C)throw new Error("Cannot flatten fields");let Y={...C};if(S(q)){const{contentType:oe,createdAt:re,updatedAt:G}=q;oe&&Object.assign(Y,{contentType:oe.sys.id}),re&&Object.assign(Y,{createdAt:re}),G&&Object.assign(Y,{updatedAt:G})}return Y},{CONTENTFUL:{LOCALES:x}}=a,O=(V,C)=>S(V)&&((q,Y)=>Object.prototype.hasOwnProperty.call(q,Y))(V,C),F=(V,C)=>{const q=(Y=>x.SUPPORTED.includes(Y)?Y:x.DEFAULT)(C);return O(V,q)?V[q]:O(V,x.DEFAULT)?V[x.DEFAULT]:V},D=V=>S(V)&&V.sys&&V.sys.type==="Asset",R=(V,C,q)=>{const{title:Y,file:oe}=w(V);if(!oe)throw new Error("Cannot flatten asset");const{contentType:re,fileName:G,url:ie,details:ae}=F(oe,C);if(!ie)throw new Error("Cannot flatten asset");return q?{description:Y||G,height:ae&&ae.image&&ae.image.height,type:re,url:ie,width:ae&&ae.image&&ae.image.width}:ie},W=V=>S(V)&&V.sys&&V.sys.type==="Entry",Q=(V,C,q)=>{const Y={},oe=((re,G)=>{const ie={};for(const[ae,be]of Object.entries(re))ie[ae]=F(be,G);return ie})(w(V),C);for(const[re,G]of Object.entries(oe))D(G)?Y[re]=R(G,C,q):W(G)?Y[re]=Q(G,C,q):v(G)?Y[re]=G.map(ie=>D(ie)?R(ie,C,q):W(ie)?Q(ie,C,q):ie):Y[re]=G;return Y},k=({items:V})=>{if(!v(V))throw new Error("Cannot read items");return V},U=async(V,C)=>{const q=_(C);return await(await(0,u.createClient)(q)).getEntries(V)},$=async(V={},C={},q=!1)=>((Y,{flatten:oe=!0,locale:re="en",assetDetails:G=!1})=>{const ie=k(Y);return oe?Q(ie[0],re,G):ie[0]})(await U(V,q),{...V,...C}),K=async(V={},C={},q=!1)=>((Y,{flatten:oe=!0,locale:re="en",assetDetails:G=!1})=>{const ie=k(Y);return oe?((ae,be,ee)=>ae.map(te=>Q(te,be,ee)))(ie,re,G):ie})(await U(V,q),{...V,...C})}(),i}()})}(li)),li.exports}var ao={exports:{}},so={exports:{}},co={exports:{}},uo={exports:{}},_c;function va(){return _c||(_c=1,function(e,t){(function(n,r){e.exports=r()})(ce,function(){function n(y){return!isNaN(parseFloat(y))&&isFinite(y)}function r(y){return y.charAt(0).toUpperCase()+y.substring(1)}function s(y){return function(){return this[y]}}var o=["isConstructor","isEval","isNative","isToplevel"],l=["columnNumber","lineNumber"],i=["fileName","functionName","source"],u=["args"],c=["evalOrigin"],a=o.concat(l,i,u,c);function d(y){if(y)for(var _=0;_<a.length;_++)y[a[_]]!==void 0&&this["set"+r(a[_])](y[a[_]])}d.prototype={getArgs:function(){return this.args},setArgs:function(y){if(Object.prototype.toString.call(y)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=y},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(y){if(y instanceof d)this.evalOrigin=y;else if(y instanceof Object)this.evalOrigin=new d(y);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var y=this.getFileName()||"",_=this.getLineNumber()||"",S=this.getColumnNumber()||"",v=this.getFunctionName()||"";return this.getIsEval()?y?"[eval] ("+y+":"+_+":"+S+")":"[eval]:"+_+":"+S:v?v+" ("+y+":"+_+":"+S+")":y+":"+_+":"+S}},d.fromString=function(_){var S=_.indexOf("("),v=_.lastIndexOf(")"),w=_.substring(0,S),x=_.substring(S+1,v).split(","),O=_.substring(v+1);if(O.indexOf("@")===0)var F=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(O,""),D=F[1],R=F[2],W=F[3];return new d({functionName:w,args:x||void 0,fileName:D,lineNumber:R||void 0,columnNumber:W||void 0})};for(var f=0;f<o.length;f++)d.prototype["get"+r(o[f])]=s(o[f]),d.prototype["set"+r(o[f])]=function(y){return function(_){this[y]=!!_}}(o[f]);for(var p=0;p<l.length;p++)d.prototype["get"+r(l[p])]=s(l[p]),d.prototype["set"+r(l[p])]=function(y){return function(_){if(!n(_))throw new TypeError(y+" must be a Number");this[y]=Number(_)}}(l[p]);for(var h=0;h<i.length;h++)d.prototype["get"+r(i[h])]=s(i[h]),d.prototype["set"+r(i[h])]=function(y){return function(_){this[y]=String(_)}}(i[h]);return d})}(uo)),uo.exports}var Ec;function Oy(){return Ec||(Ec=1,function(e,t){(function(n,r){e.exports=r(va())})(ce,function(r){var s=/(^|@)\S+:\d+/,o=/^\s*at .*(\S+:\d+|\(native\))/m,l=/^(eval@)?(\[native code])?$/;return{parse:function(u){if(typeof u.stacktrace<"u"||typeof u["opera#sourceloc"]<"u")return this.parseOpera(u);if(u.stack&&u.stack.match(o))return this.parseV8OrIE(u);if(u.stack)return this.parseFFOrSafari(u);throw new Error("Cannot parse given Error object")},extractLocation:function(u){if(u.indexOf(":")===-1)return[u];var c=/(.+?)(?::(\d+))?(?::(\d+))?$/,a=c.exec(u.replace(/[()]/g,""));return[a[1],a[2]||void 0,a[3]||void 0]},parseV8OrIE:function(u){var c=u.stack.split(`
|
|
42
42
|
`).filter(function(a){return!!a.match(o)},this);return c.map(function(a){a.indexOf("(eval ")>-1&&(a=a.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var d=a.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),f=d.match(/ (\(.+\)$)/);d=f?d.replace(f[0],""):d;var p=this.extractLocation(f?f[1]:d),h=f&&d||void 0,y=["eval","<anonymous>"].indexOf(p[0])>-1?void 0:p[0];return new r({functionName:h,fileName:y,lineNumber:p[1],columnNumber:p[2],source:a})},this)},parseFFOrSafari:function(u){var c=u.stack.split(`
|
|
43
43
|
`).filter(function(a){return!a.match(l)},this);return c.map(function(a){if(a.indexOf(" > eval")>-1&&(a=a.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),a.indexOf("@")===-1&&a.indexOf(":")===-1)return new r({functionName:a});var d=/((.*".+"[^@]*)?[^@]*)(?:@)/,f=a.match(d),p=f&&f[1]?f[1]:void 0,h=this.extractLocation(a.replace(d,""));return new r({functionName:p,fileName:h[0],lineNumber:h[1],columnNumber:h[2],source:a})},this)},parseOpera:function(u){return!u.stacktrace||u.message.indexOf(`
|
|
44
44
|
`)>-1&&u.message.split(`
|
|
@@ -46,11 +46,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
46
46
|
`).length?this.parseOpera9(u):u.stack?this.parseOpera11(u):this.parseOpera10(u)},parseOpera9:function(u){for(var c=/Line (\d+).*script (?:in )?(\S+)/i,a=u.message.split(`
|
|
47
47
|
`),d=[],f=2,p=a.length;f<p;f+=2){var h=c.exec(a[f]);h&&d.push(new r({fileName:h[2],lineNumber:h[1],source:a[f]}))}return d},parseOpera10:function(u){for(var c=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,a=u.stacktrace.split(`
|
|
48
48
|
`),d=[],f=0,p=a.length;f<p;f+=2){var h=c.exec(a[f]);h&&d.push(new r({functionName:h[3]||void 0,fileName:h[2],lineNumber:h[1],source:a[f]}))}return d},parseOpera11:function(u){var c=u.stack.split(`
|
|
49
|
-
`).filter(function(a){return!!a.match(s)&&!a.match(/^Error created at/)},this);return c.map(function(a){var d=a.split("@"),f=this.extractLocation(d.pop()),p=d.shift()||"",h=p.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,y;p.match(/\(([^)]*)\)/)&&(y=p.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var _=y===void 0||y==="[arguments not available]"?void 0:y.split(",");return new r({functionName:h,args:_,fileName:f[0],lineNumber:f[1],columnNumber:f[2],source:a})},this)}}})}(co)),co.exports}var lo={exports:{}},Ec;function Oy(){return Ec||(Ec=1,function(e,t){(function(n,r){e.exports=r(va())})(ce,function(n){return{backtrace:function(s){var o=[],l=10;typeof s=="object"&&typeof s.maxStackSize=="number"&&(l=s.maxStackSize);for(var i=arguments.callee;i&&o.length<l&&i.arguments;){for(var u=new Array(i.arguments.length),c=0;c<u.length;++c)u[c]=i.arguments[c];/function(?:\s+([\w$]+))+\s*\(/.test(i.toString())?o.push(new n({functionName:RegExp.$1||void 0,args:u})):o.push(new n({args:u}));try{i=i.caller}catch{break}}return o}}})}(lo)),lo.exports}var fo={exports:{}},gr={},po={},wc;function fl(){return wc||(wc=1,function(e){function t(v,w,x){if(w in v)return v[w];if(arguments.length===3)return x;throw new Error('"'+w+'" is a required argument.')}e.getArg=t;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,r=/^data:.+\,.+$/;function s(v){var w=v.match(n);return w?{scheme:w[1],auth:w[2],host:w[3],port:w[4],path:w[5]}:null}e.urlParse=s;function o(v){var w="";return v.scheme&&(w+=v.scheme+":"),w+="//",v.auth&&(w+=v.auth+"@"),v.host&&(w+=v.host),v.port&&(w+=":"+v.port),v.path&&(w+=v.path),w}e.urlGenerate=o;function l(v){var w=v,x=s(v);if(x){if(!x.path)return v;w=x.path}for(var O=e.isAbsolute(w),F=w.split(/\/+/),D,R=0,W=F.length-1;W>=0;W--)D=F[W],D==="."?F.splice(W,1):D===".."?R++:R>0&&(D===""?(F.splice(W+1,R),R=0):(F.splice(W,2),R--));return w=F.join("/"),w===""&&(w=O?"/":"."),x?(x.path=w,o(x)):w}e.normalize=l;function i(v,w){v===""&&(v="."),w===""&&(w=".");var x=s(w),O=s(v);if(O&&(v=O.path||"/"),x&&!x.scheme)return O&&(x.scheme=O.scheme),o(x);if(x||w.match(r))return w;if(O&&!O.host&&!O.path)return O.host=w,o(O);var F=w.charAt(0)==="/"?w:l(v.replace(/\/+$/,"")+"/"+w);return O?(O.path=F,o(O)):F}e.join=i,e.isAbsolute=function(v){return v.charAt(0)==="/"||!!v.match(n)};function u(v,w){v===""&&(v="."),v=v.replace(/\/$/,"");for(var x=0;w.indexOf(v+"/")!==0;){var O=v.lastIndexOf("/");if(O<0||(v=v.slice(0,O),v.match(/^([^\/]+:\/)?\/*$/)))return w;++x}return Array(x+1).join("../")+w.substr(v.length+1)}e.relative=u;var c=function(){var v=Object.create(null);return!("__proto__"in v)}();function a(v){return v}function d(v){return p(v)?"$"+v:v}e.toSetString=c?a:d;function f(v){return p(v)?v.slice(1):v}e.fromSetString=c?a:f;function p(v){if(!v)return!1;var w=v.length;if(w<9||v.charCodeAt(w-1)!==95||v.charCodeAt(w-2)!==95||v.charCodeAt(w-3)!==111||v.charCodeAt(w-4)!==116||v.charCodeAt(w-5)!==111||v.charCodeAt(w-6)!==114||v.charCodeAt(w-7)!==112||v.charCodeAt(w-8)!==95||v.charCodeAt(w-9)!==95)return!1;for(var x=w-10;x>=0;x--)if(v.charCodeAt(x)!==36)return!1;return!0}function h(v,w,x){var O=v.source-w.source;return O!==0||(O=v.originalLine-w.originalLine,O!==0)||(O=v.originalColumn-w.originalColumn,O!==0||x)||(O=v.generatedColumn-w.generatedColumn,O!==0)||(O=v.generatedLine-w.generatedLine,O!==0)?O:v.name-w.name}e.compareByOriginalPositions=h;function y(v,w,x){var O=v.generatedLine-w.generatedLine;return O!==0||(O=v.generatedColumn-w.generatedColumn,O!==0||x)||(O=v.source-w.source,O!==0)||(O=v.originalLine-w.originalLine,O!==0)||(O=v.originalColumn-w.originalColumn,O!==0)?O:v.name-w.name}e.compareByGeneratedPositionsDeflated=y;function _(v,w){return v===w?0:v>w?1:-1}function S(v,w){var x=v.generatedLine-w.generatedLine;return x!==0||(x=v.generatedColumn-w.generatedColumn,x!==0)||(x=_(v.source,w.source),x!==0)||(x=v.originalLine-w.originalLine,x!==0)||(x=v.originalColumn-w.originalColumn,x!==0)?x:_(v.name,w.name)}e.compareByGeneratedPositionsInflated=S}(po)),po}var ho={},bc;function Ty(){return bc||(bc=1,function(e){e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2;function t(n,r,s,o,l,i){var u=Math.floor((r-n)/2)+n,c=l(s,o[u],!0);return c===0?u:c>0?r-u>1?t(u,r,s,o,l,i):i==e.LEAST_UPPER_BOUND?r<o.length?r:-1:u:u-n>1?t(n,u,s,o,l,i):i==e.LEAST_UPPER_BOUND?u:n<0?-1:n}e.search=function(r,s,o,l){if(s.length===0)return-1;var i=t(-1,s.length,r,s,o,l||e.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&o(s[i],s[i-1],!0)===0;)--i;return i}}(ho)),ho}var mo={},Sc;function xy(){if(Sc)return mo;Sc=1;var e=fl(),t=Object.prototype.hasOwnProperty;function n(){this._array=[],this._set=Object.create(null)}return n.fromArray=function(s,o){for(var l=new n,i=0,u=s.length;i<u;i++)l.add(s[i],o);return l},n.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},n.prototype.add=function(s,o){var l=e.toSetString(s),i=t.call(this._set,l),u=this._array.length;(!i||o)&&this._array.push(s),i||(this._set[l]=u)},n.prototype.has=function(s){var o=e.toSetString(s);return t.call(this._set,o)},n.prototype.indexOf=function(s){var o=e.toSetString(s);if(t.call(this._set,o))return this._set[o];throw new Error('"'+s+'" is not in the set.')},n.prototype.at=function(s){if(s>=0&&s<this._array.length)return this._array[s];throw new Error("No element indexed by "+s)},n.prototype.toArray=function(){return this._array.slice()},mo.ArraySet=n,mo}var wn={},bn={},Oc;function Ay(){if(Oc)return bn;Oc=1;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");return bn.encode=function(t){if(0<=t&&t<e.length)return e[t];throw new TypeError("Must be between 0 and 63: "+t)},bn.decode=function(t){var n=65,r=90,s=97,o=122,l=48,i=57,u=43,c=47,a=26,d=52;return n<=t&&t<=r?t-n:s<=t&&t<=o?t-s+a:l<=t&&t<=i?t-l+d:t==u?62:t==c?63:-1},bn}var Tc;function Ry(){if(Tc)return wn;Tc=1;var e=Ay(),t=5,n=1<<t,r=n-1,s=n;function o(i){return i<0?(-i<<1)+1:(i<<1)+0}function l(i){var u=(i&1)===1,c=i>>1;return u?-c:c}return wn.encode=function(u){var c="",a,d=o(u);do a=d&r,d>>>=t,d>0&&(a|=s),c+=e.encode(a);while(d>0);return c},wn.decode=function(u,c,a){var d=u.length,f=0,p=0,h,y;do{if(c>=d)throw new Error("Expected more digits in base 64 VLQ value.");if(y=e.decode(u.charCodeAt(c++)),y===-1)throw new Error("Invalid base64 digit: "+u.charAt(c-1));h=!!(y&s),y&=r,f=f+(y<<p),p+=t}while(h);a.value=l(f),a.rest=c},wn}var go={},xc;function Cy(){if(xc)return go;xc=1;function e(r,s,o){var l=r[s];r[s]=r[o],r[o]=l}function t(r,s){return Math.round(r+Math.random()*(s-r))}function n(r,s,o,l){if(o<l){var i=t(o,l),u=o-1;e(r,i,l);for(var c=r[l],a=o;a<l;a++)s(r[a],c)<=0&&(u+=1,e(r,u,a));e(r,u+1,a);var d=u+1;n(r,s,o,d-1),n(r,s,d+1,l)}}return go.quickSort=function(r,s){n(r,s,0,r.length-1)},go}var Ac;function Ny(){if(Ac)return gr;Ac=1;var e=fl(),t=Ty(),n=xy().ArraySet,r=Ry(),s=Cy().quickSort;function o(c){var a=c;return typeof c=="string"&&(a=JSON.parse(c.replace(/^\)\]\}'/,""))),a.sections!=null?new u(a):new l(a)}o.fromSourceMap=function(c){return l.fromSourceMap(c)},o.prototype._version=3,o.prototype.__generatedMappings=null,Object.defineProperty(o.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),o.prototype.__originalMappings=null,Object.defineProperty(o.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),o.prototype._charIsMappingSeparator=function(a,d){var f=a.charAt(d);return f===";"||f===","},o.prototype._parseMappings=function(a,d){throw new Error("Subclasses must implement _parseMappings")},o.GENERATED_ORDER=1,o.ORIGINAL_ORDER=2,o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2,o.prototype.eachMapping=function(a,d,f){var p=d||null,h=f||o.GENERATED_ORDER,y;switch(h){case o.GENERATED_ORDER:y=this._generatedMappings;break;case o.ORIGINAL_ORDER:y=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var _=this.sourceRoot;y.map(function(S){var v=S.source===null?null:this._sources.at(S.source);return v!=null&&_!=null&&(v=e.join(_,v)),{source:v,generatedLine:S.generatedLine,generatedColumn:S.generatedColumn,originalLine:S.originalLine,originalColumn:S.originalColumn,name:S.name===null?null:this._names.at(S.name)}},this).forEach(a,p)},o.prototype.allGeneratedPositionsFor=function(a){var d=e.getArg(a,"line"),f={source:e.getArg(a,"source"),originalLine:d,originalColumn:e.getArg(a,"column",0)};if(this.sourceRoot!=null&&(f.source=e.relative(this.sourceRoot,f.source)),!this._sources.has(f.source))return[];f.source=this._sources.indexOf(f.source);var p=[],h=this._findMapping(f,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,t.LEAST_UPPER_BOUND);if(h>=0){var y=this._originalMappings[h];if(a.column===void 0)for(var _=y.originalLine;y&&y.originalLine===_;)p.push({line:e.getArg(y,"generatedLine",null),column:e.getArg(y,"generatedColumn",null),lastColumn:e.getArg(y,"lastGeneratedColumn",null)}),y=this._originalMappings[++h];else for(var S=y.originalColumn;y&&y.originalLine===d&&y.originalColumn==S;)p.push({line:e.getArg(y,"generatedLine",null),column:e.getArg(y,"generatedColumn",null),lastColumn:e.getArg(y,"lastGeneratedColumn",null)}),y=this._originalMappings[++h]}return p},gr.SourceMapConsumer=o;function l(c){var a=c;typeof c=="string"&&(a=JSON.parse(c.replace(/^\)\]\}'/,"")));var d=e.getArg(a,"version"),f=e.getArg(a,"sources"),p=e.getArg(a,"names",[]),h=e.getArg(a,"sourceRoot",null),y=e.getArg(a,"sourcesContent",null),_=e.getArg(a,"mappings"),S=e.getArg(a,"file",null);if(d!=this._version)throw new Error("Unsupported version: "+d);f=f.map(String).map(e.normalize).map(function(v){return h&&e.isAbsolute(h)&&e.isAbsolute(v)?e.relative(h,v):v}),this._names=n.fromArray(p.map(String),!0),this._sources=n.fromArray(f,!0),this.sourceRoot=h,this.sourcesContent=y,this._mappings=_,this.file=S}l.prototype=Object.create(o.prototype),l.prototype.consumer=o,l.fromSourceMap=function(a){var d=Object.create(l.prototype),f=d._names=n.fromArray(a._names.toArray(),!0),p=d._sources=n.fromArray(a._sources.toArray(),!0);d.sourceRoot=a._sourceRoot,d.sourcesContent=a._generateSourcesContent(d._sources.toArray(),d.sourceRoot),d.file=a._file;for(var h=a._mappings.toArray().slice(),y=d.__generatedMappings=[],_=d.__originalMappings=[],S=0,v=h.length;S<v;S++){var w=h[S],x=new i;x.generatedLine=w.generatedLine,x.generatedColumn=w.generatedColumn,w.source&&(x.source=p.indexOf(w.source),x.originalLine=w.originalLine,x.originalColumn=w.originalColumn,w.name&&(x.name=f.indexOf(w.name)),_.push(x)),y.push(x)}return s(d.__originalMappings,e.compareByOriginalPositions),d},l.prototype._version=3,Object.defineProperty(l.prototype,"sources",{get:function(){return this._sources.toArray().map(function(c){return this.sourceRoot!=null?e.join(this.sourceRoot,c):c},this)}});function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}l.prototype._parseMappings=function(a,d){for(var f=1,p=0,h=0,y=0,_=0,S=0,v=a.length,w=0,x={},O={},F=[],D=[],R,W,V,L,U;w<v;)if(a.charAt(w)===";")f++,w++,p=0;else if(a.charAt(w)===",")w++;else{for(R=new i,R.generatedLine=f,L=w;L<v&&!this._charIsMappingSeparator(a,L);L++);if(W=a.slice(w,L),V=x[W],V)w+=W.length;else{for(V=[];w<L;)r.decode(a,w,O),U=O.value,w=O.rest,V.push(U);if(V.length===2)throw new Error("Found a source, but no line and column");if(V.length===3)throw new Error("Found a source and line, but no column");x[W]=V}R.generatedColumn=p+V[0],p=R.generatedColumn,V.length>1&&(R.source=_+V[1],_+=V[1],R.originalLine=h+V[2],h=R.originalLine,R.originalLine+=1,R.originalColumn=y+V[3],y=R.originalColumn,V.length>4&&(R.name=S+V[4],S+=V[4])),D.push(R),typeof R.originalLine=="number"&&F.push(R)}s(D,e.compareByGeneratedPositionsDeflated),this.__generatedMappings=D,s(F,e.compareByOriginalPositions),this.__originalMappings=F},l.prototype._findMapping=function(a,d,f,p,h,y){if(a[f]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+a[f]);if(a[p]<0)throw new TypeError("Column must be greater than or equal to 0, got "+a[p]);return t.search(a,d,h,y)},l.prototype.computeColumnSpans=function(){for(var a=0;a<this._generatedMappings.length;++a){var d=this._generatedMappings[a];if(a+1<this._generatedMappings.length){var f=this._generatedMappings[a+1];if(d.generatedLine===f.generatedLine){d.lastGeneratedColumn=f.generatedColumn-1;continue}}d.lastGeneratedColumn=1/0}},l.prototype.originalPositionFor=function(a){var d={generatedLine:e.getArg(a,"line"),generatedColumn:e.getArg(a,"column")},f=this._findMapping(d,this._generatedMappings,"generatedLine","generatedColumn",e.compareByGeneratedPositionsDeflated,e.getArg(a,"bias",o.GREATEST_LOWER_BOUND));if(f>=0){var p=this._generatedMappings[f];if(p.generatedLine===d.generatedLine){var h=e.getArg(p,"source",null);h!==null&&(h=this._sources.at(h),this.sourceRoot!=null&&(h=e.join(this.sourceRoot,h)));var y=e.getArg(p,"name",null);return y!==null&&(y=this._names.at(y)),{source:h,line:e.getArg(p,"originalLine",null),column:e.getArg(p,"originalColumn",null),name:y}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(a){return a==null}):!1},l.prototype.sourceContentFor=function(a,d){if(!this.sourcesContent)return null;if(this.sourceRoot!=null&&(a=e.relative(this.sourceRoot,a)),this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];var f;if(this.sourceRoot!=null&&(f=e.urlParse(this.sourceRoot))){var p=a.replace(/^file:\/\//,"");if(f.scheme=="file"&&this._sources.has(p))return this.sourcesContent[this._sources.indexOf(p)];if((!f.path||f.path=="/")&&this._sources.has("/"+a))return this.sourcesContent[this._sources.indexOf("/"+a)]}if(d)return null;throw new Error('"'+a+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(a){var d=e.getArg(a,"source");if(this.sourceRoot!=null&&(d=e.relative(this.sourceRoot,d)),!this._sources.has(d))return{line:null,column:null,lastColumn:null};d=this._sources.indexOf(d);var f={source:d,originalLine:e.getArg(a,"line"),originalColumn:e.getArg(a,"column")},p=this._findMapping(f,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,e.getArg(a,"bias",o.GREATEST_LOWER_BOUND));if(p>=0){var h=this._originalMappings[p];if(h.source===f.source)return{line:e.getArg(h,"generatedLine",null),column:e.getArg(h,"generatedColumn",null),lastColumn:e.getArg(h,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},gr.BasicSourceMapConsumer=l;function u(c){var a=c;typeof c=="string"&&(a=JSON.parse(c.replace(/^\)\]\}'/,"")));var d=e.getArg(a,"version"),f=e.getArg(a,"sections");if(d!=this._version)throw new Error("Unsupported version: "+d);this._sources=new n,this._names=new n;var p={line:-1,column:0};this._sections=f.map(function(h){if(h.url)throw new Error("Support for url field in sections not implemented.");var y=e.getArg(h,"offset"),_=e.getArg(y,"line"),S=e.getArg(y,"column");if(_<p.line||_===p.line&&S<p.column)throw new Error("Section offsets must be ordered and non-overlapping.");return p=y,{generatedOffset:{generatedLine:_+1,generatedColumn:S+1},consumer:new o(e.getArg(h,"map"))}})}return u.prototype=Object.create(o.prototype),u.prototype.constructor=o,u.prototype._version=3,Object.defineProperty(u.prototype,"sources",{get:function(){for(var c=[],a=0;a<this._sections.length;a++)for(var d=0;d<this._sections[a].consumer.sources.length;d++)c.push(this._sections[a].consumer.sources[d]);return c}}),u.prototype.originalPositionFor=function(a){var d={generatedLine:e.getArg(a,"line"),generatedColumn:e.getArg(a,"column")},f=t.search(d,this._sections,function(h,y){var _=h.generatedLine-y.generatedOffset.generatedLine;return _||h.generatedColumn-y.generatedOffset.generatedColumn}),p=this._sections[f];return p?p.consumer.originalPositionFor({line:d.generatedLine-(p.generatedOffset.generatedLine-1),column:d.generatedColumn-(p.generatedOffset.generatedLine===d.generatedLine?p.generatedOffset.generatedColumn-1:0),bias:a.bias}):{source:null,line:null,column:null,name:null}},u.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(a){return a.consumer.hasContentsOfAllSources()})},u.prototype.sourceContentFor=function(a,d){for(var f=0;f<this._sections.length;f++){var p=this._sections[f],h=p.consumer.sourceContentFor(a,!0);if(h)return h}if(d)return null;throw new Error('"'+a+'" is not in the SourceMap.')},u.prototype.generatedPositionFor=function(a){for(var d=0;d<this._sections.length;d++){var f=this._sections[d];if(f.consumer.sources.indexOf(e.getArg(a,"source"))!==-1){var p=f.consumer.generatedPositionFor(a);if(p){var h={line:p.line+(f.generatedOffset.generatedLine-1),column:p.column+(f.generatedOffset.generatedLine===p.line?f.generatedOffset.generatedColumn-1:0)};return h}}}return{line:null,column:null}},u.prototype._parseMappings=function(a,d){this.__generatedMappings=[],this.__originalMappings=[];for(var f=0;f<this._sections.length;f++)for(var p=this._sections[f],h=p.consumer._generatedMappings,y=0;y<h.length;y++){var _=h[y],S=p.consumer._sources.at(_.source);p.consumer.sourceRoot!==null&&(S=e.join(p.consumer.sourceRoot,S)),this._sources.add(S),S=this._sources.indexOf(S);var v=p.consumer._names.at(_.name);this._names.add(v),v=this._names.indexOf(v);var w={source:S,generatedLine:_.generatedLine+(p.generatedOffset.generatedLine-1),generatedColumn:_.generatedColumn+(p.generatedOffset.generatedLine===_.generatedLine?p.generatedOffset.generatedColumn-1:0),originalLine:_.originalLine,originalColumn:_.originalColumn,name:v};this.__generatedMappings.push(w),typeof w.originalLine=="number"&&this.__originalMappings.push(w)}s(this.__generatedMappings,e.compareByGeneratedPositionsDeflated),s(this.__originalMappings,e.compareByOriginalPositions)},gr.IndexedSourceMapConsumer=u,gr}var Rc;function Py(){return Rc||(Rc=1,function(e,t){(function(n,r){e.exports=r(Ny(),va())})(ce,function(n,r){function s(f){return new Promise(function(p,h){var y=new XMLHttpRequest;y.open("get",f),y.onerror=h,y.onreadystatechange=function(){y.readyState===4&&(y.status>=200&&y.status<300||f.substr(0,7)==="file://"&&y.responseText?p(y.responseText):h(new Error("HTTP status: "+y.status+" retrieving "+f)))},y.send()})}function o(f){if(typeof window<"u"&&window.atob)return window.atob(f);throw new Error("You must supply a polyfill for window.atob in this environment")}function l(f){if(typeof JSON<"u"&&JSON.parse)return JSON.parse(f);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function i(f,p){for(var h=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],y=f.split(`
|
|
50
|
-
`),_="",S=Math.min(p,20),v=0;v<S;++v){var w=y[p-v-1],x=w.indexOf("//");if(x>=0&&(w=w.substr(0,x)),w){_=w+_;for(var O=h.length,F=0;F<O;F++){var D=h[F].exec(_);if(D&&D[1])return D[1]}}}}function u(){if(typeof Object.defineProperty!="function"||typeof Object.create!="function")throw new Error("Unable to consume source maps in older browsers")}function c(f){if(typeof f!="object")throw new TypeError("Given StackFrame is not an object");if(typeof f.fileName!="string")throw new TypeError("Given file name is not a String");if(typeof f.lineNumber!="number"||f.lineNumber%1!==0||f.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if(typeof f.columnNumber!="number"||f.columnNumber%1!==0||f.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function a(f){for(var p=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/mg,h,y;y=p.exec(f);)h=y[1];if(h)return h;throw new Error("sourceMappingURL not found")}function d(f,p,h){return new Promise(function(y,_){var S=p.originalPositionFor({line:f.lineNumber,column:f.columnNumber});if(S.source){var v=p.sourceContentFor(S.source);v&&(h[S.source]=v),y(new r({functionName:S.name||f.functionName,args:f.args,fileName:S.source,lineNumber:S.line,columnNumber:S.column}))}else _(new Error("Could not get original source for given stackframe and source map"))})}return function f(p){if(!(this instanceof f))return new f(p);p=p||{},this.sourceCache=p.sourceCache||{},this.sourceMapConsumerCache=p.sourceMapConsumerCache||{},this.ajax=p.ajax||s,this._atob=p.atob||o,this._get=function(y){return new Promise((function(_,S){var v=y.substr(0,5)==="data:";if(this.sourceCache[y])_(this.sourceCache[y]);else if(p.offline&&!v)S(new Error("Cannot make network requests in offline mode"));else if(v){var w=/^data:application\/json;([\w=:"-]+;)*base64,/,x=y.match(w);if(x){var O=x[0].length,F=y.substr(O),D=this._atob(F);this.sourceCache[y]=D,_(D)}else S(new Error("The encoding of the inline sourcemap is not supported"))}else{var R=this.ajax(y,{method:"get"});this.sourceCache[y]=R,R.then(_,S)}}).bind(this))},this._getSourceMapConsumer=function(y,_){return new Promise((function(S){if(this.sourceMapConsumerCache[y])S(this.sourceMapConsumerCache[y]);else{var v=new Promise((function(w,x){return this._get(y).then(function(O){typeof O=="string"&&(O=l(O.replace(/^\)\]\}'/,""))),typeof O.sourceRoot>"u"&&(O.sourceRoot=_),w(new n.SourceMapConsumer(O))}).catch(x)}).bind(this));this.sourceMapConsumerCache[y]=v,S(v)}}).bind(this))},this.pinpoint=function(y){return new Promise((function(_,S){this.getMappedLocation(y).then((function(v){function w(){_(v)}this.findFunctionName(v).then(_,w).catch(w)}).bind(this),S)}).bind(this))},this.findFunctionName=function(y){return new Promise((function(_,S){c(y),this._get(y.fileName).then(function(w){var x=y.lineNumber,O=y.columnNumber,F=i(w,x);_(F?new r({functionName:F,args:y.args,fileName:y.fileName,lineNumber:x,columnNumber:O}):y)},S).catch(S)}).bind(this))},this.getMappedLocation=function(y){return new Promise((function(_,S){u(),c(y);var v=this.sourceCache,w=y.fileName;this._get(w).then((function(x){var O=a(x),F=O.substr(0,5)==="data:",D=w.substring(0,w.lastIndexOf("/")+1);return O[0]!=="/"&&!F&&!/^https?:\/\/|^\/\//i.test(O)&&(O=D+O),this._getSourceMapConsumer(O,D).then(function(R){return d(y,R,v).then(_).catch(function(){_(y)})})}).bind(this),S).catch(S)}).bind(this))}}})}(fo)),fo.exports}var
|
|
49
|
+
`).filter(function(a){return!!a.match(s)&&!a.match(/^Error created at/)},this);return c.map(function(a){var d=a.split("@"),f=this.extractLocation(d.pop()),p=d.shift()||"",h=p.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,y;p.match(/\(([^)]*)\)/)&&(y=p.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var _=y===void 0||y==="[arguments not available]"?void 0:y.split(",");return new r({functionName:h,args:_,fileName:f[0],lineNumber:f[1],columnNumber:f[2],source:a})},this)}}})}(co)),co.exports}var lo={exports:{}},wc;function Ty(){return wc||(wc=1,function(e,t){(function(n,r){e.exports=r(va())})(ce,function(n){return{backtrace:function(s){var o=[],l=10;typeof s=="object"&&typeof s.maxStackSize=="number"&&(l=s.maxStackSize);for(var i=arguments.callee;i&&o.length<l&&i.arguments;){for(var u=new Array(i.arguments.length),c=0;c<u.length;++c)u[c]=i.arguments[c];/function(?:\s+([\w$]+))+\s*\(/.test(i.toString())?o.push(new n({functionName:RegExp.$1||void 0,args:u})):o.push(new n({args:u}));try{i=i.caller}catch{break}}return o}}})}(lo)),lo.exports}var fo={exports:{}},gr={},po={},bc;function dl(){return bc||(bc=1,function(e){function t(v,w,x){if(w in v)return v[w];if(arguments.length===3)return x;throw new Error('"'+w+'" is a required argument.')}e.getArg=t;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,r=/^data:.+\,.+$/;function s(v){var w=v.match(n);return w?{scheme:w[1],auth:w[2],host:w[3],port:w[4],path:w[5]}:null}e.urlParse=s;function o(v){var w="";return v.scheme&&(w+=v.scheme+":"),w+="//",v.auth&&(w+=v.auth+"@"),v.host&&(w+=v.host),v.port&&(w+=":"+v.port),v.path&&(w+=v.path),w}e.urlGenerate=o;function l(v){var w=v,x=s(v);if(x){if(!x.path)return v;w=x.path}for(var O=e.isAbsolute(w),F=w.split(/\/+/),D,R=0,W=F.length-1;W>=0;W--)D=F[W],D==="."?F.splice(W,1):D===".."?R++:R>0&&(D===""?(F.splice(W+1,R),R=0):(F.splice(W,2),R--));return w=F.join("/"),w===""&&(w=O?"/":"."),x?(x.path=w,o(x)):w}e.normalize=l;function i(v,w){v===""&&(v="."),w===""&&(w=".");var x=s(w),O=s(v);if(O&&(v=O.path||"/"),x&&!x.scheme)return O&&(x.scheme=O.scheme),o(x);if(x||w.match(r))return w;if(O&&!O.host&&!O.path)return O.host=w,o(O);var F=w.charAt(0)==="/"?w:l(v.replace(/\/+$/,"")+"/"+w);return O?(O.path=F,o(O)):F}e.join=i,e.isAbsolute=function(v){return v.charAt(0)==="/"||!!v.match(n)};function u(v,w){v===""&&(v="."),v=v.replace(/\/$/,"");for(var x=0;w.indexOf(v+"/")!==0;){var O=v.lastIndexOf("/");if(O<0||(v=v.slice(0,O),v.match(/^([^\/]+:\/)?\/*$/)))return w;++x}return Array(x+1).join("../")+w.substr(v.length+1)}e.relative=u;var c=function(){var v=Object.create(null);return!("__proto__"in v)}();function a(v){return v}function d(v){return p(v)?"$"+v:v}e.toSetString=c?a:d;function f(v){return p(v)?v.slice(1):v}e.fromSetString=c?a:f;function p(v){if(!v)return!1;var w=v.length;if(w<9||v.charCodeAt(w-1)!==95||v.charCodeAt(w-2)!==95||v.charCodeAt(w-3)!==111||v.charCodeAt(w-4)!==116||v.charCodeAt(w-5)!==111||v.charCodeAt(w-6)!==114||v.charCodeAt(w-7)!==112||v.charCodeAt(w-8)!==95||v.charCodeAt(w-9)!==95)return!1;for(var x=w-10;x>=0;x--)if(v.charCodeAt(x)!==36)return!1;return!0}function h(v,w,x){var O=v.source-w.source;return O!==0||(O=v.originalLine-w.originalLine,O!==0)||(O=v.originalColumn-w.originalColumn,O!==0||x)||(O=v.generatedColumn-w.generatedColumn,O!==0)||(O=v.generatedLine-w.generatedLine,O!==0)?O:v.name-w.name}e.compareByOriginalPositions=h;function y(v,w,x){var O=v.generatedLine-w.generatedLine;return O!==0||(O=v.generatedColumn-w.generatedColumn,O!==0||x)||(O=v.source-w.source,O!==0)||(O=v.originalLine-w.originalLine,O!==0)||(O=v.originalColumn-w.originalColumn,O!==0)?O:v.name-w.name}e.compareByGeneratedPositionsDeflated=y;function _(v,w){return v===w?0:v>w?1:-1}function S(v,w){var x=v.generatedLine-w.generatedLine;return x!==0||(x=v.generatedColumn-w.generatedColumn,x!==0)||(x=_(v.source,w.source),x!==0)||(x=v.originalLine-w.originalLine,x!==0)||(x=v.originalColumn-w.originalColumn,x!==0)?x:_(v.name,w.name)}e.compareByGeneratedPositionsInflated=S}(po)),po}var ho={},Sc;function xy(){return Sc||(Sc=1,function(e){e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2;function t(n,r,s,o,l,i){var u=Math.floor((r-n)/2)+n,c=l(s,o[u],!0);return c===0?u:c>0?r-u>1?t(u,r,s,o,l,i):i==e.LEAST_UPPER_BOUND?r<o.length?r:-1:u:u-n>1?t(n,u,s,o,l,i):i==e.LEAST_UPPER_BOUND?u:n<0?-1:n}e.search=function(r,s,o,l){if(s.length===0)return-1;var i=t(-1,s.length,r,s,o,l||e.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&o(s[i],s[i-1],!0)===0;)--i;return i}}(ho)),ho}var mo={},Oc;function Ay(){if(Oc)return mo;Oc=1;var e=dl(),t=Object.prototype.hasOwnProperty;function n(){this._array=[],this._set=Object.create(null)}return n.fromArray=function(s,o){for(var l=new n,i=0,u=s.length;i<u;i++)l.add(s[i],o);return l},n.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},n.prototype.add=function(s,o){var l=e.toSetString(s),i=t.call(this._set,l),u=this._array.length;(!i||o)&&this._array.push(s),i||(this._set[l]=u)},n.prototype.has=function(s){var o=e.toSetString(s);return t.call(this._set,o)},n.prototype.indexOf=function(s){var o=e.toSetString(s);if(t.call(this._set,o))return this._set[o];throw new Error('"'+s+'" is not in the set.')},n.prototype.at=function(s){if(s>=0&&s<this._array.length)return this._array[s];throw new Error("No element indexed by "+s)},n.prototype.toArray=function(){return this._array.slice()},mo.ArraySet=n,mo}var wn={},bn={},Tc;function Ry(){if(Tc)return bn;Tc=1;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");return bn.encode=function(t){if(0<=t&&t<e.length)return e[t];throw new TypeError("Must be between 0 and 63: "+t)},bn.decode=function(t){var n=65,r=90,s=97,o=122,l=48,i=57,u=43,c=47,a=26,d=52;return n<=t&&t<=r?t-n:s<=t&&t<=o?t-s+a:l<=t&&t<=i?t-l+d:t==u?62:t==c?63:-1},bn}var xc;function Cy(){if(xc)return wn;xc=1;var e=Ry(),t=5,n=1<<t,r=n-1,s=n;function o(i){return i<0?(-i<<1)+1:(i<<1)+0}function l(i){var u=(i&1)===1,c=i>>1;return u?-c:c}return wn.encode=function(u){var c="",a,d=o(u);do a=d&r,d>>>=t,d>0&&(a|=s),c+=e.encode(a);while(d>0);return c},wn.decode=function(u,c,a){var d=u.length,f=0,p=0,h,y;do{if(c>=d)throw new Error("Expected more digits in base 64 VLQ value.");if(y=e.decode(u.charCodeAt(c++)),y===-1)throw new Error("Invalid base64 digit: "+u.charAt(c-1));h=!!(y&s),y&=r,f=f+(y<<p),p+=t}while(h);a.value=l(f),a.rest=c},wn}var go={},Ac;function Ny(){if(Ac)return go;Ac=1;function e(r,s,o){var l=r[s];r[s]=r[o],r[o]=l}function t(r,s){return Math.round(r+Math.random()*(s-r))}function n(r,s,o,l){if(o<l){var i=t(o,l),u=o-1;e(r,i,l);for(var c=r[l],a=o;a<l;a++)s(r[a],c)<=0&&(u+=1,e(r,u,a));e(r,u+1,a);var d=u+1;n(r,s,o,d-1),n(r,s,d+1,l)}}return go.quickSort=function(r,s){n(r,s,0,r.length-1)},go}var Rc;function Py(){if(Rc)return gr;Rc=1;var e=dl(),t=xy(),n=Ay().ArraySet,r=Cy(),s=Ny().quickSort;function o(c){var a=c;return typeof c=="string"&&(a=JSON.parse(c.replace(/^\)\]\}'/,""))),a.sections!=null?new u(a):new l(a)}o.fromSourceMap=function(c){return l.fromSourceMap(c)},o.prototype._version=3,o.prototype.__generatedMappings=null,Object.defineProperty(o.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),o.prototype.__originalMappings=null,Object.defineProperty(o.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),o.prototype._charIsMappingSeparator=function(a,d){var f=a.charAt(d);return f===";"||f===","},o.prototype._parseMappings=function(a,d){throw new Error("Subclasses must implement _parseMappings")},o.GENERATED_ORDER=1,o.ORIGINAL_ORDER=2,o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2,o.prototype.eachMapping=function(a,d,f){var p=d||null,h=f||o.GENERATED_ORDER,y;switch(h){case o.GENERATED_ORDER:y=this._generatedMappings;break;case o.ORIGINAL_ORDER:y=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var _=this.sourceRoot;y.map(function(S){var v=S.source===null?null:this._sources.at(S.source);return v!=null&&_!=null&&(v=e.join(_,v)),{source:v,generatedLine:S.generatedLine,generatedColumn:S.generatedColumn,originalLine:S.originalLine,originalColumn:S.originalColumn,name:S.name===null?null:this._names.at(S.name)}},this).forEach(a,p)},o.prototype.allGeneratedPositionsFor=function(a){var d=e.getArg(a,"line"),f={source:e.getArg(a,"source"),originalLine:d,originalColumn:e.getArg(a,"column",0)};if(this.sourceRoot!=null&&(f.source=e.relative(this.sourceRoot,f.source)),!this._sources.has(f.source))return[];f.source=this._sources.indexOf(f.source);var p=[],h=this._findMapping(f,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,t.LEAST_UPPER_BOUND);if(h>=0){var y=this._originalMappings[h];if(a.column===void 0)for(var _=y.originalLine;y&&y.originalLine===_;)p.push({line:e.getArg(y,"generatedLine",null),column:e.getArg(y,"generatedColumn",null),lastColumn:e.getArg(y,"lastGeneratedColumn",null)}),y=this._originalMappings[++h];else for(var S=y.originalColumn;y&&y.originalLine===d&&y.originalColumn==S;)p.push({line:e.getArg(y,"generatedLine",null),column:e.getArg(y,"generatedColumn",null),lastColumn:e.getArg(y,"lastGeneratedColumn",null)}),y=this._originalMappings[++h]}return p},gr.SourceMapConsumer=o;function l(c){var a=c;typeof c=="string"&&(a=JSON.parse(c.replace(/^\)\]\}'/,"")));var d=e.getArg(a,"version"),f=e.getArg(a,"sources"),p=e.getArg(a,"names",[]),h=e.getArg(a,"sourceRoot",null),y=e.getArg(a,"sourcesContent",null),_=e.getArg(a,"mappings"),S=e.getArg(a,"file",null);if(d!=this._version)throw new Error("Unsupported version: "+d);f=f.map(String).map(e.normalize).map(function(v){return h&&e.isAbsolute(h)&&e.isAbsolute(v)?e.relative(h,v):v}),this._names=n.fromArray(p.map(String),!0),this._sources=n.fromArray(f,!0),this.sourceRoot=h,this.sourcesContent=y,this._mappings=_,this.file=S}l.prototype=Object.create(o.prototype),l.prototype.consumer=o,l.fromSourceMap=function(a){var d=Object.create(l.prototype),f=d._names=n.fromArray(a._names.toArray(),!0),p=d._sources=n.fromArray(a._sources.toArray(),!0);d.sourceRoot=a._sourceRoot,d.sourcesContent=a._generateSourcesContent(d._sources.toArray(),d.sourceRoot),d.file=a._file;for(var h=a._mappings.toArray().slice(),y=d.__generatedMappings=[],_=d.__originalMappings=[],S=0,v=h.length;S<v;S++){var w=h[S],x=new i;x.generatedLine=w.generatedLine,x.generatedColumn=w.generatedColumn,w.source&&(x.source=p.indexOf(w.source),x.originalLine=w.originalLine,x.originalColumn=w.originalColumn,w.name&&(x.name=f.indexOf(w.name)),_.push(x)),y.push(x)}return s(d.__originalMappings,e.compareByOriginalPositions),d},l.prototype._version=3,Object.defineProperty(l.prototype,"sources",{get:function(){return this._sources.toArray().map(function(c){return this.sourceRoot!=null?e.join(this.sourceRoot,c):c},this)}});function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}l.prototype._parseMappings=function(a,d){for(var f=1,p=0,h=0,y=0,_=0,S=0,v=a.length,w=0,x={},O={},F=[],D=[],R,W,Q,k,U;w<v;)if(a.charAt(w)===";")f++,w++,p=0;else if(a.charAt(w)===",")w++;else{for(R=new i,R.generatedLine=f,k=w;k<v&&!this._charIsMappingSeparator(a,k);k++);if(W=a.slice(w,k),Q=x[W],Q)w+=W.length;else{for(Q=[];w<k;)r.decode(a,w,O),U=O.value,w=O.rest,Q.push(U);if(Q.length===2)throw new Error("Found a source, but no line and column");if(Q.length===3)throw new Error("Found a source and line, but no column");x[W]=Q}R.generatedColumn=p+Q[0],p=R.generatedColumn,Q.length>1&&(R.source=_+Q[1],_+=Q[1],R.originalLine=h+Q[2],h=R.originalLine,R.originalLine+=1,R.originalColumn=y+Q[3],y=R.originalColumn,Q.length>4&&(R.name=S+Q[4],S+=Q[4])),D.push(R),typeof R.originalLine=="number"&&F.push(R)}s(D,e.compareByGeneratedPositionsDeflated),this.__generatedMappings=D,s(F,e.compareByOriginalPositions),this.__originalMappings=F},l.prototype._findMapping=function(a,d,f,p,h,y){if(a[f]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+a[f]);if(a[p]<0)throw new TypeError("Column must be greater than or equal to 0, got "+a[p]);return t.search(a,d,h,y)},l.prototype.computeColumnSpans=function(){for(var a=0;a<this._generatedMappings.length;++a){var d=this._generatedMappings[a];if(a+1<this._generatedMappings.length){var f=this._generatedMappings[a+1];if(d.generatedLine===f.generatedLine){d.lastGeneratedColumn=f.generatedColumn-1;continue}}d.lastGeneratedColumn=1/0}},l.prototype.originalPositionFor=function(a){var d={generatedLine:e.getArg(a,"line"),generatedColumn:e.getArg(a,"column")},f=this._findMapping(d,this._generatedMappings,"generatedLine","generatedColumn",e.compareByGeneratedPositionsDeflated,e.getArg(a,"bias",o.GREATEST_LOWER_BOUND));if(f>=0){var p=this._generatedMappings[f];if(p.generatedLine===d.generatedLine){var h=e.getArg(p,"source",null);h!==null&&(h=this._sources.at(h),this.sourceRoot!=null&&(h=e.join(this.sourceRoot,h)));var y=e.getArg(p,"name",null);return y!==null&&(y=this._names.at(y)),{source:h,line:e.getArg(p,"originalLine",null),column:e.getArg(p,"originalColumn",null),name:y}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(a){return a==null}):!1},l.prototype.sourceContentFor=function(a,d){if(!this.sourcesContent)return null;if(this.sourceRoot!=null&&(a=e.relative(this.sourceRoot,a)),this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];var f;if(this.sourceRoot!=null&&(f=e.urlParse(this.sourceRoot))){var p=a.replace(/^file:\/\//,"");if(f.scheme=="file"&&this._sources.has(p))return this.sourcesContent[this._sources.indexOf(p)];if((!f.path||f.path=="/")&&this._sources.has("/"+a))return this.sourcesContent[this._sources.indexOf("/"+a)]}if(d)return null;throw new Error('"'+a+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(a){var d=e.getArg(a,"source");if(this.sourceRoot!=null&&(d=e.relative(this.sourceRoot,d)),!this._sources.has(d))return{line:null,column:null,lastColumn:null};d=this._sources.indexOf(d);var f={source:d,originalLine:e.getArg(a,"line"),originalColumn:e.getArg(a,"column")},p=this._findMapping(f,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,e.getArg(a,"bias",o.GREATEST_LOWER_BOUND));if(p>=0){var h=this._originalMappings[p];if(h.source===f.source)return{line:e.getArg(h,"generatedLine",null),column:e.getArg(h,"generatedColumn",null),lastColumn:e.getArg(h,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},gr.BasicSourceMapConsumer=l;function u(c){var a=c;typeof c=="string"&&(a=JSON.parse(c.replace(/^\)\]\}'/,"")));var d=e.getArg(a,"version"),f=e.getArg(a,"sections");if(d!=this._version)throw new Error("Unsupported version: "+d);this._sources=new n,this._names=new n;var p={line:-1,column:0};this._sections=f.map(function(h){if(h.url)throw new Error("Support for url field in sections not implemented.");var y=e.getArg(h,"offset"),_=e.getArg(y,"line"),S=e.getArg(y,"column");if(_<p.line||_===p.line&&S<p.column)throw new Error("Section offsets must be ordered and non-overlapping.");return p=y,{generatedOffset:{generatedLine:_+1,generatedColumn:S+1},consumer:new o(e.getArg(h,"map"))}})}return u.prototype=Object.create(o.prototype),u.prototype.constructor=o,u.prototype._version=3,Object.defineProperty(u.prototype,"sources",{get:function(){for(var c=[],a=0;a<this._sections.length;a++)for(var d=0;d<this._sections[a].consumer.sources.length;d++)c.push(this._sections[a].consumer.sources[d]);return c}}),u.prototype.originalPositionFor=function(a){var d={generatedLine:e.getArg(a,"line"),generatedColumn:e.getArg(a,"column")},f=t.search(d,this._sections,function(h,y){var _=h.generatedLine-y.generatedOffset.generatedLine;return _||h.generatedColumn-y.generatedOffset.generatedColumn}),p=this._sections[f];return p?p.consumer.originalPositionFor({line:d.generatedLine-(p.generatedOffset.generatedLine-1),column:d.generatedColumn-(p.generatedOffset.generatedLine===d.generatedLine?p.generatedOffset.generatedColumn-1:0),bias:a.bias}):{source:null,line:null,column:null,name:null}},u.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(a){return a.consumer.hasContentsOfAllSources()})},u.prototype.sourceContentFor=function(a,d){for(var f=0;f<this._sections.length;f++){var p=this._sections[f],h=p.consumer.sourceContentFor(a,!0);if(h)return h}if(d)return null;throw new Error('"'+a+'" is not in the SourceMap.')},u.prototype.generatedPositionFor=function(a){for(var d=0;d<this._sections.length;d++){var f=this._sections[d];if(f.consumer.sources.indexOf(e.getArg(a,"source"))!==-1){var p=f.consumer.generatedPositionFor(a);if(p){var h={line:p.line+(f.generatedOffset.generatedLine-1),column:p.column+(f.generatedOffset.generatedLine===p.line?f.generatedOffset.generatedColumn-1:0)};return h}}}return{line:null,column:null}},u.prototype._parseMappings=function(a,d){this.__generatedMappings=[],this.__originalMappings=[];for(var f=0;f<this._sections.length;f++)for(var p=this._sections[f],h=p.consumer._generatedMappings,y=0;y<h.length;y++){var _=h[y],S=p.consumer._sources.at(_.source);p.consumer.sourceRoot!==null&&(S=e.join(p.consumer.sourceRoot,S)),this._sources.add(S),S=this._sources.indexOf(S);var v=p.consumer._names.at(_.name);this._names.add(v),v=this._names.indexOf(v);var w={source:S,generatedLine:_.generatedLine+(p.generatedOffset.generatedLine-1),generatedColumn:_.generatedColumn+(p.generatedOffset.generatedLine===_.generatedLine?p.generatedOffset.generatedColumn-1:0),originalLine:_.originalLine,originalColumn:_.originalColumn,name:v};this.__generatedMappings.push(w),typeof w.originalLine=="number"&&this.__originalMappings.push(w)}s(this.__generatedMappings,e.compareByGeneratedPositionsDeflated),s(this.__originalMappings,e.compareByOriginalPositions)},gr.IndexedSourceMapConsumer=u,gr}var Cc;function Iy(){return Cc||(Cc=1,function(e,t){(function(n,r){e.exports=r(Py(),va())})(ce,function(n,r){function s(f){return new Promise(function(p,h){var y=new XMLHttpRequest;y.open("get",f),y.onerror=h,y.onreadystatechange=function(){y.readyState===4&&(y.status>=200&&y.status<300||f.substr(0,7)==="file://"&&y.responseText?p(y.responseText):h(new Error("HTTP status: "+y.status+" retrieving "+f)))},y.send()})}function o(f){if(typeof window<"u"&&window.atob)return window.atob(f);throw new Error("You must supply a polyfill for window.atob in this environment")}function l(f){if(typeof JSON<"u"&&JSON.parse)return JSON.parse(f);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function i(f,p){for(var h=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],y=f.split(`
|
|
50
|
+
`),_="",S=Math.min(p,20),v=0;v<S;++v){var w=y[p-v-1],x=w.indexOf("//");if(x>=0&&(w=w.substr(0,x)),w){_=w+_;for(var O=h.length,F=0;F<O;F++){var D=h[F].exec(_);if(D&&D[1])return D[1]}}}}function u(){if(typeof Object.defineProperty!="function"||typeof Object.create!="function")throw new Error("Unable to consume source maps in older browsers")}function c(f){if(typeof f!="object")throw new TypeError("Given StackFrame is not an object");if(typeof f.fileName!="string")throw new TypeError("Given file name is not a String");if(typeof f.lineNumber!="number"||f.lineNumber%1!==0||f.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if(typeof f.columnNumber!="number"||f.columnNumber%1!==0||f.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function a(f){for(var p=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/mg,h,y;y=p.exec(f);)h=y[1];if(h)return h;throw new Error("sourceMappingURL not found")}function d(f,p,h){return new Promise(function(y,_){var S=p.originalPositionFor({line:f.lineNumber,column:f.columnNumber});if(S.source){var v=p.sourceContentFor(S.source);v&&(h[S.source]=v),y(new r({functionName:S.name||f.functionName,args:f.args,fileName:S.source,lineNumber:S.line,columnNumber:S.column}))}else _(new Error("Could not get original source for given stackframe and source map"))})}return function f(p){if(!(this instanceof f))return new f(p);p=p||{},this.sourceCache=p.sourceCache||{},this.sourceMapConsumerCache=p.sourceMapConsumerCache||{},this.ajax=p.ajax||s,this._atob=p.atob||o,this._get=function(y){return new Promise((function(_,S){var v=y.substr(0,5)==="data:";if(this.sourceCache[y])_(this.sourceCache[y]);else if(p.offline&&!v)S(new Error("Cannot make network requests in offline mode"));else if(v){var w=/^data:application\/json;([\w=:"-]+;)*base64,/,x=y.match(w);if(x){var O=x[0].length,F=y.substr(O),D=this._atob(F);this.sourceCache[y]=D,_(D)}else S(new Error("The encoding of the inline sourcemap is not supported"))}else{var R=this.ajax(y,{method:"get"});this.sourceCache[y]=R,R.then(_,S)}}).bind(this))},this._getSourceMapConsumer=function(y,_){return new Promise((function(S){if(this.sourceMapConsumerCache[y])S(this.sourceMapConsumerCache[y]);else{var v=new Promise((function(w,x){return this._get(y).then(function(O){typeof O=="string"&&(O=l(O.replace(/^\)\]\}'/,""))),typeof O.sourceRoot>"u"&&(O.sourceRoot=_),w(new n.SourceMapConsumer(O))}).catch(x)}).bind(this));this.sourceMapConsumerCache[y]=v,S(v)}}).bind(this))},this.pinpoint=function(y){return new Promise((function(_,S){this.getMappedLocation(y).then((function(v){function w(){_(v)}this.findFunctionName(v).then(_,w).catch(w)}).bind(this),S)}).bind(this))},this.findFunctionName=function(y){return new Promise((function(_,S){c(y),this._get(y.fileName).then(function(w){var x=y.lineNumber,O=y.columnNumber,F=i(w,x);_(F?new r({functionName:F,args:y.args,fileName:y.fileName,lineNumber:x,columnNumber:O}):y)},S).catch(S)}).bind(this))},this.getMappedLocation=function(y){return new Promise((function(_,S){u(),c(y);var v=this.sourceCache,w=y.fileName;this._get(w).then((function(x){var O=a(x),F=O.substr(0,5)==="data:",D=w.substring(0,w.lastIndexOf("/")+1);return O[0]!=="/"&&!F&&!/^https?:\/\/|^\/\//i.test(O)&&(O=D+O),this._getSourceMapConsumer(O,D).then(function(R){return d(y,R,v).then(_).catch(function(){_(y)})})}).bind(this),S).catch(S)}).bind(this))}}})}(fo)),fo.exports}var Nc;function ky(){return Nc||(Nc=1,function(e,t){(function(n,r){e.exports=r(Oy(),Ty(),Iy())})(ce,function(r,s,o){var l={filter:function(d){return(d.functionName||"").indexOf("StackTrace$$")===-1&&(d.functionName||"").indexOf("ErrorStackParser$$")===-1&&(d.functionName||"").indexOf("StackTraceGPS$$")===-1&&(d.functionName||"").indexOf("StackGenerator$$")===-1},sourceCache:{}},i=function(){try{throw new Error}catch(f){return f}};function u(d,f){var p={};return[d,f].forEach(function(h){for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&(p[y]=h[y]);return p}),p}function c(d){return d.stack||d["opera#sourceloc"]}function a(d,f){return typeof f=="function"?d.filter(f):d}return{get:function(f){var p=i();return c(p)?this.fromError(p,f):this.generateArtificially(f)},getSync:function(f){f=u(l,f);var p=i(),h=c(p)?r.parse(p):s.backtrace(f);return a(h,f.filter)},fromError:function(f,p){p=u(l,p);var h=new o(p);return new Promise((function(y){var _=a(r.parse(f),p.filter);y(Promise.all(_.map(function(S){return new Promise(function(v){function w(){v(S)}h.pinpoint(S).then(v,w).catch(w)})})))}).bind(this))},generateArtificially:function(f){f=u(l,f);var p=s.backtrace(f);return typeof f.filter=="function"&&(p=p.filter(f.filter)),Promise.resolve(p)},instrument:function(f,p,h,y){if(typeof f!="function")throw new Error("Cannot instrument non-function object");if(typeof f.__stacktraceOriginalFn=="function")return f;var _=(function(){try{return this.get().then(p,h).catch(h),f.apply(y||this,arguments)}catch(v){throw c(v)&&this.fromError(v).then(p,h).catch(h),v}}).bind(this);return _.__stacktraceOriginalFn=f,_},deinstrument:function(f){if(typeof f!="function")throw new Error("Cannot de-instrument non-function object");return typeof f.__stacktraceOriginalFn=="function"?f.__stacktraceOriginalFn:f},report:function(f,p,h,y){return new Promise(function(_,S){var v=new XMLHttpRequest;if(v.onerror=S,v.onreadystatechange=function(){v.readyState===4&&(v.status>=200&&v.status<400?_(v.responseText):S(new Error("POST to "+p+" failed with status: "+v.status)))},v.open("post",p),v.setRequestHeader("Content-Type","application/json"),y&&typeof y.headers=="object"){var w=y.headers;for(var x in w)Object.prototype.hasOwnProperty.call(w,x)&&v.setRequestHeader(x,w[x])}var O={stack:f};h!=null&&(O.message=h),v.send(JSON.stringify(O))})}}})}(so)),so.exports}var yo,Pc;function Ly(){if(Pc)return yo;Pc=1;var e=ky(),t="https://clouderrorreporting.googleapis.com/v1beta1/projects/",n=function(){};n.prototype.start=function(l){if(!l.key&&!l.targetUrl&&!l.customReportingFunction)throw new Error("Cannot initialize: No API key, target url or custom reporting function provided.");if(!l.projectId&&!l.targetUrl&&!l.customReportingFunction)throw new Error("Cannot initialize: No project ID, target url or custom reporting function provided.");this.customReportingFunction=l.customReportingFunction,this.apiKey=l.key,this.projectId=l.projectId,this.targetUrl=l.targetUrl,this.context=l.context||{},this.serviceContext={service:l.service||"web"},l.version&&(this.serviceContext.version=l.version),this.reportUncaughtExceptions=l.reportUncaughtExceptions!==!1,this.reportUnhandledPromiseRejections=l.reportUnhandledPromiseRejections!==!1,this.disabled=!!l.disabled,r(this)};function r(l){var i=function(){};if(l.reportUncaughtExceptions){var u=window.onerror||i;window.onerror=function(a,d,f,p,h){return h&&l.report(h).catch(i),u(a,d,f,p,h),!0}}if(l.reportUnhandledPromiseRejections){var c=window.onunhandledrejection||i;window.onunhandledrejection=function(a){return a&&l.report(a.reason).catch(i),c(a.reason),!0}}}n.prototype.report=function(l,i){if(this.disabled)return Promise.resolve(null);if(!l)return Promise.reject(new Error("no error to report"));i=i||{};var u={};u.serviceContext=this.serviceContext,u.context=this.context,u.context.httpRequest={userAgent:window.navigator.userAgent,url:window.location.href};var c=0;if(typeof l=="string"||l instanceof String){try{throw new Error(l)}catch(f){l=f}c=i.skipLocalFrames||1}var a=this.targetUrl||t+this.projectId+"/events:report?key="+this.apiKey,d=this.customReportingFunction;return s(l,c).then(function(f){return u.message=f,d?d(u):o(a,u)})};function s(l,i){return e.fromError(l).then(function(u){for(var c=[l.toString()],a=i;a<u.length;a++)c.push([" at ",u[a].getFunctionName()||"<anonymous>"," (",u[a].getFileName(),":",u[a].getLineNumber(),":",u[a].getColumnNumber(),")"].join(""));return c.join(`
|
|
51
51
|
`)},function(u){return["Error extracting stack trace: ",u,`
|
|
52
52
|
`,l.toString(),`
|
|
53
|
-
`," (",l.file,":",l.line,":",l.column,")"].join("")})}function o(l,i){var u=new XMLHttpRequest;return u.open("POST",l,!0),u.setRequestHeader("Content-Type","application/json; charset=UTF-8"),new Promise(function(c,a){u.onreadystatechange=function(){if(u.readyState===4){var d=u.status;if(d>=200&&d<300)c({message:i.message});else if(d===429)a({message:"quota or rate limiting error on stackdriver report",name:"Http429FakeError"});else{var f=d?d+" http response":"network error";a(new Error(f+" on stackdriver report"))}}},u.send(JSON.stringify(i))})}return n.prototype.setUser=function(l){this.context.user=l},yo=n,yo}var
|
|
53
|
+
`," (",l.file,":",l.line,":",l.column,")"].join("")})}function o(l,i){var u=new XMLHttpRequest;return u.open("POST",l,!0),u.setRequestHeader("Content-Type","application/json; charset=UTF-8"),new Promise(function(c,a){u.onreadystatechange=function(){if(u.readyState===4){var d=u.status;if(d>=200&&d<300)c({message:i.message});else if(d===429)a({message:"quota or rate limiting error on stackdriver report",name:"Http429FakeError"});else{var f=d?d+" http response":"network error";a(new Error(f+" on stackdriver report"))}}},u.send(JSON.stringify(i))})}return n.prototype.setUser=function(l){this.context.user=l},yo=n,yo}var Ic;function Fy(){return Ic||(Ic=1,function(e,t){(function(n,r){e.exports=r(Ly())})(ce,function(n){return function(){var r={542:function(i){i.exports=n}},s={};function o(i){var u=s[i];if(u!==void 0)return u.exports;var c=s[i]={exports:{}};return r[i](c,c.exports,o),c.exports}o.n=function(i){var u=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(u,{a:u}),u},o.d=function(i,u){for(var c in u)o.o(u,c)&&!o.o(i,c)&&Object.defineProperty(i,c,{enumerable:!0,get:u[c]})},o.o=function(i,u){return Object.prototype.hasOwnProperty.call(i,u)},o.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var l={};return function(){o.r(l),o.d(l,{reportError:function(){return f},setContext:function(){return d}});var i=o(542),u=o.n(i);const{GCP:{PROJECT_ID:c}}={GCP:{PROJECT_ID:"hazel-tea-194609"}};let a={key:null,environment:null,projectId:c};const d=({apiKey:p,environment:h,projectId:y,serviceName:_})=>{if(!p)throw new Error("Cannot set context: REACT_APP_GCP_ERRORS_API_KEY not defined");if(a.key=p,!h)throw new Error("Cannot set context: Environment not defined");a.environment=h,a.projectId=y||c,_&&(a.service=`${_}:${a.environment}`)},f=async(p,h)=>{try{const y=new(u());y.start(a),typeof h=="string"&&y.setUser(h),await y.report(p)}catch(y){console.warn(`Cannot report error: ${y.message}`)}}}(),l}()})}(ao)),ao.exports}var vo={exports:{}},Sn={},kc;function jy(){if(kc)return Sn;kc=1,Object.defineProperty(Sn,"__esModule",{value:!0});var e=function(n){console.warn("[react-gtm]",n)};return Sn.default=e,Sn}var _o,Lc;function My(){if(Lc)return _o;Lc=1;var e=jy(),t=n(e);function n(s){return s&&s.__esModule?s:{default:s}}var r={tags:function(o){var l=o.id,i=o.events,u=o.dataLayer,c=o.dataLayerName,a=o.preview,d=o.auth,f=">m_auth="+d,p=">m_preview="+a;l||(0,t.default)("GTM Id is required");var h=`
|
|
54
54
|
<iframe src="https://www.googletagmanager.com/ns.html?id=`+l+f+p+`>m_cookies_win=x"
|
|
55
55
|
height="0" width="0" style="display:none;visibility:hidden" id="tag-manager"></iframe>`,y=`
|
|
56
56
|
(function(w,d,s,l,i){w[l]=w[l]||[];
|
|
@@ -60,15 +60,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
60
60
|
f.parentNode.insertBefore(j,f);
|
|
61
61
|
})(window,document,'script','`+c+"','"+l+"');",_=this.dataLayer(u,c);return{iframe:h,script:y,dataLayerVar:_}},dataLayer:function(o,l){return`
|
|
62
62
|
window.`+l+" = window."+l+` || [];
|
|
63
|
-
window.`+l+".push("+JSON.stringify(o)+")"}};return _o=r,_o}var Eo,Lc;function My(){if(Lc)return Eo;Lc=1;var e=jy(),t=n(e);function n(s){return s&&s.__esModule?s:{default:s}}var r={dataScript:function(o){var l=document.createElement("script");return l.innerHTML=o,l},gtm:function(o){var l=t.default.tags(o),i=function(){var d=document.createElement("noscript");return d.innerHTML=l.iframe,d},u=function(){var d=document.createElement("script");return d.innerHTML=l.script,d},c=this.dataScript(l.dataLayerVar);return{noScript:i,script:u,dataScript:c}},initialize:function(o){var l=o.gtmId,i=o.events,u=i===void 0?{}:i,c=o.dataLayer,a=o.dataLayerName,d=a===void 0?"dataLayer":a,f=o.auth,p=f===void 0?"":f,h=o.preview,y=h===void 0?"":h,_=this.gtm({id:l,events:u,dataLayer:c||void 0,dataLayerName:d,auth:p,preview:y});c&&document.head.appendChild(_.dataScript),document.head.insertBefore(_.script(),document.head.childNodes[0]),document.body.insertBefore(_.noScript(),document.body.childNodes[0])},dataLayer:function(o){var l=o.dataLayer,i=o.dataLayerName,u=i===void 0?"dataLayer":i;if(window[u])return window[u].push(l);var c=t.default.dataLayer(l,u),a=this.dataScript(c);document.head.insertBefore(a,document.head.childNodes[0])}};return Eo=r,Eo}var wo,Fc;function Dy(){if(Fc)return wo;Fc=1;var e=My(),t=n(e);function n(r){return r&&r.__esModule?r:{default:r}}return wo=t.default,wo}var jc;function Uy(){return jc||(jc=1,function(e,t){(function(n,r){e.exports=r(Dy())})(ce,function(n){return function(){var r={273:function(i){i.exports=n}},s={};function o(i){var u=s[i];if(u!==void 0)return u.exports;var c=s[i]={exports:{}};return r[i](c,c.exports,o),c.exports}o.n=function(i){var u=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(u,{a:u}),u},o.d=function(i,u){for(var c in u)o.o(u,c)&&!o.o(i,c)&&Object.defineProperty(i,c,{enumerable:!0,get:u[c]})},o.o=function(i,u){return Object.prototype.hasOwnProperty.call(i,u)},o.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var l={};return function(){o.r(l),o.d(l,{setContext:function(){return a},setupGTM:function(){return f}});var i=o(273),u=o.n(i);let c=null;const a=({configs:p,environment:h})=>{if(!h)throw new Error("Cannot set context: Environment not defined");if(!p)throw new Error("Cannot set context: REACT_APP_GTM_ID not defined");if(!p[h])throw new Error(`Cannot set context: REACT_APP_GTM_ID not defined for environment - ${JSON.stringify({configs:p,environment:h})}`);c=p[h]},d=()=>c,f=()=>{const p=d();u().initialize({gtmId:p.id})}}(),l}()})}(vo)),vo.exports}var dl=202,pl=502,hl=400,ml=409,gl=100,yl=201,vl=417,By=424,_l=403,El=504,wl=410,bl=505,Sl=418,Ol=419,Tl=507,xl=500,Al=411,Rl=423,Cl=420,Nl=405,Pl=301,Il=302,kl=207,Ll=300,Fl=511,jl=204,Ml=203,Dl=406,Ul=404,Bl=501,$l=304,ql=200,Hl=206,Wl=402,Gl=308,Vl=412,Ql=428,zl=102,Yl=407,Kl=431,Jl=408,Xl=413,Zl=414,ef=416,tf=205,rf=303,nf=503,of=101,af=307,sf=429,cf=401,uf=422,lf=415,ff=305;const $y={ACCEPTED:dl,BAD_GATEWAY:pl,BAD_REQUEST:hl,CONFLICT:ml,CONTINUE:gl,CREATED:yl,EXPECTATION_FAILED:vl,FORBIDDEN:_l,GATEWAY_TIMEOUT:El,GONE:wl,HTTP_VERSION_NOT_SUPPORTED:bl,IM_A_TEAPOT:Sl,INSUFFICIENT_SPACE_ON_RESOURCE:Ol,INSUFFICIENT_STORAGE:Tl,INTERNAL_SERVER_ERROR:xl,LENGTH_REQUIRED:Al,LOCKED:Rl,METHOD_FAILURE:Cl,METHOD_NOT_ALLOWED:Nl,MOVED_PERMANENTLY:Pl,MOVED_TEMPORARILY:Il,MULTI_STATUS:kl,MULTIPLE_CHOICES:Ll,NETWORK_AUTHENTICATION_REQUIRED:Fl,NO_CONTENT:jl,NON_AUTHORITATIVE_INFORMATION:Ml,NOT_ACCEPTABLE:Dl,NOT_FOUND:Ul,NOT_IMPLEMENTED:Bl,NOT_MODIFIED:$l,OK:ql,PARTIAL_CONTENT:Hl,PAYMENT_REQUIRED:Wl,PERMANENT_REDIRECT:Gl,PRECONDITION_FAILED:Vl,PRECONDITION_REQUIRED:Ql,PROCESSING:zl,PROXY_AUTHENTICATION_REQUIRED:Yl,REQUEST_HEADER_FIELDS_TOO_LARGE:Kl,REQUEST_TIMEOUT:Jl,REQUEST_TOO_LONG:Xl,REQUEST_URI_TOO_LONG:Zl,REQUESTED_RANGE_NOT_SATISFIABLE:ef,RESET_CONTENT:tf,SEE_OTHER:rf,SERVICE_UNAVAILABLE:nf,SWITCHING_PROTOCOLS:of,TEMPORARY_REDIRECT:af,TOO_MANY_REQUESTS:sf,UNAUTHORIZED:cf,UNPROCESSABLE_ENTITY:uf,UNSUPPORTED_MEDIA_TYPE:lf,USE_PROXY:ff};var qy={202:"Accepted",502:"Bad Gateway",400:"Bad Request",409:"Conflict",100:"Continue",201:"Created",417:"Expectation Failed",424:"Failed Dependency",403:"Forbidden",504:"Gateway Timeout",410:"Gone",505:"HTTP Version Not Supported",418:"I'm a teapot",419:"Insufficient Space on Resource",507:"Insufficient Storage",500:"Internal Server Error",411:"Length Required",423:"Locked",420:"Method Failure",405:"Method Not Allowed",301:"Moved Permanently",302:"Moved Temporarily",207:"Multi-Status",300:"Multiple Choices",511:"Network Authentication Required",204:"No Content",203:"Non Authoritative Information",406:"Not Acceptable",404:"Not Found",501:"Not Implemented",304:"Not Modified",200:"OK",206:"Partial Content",402:"Payment Required",308:"Permanent Redirect",412:"Precondition Failed",428:"Precondition Required",102:"Processing",407:"Proxy Authentication Required",431:"Request Header Fields Too Large",408:"Request Timeout",413:"Request Entity Too Large",414:"Request-URI Too Long",416:"Requested Range Not Satisfiable",205:"Reset Content",303:"See Other",503:"Service Unavailable",101:"Switching Protocols",307:"Temporary Redirect",429:"Too Many Requests",401:"Unauthorized",451:"Unavailable For Legal Reasons",422:"Unprocessable Entity",415:"Unsupported Media Type",305:"Use Proxy",421:"Misdirected Request"},Hy={Accepted:202,"Bad Gateway":502,"Bad Request":400,Conflict:409,Continue:100,Created:201,"Expectation Failed":417,"Failed Dependency":424,Forbidden:403,"Gateway Timeout":504,Gone:410,"HTTP Version Not Supported":505,"I'm a teapot":418,"Insufficient Space on Resource":419,"Insufficient Storage":507,"Internal Server Error":500,"Length Required":411,Locked:423,"Method Failure":420,"Method Not Allowed":405,"Moved Permanently":301,"Moved Temporarily":302,"Multi-Status":207,"Multiple Choices":300,"Network Authentication Required":511,"No Content":204,"Non Authoritative Information":203,"Not Acceptable":406,"Not Found":404,"Not Implemented":501,"Not Modified":304,OK:200,"Partial Content":206,"Payment Required":402,"Permanent Redirect":308,"Precondition Failed":412,"Precondition Required":428,Processing:102,"Proxy Authentication Required":407,"Request Header Fields Too Large":431,"Request Timeout":408,"Request Entity Too Large":413,"Request-URI Too Long":414,"Requested Range Not Satisfiable":416,"Reset Content":205,"See Other":303,"Service Unavailable":503,"Switching Protocols":101,"Temporary Redirect":307,"Too Many Requests":429,Unauthorized:401,"Unavailable For Legal Reasons":451,"Unprocessable Entity":422,"Unsupported Media Type":415,"Use Proxy":305,"Misdirected Request":421};function df(e){var t=qy[e.toString()];if(!t)throw new Error("Status code does not exist: "+e);return t}function pf(e){var t=Hy[e];if(!t)throw new Error("Reason phrase does not exist: "+e);return t}var hf=df,Zo;(function(e){e[e.ACCEPTED=202]="ACCEPTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.CONFLICT=409]="CONFLICT",e[e.CONTINUE=100]="CONTINUE",e[e.CREATED=201]="CREATED",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.GONE=410]="GONE",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.IM_A_TEAPOT=418]="IM_A_TEAPOT",e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.LOCKED=423]="LOCKED",e[e.METHOD_FAILURE=420]="METHOD_FAILURE",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.OK=200]="OK",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.PROCESSING=102]="PROCESSING",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",e[e.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.USE_PROXY=305]="USE_PROXY",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST"})(Zo||(Zo={}));var ea;(function(e){e.ACCEPTED="Accepted",e.BAD_GATEWAY="Bad Gateway",e.BAD_REQUEST="Bad Request",e.CONFLICT="Conflict",e.CONTINUE="Continue",e.CREATED="Created",e.EXPECTATION_FAILED="Expectation Failed",e.FAILED_DEPENDENCY="Failed Dependency",e.FORBIDDEN="Forbidden",e.GATEWAY_TIMEOUT="Gateway Timeout",e.GONE="Gone",e.HTTP_VERSION_NOT_SUPPORTED="HTTP Version Not Supported",e.IM_A_TEAPOT="I'm a teapot",e.INSUFFICIENT_SPACE_ON_RESOURCE="Insufficient Space on Resource",e.INSUFFICIENT_STORAGE="Insufficient Storage",e.INTERNAL_SERVER_ERROR="Internal Server Error",e.LENGTH_REQUIRED="Length Required",e.LOCKED="Locked",e.METHOD_FAILURE="Method Failure",e.METHOD_NOT_ALLOWED="Method Not Allowed",e.MOVED_PERMANENTLY="Moved Permanently",e.MOVED_TEMPORARILY="Moved Temporarily",e.MULTI_STATUS="Multi-Status",e.MULTIPLE_CHOICES="Multiple Choices",e.NETWORK_AUTHENTICATION_REQUIRED="Network Authentication Required",e.NO_CONTENT="No Content",e.NON_AUTHORITATIVE_INFORMATION="Non Authoritative Information",e.NOT_ACCEPTABLE="Not Acceptable",e.NOT_FOUND="Not Found",e.NOT_IMPLEMENTED="Not Implemented",e.NOT_MODIFIED="Not Modified",e.OK="OK",e.PARTIAL_CONTENT="Partial Content",e.PAYMENT_REQUIRED="Payment Required",e.PERMANENT_REDIRECT="Permanent Redirect",e.PRECONDITION_FAILED="Precondition Failed",e.PRECONDITION_REQUIRED="Precondition Required",e.PROCESSING="Processing",e.PROXY_AUTHENTICATION_REQUIRED="Proxy Authentication Required",e.REQUEST_HEADER_FIELDS_TOO_LARGE="Request Header Fields Too Large",e.REQUEST_TIMEOUT="Request Timeout",e.REQUEST_TOO_LONG="Request Entity Too Large",e.REQUEST_URI_TOO_LONG="Request-URI Too Long",e.REQUESTED_RANGE_NOT_SATISFIABLE="Requested Range Not Satisfiable",e.RESET_CONTENT="Reset Content",e.SEE_OTHER="See Other",e.SERVICE_UNAVAILABLE="Service Unavailable",e.SWITCHING_PROTOCOLS="Switching Protocols",e.TEMPORARY_REDIRECT="Temporary Redirect",e.TOO_MANY_REQUESTS="Too Many Requests",e.UNAUTHORIZED="Unauthorized",e.UNAVAILABLE_FOR_LEGAL_REASONS="Unavailable For Legal Reasons",e.UNPROCESSABLE_ENTITY="Unprocessable Entity",e.UNSUPPORTED_MEDIA_TYPE="Unsupported Media Type",e.USE_PROXY="Use Proxy",e.MISDIRECTED_REQUEST="Misdirected Request"})(ea||(ea={}));var Un=globalThis&&globalThis.__assign||function(){return Un=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Un.apply(this,arguments)};const Wy=Un(Un({},$y),{getStatusCode:pf,getStatusText:hf}),Gy=Object.freeze(Object.defineProperty({__proto__:null,ACCEPTED:dl,BAD_GATEWAY:pl,BAD_REQUEST:hl,CONFLICT:ml,CONTINUE:gl,CREATED:yl,EXPECTATION_FAILED:vl,FAILED_DEPENDENCY:By,FORBIDDEN:_l,GATEWAY_TIMEOUT:El,GONE:wl,HTTP_VERSION_NOT_SUPPORTED:bl,IM_A_TEAPOT:Sl,INSUFFICIENT_SPACE_ON_RESOURCE:Ol,INSUFFICIENT_STORAGE:Tl,INTERNAL_SERVER_ERROR:xl,LENGTH_REQUIRED:Al,LOCKED:Rl,METHOD_FAILURE:Cl,METHOD_NOT_ALLOWED:Nl,MOVED_PERMANENTLY:Pl,MOVED_TEMPORARILY:Il,MULTIPLE_CHOICES:Ll,MULTI_STATUS:kl,NETWORK_AUTHENTICATION_REQUIRED:Fl,NON_AUTHORITATIVE_INFORMATION:Ml,NOT_ACCEPTABLE:Dl,NOT_FOUND:Ul,NOT_IMPLEMENTED:Bl,NOT_MODIFIED:$l,NO_CONTENT:jl,OK:ql,PARTIAL_CONTENT:Hl,PAYMENT_REQUIRED:Wl,PERMANENT_REDIRECT:Gl,PRECONDITION_FAILED:Vl,PRECONDITION_REQUIRED:Ql,PROCESSING:zl,PROXY_AUTHENTICATION_REQUIRED:Yl,REQUESTED_RANGE_NOT_SATISFIABLE:ef,REQUEST_HEADER_FIELDS_TOO_LARGE:Kl,REQUEST_TIMEOUT:Jl,REQUEST_TOO_LONG:Xl,REQUEST_URI_TOO_LONG:Zl,RESET_CONTENT:tf,get ReasonPhrases(){return ea},SEE_OTHER:rf,SERVICE_UNAVAILABLE:nf,SWITCHING_PROTOCOLS:of,get StatusCodes(){return Zo},TEMPORARY_REDIRECT:af,TOO_MANY_REQUESTS:sf,UNAUTHORIZED:cf,UNPROCESSABLE_ENTITY:uf,UNSUPPORTED_MEDIA_TYPE:lf,USE_PROXY:ff,default:Wy,getReasonPhrase:df,getStatusCode:pf,getStatusText:hf},Symbol.toStringTag,{value:"Module"})),Vy=qr(Gy);var On={exports:{}},yr={},bo={},vr={},_r={},xt={},Er={},So={},At={},lt={},Mc;function _a(){if(Mc)return lt;Mc=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.ERROR_PACKET=lt.PACKET_TYPES_REVERSE=lt.PACKET_TYPES=void 0;const e=Object.create(null);lt.PACKET_TYPES=e,e.open="0",e.close="1",e.ping="2",e.pong="3",e.message="4",e.upgrade="5",e.noop="6";const t=Object.create(null);lt.PACKET_TYPES_REVERSE=t,Object.keys(e).forEach(r=>{t[e[r]]=r});const n={type:"error",data:"parser error"};return lt.ERROR_PACKET=n,lt}var Dc;function Qy(){if(Dc)return At;Dc=1,Object.defineProperty(At,"__esModule",{value:!0}),At.encodePacket=At.encodePacketToBinary=void 0;const e=_a(),t=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",n=typeof ArrayBuffer=="function",r=c=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(c):c&&c.buffer instanceof ArrayBuffer,s=({type:c,data:a},d,f)=>t&&a instanceof Blob?d?f(a):o(a,f):n&&(a instanceof ArrayBuffer||r(a))?d?f(a):o(new Blob([a]),f):f(e.PACKET_TYPES[c]+(a||""));At.encodePacket=s;const o=(c,a)=>{const d=new FileReader;return d.onload=function(){const f=d.result.split(",")[1];a("b"+(f||""))},d.readAsDataURL(c)};function l(c){return c instanceof Uint8Array?c:c instanceof ArrayBuffer?new Uint8Array(c):new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}let i;function u(c,a){if(t&&c.data instanceof Blob)return c.data.arrayBuffer().then(l).then(a);if(n&&(c.data instanceof ArrayBuffer||r(c.data)))return a(l(c.data));s(c,!1,d=>{i||(i=new TextEncoder),a(i.encode(d))})}return At.encodePacketToBinary=u,At}var wr={},Rt={},Uc;function zy(){if(Uc)return Rt;Uc=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.decode=Rt.encode=void 0;const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<e.length;s++)t[e.charCodeAt(s)]=s;const n=s=>{let o=new Uint8Array(s),l,i=o.length,u="";for(l=0;l<i;l+=3)u+=e[o[l]>>2],u+=e[(o[l]&3)<<4|o[l+1]>>4],u+=e[(o[l+1]&15)<<2|o[l+2]>>6],u+=e[o[l+2]&63];return i%3===2?u=u.substring(0,u.length-1)+"=":i%3===1&&(u=u.substring(0,u.length-2)+"=="),u};Rt.encode=n;const r=s=>{let o=s.length*.75,l=s.length,i,u=0,c,a,d,f;s[s.length-1]==="="&&(o--,s[s.length-2]==="="&&o--);const p=new ArrayBuffer(o),h=new Uint8Array(p);for(i=0;i<l;i+=4)c=t[s.charCodeAt(i)],a=t[s.charCodeAt(i+1)],d=t[s.charCodeAt(i+2)],f=t[s.charCodeAt(i+3)],h[u++]=c<<2|a>>4,h[u++]=(a&15)<<4|d>>2,h[u++]=(d&3)<<6|f&63;return p};return Rt.decode=r,Rt}var Bc;function Yy(){if(Bc)return wr;Bc=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.decodePacket=void 0;const e=_a(),t=zy(),n=typeof ArrayBuffer=="function",r=(l,i)=>{if(typeof l!="string")return{type:"message",data:o(l,i)};const u=l.charAt(0);return u==="b"?{type:"message",data:s(l.substring(1),i)}:e.PACKET_TYPES_REVERSE[u]?l.length>1?{type:e.PACKET_TYPES_REVERSE[u],data:l.substring(1)}:{type:e.PACKET_TYPES_REVERSE[u]}:e.ERROR_PACKET};wr.decodePacket=r;const s=(l,i)=>{if(n){const u=(0,t.decode)(l);return o(u,i)}else return{base64:!0,data:l}},o=(l,i)=>{switch(i){case"blob":return l instanceof Blob?l:new Blob([l]);case"arraybuffer":default:return l instanceof ArrayBuffer?l:l.buffer}};return wr}var $c;function Wr(){return $c||($c=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=e.createPacketDecoderStream=e.createPacketEncoderStream=void 0;const t=Qy();Object.defineProperty(e,"encodePacket",{enumerable:!0,get:function(){return t.encodePacket}});const n=Yy();Object.defineProperty(e,"decodePacket",{enumerable:!0,get:function(){return n.decodePacket}});const r=_a(),s=String.fromCharCode(30),o=(f,p)=>{const h=f.length,y=new Array(h);let _=0;f.forEach((S,v)=>{(0,t.encodePacket)(S,!1,w=>{y[v]=w,++_===h&&p(y.join(s))})})};e.encodePayload=o;const l=(f,p)=>{const h=f.split(s),y=[];for(let _=0;_<h.length;_++){const S=(0,n.decodePacket)(h[_],p);if(y.push(S),S.type==="error")break}return y};e.decodePayload=l;function i(){return new TransformStream({transform(f,p){(0,t.encodePacketToBinary)(f,h=>{const y=h.length;let _;if(y<126)_=new Uint8Array(1),new DataView(_.buffer).setUint8(0,y);else if(y<65536){_=new Uint8Array(3);const S=new DataView(_.buffer);S.setUint8(0,126),S.setUint16(1,y)}else{_=new Uint8Array(9);const S=new DataView(_.buffer);S.setUint8(0,127),S.setBigUint64(1,BigInt(y))}f.data&&typeof f.data!="string"&&(_[0]|=128),p.enqueue(_),p.enqueue(h)})}})}e.createPacketEncoderStream=i;let u;function c(f){return f.reduce((p,h)=>p+h.length,0)}function a(f,p){if(f[0].length===p)return f.shift();const h=new Uint8Array(p);let y=0;for(let _=0;_<p;_++)h[_]=f[0][y++],y===f[0].length&&(f.shift(),y=0);return f.length&&y<f[0].length&&(f[0]=f[0].slice(y)),h}function d(f,p){u||(u=new TextDecoder);const h=[];let y=0,_=-1,S=!1;return new TransformStream({transform(v,w){for(h.push(v);;){if(y===0){if(c(h)<1)break;const x=a(h,1);S=(x[0]&128)===128,_=x[0]&127,_<126?y=3:_===126?y=1:y=2}else if(y===1){if(c(h)<2)break;const x=a(h,2);_=new DataView(x.buffer,x.byteOffset,x.length).getUint16(0),y=3}else if(y===2){if(c(h)<8)break;const x=a(h,8),O=new DataView(x.buffer,x.byteOffset,x.length),F=O.getUint32(0);if(F>Math.pow(2,53-32)-1){w.enqueue(r.ERROR_PACKET);break}_=F*Math.pow(2,32)+O.getUint32(4),y=3}else{if(c(h)<_)break;const x=a(h,_);w.enqueue((0,n.decodePacket)(S?x:u.decode(x),p)),y=0}if(_===0||_>f){w.enqueue(r.ERROR_PACKET);break}}}})}e.createPacketDecoderStream=d,e.protocol=4}(So)),So}function Qe(e){if(e)return Ky(e)}function Ky(e){for(var t in Qe.prototype)e[t]=Qe.prototype[t];return e}Qe.prototype.on=Qe.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Qe.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Qe.prototype.off=Qe.prototype.removeListener=Qe.prototype.removeAllListeners=Qe.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Qe.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Qe.prototype.emitReserved=Qe.prototype.emit;Qe.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Qe.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Jy=Object.freeze(Object.defineProperty({__proto__:null,Emitter:Qe},Symbol.toStringTag,{value:"Module"})),tr=qr(Jy);var ft={},br={},qc;function Vn(){return qc||(qc=1,Object.defineProperty(br,"__esModule",{value:!0}),br.globalThisShim=void 0,br.globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())()),br}var Hc;function Gr(){if(Hc)return ft;Hc=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.byteLength=ft.installTimerFunctions=ft.pick=void 0;const e=Vn();function t(u,...c){return c.reduce((a,d)=>(u.hasOwnProperty(d)&&(a[d]=u[d]),a),{})}ft.pick=t;const n=e.globalThisShim.setTimeout,r=e.globalThisShim.clearTimeout;function s(u,c){c.useNativeTimers?(u.setTimeoutFn=n.bind(e.globalThisShim),u.clearTimeoutFn=r.bind(e.globalThisShim)):(u.setTimeoutFn=e.globalThisShim.setTimeout.bind(e.globalThisShim),u.clearTimeoutFn=e.globalThisShim.clearTimeout.bind(e.globalThisShim))}ft.installTimerFunctions=s;const o=1.33;function l(u){return typeof u=="string"?i(u):Math.ceil((u.byteLength||u.size)*o)}ft.byteLength=l;function i(u){let c=0,a=0;for(let d=0,f=u.length;d<f;d++)c=u.charCodeAt(d),c<128?a+=1:c<2048?a+=2:c<55296||c>=57344?a+=3:(d++,a+=4);return a}return ft}var Tn={exports:{}},Oo,Wc;function Xy(){if(Wc)return Oo;Wc=1;var e=1e3,t=e*60,n=t*60,r=n*24,s=r*7,o=r*365.25;Oo=function(a,d){d=d||{};var f=typeof a;if(f==="string"&&a.length>0)return l(a);if(f==="number"&&isFinite(a))return d.long?u(a):i(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))};function l(a){if(a=String(a),!(a.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(d){var f=parseFloat(d[1]),p=(d[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*s;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function i(a){var d=Math.abs(a);return d>=r?Math.round(a/r)+"d":d>=n?Math.round(a/n)+"h":d>=t?Math.round(a/t)+"m":d>=e?Math.round(a/e)+"s":a+"ms"}function u(a){var d=Math.abs(a);return d>=r?c(a,d,r,"day"):d>=n?c(a,d,n,"hour"):d>=t?c(a,d,t,"minute"):d>=e?c(a,d,e,"second"):a+" ms"}function c(a,d,f,p){var h=d>=f*1.5;return Math.round(a/f)+" "+p+(h?"s":"")}return Oo}var To,Gc;function Zy(){if(Gc)return To;Gc=1;function e(t){r.debug=r,r.default=r,r.coerce=c,r.disable=l,r.enable=o,r.enabled=i,r.humanize=Xy(),r.destroy=a,Object.keys(t).forEach(d=>{r[d]=t[d]}),r.names=[],r.skips=[],r.formatters={};function n(d){let f=0;for(let p=0;p<d.length;p++)f=(f<<5)-f+d.charCodeAt(p),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=n;function r(d){let f,p=null,h,y;function _(...S){if(!_.enabled)return;const v=_,w=Number(new Date),x=w-(f||w);v.diff=x,v.prev=f,v.curr=w,f=w,S[0]=r.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let O=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(D,R)=>{if(D==="%%")return"%";O++;const W=r.formatters[R];if(typeof W=="function"){const V=S[O];D=W.call(v,V),S.splice(O,1),O--}return D}),r.formatArgs.call(v,S),(v.log||r.log).apply(v,S)}return _.namespace=d,_.useColors=r.useColors(),_.color=r.selectColor(d),_.extend=s,_.destroy=r.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(h!==r.namespaces&&(h=r.namespaces,y=r.enabled(d)),y),set:S=>{p=S}}),typeof r.init=="function"&&r.init(_),_}function s(d,f){const p=r(this.namespace+(typeof f>"u"?":":f)+d);return p.log=this.log,p}function o(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let f;const p=(typeof d=="string"?d:"").split(/[\s,]+/),h=p.length;for(f=0;f<h;f++)p[f]&&(d=p[f].replace(/\*/g,".*?"),d[0]==="-"?r.skips.push(new RegExp("^"+d.slice(1)+"$")):r.names.push(new RegExp("^"+d+"$")))}function l(){const d=[...r.names.map(u),...r.skips.map(u).map(f=>"-"+f)].join(",");return r.enable(""),d}function i(d){if(d[d.length-1]==="*")return!0;let f,p;for(f=0,p=r.skips.length;f<p;f++)if(r.skips[f].test(d))return!1;for(f=0,p=r.names.length;f<p;f++)if(r.names[f].test(d))return!0;return!1}function u(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function c(d){return d instanceof Error?d.stack||d.message:d}function a(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}return To=e,To}var Vc;function ut(){return Vc||(Vc=1,function(e,t){t.formatArgs=r,t.save=s,t.load=o,t.useColors=n,t.storage=l(),t.destroy=(()=>{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;u.splice(1,0,c,"color: inherit");let a=0,d=0;u[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(a++,f==="%c"&&(d=a))}),u.splice(d,0,c)}t.log=console.debug||console.log||(()=>{});function s(u){try{u?t.storage.setItem("debug",u):t.storage.removeItem("debug")}catch{}}function o(){let u;try{u=t.storage.getItem("debug")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=process.env.DEBUG),u}function l(){try{return localStorage}catch{}}e.exports=Zy()(t);const{formatters:i}=e.exports;i.j=function(u){try{return JSON.stringify(u)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}}(Tn,Tn.exports)),Tn.exports}var Ct={},Qc;function mf(){if(Qc)return Ct;Qc=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.decode=Ct.encode=void 0;function e(n){let r="";for(let s in n)n.hasOwnProperty(s)&&(r.length&&(r+="&"),r+=encodeURIComponent(s)+"="+encodeURIComponent(n[s]));return r}Ct.encode=e;function t(n){let r={},s=n.split("&");for(let o=0,l=s.length;o<l;o++){let i=s[o].split("=");r[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return r}return Ct.decode=t,Ct}var zc;function Qn(){if(zc)return Er;zc=1;var e=ce&&ce.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(Er,"__esModule",{value:!0}),Er.Transport=void 0;const t=Wr(),n=tr,r=Gr(),s=e(ut()),o=mf(),l=(0,s.default)("engine.io-client:transport");class i extends Error{constructor(a,d,f){super(a),this.description=d,this.context=f,this.type="TransportError"}}class u extends n.Emitter{constructor(a){super(),this.writable=!1,(0,r.installTimerFunctions)(this,a),this.opts=a,this.query=a.query,this.socket=a.socket}onError(a,d,f){return super.emitReserved("error",new i(a,d,f)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(a){this.readyState==="open"?this.write(a):l("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(a){const d=(0,t.decodePacket)(a,this.socket.binaryType);this.onPacket(d)}onPacket(a){super.emitReserved("packet",a)}onClose(a){this.readyState="closed",super.emitReserved("close",a)}pause(a){}createUri(a,d={}){return a+"://"+this._hostname()+this._port()+this.opts.path+this._query(d)}_hostname(){const a=this.opts.hostname;return a.indexOf(":")===-1?a:"["+a+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(a){const d=(0,o.encode)(a);return d.length?"?"+d:""}}return Er.Transport=u,Er}var dt={},Yc;function gf(){if(Yc)return dt;Yc=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.yeast=dt.decode=dt.encode=void 0;const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),t=64,n={};let r=0,s=0,o;function l(c){let a="";do a=e[c%t]+a,c=Math.floor(c/t);while(c>0);return a}dt.encode=l;function i(c){let a=0;for(s=0;s<c.length;s++)a=a*t+n[c.charAt(s)];return a}dt.decode=i;function u(){const c=l(+new Date);return c!==o?(r=0,o=c):c+"."+l(r++)}for(dt.yeast=u;s<t;s++)n[e[s]]=s;return dt}var Nt={},Sr={},Kc;function ev(){if(Kc)return Sr;Kc=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.hasCORS=void 0;let e=!1;try{e=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}return Sr.hasCORS=e,Sr}var Jc;function tv(){if(Jc)return Nt;Jc=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.createCookieJar=Nt.XHR=void 0;const e=ev(),t=Vn();function n(s){const o=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!o||e.hasCORS))return new XMLHttpRequest}catch{}if(!o)try{return new t.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}Nt.XHR=n;function r(){}return Nt.createCookieJar=r,Nt}var Xc;function rv(){if(Xc)return xt;Xc=1;var e=ce&&ce.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(xt,"__esModule",{value:!0}),xt.Request=xt.Polling=void 0;const t=Qn(),n=e(ut()),r=gf(),s=Wr(),o=tv(),l=tr,i=Gr(),u=Vn(),c=(0,n.default)("engine.io-client:polling");function a(){}const d=function(){return new o.XHR({xdomain:!1}).responseType!=null}();class f extends t.Transport{constructor(_){if(super(_),this.polling=!1,typeof location<"u"){const v=location.protocol==="https:";let w=location.port;w||(w=v?"443":"80"),this.xd=typeof location<"u"&&_.hostname!==location.hostname||w!==_.port}const S=_&&_.forceBase64;this.supportsBinary=d&&!S,this.opts.withCredentials&&(this.cookieJar=(0,o.createCookieJar)())}get name(){return"polling"}doOpen(){this.poll()}pause(_){this.readyState="pausing";const S=()=>{c("paused"),this.readyState="paused",_()};if(this.polling||!this.writable){let v=0;this.polling&&(c("we are currently polling - waiting to pause"),v++,this.once("pollComplete",function(){c("pre-pause polling complete"),--v||S()})),this.writable||(c("we are currently writing - waiting to pause"),v++,this.once("drain",function(){c("pre-pause writing complete"),--v||S()}))}else S()}poll(){c("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(_){c("polling got data %s",_);const S=v=>{if(this.readyState==="opening"&&v.type==="open"&&this.onOpen(),v.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(v)};(0,s.decodePayload)(_,this.socket.binaryType).forEach(S),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this.poll():c('ignoring poll - transport state "%s"',this.readyState))}doClose(){const _=()=>{c("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(c("transport open - closing"),_()):(c("transport not open - deferring close"),this.once("open",_))}write(_){this.writable=!1,(0,s.encodePayload)(_,S=>{this.doWrite(S,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const _=this.opts.secure?"https":"http",S=this.query||{};return this.opts.timestampRequests!==!1&&(S[this.opts.timestampParam]=(0,r.yeast)()),!this.supportsBinary&&!S.sid&&(S.b64=1),this.createUri(_,S)}request(_={}){return Object.assign(_,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new p(this.uri(),_)}doWrite(_,S){const v=this.request({method:"POST",data:_});v.on("success",S),v.on("error",(w,x)=>{this.onError("xhr post error",w,x)})}doPoll(){c("xhr poll");const _=this.request();_.on("data",this.onData.bind(this)),_.on("error",(S,v)=>{this.onError("xhr poll error",S,v)}),this.pollXhr=_}}xt.Polling=f;class p extends l.Emitter{constructor(_,S){super(),(0,i.installTimerFunctions)(this,S),this.opts=S,this.method=S.method||"GET",this.uri=_,this.data=S.data!==void 0?S.data:null,this.create()}create(){var _;const S=(0,i.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");S.xdomain=!!this.opts.xd;const v=this.xhr=new o.XHR(S);try{c("xhr open %s: %s",this.method,this.uri),v.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){v.setDisableHeaderCheck&&v.setDisableHeaderCheck(!0);for(let w in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(w)&&v.setRequestHeader(w,this.opts.extraHeaders[w])}}catch{}if(this.method==="POST")try{v.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{v.setRequestHeader("Accept","*/*")}catch{}(_=this.opts.cookieJar)===null||_===void 0||_.addCookies(v),"withCredentials"in v&&(v.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(v.timeout=this.opts.requestTimeout),v.onreadystatechange=()=>{var w;v.readyState===3&&((w=this.opts.cookieJar)===null||w===void 0||w.parseCookies(v)),v.readyState===4&&(v.status===200||v.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof v.status=="number"?v.status:0)},0))},c("xhr data %s",this.data),v.send(this.data)}catch(w){this.setTimeoutFn(()=>{this.onError(w)},0);return}typeof document<"u"&&(this.index=p.requestsCount++,p.requests[this.index]=this)}onError(_){this.emitReserved("error",_,this.xhr),this.cleanup(!0)}cleanup(_){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=a,_)try{this.xhr.abort()}catch{}typeof document<"u"&&delete p.requests[this.index],this.xhr=null}}onLoad(){const _=this.xhr.responseText;_!==null&&(this.emitReserved("data",_),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(xt.Request=p,p.requestsCount=0,p.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",h);else if(typeof addEventListener=="function"){const y="onpagehide"in u.globalThisShim?"pagehide":"unload";addEventListener(y,h,!1)}}function h(){for(let y in p.requests)p.requests.hasOwnProperty(y)&&p.requests[y].abort()}return xt}var Or={},et={},Zc;function zn(){if(Zc)return et;Zc=1,Object.defineProperty(et,"__esModule",{value:!0}),et.defaultBinaryType=et.usingBrowserWebSocket=et.WebSocket=et.nextTick=void 0;const e=Vn();return et.nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,r)=>r(n,0))(),et.WebSocket=e.globalThisShim.WebSocket||e.globalThisShim.MozWebSocket,et.usingBrowserWebSocket=!0,et.defaultBinaryType="arraybuffer",et}var eu;function nv(){if(eu)return Or;eu=1;var e=ce&&ce.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Or,"__esModule",{value:!0}),Or.WS=void 0;const t=Qn(),n=gf(),r=Gr(),s=zn(),o=e(ut()),l=Wr(),i=(0,o.default)("engine.io-client:websocket"),u=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class c extends t.Transport{constructor(d){super(d),this.supportsBinary=!d.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const d=this.uri(),f=this.opts.protocols,p=u?{}:(0,r.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(p.headers=this.opts.extraHeaders);try{this.ws=s.usingBrowserWebSocket&&!u?f?new s.WebSocket(d,f):new s.WebSocket(d):new s.WebSocket(d,f,p)}catch(h){return this.emitReserved("error",h)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=d=>this.onClose({description:"websocket connection closed",context:d}),this.ws.onmessage=d=>this.onData(d.data),this.ws.onerror=d=>this.onError("websocket error",d)}write(d){this.writable=!1;for(let f=0;f<d.length;f++){const p=d[f],h=f===d.length-1;(0,l.encodePacket)(p,this.supportsBinary,y=>{const _={};s.usingBrowserWebSocket||(p.options&&(_.compress=p.options.compress),this.opts.perMessageDeflate&&(typeof y=="string"?Buffer.byteLength(y):y.length)<this.opts.perMessageDeflate.threshold&&(_.compress=!1));try{s.usingBrowserWebSocket?this.ws.send(y):this.ws.send(y,_)}catch{i("websocket closed before onclose event")}h&&(0,s.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const d=this.opts.secure?"wss":"ws",f=this.query||{};return this.opts.timestampRequests&&(f[this.opts.timestampParam]=(0,n.yeast)()),this.supportsBinary||(f.b64=1),this.createUri(d,f)}check(){return!!s.WebSocket}}return Or.WS=c,Or}var Tr={},tu;function iv(){if(tu)return Tr;tu=1;var e=ce&&ce.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.WT=void 0;const t=Qn(),n=zn(),r=Wr(),o=(0,e(ut()).default)("engine.io-client:webtransport");class l extends t.Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{o("transport closed gracefully"),this.onClose()}).catch(u=>{o("transport closed due to %s",u),this.onError("webtransport error",u)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(u=>{const c=(0,r.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=u.readable.pipeThrough(c).getReader(),d=(0,r.createPacketEncoderStream)();d.readable.pipeTo(u.writable),this.writer=d.writable.getWriter();const f=()=>{a.read().then(({done:h,value:y})=>{if(h){o("session is closed");return}o("received chunk: %o",y),this.onPacket(y),f()}).catch(h=>{o("an error occurred while reading: %s",h)})};f();const p={type:"open"};this.query.sid&&(p.data=`{"sid":"${this.query.sid}"}`),this.writer.write(p).then(()=>this.onOpen())})}))}write(u){this.writable=!1;for(let c=0;c<u.length;c++){const a=u[c],d=c===u.length-1;this.writer.write(a).then(()=>{d&&(0,n.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var u;(u=this.transport)===null||u===void 0||u.close()}}return Tr.WT=l,Tr}var ru;function yf(){if(ru)return _r;ru=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.transports=void 0;const e=rv(),t=nv(),n=iv();return _r.transports={websocket:t.WS,webtransport:n.WT,polling:e.Polling},_r}var xr={},nu;function vf(){if(nu)return xr;nu=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.parse=void 0;const e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,t=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function n(o){const l=o,i=o.indexOf("["),u=o.indexOf("]");i!=-1&&u!=-1&&(o=o.substring(0,i)+o.substring(i,u).replace(/:/g,";")+o.substring(u,o.length));let c=e.exec(o||""),a={},d=14;for(;d--;)a[t[d]]=c[d]||"";return i!=-1&&u!=-1&&(a.source=l,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=r(a,a.path),a.queryKey=s(a,a.query),a}xr.parse=n;function r(o,l){const i=/\/{2,9}/g,u=l.replace(i,"/").split("/");return(l.slice(0,1)=="/"||l.length===0)&&u.splice(0,1),l.slice(-1)=="/"&&u.splice(u.length-1,1),u}function s(o,l){const i={};return l.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(u,c,a){c&&(i[c]=a)}),i}return xr}var iu;function ov(){if(iu)return vr;iu=1;var e=ce&&ce.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(vr,"__esModule",{value:!0}),vr.Socket=void 0;const t=yf(),n=Gr(),r=mf(),s=vf(),o=e(ut()),l=tr,i=Wr(),u=zn(),c=(0,o.default)("engine.io-client:socket");class a extends l.Emitter{constructor(f,p={}){super(),this.binaryType=u.defaultBinaryType,this.writeBuffer=[],f&&typeof f=="object"&&(p=f,f=null),f?(f=(0,s.parse)(f),p.hostname=f.host,p.secure=f.protocol==="https"||f.protocol==="wss",p.port=f.port,f.query&&(p.query=f.query)):p.host&&(p.hostname=(0,s.parse)(p.host).host),(0,n.installTimerFunctions)(this,p),this.secure=p.secure!=null?p.secure:typeof location<"u"&&location.protocol==="https:",p.hostname&&!p.port&&(p.port=this.secure?"443":"80"),this.hostname=p.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=p.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=p.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},p),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,r.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(f){c('creating transport "%s"',f);const p=Object.assign({},this.opts.query);p.EIO=i.protocol,p.transport=f,this.id&&(p.sid=this.id);const h=Object.assign({},this.opts,{query:p,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[f]);return c("options: %j",h),new t.transports[f](h)}open(){let f;if(this.opts.rememberUpgrade&&a.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)f="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else f=this.transports[0];this.readyState="opening";try{f=this.createTransport(f)}catch(p){c("error while creating transport: %s",p),this.transports.shift(),this.open();return}f.open(),this.setTransport(f)}setTransport(f){c("setting transport %s",f.name),this.transport&&(c("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=f,f.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",p=>this.onClose("transport close",p))}probe(f){c('probing transport "%s"',f);let p=this.createTransport(f),h=!1;a.priorWebsocketSuccess=!1;const y=()=>{h||(c('probe transport "%s" opened',f),p.send([{type:"ping",data:"probe"}]),p.once("packet",F=>{if(!h)if(F.type==="pong"&&F.data==="probe"){if(c('probe transport "%s" pong',f),this.upgrading=!0,this.emitReserved("upgrading",p),!p)return;a.priorWebsocketSuccess=p.name==="websocket",c('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{h||this.readyState!=="closed"&&(c("changing transport and sending upgrade packet"),O(),this.setTransport(p),p.send([{type:"upgrade"}]),this.emitReserved("upgrade",p),p=null,this.upgrading=!1,this.flush())})}else{c('probe transport "%s" failed',f);const D=new Error("probe error");D.transport=p.name,this.emitReserved("upgradeError",D)}}))};function _(){h||(h=!0,O(),p.close(),p=null)}const S=F=>{const D=new Error("probe error: "+F);D.transport=p.name,_(),c('probe transport "%s" failed because of error: %s',f,F),this.emitReserved("upgradeError",D)};function v(){S("transport closed")}function w(){S("socket closed")}function x(F){p&&F.name!==p.name&&(c('"%s" works - aborting "%s"',F.name,p.name),_())}const O=()=>{p.removeListener("open",y),p.removeListener("error",S),p.removeListener("close",v),this.off("close",w),this.off("upgrading",x)};p.once("open",y),p.once("error",S),p.once("close",v),this.once("close",w),this.once("upgrading",x),this.upgrades.indexOf("webtransport")!==-1&&f!=="webtransport"?this.setTimeoutFn(()=>{h||p.open()},200):p.open()}onOpen(){if(c("socket open"),this.readyState="open",a.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){c("starting upgrade probes");let f=0;const p=this.upgrades.length;for(;f<p;f++)this.probe(this.upgrades[f])}}onPacket(f){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(c('socket receive: type "%s", data "%s"',f.type,f.data),this.emitReserved("packet",f),this.emitReserved("heartbeat"),this.resetPingTimeout(),f.type){case"open":this.onHandshake(JSON.parse(f.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const p=new Error("server error");p.code=f.data,this.onError(p);break;case"message":this.emitReserved("data",f.data),this.emitReserved("message",f.data);break}else c('packet received with socket readyState "%s"',this.readyState)}onHandshake(f){this.emitReserved("handshake",f),this.id=f.sid,this.transport.query.sid=f.sid,this.upgrades=this.filterUpgrades(f.upgrades),this.pingInterval=f.pingInterval,this.pingTimeout=f.pingTimeout,this.maxPayload=f.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const f=this.getWritablePackets();c("flushing %d packets in socket",f.length),this.transport.send(f),this.prevBufferLen=f.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let p=1;for(let h=0;h<this.writeBuffer.length;h++){const y=this.writeBuffer[h].data;if(y&&(p+=(0,n.byteLength)(y)),h>0&&p>this.maxPayload)return c("only send %d out of %d packets",h,this.writeBuffer.length),this.writeBuffer.slice(0,h);p+=2}return c("payload size is %d (max: %d)",p,this.maxPayload),this.writeBuffer}write(f,p,h){return this.sendPacket("message",f,p,h),this}send(f,p,h){return this.sendPacket("message",f,p,h),this}sendPacket(f,p,h,y){if(typeof p=="function"&&(y=p,p=void 0),typeof h=="function"&&(y=h,h=null),this.readyState==="closing"||this.readyState==="closed")return;h=h||{},h.compress=h.compress!==!1;const _={type:f,data:p,options:h};this.emitReserved("packetCreate",_),this.writeBuffer.push(_),y&&this.once("flush",y),this.flush()}close(){const f=()=>{this.onClose("forced close"),c("socket closing - telling transport to close"),this.transport.close()},p=()=>{this.off("upgrade",p),this.off("upgradeError",p),f()},h=()=>{this.once("upgrade",p),this.once("upgradeError",p)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?h():f()}):this.upgrading?h():f()),this}onError(f){c("socket error %j",f),a.priorWebsocketSuccess=!1,this.emitReserved("error",f),this.onClose("transport error",f)}onClose(f,p){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(c('socket close with reason: "%s"',f),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",f,p),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(f){const p=[];let h=0;const y=f.length;for(;h<y;h++)~this.transports.indexOf(f[h])&&p.push(f[h]);return p}}return vr.Socket=a,a.protocol=i.protocol,vr}var ou;function _f(){return ou||(ou=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.nextTick=e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const t=ov();Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return t.Socket}}),e.protocol=t.Socket.protocol;var n=Qn();Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return n.Transport}});var r=yf();Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return r.transports}});var s=Gr();Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return s.installTimerFunctions}});var o=vf();Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return o.parse}});var l=zn();Object.defineProperty(e,"nextTick",{enumerable:!0,get:function(){return l.nextTick}})}(bo)),bo}var au;function av(){if(au)return yr;au=1;var e=ce&&ce.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(yr,"__esModule",{value:!0}),yr.url=void 0;const t=_f(),r=e(ut()).default("socket.io-client:url");function s(o,l="",i){let u=o;i=i||typeof location<"u"&&location,o==null&&(o=i.protocol+"//"+i.host),typeof o=="string"&&(o.charAt(0)==="/"&&(o.charAt(1)==="/"?o=i.protocol+o:o=i.host+o),/^(https?|wss?):\/\//.test(o)||(r("protocol-less url %s",o),typeof i<"u"?o=i.protocol+"//"+o:o="https://"+o),r("parse %s",o),u=t.parse(o)),u.port||(/^(http|ws)$/.test(u.protocol)?u.port="80":/^(http|ws)s$/.test(u.protocol)&&(u.port="443")),u.path=u.path||"/";const a=u.host.indexOf(":")!==-1?"["+u.host+"]":u.host;return u.id=u.protocol+"://"+a+":"+u.port+l,u.href=u.protocol+"://"+a+(i&&i.port===u.port?"":":"+u.port),u}return yr.url=s,yr}var Ar={},Rr={},xo={},Pt={},It={},su;function Ef(){if(su)return It;su=1,Object.defineProperty(It,"__esModule",{value:!0}),It.hasBinary=It.isBinary=void 0;const e=typeof ArrayBuffer=="function",t=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,n=Object.prototype.toString,r=typeof Blob=="function"||typeof Blob<"u"&&n.call(Blob)==="[object BlobConstructor]",s=typeof File=="function"||typeof File<"u"&&n.call(File)==="[object FileConstructor]";function o(i){return e&&(i instanceof ArrayBuffer||t(i))||r&&i instanceof Blob||s&&i instanceof File}It.isBinary=o;function l(i,u){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let c=0,a=i.length;c<a;c++)if(l(i[c]))return!0;return!1}if(o(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return l(i.toJSON(),!0);for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c)&&l(i[c]))return!0;return!1}return It.hasBinary=l,It}var cu;function sv(){if(cu)return Pt;cu=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.reconstructPacket=Pt.deconstructPacket=void 0;const e=Ef();function t(o){const l=[],i=o.data,u=o;return u.data=n(i,l),u.attachments=l.length,{packet:u,buffers:l}}Pt.deconstructPacket=t;function n(o,l){if(!o)return o;if((0,e.isBinary)(o)){const i={_placeholder:!0,num:l.length};return l.push(o),i}else if(Array.isArray(o)){const i=new Array(o.length);for(let u=0;u<o.length;u++)i[u]=n(o[u],l);return i}else if(typeof o=="object"&&!(o instanceof Date)){const i={};for(const u in o)Object.prototype.hasOwnProperty.call(o,u)&&(i[u]=n(o[u],l));return i}return o}function r(o,l){return o.data=s(o.data,l),delete o.attachments,o}Pt.reconstructPacket=r;function s(o,l){if(!o)return o;if(o&&o._placeholder===!0){if(typeof o.num=="number"&&o.num>=0&&o.num<l.length)return l[o.num];throw new Error("illegal attachments")}else if(Array.isArray(o))for(let i=0;i<o.length;i++)o[i]=s(o[i],l);else if(typeof o=="object")for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=s(o[i],l));return o}return Pt}var uu;function Ea(){return uu||(uu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const t=tr,n=sv(),r=Ef(),o=(0,ut().default)("socket.io-parser"),l=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];e.protocol=5;var i;(function(f){f[f.CONNECT=0]="CONNECT",f[f.DISCONNECT=1]="DISCONNECT",f[f.EVENT=2]="EVENT",f[f.ACK=3]="ACK",f[f.CONNECT_ERROR=4]="CONNECT_ERROR",f[f.BINARY_EVENT=5]="BINARY_EVENT",f[f.BINARY_ACK=6]="BINARY_ACK"})(i=e.PacketType||(e.PacketType={}));class u{constructor(p){this.replacer=p}encode(p){return o("encoding packet %j",p),(p.type===i.EVENT||p.type===i.ACK)&&(0,r.hasBinary)(p)?this.encodeAsBinary({type:p.type===i.EVENT?i.BINARY_EVENT:i.BINARY_ACK,nsp:p.nsp,data:p.data,id:p.id}):[this.encodeAsString(p)]}encodeAsString(p){let h=""+p.type;return(p.type===i.BINARY_EVENT||p.type===i.BINARY_ACK)&&(h+=p.attachments+"-"),p.nsp&&p.nsp!=="/"&&(h+=p.nsp+","),p.id!=null&&(h+=p.id),p.data!=null&&(h+=JSON.stringify(p.data,this.replacer)),o("encoded %j as %s",p,h),h}encodeAsBinary(p){const h=(0,n.deconstructPacket)(p),y=this.encodeAsString(h.packet),_=h.buffers;return _.unshift(y),_}}e.Encoder=u;function c(f){return Object.prototype.toString.call(f)==="[object Object]"}class a extends t.Emitter{constructor(p){super(),this.reviver=p}add(p){let h;if(typeof p=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");h=this.decodeString(p);const y=h.type===i.BINARY_EVENT;y||h.type===i.BINARY_ACK?(h.type=y?i.EVENT:i.ACK,this.reconstructor=new d(h),h.attachments===0&&super.emitReserved("decoded",h)):super.emitReserved("decoded",h)}else if((0,r.isBinary)(p)||p.base64)if(this.reconstructor)h=this.reconstructor.takeBinaryData(p),h&&(this.reconstructor=null,super.emitReserved("decoded",h));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+p)}decodeString(p){let h=0;const y={type:Number(p.charAt(0))};if(i[y.type]===void 0)throw new Error("unknown packet type "+y.type);if(y.type===i.BINARY_EVENT||y.type===i.BINARY_ACK){const S=h+1;for(;p.charAt(++h)!=="-"&&h!=p.length;);const v=p.substring(S,h);if(v!=Number(v)||p.charAt(h)!=="-")throw new Error("Illegal attachments");y.attachments=Number(v)}if(p.charAt(h+1)==="/"){const S=h+1;for(;++h&&!(p.charAt(h)===","||h===p.length););y.nsp=p.substring(S,h)}else y.nsp="/";const _=p.charAt(h+1);if(_!==""&&Number(_)==_){const S=h+1;for(;++h;){const v=p.charAt(h);if(v==null||Number(v)!=v){--h;break}if(h===p.length)break}y.id=Number(p.substring(S,h+1))}if(p.charAt(++h)){const S=this.tryParse(p.substr(h));if(a.isPayloadValid(y.type,S))y.data=S;else throw new Error("invalid payload")}return o("decoded %s as %j",p,y),y}tryParse(p){try{return JSON.parse(p,this.reviver)}catch{return!1}}static isPayloadValid(p,h){switch(p){case i.CONNECT:return c(h);case i.DISCONNECT:return h===void 0;case i.CONNECT_ERROR:return typeof h=="string"||c(h);case i.EVENT:case i.BINARY_EVENT:return Array.isArray(h)&&(typeof h[0]=="number"||typeof h[0]=="string"&&l.indexOf(h[0])===-1);case i.ACK:case i.BINARY_ACK:return Array.isArray(h)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=a;class d{constructor(p){this.packet=p,this.buffers=[],this.reconPack=p}takeBinaryData(p){if(this.buffers.push(p),this.buffers.length===this.reconPack.attachments){const h=(0,n.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),h}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}}(xo)),xo}var Cr={},lu;function wf(){if(lu)return Cr;lu=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.on=void 0;function e(t,n,r){return t.on(n,r),function(){t.off(n,r)}}return Cr.on=e,Cr}var fu;function bf(){if(fu)return Rr;fu=1;var e=ce&&ce.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.Socket=void 0;const t=Ea(),n=wf(),r=tr,o=e(ut()).default("socket.io-client:socket"),l=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class i extends r.Emitter{constructor(c,a,d){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=c,this.nsp=a,d&&d.auth&&(this.auth=d.auth),this._opts=Object.assign({},d),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const c=this.io;this.subs=[n.on(c,"open",this.onopen.bind(this)),n.on(c,"packet",this.onpacket.bind(this)),n.on(c,"error",this.onerror.bind(this)),n.on(c,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...c){return c.unshift("message"),this.emit.apply(this,c),this}emit(c,...a){if(l.hasOwnProperty(c))throw new Error('"'+c.toString()+'" is a reserved event name');if(a.unshift(c),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(a),this;const d={type:t.PacketType.EVENT,data:a};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof a[a.length-1]=="function"){const h=this.ids++;o("emitting packet with ack id %d",h);const y=a.pop();this._registerAckCallback(h,y),d.id=h}const f=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!f||!this.connected)?o("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d),this.flags={},this}_registerAckCallback(c,a){var d;const f=(d=this.flags.timeout)!==null&&d!==void 0?d:this._opts.ackTimeout;if(f===void 0){this.acks[c]=a;return}const p=this.io.setTimeoutFn(()=>{delete this.acks[c];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===c&&(o("removing packet with ack id %d from the buffer",c),this.sendBuffer.splice(h,1));o("event with ack id %d has timed out after %d ms",c,f),a.call(this,new Error("operation has timed out"))},f);this.acks[c]=(...h)=>{this.io.clearTimeoutFn(p),a.apply(this,[null,...h])}}emitWithAck(c,...a){const d=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((f,p)=>{a.push((h,y)=>d?h?p(h):f(y):f(h)),this.emit(c,...a)})}_addToQueue(c){let a;typeof c[c.length-1]=="function"&&(a=c.pop());const d={id:this._queueSeq++,tryCount:0,pending:!1,args:c,flags:Object.assign({fromQueue:!0},this.flags)};c.push((f,...p)=>d!==this._queue[0]?void 0:(f!==null?d.tryCount>this._opts.retries&&(o("packet [%d] is discarded after %d tries",d.id,d.tryCount),this._queue.shift(),a&&a(f)):(o("packet [%d] was successfully sent",d.id),this._queue.shift(),a&&a(null,...p)),d.pending=!1,this._drainQueue())),this._queue.push(d),this._drainQueue()}_drainQueue(c=!1){if(o("draining queue"),!this.connected||this._queue.length===0)return;const a=this._queue[0];if(a.pending&&!c){o("packet [%d] has already been sent and is waiting for an ack",a.id);return}a.pending=!0,a.tryCount++,o("sending packet [%d] (try n°%d)",a.id,a.tryCount),this.flags=a.flags,this.emit.apply(this,a.args)}packet(c){c.nsp=this.nsp,this.io._packet(c)}onopen(){o("transport is open - connecting"),typeof this.auth=="function"?this.auth(c=>{this._sendConnectPacket(c)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(c){this.packet({type:t.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},c):c})}onerror(c){this.connected||this.emitReserved("connect_error",c)}onclose(c,a){o("close (%s)",c),this.connected=!1,delete this.id,this.emitReserved("disconnect",c,a)}onpacket(c){if(c.nsp===this.nsp)switch(c.type){case t.PacketType.CONNECT:c.data&&c.data.sid?this.onconnect(c.data.sid,c.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case t.PacketType.EVENT:case t.PacketType.BINARY_EVENT:this.onevent(c);break;case t.PacketType.ACK:case t.PacketType.BINARY_ACK:this.onack(c);break;case t.PacketType.DISCONNECT:this.ondisconnect();break;case t.PacketType.CONNECT_ERROR:this.destroy();const d=new Error(c.data.message);d.data=c.data.data,this.emitReserved("connect_error",d);break}}onevent(c){const a=c.data||[];o("emitting event %j",a),c.id!=null&&(o("attaching ack callback to event"),a.push(this.ack(c.id))),this.connected?this.emitEvent(a):this.receiveBuffer.push(Object.freeze(a))}emitEvent(c){if(this._anyListeners&&this._anyListeners.length){const a=this._anyListeners.slice();for(const d of a)d.apply(this,c)}super.emit.apply(this,c),this._pid&&c.length&&typeof c[c.length-1]=="string"&&(this._lastOffset=c[c.length-1])}ack(c){const a=this;let d=!1;return function(...f){d||(d=!0,o("sending ack %j",f),a.packet({type:t.PacketType.ACK,id:c,data:f}))}}onack(c){const a=this.acks[c.id];typeof a=="function"?(o("calling ack %s with %j",c.id,c.data),a.apply(this,c.data),delete this.acks[c.id]):o("bad ack %s",c.id)}onconnect(c,a){o("socket connected with id %s",c),this.id=c,this.recovered=a&&this._pid===a,this._pid=a,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(c=>this.emitEvent(c)),this.receiveBuffer=[],this.sendBuffer.forEach(c=>{this.notifyOutgoingListeners(c),this.packet(c)}),this.sendBuffer=[]}ondisconnect(){o("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(c=>c()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(o("performing disconnect (%s)",this.nsp),this.packet({type:t.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(c){return this.flags.compress=c,this}get volatile(){return this.flags.volatile=!0,this}timeout(c){return this.flags.timeout=c,this}onAny(c){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(c),this}prependAny(c){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(c),this}offAny(c){if(!this._anyListeners)return this;if(c){const a=this._anyListeners;for(let d=0;d<a.length;d++)if(c===a[d])return a.splice(d,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(c){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(c),this}prependAnyOutgoing(c){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(c),this}offAnyOutgoing(c){if(!this._anyOutgoingListeners)return this;if(c){const a=this._anyOutgoingListeners;for(let d=0;d<a.length;d++)if(c===a[d])return a.splice(d,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(c){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const a=this._anyOutgoingListeners.slice();for(const d of a)d.apply(this,c.data)}}}return Rr.Socket=i,Rr}var Nr={},du;function cv(){if(du)return Nr;du=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.Backoff=void 0;function e(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}return Nr.Backoff=e,e.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),r=Math.floor(n*this.jitter*t);t=Math.floor(n*10)&1?t+r:t-r}return Math.min(t,this.max)|0},e.prototype.reset=function(){this.attempts=0},e.prototype.setMin=function(t){this.ms=t},e.prototype.setMax=function(t){this.max=t},e.prototype.setJitter=function(t){this.jitter=t},Nr}var pu;function uv(){if(pu)return Ar;pu=1;var e=ce&&ce.__createBinding||(Object.create?function(p,h,y,_){_===void 0&&(_=y),Object.defineProperty(p,_,{enumerable:!0,get:function(){return h[y]}})}:function(p,h,y,_){_===void 0&&(_=y),p[_]=h[y]}),t=ce&&ce.__setModuleDefault||(Object.create?function(p,h){Object.defineProperty(p,"default",{enumerable:!0,value:h})}:function(p,h){p.default=h}),n=ce&&ce.__importStar||function(p){if(p&&p.__esModule)return p;var h={};if(p!=null)for(var y in p)y!=="default"&&Object.prototype.hasOwnProperty.call(p,y)&&e(h,p,y);return t(h,p),h},r=ce&&ce.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.Manager=void 0;const s=_f(),o=bf(),l=n(Ea()),i=wf(),u=cv(),c=tr,d=r(ut()).default("socket.io-client:manager");class f extends c.Emitter{constructor(h,y){var _;super(),this.nsps={},this.subs=[],h&&typeof h=="object"&&(y=h,h=void 0),y=y||{},y.path=y.path||"/socket.io",this.opts=y,s.installTimerFunctions(this,y),this.reconnection(y.reconnection!==!1),this.reconnectionAttempts(y.reconnectionAttempts||1/0),this.reconnectionDelay(y.reconnectionDelay||1e3),this.reconnectionDelayMax(y.reconnectionDelayMax||5e3),this.randomizationFactor((_=y.randomizationFactor)!==null&&_!==void 0?_:.5),this.backoff=new u.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(y.timeout==null?2e4:y.timeout),this._readyState="closed",this.uri=h;const S=y.parser||l;this.encoder=new S.Encoder,this.decoder=new S.Decoder,this._autoConnect=y.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(h){return arguments.length?(this._reconnection=!!h,this):this._reconnection}reconnectionAttempts(h){return h===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=h,this)}reconnectionDelay(h){var y;return h===void 0?this._reconnectionDelay:(this._reconnectionDelay=h,(y=this.backoff)===null||y===void 0||y.setMin(h),this)}randomizationFactor(h){var y;return h===void 0?this._randomizationFactor:(this._randomizationFactor=h,(y=this.backoff)===null||y===void 0||y.setJitter(h),this)}reconnectionDelayMax(h){var y;return h===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=h,(y=this.backoff)===null||y===void 0||y.setMax(h),this)}timeout(h){return arguments.length?(this._timeout=h,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(h){if(d("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;d("opening %s",this.uri),this.engine=new s.Socket(this.uri,this.opts);const y=this.engine,_=this;this._readyState="opening",this.skipReconnect=!1;const S=i.on(y,"open",function(){_.onopen(),h&&h()}),v=x=>{d("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",x),h?h(x):this.maybeReconnectOnOpen()},w=i.on(y,"error",v);if(this._timeout!==!1){const x=this._timeout;d("connect attempt will timeout after %d",x);const O=this.setTimeoutFn(()=>{d("connect attempt timed out after %d",x),S(),v(new Error("timeout")),y.close()},x);this.opts.autoUnref&&O.unref(),this.subs.push(()=>{this.clearTimeoutFn(O)})}return this.subs.push(S),this.subs.push(w),this}connect(h){return this.open(h)}onopen(){d("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const h=this.engine;this.subs.push(i.on(h,"ping",this.onping.bind(this)),i.on(h,"data",this.ondata.bind(this)),i.on(h,"error",this.onerror.bind(this)),i.on(h,"close",this.onclose.bind(this)),i.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(h){try{this.decoder.add(h)}catch(y){this.onclose("parse error",y)}}ondecoded(h){s.nextTick(()=>{this.emitReserved("packet",h)},this.setTimeoutFn)}onerror(h){d("error",h),this.emitReserved("error",h)}socket(h,y){let _=this.nsps[h];return _?this._autoConnect&&!_.active&&_.connect():(_=new o.Socket(this,h,y),this.nsps[h]=_),_}_destroy(h){const y=Object.keys(this.nsps);for(const _ of y)if(this.nsps[_].active){d("socket %s is still active, skipping close",_);return}this._close()}_packet(h){d("writing packet %j",h);const y=this.encoder.encode(h);for(let _=0;_<y.length;_++)this.engine.write(y[_],h.options)}cleanup(){d("cleanup"),this.subs.forEach(h=>h()),this.subs.length=0,this.decoder.destroy()}_close(){d("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(h,y){d("closed due to %s",h),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",h,y),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const h=this;if(this.backoff.attempts>=this._reconnectionAttempts)d("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const y=this.backoff.duration();d("will wait %dms before reconnect attempt",y),this._reconnecting=!0;const _=this.setTimeoutFn(()=>{h.skipReconnect||(d("attempting reconnect"),this.emitReserved("reconnect_attempt",h.backoff.attempts),!h.skipReconnect&&h.open(S=>{S?(d("reconnect attempt error"),h._reconnecting=!1,h.reconnect(),this.emitReserved("reconnect_error",S)):(d("reconnect success"),h.onreconnect())}))},y);this.opts.autoUnref&&_.unref(),this.subs.push(()=>{this.clearTimeoutFn(_)})}}onreconnect(){const h=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",h)}}return Ar.Manager=f,Ar}var hu;function lv(){return hu||(hu=1,function(e,t){var n=ce&&ce.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const r=av(),s=uv();Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return s.Manager}});const o=bf();Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return o.Socket}});const i=n(ut()).default("socket.io-client"),u={};function c(d,f){typeof d=="object"&&(f=d,d=void 0),f=f||{};const p=r.url(d,f.path||"/socket.io"),h=p.source,y=p.id,_=p.path,S=u[y]&&_ in u[y].nsps,v=f.forceNew||f["force new connection"]||f.multiplex===!1||S;let w;return v?(i("ignoring socket cache for %s",h),w=new s.Manager(h,f)):(u[y]||(i("new io instance for %s",h),u[y]=new s.Manager(h,f)),w=u[y]),p.query&&!f.query&&(f.query=p.queryKey),w.socket(p.path,f)}t.io=c,t.connect=c,t.default=c,Object.assign(c,{Manager:s.Manager,Socket:o.Socket,io:c,connect:c});var a=Ea();Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return a.protocol}}),e.exports=c}(On,On.exports)),On.exports}var Ao={},Pr={},mu;function fv(){if(mu)return Pr;mu=1,Pr.byteLength=i,Pr.toByteArray=c,Pr.fromByteArray=f;for(var e=[],t=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=r.length;s<o;++s)e[s]=r[s],t[r.charCodeAt(s)]=s;t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;function l(p){var h=p.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=p.indexOf("=");y===-1&&(y=h);var _=y===h?0:4-y%4;return[y,_]}function i(p){var h=l(p),y=h[0],_=h[1];return(y+_)*3/4-_}function u(p,h,y){return(h+y)*3/4-y}function c(p){var h,y=l(p),_=y[0],S=y[1],v=new n(u(p,_,S)),w=0,x=S>0?_-4:_,O;for(O=0;O<x;O+=4)h=t[p.charCodeAt(O)]<<18|t[p.charCodeAt(O+1)]<<12|t[p.charCodeAt(O+2)]<<6|t[p.charCodeAt(O+3)],v[w++]=h>>16&255,v[w++]=h>>8&255,v[w++]=h&255;return S===2&&(h=t[p.charCodeAt(O)]<<2|t[p.charCodeAt(O+1)]>>4,v[w++]=h&255),S===1&&(h=t[p.charCodeAt(O)]<<10|t[p.charCodeAt(O+1)]<<4|t[p.charCodeAt(O+2)]>>2,v[w++]=h>>8&255,v[w++]=h&255),v}function a(p){return e[p>>18&63]+e[p>>12&63]+e[p>>6&63]+e[p&63]}function d(p,h,y){for(var _,S=[],v=h;v<y;v+=3)_=(p[v]<<16&16711680)+(p[v+1]<<8&65280)+(p[v+2]&255),S.push(a(_));return S.join("")}function f(p){for(var h,y=p.length,_=y%3,S=[],v=16383,w=0,x=y-_;w<x;w+=v)S.push(d(p,w,w+v>x?x:w+v));return _===1?(h=p[y-1],S.push(e[h>>2]+e[h<<4&63]+"==")):_===2&&(h=(p[y-2]<<8)+p[y-1],S.push(e[h>>10]+e[h>>4&63]+e[h<<2&63]+"=")),S.join("")}return Pr}var xn={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var gu;function dv(){return gu||(gu=1,xn.read=function(e,t,n,r,s){var o,l,i=s*8-r-1,u=(1<<i)-1,c=u>>1,a=-7,d=n?s-1:0,f=n?-1:1,p=e[t+d];for(d+=f,o=p&(1<<-a)-1,p>>=-a,a+=i;a>0;o=o*256+e[t+d],d+=f,a-=8);for(l=o&(1<<-a)-1,o>>=-a,a+=r;a>0;l=l*256+e[t+d],d+=f,a-=8);if(o===0)o=1-c;else{if(o===u)return l?NaN:(p?-1:1)*(1/0);l=l+Math.pow(2,r),o=o-c}return(p?-1:1)*l*Math.pow(2,o-r)},xn.write=function(e,t,n,r,s,o){var l,i,u,c=o*8-s-1,a=(1<<c)-1,d=a>>1,f=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,y=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,l=a):(l=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-l))<1&&(l--,u*=2),l+d>=1?t+=f/u:t+=f*Math.pow(2,1-d),t*u>=2&&(l++,u/=2),l+d>=a?(i=0,l=a):l+d>=1?(i=(t*u-1)*Math.pow(2,s),l=l+d):(i=t*Math.pow(2,d-1)*Math.pow(2,s),l=0));s>=8;e[n+p]=i&255,p+=h,i/=256,s-=8);for(l=l<<s|i,c+=s;c>0;e[n+p]=l&255,p+=h,l/=256,c-=8);e[n+p-h]|=y*128}),xn}/*!
|
|
63
|
+
window.`+l+".push("+JSON.stringify(o)+")"}};return _o=r,_o}var Eo,Fc;function Dy(){if(Fc)return Eo;Fc=1;var e=My(),t=n(e);function n(s){return s&&s.__esModule?s:{default:s}}var r={dataScript:function(o){var l=document.createElement("script");return l.innerHTML=o,l},gtm:function(o){var l=t.default.tags(o),i=function(){var d=document.createElement("noscript");return d.innerHTML=l.iframe,d},u=function(){var d=document.createElement("script");return d.innerHTML=l.script,d},c=this.dataScript(l.dataLayerVar);return{noScript:i,script:u,dataScript:c}},initialize:function(o){var l=o.gtmId,i=o.events,u=i===void 0?{}:i,c=o.dataLayer,a=o.dataLayerName,d=a===void 0?"dataLayer":a,f=o.auth,p=f===void 0?"":f,h=o.preview,y=h===void 0?"":h,_=this.gtm({id:l,events:u,dataLayer:c||void 0,dataLayerName:d,auth:p,preview:y});c&&document.head.appendChild(_.dataScript),document.head.insertBefore(_.script(),document.head.childNodes[0]),document.body.insertBefore(_.noScript(),document.body.childNodes[0])},dataLayer:function(o){var l=o.dataLayer,i=o.dataLayerName,u=i===void 0?"dataLayer":i;if(window[u])return window[u].push(l);var c=t.default.dataLayer(l,u),a=this.dataScript(c);document.head.insertBefore(a,document.head.childNodes[0])}};return Eo=r,Eo}var wo,jc;function Uy(){if(jc)return wo;jc=1;var e=Dy(),t=n(e);function n(r){return r&&r.__esModule?r:{default:r}}return wo=t.default,wo}var Mc;function By(){return Mc||(Mc=1,function(e,t){(function(n,r){e.exports=r(Uy())})(ce,function(n){return function(){var r={273:function(i){i.exports=n}},s={};function o(i){var u=s[i];if(u!==void 0)return u.exports;var c=s[i]={exports:{}};return r[i](c,c.exports,o),c.exports}o.n=function(i){var u=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(u,{a:u}),u},o.d=function(i,u){for(var c in u)o.o(u,c)&&!o.o(i,c)&&Object.defineProperty(i,c,{enumerable:!0,get:u[c]})},o.o=function(i,u){return Object.prototype.hasOwnProperty.call(i,u)},o.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var l={};return function(){o.r(l),o.d(l,{setContext:function(){return a},setupGTM:function(){return f}});var i=o(273),u=o.n(i);let c=null;const a=({configs:p,environment:h})=>{if(!h)throw new Error("Cannot set context: Environment not defined");if(!p)throw new Error("Cannot set context: REACT_APP_GTM_ID not defined");if(!p[h])throw new Error(`Cannot set context: REACT_APP_GTM_ID not defined for environment - ${JSON.stringify({configs:p,environment:h})}`);c=p[h]},d=()=>c,f=()=>{const p=d();u().initialize({gtmId:p.id})}}(),l}()})}(vo)),vo.exports}var pl=202,hl=502,ml=400,gl=409,yl=100,vl=201,_l=417,$y=424,El=403,wl=504,bl=410,Sl=505,Ol=418,Tl=419,xl=507,Al=500,Rl=411,Cl=423,Nl=420,Pl=405,Il=301,kl=302,Ll=207,Fl=300,jl=511,Ml=204,Dl=203,Ul=406,Bl=404,$l=501,ql=304,Hl=200,Wl=206,Gl=402,Vl=308,Ql=412,zl=428,Yl=102,Kl=407,Jl=431,Xl=408,Zl=413,ef=414,tf=416,rf=205,nf=303,of=503,af=101,sf=307,cf=429,uf=401,lf=422,ff=415,df=305;const qy={ACCEPTED:pl,BAD_GATEWAY:hl,BAD_REQUEST:ml,CONFLICT:gl,CONTINUE:yl,CREATED:vl,EXPECTATION_FAILED:_l,FORBIDDEN:El,GATEWAY_TIMEOUT:wl,GONE:bl,HTTP_VERSION_NOT_SUPPORTED:Sl,IM_A_TEAPOT:Ol,INSUFFICIENT_SPACE_ON_RESOURCE:Tl,INSUFFICIENT_STORAGE:xl,INTERNAL_SERVER_ERROR:Al,LENGTH_REQUIRED:Rl,LOCKED:Cl,METHOD_FAILURE:Nl,METHOD_NOT_ALLOWED:Pl,MOVED_PERMANENTLY:Il,MOVED_TEMPORARILY:kl,MULTI_STATUS:Ll,MULTIPLE_CHOICES:Fl,NETWORK_AUTHENTICATION_REQUIRED:jl,NO_CONTENT:Ml,NON_AUTHORITATIVE_INFORMATION:Dl,NOT_ACCEPTABLE:Ul,NOT_FOUND:Bl,NOT_IMPLEMENTED:$l,NOT_MODIFIED:ql,OK:Hl,PARTIAL_CONTENT:Wl,PAYMENT_REQUIRED:Gl,PERMANENT_REDIRECT:Vl,PRECONDITION_FAILED:Ql,PRECONDITION_REQUIRED:zl,PROCESSING:Yl,PROXY_AUTHENTICATION_REQUIRED:Kl,REQUEST_HEADER_FIELDS_TOO_LARGE:Jl,REQUEST_TIMEOUT:Xl,REQUEST_TOO_LONG:Zl,REQUEST_URI_TOO_LONG:ef,REQUESTED_RANGE_NOT_SATISFIABLE:tf,RESET_CONTENT:rf,SEE_OTHER:nf,SERVICE_UNAVAILABLE:of,SWITCHING_PROTOCOLS:af,TEMPORARY_REDIRECT:sf,TOO_MANY_REQUESTS:cf,UNAUTHORIZED:uf,UNPROCESSABLE_ENTITY:lf,UNSUPPORTED_MEDIA_TYPE:ff,USE_PROXY:df};var Hy={202:"Accepted",502:"Bad Gateway",400:"Bad Request",409:"Conflict",100:"Continue",201:"Created",417:"Expectation Failed",424:"Failed Dependency",403:"Forbidden",504:"Gateway Timeout",410:"Gone",505:"HTTP Version Not Supported",418:"I'm a teapot",419:"Insufficient Space on Resource",507:"Insufficient Storage",500:"Internal Server Error",411:"Length Required",423:"Locked",420:"Method Failure",405:"Method Not Allowed",301:"Moved Permanently",302:"Moved Temporarily",207:"Multi-Status",300:"Multiple Choices",511:"Network Authentication Required",204:"No Content",203:"Non Authoritative Information",406:"Not Acceptable",404:"Not Found",501:"Not Implemented",304:"Not Modified",200:"OK",206:"Partial Content",402:"Payment Required",308:"Permanent Redirect",412:"Precondition Failed",428:"Precondition Required",102:"Processing",407:"Proxy Authentication Required",431:"Request Header Fields Too Large",408:"Request Timeout",413:"Request Entity Too Large",414:"Request-URI Too Long",416:"Requested Range Not Satisfiable",205:"Reset Content",303:"See Other",503:"Service Unavailable",101:"Switching Protocols",307:"Temporary Redirect",429:"Too Many Requests",401:"Unauthorized",451:"Unavailable For Legal Reasons",422:"Unprocessable Entity",415:"Unsupported Media Type",305:"Use Proxy",421:"Misdirected Request"},Wy={Accepted:202,"Bad Gateway":502,"Bad Request":400,Conflict:409,Continue:100,Created:201,"Expectation Failed":417,"Failed Dependency":424,Forbidden:403,"Gateway Timeout":504,Gone:410,"HTTP Version Not Supported":505,"I'm a teapot":418,"Insufficient Space on Resource":419,"Insufficient Storage":507,"Internal Server Error":500,"Length Required":411,Locked:423,"Method Failure":420,"Method Not Allowed":405,"Moved Permanently":301,"Moved Temporarily":302,"Multi-Status":207,"Multiple Choices":300,"Network Authentication Required":511,"No Content":204,"Non Authoritative Information":203,"Not Acceptable":406,"Not Found":404,"Not Implemented":501,"Not Modified":304,OK:200,"Partial Content":206,"Payment Required":402,"Permanent Redirect":308,"Precondition Failed":412,"Precondition Required":428,Processing:102,"Proxy Authentication Required":407,"Request Header Fields Too Large":431,"Request Timeout":408,"Request Entity Too Large":413,"Request-URI Too Long":414,"Requested Range Not Satisfiable":416,"Reset Content":205,"See Other":303,"Service Unavailable":503,"Switching Protocols":101,"Temporary Redirect":307,"Too Many Requests":429,Unauthorized:401,"Unavailable For Legal Reasons":451,"Unprocessable Entity":422,"Unsupported Media Type":415,"Use Proxy":305,"Misdirected Request":421};function pf(e){var t=Hy[e.toString()];if(!t)throw new Error("Status code does not exist: "+e);return t}function hf(e){var t=Wy[e];if(!t)throw new Error("Reason phrase does not exist: "+e);return t}var mf=pf,Zo;(function(e){e[e.ACCEPTED=202]="ACCEPTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.CONFLICT=409]="CONFLICT",e[e.CONTINUE=100]="CONTINUE",e[e.CREATED=201]="CREATED",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.GONE=410]="GONE",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.IM_A_TEAPOT=418]="IM_A_TEAPOT",e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.LOCKED=423]="LOCKED",e[e.METHOD_FAILURE=420]="METHOD_FAILURE",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.OK=200]="OK",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.PROCESSING=102]="PROCESSING",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",e[e.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.USE_PROXY=305]="USE_PROXY",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST"})(Zo||(Zo={}));var ea;(function(e){e.ACCEPTED="Accepted",e.BAD_GATEWAY="Bad Gateway",e.BAD_REQUEST="Bad Request",e.CONFLICT="Conflict",e.CONTINUE="Continue",e.CREATED="Created",e.EXPECTATION_FAILED="Expectation Failed",e.FAILED_DEPENDENCY="Failed Dependency",e.FORBIDDEN="Forbidden",e.GATEWAY_TIMEOUT="Gateway Timeout",e.GONE="Gone",e.HTTP_VERSION_NOT_SUPPORTED="HTTP Version Not Supported",e.IM_A_TEAPOT="I'm a teapot",e.INSUFFICIENT_SPACE_ON_RESOURCE="Insufficient Space on Resource",e.INSUFFICIENT_STORAGE="Insufficient Storage",e.INTERNAL_SERVER_ERROR="Internal Server Error",e.LENGTH_REQUIRED="Length Required",e.LOCKED="Locked",e.METHOD_FAILURE="Method Failure",e.METHOD_NOT_ALLOWED="Method Not Allowed",e.MOVED_PERMANENTLY="Moved Permanently",e.MOVED_TEMPORARILY="Moved Temporarily",e.MULTI_STATUS="Multi-Status",e.MULTIPLE_CHOICES="Multiple Choices",e.NETWORK_AUTHENTICATION_REQUIRED="Network Authentication Required",e.NO_CONTENT="No Content",e.NON_AUTHORITATIVE_INFORMATION="Non Authoritative Information",e.NOT_ACCEPTABLE="Not Acceptable",e.NOT_FOUND="Not Found",e.NOT_IMPLEMENTED="Not Implemented",e.NOT_MODIFIED="Not Modified",e.OK="OK",e.PARTIAL_CONTENT="Partial Content",e.PAYMENT_REQUIRED="Payment Required",e.PERMANENT_REDIRECT="Permanent Redirect",e.PRECONDITION_FAILED="Precondition Failed",e.PRECONDITION_REQUIRED="Precondition Required",e.PROCESSING="Processing",e.PROXY_AUTHENTICATION_REQUIRED="Proxy Authentication Required",e.REQUEST_HEADER_FIELDS_TOO_LARGE="Request Header Fields Too Large",e.REQUEST_TIMEOUT="Request Timeout",e.REQUEST_TOO_LONG="Request Entity Too Large",e.REQUEST_URI_TOO_LONG="Request-URI Too Long",e.REQUESTED_RANGE_NOT_SATISFIABLE="Requested Range Not Satisfiable",e.RESET_CONTENT="Reset Content",e.SEE_OTHER="See Other",e.SERVICE_UNAVAILABLE="Service Unavailable",e.SWITCHING_PROTOCOLS="Switching Protocols",e.TEMPORARY_REDIRECT="Temporary Redirect",e.TOO_MANY_REQUESTS="Too Many Requests",e.UNAUTHORIZED="Unauthorized",e.UNAVAILABLE_FOR_LEGAL_REASONS="Unavailable For Legal Reasons",e.UNPROCESSABLE_ENTITY="Unprocessable Entity",e.UNSUPPORTED_MEDIA_TYPE="Unsupported Media Type",e.USE_PROXY="Use Proxy",e.MISDIRECTED_REQUEST="Misdirected Request"})(ea||(ea={}));var Un=globalThis&&globalThis.__assign||function(){return Un=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Un.apply(this,arguments)};const Gy=Un(Un({},qy),{getStatusCode:hf,getStatusText:mf}),Vy=Object.freeze(Object.defineProperty({__proto__:null,ACCEPTED:pl,BAD_GATEWAY:hl,BAD_REQUEST:ml,CONFLICT:gl,CONTINUE:yl,CREATED:vl,EXPECTATION_FAILED:_l,FAILED_DEPENDENCY:$y,FORBIDDEN:El,GATEWAY_TIMEOUT:wl,GONE:bl,HTTP_VERSION_NOT_SUPPORTED:Sl,IM_A_TEAPOT:Ol,INSUFFICIENT_SPACE_ON_RESOURCE:Tl,INSUFFICIENT_STORAGE:xl,INTERNAL_SERVER_ERROR:Al,LENGTH_REQUIRED:Rl,LOCKED:Cl,METHOD_FAILURE:Nl,METHOD_NOT_ALLOWED:Pl,MOVED_PERMANENTLY:Il,MOVED_TEMPORARILY:kl,MULTIPLE_CHOICES:Fl,MULTI_STATUS:Ll,NETWORK_AUTHENTICATION_REQUIRED:jl,NON_AUTHORITATIVE_INFORMATION:Dl,NOT_ACCEPTABLE:Ul,NOT_FOUND:Bl,NOT_IMPLEMENTED:$l,NOT_MODIFIED:ql,NO_CONTENT:Ml,OK:Hl,PARTIAL_CONTENT:Wl,PAYMENT_REQUIRED:Gl,PERMANENT_REDIRECT:Vl,PRECONDITION_FAILED:Ql,PRECONDITION_REQUIRED:zl,PROCESSING:Yl,PROXY_AUTHENTICATION_REQUIRED:Kl,REQUESTED_RANGE_NOT_SATISFIABLE:tf,REQUEST_HEADER_FIELDS_TOO_LARGE:Jl,REQUEST_TIMEOUT:Xl,REQUEST_TOO_LONG:Zl,REQUEST_URI_TOO_LONG:ef,RESET_CONTENT:rf,get ReasonPhrases(){return ea},SEE_OTHER:nf,SERVICE_UNAVAILABLE:of,SWITCHING_PROTOCOLS:af,get StatusCodes(){return Zo},TEMPORARY_REDIRECT:sf,TOO_MANY_REQUESTS:cf,UNAUTHORIZED:uf,UNPROCESSABLE_ENTITY:lf,UNSUPPORTED_MEDIA_TYPE:ff,USE_PROXY:df,default:Gy,getReasonPhrase:pf,getStatusCode:hf,getStatusText:mf},Symbol.toStringTag,{value:"Module"})),Qy=qr(Vy);var On={exports:{}},yr={},bo={},vr={},_r={},xt={},Er={},So={},At={},lt={},Dc;function _a(){if(Dc)return lt;Dc=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.ERROR_PACKET=lt.PACKET_TYPES_REVERSE=lt.PACKET_TYPES=void 0;const e=Object.create(null);lt.PACKET_TYPES=e,e.open="0",e.close="1",e.ping="2",e.pong="3",e.message="4",e.upgrade="5",e.noop="6";const t=Object.create(null);lt.PACKET_TYPES_REVERSE=t,Object.keys(e).forEach(r=>{t[e[r]]=r});const n={type:"error",data:"parser error"};return lt.ERROR_PACKET=n,lt}var Uc;function zy(){if(Uc)return At;Uc=1,Object.defineProperty(At,"__esModule",{value:!0}),At.encodePacket=At.encodePacketToBinary=void 0;const e=_a(),t=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",n=typeof ArrayBuffer=="function",r=c=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(c):c&&c.buffer instanceof ArrayBuffer,s=({type:c,data:a},d,f)=>t&&a instanceof Blob?d?f(a):o(a,f):n&&(a instanceof ArrayBuffer||r(a))?d?f(a):o(new Blob([a]),f):f(e.PACKET_TYPES[c]+(a||""));At.encodePacket=s;const o=(c,a)=>{const d=new FileReader;return d.onload=function(){const f=d.result.split(",")[1];a("b"+(f||""))},d.readAsDataURL(c)};function l(c){return c instanceof Uint8Array?c:c instanceof ArrayBuffer?new Uint8Array(c):new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}let i;function u(c,a){if(t&&c.data instanceof Blob)return c.data.arrayBuffer().then(l).then(a);if(n&&(c.data instanceof ArrayBuffer||r(c.data)))return a(l(c.data));s(c,!1,d=>{i||(i=new TextEncoder),a(i.encode(d))})}return At.encodePacketToBinary=u,At}var wr={},Rt={},Bc;function Yy(){if(Bc)return Rt;Bc=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.decode=Rt.encode=void 0;const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<e.length;s++)t[e.charCodeAt(s)]=s;const n=s=>{let o=new Uint8Array(s),l,i=o.length,u="";for(l=0;l<i;l+=3)u+=e[o[l]>>2],u+=e[(o[l]&3)<<4|o[l+1]>>4],u+=e[(o[l+1]&15)<<2|o[l+2]>>6],u+=e[o[l+2]&63];return i%3===2?u=u.substring(0,u.length-1)+"=":i%3===1&&(u=u.substring(0,u.length-2)+"=="),u};Rt.encode=n;const r=s=>{let o=s.length*.75,l=s.length,i,u=0,c,a,d,f;s[s.length-1]==="="&&(o--,s[s.length-2]==="="&&o--);const p=new ArrayBuffer(o),h=new Uint8Array(p);for(i=0;i<l;i+=4)c=t[s.charCodeAt(i)],a=t[s.charCodeAt(i+1)],d=t[s.charCodeAt(i+2)],f=t[s.charCodeAt(i+3)],h[u++]=c<<2|a>>4,h[u++]=(a&15)<<4|d>>2,h[u++]=(d&3)<<6|f&63;return p};return Rt.decode=r,Rt}var $c;function Ky(){if($c)return wr;$c=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.decodePacket=void 0;const e=_a(),t=Yy(),n=typeof ArrayBuffer=="function",r=(l,i)=>{if(typeof l!="string")return{type:"message",data:o(l,i)};const u=l.charAt(0);return u==="b"?{type:"message",data:s(l.substring(1),i)}:e.PACKET_TYPES_REVERSE[u]?l.length>1?{type:e.PACKET_TYPES_REVERSE[u],data:l.substring(1)}:{type:e.PACKET_TYPES_REVERSE[u]}:e.ERROR_PACKET};wr.decodePacket=r;const s=(l,i)=>{if(n){const u=(0,t.decode)(l);return o(u,i)}else return{base64:!0,data:l}},o=(l,i)=>{switch(i){case"blob":return l instanceof Blob?l:new Blob([l]);case"arraybuffer":default:return l instanceof ArrayBuffer?l:l.buffer}};return wr}var qc;function Wr(){return qc||(qc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=e.createPacketDecoderStream=e.createPacketEncoderStream=void 0;const t=zy();Object.defineProperty(e,"encodePacket",{enumerable:!0,get:function(){return t.encodePacket}});const n=Ky();Object.defineProperty(e,"decodePacket",{enumerable:!0,get:function(){return n.decodePacket}});const r=_a(),s=String.fromCharCode(30),o=(f,p)=>{const h=f.length,y=new Array(h);let _=0;f.forEach((S,v)=>{(0,t.encodePacket)(S,!1,w=>{y[v]=w,++_===h&&p(y.join(s))})})};e.encodePayload=o;const l=(f,p)=>{const h=f.split(s),y=[];for(let _=0;_<h.length;_++){const S=(0,n.decodePacket)(h[_],p);if(y.push(S),S.type==="error")break}return y};e.decodePayload=l;function i(){return new TransformStream({transform(f,p){(0,t.encodePacketToBinary)(f,h=>{const y=h.length;let _;if(y<126)_=new Uint8Array(1),new DataView(_.buffer).setUint8(0,y);else if(y<65536){_=new Uint8Array(3);const S=new DataView(_.buffer);S.setUint8(0,126),S.setUint16(1,y)}else{_=new Uint8Array(9);const S=new DataView(_.buffer);S.setUint8(0,127),S.setBigUint64(1,BigInt(y))}f.data&&typeof f.data!="string"&&(_[0]|=128),p.enqueue(_),p.enqueue(h)})}})}e.createPacketEncoderStream=i;let u;function c(f){return f.reduce((p,h)=>p+h.length,0)}function a(f,p){if(f[0].length===p)return f.shift();const h=new Uint8Array(p);let y=0;for(let _=0;_<p;_++)h[_]=f[0][y++],y===f[0].length&&(f.shift(),y=0);return f.length&&y<f[0].length&&(f[0]=f[0].slice(y)),h}function d(f,p){u||(u=new TextDecoder);const h=[];let y=0,_=-1,S=!1;return new TransformStream({transform(v,w){for(h.push(v);;){if(y===0){if(c(h)<1)break;const x=a(h,1);S=(x[0]&128)===128,_=x[0]&127,_<126?y=3:_===126?y=1:y=2}else if(y===1){if(c(h)<2)break;const x=a(h,2);_=new DataView(x.buffer,x.byteOffset,x.length).getUint16(0),y=3}else if(y===2){if(c(h)<8)break;const x=a(h,8),O=new DataView(x.buffer,x.byteOffset,x.length),F=O.getUint32(0);if(F>Math.pow(2,53-32)-1){w.enqueue(r.ERROR_PACKET);break}_=F*Math.pow(2,32)+O.getUint32(4),y=3}else{if(c(h)<_)break;const x=a(h,_);w.enqueue((0,n.decodePacket)(S?x:u.decode(x),p)),y=0}if(_===0||_>f){w.enqueue(r.ERROR_PACKET);break}}}})}e.createPacketDecoderStream=d,e.protocol=4}(So)),So}function Qe(e){if(e)return Jy(e)}function Jy(e){for(var t in Qe.prototype)e[t]=Qe.prototype[t];return e}Qe.prototype.on=Qe.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Qe.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Qe.prototype.off=Qe.prototype.removeListener=Qe.prototype.removeAllListeners=Qe.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Qe.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Qe.prototype.emitReserved=Qe.prototype.emit;Qe.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Qe.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Xy=Object.freeze(Object.defineProperty({__proto__:null,Emitter:Qe},Symbol.toStringTag,{value:"Module"})),tr=qr(Xy);var ft={},br={},Hc;function Vn(){return Hc||(Hc=1,Object.defineProperty(br,"__esModule",{value:!0}),br.globalThisShim=void 0,br.globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())()),br}var Wc;function Gr(){if(Wc)return ft;Wc=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.byteLength=ft.installTimerFunctions=ft.pick=void 0;const e=Vn();function t(u,...c){return c.reduce((a,d)=>(u.hasOwnProperty(d)&&(a[d]=u[d]),a),{})}ft.pick=t;const n=e.globalThisShim.setTimeout,r=e.globalThisShim.clearTimeout;function s(u,c){c.useNativeTimers?(u.setTimeoutFn=n.bind(e.globalThisShim),u.clearTimeoutFn=r.bind(e.globalThisShim)):(u.setTimeoutFn=e.globalThisShim.setTimeout.bind(e.globalThisShim),u.clearTimeoutFn=e.globalThisShim.clearTimeout.bind(e.globalThisShim))}ft.installTimerFunctions=s;const o=1.33;function l(u){return typeof u=="string"?i(u):Math.ceil((u.byteLength||u.size)*o)}ft.byteLength=l;function i(u){let c=0,a=0;for(let d=0,f=u.length;d<f;d++)c=u.charCodeAt(d),c<128?a+=1:c<2048?a+=2:c<55296||c>=57344?a+=3:(d++,a+=4);return a}return ft}var Tn={exports:{}},Oo,Gc;function Zy(){if(Gc)return Oo;Gc=1;var e=1e3,t=e*60,n=t*60,r=n*24,s=r*7,o=r*365.25;Oo=function(a,d){d=d||{};var f=typeof a;if(f==="string"&&a.length>0)return l(a);if(f==="number"&&isFinite(a))return d.long?u(a):i(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))};function l(a){if(a=String(a),!(a.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(d){var f=parseFloat(d[1]),p=(d[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*s;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function i(a){var d=Math.abs(a);return d>=r?Math.round(a/r)+"d":d>=n?Math.round(a/n)+"h":d>=t?Math.round(a/t)+"m":d>=e?Math.round(a/e)+"s":a+"ms"}function u(a){var d=Math.abs(a);return d>=r?c(a,d,r,"day"):d>=n?c(a,d,n,"hour"):d>=t?c(a,d,t,"minute"):d>=e?c(a,d,e,"second"):a+" ms"}function c(a,d,f,p){var h=d>=f*1.5;return Math.round(a/f)+" "+p+(h?"s":"")}return Oo}var To,Vc;function ev(){if(Vc)return To;Vc=1;function e(t){r.debug=r,r.default=r,r.coerce=c,r.disable=l,r.enable=o,r.enabled=i,r.humanize=Zy(),r.destroy=a,Object.keys(t).forEach(d=>{r[d]=t[d]}),r.names=[],r.skips=[],r.formatters={};function n(d){let f=0;for(let p=0;p<d.length;p++)f=(f<<5)-f+d.charCodeAt(p),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=n;function r(d){let f,p=null,h,y;function _(...S){if(!_.enabled)return;const v=_,w=Number(new Date),x=w-(f||w);v.diff=x,v.prev=f,v.curr=w,f=w,S[0]=r.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let O=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(D,R)=>{if(D==="%%")return"%";O++;const W=r.formatters[R];if(typeof W=="function"){const Q=S[O];D=W.call(v,Q),S.splice(O,1),O--}return D}),r.formatArgs.call(v,S),(v.log||r.log).apply(v,S)}return _.namespace=d,_.useColors=r.useColors(),_.color=r.selectColor(d),_.extend=s,_.destroy=r.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(h!==r.namespaces&&(h=r.namespaces,y=r.enabled(d)),y),set:S=>{p=S}}),typeof r.init=="function"&&r.init(_),_}function s(d,f){const p=r(this.namespace+(typeof f>"u"?":":f)+d);return p.log=this.log,p}function o(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let f;const p=(typeof d=="string"?d:"").split(/[\s,]+/),h=p.length;for(f=0;f<h;f++)p[f]&&(d=p[f].replace(/\*/g,".*?"),d[0]==="-"?r.skips.push(new RegExp("^"+d.slice(1)+"$")):r.names.push(new RegExp("^"+d+"$")))}function l(){const d=[...r.names.map(u),...r.skips.map(u).map(f=>"-"+f)].join(",");return r.enable(""),d}function i(d){if(d[d.length-1]==="*")return!0;let f,p;for(f=0,p=r.skips.length;f<p;f++)if(r.skips[f].test(d))return!1;for(f=0,p=r.names.length;f<p;f++)if(r.names[f].test(d))return!0;return!1}function u(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function c(d){return d instanceof Error?d.stack||d.message:d}function a(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}return To=e,To}var Qc;function ut(){return Qc||(Qc=1,function(e,t){t.formatArgs=r,t.save=s,t.load=o,t.useColors=n,t.storage=l(),t.destroy=(()=>{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;u.splice(1,0,c,"color: inherit");let a=0,d=0;u[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(a++,f==="%c"&&(d=a))}),u.splice(d,0,c)}t.log=console.debug||console.log||(()=>{});function s(u){try{u?t.storage.setItem("debug",u):t.storage.removeItem("debug")}catch{}}function o(){let u;try{u=t.storage.getItem("debug")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=process.env.DEBUG),u}function l(){try{return localStorage}catch{}}e.exports=ev()(t);const{formatters:i}=e.exports;i.j=function(u){try{return JSON.stringify(u)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}}(Tn,Tn.exports)),Tn.exports}var Ct={},zc;function gf(){if(zc)return Ct;zc=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.decode=Ct.encode=void 0;function e(n){let r="";for(let s in n)n.hasOwnProperty(s)&&(r.length&&(r+="&"),r+=encodeURIComponent(s)+"="+encodeURIComponent(n[s]));return r}Ct.encode=e;function t(n){let r={},s=n.split("&");for(let o=0,l=s.length;o<l;o++){let i=s[o].split("=");r[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return r}return Ct.decode=t,Ct}var Yc;function Qn(){if(Yc)return Er;Yc=1;var e=ce&&ce.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(Er,"__esModule",{value:!0}),Er.Transport=void 0;const t=Wr(),n=tr,r=Gr(),s=e(ut()),o=gf(),l=(0,s.default)("engine.io-client:transport");class i extends Error{constructor(a,d,f){super(a),this.description=d,this.context=f,this.type="TransportError"}}class u extends n.Emitter{constructor(a){super(),this.writable=!1,(0,r.installTimerFunctions)(this,a),this.opts=a,this.query=a.query,this.socket=a.socket}onError(a,d,f){return super.emitReserved("error",new i(a,d,f)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(a){this.readyState==="open"?this.write(a):l("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(a){const d=(0,t.decodePacket)(a,this.socket.binaryType);this.onPacket(d)}onPacket(a){super.emitReserved("packet",a)}onClose(a){this.readyState="closed",super.emitReserved("close",a)}pause(a){}createUri(a,d={}){return a+"://"+this._hostname()+this._port()+this.opts.path+this._query(d)}_hostname(){const a=this.opts.hostname;return a.indexOf(":")===-1?a:"["+a+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(a){const d=(0,o.encode)(a);return d.length?"?"+d:""}}return Er.Transport=u,Er}var dt={},Kc;function yf(){if(Kc)return dt;Kc=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.yeast=dt.decode=dt.encode=void 0;const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),t=64,n={};let r=0,s=0,o;function l(c){let a="";do a=e[c%t]+a,c=Math.floor(c/t);while(c>0);return a}dt.encode=l;function i(c){let a=0;for(s=0;s<c.length;s++)a=a*t+n[c.charAt(s)];return a}dt.decode=i;function u(){const c=l(+new Date);return c!==o?(r=0,o=c):c+"."+l(r++)}for(dt.yeast=u;s<t;s++)n[e[s]]=s;return dt}var Nt={},Sr={},Jc;function tv(){if(Jc)return Sr;Jc=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.hasCORS=void 0;let e=!1;try{e=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}return Sr.hasCORS=e,Sr}var Xc;function rv(){if(Xc)return Nt;Xc=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.createCookieJar=Nt.XHR=void 0;const e=tv(),t=Vn();function n(s){const o=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!o||e.hasCORS))return new XMLHttpRequest}catch{}if(!o)try{return new t.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}Nt.XHR=n;function r(){}return Nt.createCookieJar=r,Nt}var Zc;function nv(){if(Zc)return xt;Zc=1;var e=ce&&ce.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(xt,"__esModule",{value:!0}),xt.Request=xt.Polling=void 0;const t=Qn(),n=e(ut()),r=yf(),s=Wr(),o=rv(),l=tr,i=Gr(),u=Vn(),c=(0,n.default)("engine.io-client:polling");function a(){}const d=function(){return new o.XHR({xdomain:!1}).responseType!=null}();class f extends t.Transport{constructor(_){if(super(_),this.polling=!1,typeof location<"u"){const v=location.protocol==="https:";let w=location.port;w||(w=v?"443":"80"),this.xd=typeof location<"u"&&_.hostname!==location.hostname||w!==_.port}const S=_&&_.forceBase64;this.supportsBinary=d&&!S,this.opts.withCredentials&&(this.cookieJar=(0,o.createCookieJar)())}get name(){return"polling"}doOpen(){this.poll()}pause(_){this.readyState="pausing";const S=()=>{c("paused"),this.readyState="paused",_()};if(this.polling||!this.writable){let v=0;this.polling&&(c("we are currently polling - waiting to pause"),v++,this.once("pollComplete",function(){c("pre-pause polling complete"),--v||S()})),this.writable||(c("we are currently writing - waiting to pause"),v++,this.once("drain",function(){c("pre-pause writing complete"),--v||S()}))}else S()}poll(){c("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(_){c("polling got data %s",_);const S=v=>{if(this.readyState==="opening"&&v.type==="open"&&this.onOpen(),v.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(v)};(0,s.decodePayload)(_,this.socket.binaryType).forEach(S),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this.poll():c('ignoring poll - transport state "%s"',this.readyState))}doClose(){const _=()=>{c("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(c("transport open - closing"),_()):(c("transport not open - deferring close"),this.once("open",_))}write(_){this.writable=!1,(0,s.encodePayload)(_,S=>{this.doWrite(S,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const _=this.opts.secure?"https":"http",S=this.query||{};return this.opts.timestampRequests!==!1&&(S[this.opts.timestampParam]=(0,r.yeast)()),!this.supportsBinary&&!S.sid&&(S.b64=1),this.createUri(_,S)}request(_={}){return Object.assign(_,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new p(this.uri(),_)}doWrite(_,S){const v=this.request({method:"POST",data:_});v.on("success",S),v.on("error",(w,x)=>{this.onError("xhr post error",w,x)})}doPoll(){c("xhr poll");const _=this.request();_.on("data",this.onData.bind(this)),_.on("error",(S,v)=>{this.onError("xhr poll error",S,v)}),this.pollXhr=_}}xt.Polling=f;class p extends l.Emitter{constructor(_,S){super(),(0,i.installTimerFunctions)(this,S),this.opts=S,this.method=S.method||"GET",this.uri=_,this.data=S.data!==void 0?S.data:null,this.create()}create(){var _;const S=(0,i.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");S.xdomain=!!this.opts.xd;const v=this.xhr=new o.XHR(S);try{c("xhr open %s: %s",this.method,this.uri),v.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){v.setDisableHeaderCheck&&v.setDisableHeaderCheck(!0);for(let w in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(w)&&v.setRequestHeader(w,this.opts.extraHeaders[w])}}catch{}if(this.method==="POST")try{v.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{v.setRequestHeader("Accept","*/*")}catch{}(_=this.opts.cookieJar)===null||_===void 0||_.addCookies(v),"withCredentials"in v&&(v.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(v.timeout=this.opts.requestTimeout),v.onreadystatechange=()=>{var w;v.readyState===3&&((w=this.opts.cookieJar)===null||w===void 0||w.parseCookies(v)),v.readyState===4&&(v.status===200||v.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof v.status=="number"?v.status:0)},0))},c("xhr data %s",this.data),v.send(this.data)}catch(w){this.setTimeoutFn(()=>{this.onError(w)},0);return}typeof document<"u"&&(this.index=p.requestsCount++,p.requests[this.index]=this)}onError(_){this.emitReserved("error",_,this.xhr),this.cleanup(!0)}cleanup(_){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=a,_)try{this.xhr.abort()}catch{}typeof document<"u"&&delete p.requests[this.index],this.xhr=null}}onLoad(){const _=this.xhr.responseText;_!==null&&(this.emitReserved("data",_),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(xt.Request=p,p.requestsCount=0,p.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",h);else if(typeof addEventListener=="function"){const y="onpagehide"in u.globalThisShim?"pagehide":"unload";addEventListener(y,h,!1)}}function h(){for(let y in p.requests)p.requests.hasOwnProperty(y)&&p.requests[y].abort()}return xt}var Or={},et={},eu;function zn(){if(eu)return et;eu=1,Object.defineProperty(et,"__esModule",{value:!0}),et.defaultBinaryType=et.usingBrowserWebSocket=et.WebSocket=et.nextTick=void 0;const e=Vn();return et.nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,r)=>r(n,0))(),et.WebSocket=e.globalThisShim.WebSocket||e.globalThisShim.MozWebSocket,et.usingBrowserWebSocket=!0,et.defaultBinaryType="arraybuffer",et}var tu;function iv(){if(tu)return Or;tu=1;var e=ce&&ce.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Or,"__esModule",{value:!0}),Or.WS=void 0;const t=Qn(),n=yf(),r=Gr(),s=zn(),o=e(ut()),l=Wr(),i=(0,o.default)("engine.io-client:websocket"),u=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class c extends t.Transport{constructor(d){super(d),this.supportsBinary=!d.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const d=this.uri(),f=this.opts.protocols,p=u?{}:(0,r.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(p.headers=this.opts.extraHeaders);try{this.ws=s.usingBrowserWebSocket&&!u?f?new s.WebSocket(d,f):new s.WebSocket(d):new s.WebSocket(d,f,p)}catch(h){return this.emitReserved("error",h)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=d=>this.onClose({description:"websocket connection closed",context:d}),this.ws.onmessage=d=>this.onData(d.data),this.ws.onerror=d=>this.onError("websocket error",d)}write(d){this.writable=!1;for(let f=0;f<d.length;f++){const p=d[f],h=f===d.length-1;(0,l.encodePacket)(p,this.supportsBinary,y=>{const _={};s.usingBrowserWebSocket||(p.options&&(_.compress=p.options.compress),this.opts.perMessageDeflate&&(typeof y=="string"?Buffer.byteLength(y):y.length)<this.opts.perMessageDeflate.threshold&&(_.compress=!1));try{s.usingBrowserWebSocket?this.ws.send(y):this.ws.send(y,_)}catch{i("websocket closed before onclose event")}h&&(0,s.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const d=this.opts.secure?"wss":"ws",f=this.query||{};return this.opts.timestampRequests&&(f[this.opts.timestampParam]=(0,n.yeast)()),this.supportsBinary||(f.b64=1),this.createUri(d,f)}check(){return!!s.WebSocket}}return Or.WS=c,Or}var Tr={},ru;function ov(){if(ru)return Tr;ru=1;var e=ce&&ce.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.WT=void 0;const t=Qn(),n=zn(),r=Wr(),o=(0,e(ut()).default)("engine.io-client:webtransport");class l extends t.Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{o("transport closed gracefully"),this.onClose()}).catch(u=>{o("transport closed due to %s",u),this.onError("webtransport error",u)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(u=>{const c=(0,r.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=u.readable.pipeThrough(c).getReader(),d=(0,r.createPacketEncoderStream)();d.readable.pipeTo(u.writable),this.writer=d.writable.getWriter();const f=()=>{a.read().then(({done:h,value:y})=>{if(h){o("session is closed");return}o("received chunk: %o",y),this.onPacket(y),f()}).catch(h=>{o("an error occurred while reading: %s",h)})};f();const p={type:"open"};this.query.sid&&(p.data=`{"sid":"${this.query.sid}"}`),this.writer.write(p).then(()=>this.onOpen())})}))}write(u){this.writable=!1;for(let c=0;c<u.length;c++){const a=u[c],d=c===u.length-1;this.writer.write(a).then(()=>{d&&(0,n.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var u;(u=this.transport)===null||u===void 0||u.close()}}return Tr.WT=l,Tr}var nu;function vf(){if(nu)return _r;nu=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.transports=void 0;const e=nv(),t=iv(),n=ov();return _r.transports={websocket:t.WS,webtransport:n.WT,polling:e.Polling},_r}var xr={},iu;function _f(){if(iu)return xr;iu=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.parse=void 0;const e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,t=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function n(o){const l=o,i=o.indexOf("["),u=o.indexOf("]");i!=-1&&u!=-1&&(o=o.substring(0,i)+o.substring(i,u).replace(/:/g,";")+o.substring(u,o.length));let c=e.exec(o||""),a={},d=14;for(;d--;)a[t[d]]=c[d]||"";return i!=-1&&u!=-1&&(a.source=l,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=r(a,a.path),a.queryKey=s(a,a.query),a}xr.parse=n;function r(o,l){const i=/\/{2,9}/g,u=l.replace(i,"/").split("/");return(l.slice(0,1)=="/"||l.length===0)&&u.splice(0,1),l.slice(-1)=="/"&&u.splice(u.length-1,1),u}function s(o,l){const i={};return l.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(u,c,a){c&&(i[c]=a)}),i}return xr}var ou;function av(){if(ou)return vr;ou=1;var e=ce&&ce.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(vr,"__esModule",{value:!0}),vr.Socket=void 0;const t=vf(),n=Gr(),r=gf(),s=_f(),o=e(ut()),l=tr,i=Wr(),u=zn(),c=(0,o.default)("engine.io-client:socket");class a extends l.Emitter{constructor(f,p={}){super(),this.binaryType=u.defaultBinaryType,this.writeBuffer=[],f&&typeof f=="object"&&(p=f,f=null),f?(f=(0,s.parse)(f),p.hostname=f.host,p.secure=f.protocol==="https"||f.protocol==="wss",p.port=f.port,f.query&&(p.query=f.query)):p.host&&(p.hostname=(0,s.parse)(p.host).host),(0,n.installTimerFunctions)(this,p),this.secure=p.secure!=null?p.secure:typeof location<"u"&&location.protocol==="https:",p.hostname&&!p.port&&(p.port=this.secure?"443":"80"),this.hostname=p.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=p.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=p.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},p),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,r.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(f){c('creating transport "%s"',f);const p=Object.assign({},this.opts.query);p.EIO=i.protocol,p.transport=f,this.id&&(p.sid=this.id);const h=Object.assign({},this.opts,{query:p,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[f]);return c("options: %j",h),new t.transports[f](h)}open(){let f;if(this.opts.rememberUpgrade&&a.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)f="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else f=this.transports[0];this.readyState="opening";try{f=this.createTransport(f)}catch(p){c("error while creating transport: %s",p),this.transports.shift(),this.open();return}f.open(),this.setTransport(f)}setTransport(f){c("setting transport %s",f.name),this.transport&&(c("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=f,f.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",p=>this.onClose("transport close",p))}probe(f){c('probing transport "%s"',f);let p=this.createTransport(f),h=!1;a.priorWebsocketSuccess=!1;const y=()=>{h||(c('probe transport "%s" opened',f),p.send([{type:"ping",data:"probe"}]),p.once("packet",F=>{if(!h)if(F.type==="pong"&&F.data==="probe"){if(c('probe transport "%s" pong',f),this.upgrading=!0,this.emitReserved("upgrading",p),!p)return;a.priorWebsocketSuccess=p.name==="websocket",c('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{h||this.readyState!=="closed"&&(c("changing transport and sending upgrade packet"),O(),this.setTransport(p),p.send([{type:"upgrade"}]),this.emitReserved("upgrade",p),p=null,this.upgrading=!1,this.flush())})}else{c('probe transport "%s" failed',f);const D=new Error("probe error");D.transport=p.name,this.emitReserved("upgradeError",D)}}))};function _(){h||(h=!0,O(),p.close(),p=null)}const S=F=>{const D=new Error("probe error: "+F);D.transport=p.name,_(),c('probe transport "%s" failed because of error: %s',f,F),this.emitReserved("upgradeError",D)};function v(){S("transport closed")}function w(){S("socket closed")}function x(F){p&&F.name!==p.name&&(c('"%s" works - aborting "%s"',F.name,p.name),_())}const O=()=>{p.removeListener("open",y),p.removeListener("error",S),p.removeListener("close",v),this.off("close",w),this.off("upgrading",x)};p.once("open",y),p.once("error",S),p.once("close",v),this.once("close",w),this.once("upgrading",x),this.upgrades.indexOf("webtransport")!==-1&&f!=="webtransport"?this.setTimeoutFn(()=>{h||p.open()},200):p.open()}onOpen(){if(c("socket open"),this.readyState="open",a.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){c("starting upgrade probes");let f=0;const p=this.upgrades.length;for(;f<p;f++)this.probe(this.upgrades[f])}}onPacket(f){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(c('socket receive: type "%s", data "%s"',f.type,f.data),this.emitReserved("packet",f),this.emitReserved("heartbeat"),this.resetPingTimeout(),f.type){case"open":this.onHandshake(JSON.parse(f.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const p=new Error("server error");p.code=f.data,this.onError(p);break;case"message":this.emitReserved("data",f.data),this.emitReserved("message",f.data);break}else c('packet received with socket readyState "%s"',this.readyState)}onHandshake(f){this.emitReserved("handshake",f),this.id=f.sid,this.transport.query.sid=f.sid,this.upgrades=this.filterUpgrades(f.upgrades),this.pingInterval=f.pingInterval,this.pingTimeout=f.pingTimeout,this.maxPayload=f.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const f=this.getWritablePackets();c("flushing %d packets in socket",f.length),this.transport.send(f),this.prevBufferLen=f.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let p=1;for(let h=0;h<this.writeBuffer.length;h++){const y=this.writeBuffer[h].data;if(y&&(p+=(0,n.byteLength)(y)),h>0&&p>this.maxPayload)return c("only send %d out of %d packets",h,this.writeBuffer.length),this.writeBuffer.slice(0,h);p+=2}return c("payload size is %d (max: %d)",p,this.maxPayload),this.writeBuffer}write(f,p,h){return this.sendPacket("message",f,p,h),this}send(f,p,h){return this.sendPacket("message",f,p,h),this}sendPacket(f,p,h,y){if(typeof p=="function"&&(y=p,p=void 0),typeof h=="function"&&(y=h,h=null),this.readyState==="closing"||this.readyState==="closed")return;h=h||{},h.compress=h.compress!==!1;const _={type:f,data:p,options:h};this.emitReserved("packetCreate",_),this.writeBuffer.push(_),y&&this.once("flush",y),this.flush()}close(){const f=()=>{this.onClose("forced close"),c("socket closing - telling transport to close"),this.transport.close()},p=()=>{this.off("upgrade",p),this.off("upgradeError",p),f()},h=()=>{this.once("upgrade",p),this.once("upgradeError",p)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?h():f()}):this.upgrading?h():f()),this}onError(f){c("socket error %j",f),a.priorWebsocketSuccess=!1,this.emitReserved("error",f),this.onClose("transport error",f)}onClose(f,p){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(c('socket close with reason: "%s"',f),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",f,p),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(f){const p=[];let h=0;const y=f.length;for(;h<y;h++)~this.transports.indexOf(f[h])&&p.push(f[h]);return p}}return vr.Socket=a,a.protocol=i.protocol,vr}var au;function Ef(){return au||(au=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.nextTick=e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const t=av();Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return t.Socket}}),e.protocol=t.Socket.protocol;var n=Qn();Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return n.Transport}});var r=vf();Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return r.transports}});var s=Gr();Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return s.installTimerFunctions}});var o=_f();Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return o.parse}});var l=zn();Object.defineProperty(e,"nextTick",{enumerable:!0,get:function(){return l.nextTick}})}(bo)),bo}var su;function sv(){if(su)return yr;su=1;var e=ce&&ce.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(yr,"__esModule",{value:!0}),yr.url=void 0;const t=Ef(),r=e(ut()).default("socket.io-client:url");function s(o,l="",i){let u=o;i=i||typeof location<"u"&&location,o==null&&(o=i.protocol+"//"+i.host),typeof o=="string"&&(o.charAt(0)==="/"&&(o.charAt(1)==="/"?o=i.protocol+o:o=i.host+o),/^(https?|wss?):\/\//.test(o)||(r("protocol-less url %s",o),typeof i<"u"?o=i.protocol+"//"+o:o="https://"+o),r("parse %s",o),u=t.parse(o)),u.port||(/^(http|ws)$/.test(u.protocol)?u.port="80":/^(http|ws)s$/.test(u.protocol)&&(u.port="443")),u.path=u.path||"/";const a=u.host.indexOf(":")!==-1?"["+u.host+"]":u.host;return u.id=u.protocol+"://"+a+":"+u.port+l,u.href=u.protocol+"://"+a+(i&&i.port===u.port?"":":"+u.port),u}return yr.url=s,yr}var Ar={},Rr={},xo={},Pt={},It={},cu;function wf(){if(cu)return It;cu=1,Object.defineProperty(It,"__esModule",{value:!0}),It.hasBinary=It.isBinary=void 0;const e=typeof ArrayBuffer=="function",t=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,n=Object.prototype.toString,r=typeof Blob=="function"||typeof Blob<"u"&&n.call(Blob)==="[object BlobConstructor]",s=typeof File=="function"||typeof File<"u"&&n.call(File)==="[object FileConstructor]";function o(i){return e&&(i instanceof ArrayBuffer||t(i))||r&&i instanceof Blob||s&&i instanceof File}It.isBinary=o;function l(i,u){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let c=0,a=i.length;c<a;c++)if(l(i[c]))return!0;return!1}if(o(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return l(i.toJSON(),!0);for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c)&&l(i[c]))return!0;return!1}return It.hasBinary=l,It}var uu;function cv(){if(uu)return Pt;uu=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.reconstructPacket=Pt.deconstructPacket=void 0;const e=wf();function t(o){const l=[],i=o.data,u=o;return u.data=n(i,l),u.attachments=l.length,{packet:u,buffers:l}}Pt.deconstructPacket=t;function n(o,l){if(!o)return o;if((0,e.isBinary)(o)){const i={_placeholder:!0,num:l.length};return l.push(o),i}else if(Array.isArray(o)){const i=new Array(o.length);for(let u=0;u<o.length;u++)i[u]=n(o[u],l);return i}else if(typeof o=="object"&&!(o instanceof Date)){const i={};for(const u in o)Object.prototype.hasOwnProperty.call(o,u)&&(i[u]=n(o[u],l));return i}return o}function r(o,l){return o.data=s(o.data,l),delete o.attachments,o}Pt.reconstructPacket=r;function s(o,l){if(!o)return o;if(o&&o._placeholder===!0){if(typeof o.num=="number"&&o.num>=0&&o.num<l.length)return l[o.num];throw new Error("illegal attachments")}else if(Array.isArray(o))for(let i=0;i<o.length;i++)o[i]=s(o[i],l);else if(typeof o=="object")for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=s(o[i],l));return o}return Pt}var lu;function Ea(){return lu||(lu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const t=tr,n=cv(),r=wf(),o=(0,ut().default)("socket.io-parser"),l=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];e.protocol=5;var i;(function(f){f[f.CONNECT=0]="CONNECT",f[f.DISCONNECT=1]="DISCONNECT",f[f.EVENT=2]="EVENT",f[f.ACK=3]="ACK",f[f.CONNECT_ERROR=4]="CONNECT_ERROR",f[f.BINARY_EVENT=5]="BINARY_EVENT",f[f.BINARY_ACK=6]="BINARY_ACK"})(i=e.PacketType||(e.PacketType={}));class u{constructor(p){this.replacer=p}encode(p){return o("encoding packet %j",p),(p.type===i.EVENT||p.type===i.ACK)&&(0,r.hasBinary)(p)?this.encodeAsBinary({type:p.type===i.EVENT?i.BINARY_EVENT:i.BINARY_ACK,nsp:p.nsp,data:p.data,id:p.id}):[this.encodeAsString(p)]}encodeAsString(p){let h=""+p.type;return(p.type===i.BINARY_EVENT||p.type===i.BINARY_ACK)&&(h+=p.attachments+"-"),p.nsp&&p.nsp!=="/"&&(h+=p.nsp+","),p.id!=null&&(h+=p.id),p.data!=null&&(h+=JSON.stringify(p.data,this.replacer)),o("encoded %j as %s",p,h),h}encodeAsBinary(p){const h=(0,n.deconstructPacket)(p),y=this.encodeAsString(h.packet),_=h.buffers;return _.unshift(y),_}}e.Encoder=u;function c(f){return Object.prototype.toString.call(f)==="[object Object]"}class a extends t.Emitter{constructor(p){super(),this.reviver=p}add(p){let h;if(typeof p=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");h=this.decodeString(p);const y=h.type===i.BINARY_EVENT;y||h.type===i.BINARY_ACK?(h.type=y?i.EVENT:i.ACK,this.reconstructor=new d(h),h.attachments===0&&super.emitReserved("decoded",h)):super.emitReserved("decoded",h)}else if((0,r.isBinary)(p)||p.base64)if(this.reconstructor)h=this.reconstructor.takeBinaryData(p),h&&(this.reconstructor=null,super.emitReserved("decoded",h));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+p)}decodeString(p){let h=0;const y={type:Number(p.charAt(0))};if(i[y.type]===void 0)throw new Error("unknown packet type "+y.type);if(y.type===i.BINARY_EVENT||y.type===i.BINARY_ACK){const S=h+1;for(;p.charAt(++h)!=="-"&&h!=p.length;);const v=p.substring(S,h);if(v!=Number(v)||p.charAt(h)!=="-")throw new Error("Illegal attachments");y.attachments=Number(v)}if(p.charAt(h+1)==="/"){const S=h+1;for(;++h&&!(p.charAt(h)===","||h===p.length););y.nsp=p.substring(S,h)}else y.nsp="/";const _=p.charAt(h+1);if(_!==""&&Number(_)==_){const S=h+1;for(;++h;){const v=p.charAt(h);if(v==null||Number(v)!=v){--h;break}if(h===p.length)break}y.id=Number(p.substring(S,h+1))}if(p.charAt(++h)){const S=this.tryParse(p.substr(h));if(a.isPayloadValid(y.type,S))y.data=S;else throw new Error("invalid payload")}return o("decoded %s as %j",p,y),y}tryParse(p){try{return JSON.parse(p,this.reviver)}catch{return!1}}static isPayloadValid(p,h){switch(p){case i.CONNECT:return c(h);case i.DISCONNECT:return h===void 0;case i.CONNECT_ERROR:return typeof h=="string"||c(h);case i.EVENT:case i.BINARY_EVENT:return Array.isArray(h)&&(typeof h[0]=="number"||typeof h[0]=="string"&&l.indexOf(h[0])===-1);case i.ACK:case i.BINARY_ACK:return Array.isArray(h)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=a;class d{constructor(p){this.packet=p,this.buffers=[],this.reconPack=p}takeBinaryData(p){if(this.buffers.push(p),this.buffers.length===this.reconPack.attachments){const h=(0,n.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),h}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}}(xo)),xo}var Cr={},fu;function bf(){if(fu)return Cr;fu=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.on=void 0;function e(t,n,r){return t.on(n,r),function(){t.off(n,r)}}return Cr.on=e,Cr}var du;function Sf(){if(du)return Rr;du=1;var e=ce&&ce.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.Socket=void 0;const t=Ea(),n=bf(),r=tr,o=e(ut()).default("socket.io-client:socket"),l=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class i extends r.Emitter{constructor(c,a,d){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=c,this.nsp=a,d&&d.auth&&(this.auth=d.auth),this._opts=Object.assign({},d),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const c=this.io;this.subs=[n.on(c,"open",this.onopen.bind(this)),n.on(c,"packet",this.onpacket.bind(this)),n.on(c,"error",this.onerror.bind(this)),n.on(c,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...c){return c.unshift("message"),this.emit.apply(this,c),this}emit(c,...a){if(l.hasOwnProperty(c))throw new Error('"'+c.toString()+'" is a reserved event name');if(a.unshift(c),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(a),this;const d={type:t.PacketType.EVENT,data:a};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof a[a.length-1]=="function"){const h=this.ids++;o("emitting packet with ack id %d",h);const y=a.pop();this._registerAckCallback(h,y),d.id=h}const f=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!f||!this.connected)?o("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d),this.flags={},this}_registerAckCallback(c,a){var d;const f=(d=this.flags.timeout)!==null&&d!==void 0?d:this._opts.ackTimeout;if(f===void 0){this.acks[c]=a;return}const p=this.io.setTimeoutFn(()=>{delete this.acks[c];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===c&&(o("removing packet with ack id %d from the buffer",c),this.sendBuffer.splice(h,1));o("event with ack id %d has timed out after %d ms",c,f),a.call(this,new Error("operation has timed out"))},f);this.acks[c]=(...h)=>{this.io.clearTimeoutFn(p),a.apply(this,[null,...h])}}emitWithAck(c,...a){const d=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((f,p)=>{a.push((h,y)=>d?h?p(h):f(y):f(h)),this.emit(c,...a)})}_addToQueue(c){let a;typeof c[c.length-1]=="function"&&(a=c.pop());const d={id:this._queueSeq++,tryCount:0,pending:!1,args:c,flags:Object.assign({fromQueue:!0},this.flags)};c.push((f,...p)=>d!==this._queue[0]?void 0:(f!==null?d.tryCount>this._opts.retries&&(o("packet [%d] is discarded after %d tries",d.id,d.tryCount),this._queue.shift(),a&&a(f)):(o("packet [%d] was successfully sent",d.id),this._queue.shift(),a&&a(null,...p)),d.pending=!1,this._drainQueue())),this._queue.push(d),this._drainQueue()}_drainQueue(c=!1){if(o("draining queue"),!this.connected||this._queue.length===0)return;const a=this._queue[0];if(a.pending&&!c){o("packet [%d] has already been sent and is waiting for an ack",a.id);return}a.pending=!0,a.tryCount++,o("sending packet [%d] (try n°%d)",a.id,a.tryCount),this.flags=a.flags,this.emit.apply(this,a.args)}packet(c){c.nsp=this.nsp,this.io._packet(c)}onopen(){o("transport is open - connecting"),typeof this.auth=="function"?this.auth(c=>{this._sendConnectPacket(c)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(c){this.packet({type:t.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},c):c})}onerror(c){this.connected||this.emitReserved("connect_error",c)}onclose(c,a){o("close (%s)",c),this.connected=!1,delete this.id,this.emitReserved("disconnect",c,a)}onpacket(c){if(c.nsp===this.nsp)switch(c.type){case t.PacketType.CONNECT:c.data&&c.data.sid?this.onconnect(c.data.sid,c.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case t.PacketType.EVENT:case t.PacketType.BINARY_EVENT:this.onevent(c);break;case t.PacketType.ACK:case t.PacketType.BINARY_ACK:this.onack(c);break;case t.PacketType.DISCONNECT:this.ondisconnect();break;case t.PacketType.CONNECT_ERROR:this.destroy();const d=new Error(c.data.message);d.data=c.data.data,this.emitReserved("connect_error",d);break}}onevent(c){const a=c.data||[];o("emitting event %j",a),c.id!=null&&(o("attaching ack callback to event"),a.push(this.ack(c.id))),this.connected?this.emitEvent(a):this.receiveBuffer.push(Object.freeze(a))}emitEvent(c){if(this._anyListeners&&this._anyListeners.length){const a=this._anyListeners.slice();for(const d of a)d.apply(this,c)}super.emit.apply(this,c),this._pid&&c.length&&typeof c[c.length-1]=="string"&&(this._lastOffset=c[c.length-1])}ack(c){const a=this;let d=!1;return function(...f){d||(d=!0,o("sending ack %j",f),a.packet({type:t.PacketType.ACK,id:c,data:f}))}}onack(c){const a=this.acks[c.id];typeof a=="function"?(o("calling ack %s with %j",c.id,c.data),a.apply(this,c.data),delete this.acks[c.id]):o("bad ack %s",c.id)}onconnect(c,a){o("socket connected with id %s",c),this.id=c,this.recovered=a&&this._pid===a,this._pid=a,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(c=>this.emitEvent(c)),this.receiveBuffer=[],this.sendBuffer.forEach(c=>{this.notifyOutgoingListeners(c),this.packet(c)}),this.sendBuffer=[]}ondisconnect(){o("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(c=>c()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(o("performing disconnect (%s)",this.nsp),this.packet({type:t.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(c){return this.flags.compress=c,this}get volatile(){return this.flags.volatile=!0,this}timeout(c){return this.flags.timeout=c,this}onAny(c){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(c),this}prependAny(c){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(c),this}offAny(c){if(!this._anyListeners)return this;if(c){const a=this._anyListeners;for(let d=0;d<a.length;d++)if(c===a[d])return a.splice(d,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(c){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(c),this}prependAnyOutgoing(c){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(c),this}offAnyOutgoing(c){if(!this._anyOutgoingListeners)return this;if(c){const a=this._anyOutgoingListeners;for(let d=0;d<a.length;d++)if(c===a[d])return a.splice(d,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(c){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const a=this._anyOutgoingListeners.slice();for(const d of a)d.apply(this,c.data)}}}return Rr.Socket=i,Rr}var Nr={},pu;function uv(){if(pu)return Nr;pu=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.Backoff=void 0;function e(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}return Nr.Backoff=e,e.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),r=Math.floor(n*this.jitter*t);t=Math.floor(n*10)&1?t+r:t-r}return Math.min(t,this.max)|0},e.prototype.reset=function(){this.attempts=0},e.prototype.setMin=function(t){this.ms=t},e.prototype.setMax=function(t){this.max=t},e.prototype.setJitter=function(t){this.jitter=t},Nr}var hu;function lv(){if(hu)return Ar;hu=1;var e=ce&&ce.__createBinding||(Object.create?function(p,h,y,_){_===void 0&&(_=y),Object.defineProperty(p,_,{enumerable:!0,get:function(){return h[y]}})}:function(p,h,y,_){_===void 0&&(_=y),p[_]=h[y]}),t=ce&&ce.__setModuleDefault||(Object.create?function(p,h){Object.defineProperty(p,"default",{enumerable:!0,value:h})}:function(p,h){p.default=h}),n=ce&&ce.__importStar||function(p){if(p&&p.__esModule)return p;var h={};if(p!=null)for(var y in p)y!=="default"&&Object.prototype.hasOwnProperty.call(p,y)&&e(h,p,y);return t(h,p),h},r=ce&&ce.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.Manager=void 0;const s=Ef(),o=Sf(),l=n(Ea()),i=bf(),u=uv(),c=tr,d=r(ut()).default("socket.io-client:manager");class f extends c.Emitter{constructor(h,y){var _;super(),this.nsps={},this.subs=[],h&&typeof h=="object"&&(y=h,h=void 0),y=y||{},y.path=y.path||"/socket.io",this.opts=y,s.installTimerFunctions(this,y),this.reconnection(y.reconnection!==!1),this.reconnectionAttempts(y.reconnectionAttempts||1/0),this.reconnectionDelay(y.reconnectionDelay||1e3),this.reconnectionDelayMax(y.reconnectionDelayMax||5e3),this.randomizationFactor((_=y.randomizationFactor)!==null&&_!==void 0?_:.5),this.backoff=new u.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(y.timeout==null?2e4:y.timeout),this._readyState="closed",this.uri=h;const S=y.parser||l;this.encoder=new S.Encoder,this.decoder=new S.Decoder,this._autoConnect=y.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(h){return arguments.length?(this._reconnection=!!h,this):this._reconnection}reconnectionAttempts(h){return h===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=h,this)}reconnectionDelay(h){var y;return h===void 0?this._reconnectionDelay:(this._reconnectionDelay=h,(y=this.backoff)===null||y===void 0||y.setMin(h),this)}randomizationFactor(h){var y;return h===void 0?this._randomizationFactor:(this._randomizationFactor=h,(y=this.backoff)===null||y===void 0||y.setJitter(h),this)}reconnectionDelayMax(h){var y;return h===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=h,(y=this.backoff)===null||y===void 0||y.setMax(h),this)}timeout(h){return arguments.length?(this._timeout=h,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(h){if(d("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;d("opening %s",this.uri),this.engine=new s.Socket(this.uri,this.opts);const y=this.engine,_=this;this._readyState="opening",this.skipReconnect=!1;const S=i.on(y,"open",function(){_.onopen(),h&&h()}),v=x=>{d("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",x),h?h(x):this.maybeReconnectOnOpen()},w=i.on(y,"error",v);if(this._timeout!==!1){const x=this._timeout;d("connect attempt will timeout after %d",x);const O=this.setTimeoutFn(()=>{d("connect attempt timed out after %d",x),S(),v(new Error("timeout")),y.close()},x);this.opts.autoUnref&&O.unref(),this.subs.push(()=>{this.clearTimeoutFn(O)})}return this.subs.push(S),this.subs.push(w),this}connect(h){return this.open(h)}onopen(){d("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const h=this.engine;this.subs.push(i.on(h,"ping",this.onping.bind(this)),i.on(h,"data",this.ondata.bind(this)),i.on(h,"error",this.onerror.bind(this)),i.on(h,"close",this.onclose.bind(this)),i.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(h){try{this.decoder.add(h)}catch(y){this.onclose("parse error",y)}}ondecoded(h){s.nextTick(()=>{this.emitReserved("packet",h)},this.setTimeoutFn)}onerror(h){d("error",h),this.emitReserved("error",h)}socket(h,y){let _=this.nsps[h];return _?this._autoConnect&&!_.active&&_.connect():(_=new o.Socket(this,h,y),this.nsps[h]=_),_}_destroy(h){const y=Object.keys(this.nsps);for(const _ of y)if(this.nsps[_].active){d("socket %s is still active, skipping close",_);return}this._close()}_packet(h){d("writing packet %j",h);const y=this.encoder.encode(h);for(let _=0;_<y.length;_++)this.engine.write(y[_],h.options)}cleanup(){d("cleanup"),this.subs.forEach(h=>h()),this.subs.length=0,this.decoder.destroy()}_close(){d("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(h,y){d("closed due to %s",h),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",h,y),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const h=this;if(this.backoff.attempts>=this._reconnectionAttempts)d("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const y=this.backoff.duration();d("will wait %dms before reconnect attempt",y),this._reconnecting=!0;const _=this.setTimeoutFn(()=>{h.skipReconnect||(d("attempting reconnect"),this.emitReserved("reconnect_attempt",h.backoff.attempts),!h.skipReconnect&&h.open(S=>{S?(d("reconnect attempt error"),h._reconnecting=!1,h.reconnect(),this.emitReserved("reconnect_error",S)):(d("reconnect success"),h.onreconnect())}))},y);this.opts.autoUnref&&_.unref(),this.subs.push(()=>{this.clearTimeoutFn(_)})}}onreconnect(){const h=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",h)}}return Ar.Manager=f,Ar}var mu;function fv(){return mu||(mu=1,function(e,t){var n=ce&&ce.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const r=sv(),s=lv();Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return s.Manager}});const o=Sf();Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return o.Socket}});const i=n(ut()).default("socket.io-client"),u={};function c(d,f){typeof d=="object"&&(f=d,d=void 0),f=f||{};const p=r.url(d,f.path||"/socket.io"),h=p.source,y=p.id,_=p.path,S=u[y]&&_ in u[y].nsps,v=f.forceNew||f["force new connection"]||f.multiplex===!1||S;let w;return v?(i("ignoring socket cache for %s",h),w=new s.Manager(h,f)):(u[y]||(i("new io instance for %s",h),u[y]=new s.Manager(h,f)),w=u[y]),p.query&&!f.query&&(f.query=p.queryKey),w.socket(p.path,f)}t.io=c,t.connect=c,t.default=c,Object.assign(c,{Manager:s.Manager,Socket:o.Socket,io:c,connect:c});var a=Ea();Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return a.protocol}}),e.exports=c}(On,On.exports)),On.exports}var Ao={},Pr={},gu;function dv(){if(gu)return Pr;gu=1,Pr.byteLength=i,Pr.toByteArray=c,Pr.fromByteArray=f;for(var e=[],t=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=r.length;s<o;++s)e[s]=r[s],t[r.charCodeAt(s)]=s;t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;function l(p){var h=p.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=p.indexOf("=");y===-1&&(y=h);var _=y===h?0:4-y%4;return[y,_]}function i(p){var h=l(p),y=h[0],_=h[1];return(y+_)*3/4-_}function u(p,h,y){return(h+y)*3/4-y}function c(p){var h,y=l(p),_=y[0],S=y[1],v=new n(u(p,_,S)),w=0,x=S>0?_-4:_,O;for(O=0;O<x;O+=4)h=t[p.charCodeAt(O)]<<18|t[p.charCodeAt(O+1)]<<12|t[p.charCodeAt(O+2)]<<6|t[p.charCodeAt(O+3)],v[w++]=h>>16&255,v[w++]=h>>8&255,v[w++]=h&255;return S===2&&(h=t[p.charCodeAt(O)]<<2|t[p.charCodeAt(O+1)]>>4,v[w++]=h&255),S===1&&(h=t[p.charCodeAt(O)]<<10|t[p.charCodeAt(O+1)]<<4|t[p.charCodeAt(O+2)]>>2,v[w++]=h>>8&255,v[w++]=h&255),v}function a(p){return e[p>>18&63]+e[p>>12&63]+e[p>>6&63]+e[p&63]}function d(p,h,y){for(var _,S=[],v=h;v<y;v+=3)_=(p[v]<<16&16711680)+(p[v+1]<<8&65280)+(p[v+2]&255),S.push(a(_));return S.join("")}function f(p){for(var h,y=p.length,_=y%3,S=[],v=16383,w=0,x=y-_;w<x;w+=v)S.push(d(p,w,w+v>x?x:w+v));return _===1?(h=p[y-1],S.push(e[h>>2]+e[h<<4&63]+"==")):_===2&&(h=(p[y-2]<<8)+p[y-1],S.push(e[h>>10]+e[h>>4&63]+e[h<<2&63]+"=")),S.join("")}return Pr}var xn={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var yu;function pv(){return yu||(yu=1,xn.read=function(e,t,n,r,s){var o,l,i=s*8-r-1,u=(1<<i)-1,c=u>>1,a=-7,d=n?s-1:0,f=n?-1:1,p=e[t+d];for(d+=f,o=p&(1<<-a)-1,p>>=-a,a+=i;a>0;o=o*256+e[t+d],d+=f,a-=8);for(l=o&(1<<-a)-1,o>>=-a,a+=r;a>0;l=l*256+e[t+d],d+=f,a-=8);if(o===0)o=1-c;else{if(o===u)return l?NaN:(p?-1:1)*(1/0);l=l+Math.pow(2,r),o=o-c}return(p?-1:1)*l*Math.pow(2,o-r)},xn.write=function(e,t,n,r,s,o){var l,i,u,c=o*8-s-1,a=(1<<c)-1,d=a>>1,f=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,y=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,l=a):(l=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-l))<1&&(l--,u*=2),l+d>=1?t+=f/u:t+=f*Math.pow(2,1-d),t*u>=2&&(l++,u/=2),l+d>=a?(i=0,l=a):l+d>=1?(i=(t*u-1)*Math.pow(2,s),l=l+d):(i=t*Math.pow(2,d-1)*Math.pow(2,s),l=0));s>=8;e[n+p]=i&255,p+=h,i/=256,s-=8);for(l=l<<s|i,c+=s;c>0;e[n+p]=l&255,p+=h,l/=256,c-=8);e[n+p-h]|=y*128}),xn}/*!
|
|
64
64
|
* The buffer module from node.js, for the browser.
|
|
65
65
|
*
|
|
66
66
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
67
67
|
* @license MIT
|
|
68
|
-
*/var yu;function pv(){return yu||(yu=1,function(e){const t=fv(),n=dv(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=i,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;const s=2147483647;e.kMaxLength=s,i.TYPED_ARRAY_SUPPORT=o(),!i.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 b=new Uint8Array(1),m={foo:function(){return 42}};return Object.setPrototypeOf(m,Uint8Array.prototype),Object.setPrototypeOf(b,m),b.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function l(b){if(b>s)throw new RangeError('The value "'+b+'" is invalid for option "size"');const m=new Uint8Array(b);return Object.setPrototypeOf(m,i.prototype),m}function i(b,m,g){if(typeof b=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(b)}return u(b,m,g)}i.poolSize=8192;function u(b,m,g){if(typeof b=="string")return f(b,m);if(ArrayBuffer.isView(b))return h(b);if(b==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b);if(Me(b,ArrayBuffer)||b&&Me(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Me(b,SharedArrayBuffer)||b&&Me(b.buffer,SharedArrayBuffer)))return y(b,m,g);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=b.valueOf&&b.valueOf();if(T!=null&&T!==b)return i.from(T,m,g);const N=_(b);if(N)return N;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof b[Symbol.toPrimitive]=="function")return i.from(b[Symbol.toPrimitive]("string"),m,g);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b)}i.from=function(b,m,g){return u(b,m,g)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function c(b){if(typeof b!="number")throw new TypeError('"size" argument must be of type number');if(b<0)throw new RangeError('The value "'+b+'" is invalid for option "size"')}function a(b,m,g){return c(b),b<=0?l(b):m!==void 0?typeof g=="string"?l(b).fill(m,g):l(b).fill(m):l(b)}i.alloc=function(b,m,g){return a(b,m,g)};function d(b){return c(b),l(b<0?0:S(b)|0)}i.allocUnsafe=function(b){return d(b)},i.allocUnsafeSlow=function(b){return d(b)};function f(b,m){if((typeof m!="string"||m==="")&&(m="utf8"),!i.isEncoding(m))throw new TypeError("Unknown encoding: "+m);const g=w(b,m)|0;let T=l(g);const N=T.write(b,m);return N!==g&&(T=T.slice(0,N)),T}function p(b){const m=b.length<0?0:S(b.length)|0,g=l(m);for(let T=0;T<m;T+=1)g[T]=b[T]&255;return g}function h(b){if(Me(b,Uint8Array)){const m=new Uint8Array(b);return y(m.buffer,m.byteOffset,m.byteLength)}return p(b)}function y(b,m,g){if(m<0||b.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(b.byteLength<m+(g||0))throw new RangeError('"length" is outside of buffer bounds');let T;return m===void 0&&g===void 0?T=new Uint8Array(b):g===void 0?T=new Uint8Array(b,m):T=new Uint8Array(b,m,g),Object.setPrototypeOf(T,i.prototype),T}function _(b){if(i.isBuffer(b)){const m=S(b.length)|0,g=l(m);return g.length===0||b.copy(g,0,0,m),g}if(b.length!==void 0)return typeof b.length!="number"||_t(b.length)?l(0):p(b);if(b.type==="Buffer"&&Array.isArray(b.data))return p(b.data)}function S(b){if(b>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return b|0}function v(b){return+b!=b&&(b=0),i.alloc(+b)}i.isBuffer=function(m){return m!=null&&m._isBuffer===!0&&m!==i.prototype},i.compare=function(m,g){if(Me(m,Uint8Array)&&(m=i.from(m,m.offset,m.byteLength)),Me(g,Uint8Array)&&(g=i.from(g,g.offset,g.byteLength)),!i.isBuffer(m)||!i.isBuffer(g))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===g)return 0;let T=m.length,N=g.length;for(let M=0,H=Math.min(T,N);M<H;++M)if(m[M]!==g[M]){T=m[M],N=g[M];break}return T<N?-1:N<T?1:0},i.isEncoding=function(m){switch(String(m).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}},i.concat=function(m,g){if(!Array.isArray(m))throw new TypeError('"list" argument must be an Array of Buffers');if(m.length===0)return i.alloc(0);let T;if(g===void 0)for(g=0,T=0;T<m.length;++T)g+=m[T].length;const N=i.allocUnsafe(g);let M=0;for(T=0;T<m.length;++T){let H=m[T];if(Me(H,Uint8Array))M+H.length>N.length?(i.isBuffer(H)||(H=i.from(H)),H.copy(N,M)):Uint8Array.prototype.set.call(N,H,M);else if(i.isBuffer(H))H.copy(N,M);else throw new TypeError('"list" argument must be an Array of Buffers');M+=H.length}return N};function w(b,m){if(i.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||Me(b,ArrayBuffer))return b.byteLength;if(typeof b!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof b);const g=b.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&g===0)return 0;let N=!1;for(;;)switch(m){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":return je(b).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return Mt(b).length;default:if(N)return T?-1:je(b).length;m=(""+m).toLowerCase(),N=!0}}i.byteLength=w;function x(b,m,g){let T=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,m>>>=0,g<=m))return"";for(b||(b="utf8");;)switch(b){case"hex":return oe(this,m,g);case"utf8":case"utf-8":return K(this,m,g);case"ascii":return q(this,m,g);case"latin1":case"binary":return Y(this,m,g);case"base64":return $(this,m,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,m,g);default:if(T)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),T=!0}}i.prototype._isBuffer=!0;function O(b,m,g){const T=b[m];b[m]=b[g],b[g]=T}i.prototype.swap16=function(){const m=this.length;if(m%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let g=0;g<m;g+=2)O(this,g,g+1);return this},i.prototype.swap32=function(){const m=this.length;if(m%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let g=0;g<m;g+=4)O(this,g,g+3),O(this,g+1,g+2);return this},i.prototype.swap64=function(){const m=this.length;if(m%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let g=0;g<m;g+=8)O(this,g,g+7),O(this,g+1,g+6),O(this,g+2,g+5),O(this,g+3,g+4);return this},i.prototype.toString=function(){const m=this.length;return m===0?"":arguments.length===0?K(this,0,m):x.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(m){if(!i.isBuffer(m))throw new TypeError("Argument must be a Buffer");return this===m?!0:i.compare(this,m)===0},i.prototype.inspect=function(){let m="";const g=e.INSPECT_MAX_BYTES;return m=this.toString("hex",0,g).replace(/(.{2})/g,"$1 ").trim(),this.length>g&&(m+=" ... "),"<Buffer "+m+">"},r&&(i.prototype[r]=i.prototype.inspect),i.prototype.compare=function(m,g,T,N,M){if(Me(m,Uint8Array)&&(m=i.from(m,m.offset,m.byteLength)),!i.isBuffer(m))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof m);if(g===void 0&&(g=0),T===void 0&&(T=m?m.length:0),N===void 0&&(N=0),M===void 0&&(M=this.length),g<0||T>m.length||N<0||M>this.length)throw new RangeError("out of range index");if(N>=M&&g>=T)return 0;if(N>=M)return-1;if(g>=T)return 1;if(g>>>=0,T>>>=0,N>>>=0,M>>>=0,this===m)return 0;let H=M-N,le=T-g;const be=Math.min(H,le),_e=this.slice(N,M),Se=m.slice(g,T);for(let me=0;me<be;++me)if(_e[me]!==Se[me]){H=_e[me],le=Se[me];break}return H<le?-1:le<H?1:0};function F(b,m,g,T,N){if(b.length===0)return-1;if(typeof g=="string"?(T=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,_t(g)&&(g=N?0:b.length-1),g<0&&(g=b.length+g),g>=b.length){if(N)return-1;g=b.length-1}else if(g<0)if(N)g=0;else return-1;if(typeof m=="string"&&(m=i.from(m,T)),i.isBuffer(m))return m.length===0?-1:D(b,m,g,T,N);if(typeof m=="number")return m=m&255,typeof Uint8Array.prototype.indexOf=="function"?N?Uint8Array.prototype.indexOf.call(b,m,g):Uint8Array.prototype.lastIndexOf.call(b,m,g):D(b,[m],g,T,N);throw new TypeError("val must be string, number or Buffer")}function D(b,m,g,T,N){let M=1,H=b.length,le=m.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(b.length<2||m.length<2)return-1;M=2,H/=2,le/=2,g/=2}function be(Se,me){return M===1?Se[me]:Se.readUInt16BE(me*M)}let _e;if(N){let Se=-1;for(_e=g;_e<H;_e++)if(be(b,_e)===be(m,Se===-1?0:_e-Se)){if(Se===-1&&(Se=_e),_e-Se+1===le)return Se*M}else Se!==-1&&(_e-=_e-Se),Se=-1}else for(g+le>H&&(g=H-le),_e=g;_e>=0;_e--){let Se=!0;for(let me=0;me<le;me++)if(be(b,_e+me)!==be(m,me)){Se=!1;break}if(Se)return _e}return-1}i.prototype.includes=function(m,g,T){return this.indexOf(m,g,T)!==-1},i.prototype.indexOf=function(m,g,T){return F(this,m,g,T,!0)},i.prototype.lastIndexOf=function(m,g,T){return F(this,m,g,T,!1)};function R(b,m,g,T){g=Number(g)||0;const N=b.length-g;T?(T=Number(T),T>N&&(T=N)):T=N;const M=m.length;T>M/2&&(T=M/2);let H;for(H=0;H<T;++H){const le=parseInt(m.substr(H*2,2),16);if(_t(le))return H;b[g+H]=le}return H}function W(b,m,g,T){return vt(je(m,b.length-g),b,g,T)}function V(b,m,g,T){return vt(Xe(m),b,g,T)}function L(b,m,g,T){return vt(Mt(m),b,g,T)}function U(b,m,g,T){return vt(rt(m,b.length-g),b,g,T)}i.prototype.write=function(m,g,T,N){if(g===void 0)N="utf8",T=this.length,g=0;else if(T===void 0&&typeof g=="string")N=g,T=this.length,g=0;else if(isFinite(g))g=g>>>0,isFinite(T)?(T=T>>>0,N===void 0&&(N="utf8")):(N=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const M=this.length-g;if((T===void 0||T>M)&&(T=M),m.length>0&&(T<0||g<0)||g>this.length)throw new RangeError("Attempt to write outside buffer bounds");N||(N="utf8");let H=!1;for(;;)switch(N){case"hex":return R(this,m,g,T);case"utf8":case"utf-8":return W(this,m,g,T);case"ascii":case"latin1":case"binary":return V(this,m,g,T);case"base64":return L(this,m,g,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,m,g,T);default:if(H)throw new TypeError("Unknown encoding: "+N);N=(""+N).toLowerCase(),H=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(b,m,g){return m===0&&g===b.length?t.fromByteArray(b):t.fromByteArray(b.slice(m,g))}function K(b,m,g){g=Math.min(b.length,g);const T=[];let N=m;for(;N<g;){const M=b[N];let H=null,le=M>239?4:M>223?3:M>191?2:1;if(N+le<=g){let be,_e,Se,me;switch(le){case 1:M<128&&(H=M);break;case 2:be=b[N+1],(be&192)===128&&(me=(M&31)<<6|be&63,me>127&&(H=me));break;case 3:be=b[N+1],_e=b[N+2],(be&192)===128&&(_e&192)===128&&(me=(M&15)<<12|(be&63)<<6|_e&63,me>2047&&(me<55296||me>57343)&&(H=me));break;case 4:be=b[N+1],_e=b[N+2],Se=b[N+3],(be&192)===128&&(_e&192)===128&&(Se&192)===128&&(me=(M&15)<<18|(be&63)<<12|(_e&63)<<6|Se&63,me>65535&&me<1114112&&(H=me))}}H===null?(H=65533,le=1):H>65535&&(H-=65536,T.push(H>>>10&1023|55296),H=56320|H&1023),T.push(H),N+=le}return C(T)}const Q=4096;function C(b){const m=b.length;if(m<=Q)return String.fromCharCode.apply(String,b);let g="",T=0;for(;T<m;)g+=String.fromCharCode.apply(String,b.slice(T,T+=Q));return g}function q(b,m,g){let T="";g=Math.min(b.length,g);for(let N=m;N<g;++N)T+=String.fromCharCode(b[N]&127);return T}function Y(b,m,g){let T="";g=Math.min(b.length,g);for(let N=m;N<g;++N)T+=String.fromCharCode(b[N]);return T}function oe(b,m,g){const T=b.length;(!m||m<0)&&(m=0),(!g||g<0||g>T)&&(g=T);let N="";for(let M=m;M<g;++M)N+=Dt[b[M]];return N}function ee(b,m,g){const T=b.slice(m,g);let N="";for(let M=0;M<T.length-1;M+=2)N+=String.fromCharCode(T[M]+T[M+1]*256);return N}i.prototype.slice=function(m,g){const T=this.length;m=~~m,g=g===void 0?T:~~g,m<0?(m+=T,m<0&&(m=0)):m>T&&(m=T),g<0?(g+=T,g<0&&(g=0)):g>T&&(g=T),g<m&&(g=m);const N=this.subarray(m,g);return Object.setPrototypeOf(N,i.prototype),N};function G(b,m,g){if(b%1!==0||b<0)throw new RangeError("offset is not uint");if(b+m>g)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(m,g,T){m=m>>>0,g=g>>>0,T||G(m,g,this.length);let N=this[m],M=1,H=0;for(;++H<g&&(M*=256);)N+=this[m+H]*M;return N},i.prototype.readUintBE=i.prototype.readUIntBE=function(m,g,T){m=m>>>0,g=g>>>0,T||G(m,g,this.length);let N=this[m+--g],M=1;for(;g>0&&(M*=256);)N+=this[m+--g]*M;return N},i.prototype.readUint8=i.prototype.readUInt8=function(m,g){return m=m>>>0,g||G(m,1,this.length),this[m]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(m,g){return m=m>>>0,g||G(m,2,this.length),this[m]|this[m+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(m,g){return m=m>>>0,g||G(m,2,this.length),this[m]<<8|this[m+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(m,g){return m=m>>>0,g||G(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+this[m+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(m,g){return m=m>>>0,g||G(m,4,this.length),this[m]*16777216+(this[m+1]<<16|this[m+2]<<8|this[m+3])},i.prototype.readBigUInt64LE=Ke(function(m){m=m>>>0,Ge(m,"offset");const g=this[m],T=this[m+7];(g===void 0||T===void 0)&&qe(m,this.length-8);const N=g+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24,M=this[++m]+this[++m]*2**8+this[++m]*2**16+T*2**24;return BigInt(N)+(BigInt(M)<<BigInt(32))}),i.prototype.readBigUInt64BE=Ke(function(m){m=m>>>0,Ge(m,"offset");const g=this[m],T=this[m+7];(g===void 0||T===void 0)&&qe(m,this.length-8);const N=g*2**24+this[++m]*2**16+this[++m]*2**8+this[++m],M=this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+T;return(BigInt(N)<<BigInt(32))+BigInt(M)}),i.prototype.readIntLE=function(m,g,T){m=m>>>0,g=g>>>0,T||G(m,g,this.length);let N=this[m],M=1,H=0;for(;++H<g&&(M*=256);)N+=this[m+H]*M;return M*=128,N>=M&&(N-=Math.pow(2,8*g)),N},i.prototype.readIntBE=function(m,g,T){m=m>>>0,g=g>>>0,T||G(m,g,this.length);let N=g,M=1,H=this[m+--N];for(;N>0&&(M*=256);)H+=this[m+--N]*M;return M*=128,H>=M&&(H-=Math.pow(2,8*g)),H},i.prototype.readInt8=function(m,g){return m=m>>>0,g||G(m,1,this.length),this[m]&128?(255-this[m]+1)*-1:this[m]},i.prototype.readInt16LE=function(m,g){m=m>>>0,g||G(m,2,this.length);const T=this[m]|this[m+1]<<8;return T&32768?T|4294901760:T},i.prototype.readInt16BE=function(m,g){m=m>>>0,g||G(m,2,this.length);const T=this[m+1]|this[m]<<8;return T&32768?T|4294901760:T},i.prototype.readInt32LE=function(m,g){return m=m>>>0,g||G(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},i.prototype.readInt32BE=function(m,g){return m=m>>>0,g||G(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},i.prototype.readBigInt64LE=Ke(function(m){m=m>>>0,Ge(m,"offset");const g=this[m],T=this[m+7];(g===void 0||T===void 0)&&qe(m,this.length-8);const N=this[m+4]+this[m+5]*2**8+this[m+6]*2**16+(T<<24);return(BigInt(N)<<BigInt(32))+BigInt(g+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24)}),i.prototype.readBigInt64BE=Ke(function(m){m=m>>>0,Ge(m,"offset");const g=this[m],T=this[m+7];(g===void 0||T===void 0)&&qe(m,this.length-8);const N=(g<<24)+this[++m]*2**16+this[++m]*2**8+this[++m];return(BigInt(N)<<BigInt(32))+BigInt(this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+T)}),i.prototype.readFloatLE=function(m,g){return m=m>>>0,g||G(m,4,this.length),n.read(this,m,!0,23,4)},i.prototype.readFloatBE=function(m,g){return m=m>>>0,g||G(m,4,this.length),n.read(this,m,!1,23,4)},i.prototype.readDoubleLE=function(m,g){return m=m>>>0,g||G(m,8,this.length),n.read(this,m,!0,52,8)},i.prototype.readDoubleBE=function(m,g){return m=m>>>0,g||G(m,8,this.length),n.read(this,m,!1,52,8)};function Z(b,m,g,T,N,M){if(!i.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>N||m<M)throw new RangeError('"value" argument is out of bounds');if(g+T>b.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(m,g,T,N){if(m=+m,g=g>>>0,T=T>>>0,!N){const le=Math.pow(2,8*T)-1;Z(this,m,g,T,le,0)}let M=1,H=0;for(this[g]=m&255;++H<T&&(M*=256);)this[g+H]=m/M&255;return g+T},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(m,g,T,N){if(m=+m,g=g>>>0,T=T>>>0,!N){const le=Math.pow(2,8*T)-1;Z(this,m,g,T,le,0)}let M=T-1,H=1;for(this[g+M]=m&255;--M>=0&&(H*=256);)this[g+M]=m/H&255;return g+T},i.prototype.writeUint8=i.prototype.writeUInt8=function(m,g,T){return m=+m,g=g>>>0,T||Z(this,m,g,1,255,0),this[g]=m&255,g+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(m,g,T){return m=+m,g=g>>>0,T||Z(this,m,g,2,65535,0),this[g]=m&255,this[g+1]=m>>>8,g+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(m,g,T){return m=+m,g=g>>>0,T||Z(this,m,g,2,65535,0),this[g]=m>>>8,this[g+1]=m&255,g+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(m,g,T){return m=+m,g=g>>>0,T||Z(this,m,g,4,4294967295,0),this[g+3]=m>>>24,this[g+2]=m>>>16,this[g+1]=m>>>8,this[g]=m&255,g+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(m,g,T){return m=+m,g=g>>>0,T||Z(this,m,g,4,4294967295,0),this[g]=m>>>24,this[g+1]=m>>>16,this[g+2]=m>>>8,this[g+3]=m&255,g+4};function ae(b,m,g,T,N){tt(m,T,N,b,g,7);let M=Number(m&BigInt(4294967295));b[g++]=M,M=M>>8,b[g++]=M,M=M>>8,b[g++]=M,M=M>>8,b[g++]=M;let H=Number(m>>BigInt(32)&BigInt(4294967295));return b[g++]=H,H=H>>8,b[g++]=H,H=H>>8,b[g++]=H,H=H>>8,b[g++]=H,g}function Oe(b,m,g,T,N){tt(m,T,N,b,g,7);let M=Number(m&BigInt(4294967295));b[g+7]=M,M=M>>8,b[g+6]=M,M=M>>8,b[g+5]=M,M=M>>8,b[g+4]=M;let H=Number(m>>BigInt(32)&BigInt(4294967295));return b[g+3]=H,H=H>>8,b[g+2]=H,H=H>>8,b[g+1]=H,H=H>>8,b[g]=H,g+8}i.prototype.writeBigUInt64LE=Ke(function(m,g=0){return ae(this,m,g,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=Ke(function(m,g=0){return Oe(this,m,g,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(m,g,T,N){if(m=+m,g=g>>>0,!N){const be=Math.pow(2,8*T-1);Z(this,m,g,T,be-1,-be)}let M=0,H=1,le=0;for(this[g]=m&255;++M<T&&(H*=256);)m<0&&le===0&&this[g+M-1]!==0&&(le=1),this[g+M]=(m/H>>0)-le&255;return g+T},i.prototype.writeIntBE=function(m,g,T,N){if(m=+m,g=g>>>0,!N){const be=Math.pow(2,8*T-1);Z(this,m,g,T,be-1,-be)}let M=T-1,H=1,le=0;for(this[g+M]=m&255;--M>=0&&(H*=256);)m<0&&le===0&&this[g+M+1]!==0&&(le=1),this[g+M]=(m/H>>0)-le&255;return g+T},i.prototype.writeInt8=function(m,g,T){return m=+m,g=g>>>0,T||Z(this,m,g,1,127,-128),m<0&&(m=255+m+1),this[g]=m&255,g+1},i.prototype.writeInt16LE=function(m,g,T){return m=+m,g=g>>>0,T||Z(this,m,g,2,32767,-32768),this[g]=m&255,this[g+1]=m>>>8,g+2},i.prototype.writeInt16BE=function(m,g,T){return m=+m,g=g>>>0,T||Z(this,m,g,2,32767,-32768),this[g]=m>>>8,this[g+1]=m&255,g+2},i.prototype.writeInt32LE=function(m,g,T){return m=+m,g=g>>>0,T||Z(this,m,g,4,2147483647,-2147483648),this[g]=m&255,this[g+1]=m>>>8,this[g+2]=m>>>16,this[g+3]=m>>>24,g+4},i.prototype.writeInt32BE=function(m,g,T){return m=+m,g=g>>>0,T||Z(this,m,g,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[g]=m>>>24,this[g+1]=m>>>16,this[g+2]=m>>>8,this[g+3]=m&255,g+4},i.prototype.writeBigInt64LE=Ke(function(m,g=0){return ae(this,m,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=Ke(function(m,g=0){return Oe(this,m,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ie(b,m,g,T,N,M){if(g+T>b.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function re(b,m,g,T,N){return m=+m,g=g>>>0,N||ie(b,m,g,4),n.write(b,m,g,T,23,4),g+4}i.prototype.writeFloatLE=function(m,g,T){return re(this,m,g,!0,T)},i.prototype.writeFloatBE=function(m,g,T){return re(this,m,g,!1,T)};function te(b,m,g,T,N){return m=+m,g=g>>>0,N||ie(b,m,g,8),n.write(b,m,g,T,52,8),g+8}i.prototype.writeDoubleLE=function(m,g,T){return te(this,m,g,!0,T)},i.prototype.writeDoubleBE=function(m,g,T){return te(this,m,g,!1,T)},i.prototype.copy=function(m,g,T,N){if(!i.isBuffer(m))throw new TypeError("argument should be a Buffer");if(T||(T=0),!N&&N!==0&&(N=this.length),g>=m.length&&(g=m.length),g||(g=0),N>0&&N<T&&(N=T),N===T||m.length===0||this.length===0)return 0;if(g<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("sourceEnd out of bounds");N>this.length&&(N=this.length),m.length-g<N-T&&(N=m.length-g+T);const M=N-T;return this===m&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(g,T,N):Uint8Array.prototype.set.call(m,this.subarray(T,N),g),M},i.prototype.fill=function(m,g,T,N){if(typeof m=="string"){if(typeof g=="string"?(N=g,g=0,T=this.length):typeof T=="string"&&(N=T,T=this.length),N!==void 0&&typeof N!="string")throw new TypeError("encoding must be a string");if(typeof N=="string"&&!i.isEncoding(N))throw new TypeError("Unknown encoding: "+N);if(m.length===1){const H=m.charCodeAt(0);(N==="utf8"&&H<128||N==="latin1")&&(m=H)}}else typeof m=="number"?m=m&255:typeof m=="boolean"&&(m=Number(m));if(g<0||this.length<g||this.length<T)throw new RangeError("Out of range index");if(T<=g)return this;g=g>>>0,T=T===void 0?this.length:T>>>0,m||(m=0);let M;if(typeof m=="number")for(M=g;M<T;++M)this[M]=m;else{const H=i.isBuffer(m)?m:i.from(m,N),le=H.length;if(le===0)throw new TypeError('The value "'+m+'" is invalid for argument "value"');for(M=0;M<T-g;++M)this[M+g]=H[M%le]}return this};const we={};function Ne(b,m,g){we[b]=class extends g{constructor(){super(),Object.defineProperty(this,"message",{value:m.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${b}]`,this.stack,delete this.name}get code(){return b}set code(N){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:N,writable:!0})}toString(){return`${this.name} [${b}]: ${this.message}`}}}Ne("ERR_BUFFER_OUT_OF_BOUNDS",function(b){return b?`${b} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ne("ERR_INVALID_ARG_TYPE",function(b,m){return`The "${b}" argument must be of type number. Received type ${typeof m}`},TypeError),Ne("ERR_OUT_OF_RANGE",function(b,m,g){let T=`The value of "${b}" is out of range.`,N=g;return Number.isInteger(g)&&Math.abs(g)>2**32?N=$e(String(g)):typeof g=="bigint"&&(N=String(g),(g>BigInt(2)**BigInt(32)||g<-(BigInt(2)**BigInt(32)))&&(N=$e(N)),N+="n"),T+=` It must be ${m}. Received ${N}`,T},RangeError);function $e(b){let m="",g=b.length;const T=b[0]==="-"?1:0;for(;g>=T+4;g-=3)m=`_${b.slice(g-3,g)}${m}`;return`${b.slice(0,g)}${m}`}function Fe(b,m,g){Ge(m,"offset"),(b[m]===void 0||b[m+g]===void 0)&&qe(m,b.length-(g+1))}function tt(b,m,g,T,N,M){if(b>g||b<m){const H=typeof m=="bigint"?"n":"";let le;throw M>3?m===0||m===BigInt(0)?le=`>= 0${H} and < 2${H} ** ${(M+1)*8}${H}`:le=`>= -(2${H} ** ${(M+1)*8-1}${H}) and < 2 ** ${(M+1)*8-1}${H}`:le=`>= ${m}${H} and <= ${g}${H}`,new we.ERR_OUT_OF_RANGE("value",le,b)}Fe(T,N,M)}function Ge(b,m){if(typeof b!="number")throw new we.ERR_INVALID_ARG_TYPE(m,"number",b)}function qe(b,m,g){throw Math.floor(b)!==b?(Ge(b,g),new we.ERR_OUT_OF_RANGE(g||"offset","an integer",b)):m<0?new we.ERR_BUFFER_OUT_OF_BOUNDS:new we.ERR_OUT_OF_RANGE(g||"offset",`>= ${g?1:0} and <= ${m}`,b)}const Ve=/[^+/0-9A-Za-z-_]/g;function ve(b){if(b=b.split("=")[0],b=b.trim().replace(Ve,""),b.length<2)return"";for(;b.length%4!==0;)b=b+"=";return b}function je(b,m){m=m||1/0;let g;const T=b.length;let N=null;const M=[];for(let H=0;H<T;++H){if(g=b.charCodeAt(H),g>55295&&g<57344){if(!N){if(g>56319){(m-=3)>-1&&M.push(239,191,189);continue}else if(H+1===T){(m-=3)>-1&&M.push(239,191,189);continue}N=g;continue}if(g<56320){(m-=3)>-1&&M.push(239,191,189),N=g;continue}g=(N-55296<<10|g-56320)+65536}else N&&(m-=3)>-1&&M.push(239,191,189);if(N=null,g<128){if((m-=1)<0)break;M.push(g)}else if(g<2048){if((m-=2)<0)break;M.push(g>>6|192,g&63|128)}else if(g<65536){if((m-=3)<0)break;M.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((m-=4)<0)break;M.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return M}function Xe(b){const m=[];for(let g=0;g<b.length;++g)m.push(b.charCodeAt(g)&255);return m}function rt(b,m){let g,T,N;const M=[];for(let H=0;H<b.length&&!((m-=2)<0);++H)g=b.charCodeAt(H),T=g>>8,N=g%256,M.push(N),M.push(T);return M}function Mt(b){return t.toByteArray(ve(b))}function vt(b,m,g,T){let N;for(N=0;N<T&&!(N+g>=m.length||N>=b.length);++N)m[N+g]=b[N];return N}function Me(b,m){return b instanceof m||b!=null&&b.constructor!=null&&b.constructor.name!=null&&b.constructor.name===m.name}function _t(b){return b!==b}const Dt=function(){const b="0123456789abcdef",m=new Array(256);for(let g=0;g<16;++g){const T=g*16;for(let N=0;N<16;++N)m[T+N]=b[g]+b[N]}return m}();function Ke(b){return typeof BigInt>"u"?Ut:b}function Ut(){throw new Error("BigInt not supported")}}(Ao)),Ao}(function(e,t){(function(n,r){e.exports=r(by(),Ly(),Uy(),Du(),Vy,lv(),pv())})(ce,function(n,r,s,o,l,i,u){return function(){var c={809:function(p){p.exports=n},30:function(p){p.exports=r},36:function(p){p.exports=s},300:function(p){p.exports=o},408:function(p){p.exports=u},25:function(p){p.exports=l},130:function(p){p.exports=i}},a={};function d(p){var h=a[p];if(h!==void 0)return h.exports;var y=a[p]={exports:{}};return c[p](y,y.exports,d),y.exports}d.n=function(p){var h=p&&p.__esModule?function(){return p.default}:function(){return p};return d.d(h,{a:h}),h},d.d=function(p,h){for(var y in h)d.o(h,y)&&!d.o(p,y)&&Object.defineProperty(p,y,{enumerable:!0,get:h[y]})},d.o=function(p,h){return Object.prototype.hasOwnProperty.call(p,h)},d.r=function(p){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})};var f={};return function(){d.r(f),d.d(f,{assets:function(){return C},auth:function(){return G},buildAnswer:function(){return ap},buildCarouselCard:function(){return op},buildQuestion:function(){return Xd},carouselCards:function(){return Ma},contentInteraction:function(){return Ke},decodeBase64:function(){return cp},default:function(){return up},editorialPages:function(){return Vd},features:function(){return g},getEntries:function(){return p.getEntries},getEntry:function(){return p.getEntry},management:function(){return ir},payments:function(){return ei},people:function(){return Bt},peopleEngagement:function(){return Fa},qaQuestions:function(){return Ba},reportError:function(){return h.reportError},search:function(){return Bd}});var p=d(809),h=d(30),y=d(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:x},ENVIRONMENTS:{PRODUCTION:O,LOCAL:F}}}=_,{HUBSPOT:{ENVIRONMENTS_MAPPING:D,EMAIL_IDS:R}}=_;let W={emailIds:{}};var V=d(300),L=d.n(V);const U=async P=>{try{const{message:k,response:I,request:B}=P;let X=k;return I?X+=` - The request was made and the server responded with ${JSON.stringify({status:I.status,data:I.data})}`:B&&(X+=" - The request was made but no response was received"),console.warn(X),await(0,h.reportError)(new Error(X)),X}catch(k){return console.warn(`Cannot handle error: ${k.message}`),k.message}},{APIS:{ASSETS_API:{BASE_URL:$,ENDPOINTS:{USERS:K,CERTIFICATES:Q}}}}=_;var C={certificates:{create:async(P,k)=>{let I=[];try{const{data:B}=await L().post(`${$}${K}/${P}${Q}`,k);B&&(I=B)}catch(B){await U(B)}return I}}};const{APIS:{AUTH_API:{BASE_URL:q,ENDPOINTS:{USER_PASSWORD:Y,USERS:oe}}},USERS:{MYSELF:ee}}=_;var G={userPassword:{update:async P=>{let k=null;try{k=await L().put(`${q}${oe}/${ee}${Y}`,P)}catch(I){k={message:(((I||{}).response||{}).data||{}).message},await U(I)}return k}}};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:Z,ENDPOINTS:{ANSWERS:ae,QUESTIONS:Oe,LIKES:ie}}}}=_,re=`${Z}${Oe}`;var te={create:async({questionSlug:P},k)=>{try{await L().post(`${re}/${encodeURIComponent(P)}${ae}`,k)}catch(I){const B=await U(I);throw new Error(B)}},remove:async({questionSlug:P,answerSlug:k})=>{try{await L().delete(`${re}/${encodeURIComponent(P)}${ae}/${encodeURIComponent(k)}`)}catch(I){const B=await U(I);throw new Error(B)}},update:async({questionSlug:P,answerSlug:k},I)=>{try{return await L().put(`${re}/${encodeURIComponent(P)}${ae}/${encodeURIComponent(k)}`,I)}catch(B){const X=await U(B);throw new Error(X)}},like:async({questionSlug:P,answerSlug:k},I)=>{try{return await L().post(`${re}/${encodeURIComponent(P)}${ae}/${encodeURIComponent(k)}${ie}`,I)}catch(B){const X=await U(B);throw new Error(X)}},unlike:async({questionSlug:P,answerSlug:k})=>{try{return await L().delete(`${re}/${encodeURIComponent(P)}${ae}/${encodeURIComponent(k)}${ie}`)}catch(I){const B=await U(I);throw new Error(B)}}};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:we,ENDPOINTS:{QUESTIONS:Ne}}}}=_,$e=`${we}${Ne}`;var Fe={create:async P=>{try{return await L().post($e,P)}catch(k){const I=await U(k);throw new Error(I)}},remove:async({questionSlug:P})=>{try{await L().delete(`${$e}/${encodeURIComponent(P)}`)}catch(k){const I=await U(k);throw new Error(I)}},update:async({questionSlug:P},k)=>{try{return await L().put(`${$e}/${encodeURIComponent(P)}`,k)}catch(I){const B=await U(I);throw new Error(B)}}};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:tt,ENDPOINTS:{REPLIES:Ge,ANSWERS:qe,QUESTIONS:Ve,LIKES:ve}}}}=_,je=`${tt}${Ve}`,Xe=({questionSlug:P,answerSlug:k,replySlug:I},B=!1)=>{let X=`${je}/${encodeURIComponent(P)}${qe}/${encodeURIComponent(k)}${Ge}`;return I&&(X=`${X}/${encodeURIComponent(I)}`,B&&(X=`${X}${ve}`)),X};var rt={create:async({questionSlug:P,answerSlug:k},I)=>{try{return await L().post(Xe({questionSlug:P,answerSlug:k}),I)}catch(B){const X=await U(B);throw new Error(X)}},update:async({questionSlug:P,answerSlug:k,replySlug:I},B)=>{try{return await L().put(Xe({questionSlug:P,answerSlug:k,replySlug:I}),B)}catch(X){const ge=await U(X);throw new Error(ge)}},remove:async({questionSlug:P,answerSlug:k,replySlug:I})=>{try{await L().delete(Xe({questionSlug:P,answerSlug:k,replySlug:I}))}catch(B){const X=await U(B);throw new Error(X)}},like:async({questionSlug:P,answerSlug:k,replySlug:I},B)=>{try{await L().post(Xe({questionSlug:P,answerSlug:k,replySlug:I},!0),B)}catch(X){const ge=await U(X);throw new Error(ge)}},unlike:async({questionSlug:P,answerSlug:k,replySlug:I})=>{try{await L().delete(Xe({questionSlug:P,answerSlug:k,replySlug:I},!0))}catch(B){const X=await U(B);throw new Error(X)}},getReplyUrl:Xe};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:Mt,ENDPOINTS:{QUESTIONS:vt,ANSWERS:Me,LIKES:_t}}}}=_,Dt=`${Mt}${vt}`;var Ke={answers:te,questions:Fe,replies:rt,likes:{create:async(P,k)=>{try{return await L().post(`${Dt}/${encodeURIComponent(P)}${Me}/${encodeURIComponent(k)}${_t}`)}catch(I){const B=await U(I);throw new Error(B)}},remove:async(P,k)=>{try{return await L().delete(`${Dt}/${encodeURIComponent(P)}${Me}/${encodeURIComponent(k)}${_t}`)}catch(I){const B=await U(I);throw new Error(B)}}}};const{APIS:{FEATURES_API:{BASE_URL:Ut,ENDPOINTS:{FLAGS:b}}}}=_,m=`${Ut}${b}`;var g={flags:{read:async P=>{let k=null;try{const{data:I}=await L().get(`${m}/${encodeURIComponent(P)}`);I!=null&&I.name&&(I!=null&&I.featureState)&&(k=I)}catch(I){await U(I)}return k}}};const{APIS:{MANAGEMENT_API:{BASE_URL:T,ENDPOINTS:{ACCOUNTS:N}}}}=_;var M={create:async P=>{try{await L().post(`${T}${N}`,P)}catch(k){throw await U(k),k}},read:async P=>{let k=null;try{({data:k}=await L().get(`${T}${N}/${encodeURIComponent(P)}`))}catch(I){await U(I)}return k},update:async(P,k)=>{try{await L().put(`${T}${N}/${encodeURIComponent(P)}`,k)}catch(I){throw await U(I),I}}};const{APIS:{MANAGEMENT_API:{BASE_URL:H,ENDPOINTS:{BULK_ENROLMENTS:le}}}}=_;var be={create:async P=>{try{await L().post(`${H}${le}`,P)}catch(k){throw await U(k),k}}};const{APIS:{MANAGEMENT_API:{BASE_URL:_e,ENDPOINTS:{EVENT_REGISTRATIONS:Se}}}}=_;var me={create:async P=>{try{await L().post(`${_e}${Se}`,P)}catch(k){const I=await U(k);throw new Error(I)}}};const{APIS:{MANAGEMENT_API:{BASE_URL:rr,ENDPOINTS:{LOGINS:Jr,LOGIN_PASSWORDLESS:Et}}}}=_,nr=`${rr}${Jr}`;var ir={accounts:M,bulkEnrolments:be,eventRegistrations:me,passwordless:{update:async P=>{try{await L().put(`${nr}/${encodeURIComponent(P)}${Et}`)}catch(k){throw await U(k),k}}}};const{APIS:{PAYMENTS_API:{BASE_URL_V2:Xr,ENDPOINTS:{PRODUCTS:Zn}}}}=_,Zr=`${Xr}${Zn}`;var ei={products:{list:async P=>{let k=[],I=P?{params:P}:{params:{}};try{const{data:B}=await L().get(Zr,I);B&&B.length&&(k=B)}catch(B){await U(B)}return k}}};const{APIS:{PEOPLE_API:{BASE_URL_V2:en,ENDPOINTS:{BULK_ENROLMENTS:tn}}}}=_;var ti={list:async P=>{let k=[];try{const{data:I}=await L().get(`${en}${tn}`,{params:P});I&&I.length&&(k=I)}catch(I){await U(I)}return k}},ri=d(25);const{OK:rn,MULTIPLE_CHOICES:ni,NOT_FOUND:ii,FORBIDDEN:oi}=ri.StatusCodes,nn=P=>P>=rn&&P<ni||P===oi||P===ii,{APIS:{PEOPLE_API:{BASE_URL_V2:A,ENDPOINTS:{USERS:z}}}}=_,J=async P=>{let k=null;try{const{data:I}=await L().get(`${A}${z}/${encodeURIComponent(P)}`,{validateStatus:nn});I&&I.id&&(k=I)}catch(I){await U(I)}return k},se=async P=>{let k=[];try{if(P&&P.length<2)throw new Error("users list method requires at least two ids");const I=P.map(X=>`ids=${encodeURIComponent(X)}`).join("&"),B=await L().get(`${A}${z}?${I}`,{validateStatus:nn});B&&B.length&&(k=B)}catch(I){await U(I)}return k};var he={read:J,update:async(P,k)=>{let I=!1;try{const{data:B}=await L().put(`${A}${z}/${encodeURIComponent(P)}`,k);I=!(!B||!B.id)}catch(B){await U(B)}return I},list:se};const{APIS:{PEOPLE_API:{BASE_URL_V2:ye,ENDPOINTS:{USERS:de,USER_LIKES:fe}}},USERS:{MYSELF:De}}=_,Re=`${ye}${de}/${De}${fe}`,Ae=async P=>{let k=[],I=P?{params:P}:{params:{}};try{const{data:B}=await L().get(Re,I);B&&B.length&&(k=B)}catch(B){await U(B)}return k};var ze={list:Ae},wt={authors:{readQuestionAuthors:async(P,k,I)=>{try{if(P.author=await J(P.authorId),P.answers&&P.answers.length&&!I.ignoreAnswersAuthors){P.answers.sort((X,ge)=>new Date(ge.updatedAt)-new Date(X.updatedAt)),P.totalAnswers=P.answers.length;let B=P.answers;if(I.limit&&I.pageNumber){const X=I.limit*(I.pageNumber-1);B=P.answers.slice(X,X+I.limit)}for(let X of B){X.author=X.authorId&&await J(X.authorId)||{};const[ge]=k?await Ae({contentType:_.CONTENTFUL.ANSWERS.TYPE,contentSlug:X.slug}):[null];X.userLiked=!!ge}P.answers=B}else P.answers||(P.answers=[]);return P}catch(B){throw await U(B),new Error(`Cannot read authors for question: ${B.message}`)}},readAuthors:async(P=[])=>{let k=[];try{if(Array.isArray(P)===!1)throw new Error("authorIds is not an array!");if(P&&P.length===1){const I=await J(P[0]);I&&k.push(I)}else if(P&&P.length>1){const I=await se(P);I&&I.length>0&&(k=I)}}catch(I){throw await U(I),new Error(`Cannot read authors: ${I.message}`)}return k}}};const{APIS:{PEOPLE_API:{BASE_URL:on,ENDPOINTS:{REGISTRATIONS:Ze}}}}=_;var rd={list:async P=>{let k=[];try{const{data:I}=await L().get(`${on}${Ze}`,{params:P});I&&I.length&&(k=I)}catch(I){await U(I)}return k}};const{APIS:{PEOPLE_API:{BASE_URL_V2:nd,ENDPOINTS:{USERS:id,USER_COURSES:od}}},USERS:{MYSELF:ad}}=_,ai=`${nd}${id}/${ad}${od}`;var sd={create:async P=>{try{await L().post(ai,P)}catch(k){await U(k)}},list:async P=>{let k=[],I=P?{params:P}:{params:{}};try{const{data:B}=await L().get(ai,I);B&&B.length&&(k=B)}catch(B){await U(B)}return k},update:async(P,k)=>{try{await L().put(`${ai}/${P}`,k)}catch(I){await U(I)}}};const{APIS:{PEOPLE_API:{BASE_URL_V2:cd,ENDPOINTS:{USERS:ud,USER_EVENTS:ld}}},USERS:{MYSELF:fd}}=_,dd=`${cd}${ud}/${fd}${ld}`;var pd={list:async P=>{let k=[],I=P?{params:P}:{params:{}};try{const{data:B}=await L().get(dd,I);B&&B.length&&(k=B)}catch(B){await U(B)}return k}};const{APIS:{PEOPLE_API:{BASE_URL_V2:hd,ENDPOINTS:{USERS:md,USER_LESSONS:gd}}},USERS:{MYSELF:yd}}=_,ka=`${hd}${md}/${yd}${gd}`;var vd={create:async P=>{let k=null;try{k=await L().post(ka,P)}catch(I){await U(I)}return k},list:async P=>{let k=[],I=P?{params:P}:{params:{}};try{const{data:B}=await L().get(ka,I);B&&B.length&&(k=B)}catch(B){await U(B)}return k}};const{APIS:{PEOPLE_API:{BASE_URL_V2:_d,ENDPOINTS:{USERS:Ed,USER_PRODUCTS:wd}}},USERS:{MYSELF:bd}}=_,si=`${_d}${Ed}/${bd}${wd}`;var Sd={create:async P=>{let k=null;try{k=await L().post(si,P)}catch(I){await U(I)}return k},list:async P=>{let k=[],I=P?{params:P}:{params:{}};try{const{data:B}=await L().get(si,I);B&&B.length&&(k=B)}catch(B){await U(B)}return k},update:async(P,k)=>{try{await L().put(`${si}/${P}`,k)}catch(I){await U(I)}}};const{APIS:{PEOPLE_API:{BASE_URL_V2:Od,ENDPOINTS:{USERS:Td,USER_RATINGS:xd}}},USERS:{MYSELF:Ad}}=_,La=`${Od}${Td}/${Ad}${xd}`;var Bt={bulkEnrolments:ti,handlers:wt,registrations:rd,users:he,userCourses:sd,userEvents:pd,userLessons:vd,userLikes:ze,userProducts:Sd,userRatings:{create:async P=>{let k=null;try{const{data:I}=await L().post(La,P);I!=null&&I.id&&(k=I)}catch(I){await U(I)}return k},update:async(P,k)=>{try{await L().put(`${La}/${P}`,k)}catch(I){await U(I)}}}};const{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:Rd,ENDPOINTS:{ENQUIRY_EMAILS:Cd}}}}=_;var Nd={create:async P=>{let k=null;try{const{data:I}=await L().post(`${Rd}${Cd}`,P);I&&(k=I)}catch(I){await U(I)}return k}},Pd={forms:{sendEnquiryEmails:async P=>{let k=null;try{const{emailIds:I}=W;k=await Fa.emails.create({...I,...P})}catch(I){await U(I)}return k}}};const{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:Id,ENDPOINTS:{USERS:kd,USER_PROPERTIES:Ld}}},USERS:{MYSELF:Fd}}=_;var Fa={emails:Nd,handlers:Pd,userProperties:{update:async(P,k)=>{try{await L().put(`${Id}${kd}/${Fd}${Ld}/${P}`,k)}catch(I){await U(I)}}}},jd=d(130);const{APIS:{SEARCH_API:{BASE_URL:Md,ENDPOINTS:{SEARCH:Dd}}}}=_,Ud=`${Md}${Dd}`;var Bd={ask:async P=>{try{let k=null;const{data:I}=await L().get(Ud,{params:{question:P}});return I!=null&&I.answer&&(I!=null&&I.references)&&(I!=null&&I.version)&&(k=I),k}catch(k){const I=await U(k);throw new Error(I)}},stream:(P,k,I)=>{const B=(0,jd.io)(void 0,{path:"/api/search-api/web-sockets"});function X(){B.emit("search",{question:P})}function ge(Ce){I(Ce),Te(),B.disconnect()}function Te(){B.off("connect",X),B.off("update",k),B.off("result",ge)}return B.on("connect",X),B.on("update",k),B.on("result",ge),Te}};const{CONTENTFUL:$d}=_,{CARD_TYPES:ja}=$d.CAROUSELS;var Ma={read:async(P,k)=>{try{if(!k||!k.sys||!k.sys.id)throw new Error("Invalid link to card");if(!P||!ja[P])throw new Error("Unsupported card content type");const{INCLUDE:I,SELECT:B}=ja[P];return await(0,p.getEntry)({content_type:P,"sys.id":k.sys.id,include:I,select:B},{assetDetails:!0})}catch(I){throw await U(I),new Error(`Cannot read carousel card: ${I.message}`)}}};const{CONTENTFUL:qd}=_,{INCLUDE:Hd,SELECT:Wd,TYPE:Gd}=qd.EDITORIAL_PAGES;var Vd={read:async P=>{try{return await(0,p.getEntry)({content_type:Gd,"fields.slug":P,include:Hd,select:Wd})}catch(k){throw await U(k),new Error(`Cannot read editorial page: ${k.message}`)}}};const{CONTENTFUL:Qd}=_,{TYPE:Da,ORDER:zd,SELECT:Ua,SKIP:Yd,LIMIT:Kd,INCLUDE:Jd}=Qd.QUESTIONS;var Ba={read:async P=>{try{return await(0,p.getEntry)({content_type:Da,"fields.slug":P,include:2,select:Ua})}catch(k){throw await U(k),new Error(`Cannot read question: ${k.message}`)}},list:async(P={})=>{try{return await(0,p.getEntries)({content_type:Da,include:Jd,limit:Kd,order:zd,select:Ua,skip:Yd,...P})}catch(k){throw await U(k),new Error(`Cannot list questions: ${k.message}`)}}},Xd=async(P,k,I={ignoreAnswersAuthors:!1})=>{try{let B={};return B=await Ba.read(P),B=await Bt.handlers.authors.readQuestionAuthors(B,k,I),B}catch(B){throw await U(B),new Error(`Cannot build question: ${B.message}`)}};const{ARTICLES:{TYPE:Zd},COURSES:{TYPE:ep},EVENTS:{TYPE:tp},LISTS:{TYPE:rp},QUESTIONS:{TYPE:np},LEARNING_HUB:{TYPE:ip}}=_.CONTENTFUL,or=P=>P&&P.url?(Object.assign(P,{aspect:"responsiveCard",query:"q=90&fit=fill"}),P):null,ci={[Zd]:async P=>{const{authorIds:k,authorTag:I,image:B,publishedDate:X,readingTime:ge,slug:Te,title:Ce}=P,Je=await Bt.handlers.authors.readAuthors(k),nt=Je&&Je.length?Je:I?[I]:null;return{banner:or(B),contributors:nt,publishedDate:X,readingTime:ge,slug:Te,title:Ce}},[ep]:async(P,k)=>{const{banner:I,freeCourse:B,partnershipDetails:X,slug:ge,title:Te,registered:Ce}=P,Je={banner:or(I),slug:ge,title:Te,pill:B?"free":"premium",registered:!!Ce};if(X){const{partners:nt}=X;Je.partner=nt&&nt.length&&X.partners[0]}if(Ce===void 0&&k){const[nt]=await Bt.userProducts.list({courseSlug:ge,isEnrolled:!0,scope:"active"});Je.registered=!!nt}return Je},[tp]:async(P,k)=>{const{bannerImage:I,defaultStartDate:B,isEventOngoing:X,slug:ge,speakers:Te,title:Ce,registered:Je}=P,nt=new Date(B),lp=!!nt&&nt<new Date;if(Te&&Te.length)for(const an of Te)an.image=(ui=an.image)&&ui.url?`${ui.url}?w=100&h=100&fit=thumb&f=center`:null;var ui;const $a={banner:or(I),dateHasPassed:lp,title:Ce,slug:ge,isOngoingEvent:X,contributors:Te,startDate:nt,registered:!!Je};if(Je===void 0&&k){const[an]=await Bt.userEvents.list({eventSlug:ge});$a.registered=!!an}return $a},[rp]:async P=>{const{hero:k,slug:I,title:B}=P;return{banner:or(k),slug:I,title:B}},[np]:async P=>{const{answers:k,authorId:I,createdAt:B,slug:X,title:ge}=P;let Te=null;if(I){const Ce=await Bt.users.read(I);Ce&&(Te=Ce)}return{answers:k&&k.length?k.length:0,contributors:Te?[Te]:[],createdAt:B,slug:X,title:ge}},[ip]:P=>{const{bannerSection:k,customLabel:I,slug:B,title:X}=P;return{banner:or(k.image),slug:B,title:X,customLabel:I}},people:P=>{const{id:k,name:I,jobTitle:B,location:X,image:ge}=P;return{profile:ge,slug:k,title:I,text:B,secondaryText:X}}};var op=async({contentType:P,...k}={},I)=>{try{if(!ci[P])throw new Error("Content type not supported");if(typeof ci[P]!="function")throw new Error("No builder function for content type");return P!=="people"&&k.sys&&k.sys.type&&k.sys.type==="Link"&&(k=await Ma.read(P,k)),{contentType:P,...await ci[P](k,I)}}catch(B){throw await U(B),new Error(`Cannot build carousel card: ${B.message}`)}},ap=async(P,k,I={})=>{try{if(!P.replies||P.replies.length===0)return P.replies=[],P;P.replies.sort((X,ge)=>new Date(X.createdAt)-new Date(ge.createdAt)),P.totalReplies=P.totalReplies||P.replies.length;let B=P.replies;if(I.limit&&I.pageNumber){const X=I.limit*(I.pageNumber-1);B=P.replies.slice(X,X+I.limit)}for(const X of B){if(X.authorId===P.authorId){X.author=P.author,X.userLiked=!1;continue}X.author=X.authorId&&await J(X.authorId)||{};const[ge]=k?await Ae({contentType:_.CONTENTFUL.REPLIES.TYPE,contentSlug:X.slug}):[null];X.userLiked=!!ge}return P.replies=B,P}catch(B){throw await U(B),new Error(`Cannot build replies for answer: ${B.message}`)}},sp=d(408);const cp=P=>P&&sp.Buffer.from(P,"base64").toString("ascii");function up({contentContext:P=null,errorsContext:k=null,gtmContext:I=null,origin:B}){try{const X=(ge=>{let Te=null;ge?Te=ge:typeof window<"u"&&(Te=window.origin||window.location.origin),Te||new Error("Cannot select environment: Website not defined");let Ce=null;const Je=Te.match(w);return Je?Ce=Je[1].split(x)[0]:Te===S?Ce=O:Te.includes(v)&&(Ce=F),Ce||new Error(`Cannot select environment: No rule for website ${Te}`),Ce})(B);return P&&(0,p.setContext)(Object.assign({},P,{environment:X})),k&&(0,h.setContext)(Object.assign({},k,{environment:X})),I&&((0,y.setContext)(Object.assign({},I,{environment:X})),(0,y.setupGTM)()),(({environment:ge})=>{const Te=(Ce=>{if(!Ce)throw new Error("Cannot map environment: Environment not defined");if(!D[Ce])throw new Error(`Cannot map environment: No mapping found for environment ${Ce}`);return D[Ce]})(ge);W.emailIds=R[Te]})(Object.assign({},{environment:X})),X}catch(X){console.warn(`Cannot load SDK: ${X.message}`)}}}(),f}()})})(Cu);var hv=Cu.exports;const Ir={Off:"off",On:"on",Cookie:"cookie"},mv=e=>{const[t]=ia.useCookies(),[n,r]=j.useState(null),[s,o]=j.useState(!1),[l,i]=j.useState(Ir.Off);return j.useEffect(()=>{e&&hv.features.flags.read(e).then(u=>{i(u.featureState),r(null)}).catch(u=>{i(Ir.Off),r(u)})},[e]),j.useEffect(()=>{switch(l){case Ir.Off:o(!1);break;case Ir.On:o(!0);break;case Ir.Cookie:o(!!t[`feature-${e}`]);break;default:o(!1)}},[l,t]),{isFeatureActive:s,error:n}};function gv(e,t,n){var r=this,s=j.useRef(null),o=j.useRef(0),l=j.useRef(null),i=j.useRef([]),u=j.useRef(),c=j.useRef(),a=j.useRef(e),d=j.useRef(!0);j.useEffect(function(){a.current=e},[e]);var f=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var p=!!(n=n||{}).leading,h=!("trailing"in n)||!!n.trailing,y="maxWait"in n,_=y?Math.max(+n.maxWait||0,t):null;j.useEffect(function(){return d.current=!0,function(){d.current=!1}},[]);var S=j.useMemo(function(){var v=function(R){var W=i.current,V=u.current;return i.current=u.current=null,o.current=R,c.current=a.current.apply(V,W)},w=function(R,W){f&&cancelAnimationFrame(l.current),l.current=f?requestAnimationFrame(R):setTimeout(R,W)},x=function(R){if(!d.current)return!1;var W=R-s.current;return!s.current||W>=t||W<0||y&&R-o.current>=_},O=function(R){return l.current=null,h&&i.current?v(R):(i.current=u.current=null,c.current)},F=function R(){var W=Date.now();if(x(W))return O(W);if(d.current){var V=t-(W-s.current),L=y?Math.min(V,_-(W-o.current)):V;w(R,L)}},D=function(){var R=Date.now(),W=x(R);if(i.current=[].slice.call(arguments),u.current=r,s.current=R,W){if(!l.current&&d.current)return o.current=s.current,w(F,t),p?v(s.current):c.current;if(y)return w(F,t),v(s.current)}return l.current||w(F,t),c.current};return D.cancel=function(){l.current&&(f?cancelAnimationFrame(l.current):clearTimeout(l.current)),o.current=0,i.current=s.current=u.current=l.current=null},D.isPending=function(){return!!l.current},D.flush=function(){return l.current?O(Date.now()):c.current},D},[p,y,t,_,h,f]);return S}function Sf(e,t,n){var r=n===void 0?{}:n,s=r.leading,o=r.trailing;return gv(e,t,{maxWait:t,leading:s===void 0||s,trailing:o===void 0||o})}let Ro;const Vr=(e=!0,t=!1)=>{if(!e)return;const[n,r]=j.useState(0)||[!1,()=>{}];j.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(Ro),l.flush(),window.removeEventListener("resize",l)}),[]);const s=()=>window.innerWidth,o=()=>{r(s())},l=Sf(()=>{s()!==n&&(t&&(clearTimeout(Ro),document.body.classList.add("is-resizing"),Ro=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),o())},500,{leading:!0});return n},Of=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[s,o]=j.useState({current:0,past:0})||[!1,()=>{}],[l,i]=j.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];j.useEffect(()=>(u(),window.addEventListener("scroll",c),()=>{c.flush(),window.removeEventListener("scroll",c)}),[]);const u=()=>{const a=window.scrollY,d=s.current,f=a-d,p=f>0?"down":"up";if(o({current:a,past:d}),p==="down"){a>=e+t.down&&!l.scrollDown&&(!l.scrollUp||f>t.up)&&(n(),i({scrollUp:!1,scrollDown:!0}));return}Math.abs(f)>=t.up&&!l.scrollUp&&(r(),i({scrollUp:!0,scrollDown:!1}))},c=Sf(()=>{u()},250);return s},yv=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=j.useRef(!1);jt(()=>{if(window&&window.location&&window.location.hash){if(n.current)return;const r=document.getElementById(window.location.hash.replace("#",""));r&&(r.scrollIntoView(t?{behavior:"smooth"}:null),n.current=!0)}},e)},vv=(e,t)=>{Array.isArray(t)||(t=[t]);const n=fp(e);return t.forEach(({type:r,value:s})=>{dp(n,r,s)}),n},Tf=e=>{const t=[];return e.forEach(n=>{const r=parseInt(n);isNaN(r)||t.push(r)}),t.sort((n,r)=>n-r)},xf=(e,t,n)=>{let r=n.mobile;for(const s in t){const o=parseInt(String(t[s]));if(e>=o)r=n[o];else if(e<o)break}return r},_v=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),Ev=e=>{let o;try{o=new Date().getTime()-new Date(e).getTime()}catch{return""}const l=o/36e5,i=Math.floor(o/864e5);if(i<1)return l<1?{path:"now"}:{path:"hours",number:Math.floor(l)};if(i<7)return{path:"days",number:i};const u=Math.floor(i/7);return u<=52?{path:"weeks",number:u}:{path:"years",number:Math.floor(i/365)}},wv=e=>new Promise(t=>setTimeout(t,e)),wa={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}.
|
|
68
|
+
*/var vu;function hv(){return vu||(vu=1,function(e){const t=dv(),n=pv(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=i,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;const s=2147483647;e.kMaxLength=s,i.TYPED_ARRAY_SUPPORT=o(),!i.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 b=new Uint8Array(1),m={foo:function(){return 42}};return Object.setPrototypeOf(m,Uint8Array.prototype),Object.setPrototypeOf(b,m),b.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function l(b){if(b>s)throw new RangeError('The value "'+b+'" is invalid for option "size"');const m=new Uint8Array(b);return Object.setPrototypeOf(m,i.prototype),m}function i(b,m,g){if(typeof b=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(b)}return u(b,m,g)}i.poolSize=8192;function u(b,m,g){if(typeof b=="string")return f(b,m);if(ArrayBuffer.isView(b))return h(b);if(b==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b);if(De(b,ArrayBuffer)||b&&De(b.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(De(b,SharedArrayBuffer)||b&&De(b.buffer,SharedArrayBuffer)))return y(b,m,g);if(typeof b=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=b.valueOf&&b.valueOf();if(T!=null&&T!==b)return i.from(T,m,g);const N=_(b);if(N)return N;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof b[Symbol.toPrimitive]=="function")return i.from(b[Symbol.toPrimitive]("string"),m,g);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof b)}i.from=function(b,m,g){return u(b,m,g)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function c(b){if(typeof b!="number")throw new TypeError('"size" argument must be of type number');if(b<0)throw new RangeError('The value "'+b+'" is invalid for option "size"')}function a(b,m,g){return c(b),b<=0?l(b):m!==void 0?typeof g=="string"?l(b).fill(m,g):l(b).fill(m):l(b)}i.alloc=function(b,m,g){return a(b,m,g)};function d(b){return c(b),l(b<0?0:S(b)|0)}i.allocUnsafe=function(b){return d(b)},i.allocUnsafeSlow=function(b){return d(b)};function f(b,m){if((typeof m!="string"||m==="")&&(m="utf8"),!i.isEncoding(m))throw new TypeError("Unknown encoding: "+m);const g=w(b,m)|0;let T=l(g);const N=T.write(b,m);return N!==g&&(T=T.slice(0,N)),T}function p(b){const m=b.length<0?0:S(b.length)|0,g=l(m);for(let T=0;T<m;T+=1)g[T]=b[T]&255;return g}function h(b){if(De(b,Uint8Array)){const m=new Uint8Array(b);return y(m.buffer,m.byteOffset,m.byteLength)}return p(b)}function y(b,m,g){if(m<0||b.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(b.byteLength<m+(g||0))throw new RangeError('"length" is outside of buffer bounds');let T;return m===void 0&&g===void 0?T=new Uint8Array(b):g===void 0?T=new Uint8Array(b,m):T=new Uint8Array(b,m,g),Object.setPrototypeOf(T,i.prototype),T}function _(b){if(i.isBuffer(b)){const m=S(b.length)|0,g=l(m);return g.length===0||b.copy(g,0,0,m),g}if(b.length!==void 0)return typeof b.length!="number"||_t(b.length)?l(0):p(b);if(b.type==="Buffer"&&Array.isArray(b.data))return p(b.data)}function S(b){if(b>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return b|0}function v(b){return+b!=b&&(b=0),i.alloc(+b)}i.isBuffer=function(m){return m!=null&&m._isBuffer===!0&&m!==i.prototype},i.compare=function(m,g){if(De(m,Uint8Array)&&(m=i.from(m,m.offset,m.byteLength)),De(g,Uint8Array)&&(g=i.from(g,g.offset,g.byteLength)),!i.isBuffer(m)||!i.isBuffer(g))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===g)return 0;let T=m.length,N=g.length;for(let M=0,H=Math.min(T,N);M<H;++M)if(m[M]!==g[M]){T=m[M],N=g[M];break}return T<N?-1:N<T?1:0},i.isEncoding=function(m){switch(String(m).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}},i.concat=function(m,g){if(!Array.isArray(m))throw new TypeError('"list" argument must be an Array of Buffers');if(m.length===0)return i.alloc(0);let T;if(g===void 0)for(g=0,T=0;T<m.length;++T)g+=m[T].length;const N=i.allocUnsafe(g);let M=0;for(T=0;T<m.length;++T){let H=m[T];if(De(H,Uint8Array))M+H.length>N.length?(i.isBuffer(H)||(H=i.from(H)),H.copy(N,M)):Uint8Array.prototype.set.call(N,H,M);else if(i.isBuffer(H))H.copy(N,M);else throw new TypeError('"list" argument must be an Array of Buffers');M+=H.length}return N};function w(b,m){if(i.isBuffer(b))return b.length;if(ArrayBuffer.isView(b)||De(b,ArrayBuffer))return b.byteLength;if(typeof b!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof b);const g=b.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&g===0)return 0;let N=!1;for(;;)switch(m){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":return Me(b).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return Mt(b).length;default:if(N)return T?-1:Me(b).length;m=(""+m).toLowerCase(),N=!0}}i.byteLength=w;function x(b,m,g){let T=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,m>>>=0,g<=m))return"";for(b||(b="utf8");;)switch(b){case"hex":return oe(this,m,g);case"utf8":case"utf-8":return K(this,m,g);case"ascii":return q(this,m,g);case"latin1":case"binary":return Y(this,m,g);case"base64":return $(this,m,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,m,g);default:if(T)throw new TypeError("Unknown encoding: "+b);b=(b+"").toLowerCase(),T=!0}}i.prototype._isBuffer=!0;function O(b,m,g){const T=b[m];b[m]=b[g],b[g]=T}i.prototype.swap16=function(){const m=this.length;if(m%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let g=0;g<m;g+=2)O(this,g,g+1);return this},i.prototype.swap32=function(){const m=this.length;if(m%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let g=0;g<m;g+=4)O(this,g,g+3),O(this,g+1,g+2);return this},i.prototype.swap64=function(){const m=this.length;if(m%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let g=0;g<m;g+=8)O(this,g,g+7),O(this,g+1,g+6),O(this,g+2,g+5),O(this,g+3,g+4);return this},i.prototype.toString=function(){const m=this.length;return m===0?"":arguments.length===0?K(this,0,m):x.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(m){if(!i.isBuffer(m))throw new TypeError("Argument must be a Buffer");return this===m?!0:i.compare(this,m)===0},i.prototype.inspect=function(){let m="";const g=e.INSPECT_MAX_BYTES;return m=this.toString("hex",0,g).replace(/(.{2})/g,"$1 ").trim(),this.length>g&&(m+=" ... "),"<Buffer "+m+">"},r&&(i.prototype[r]=i.prototype.inspect),i.prototype.compare=function(m,g,T,N,M){if(De(m,Uint8Array)&&(m=i.from(m,m.offset,m.byteLength)),!i.isBuffer(m))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof m);if(g===void 0&&(g=0),T===void 0&&(T=m?m.length:0),N===void 0&&(N=0),M===void 0&&(M=this.length),g<0||T>m.length||N<0||M>this.length)throw new RangeError("out of range index");if(N>=M&&g>=T)return 0;if(N>=M)return-1;if(g>=T)return 1;if(g>>>=0,T>>>=0,N>>>=0,M>>>=0,this===m)return 0;let H=M-N,le=T-g;const Se=Math.min(H,le),Ee=this.slice(N,M),Oe=m.slice(g,T);for(let ge=0;ge<Se;++ge)if(Ee[ge]!==Oe[ge]){H=Ee[ge],le=Oe[ge];break}return H<le?-1:le<H?1:0};function F(b,m,g,T,N){if(b.length===0)return-1;if(typeof g=="string"?(T=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,_t(g)&&(g=N?0:b.length-1),g<0&&(g=b.length+g),g>=b.length){if(N)return-1;g=b.length-1}else if(g<0)if(N)g=0;else return-1;if(typeof m=="string"&&(m=i.from(m,T)),i.isBuffer(m))return m.length===0?-1:D(b,m,g,T,N);if(typeof m=="number")return m=m&255,typeof Uint8Array.prototype.indexOf=="function"?N?Uint8Array.prototype.indexOf.call(b,m,g):Uint8Array.prototype.lastIndexOf.call(b,m,g):D(b,[m],g,T,N);throw new TypeError("val must be string, number or Buffer")}function D(b,m,g,T,N){let M=1,H=b.length,le=m.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(b.length<2||m.length<2)return-1;M=2,H/=2,le/=2,g/=2}function Se(Oe,ge){return M===1?Oe[ge]:Oe.readUInt16BE(ge*M)}let Ee;if(N){let Oe=-1;for(Ee=g;Ee<H;Ee++)if(Se(b,Ee)===Se(m,Oe===-1?0:Ee-Oe)){if(Oe===-1&&(Oe=Ee),Ee-Oe+1===le)return Oe*M}else Oe!==-1&&(Ee-=Ee-Oe),Oe=-1}else for(g+le>H&&(g=H-le),Ee=g;Ee>=0;Ee--){let Oe=!0;for(let ge=0;ge<le;ge++)if(Se(b,Ee+ge)!==Se(m,ge)){Oe=!1;break}if(Oe)return Ee}return-1}i.prototype.includes=function(m,g,T){return this.indexOf(m,g,T)!==-1},i.prototype.indexOf=function(m,g,T){return F(this,m,g,T,!0)},i.prototype.lastIndexOf=function(m,g,T){return F(this,m,g,T,!1)};function R(b,m,g,T){g=Number(g)||0;const N=b.length-g;T?(T=Number(T),T>N&&(T=N)):T=N;const M=m.length;T>M/2&&(T=M/2);let H;for(H=0;H<T;++H){const le=parseInt(m.substr(H*2,2),16);if(_t(le))return H;b[g+H]=le}return H}function W(b,m,g,T){return vt(Me(m,b.length-g),b,g,T)}function Q(b,m,g,T){return vt(Xe(m),b,g,T)}function k(b,m,g,T){return vt(Mt(m),b,g,T)}function U(b,m,g,T){return vt(rt(m,b.length-g),b,g,T)}i.prototype.write=function(m,g,T,N){if(g===void 0)N="utf8",T=this.length,g=0;else if(T===void 0&&typeof g=="string")N=g,T=this.length,g=0;else if(isFinite(g))g=g>>>0,isFinite(T)?(T=T>>>0,N===void 0&&(N="utf8")):(N=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const M=this.length-g;if((T===void 0||T>M)&&(T=M),m.length>0&&(T<0||g<0)||g>this.length)throw new RangeError("Attempt to write outside buffer bounds");N||(N="utf8");let H=!1;for(;;)switch(N){case"hex":return R(this,m,g,T);case"utf8":case"utf-8":return W(this,m,g,T);case"ascii":case"latin1":case"binary":return Q(this,m,g,T);case"base64":return k(this,m,g,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,m,g,T);default:if(H)throw new TypeError("Unknown encoding: "+N);N=(""+N).toLowerCase(),H=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(b,m,g){return m===0&&g===b.length?t.fromByteArray(b):t.fromByteArray(b.slice(m,g))}function K(b,m,g){g=Math.min(b.length,g);const T=[];let N=m;for(;N<g;){const M=b[N];let H=null,le=M>239?4:M>223?3:M>191?2:1;if(N+le<=g){let Se,Ee,Oe,ge;switch(le){case 1:M<128&&(H=M);break;case 2:Se=b[N+1],(Se&192)===128&&(ge=(M&31)<<6|Se&63,ge>127&&(H=ge));break;case 3:Se=b[N+1],Ee=b[N+2],(Se&192)===128&&(Ee&192)===128&&(ge=(M&15)<<12|(Se&63)<<6|Ee&63,ge>2047&&(ge<55296||ge>57343)&&(H=ge));break;case 4:Se=b[N+1],Ee=b[N+2],Oe=b[N+3],(Se&192)===128&&(Ee&192)===128&&(Oe&192)===128&&(ge=(M&15)<<18|(Se&63)<<12|(Ee&63)<<6|Oe&63,ge>65535&&ge<1114112&&(H=ge))}}H===null?(H=65533,le=1):H>65535&&(H-=65536,T.push(H>>>10&1023|55296),H=56320|H&1023),T.push(H),N+=le}return C(T)}const V=4096;function C(b){const m=b.length;if(m<=V)return String.fromCharCode.apply(String,b);let g="",T=0;for(;T<m;)g+=String.fromCharCode.apply(String,b.slice(T,T+=V));return g}function q(b,m,g){let T="";g=Math.min(b.length,g);for(let N=m;N<g;++N)T+=String.fromCharCode(b[N]&127);return T}function Y(b,m,g){let T="";g=Math.min(b.length,g);for(let N=m;N<g;++N)T+=String.fromCharCode(b[N]);return T}function oe(b,m,g){const T=b.length;(!m||m<0)&&(m=0),(!g||g<0||g>T)&&(g=T);let N="";for(let M=m;M<g;++M)N+=Dt[b[M]];return N}function re(b,m,g){const T=b.slice(m,g);let N="";for(let M=0;M<T.length-1;M+=2)N+=String.fromCharCode(T[M]+T[M+1]*256);return N}i.prototype.slice=function(m,g){const T=this.length;m=~~m,g=g===void 0?T:~~g,m<0?(m+=T,m<0&&(m=0)):m>T&&(m=T),g<0?(g+=T,g<0&&(g=0)):g>T&&(g=T),g<m&&(g=m);const N=this.subarray(m,g);return Object.setPrototypeOf(N,i.prototype),N};function G(b,m,g){if(b%1!==0||b<0)throw new RangeError("offset is not uint");if(b+m>g)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(m,g,T){m=m>>>0,g=g>>>0,T||G(m,g,this.length);let N=this[m],M=1,H=0;for(;++H<g&&(M*=256);)N+=this[m+H]*M;return N},i.prototype.readUintBE=i.prototype.readUIntBE=function(m,g,T){m=m>>>0,g=g>>>0,T||G(m,g,this.length);let N=this[m+--g],M=1;for(;g>0&&(M*=256);)N+=this[m+--g]*M;return N},i.prototype.readUint8=i.prototype.readUInt8=function(m,g){return m=m>>>0,g||G(m,1,this.length),this[m]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(m,g){return m=m>>>0,g||G(m,2,this.length),this[m]|this[m+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(m,g){return m=m>>>0,g||G(m,2,this.length),this[m]<<8|this[m+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(m,g){return m=m>>>0,g||G(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+this[m+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(m,g){return m=m>>>0,g||G(m,4,this.length),this[m]*16777216+(this[m+1]<<16|this[m+2]<<8|this[m+3])},i.prototype.readBigUInt64LE=Ke(function(m){m=m>>>0,Ge(m,"offset");const g=this[m],T=this[m+7];(g===void 0||T===void 0)&&qe(m,this.length-8);const N=g+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24,M=this[++m]+this[++m]*2**8+this[++m]*2**16+T*2**24;return BigInt(N)+(BigInt(M)<<BigInt(32))}),i.prototype.readBigUInt64BE=Ke(function(m){m=m>>>0,Ge(m,"offset");const g=this[m],T=this[m+7];(g===void 0||T===void 0)&&qe(m,this.length-8);const N=g*2**24+this[++m]*2**16+this[++m]*2**8+this[++m],M=this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+T;return(BigInt(N)<<BigInt(32))+BigInt(M)}),i.prototype.readIntLE=function(m,g,T){m=m>>>0,g=g>>>0,T||G(m,g,this.length);let N=this[m],M=1,H=0;for(;++H<g&&(M*=256);)N+=this[m+H]*M;return M*=128,N>=M&&(N-=Math.pow(2,8*g)),N},i.prototype.readIntBE=function(m,g,T){m=m>>>0,g=g>>>0,T||G(m,g,this.length);let N=g,M=1,H=this[m+--N];for(;N>0&&(M*=256);)H+=this[m+--N]*M;return M*=128,H>=M&&(H-=Math.pow(2,8*g)),H},i.prototype.readInt8=function(m,g){return m=m>>>0,g||G(m,1,this.length),this[m]&128?(255-this[m]+1)*-1:this[m]},i.prototype.readInt16LE=function(m,g){m=m>>>0,g||G(m,2,this.length);const T=this[m]|this[m+1]<<8;return T&32768?T|4294901760:T},i.prototype.readInt16BE=function(m,g){m=m>>>0,g||G(m,2,this.length);const T=this[m+1]|this[m]<<8;return T&32768?T|4294901760:T},i.prototype.readInt32LE=function(m,g){return m=m>>>0,g||G(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},i.prototype.readInt32BE=function(m,g){return m=m>>>0,g||G(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},i.prototype.readBigInt64LE=Ke(function(m){m=m>>>0,Ge(m,"offset");const g=this[m],T=this[m+7];(g===void 0||T===void 0)&&qe(m,this.length-8);const N=this[m+4]+this[m+5]*2**8+this[m+6]*2**16+(T<<24);return(BigInt(N)<<BigInt(32))+BigInt(g+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24)}),i.prototype.readBigInt64BE=Ke(function(m){m=m>>>0,Ge(m,"offset");const g=this[m],T=this[m+7];(g===void 0||T===void 0)&&qe(m,this.length-8);const N=(g<<24)+this[++m]*2**16+this[++m]*2**8+this[++m];return(BigInt(N)<<BigInt(32))+BigInt(this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+T)}),i.prototype.readFloatLE=function(m,g){return m=m>>>0,g||G(m,4,this.length),n.read(this,m,!0,23,4)},i.prototype.readFloatBE=function(m,g){return m=m>>>0,g||G(m,4,this.length),n.read(this,m,!1,23,4)},i.prototype.readDoubleLE=function(m,g){return m=m>>>0,g||G(m,8,this.length),n.read(this,m,!0,52,8)},i.prototype.readDoubleBE=function(m,g){return m=m>>>0,g||G(m,8,this.length),n.read(this,m,!1,52,8)};function ie(b,m,g,T,N,M){if(!i.isBuffer(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>N||m<M)throw new RangeError('"value" argument is out of bounds');if(g+T>b.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(m,g,T,N){if(m=+m,g=g>>>0,T=T>>>0,!N){const le=Math.pow(2,8*T)-1;ie(this,m,g,T,le,0)}let M=1,H=0;for(this[g]=m&255;++H<T&&(M*=256);)this[g+H]=m/M&255;return g+T},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(m,g,T,N){if(m=+m,g=g>>>0,T=T>>>0,!N){const le=Math.pow(2,8*T)-1;ie(this,m,g,T,le,0)}let M=T-1,H=1;for(this[g+M]=m&255;--M>=0&&(H*=256);)this[g+M]=m/H&255;return g+T},i.prototype.writeUint8=i.prototype.writeUInt8=function(m,g,T){return m=+m,g=g>>>0,T||ie(this,m,g,1,255,0),this[g]=m&255,g+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(m,g,T){return m=+m,g=g>>>0,T||ie(this,m,g,2,65535,0),this[g]=m&255,this[g+1]=m>>>8,g+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(m,g,T){return m=+m,g=g>>>0,T||ie(this,m,g,2,65535,0),this[g]=m>>>8,this[g+1]=m&255,g+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(m,g,T){return m=+m,g=g>>>0,T||ie(this,m,g,4,4294967295,0),this[g+3]=m>>>24,this[g+2]=m>>>16,this[g+1]=m>>>8,this[g]=m&255,g+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(m,g,T){return m=+m,g=g>>>0,T||ie(this,m,g,4,4294967295,0),this[g]=m>>>24,this[g+1]=m>>>16,this[g+2]=m>>>8,this[g+3]=m&255,g+4};function ae(b,m,g,T,N){tt(m,T,N,b,g,7);let M=Number(m&BigInt(4294967295));b[g++]=M,M=M>>8,b[g++]=M,M=M>>8,b[g++]=M,M=M>>8,b[g++]=M;let H=Number(m>>BigInt(32)&BigInt(4294967295));return b[g++]=H,H=H>>8,b[g++]=H,H=H>>8,b[g++]=H,H=H>>8,b[g++]=H,g}function be(b,m,g,T,N){tt(m,T,N,b,g,7);let M=Number(m&BigInt(4294967295));b[g+7]=M,M=M>>8,b[g+6]=M,M=M>>8,b[g+5]=M,M=M>>8,b[g+4]=M;let H=Number(m>>BigInt(32)&BigInt(4294967295));return b[g+3]=H,H=H>>8,b[g+2]=H,H=H>>8,b[g+1]=H,H=H>>8,b[g]=H,g+8}i.prototype.writeBigUInt64LE=Ke(function(m,g=0){return ae(this,m,g,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=Ke(function(m,g=0){return be(this,m,g,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(m,g,T,N){if(m=+m,g=g>>>0,!N){const Se=Math.pow(2,8*T-1);ie(this,m,g,T,Se-1,-Se)}let M=0,H=1,le=0;for(this[g]=m&255;++M<T&&(H*=256);)m<0&&le===0&&this[g+M-1]!==0&&(le=1),this[g+M]=(m/H>>0)-le&255;return g+T},i.prototype.writeIntBE=function(m,g,T,N){if(m=+m,g=g>>>0,!N){const Se=Math.pow(2,8*T-1);ie(this,m,g,T,Se-1,-Se)}let M=T-1,H=1,le=0;for(this[g+M]=m&255;--M>=0&&(H*=256);)m<0&&le===0&&this[g+M+1]!==0&&(le=1),this[g+M]=(m/H>>0)-le&255;return g+T},i.prototype.writeInt8=function(m,g,T){return m=+m,g=g>>>0,T||ie(this,m,g,1,127,-128),m<0&&(m=255+m+1),this[g]=m&255,g+1},i.prototype.writeInt16LE=function(m,g,T){return m=+m,g=g>>>0,T||ie(this,m,g,2,32767,-32768),this[g]=m&255,this[g+1]=m>>>8,g+2},i.prototype.writeInt16BE=function(m,g,T){return m=+m,g=g>>>0,T||ie(this,m,g,2,32767,-32768),this[g]=m>>>8,this[g+1]=m&255,g+2},i.prototype.writeInt32LE=function(m,g,T){return m=+m,g=g>>>0,T||ie(this,m,g,4,2147483647,-2147483648),this[g]=m&255,this[g+1]=m>>>8,this[g+2]=m>>>16,this[g+3]=m>>>24,g+4},i.prototype.writeInt32BE=function(m,g,T){return m=+m,g=g>>>0,T||ie(this,m,g,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[g]=m>>>24,this[g+1]=m>>>16,this[g+2]=m>>>8,this[g+3]=m&255,g+4},i.prototype.writeBigInt64LE=Ke(function(m,g=0){return ae(this,m,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=Ke(function(m,g=0){return be(this,m,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ee(b,m,g,T,N,M){if(g+T>b.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function te(b,m,g,T,N){return m=+m,g=g>>>0,N||ee(b,m,g,4),n.write(b,m,g,T,23,4),g+4}i.prototype.writeFloatLE=function(m,g,T){return te(this,m,g,!0,T)},i.prototype.writeFloatBE=function(m,g,T){return te(this,m,g,!1,T)};function Z(b,m,g,T,N){return m=+m,g=g>>>0,N||ee(b,m,g,8),n.write(b,m,g,T,52,8),g+8}i.prototype.writeDoubleLE=function(m,g,T){return Z(this,m,g,!0,T)},i.prototype.writeDoubleBE=function(m,g,T){return Z(this,m,g,!1,T)},i.prototype.copy=function(m,g,T,N){if(!i.isBuffer(m))throw new TypeError("argument should be a Buffer");if(T||(T=0),!N&&N!==0&&(N=this.length),g>=m.length&&(g=m.length),g||(g=0),N>0&&N<T&&(N=T),N===T||m.length===0||this.length===0)return 0;if(g<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("sourceEnd out of bounds");N>this.length&&(N=this.length),m.length-g<N-T&&(N=m.length-g+T);const M=N-T;return this===m&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(g,T,N):Uint8Array.prototype.set.call(m,this.subarray(T,N),g),M},i.prototype.fill=function(m,g,T,N){if(typeof m=="string"){if(typeof g=="string"?(N=g,g=0,T=this.length):typeof T=="string"&&(N=T,T=this.length),N!==void 0&&typeof N!="string")throw new TypeError("encoding must be a string");if(typeof N=="string"&&!i.isEncoding(N))throw new TypeError("Unknown encoding: "+N);if(m.length===1){const H=m.charCodeAt(0);(N==="utf8"&&H<128||N==="latin1")&&(m=H)}}else typeof m=="number"?m=m&255:typeof m=="boolean"&&(m=Number(m));if(g<0||this.length<g||this.length<T)throw new RangeError("Out of range index");if(T<=g)return this;g=g>>>0,T=T===void 0?this.length:T>>>0,m||(m=0);let M;if(typeof m=="number")for(M=g;M<T;++M)this[M]=m;else{const H=i.isBuffer(m)?m:i.from(m,N),le=H.length;if(le===0)throw new TypeError('The value "'+m+'" is invalid for argument "value"');for(M=0;M<T-g;++M)this[M+g]=H[M%le]}return this};const he={};function Ae(b,m,g){he[b]=class extends g{constructor(){super(),Object.defineProperty(this,"message",{value:m.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${b}]`,this.stack,delete this.name}get code(){return b}set code(N){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:N,writable:!0})}toString(){return`${this.name} [${b}]: ${this.message}`}}}Ae("ERR_BUFFER_OUT_OF_BOUNDS",function(b){return b?`${b} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ae("ERR_INVALID_ARG_TYPE",function(b,m){return`The "${b}" argument must be of type number. Received type ${typeof m}`},TypeError),Ae("ERR_OUT_OF_RANGE",function(b,m,g){let T=`The value of "${b}" is out of range.`,N=g;return Number.isInteger(g)&&Math.abs(g)>2**32?N=Pe(String(g)):typeof g=="bigint"&&(N=String(g),(g>BigInt(2)**BigInt(32)||g<-(BigInt(2)**BigInt(32)))&&(N=Pe(N)),N+="n"),T+=` It must be ${m}. Received ${N}`,T},RangeError);function Pe(b){let m="",g=b.length;const T=b[0]==="-"?1:0;for(;g>=T+4;g-=3)m=`_${b.slice(g-3,g)}${m}`;return`${b.slice(0,g)}${m}`}function je(b,m,g){Ge(m,"offset"),(b[m]===void 0||b[m+g]===void 0)&&qe(m,b.length-(g+1))}function tt(b,m,g,T,N,M){if(b>g||b<m){const H=typeof m=="bigint"?"n":"";let le;throw M>3?m===0||m===BigInt(0)?le=`>= 0${H} and < 2${H} ** ${(M+1)*8}${H}`:le=`>= -(2${H} ** ${(M+1)*8-1}${H}) and < 2 ** ${(M+1)*8-1}${H}`:le=`>= ${m}${H} and <= ${g}${H}`,new he.ERR_OUT_OF_RANGE("value",le,b)}je(T,N,M)}function Ge(b,m){if(typeof b!="number")throw new he.ERR_INVALID_ARG_TYPE(m,"number",b)}function qe(b,m,g){throw Math.floor(b)!==b?(Ge(b,g),new he.ERR_OUT_OF_RANGE(g||"offset","an integer",b)):m<0?new he.ERR_BUFFER_OUT_OF_BOUNDS:new he.ERR_OUT_OF_RANGE(g||"offset",`>= ${g?1:0} and <= ${m}`,b)}const Ve=/[^+/0-9A-Za-z-_]/g;function _e(b){if(b=b.split("=")[0],b=b.trim().replace(Ve,""),b.length<2)return"";for(;b.length%4!==0;)b=b+"=";return b}function Me(b,m){m=m||1/0;let g;const T=b.length;let N=null;const M=[];for(let H=0;H<T;++H){if(g=b.charCodeAt(H),g>55295&&g<57344){if(!N){if(g>56319){(m-=3)>-1&&M.push(239,191,189);continue}else if(H+1===T){(m-=3)>-1&&M.push(239,191,189);continue}N=g;continue}if(g<56320){(m-=3)>-1&&M.push(239,191,189),N=g;continue}g=(N-55296<<10|g-56320)+65536}else N&&(m-=3)>-1&&M.push(239,191,189);if(N=null,g<128){if((m-=1)<0)break;M.push(g)}else if(g<2048){if((m-=2)<0)break;M.push(g>>6|192,g&63|128)}else if(g<65536){if((m-=3)<0)break;M.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((m-=4)<0)break;M.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return M}function Xe(b){const m=[];for(let g=0;g<b.length;++g)m.push(b.charCodeAt(g)&255);return m}function rt(b,m){let g,T,N;const M=[];for(let H=0;H<b.length&&!((m-=2)<0);++H)g=b.charCodeAt(H),T=g>>8,N=g%256,M.push(N),M.push(T);return M}function Mt(b){return t.toByteArray(_e(b))}function vt(b,m,g,T){let N;for(N=0;N<T&&!(N+g>=m.length||N>=b.length);++N)m[N+g]=b[N];return N}function De(b,m){return b instanceof m||b!=null&&b.constructor!=null&&b.constructor.name!=null&&b.constructor.name===m.name}function _t(b){return b!==b}const Dt=function(){const b="0123456789abcdef",m=new Array(256);for(let g=0;g<16;++g){const T=g*16;for(let N=0;N<16;++N)m[T+N]=b[g]+b[N]}return m}();function Ke(b){return typeof BigInt>"u"?Ut:b}function Ut(){throw new Error("BigInt not supported")}}(Ao)),Ao}(function(e,t){(function(n,r){e.exports=r(Sy(),Fy(),By(),Uu(),Qy,fv(),hv())})(ce,function(n,r,s,o,l,i,u){return function(){var c={809:function(p){p.exports=n},30:function(p){p.exports=r},36:function(p){p.exports=s},300:function(p){p.exports=o},408:function(p){p.exports=u},25:function(p){p.exports=l},130:function(p){p.exports=i}},a={};function d(p){var h=a[p];if(h!==void 0)return h.exports;var y=a[p]={exports:{}};return c[p](y,y.exports,d),y.exports}d.n=function(p){var h=p&&p.__esModule?function(){return p.default}:function(){return p};return d.d(h,{a:h}),h},d.d=function(p,h){for(var y in h)d.o(h,y)&&!d.o(p,y)&&Object.defineProperty(p,y,{enumerable:!0,get:h[y]})},d.o=function(p,h){return Object.prototype.hasOwnProperty.call(p,h)},d.r=function(p){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})};var f={};return function(){d.r(f),d.d(f,{assets:function(){return C},auth:function(){return G},buildAnswer:function(){return sp},buildCarouselCard:function(){return ap},buildQuestion:function(){return Zd},carouselCards:function(){return Da},contentInteraction:function(){return Ke},decodeBase64:function(){return up},default:function(){return lp},editorialPages:function(){return Qd},features:function(){return g},getEntries:function(){return p.getEntries},getEntry:function(){return p.getEntry},management:function(){return ir},payments:function(){return ei},people:function(){return Bt},peopleEngagement:function(){return ja},qaQuestions:function(){return $a},reportError:function(){return h.reportError},search:function(){return $d}});var p=d(809),h=d(30),y=d(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:x},ENVIRONMENTS:{PRODUCTION:O,LOCAL:F}}}=_,{HUBSPOT:{ENVIRONMENTS_MAPPING:D,EMAIL_IDS:R}}=_;let W={emailIds:{}};var Q=d(300),k=d.n(Q);const U=async P=>{try{const{message:L,response:I,request:B}=P;let X=L;return I?X+=` - The request was made and the server responded with ${JSON.stringify({status:I.status,data:I.data})}`:B&&(X+=" - The request was made but no response was received"),console.warn(X),await(0,h.reportError)(new Error(X)),X}catch(L){return console.warn(`Cannot handle error: ${L.message}`),L.message}},{APIS:{ASSETS_API:{BASE_URL:$,ENDPOINTS:{USERS:K,CERTIFICATES:V}}}}=_;var C={certificates:{create:async(P,L)=>{let I=[];try{const{data:B}=await k().post(`${$}${K}/${P}${V}`,L);B&&(I=B)}catch(B){await U(B)}return I}}};const{APIS:{AUTH_API:{BASE_URL:q,ENDPOINTS:{USER_PASSWORD:Y,USERS:oe}}},USERS:{MYSELF:re}}=_;var G={userPassword:{update:async P=>{let L=null;try{L=await k().put(`${q}${oe}/${re}${Y}`,P)}catch(I){L={message:(((I||{}).response||{}).data||{}).message},await U(I)}return L}}};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:ie,ENDPOINTS:{ANSWERS:ae,QUESTIONS:be,LIKES:ee}}}}=_,te=`${ie}${be}`;var Z={create:async({questionSlug:P},L)=>{try{await k().post(`${te}/${encodeURIComponent(P)}${ae}`,L)}catch(I){const B=await U(I);throw new Error(B)}},remove:async({questionSlug:P,answerSlug:L})=>{try{await k().delete(`${te}/${encodeURIComponent(P)}${ae}/${encodeURIComponent(L)}`)}catch(I){const B=await U(I);throw new Error(B)}},update:async({questionSlug:P,answerSlug:L},I)=>{try{return await k().put(`${te}/${encodeURIComponent(P)}${ae}/${encodeURIComponent(L)}`,I)}catch(B){const X=await U(B);throw new Error(X)}},like:async({questionSlug:P,answerSlug:L},I)=>{try{return await k().post(`${te}/${encodeURIComponent(P)}${ae}/${encodeURIComponent(L)}${ee}`,I)}catch(B){const X=await U(B);throw new Error(X)}},unlike:async({questionSlug:P,answerSlug:L})=>{try{return await k().delete(`${te}/${encodeURIComponent(P)}${ae}/${encodeURIComponent(L)}${ee}`)}catch(I){const B=await U(I);throw new Error(B)}}};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:he,ENDPOINTS:{QUESTIONS:Ae}}}}=_,Pe=`${he}${Ae}`;var je={create:async P=>{try{return await k().post(Pe,P)}catch(L){const I=await U(L);throw new Error(I)}},remove:async({questionSlug:P})=>{try{await k().delete(`${Pe}/${encodeURIComponent(P)}`)}catch(L){const I=await U(L);throw new Error(I)}},update:async({questionSlug:P},L)=>{try{return await k().put(`${Pe}/${encodeURIComponent(P)}`,L)}catch(I){const B=await U(I);throw new Error(B)}}};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:tt,ENDPOINTS:{REPLIES:Ge,ANSWERS:qe,QUESTIONS:Ve,LIKES:_e}}}}=_,Me=`${tt}${Ve}`,Xe=({questionSlug:P,answerSlug:L,replySlug:I},B=!1)=>{let X=`${Me}/${encodeURIComponent(P)}${qe}/${encodeURIComponent(L)}${Ge}`;return I&&(X=`${X}/${encodeURIComponent(I)}`,B&&(X=`${X}${_e}`)),X};var rt={create:async({questionSlug:P,answerSlug:L},I)=>{try{return await k().post(Xe({questionSlug:P,answerSlug:L}),I)}catch(B){const X=await U(B);throw new Error(X)}},update:async({questionSlug:P,answerSlug:L,replySlug:I},B)=>{try{return await k().put(Xe({questionSlug:P,answerSlug:L,replySlug:I}),B)}catch(X){const ye=await U(X);throw new Error(ye)}},remove:async({questionSlug:P,answerSlug:L,replySlug:I})=>{try{await k().delete(Xe({questionSlug:P,answerSlug:L,replySlug:I}))}catch(B){const X=await U(B);throw new Error(X)}},like:async({questionSlug:P,answerSlug:L,replySlug:I},B)=>{try{await k().post(Xe({questionSlug:P,answerSlug:L,replySlug:I},!0),B)}catch(X){const ye=await U(X);throw new Error(ye)}},unlike:async({questionSlug:P,answerSlug:L,replySlug:I})=>{try{await k().delete(Xe({questionSlug:P,answerSlug:L,replySlug:I},!0))}catch(B){const X=await U(B);throw new Error(X)}},getReplyUrl:Xe};const{APIS:{CONTENT_INTERACTION_API:{BASE_URL:Mt,ENDPOINTS:{QUESTIONS:vt,ANSWERS:De,LIKES:_t}}}}=_,Dt=`${Mt}${vt}`;var Ke={answers:Z,questions:je,replies:rt,likes:{create:async(P,L)=>{try{return await k().post(`${Dt}/${encodeURIComponent(P)}${De}/${encodeURIComponent(L)}${_t}`)}catch(I){const B=await U(I);throw new Error(B)}},remove:async(P,L)=>{try{return await k().delete(`${Dt}/${encodeURIComponent(P)}${De}/${encodeURIComponent(L)}${_t}`)}catch(I){const B=await U(I);throw new Error(B)}}}};const{APIS:{FEATURES_API:{BASE_URL:Ut,ENDPOINTS:{FLAGS:b}}}}=_,m=`${Ut}${b}`;var g={flags:{read:async P=>{let L=null;try{const{data:I}=await k().get(`${m}/${encodeURIComponent(P)}`);I!=null&&I.name&&(I!=null&&I.featureState)&&(L=I)}catch(I){await U(I)}return L}}};const{APIS:{MANAGEMENT_API:{BASE_URL:T,ENDPOINTS:{ACCOUNTS:N}}}}=_;var M={create:async P=>{try{await k().post(`${T}${N}`,P)}catch(L){throw await U(L),L}},read:async P=>{let L=null;try{({data:L}=await k().get(`${T}${N}/${encodeURIComponent(P)}`))}catch(I){await U(I)}return L},update:async(P,L)=>{try{await k().put(`${T}${N}/${encodeURIComponent(P)}`,L)}catch(I){throw await U(I),I}}};const{APIS:{MANAGEMENT_API:{BASE_URL:H,ENDPOINTS:{BULK_ENROLMENTS:le}}}}=_;var Se={create:async P=>{try{await k().post(`${H}${le}`,P)}catch(L){throw await U(L),L}}};const{APIS:{MANAGEMENT_API:{BASE_URL:Ee,ENDPOINTS:{EVENT_REGISTRATIONS:Oe}}}}=_;var ge={create:async P=>{try{await k().post(`${Ee}${Oe}`,P)}catch(L){const I=await U(L);throw new Error(I)}}};const{APIS:{MANAGEMENT_API:{BASE_URL:rr,ENDPOINTS:{LOGINS:Jr,LOGIN_PASSWORDLESS:Et}}}}=_,nr=`${rr}${Jr}`;var ir={accounts:M,bulkEnrolments:Se,eventRegistrations:ge,passwordless:{update:async P=>{try{await k().put(`${nr}/${encodeURIComponent(P)}${Et}`)}catch(L){throw await U(L),L}}}};const{APIS:{PAYMENTS_API:{BASE_URL_V2:Xr,ENDPOINTS:{PRODUCTS:Zn}}}}=_,Zr=`${Xr}${Zn}`;var ei={products:{list:async P=>{let L=[],I=P?{params:P}:{params:{}};try{const{data:B}=await k().get(Zr,I);B&&B.length&&(L=B)}catch(B){await U(B)}return L}}};const{APIS:{PEOPLE_API:{BASE_URL_V2:en,ENDPOINTS:{BULK_ENROLMENTS:tn}}}}=_;var ti={list:async P=>{let L=[];try{const{data:I}=await k().get(`${en}${tn}`,{params:P});I&&I.length&&(L=I)}catch(I){await U(I)}return L}},ri=d(25);const{OK:rn,MULTIPLE_CHOICES:ni,NOT_FOUND:ii,FORBIDDEN:oi}=ri.StatusCodes,nn=P=>P>=rn&&P<ni||P===oi||P===ii,{APIS:{PEOPLE_API:{BASE_URL_V2:A,ENDPOINTS:{USERS:z}}}}=_,J=async P=>{let L=null;try{const{data:I}=await k().get(`${A}${z}/${encodeURIComponent(P)}`,{validateStatus:nn});I&&I.id&&(L=I)}catch(I){await U(I)}return L},se=async P=>{let L=[];try{if(P&&P.length<2)throw new Error("users list method requires at least two ids");const I=P.map(X=>`ids=${encodeURIComponent(X)}`).join("&"),B=await k().get(`${A}${z}?${I}`,{validateStatus:nn});B&&B.length&&(L=B)}catch(I){await U(I)}return L};var me={read:J,update:async(P,L)=>{let I=!1;try{const{data:B}=await k().put(`${A}${z}/${encodeURIComponent(P)}`,L);I=!(!B||!B.id)}catch(B){await U(B)}return I},list:se};const{APIS:{PEOPLE_API:{BASE_URL_V2:ve,ENDPOINTS:{USERS:de,USER_LIKES:fe}}},USERS:{MYSELF:Ue}}=_,Ce=`${ve}${de}/${Ue}${fe}`,Re=async P=>{let L=[],I=P?{params:P}:{params:{}};try{const{data:B}=await k().get(Ce,I);B&&B.length&&(L=B)}catch(B){await U(B)}return L};var ze={list:Re},wt={authors:{readQuestionAuthors:async(P,L,I)=>{try{if(P.author=await J(P.authorId),P.answers&&P.answers.length&&!I.ignoreAnswersAuthors){P.answers.sort((X,ye)=>new Date(ye.updatedAt)-new Date(X.updatedAt)),P.totalAnswers=P.answers.length;let B=P.answers;if(I.limit&&I.pageNumber){const X=I.limit*(I.pageNumber-1);B=P.answers.slice(X,X+I.limit)}for(let X of B){X.author=X.authorId&&await J(X.authorId)||{};const[ye]=L?await Re({contentType:_.CONTENTFUL.ANSWERS.TYPE,contentSlug:X.slug}):[null];X.userLiked=!!ye}P.answers=B}else P.answers||(P.answers=[]);return P}catch(B){throw await U(B),new Error(`Cannot read authors for question: ${B.message}`)}},readAuthors:async(P=[])=>{let L=[];try{if(Array.isArray(P)===!1)throw new Error("authorIds is not an array!");if(P&&P.length===1){const I=await J(P[0]);I&&L.push(I)}else if(P&&P.length>1){const I=await se(P);I&&I.length>0&&(L=I)}}catch(I){throw await U(I),new Error(`Cannot read authors: ${I.message}`)}return L}}};const{APIS:{PEOPLE_API:{BASE_URL:on,ENDPOINTS:{REGISTRATIONS:Ze}}}}=_;var nd={list:async P=>{let L=[];try{const{data:I}=await k().get(`${on}${Ze}`,{params:P});I&&I.length&&(L=I)}catch(I){await U(I)}return L}};const{APIS:{PEOPLE_API:{BASE_URL_V2:id,ENDPOINTS:{USERS:od,USER_COURSES:ad}}},USERS:{MYSELF:sd}}=_,ai=`${id}${od}/${sd}${ad}`;var cd={create:async P=>{try{await k().post(ai,P)}catch(L){await U(L)}},list:async P=>{let L=[],I=P?{params:P}:{params:{}};try{const{data:B}=await k().get(ai,I);B&&B.length&&(L=B)}catch(B){await U(B)}return L},update:async(P,L)=>{try{await k().put(`${ai}/${P}`,L)}catch(I){await U(I)}}};const{APIS:{PEOPLE_API:{BASE_URL_V2:ud,ENDPOINTS:{USERS:ld,USER_EVENTS:fd}}},USERS:{MYSELF:dd}}=_,pd=`${ud}${ld}/${dd}${fd}`;var hd={list:async P=>{let L=[],I=P?{params:P}:{params:{}};try{const{data:B}=await k().get(pd,I);B&&B.length&&(L=B)}catch(B){await U(B)}return L}};const{APIS:{PEOPLE_API:{BASE_URL_V2:md,ENDPOINTS:{USERS:gd,USER_LESSONS:yd}}},USERS:{MYSELF:vd}}=_,La=`${md}${gd}/${vd}${yd}`;var _d={create:async P=>{let L=null;try{L=await k().post(La,P)}catch(I){await U(I)}return L},list:async P=>{let L=[],I=P?{params:P}:{params:{}};try{const{data:B}=await k().get(La,I);B&&B.length&&(L=B)}catch(B){await U(B)}return L}};const{APIS:{PEOPLE_API:{BASE_URL_V2:Ed,ENDPOINTS:{USERS:wd,USER_PRODUCTS:bd}}},USERS:{MYSELF:Sd}}=_,si=`${Ed}${wd}/${Sd}${bd}`;var Od={create:async P=>{let L=null;try{L=await k().post(si,P)}catch(I){await U(I)}return L},list:async P=>{let L=[],I=P?{params:P}:{params:{}};try{const{data:B}=await k().get(si,I);B&&B.length&&(L=B)}catch(B){await U(B)}return L},update:async(P,L)=>{try{await k().put(`${si}/${P}`,L)}catch(I){await U(I)}}};const{APIS:{PEOPLE_API:{BASE_URL_V2:Td,ENDPOINTS:{USERS:xd,USER_RATINGS:Ad}}},USERS:{MYSELF:Rd}}=_,Fa=`${Td}${xd}/${Rd}${Ad}`;var Bt={bulkEnrolments:ti,handlers:wt,registrations:nd,users:me,userCourses:cd,userEvents:hd,userLessons:_d,userLikes:ze,userProducts:Od,userRatings:{create:async P=>{let L=null;try{const{data:I}=await k().post(Fa,P);I!=null&&I.id&&(L=I)}catch(I){await U(I)}return L},update:async(P,L)=>{try{await k().put(`${Fa}/${P}`,L)}catch(I){await U(I)}}}};const{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:Cd,ENDPOINTS:{ENQUIRY_EMAILS:Nd}}}}=_;var Pd={create:async P=>{let L=null;try{const{data:I}=await k().post(`${Cd}${Nd}`,P);I&&(L=I)}catch(I){await U(I)}return L}},Id={forms:{sendEnquiryEmails:async P=>{let L=null;try{const{emailIds:I}=W;L=await ja.emails.create({...I,...P})}catch(I){await U(I)}return L}}};const{APIS:{PEOPLE_ENGAGEMENT_API:{BASE_URL:kd,ENDPOINTS:{USERS:Ld,USER_PROPERTIES:Fd}}},USERS:{MYSELF:jd}}=_;var ja={emails:Pd,handlers:Id,userProperties:{update:async(P,L)=>{try{await k().put(`${kd}${Ld}/${jd}${Fd}/${P}`,L)}catch(I){await U(I)}}}},Md=d(130);const{APIS:{SEARCH_API:{BASE_URL:Dd,ENDPOINTS:{SEARCH:Ud}}}}=_,Bd=`${Dd}${Ud}`;var $d={ask:async P=>{try{let L=null;const{data:I}=await k().get(Bd,{params:{question:P}});return I!=null&&I.answer&&(I!=null&&I.references)&&(I!=null&&I.version)&&(L=I),L}catch(L){const I=await U(L);throw new Error(I)}},stream:(P,L,I)=>{const B=(0,Md.io)(void 0,{path:"/api/search-api/web-sockets"});function X(){B.emit("search",{question:P})}function ye(Ne){I(Ne),Te(),B.disconnect()}function Te(){B.off("connect",X),B.off("update",L),B.off("result",ye)}return B.on("connect",X),B.on("update",L),B.on("result",ye),Te}};const{CONTENTFUL:qd}=_,{CARD_TYPES:Ma}=qd.CAROUSELS;var Da={read:async(P,L)=>{try{if(!L||!L.sys||!L.sys.id)throw new Error("Invalid link to card");if(!P||!Ma[P])throw new Error("Unsupported card content type");const{INCLUDE:I,SELECT:B}=Ma[P];return await(0,p.getEntry)({content_type:P,"sys.id":L.sys.id,include:I,select:B},{assetDetails:!0})}catch(I){throw await U(I),new Error(`Cannot read carousel card: ${I.message}`)}}};const{CONTENTFUL:Hd}=_,{INCLUDE:Wd,SELECT:Gd,TYPE:Vd}=Hd.EDITORIAL_PAGES;var Qd={read:async P=>{try{return await(0,p.getEntry)({content_type:Vd,"fields.slug":P,include:Wd,select:Gd})}catch(L){throw await U(L),new Error(`Cannot read editorial page: ${L.message}`)}}};const{CONTENTFUL:zd}=_,{TYPE:Ua,ORDER:Yd,SELECT:Ba,SKIP:Kd,LIMIT:Jd,INCLUDE:Xd}=zd.QUESTIONS;var $a={read:async P=>{try{return await(0,p.getEntry)({content_type:Ua,"fields.slug":P,include:2,select:Ba})}catch(L){throw await U(L),new Error(`Cannot read question: ${L.message}`)}},list:async(P={})=>{try{return await(0,p.getEntries)({content_type:Ua,include:Xd,limit:Jd,order:Yd,select:Ba,skip:Kd,...P})}catch(L){throw await U(L),new Error(`Cannot list questions: ${L.message}`)}}},Zd=async(P,L,I={ignoreAnswersAuthors:!1})=>{try{let B={};return B=await $a.read(P),B=await Bt.handlers.authors.readQuestionAuthors(B,L,I),B}catch(B){throw await U(B),new Error(`Cannot build question: ${B.message}`)}};const{ARTICLES:{TYPE:ep},COURSES:{TYPE:tp},EVENTS:{TYPE:rp},LISTS:{TYPE:np},QUESTIONS:{TYPE:ip},LEARNING_HUB:{TYPE:op}}=_.CONTENTFUL,or=P=>P&&P.url?(Object.assign(P,{aspect:"responsiveCard",query:"q=90&fit=fill"}),P):null,ci={[ep]:async P=>{const{authorIds:L,authorTag:I,image:B,publishedDate:X,readingTime:ye,slug:Te,title:Ne}=P,Je=await Bt.handlers.authors.readAuthors(L),nt=Je&&Je.length?Je:I?[I]:null;return{banner:or(B),contributors:nt,publishedDate:X,readingTime:ye,slug:Te,title:Ne}},[tp]:async(P,L)=>{const{banner:I,freeCourse:B,partnershipDetails:X,slug:ye,title:Te,registered:Ne}=P,Je={banner:or(I),slug:ye,title:Te,pill:B?"free":"premium",registered:!!Ne};if(X){const{partners:nt}=X;Je.partner=nt&&nt.length&&X.partners[0]}if(Ne===void 0&&L){const[nt]=await Bt.userProducts.list({courseSlug:ye,isEnrolled:!0,scope:"active"});Je.registered=!!nt}return Je},[rp]:async(P,L)=>{const{bannerImage:I,defaultStartDate:B,isEventOngoing:X,slug:ye,speakers:Te,title:Ne,registered:Je}=P,nt=new Date(B),fp=!!nt&&nt<new Date;if(Te&&Te.length)for(const an of Te)an.image=(ui=an.image)&&ui.url?`${ui.url}?w=100&h=100&fit=thumb&f=center`:null;var ui;const qa={banner:or(I),dateHasPassed:fp,title:Ne,slug:ye,isOngoingEvent:X,contributors:Te,startDate:nt,registered:!!Je};if(Je===void 0&&L){const[an]=await Bt.userEvents.list({eventSlug:ye});qa.registered=!!an}return qa},[np]:async P=>{const{hero:L,slug:I,title:B}=P;return{banner:or(L),slug:I,title:B}},[ip]:async P=>{const{answers:L,authorId:I,createdAt:B,slug:X,title:ye}=P;let Te=null;if(I){const Ne=await Bt.users.read(I);Ne&&(Te=Ne)}return{answers:L&&L.length?L.length:0,contributors:Te?[Te]:[],createdAt:B,slug:X,title:ye}},[op]:P=>{const{bannerSection:L,customLabel:I,slug:B,title:X}=P;return{banner:or(L.image),slug:B,title:X,customLabel:I}},people:P=>{const{id:L,name:I,jobTitle:B,location:X,image:ye}=P;return{profile:ye,slug:L,title:I,text:B,secondaryText:X}}};var ap=async({contentType:P,...L}={},I)=>{try{if(!ci[P])throw new Error("Content type not supported");if(typeof ci[P]!="function")throw new Error("No builder function for content type");return P!=="people"&&L.sys&&L.sys.type&&L.sys.type==="Link"&&(L=await Da.read(P,L)),{contentType:P,...await ci[P](L,I)}}catch(B){throw await U(B),new Error(`Cannot build carousel card: ${B.message}`)}},sp=async(P,L,I={})=>{try{if(!P.replies||P.replies.length===0)return P.replies=[],P;P.replies.sort((X,ye)=>new Date(X.createdAt)-new Date(ye.createdAt)),P.totalReplies=P.totalReplies||P.replies.length;let B=P.replies;if(I.limit&&I.pageNumber){const X=I.limit*(I.pageNumber-1);B=P.replies.slice(X,X+I.limit)}for(const X of B){if(X.authorId===P.authorId){X.author=P.author,X.userLiked=!1;continue}X.author=X.authorId&&await J(X.authorId)||{};const[ye]=L?await Re({contentType:_.CONTENTFUL.REPLIES.TYPE,contentSlug:X.slug}):[null];X.userLiked=!!ye}return P.replies=B,P}catch(B){throw await U(B),new Error(`Cannot build replies for answer: ${B.message}`)}},cp=d(408);const up=P=>P&&cp.Buffer.from(P,"base64").toString("ascii");function lp({contentContext:P=null,errorsContext:L=null,gtmContext:I=null,origin:B}){try{const X=(ye=>{let Te=null;ye?Te=ye:typeof window<"u"&&(Te=window.origin||window.location.origin),Te||new Error("Cannot select environment: Website not defined");let Ne=null;const Je=Te.match(w);return Je?Ne=Je[1].split(x)[0]:Te===S?Ne=O:Te.includes(v)&&(Ne=F),Ne||new Error(`Cannot select environment: No rule for website ${Te}`),Ne})(B);return P&&(0,p.setContext)(Object.assign({},P,{environment:X})),L&&(0,h.setContext)(Object.assign({},L,{environment:X})),I&&((0,y.setContext)(Object.assign({},I,{environment:X})),(0,y.setupGTM)()),(({environment:ye})=>{const Te=(Ne=>{if(!Ne)throw new Error("Cannot map environment: Environment not defined");if(!D[Ne])throw new Error(`Cannot map environment: No mapping found for environment ${Ne}`);return D[Ne]})(ye);W.emailIds=R[Te]})(Object.assign({},{environment:X})),X}catch(X){console.warn(`Cannot load SDK: ${X.message}`)}}}(),f}()})})(Nu);var mv=Nu.exports;const Ir={Off:"off",On:"on",Cookie:"cookie"},gv=e=>{const[t]=ia.useCookies(),[n,r]=j.useState(null),[s,o]=j.useState(!1),[l,i]=j.useState(Ir.Off);return j.useEffect(()=>{e&&mv.features.flags.read(e).then(u=>{i(u.featureState),r(null)}).catch(u=>{i(Ir.Off),r(u)})},[e]),j.useEffect(()=>{switch(l){case Ir.Off:o(!1);break;case Ir.On:o(!0);break;case Ir.Cookie:o(!!t[`feature-${e}`]);break;default:o(!1)}},[l,t]),{isFeatureActive:s,error:n}};function yv(e,t,n){var r=this,s=j.useRef(null),o=j.useRef(0),l=j.useRef(null),i=j.useRef([]),u=j.useRef(),c=j.useRef(),a=j.useRef(e),d=j.useRef(!0);j.useEffect(function(){a.current=e},[e]);var f=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var p=!!(n=n||{}).leading,h=!("trailing"in n)||!!n.trailing,y="maxWait"in n,_=y?Math.max(+n.maxWait||0,t):null;j.useEffect(function(){return d.current=!0,function(){d.current=!1}},[]);var S=j.useMemo(function(){var v=function(R){var W=i.current,Q=u.current;return i.current=u.current=null,o.current=R,c.current=a.current.apply(Q,W)},w=function(R,W){f&&cancelAnimationFrame(l.current),l.current=f?requestAnimationFrame(R):setTimeout(R,W)},x=function(R){if(!d.current)return!1;var W=R-s.current;return!s.current||W>=t||W<0||y&&R-o.current>=_},O=function(R){return l.current=null,h&&i.current?v(R):(i.current=u.current=null,c.current)},F=function R(){var W=Date.now();if(x(W))return O(W);if(d.current){var Q=t-(W-s.current),k=y?Math.min(Q,_-(W-o.current)):Q;w(R,k)}},D=function(){var R=Date.now(),W=x(R);if(i.current=[].slice.call(arguments),u.current=r,s.current=R,W){if(!l.current&&d.current)return o.current=s.current,w(F,t),p?v(s.current):c.current;if(y)return w(F,t),v(s.current)}return l.current||w(F,t),c.current};return D.cancel=function(){l.current&&(f?cancelAnimationFrame(l.current):clearTimeout(l.current)),o.current=0,i.current=s.current=u.current=l.current=null},D.isPending=function(){return!!l.current},D.flush=function(){return l.current?O(Date.now()):c.current},D},[p,y,t,_,h,f]);return S}function Of(e,t,n){var r=n===void 0?{}:n,s=r.leading,o=r.trailing;return yv(e,t,{maxWait:t,leading:s===void 0||s,trailing:o===void 0||o})}let Ro;const Vr=(e=!0,t=!1)=>{if(!e)return;const[n,r]=j.useState(0)||[!1,()=>{}];j.useEffect(()=>(o(),window.addEventListener("resize",l),()=>{clearTimeout(Ro),l.flush(),window.removeEventListener("resize",l)}),[]);const s=()=>window.innerWidth,o=()=>{r(s())},l=Of(()=>{s()!==n&&(t&&(clearTimeout(Ro),document.body.classList.add("is-resizing"),Ro=setTimeout(()=>{document.body.classList.remove("is-resizing")},550)),o())},500,{leading:!0});return n},Tf=({scrollPosition:e=0,offset:t={down:0,up:10},callbacks:{scrollDown:n=()=>{},scrollUp:r=()=>{}}})=>{if(!window)return;const[s,o]=j.useState({current:0,past:0})||[!1,()=>{}],[l,i]=j.useState({scrollDown:!1,scrollUp:!1})||[!1,()=>{}];j.useEffect(()=>(u(),window.addEventListener("scroll",c),()=>{c.flush(),window.removeEventListener("scroll",c)}),[]);const u=()=>{const a=window.scrollY,d=s.current,f=a-d,p=f>0?"down":"up";if(o({current:a,past:d}),p==="down"){a>=e+t.down&&!l.scrollDown&&(!l.scrollUp||f>t.up)&&(n(),i({scrollUp:!1,scrollDown:!0}));return}Math.abs(f)>=t.up&&!l.scrollUp&&(r(),i({scrollUp:!0,scrollDown:!1}))},c=Of(()=>{u()},250);return s},vv=(e=[],t=!0)=>{e=Array.isArray(e)?e:[e];const n=j.useRef(!1);jt(()=>{if(window&&window.location&&window.location.hash){if(n.current)return;const r=document.getElementById(window.location.hash.replace("#",""));r&&(r.scrollIntoView(t?{behavior:"smooth"}:null),n.current=!0)}},e)},_v=(e,t)=>{Array.isArray(t)||(t=[t]);const n=dp(e);return t.forEach(({type:r,value:s})=>{pp(n,r,s)}),n},xf=e=>{const t=[];return e.forEach(n=>{const r=parseInt(n);isNaN(r)||t.push(r)}),t.sort((n,r)=>n-r)},Af=(e,t,n)=>{let r=n.mobile;for(const s in t){const o=parseInt(String(t[s]));if(e>=o)r=n[o];else if(e<o)break}return r},Ev=(e,t="en")=>new Date(e).toLocaleString(t,{weekday:"long",day:"numeric",month:"short",year:"numeric"}),wv=e=>{let o;try{o=new Date().getTime()-new Date(e).getTime()}catch{return""}const l=o/36e5,i=Math.floor(o/864e5);if(i<1)return l<1?{path:"now"}:{path:"hours",number:Math.floor(l)};if(i<7)return{path:"days",number:i};const u=Math.floor(i/7);return u<=52?{path:"weeks",number:u}:{path:"years",number:Math.floor(i/365)}},bv=e=>new Promise(t=>setTimeout(t,e)),wa={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}.
|
|
69
69
|
|
|
70
70
|
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.
|
|
71
71
|
|
|
72
|
-
Thank you for helping to protect the Apolitical community from abusive content.`,discussion_form_title:"Write your {action}",discussion_form_placeholder:"Type your {action} here...",discussion_form_label:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Write something...",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_more:"and {number} more...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_thread_show:"Show {count, plural, =0 {replies} one {# reply} other {# replies}}",discussion_thread_hide:"Hide replies",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",filters_all:"Show all",filters_disabled:"{name} - no results",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_community:"Community",footer_community_support:"Support FAQ",footer_community_post:"Post on Apolitical",footer_community_join:"Who can join",footer_community_guidelines:"Guidelines & values",footer_company:"Company",footer_company_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_correspondence:"Correspondence address",footer_contact_correspondence_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital and data",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",inviteModal_title:"You’re registered",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their emails below",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",joinCommunityButton:"Join community",joinCommunityButton_short:"Join",joinCommunityButton_joining:"Joining...",joinCommunityButton_member:"Member",joinCommunityButton_member_aria:"Leave community",joinCommunityButton_leave:"Leave",joinCommunityButton_leaving:"Leaving...",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll",member_apolitical:"Apolitical",member_community:"Community post",membersList:"Members",membersList_admin:"Admin",moreMenu:"See more options",overlay_close:"Close",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",progressBar:"{number}% loaded",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",sharedLinks_copy_text:"Copy link",tags_community:"From the community",tooltip_loading:"Loading..."},bv={languageSwitcher_label:"Me gustaría leer este artículo en...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traducido por un humano",languageSwitcher_translation_machine:"traducido por máquina",languageSwitcher_disclaimer:"Este contenido fue traducido automáticamente y ocasionalmente tendrá errores de género u otras traducciones directas. Estamos intentando resolver este problema, pero mientras tanto, si notas algún error grave, escríbenos a <link>{email}</link>"},Sv={collapsibleSection_summary:"En savoir plus",languageSwitcher_label:"Je voudrais lire cet article dans...",languageSwitcher_translation_original:"langue originale",languageSwitcher_translation_human:"traduit par un humain",languageSwitcher_translation_machine:"traduit par machine",languageSwitcher_disclaimer:"Ce contenu est traduit automatiquement et contiendra d’évantuelles erreurs de genre ou d’autres traductions directes. Nous essayons de résoudre ce problème, mais en attendant, si vous remarquez une erreur importante, faites-le nous savoir à <link>{email}</link>"},Ov={languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"linguagem original",languageSwitcher_translation_human:"traduzido por um humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, poderão ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos tentando resolver isso, porém se perceber algo errado por favor nos avise em <link>{email}</link>"},Tv=Object.freeze(Object.defineProperty({__proto__:null,en:wa,es:bv,fr:Sv,pt:Ov},Symbol.toStringTag,{value:"Module"})),ot=(e,t,n,r,s={})=>{let o="";return`${t}_${n}`in wa?o=e({id:`${t}_${n}`},s):o=e({id:t},{[r]:n,...s}),o},xv=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let s=n.length-1;s>=0;s--){const o=Math.pow(10,(s+1)*3);if(o<=e){e=Math.round(e*t/o)/t,e===1e3&&s<n.length-1&&(e=1,s++),r=`${e}${n[s]}`;break}}return r},Af=(e,t)=>j.Children.map(e,n=>j.cloneElement(n,{...t})),Av=e=>e.replace(/\s+/g,"").length>0,xe=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:s=!1,element:o="button",onClick:l=!1,className:i="",disabled:u=!1,screenreaderText:c=!1,children:a=!1,...d})=>{const p=Vr(typeof t=="object");if(typeof t=="object"&&typeof p=="number"){const _=Object.assign({},t),S=Tf(Object.keys(_));t=xf(p,S,_)}const h=[];typeof t=="string"&&h.push(t),r&&(h.push("icon"),typeof r=="object"?(h.push(r.icon),r.position?h.push(r.position):h.push("left"),r.hover&&h.push(`hover_${r.hover}`),r.animate&&(h.push("animate"),typeof r.animate=="string"&&h.push(r.animate))):(h.push(r),!r.includes("right")&&!r.includes("left")&&h.push("left"))),n.muted&&h.push("muted"),n.fullWidth&&h.push("full-width");const y={...d,className:ne(e,i,h,{"no-text":!a,disabled:u,button:s}),onClick:_=>{(!s||s[0]==="#")&&l&&(_.preventDefault(),_.stopPropagation()),l&&l(_)},disabled:typeof u=="object"&&"isClickable"in u?!u.isClickable:u};return s&&(o="a",y.href=s),j.createElement(o,y,a||(c?E.jsx(Ue,{showOnFocus:!1,children:c}):null))},Qr=({buttons:e,className:t="",...n})=>{const r=e.length>1?"ul":"p",s=e.map((o,l)=>r==="p"?E.jsx(xe,{...o},l):E.jsx("li",{children:E.jsx(xe,{...o})},l));return j.createElement(r,{className:ne("button-wrapper",t),...n,children:s})};const Jt=({maxWidth:e=!1})=>{const t=e?{"--max-width":`${e/16}rem`}:{};return E.jsx("hr",{className:ne({"has-max-width":e}),style:t})},zr=({href:e,children:t,fallbackElement:n,className:r="",onClick:s,gtmContext:o,gtmType:l,...i})=>{if(e){const u={...i};return s&&(u.onClick=s),o&&(u["data-gtm-event-context"]=o),l&&(u["data-gtm-event-type"]=l),E.jsx("a",{href:e,className:ne("gtm-trackable",r),...u,children:t})}return n?j.createElement(n,{children:t,className:r,...i}):t},vu={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"}},Rv=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:s}=e?vu[e]:vu.fallback;return{range:t&&t.length>0?t:r,sizes:n||s}},Cv=({format:e,height:t,query:n,width:r})=>{let s=`w=${r}&h=${t}`;return s=e?`${s}&fm=${e}`:s,s=n?`${s}&${n}`:s,s},Co=({format:e,range:t,url:n,query:r})=>t.map(({height:s,width:o})=>`${n}?${Cv({format:e,height:s,query:r,width:o})} ${o}w`).join(", ");const Rf=({image:e,className:t,testId:n})=>{const{description:r,height:s,type:o,query:l,url:i,width:u,loading:c,decoding:a,fetchPriority:d}=e,{range:f,sizes:p}=Rv(e),h=Co({format:"avif",query:l,range:f,url:i}),y=Co({format:"webp",query:l,range:f,url:i}),_=Co({format:"",query:l,range:f,url:i});return E.jsxs("picture",{className:t,children:[o!=="image/gif"&&E.jsx("source",{type:"image/avif",srcSet:h,sizes:p,"data-testid":"source"}),E.jsx("source",{type:"image/webp",srcSet:y,sizes:p,"data-testid":"source"}),E.jsx("img",{srcSet:_,sizes:p,src:i,alt:r,loading:c||"lazy",decoding:a||"async",fetchpriority:d||"auto",width:u,height:s,"data-testid":n||"image"})]})};let kr=!1;const Cf=({isOpen:e=!1,isLoading:t=!1,children:n})=>{const r=ue.useIntl(),s=j.useRef(null),[o,l]=j.useState("hidden");j.useEffect(()=>{const u=s.current;if(u)return u.addEventListener("transitionend",i),()=>{u.removeEventListener("transitionend",i)}},[]);const i=({propertyName:u})=>{u==="opacity"&&(kr!==!1&&clearTimeout(kr),l(c=>c==="opening"?"open":c==="closing"?"closed":c==="closed"?"hidden":c))};return jt(()=>{kr!==!1&&clearTimeout(kr);let u="open";e?l("opening"):(l("closing"),u="hidden"),kr=setTimeout(()=>{l(u)},300)},[e]),E.jsx("aside",{ref:s,className:ne("tooltip text-medium",o,{loading:t}),hidden:o==="hidden",children:t?E.jsx("p",{children:r.formatMessage({id:"tooltip_loading"})}):typeof n=="string"?E.jsx("p",{children:n}):n})};const ba=({children:e,className:t="",...n})=>E.jsx("section",{className:ne("full-width-section",t),...n,children:e});const Nv=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(s=>{r.push({href:s.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable","data-gtm-event-type":"download-click","data-gtm-event-context":s.eventContext||"Download",target:"_blank",children:s.text})}),E.jsx(ba,{className:ne("download-section",n),children:E.jsxs(E.Fragment,{children:[j.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),E.jsx(Qr,{buttons:r})]})})};const Pv=({title:e=!1,logos:t=[],className:n=""})=>{const r=t.length;if(r===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:""};return E.jsxs("div",{className:ne("logos",n),children:[e&&j.createElement(s.element,{className:"title"},s.text),E.jsx("ul",{className:ne({"two-col":r===2||r===4,"three-col":r===5||r<=10&&r%3===0}),children:t.map(({logo:o,nameOfBusiness:l,link:i=!1,description:u=!1},c)=>{if(!o||!o.url)return null;const a=E.jsx("img",{src:o.url,width:o.width||"auto",height:o.height||"auto",alt:l});return E.jsxs("li",{children:[E.jsx("p",{className:"img-wrapper",children:i?E.jsx("a",{href:i,target:"_blank",rel:"nofollow noreferrer noopener",children:a}):a}),u&&E.jsx("small",{children:u})]},window.btoa(`${o.url}_${c}`))})})]})};const Iv=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],kv=({content:e,image:t,variant:n="default",spacing:r="normal",cta:s,children:o})=>{const l=["eyebrow","title","text"],i={eyebrow:"small",title:"h1",text:"p"},u={};return l.forEach(c=>{if(!e[c]){u[c]=!1;return}if(typeof e[c]=="object"){u[c]=e[c];const{text:a,element:d}=e[c];if(d&&Iv.includes(d.toLowerCase()))return;u[c]={text:a,element:i[c]};return}u[c]={text:e[c],element:i[c]}}),s&&s.link&&s.link[0]==="#"&&(s.props||(s.props={}),s.props.onClick=c=>{c.preventDefault(),c.stopPropagation();const a=document.getElementById(s.link.substring(1));a&&a.scrollIntoView({behavior:"smooth"})}),E.jsx(ba,{className:ne("banner-section",n,r,{"has-image":t,"has-extra-spacing":r==="normal"&&u.eyebrow&&u.title}),children:E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"content-wrapper",children:[l.map(c=>{if(u[c]&&typeof u[c]=="object"){const{text:a,element:d=""}=u[c];return j.createElement(d.toLowerCase(),{key:c,className:c},a)}return null}),o,s&&s.text&&s.link&&E.jsx(xe,{variant:t||n==="light"?"primary":"secondary",size:{mobile:"medium",768:"large"},href:s.link,...s.props,children:s.text})]}),t&&E.jsx(Rf,{image:{...t,aspect:"banner"}})]})})},Lv=j.memo(kv);const Fv=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:s})=>!n&&!r?null:E.jsxs("aside",{className:ne("marketing-block",e),children:[n&&E.jsx("p",{className:"title",children:n}),r&&E.jsx("p",{children:r}),t&&E.jsx(xe,{variant:"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":s,"data-gtm-event-type":"learn-more-click",children:t.text})]}),Bn="https://storage.googleapis.com/apolitical-assets/",Gt={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},jv="200,000+";const Sa=({label:e=!1,className:t="",children:n})=>{const r=ue.useIntl();return E.jsxs("details",{className:ne("collapsible-section",t),children:[E.jsx("summary",{children:e||r.formatMessage({id:"collapsibleSection_summary"})}),E.jsx("div",{className:"content",children:n})]})};const gt=({variant:e="primary",className:t="",children:n,...r})=>E.jsx("div",{className:ne("highlighted-text-box",e,t),...r,children:n});const Yr=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let s=n&&!!Object.keys(n).length;const o=typeof n=="object"&&"breakpoints"in n,l=Vr(o);if(o&&typeof n=="object"&&typeof l=="number"){const d=Object.assign({},n.breakpoints),f=Tf(Object.keys(d));s=xf(l,f,d)}const{breakpoints:i,text:u="",component:c,...a}=n;return E.jsx(gt,{variant:"subtle",className:ne("empty-state-box",e,r),children:E.jsxs(E.Fragment,{children:[t&&E.jsx(Wn,{options:{forceBlock:!0},children:t}),s&&typeof n=="object"&&(c||E.jsx(xe,{...a,variant:n.variant?n.variant:"secondary",children:u}))]})})};const ta=({children:e,...t})=>E.jsx("p",{...t,children:e}),Nf={q:ta,blockquote:ta};for(let e=1;e<=6;e++)Nf[`h${e}`]={component:ta,props:{className:"title"}};const Pf=({type:e="default",className:t="",heading:n=!1,children:r})=>E.jsxs("div",{className:ne("helper-text-box text-small",e,t),children:[n&&E.jsx("p",{className:"title",children:n}),typeof r=="string"?E.jsx(Wn,{options:{wrapper:j.Fragment,forceBlock:!0,overrides:Nf},children:r}):E.jsx("p",{children:r})]});const Mv=({className:e="",show:t=!1,hide:n=!1,text:r,children:s})=>{const o=ue.useIntl(),l=j.useRef(null),[i,u]=j.useState(""),[c,a]=j.useState("closed");j.useEffect(()=>{const p=l.current;if(p)return p.addEventListener("transitionend",d),()=>{p.removeEventListener("transitionend",d)}},[]),j.useEffect(()=>{if(!r||typeof r!="string")return;const p=r.split(`
|
|
72
|
+
Thank you for helping to protect the Apolitical community from abusive content.`,discussion_form_title:"Write your {action}",discussion_form_placeholder:"Type your {action} here...",discussion_form_label:"Your {action}",discussion_form_explainer:"Try to make your {action} specific and practical. Be respectful and kind. See our <a>community guidelines</a>",discussion_form_success:"Your {action} has been submitted.",discussion_form_post:"Post",discussion_form_posting:"Posting...",discussion_form_save:"Save",discussion_form_saving:"Saving...",discussion_form_cancel:"Cancel",discussion_form_submitting:"Submitting...",discussion_form_placeholder_post:"Write something...",discussion_form_error:"We are unable to process your {action} right now. Please try again later or contact us if the problem persists",discussion_form_error_tooLong:"Please keep your content to {maxLength, plural, one {1 character} other {# characters}}.",discussion_form_error_tooMany:"You have posted too many times in a row. Please wait and try again.",discussion_form_error_loggedOut:"Please log in to submit your {action}.",discussion_form_error_noPermission:"You do not have permission to {action}.",discussion_form_error_alreadyExists:"This {action} already exists.",discussion_form_title_question:"Start a conversation",discussion_form_placeholder_question:"Ask your question here",discussion_form_explainer_question:"Unsure what you can post? See our <a>community guidelines</a>.",discussion_likes:"{number, plural, =0 {0 likes} one {# like} other {# likes}}",discussion_likes_short:"{number}",discussion_likes_more:"and {number} more...",discussion_likes_like:"Like this {action}",discussion_likes_unlike:"Unlike {action}",discussion_moreMenu_edit:"Edit",discussion_moreMenu_delete:"Delete",discussion_moreMenu_report:"Report",discussion_comments_screenReader:"See {count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_comments:"{count, plural, =0 {0 comments} one {# comment} other {# comments}}",discussion_responses_answer:"Answers",discussion_responses_comment:"Comments",discussion_responses_title:"{action} ({count})",discussion_responses_empty:"Be the first to respond",discussion_responses_empty_answer:"Be the first to answer this question",discussion_thread_show:"Show {count, plural, =0 {replies} one {# reply} other {# replies}}",discussion_thread_hide:"Hide replies",emailHelperTextBox_fallback_title:"Who can join",emailHelperTextBox_fallback_text:"Apolitical is a private community for public servants and policymakers.",emailHelperTextBox_default_title:"Who can join",emailHelperTextBox_default_text:"Apolitical is a private community for public servants and policymakers. <link>Learn more</link>.",emailHelperTextBox_autoApproved_title:"Email check",emailHelperTextBox_autoApproved_text:"Great! Looks like you are using a **government email domain we recognise.** You will be **auto-approved** once you sign up.",emailHelperTextBox_unrecognisedEmail_title:"Not a recognised government email",emailHelperTextBox_unrecognisedEmail_text:"To confirm you work in government or policy, please add more details below. <link>Learn more</link>.",emailHelperTextBox_pendingApproval_title:"Email is pending approval",emailHelperTextBox_pendingApproval_text:"Looks like this email has been used to sign up to Apolitical before, but <strong>we have not yet approved it.</strong> If you cannot wait to join, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_emailUnverified_title:"Hello again!",emailHelperTextBox_emailUnverified_text:"It looks like you're already an Apolitical member. To access your account, please verify your email address. <link>Click here to get a verification code sent to your email</link>.",emailHelperTextBox_emailAlreadyExists_title:"Email is already registered",emailHelperTextBox_emailAlreadyExists_text:"Looks like this email has been used to sign up to Apolitical before, try <link>logging in</link> instead. If you're still having issues, contact <mail>concierge@apolitical.co</mail>.",emailHelperTextBox_error_verificationFailedToSend_title:"Verification code failed to send",emailHelperTextBox_error_verificationFailedToSend_text:"Error details: <em>{error}</em>{br}<link>Click here to try again</link>.{br}If you continue to have problems, contact us at <mail>concierge@apolitical.co</mail>",emailHelperTextBox_error_noFunction:"Cannot resend verification code.",filters_all:"Show all",filters_disabled:"{name} - no results",footer_platform:"Platform",footer_platform_events:"Events",footer_platform_courses:"Courses",footer_platform_qanda:"Q&A",footer_platform_articles:"Articles",footer_community:"Community",footer_community_support:"Support FAQ",footer_community_post:"Post on Apolitical",footer_community_join:"Who can join",footer_community_guidelines:"Guidelines & values",footer_company:"Company",footer_company_story:"Our story",footer_company_team:"Meet our team",footer_company_careers:"Careers",footer_company_partner:"Partner with us",footer_company_contact:"Get in touch",footer_legal:"Legal",footer_legal_privacy:"Privacy policy",footer_legal_terms:"Terms & conditions",footer_legal_cookie:"Cookie policy",footer_legal_accessibility:"Accessibility statement",footer_legal_dataProtection:"Data protection officer",footer_legal_euDataProtection:"EU data protection officer",footer_contact:"Contact",footer_contact_correspondence:"Correspondence address",footer_contact_correspondence_address:"251 Southwark Bridge Road{br}London, SE1 6FL{br}United Kingdom",footer_contact_registered:"Registered address",footer_contact_registered_address:"20–22 Wenlock Road{br}London, N1 7GU{br}United Kingdom",footer_contact_berlin:"Berlin address",footer_contact_berlin_address:"Torstraße 220{br}10115 Berlin{br}Germany",footer_contact_support:"For platform support",footer_contact_business:"For business inquiries",footer_social_linkedin:"LinkedIn",footer_social_twitter:"Twitter",footer_social_facebook:"Facebook",footer_copyright:"Copyright © {currentYear} Apolitical Group Limited",form_fieldWrapper_required:"required",form_fieldWrapper_characterLimit:"Character limit:",form_error_generalError:"Sorry, something has gone. Please refresh the page and try again.",form_error_required:"Please fill in this required field",form_error_numbers:"Numbers are not allowed in this text field",form_error_email:"Please enter a valid email address",form_error_url:"Please enter a valid URL",form_submit:"Submit",form_submitting:"Submitting form...",form_submitted:"Submitted",header_skip:"Skip to main content",header_search_show:"Show search bar",header_search_hide:"Close search bar",header_menu_show:"Show navigation",header_menu_hide:"Close navigation",header_home_loggedOut:"Home",header_home_loggedIn:"My Home",header_topics:"Topics",header_topics_explore:"Explore",header_topics_explore_events:"Events",header_topics_explore_courses:"Courses","header_topics_explore_q-and-a":"Q&A",header_topics_explore_articles:"Articles",header_topics_topics:"Topics",header_topics_topics_climate:"Climate","header_topics_topics_cities-and-local-government":"Cities and local government","header_topics_topics_digital-and-data":"Digital and data",header_topics_topics_education:"Education","header_topics_topics_equity-justice-and-inclusion":"Equity, justice and inclusion","header_topics_topics_health-and-social-care":"Health and social care",header_topics_topics_innovation:"Innovation","header_topics_topics_leadership-and-skills":"Leadership and skills","header_topics_topics_life-in-government":"Life in government",header_topics_topics_policymaking:"Policymaking","header_topics_topics_transport-and-infrastructure":"Transport and infrastructure","header_topics_topics_work-and-the-economy":"Work and the economy",header_partners:"For partners",header_account:"My account",header_account_show:"Show account menu",header_account_hide:"Close account menu",header_account_profile:"My profile",header_account_settings:"Settings & privacy","header_account_log-out":"Log out",header_buttons_login:"Log in",header_buttons_signup:"Sign up",hideShowTextBox_hide:"View less",hideShowTextBox_show:"View more",inviteModal_title:"You’re registered",inviteForm_email_placeholder:"Add email addresses...",inviteForm_title:"Know someone who might like to join this workshop?",inviteForm_label:"Invite your colleagues by typing or pasting their emails below",inviteForm_ctaMessage:"Send",inviteForm_success:"Invitation Sent!",inviteForm_error:"Something went wrong!",inviteForm_ctaTryAgain:"Try again!",inviteForm_ctaSendMoreInvites:"Send more invites",inviteForm_ctaDone:"Done",joinCommunityButton:"Join community",joinCommunityButton_short:"Join",joinCommunityButton_joining:"Joining...",joinCommunityButton_member:"Member",joinCommunityButton_member_aria:"Leave community",joinCommunityButton_leave:"Leave",joinCommunityButton_leaving:"Leaving...",languageSwitcher_label:"I would like to read this article in...",languageSwitcher_translation_original:"original language",languageSwitcher_translation_human:"translated by person",languageSwitcher_translation_machine:"translated by machine",languageSwitcher_selected:"{language} - currently selected",languageSwitcher_disclaimer:"This content is machine translated and will occasionally get gendered language or other direct translations wrong. We’re trying to resolve this but in the meantime, if you notice something very wrong, let us know at <link>{email}</link>",loadMore_button:"Load more",loadMore_endOfFeed:"You're all caught up",loadMore_error:"We're having trouble loading more content. Please refresh the page or try again later.",loadingBlock_loading:"Loading...",loadingBlock_almostDone:"Almost done...",loadingBlock_complete:"Complete!",markdown_collapsibleSection_summary:"Resources",markdown_skip_video:"Skip past video",markdown_skip_padlet:"Skip past interactive board",markdown_skip_poll:"Skip past poll",markdown_skip:"Skip to next section",markdown_iframe_title:"Course information",markdown_iframe_video:"Video",markdown_iframe_padlet:"Interactive board",markdown_iframe_poll:"Poll",member_apolitical:"Apolitical",member_community:"Community post",membersList:"Members",membersList_admin:"Admin",moreMenu:"See more options",overlay_close:"Close",pageLayout_error:"An error occurred while rendering this page. Please refresh the page or try again later.",passwordRules_intro:"We advise you not to use your name or email in your password.",passwordRules_rule_label:"Password",passwordRules_rule_8Characters:"must be longer than 8 characters",passwordRules_rule_numberSymbol:"must include a number and a symbol",passwordRules_rule_lowercaseUppercase:"must include both lower and upper case characters",passwordRules_notMet:"Your password does not meet this requirement",progressBar:"{number}% loaded",ratings_text:"Rate answer",ratings_stars:"{number} out of {total}",ratings_low:"this is incorrect or confusing",ratings_high:"this is a fantastic answer",ratings_success:"Thank you!",search_label:"Search for:",search_placeholder:"Ask Apolitical",search_clear:"Clear search",search_cta:"Search",signup_title:"Sign up",signup_full_name:"Full name",signup_full_name_placeholder:"Lionel Messi",signup_email_address:"Work email",signup_email_address_placeholder:"lionel.messi@argentina.gov",signup_job_title:"Job title",signup_job_title_placeholder:"e.g. Senior Policy Advisor",signup_organization:"Organisation",signup_organization_placeholder:"e.g. Department of Justice",signup_url:"Link to official government bio / LinkedIn <small>(optional)</small>",signup_url_placeholder:"https://organisation.com/bio",signup_expectation:"What do you want to know<small>Optional, but we will use your response to build the session!</small>",signup_expectation_placeholder:"What do you want to know?",signup_terms:"I accept Apolitical's <terms>Terms of Service</terms>, <privacy>Privacy Policy</privacy> and that I'll get essential emails for my use of Apolitical",signup_error:"We're really sorry, but we've had a problem trying to sign you up. This could be an issue with our system, so we suggest you try again later.",signup_button_join:"Join for free",signup_button_login:"Log in",signup_submitting:"Submitting form...",signup_success_title:"Thank you for applying to join Apolitical!",signup_success_text:"<p>Once we've vetted your application, you'll get a secure login link to help you get started.</p><p>Please note that trust is everything to our community, so you can't login until your identity has been verified.</p>",sharedLinks_copy_text:"Copy link",tags_community:"From the community",tooltip_loading:"Loading..."},Sv={languageSwitcher_label:"Me gustaría leer este artículo en...",languageSwitcher_translation_original:"idioma original",languageSwitcher_translation_human:"traducido por un humano",languageSwitcher_translation_machine:"traducido por máquina",languageSwitcher_disclaimer:"Este contenido fue traducido automáticamente y ocasionalmente tendrá errores de género u otras traducciones directas. Estamos intentando resolver este problema, pero mientras tanto, si notas algún error grave, escríbenos a <link>{email}</link>"},Ov={collapsibleSection_summary:"En savoir plus",languageSwitcher_label:"Je voudrais lire cet article dans...",languageSwitcher_translation_original:"langue originale",languageSwitcher_translation_human:"traduit par un humain",languageSwitcher_translation_machine:"traduit par machine",languageSwitcher_disclaimer:"Ce contenu est traduit automatiquement et contiendra d’évantuelles erreurs de genre ou d’autres traductions directes. Nous essayons de résoudre ce problème, mais en attendant, si vous remarquez une erreur importante, faites-le nous savoir à <link>{email}</link>"},Tv={languageSwitcher_label:"Eu gostaria de ler este artigo em...",languageSwitcher_translation_original:"linguagem original",languageSwitcher_translation_human:"traduzido por um humano",languageSwitcher_translation_machine:"traduzido por máquina",languageSwitcher_disclaimer:"Este conteúdo foi traduzido automaticamente e, ocasionalmente, poderão ocorrer erros de linguagem de gênero ou outras traduções diretas. Estamos tentando resolver isso, porém se perceber algo errado por favor nos avise em <link>{email}</link>"},xv=Object.freeze(Object.defineProperty({__proto__:null,en:wa,es:Sv,fr:Ov,pt:Tv},Symbol.toStringTag,{value:"Module"})),ot=(e,t,n,r,s={})=>{let o="";return`${t}_${n}`in wa?o=e({id:`${t}_${n}`},s):o=e({id:t},{[r]:n,...s}),o},Av=(e,t,n)=>{if(!e||e===0)return"0";t||(t=0),n||(n=["k","m","b","t"]);let r=e.toString();t=Math.pow(10,t);for(let s=n.length-1;s>=0;s--){const o=Math.pow(10,(s+1)*3);if(o<=e){e=Math.round(e*t/o)/t,e===1e3&&s<n.length-1&&(e=1,s++),r=`${e}${n[s]}`;break}}return r},Rf=(e,t)=>j.Children.map(e,n=>j.cloneElement(n,{...t})),Rv=e=>e.replace(/\s+/g,"").length>0,xe=({variant:e="primary",size:t="medium",styling:n={muted:!1,fullWidth:!1},icon:r=!1,href:s=!1,element:o="button",onClick:l=!1,className:i="",disabled:u=!1,screenreaderText:c=!1,children:a=!1,...d})=>{const p=Vr(typeof t=="object");if(typeof t=="object"&&typeof p=="number"){const _=Object.assign({},t),S=xf(Object.keys(_));t=Af(p,S,_)}const h=[];typeof t=="string"&&h.push(t),r&&(h.push("icon"),typeof r=="object"?(h.push(r.icon),r.position?h.push(r.position):h.push("left"),r.hover&&h.push(`hover_${r.hover}`),r.animate&&(h.push("animate"),typeof r.animate=="string"&&h.push(r.animate))):(h.push(r),!r.includes("right")&&!r.includes("left")&&h.push("left"))),n.muted&&h.push("muted"),n.fullWidth&&h.push("full-width");const y={...d,className:ne(e,i,h,{"no-text":!a,disabled:u,button:s}),onClick:_=>{(!s||s[0]==="#")&&l&&(_.preventDefault(),_.stopPropagation()),l&&l(_)},disabled:typeof u=="object"&&"isClickable"in u?!u.isClickable:u};return s&&(o="a",y.href=s),j.createElement(o,y,a||(c?E.jsx(Be,{showOnFocus:!1,children:c}):null))},Qr=({buttons:e,className:t="",...n})=>{const r=e.length>1?"ul":"p",s=e.map((o,l)=>r==="p"?E.jsx(xe,{...o},l):E.jsx("li",{children:E.jsx(xe,{...o})},l));return j.createElement(r,{className:ne("button-wrapper",t),...n,children:s})};const Jt=({maxWidth:e=!1})=>{const t=e?{"--max-width":`${e/16}rem`}:{};return E.jsx("hr",{className:ne({"has-max-width":e}),style:t})},zr=({href:e,children:t,fallbackElement:n,className:r="",onClick:s,gtmContext:o,gtmType:l,...i})=>{if(e){const u={...i};return s&&(u.onClick=s),o&&(u["data-gtm-event-context"]=o),l&&(u["data-gtm-event-type"]=l),E.jsx("a",{href:e,className:ne("gtm-trackable",r),...u,children:t})}return n?j.createElement(n,{children:t,className:r,...i}):t},_u={card:{range:[{height:320,width:320},{height:425,width:687},{height:510,width:768}],sizes:"(min-width: 1024px) 720px, 30vw"},responsiveCard:{range:[{height:125,width:200},{height:188,width:300},{height:313,width:500}],sizes:"(min-width: 1024px) 720px, 30vw"},banner:{range:[{height:124,width:425},{height:320,width:768},{height:510,width:1368}],sizes:"(min-width: 1024px) 975px, 50vw"},feed:{range:[{height:270,width:124},{height:320,width:425},{height:425,width:687}],sizes:"(min-width: 1024px) 510px, 20vw"},fallback:{range:[{height:124,width:375},{height:320,width:687},{height:510,width:990}],sizes:"(min-width: 1024px) 885px, 35vw"},thumbnail:{range:[{height:124,width:124},{height:320,width:320},{height:510,width:510}],sizes:"(min-width: 1024px) 453px, 20vw"}},Cv=({aspect:e,range:t,sizes:n})=>{const{range:r,sizes:s}=e?_u[e]:_u.fallback;return{range:t&&t.length>0?t:r,sizes:n||s}},Nv=({format:e,height:t,query:n,width:r})=>{let s=`w=${r}&h=${t}`;return s=e?`${s}&fm=${e}`:s,s=n?`${s}&${n}`:s,s},Co=({format:e,range:t,url:n,query:r})=>t.map(({height:s,width:o})=>`${n}?${Nv({format:e,height:s,query:r,width:o})} ${o}w`).join(", ");const Cf=({image:e,className:t,testId:n})=>{const{description:r,height:s,type:o,query:l,url:i,width:u,loading:c,decoding:a,fetchPriority:d}=e,{range:f,sizes:p}=Cv(e),h=Co({format:"avif",query:l,range:f,url:i}),y=Co({format:"webp",query:l,range:f,url:i}),_=Co({format:"",query:l,range:f,url:i});return E.jsxs("picture",{className:t,children:[o!=="image/gif"&&E.jsx("source",{type:"image/avif",srcSet:h,sizes:p,"data-testid":"source"}),E.jsx("source",{type:"image/webp",srcSet:y,sizes:p,"data-testid":"source"}),E.jsx("img",{srcSet:_,sizes:p,src:i,alt:r,loading:c||"lazy",decoding:a||"async",fetchpriority:d||"auto",width:u,height:s,"data-testid":n||"image"})]})};let kr=!1;const Nf=({isOpen:e=!1,isLoading:t=!1,children:n})=>{const r=ue.useIntl(),s=j.useRef(null),[o,l]=j.useState("hidden");j.useEffect(()=>{const u=s.current;if(u)return u.addEventListener("transitionend",i),()=>{u.removeEventListener("transitionend",i)}},[]);const i=({propertyName:u})=>{u==="opacity"&&(kr!==!1&&clearTimeout(kr),l(c=>c==="opening"?"open":c==="closing"?"closed":c==="closed"?"hidden":c))};return jt(()=>{kr!==!1&&clearTimeout(kr);let u="open";e?l("opening"):(l("closing"),u="hidden"),kr=setTimeout(()=>{l(u)},300)},[e]),E.jsx("aside",{ref:s,className:ne("tooltip text-medium",o,{loading:t}),hidden:o==="hidden",children:t?E.jsx("p",{children:r.formatMessage({id:"tooltip_loading"})}):typeof n=="string"?E.jsx("p",{children:n}):n})};const ba=({children:e,className:t="",...n})=>E.jsx("section",{className:ne("full-width-section",t),...n,children:e});const Pv=({text:e,buttons:t,className:n=""})=>{const r=[];return t.forEach(s=>{r.push({href:s.link,variant:"secondary",size:{mobile:"medium",1024:"large"},className:"gtm-trackable","data-gtm-event-type":"download-click","data-gtm-event-context":s.eventContext||"Download",target:"_blank",children:s.text})}),E.jsx(ba,{className:ne("download-section",n),children:E.jsxs(E.Fragment,{children:[j.createElement(typeof e=="string"?"h2":e.element,{className:"text"},typeof e=="string"?e:e.text),E.jsx(Qr,{buttons:r})]})})};const Iv=({title:e=!1,logos:t=[],className:n=""})=>{const r=t.length;if(r===0)return null;const s={element:typeof e=="object"?e.element:"h2",text:typeof e=="string"?e:typeof e=="object"?e.text:""};return E.jsxs("div",{className:ne("logos",n),children:[e&&j.createElement(s.element,{className:"title"},s.text),E.jsx("ul",{className:ne({"two-col":r===2||r===4,"three-col":r===5||r<=10&&r%3===0}),children:t.map(({logo:o,nameOfBusiness:l,link:i=!1,description:u=!1},c)=>{if(!o||!o.url)return null;const a=E.jsx("img",{src:o.url,width:o.width||"auto",height:o.height||"auto",alt:l});return E.jsxs("li",{children:[E.jsx("p",{className:"img-wrapper",children:i?E.jsx("a",{href:i,target:"_blank",rel:"nofollow noreferrer noopener",children:a}):a}),u&&E.jsx("small",{children:u})]},window.btoa(`${o.url}_${c}`))})})]})};const kv=["small","span","strong","em","p","h1","h2","h3","h4","h5","h6","blockquote","q"],Lv=({content:e,image:t,variant:n="default",spacing:r="normal",cta:s,children:o})=>{const l=["eyebrow","title","text"],i={eyebrow:"small",title:"h1",text:"p"},u={};return l.forEach(c=>{if(!e[c]){u[c]=!1;return}if(typeof e[c]=="object"){u[c]=e[c];const{text:a,element:d}=e[c];if(d&&kv.includes(d.toLowerCase()))return;u[c]={text:a,element:i[c]};return}u[c]={text:e[c],element:i[c]}}),s&&s.link&&s.link[0]==="#"&&(s.props||(s.props={}),s.props.onClick=c=>{c.preventDefault(),c.stopPropagation();const a=document.getElementById(s.link.substring(1));a&&a.scrollIntoView({behavior:"smooth"})}),E.jsx(ba,{className:ne("banner-section",n,r,{"has-image":t,"has-extra-spacing":r==="normal"&&u.eyebrow&&u.title}),children:E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"content-wrapper",children:[l.map(c=>{if(u[c]&&typeof u[c]=="object"){const{text:a,element:d=""}=u[c];return j.createElement(d.toLowerCase(),{key:c,className:c},a)}return null}),o,s&&s.text&&s.link&&E.jsx(xe,{variant:t||n==="light"?"primary":"secondary",size:{mobile:"medium",768:"large"},href:s.link,...s.props,children:s.text})]}),t&&E.jsx(Cf,{image:{...t,aspect:"banner"}})]})})},Fv=j.memo(Lv);const jv=({variant:e="primary",button:t=null,title:n,text:r,gtmContext:s})=>!n&&!r?null:E.jsxs("aside",{className:ne("marketing-block",e),children:[n&&E.jsx("p",{className:"title",children:n}),r&&E.jsx("p",{children:r}),t&&E.jsx(xe,{variant:"secondary",size:"medium",href:t.link,className:"gtm-trackable","data-gtm-event-context":s,"data-gtm-event-type":"learn-more-click",children:t.text})]}),Bn="https://storage.googleapis.com/apolitical-assets/",Gt={general:"hello@apolitical.co",support:"concierge@apolitical.co","data-protection":{default:"dpo@apolitical.co",eu:"dpo.agl@apolitical.foundation"}},Mv="200,000+";const Sa=({label:e=!1,className:t="",children:n})=>{const r=ue.useIntl();return E.jsxs("details",{className:ne("collapsible-section",t),children:[E.jsx("summary",{children:e||r.formatMessage({id:"collapsibleSection_summary"})}),E.jsx("div",{className:"content",children:n})]})};const gt=({variant:e="primary",className:t="",children:n,...r})=>E.jsx("div",{className:ne("highlighted-text-box",e,t),...r,children:n});const Yr=({variant:e="empty",text:t=!1,button:n=!1,className:r=""})=>{let s=n&&!!Object.keys(n).length;const o=typeof n=="object"&&"breakpoints"in n,l=Vr(o);if(o&&typeof n=="object"&&typeof l=="number"){const d=Object.assign({},n.breakpoints),f=xf(Object.keys(d));s=Af(l,f,d)}const{breakpoints:i,text:u="",component:c,...a}=n;return E.jsx(gt,{variant:"subtle",className:ne("empty-state-box",e,r),children:E.jsxs(E.Fragment,{children:[t&&E.jsx(Wn,{options:{forceBlock:!0},children:t}),s&&typeof n=="object"&&(c||E.jsx(xe,{...a,variant:n.variant?n.variant:"secondary",children:u}))]})})};const ta=({children:e,...t})=>E.jsx("p",{...t,children:e}),Pf={q:ta,blockquote:ta};for(let e=1;e<=6;e++)Pf[`h${e}`]={component:ta,props:{className:"title"}};const If=({type:e="default",className:t="",heading:n=!1,children:r})=>E.jsxs("div",{className:ne("helper-text-box text-small",e,t),children:[n&&E.jsx("p",{className:"title",children:n}),typeof r=="string"?E.jsx(Wn,{options:{wrapper:j.Fragment,forceBlock:!0,overrides:Pf},children:r}):E.jsx("p",{children:r})]});const Dv=({className:e="",show:t=!1,hide:n=!1,text:r,children:s})=>{const o=ue.useIntl(),l=j.useRef(null),[i,u]=j.useState(""),[c,a]=j.useState("closed");j.useEffect(()=>{const p=l.current;if(p)return p.addEventListener("transitionend",d),()=>{p.removeEventListener("transitionend",d)}},[]),j.useEffect(()=>{if(!r||typeof r!="string")return;const p=r.split(`
|
|
73
73
|
`);u(p.length<3?`${r.substring(0,400)}...`:p.slice(0,3).join(`
|
|
74
|
-
`))},[r]),j.useEffect(()=>{c==="ready-to-close"&&a("closing")},[c]);const d=({propertyName:p})=>{p==="max-height"&&a(h=>h==="opening"?"open":h==="closing"?"closed":h)};if(!r)return null;const f=["opening","open"].includes(c);return E.jsxs(gt,{variant:"subtle",className:ne("hide-show-text-box",e),children:[E.jsxs("div",{ref:l,className:ne("content",c),children:[E.jsx(Wn,{options:{forceBlock:!0},children:c==="closed"?i:r}),c!=="closed"&&s]}),E.jsx("p",{className:"cta",children:E.jsx(xe,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:ne({"rotate-180":f}),onClick:()=>{a(f?"ready-to-close":"opening")},children:f?n||o.formatMessage({id:"hideShowTextBox_hide"}):t||o.formatMessage({id:"hideShowTextBox_show"})})})]})},Dv=()=>j.Fragment,Uv=({children:e})=>E.jsx(gt,{variant:"secondary",children:e}),Bv=["span","strong","h1","h2","h3","h4","h5","h6","p"],$v=({children:e})=>{const t=ue.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const o of j.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number"))if(j.isValidElement(o)&&o.type==="summary"){if(o.props&&o.props.children){for(const l of j.Children.toArray(o.props.children))if(!(!l||typeof l=="string"||typeof l=="number")&&j.isValidElement(l)){const i=l.type;if(Bv.includes(i)){for(n=l.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(o);const s=n?n.toString():"";return E.jsx(Sa,{label:s,className:["Sources","Resources"].includes(s)?"discrete-links":"",children:r.map(o=>o)})},qv=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return E.jsx(gt,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return E.jsx(gt,{variant:"primary",children:e});case"pink-textbox":return E.jsx(gt,{variant:"tertiary",children:e});default:return E.jsx("div",{...t,children:e})}return E.jsx("div",{...t,children:e})},Hv=e=>{const t=ue.useIntl(),n=Date.now().toString();let r="default";const s=e.src;return s.includes("youtube")||s.includes("vimeo")?r="video":s.includes("riddle")||s.includes("sli.do")?r="poll":s.includes("padlet")&&(r="padlet"),E.jsxs(E.Fragment,{children:[E.jsx(Ue,{children:E.jsx("a",{href:`#content-after-iframe-${n}`,children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})})}),E.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),E.jsx("span",{id:`content-after-iframe-${n}`,tabIndex:-1})]})},_u=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},Wv=({children:e,...t})=>{let n={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(n.target="_blank");let r=e,s=!1;for(const o of j.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&j.isValidElement(o)){const l=o.type;if(["button","center","span","strong"].includes(l)&&o.props&&o.props.children&&o.props.children[0])for((l==="button"||_u(o.props.children[0])==="button")&&(s=!0),r=o.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!j.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&_u(r)==="button"&&(s=!0);else break}return s?(n={...n,className:"button primary medium"},E.jsx("p",{className:"center",children:E.jsx(xe,{variant:"primary",size:"medium",...n,children:r})})):E.jsx("a",{...n,children:r})},If=({children:e})=>E.jsx("span",{children:e});const ra=({className:e="",options:t={},children:n})=>{n=n.replace(/^<br\/?>/,"");const r={wrapper:j.Fragment,forceBlock:!0,overrides:{a:Wv,CollapsibleSection:Sa,TextBox:gt,CaseStudy:Uv,style:Dv,details:$v,div:qv,iframe:Hv}};return E.jsx("div",{className:ne("markdown-text",e),children:E.jsx(Wn,{options:{...r,...t},children:n})})};const kf=({size:e="medium",variant:t="default",className:n="",children:r})=>E.jsx("span",{className:ne("pill",e,t,n),children:r});const $n=({element:e="p",children:t=null,className:n="",...r})=>j.createElement(e,{...r,className:ne("status-banner text-small",n),"aria-live":"assertive"},t);const Gv=({progress:e=0,text:t=!1,className:n=""})=>{const r=ue.useIntl(),s=e>75?100:e>50?75:e>25?50:e>5?25:0,o={"--progress":`${e}%`};return E.jsx("span",{className:ne(`progress-bar section-${s}`,n),style:o,children:E.jsx(Ue,{children:t?`${e} ${t}`:r.formatMessage({id:"progressBar"},{number:e})})})},Lf=j.memo(Gv);const No="loadingBlock_",Vv=({progress:e=0,steps:t=!1,className:n=""})=>{const r=ue.useIntl();t||(t={0:{text:r.formatMessage({id:`${No}loading`})},75:{text:r.formatMessage({id:`${No}almostDone`})},100:{text:r.formatMessage({id:`${No}complete`})}});let s=null;const o=Object.keys(t);for(let i=0;i<o.length&&!(e<parseInt(o[i]));i++)s=o[i];const l=s&&t[s].icon?{"--icon":`url(${Bn}icons/${t[s].icon}.svg)`}:{};return E.jsxs(gt,{className:ne("loading-block",n,{"has-icon":s&&t[s].icon}),variant:"subtle",style:l,children:[s&&E.jsx("span",{className:"step",children:t[s].text}),E.jsx(Lf,{progress:e})]})},Qv=j.memo(Vv);const st=({element:e="div",className:t="",...n})=>E.jsx(aa,{element:e,className:ne("loading-placeholder",t),...n});const na={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"]},Ff=(e,t)=>e in na?E.jsx("div",{className:e,children:na[e].map((n,r)=>Ff(n,r))},t):E.jsx(st,{className:e},t),jf=({layout:e="overview-page"})=>E.jsx("div",{className:ne("loading-state",e),children:na[e].map((t,n)=>Ff(t,n))}),Mf=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):""},An=["#5AB6A3","#A2D7AF","#806056","#3962B3"],zv=e=>{const t=Math.ceil(26/An.length),n=Mf(e).toLowerCase();if(n==="")return An[0];const r=n.charCodeAt(0)-96;for(let s=0;s<An.length;s++)if(r<=t*(s+1))return An[s]};const Eu=256,Yn=({className:e="",src:t="",name:n,alt:r,width:s=Eu,height:o=Eu,...l})=>{const[i,u]=j.useState(!1),c=j.useRef(null);j.useEffect(()=>{const d=c.current;if(!d)return;const f=d.getContext("2d");if(!f)return;const p=s,h=o;typeof window<"u"&&window.devicePixelRatio&&(d.width=p*window.devicePixelRatio,d.height=h*window.devicePixelRatio,f.scale(window.devicePixelRatio,window.devicePixelRatio)),f.fillStyle=zv(n),f.fillRect(0,0,p,h),f.font=`${p/3}px Arial`,f.textAlign="center",f.fillStyle="white",f.fillText(Mf(n),p/2,h/1.6)},[n]);let a=!1;return t&&t!==""&&!i&&(t.includes("http")||t.includes("//"))&&(a=!0),E.jsx("figure",{className:ne("profile-picture",e,{error:i}),...l,children:a?E.jsx("img",{src:t,alt:r||n,onError:()=>{u(!0)},width:s,height:o}):E.jsx("canvas",{ref:c})})},Oa=e=>e==="apolitical"?{image:`${Bn}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${Bn}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},Yv=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const s=e!=="",o=t!=="",l=n!=="";if(!s&&!o&&!l)return"";const i=`${e}${s&&o?` — ${t}`:t}`;let u=`${i}${(s||o)&&l?`, ${n}`:n}`;return u.length>r&&(u=i),u.length>r&&(u=oa(u,r)),u};const Kn=({element:e="div",member:t="community",additionalContent:n=!1,gtmContext:r="member",gtmType:s="member-click",className:o=""})=>{const l=ue.useIntl(),i=Oa(t);i.name||(i.name=l.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:u,url:c,image:a}=i,d=Yv(i),f=n&&n.createdAt?Ev(n.createdAt):!1,p=n&&n.createdAt?_v(n.createdAt):"";return j.createElement(e,{className:ne("member text-medium",o),children:E.jsxs(zr,{href:c,gtmType:s,gtmContext:r,onClick:h=>{h==null||h.stopPropagation()},children:[E.jsx(Yn,{name:u,src:a}),E.jsxs("p",{className:"details",children:[E.jsx("strong",{children:u}),n&&E.jsxs("span",{className:"additional-content",children:[n.createdAt&&f&&E.jsx("span",{className:"date",title:p,"aria-label":p,children:l.formatMessage({id:`dates_${f.path}`},{number:f.number})}),n.didEdit&&E.jsx("em",{children:l.formatMessage({id:"discussion_edited"})})]}),d&&E.jsx("small",{children:d})]})]})})};const wu={small:24,medium:48},Df=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:s,showGap:o,showPlaceholders:l}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:i=2,className:u=""})=>{const c=ue.useIntl();return!n||n.length===0?null:j.createElement(e,{className:ne("contributors",u,s,{"has-gap":o}),children:E.jsxs(E.Fragment,{children:[E.jsx("ul",{children:n.map((a,d)=>{let f,p="";if(d<i){const{name:h="",image:y=""}=Oa(a);if(l)return E.jsx(st,{element:"li",className:"contributor"},d);f=E.jsx(Yn,{name:h,src:y,width:wu[s||"medium"],height:wu[s||"medium"]})}else if(d===i){const h=(t||n.length)-i;f=E.jsxs("small",{className:ne({"large-number":h>99}),children:["+",xv(h,0)]}),p="number-left"}return f?E.jsx("li",{className:ne("contributor",p),children:f},d):null})}),r&&E.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?c.formatMessage({id:`member_${n[0]}`}):oa(n[0].name||"",20):null})]})})},Uf=({showDevTools:e=!0,children:t})=>{const n=new Le.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return E.jsxs(Le.QueryClientProvider,{client:n,children:[t,e&&E.jsx(pp.ReactQueryDevtools,{initialIsOpen:!1})]})},Bf=({children:e,locale:t,messages:n})=>{const r=t||"en",s={...Tv[r],...n||{}};return E.jsx(ue.IntlProvider,{locale:r,messages:s,children:e})},yt=j.createContext(null),$f=({children:e,user:t})=>E.jsx(yt.Provider,{value:t,children:e}),Kv=({bootstrap:e,children:t,intl:n})=>{const[r,s]=j.useState({isLoading:!0});return j.useEffect(()=>{e().then(o=>s({...o,isLoading:!1})).catch(()=>s({isLoading:!1}))},[]),E.jsx(Bf,{locale:n==null?void 0:n.locale,messages:n==null?void 0:n.messages,children:E.jsx($f,{user:r,children:E.jsx(Uf,{children:t})})})};const Po="joinCommunityButton",Ta=({isMember:e=!1,isShort:t=!1,functions:{join:n,leave:r}={join:()=>{},leave:()=>{}}})=>{const s=ue.useIntl(),o=j.useContext(yt),l=o&&typeof o.id=="string",[i,u]=j.useState(e),[c,a]=j.useState(e?"joined":"notJoined");j.useEffect(()=>{c==="joining"?a("joined"):c==="leaving"&&a("notJoined")},[i]);const d={},f={};return i&&c!=="leaving"&&(d["data-hover-text"]=s.formatMessage({id:`${Po}_leave`}),d["aria-label"]=s.formatMessage({id:`${Po}_member_aria`}),f["aria-hidden"]="true"),E.jsx(xe,{variant:i?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:i&&c!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async p=>{l&&(p.currentTarget.blur(),i?(a("leaving"),typeof r=="function"&&await r()):(a("joining"),typeof n=="function"&&await n()),u(!i))},className:ne("join-community-button",c,{active:c==="joining"}),disabled:!l,...d,children:E.jsx("span",{className:"text",...f,children:s.formatMessage({id:`${Po}${["joining","leaving"].includes(c)?`_${c}`:i?"_member":t?"_short":""}`})})})};const Io="communityDetails_",Jv=({isMember:e=!1,slug:t,members:{number:n,data:r}={number:void 0,data:[]},className:s="",...o})=>{const l=ue.useIntl(),i=n||(r==null?void 0:r.length)||0;return E.jsxs("div",{className:ne("community-details",s),children:[E.jsx(Jt,{}),E.jsxs("div",{className:"member-details",children:[E.jsxs("div",{className:"top",children:[E.jsxs("h3",{children:[l.formatMessage({id:`${Io}members`}),E.jsx("span",{className:"count",children:i})]}),E.jsx("p",{className:"text-small",children:E.jsx("a",{href:`/communities/${t}/members`,children:l.formatMessage({id:`${Io}viewAll`})})})]}),E.jsx(Df,{contributors:{total:n,data:r!=null&&r.length?r:[{},{},{},{},{}]},styling:{size:"medium",showGap:!0,showPlaceholders:i===0},cutoff:5})]}),E.jsx(Ta,{isMember:e,...o}),e&&E.jsx(xe,{variant:"primary",icon:{icon:"plus"},styling:{fullWidth:!0},children:l.formatMessage({id:`${Io}invite`})})]})};const Xv=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=ue.useIntl();return E.jsxs(E.Fragment,{children:[E.jsx(Ue,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),E.jsx("ul",{className:ne("breadcrumbs text-small",n),children:e.map(({text:s,href:o,current:l=!1},i)=>E.jsxs("li",{children:[l&&E.jsx(Ue,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),E.jsx(zr,{href:l?void 0:o,children:oa(s,t)})]},`${window.btoa(s)}_${i}`))})]})};const Zv=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:s=""})=>{const o=ue.useIntl(),l=t?[{id:"all",text:typeof t!="boolean"&&t.text||o.formatMessage({id:"filters_all"})},...e]:e,[i,u]=j.useState(t?["all"]:[]),c=(a,d)=>{let f=[];i.includes(a)?f=i.filter(p=>p!==a):a==="all"?f=["all"]:n?f=[...i.filter(p=>p!=="all"),a]:f=[a],u(p=>(r&&typeof r=="function"&&r({current:f,previous:p}),f)),d&&typeof d=="function"&&d()};return E.jsx("ul",{className:ne("filters",s),children:l.map(({id:a,text:d,disabled:f=!1,callback:p=()=>{}})=>{let h={};return f&&(h={disabled:!0,"aria-label":o.formatMessage({id:"filters_disabled"},{name:d})}),E.jsx("li",{children:E.jsx("button",{className:ne(a,{selected:i.includes(a)}),onClick:y=>{y.preventDefault(),y.stopPropagation(),c(a,p)},...h,children:d})},a)})})},e_=(e,t)=>{const n=String(e);if(!t||!t.length)return`/${n}`;let r="";return t.forEach(({url:s,position:o})=>{o==="before-lang"?r+=`/${s}`:(r.includes(`/${n}/`)||(r+=`/${n}`),r+=`/${s}`)}),r.includes(`/${n}/`)||(r+=`/${n}`),r};const ko={en:"English",es:"Español",fr:"Français",pt:"Português"},Rn="languageSwitcher_",t_=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:s=()=>{},urlParts:o,variant:l="default",label:i,className:u=""})=>{const c=ue.useIntl(),[a,d]=j.useState(e);if(j.useEffect(()=>{e!==a&&d(e)},[e]),!r||!Object.values(r).some(y=>y&&y.post_name))return null;const p=Object.keys(r),h=a!==e;return E.jsxs("div",{className:ne("language-switcher text-small",l,u),children:[E.jsxs("nav",{children:[l!=="short"&&E.jsx("p",{children:i||c.formatMessage({id:`${Rn}label`})}),E.jsx("ul",{children:p.map(y=>{if(!ko[y])return null;let _={className:y};return a===y?_["aria-label"]=c.formatMessage({id:`${Rn}selected`},{language:ko[y]}):_={..._,href:e_(y,o),onClick:S=>{S.preventDefault(),S.stopPropagation(),d(y),s(y)}},E.jsx("li",{children:E.jsx(zr,{..._,fallbackElement:"span",children:ko[y]})},y)})}),l!=="short"&&!h&&E.jsx("p",{children:c.formatMessage({id:`${Rn}translation_${t?"original":n?"human":"machine"}`})})]}),l!=="short"&&!h&&!t&&!n&&E.jsx("small",{children:c.formatMessage({id:`${Rn}disclaimer`},{email:Gt.support,link:y=>{const _=`mailto:${y}`;return E.jsx("a",{href:_,children:y})}})})]})};const Lo=ue.createIntl({locale:"en",messages:wa}),qf=({page:e=1,length:t=0,limit:n=10,loadNextPage:r=()=>{},icon:s=!1,messages:o={button:Lo.formatMessage({id:"loadMore_button"}),endOfFeed:Lo.formatMessage({id:"loadMore_endOfFeed"}),error:Lo.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:i="LoadMore"})=>{const[u,c]=j.useState(!1),[a,d]=j.useState(!1);if(t<=0||t<n*e)return null;const f=async p=>{try{await r(p)}catch(h){h instanceof Error&&h.message&&h.message.includes("Cannot read items")?d(!0):c(!0)}};return E.jsxs("footer",{className:ne("load-more",l),children:[u&&E.jsx("p",{className:"error",children:o.error}),a?E.jsx("p",{children:o.endOfFeed}):E.jsx(xe,{variant:"secondary",icon:s,onClick:f,"data-gtm-event-context":i,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:o.button})]})};let Cn=!1;const Hf=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const s=ue.useIntl(),o=j.useRef(null),[l,i]=j.useState(!1),u=c=>{o.current&&c.target instanceof HTMLElement&&!o.current.contains(c.target)&&i(!1)};return j.useEffect(()=>(document.addEventListener("click",u,!0),()=>{document.removeEventListener("click",u,!0)})),j.createElement(e,{ref:o,className:ne("more-menu text-medium",r),children:E.jsxs(E.Fragment,{children:[E.jsx(xe,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>i(!l),"aria-haspopup":"true","aria-expanded":l,"aria-controls":t,screenreaderText:s.formatMessage({id:"moreMenu"})}),E.jsx("ul",{id:t,hidden:!l,children:n.map(({href:c,onClick:a,text:d,icon:f,...p},h)=>{const y={...p,onClick:_=>{i(!1),typeof a=="function"&&a(_)},onFocus:()=>{Cn&&(clearTimeout(Cn),Cn=!1)},onBlur:()=>{Cn=setTimeout(()=>{i(!1)},100)}};return c&&(y.href=c),E.jsx("li",{children:E.jsx(xe,{variant:"tertiary",size:"medium",icon:f?{icon:f,position:"left"}:!1,...y,children:d})},`${window.btoa(d)}_${h}`)})})]})})};const xa=({variant:e="default",version:t="default",className:n="",...r})=>E.jsx("p",{className:"logo-wrapper",children:E.jsx("a",{href:"/home/",className:ne("logo",e,t,n),...r,children:E.jsx(Ue,{children:E.jsx(ue.FormattedMessage,{id:"apolitical"})})})});const r_={"2-1":901},n_=({layout:e="2-1",hideOnMobile:t=!1,className:n="",children:r})=>{const s=Vr(!0);let o=r;return j.Children.count(r)===1&&(o=j.Children.toArray(r)[0],o.props&&(o=o.props.children)),E.jsx("section",{className:ne("columns",`layout-${e}`,n),children:j.Children.map(o,(l,i)=>t!==!1&&i===t&&s&&s<r_[e]?null:l)})};const Fo="cookieBanner_",jo=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Mo=new Date(Date.now()+12*30*24*60*60*1e3),Wf=()=>{const e=ue.useIntl(),[t,n,r]=ia.useCookies(jo),[s,o]=j.useState(!t["apol-cookie-banner"]),l=()=>{jo.forEach(a=>{n(a,!0,{path:"/",expires:Mo,domain:a==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),o(!1),window.location.reload()},i=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Mo}),jo.forEach(a=>{if(a==="apol-cookie-banner"){n(a,!0,{path:"/",expires:Mo});return}r(a)}),o(!1)};if(!s)return null;const u=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:i,gtmType:"reject-all"},{id:"accept",onClick:l,gtmType:"accepted-all"}],c=[];return u.forEach(a=>{c.push({variant:a.href?"tertiary":"primary",href:a.href,onClick:a.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${a.gtmType}-click`,children:e.formatMessage({id:`${Fo}buttons_${a.id}`})})}),E.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[E.jsx("h6",{children:e.formatMessage({id:`${Fo}title`})}),E.jsx("p",{children:e.formatMessage({id:`${Fo}text`})}),E.jsx(Qr,{buttons:c})]})},mt={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:Gt["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Gt["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:Gt.support,gtmType:"concierge-email-click"},business:{email:Gt.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 Vt="footer_",qn="SiteFooter",bu=({group:e})=>{const t=mt[e].order||[];let n=!1;return"text"in mt[e]&&(n=mt[e].text),E.jsxs(j.Fragment,{children:[E.jsx("p",{className:"pre-title",children:E.jsx(ue.FormattedMessage,{id:`${Vt}${e}`})}),Array.isArray(t)&&t.length>0&&E.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:s,gtmType:o}=mt[e][r],l={};return["legal"].includes(e)&&(l.target="_blank",l.rel="noopener"),E.jsx("li",{children:E.jsx("a",{href:s,className:"gtm-trackable","data-gtm-event-context":qn,"data-gtm-event-type":o,...l,children:E.jsx(ue.FormattedMessage,{id:`${Vt}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&E.jsx("dl",{className:"text-medium",children:n.order.map(r=>E.jsxs(j.Fragment,{children:[E.jsx("dt",{children:E.jsx(ue.FormattedMessage,{id:`${Vt}${e}_${r}`})}),E.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&E.jsx("address",{children:E.jsx(ue.FormattedMessage,{id:`${Vt}${e}_${r}_address`,values:{br:E.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&E.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":qn,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},Aa=()=>E.jsx("div",{id:"footer",children:E.jsxs("div",{className:"wrapper",children:[E.jsx(aa,{element:"hr"}),E.jsx(xa,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":qn,"data-gtm-event-type":"logo-homepage-link"}),E.jsx("footer",{children:["platform","community","company","contact"].map(e=>E.jsxs("div",{className:"group",children:[E.jsx(bu,{group:e}),Object.keys(mt[e]).includes("child")&&E.jsx(bu,{group:mt[e].child})]},e))}),E.jsx("hr",{}),E.jsxs("div",{className:"sub-footer",children:[E.jsx("ul",{children:Array.isArray(mt.social.order)&&mt.social.order.map(e=>{const t=mt.social[e];return E.jsx("li",{className:e,children:E.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":qn,"data-gtm-event-type":"social-click",children:E.jsx("span",{className:"hidden",children:E.jsx(ue.FormattedMessage,{id:`${Vt}social_${e}`})})})},e)})}),E.jsx("small",{children:E.jsx(ue.FormattedMessage,{id:`${Vt}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})});const Nn="emailHelperTextBox_",i_=({type:e,email:t,redirectPath:n,resendVerificationCode:r})=>{const s=ue.useIntl(),[o,l]=j.useState({path:`${Nn}default`,type:"default",link:{},mail:{},error:""}),[i,u]=j.useState(!1),c=j.useCallback(p=>{p.preventDefault(),p.stopPropagation();const h=y=>{l({path:`${Nn}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:_=>c(_),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:y})};if(typeof r!="function"){h(s.formatMessage({id:`${Nn}error_noFunction`}));return}u(!0),r(t).then(()=>{localStorage.setItem("email",t),window.location.href=n||"/signup/verify-email"}).catch(y=>{h(y.message)}).finally(()=>{u(!1)})},[t,n,r]);j.useEffect(()=>{let p=Nn,h="default",y={},_={};switch(e){case"gov":p+="autoApproved",h="success";break;case"nonGov":p+="unrecognisedEmail",h="error",y={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":p+="pendingApproval",h="error",_={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":p+="emailUnverified",h="error",y={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:S=>c(S),"data-testid":"send-verify-email-click"};break;case"exists":p+="emailAlreadyExists",h="error",y={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:p+="default",y={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}l({...o,path:p,type:h,link:y,mail:_})},[e]);const a={};return["link","mail"].forEach(p=>{a[p]=Object.keys(o[p]).length?h=>E.jsx("a",{...o[p],children:h}):h=>h}),E.jsx(Pf,{type:o.type,heading:i?!1:s.formatMessage({id:`${o.path}_title`}),children:i?E.jsxs(E.Fragment,{children:[E.jsx(st,{element:"span"}),E.jsx(st,{element:"span"})]}):s.formatMessage({id:`${o.path}_text`},{...a,strong:p=>E.jsx("strong",{children:p}),em:p=>E.jsx("em",{children:p}),br:E.jsxs(E.Fragment,{children:[E.jsx("br",{}),E.jsx("br",{})]}),error:o.error})})};const Pn="passwordRules_",Gf="isMoreThanEightCharacters",Vf="includesNumberAndSymbol",Qf="includesLowerAndUppercase",o_={[Gf]:"8Characters",[Vf]:"numberSymbol",[Qf]:"lowercaseUppercase"},a_=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=ue.useIntl();return E.jsxs("aside",{className:ne("password-rules",t),children:[E.jsx("small",{children:n.formatMessage({id:`${Pn}intro`})}),E.jsx("ul",{children:[Gf,Vf,Qf].map(r=>E.jsxs("li",{className:ne({matches:e[r]}),children:[E.jsxs(Ue,{children:[n.formatMessage({id:`${Pn}rule_label`})," "]}),E.jsx("span",{children:n.formatMessage({id:`${Pn}rule_${o_[r]}`})}),!e[r]&&E.jsxs(Ue,{element:"strong",children:[" "," ",n.formatMessage({id:`${Pn}notMet`})]})]},`rule-${r}`))})]})},s_=j.memo(a_);const c_=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:s=()=>{}},className:o="",hasLoaded:l=!1})=>{const i=ue.useIntl(),[u,c]=j.useState({setUp:!1,id:null,rating:null,disabled:!0}),a=async()=>{try{const S=await n();c(v=>({...v,setUp:!0,id:S&&S.id,disabled:!1}))}catch(S){c(v=>({...v,setUp:!0,disabled:!0})),s(S)}};if(j.useEffect(()=>{l&&!u.setUp&&a()},[l]),!l)return E.jsx(st,{className:"rating-placeholder"});const{id:d,rating:f,disabled:p}=u,h="ratings_",y={text:i.formatMessage({id:`${h}text`}),low:i.formatMessage({id:`${h}low`}),high:i.formatMessage({id:`${h}high`}),success:i.formatMessage({id:`${h}success`}),...e},_=async S=>{if(!(!d||p))try{c(v=>({...v,rating:S,disabled:!0})),await r({id:d,value:S})}catch(v){c(w=>({...w,rating:null})),s(v)}finally{c(v=>({...v,disabled:!1}))}};return E.jsxs("div",{className:ne("rating",o),children:[E.jsx("span",{className:"label",children:y[f?"success":"text"]}),E.jsx("ol",{children:Array.from(new Array(t).keys()).map(S=>{const v=S+1;return E.jsx("li",{className:ne({selected:f&&v<=f}),children:E.jsx(xe,{variant:"tertiary",size:"small",icon:{icon:`star${!f||v>f?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${i.formatMessage({id:`${h}stars`},{number:v,total:t})}${v===1||v===t?` - ${y[v===1?"low":"high"]}`:""}`,onClick:w=>{w.preventDefault(),w.stopPropagation(),_(v)},disabled:p})},`rating-${v}`)})})]})};const zf=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:s="search-bar",gtmEvent:o="form-submission"})=>{const{searchIsOpen:l=!0,isDesktopVersion:i=!1}=n||{},u=ue.useIntl(),c=j.useRef(null);jt(()=>{!n||i||!l||c.current&&c.current.focus()},[l]);const a=d=>{d.preventDefault(),d.stopPropagation(),!(!c.current||!c.current.value||c.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(c.current.value)}`)};return E.jsx("form",{onSubmit:a,className:ne("search-form gtm-trackable",t),"data-gtm-event-context":s,"data-gtm-event-type":o,children:E.jsx("fieldset",{id:`${e}-form`,hidden:n?!l:!1,role:"search",children:E.jsxs("p",{children:[E.jsx(Ue,{element:"label",htmlFor:e,children:u.formatMessage({id:"search_label"})}),E.jsx("input",{ref:c,type:"search",id:e,name:e,defaultValue:r,placeholder:u.formatMessage({id:"search_placeholder"}),onKeyDown:d=>{d.key==="Enter"&&a(d)}}),E.jsx("button",{className:"clear",onClick:d=>{d.preventDefault(),d.stopPropagation(),c.current&&c.current.value&&(c.current.value="")},children:E.jsx(Ue,{children:u.formatMessage({id:"search_clear"})})}),E.jsx("button",{className:"search",onClick:a,children:E.jsx(Ue,{children:u.formatMessage({id:"search_cta"})})})]})})})};var Yf={},Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.isEmail=void 0;const u_={requireTld:!0,allowUnderscores:!1,allowTrailingDot:!1},l_={allowDisplayName:!1,requireDisplayName:!1,allowUtf8LocalPart:!0,requireTld:!0},f_=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\,\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i,d_=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,p_=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,h_=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,m_=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;function Su(e,t){let n=0,r;const s=encodeURI(e).split(/%..|./).length-1;return t&&(n=Number(t.min)||0,r=Number(t.max)),s>=n&&(typeof r>"u"||s<=r)}function g_(e,t){t=Object.assign(Object.assign({},u_),t),t.allowTrailingDot&&e[e.length-1]==="."&&(e=e.substring(0,e.length-1));const n=e.split(".");if(t.requireTld){const r=""+n.pop();if(!n.length||!/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(r)||/[\s\u2002-\u200B\u202F\u205F\u3000\uFEFF\uDB40\uDC20]/.test(r))return!1}for(let r,s=0;s<n.length;s++)if(r=n[s],t.allowUnderscores&&(r=r.replace(/_/g,"")),!/^[a-z\u00a1-\uffff0-9-]+$/i.test(r)||/[\uff01-\uff5e]/.test(r)||r[0]==="-"||r[r.length-1]==="-")return!1;return!0}function y_(e,t){if(t=Object.assign(Object.assign({},l_),t),t.requireDisplayName||t.allowDisplayName){const u=e.match(f_);if(u)e=u[1];else if(t.requireDisplayName)return!1}const n=e.split("@"),r=""+n.pop(),s=r.toLowerCase();let o=n.join("@");if((s==="gmail.com"||s==="googlemail.com")&&(o=o.replace(/\./g,"").toLowerCase()),!Su(o,{max:64})||!Su(r,{max:254})||!g_(r,{requireTld:t.requireTld}))return!1;if(o[0]==='"')return o=o.slice(1,o.length-1),t.allowUtf8LocalPart?m_.test(o):p_.test(o);const l=t.allowUtf8LocalPart?h_:d_,i=o.split(".");for(let u=0;u<i.length;u++)if(!l.test(i[u]))return!1;return!0}Kr.isEmail=y_;var Jn={},v_=ce&&ce.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),__=ce&&ce.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),E_=ce&&ce.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&v_(t,e,n);return __(t,e),t},Lr=ce&&ce.__awaiter||function(e,t,n,r){function s(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function i(a){try{c(r.next(a))}catch(d){l(d)}}function u(a){try{c(r.throw(a))}catch(d){l(d)}}function c(a){a.done?o(a.value):s(a.value).then(i,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.ReactMultiEmail=void 0;const Pe=E_(j),Kf=Kr,w_=e=>typeof e>"u"?[]:e.filter(n=>(0,Kf.isEmail)(n));function b_(e){const{id:t,style:n,className:r="",noClass:s,placeholder:o,autoFocus:l,allowDisplayName:i=!1,stripDisplayName:u=!1,allowDuplicate:c=!1,delimiter:a=`[${i?"":" "},;]`,initialInputValue:d="",inputClassName:f,autoComplete:p,getLabel:h,enable:y,onDisabled:_,validateEmail:S,onChange:v,onChangeInput:w,onFocus:x,onBlur:O,onKeyDown:F,onKeyUp:D,spinner:R,disableOnBlurValidation:W=!1}=e,V=Pe.useRef(null),[L,U]=Pe.useState(!1),[$,K]=Pe.useState([]),[Q,C]=Pe.useState(d),[q,Y]=Pe.useState(!1),oe=Pe.useCallback((te,we)=>Lr(this,void 0,void 0,function*(){var Ne;const $e=[];let Fe="";const tt=new RegExp(a,"g"),Ge=S||Kf.isEmail,qe=Ve=>{if(!c){for(let ve=0,je=$.length;ve<je;ve++)if($[ve]===Ve)return!1}return $e.push(Ve),!0};if(te!=="")if(tt.test(te)){const ve=[...new Set(te.split(tt).filter(je=>je))];do{const je=Ge(""+ve[0].trim());if(typeof je=="boolean")if(je)qe(""+ve.shift());else if(i)if(Ge(""+ve[0].trim(),{allowDisplayName:i})){const rt=u?(Ne=ve.shift())===null||Ne===void 0?void 0:Ne.split("<")[1].split(">")[0]:ve.shift();qe(""+rt)}else ve.length===1?Fe=""+ve.shift():ve.shift();else Fe=""+ve.shift();else Y(!0),(yield S==null?void 0:S(te))===!0?(qe(""+ve.shift()),Y(!1)):ve.length===1?Fe=""+ve.shift():ve.shift()}while(ve.length)}else{if(y&&!y({emailCnt:$.length})){_==null||_();return}if(we){const Ve=Ge(te);if(typeof Ve=="boolean")if(Ve)qe(te);else if(i)if(Ge(te,{allowDisplayName:i})){const je=u?te.split("<")[1].split(">")[0]:te;qe(je)}else Fe=te;else Fe=te;else Y(!0),(yield S==null?void 0:S(te))===!0?(qe(te),Y(!1)):Fe=te}else Fe=te}K([...$,...$e]),C(Fe),$e.length&&(v==null||v([...$,...$e])),Fe!==Fe&&(w==null||w(Fe))}),[i,c,a,$,y,v,w,_,u,S]),ee=Pe.useCallback(te=>Lr(this,void 0,void 0,function*(){yield oe(te),w==null||w(te)}),[oe,w]),G=Pe.useCallback((te,we)=>{if(we)return;const Ne=[...$.slice(0,te),...$.slice(te+1)];K(Ne),v==null||v(Ne)},[$,v]),Z=Pe.useCallback(te=>{switch(F==null||F(te),te.key){case"Enter":te.preventDefault();break;case"Backspace":te.currentTarget.value||G($.length-1,!1);break}},[$.length,F,G]),ae=Pe.useCallback(te=>Lr(this,void 0,void 0,function*(){switch(D==null||D(te),te.key){case"Enter":yield oe(te.currentTarget.value,!0);break}}),[oe,D]),Oe=Pe.useCallback(te=>Lr(this,void 0,void 0,function*(){return yield ee(te.currentTarget.value)}),[ee]),ie=Pe.useCallback(te=>Lr(this,void 0,void 0,function*(){U(!1),W||(yield oe(te.currentTarget.value,!0)),O==null||O()}),[W,oe,O]),re=Pe.useCallback(()=>{U(!0),x==null||x()},[x]);return Pe.useEffect(()=>{K(w_(e.emails))},[e.emails]),Pe.createElement("div",{className:`${r} ${s?"":"react-multi-email"} ${L?"focused":""} ${Q===""&&$.length===0?"empty":""}`,style:n,onClick:()=>{var te;return(te=V.current)===null||te===void 0?void 0:te.focus()}},q&&(R==null?void 0:R()),o?Pe.createElement("span",{"data-placeholder":!0},o):null,Pe.createElement("div",{className:"data-labels",style:{opacity:q?.45:1,display:"contents",flexWrap:"inherit"}},$.map((te,we)=>h(te,we,G))),Pe.createElement("input",{id:t,style:{opacity:q?.45:1},ref:V,type:"text",value:Q,onFocus:re,onBlur:ie,onChange:Oe,onKeyDown:Z,onKeyUp:ae,autoFocus:l,className:f,autoComplete:p}))}Jn.ReactMultiEmail=b_;(function(e){var t=ce&&ce.__createBinding||(Object.create?function(r,s,o,l){l===void 0&&(l=o);var i=Object.getOwnPropertyDescriptor(s,o);(!i||("get"in i?!s.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(r,l,i)}:function(r,s,o,l){l===void 0&&(l=o),r[l]=s[o]}),n=ce&&ce.__exportStar||function(r,s){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(Kr,e),n(Jn,e)})(Yf);const Jf=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:s,backgroundColor:o,onClose:l,reportError:i,sendInvites:u,initialFormStatus:c="NOT_SUBMITTED"})=>{const[a,d]=j.useState([]),[f,p]=j.useState(!0),[h,y]=j.useState(c),{formatMessage:_}=ue.useIntl(),S=async x=>{x.preventDefault();try{await u(a),d([]),y("SUCCESS")}catch(O){y("ERROR"),i(O)}},v=x=>{x.preventDefault(),y("NOT_SUBMITTED"),p(!0),d([])},w=x=>{x.preventDefault(),l(),y("CLOSED")};return h==="CLOSED"?null:h==="ERROR"||h==="SUCCESS"?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"content centred",children:h==="SUCCESS"?E.jsx("h2",{className:"success-title",children:_({id:"inviteForm_success"})}):E.jsxs("h2",{className:"error-title",children:[" ",_({id:"inviteForm_error"})]})}),E.jsx(Jt,{}),E.jsx("div",{className:"footer",children:h==="SUCCESS"?E.jsxs(E.Fragment,{children:[E.jsx(xe,{variant:"secondary",onClick:v,children:_({id:"inviteForm_ctaSendMoreInvites"})}),E.jsx(xe,{onClick:w,children:_({id:"inviteForm_ctaDone"})})]}):E.jsx(xe,{onClick:v,children:_({id:"inviteForm_ctaTryAgain"})})})]}):E.jsxs("form",{style:{backgroundColor:o},onSubmit:S,className:ne("invite-form gtm-trackable"),children:[E.jsxs("fieldset",{className:"content",children:[E.jsx("h2",{className:"title",style:{color:r},children:e}),E.jsx("label",{htmlFor:"email-input",className:"label",style:{color:s},children:t}),E.jsx(Yf.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:_({id:"inviteForm_email_placeholder"}),emails:a,onChange:x=>{d(x),p(!x.length)},autoFocus:!1,getLabel:(x,O,F)=>E.jsxs("div",{className:"email text-medium",children:[E.jsx("div",{"data-tag-item":!0,children:x}),E.jsx(xe,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{F(O),p(!a.length)},className:"remove-email-button",screenreaderText:_({id:"overlay_close"})})]},O)})]}),E.jsx(Jt,{}),E.jsx("fieldset",{className:"footer",children:E.jsx(xe,{className:"sendEmailsButton",disabled:f,children:n})})]})},Ee={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=o=>{const l=`logged${e?"In":"Out"}`;return t>=n[o][l]};let s={};return["navigation","search"].forEach(o=>{s[o]=r(o)}),s},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(s=>s===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r})=>{if(n[e]===t||e==="account"&&t===!1&&n.navigation===!0)return;const s=Date.now();if(!t&&Ee.handlerCalled[e]&&s-Ee.handlerCalled[e]<500)return;Ee.handlerCalled[e]=s;let o=[{type:`menus.${e}`,value:t}];t===!0&&Object.keys(n).forEach(l=>{l===e||n[l]===!1||o.push({type:`menus.${l}`,value:!1})}),r(o)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const s=xu(e[r],t);if(!(typeof s>"u")&&(!n||s[t]&&s[t].includes(n)||s.value&&s.value.includes(n)||s.toString().includes(n)))return e[r]}return e[0].children?Ee.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:s})=>{if(!t.current||!t.current.children)return;const o=n?"desktop":"default";if(r[e][o]){r[e][o].focus();return}let l,i;switch(e){case"navigation":if(n){const u=Ee.findFirstChild(t.current.children,"attributes.aria-controls","navigation");l=Ee.findFirstChild(u.children,"href")}else l=Ee.findFirstChild(t.current.children,"href");l||(l=t.current);break;case"account":if(i=Ee.findFirstChild(t.current.children,"className","account"),!i||!i.children)return;l=Ee.findFirstChild(i.children,"href");break;default:return}l&&(s([{type:`focusElements.${e}.${o}`,value:l}]),l.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(Ee.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(Ee.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(Ee.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{Ee.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},Br={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"}}}},Hn=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:s=()=>{},doTrack:o=null})=>{const l=ue.useIntl(),i=xu(Br,e);if(!i||i.onlyShow&&(i.onlyShow==="logged-in"&&!t||i.onlyShow==="logged-out"&&t))return null;const u="doTrack"in i,c=o===null?u?i.doTrack:!0:o,a=e.includes("buttons.");let d=`header_${e.replaceAll(".","_")}`;i.hasVariantText&&(d+=`_logged${t?"In":"Out"}`);let f=!1;if(i.href){let v=i.gtmType||`${e}-click`;if(v.includes(".")){const w=v.split("."),x=w[w.length-2];v=`${x==="topics"?`${x}-`:""}${w[w.length-1]}`}f={href:i.href,role:"menuitem"},c&&(f={...f,className:"gtm-trackable","data-gtm-event-type":v,"data-gtm-event-context":"HeaderButtons"}),a&&(f={...f,variant:"secondary",size:{mobile:"small",881:"large"},...i.props||{}})}const p=i.order&&i.order[0]&&i[i.order[0]],h=p&&i[i.order[0]].order,y=f&&window.location.pathname===i.href;let _={},S={};if(p){const v=i.menuId||e,w={onClick:x=>Ee.events.onClick(x,{id:v,callback:s,isOpen:r[v]}),onFocus:()=>Ee.events.onFocus({id:v}),onBlur:()=>Ee.events.onBlur({id:v,callback:s}),onMouseLeave:()=>Ee.events.onBlur({id:v,callback:s}),onMouseEnter:()=>Ee.events.onMouseEnter({id:v,callback:s})};n&&(h&&(_={...w,onKeyPress:x=>{x.key==="Enter"&&Ee.events.onClick(x,{id:v,callback:s,isOpen:r[v]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":r[v],"aria-controls":v}),S={hidden:v in r?!r[v]:!0}),h||(S={...S,...w})}return E.jsxs("li",{className:ne({[i.className]:i.className,"has-submenu":p,parent:h,active:y}),role:"none",..._,children:[f?j.createElement(a?xe:"a",f,l.formatMessage({id:d})):l.formatMessage({id:d}),i.order&&E.jsx("ul",{...S,children:i.order.map(v=>{if(!i[v])return null;const w={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:s,doTrack:u?c:null};return i[v].order?E.jsxs("li",{className:ne({[i[v].className]:i[v].className}),children:[l.formatMessage({id:`${d}_${v}`}),E.jsx("ul",{children:i[v].order.map(x=>E.jsx(Hn,{id:`${e}.${v}.${x}`,...w},x))})]},v):E.jsx(Hn,{id:`${e}.${v}`,...w},v)})})]},e)};const S_={height:67,height_desktop:83},Ra=()=>{const e=ue.useIntl(),t=j.useContext(yt),n=Vr(!0,!0),r=t&&typeof t.id=="string",s=j.useMemo(()=>Ee.getIsDesktopVersion(r,n),[r,n]),[o,l]=j.useReducer(vv,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:i,menus:u,focusElements:c}=o;Of({scrollPosition:S_[`height${s.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{!s&&u.navigation||Ee.shouldChangeHeaderIsVisible(!0,u,l)},scrollDown:()=>{!s&&u.navigation||Ee.shouldChangeHeaderIsVisible(!1,u,l)}}});const a=(f,p)=>{Ee.handleMenus({id:f,value:p,menus:u,dispatch:l})},d=j.useRef(null);return jt(()=>{u.navigation&&Ee.autoFocus({menu:"navigation",navigationRef:d,isDesktopVersion:s.navigation,focusElements:c,dispatch:l})},[u.navigation]),jt(()=>{u.account&&Ee.autoFocus({menu:"account",navigationRef:d,isDesktopVersion:s.navigation,focusElements:c,dispatch:l})},[u.account]),t&&t.isLoading?null:E.jsxs(E.Fragment,{children:[E.jsxs("nav",{id:"header",className:ne({"logged-in":r,"logged-out":!r,visible:i}),children:[E.jsx(Ue,{element:"a",href:"#content-of-page",children:e.formatMessage({id:"header_skip"})}),E.jsx(xa,{}),!s.navigation&&E.jsx("button",{className:"menu-button gtm-trackable",onClick:f=>{f.preventDefault(),f.stopPropagation(),a("navigation",!u.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":u.navigation,"aria-controls":"navigation",children:E.jsx(Ue,{children:e.formatMessage({id:`header_menu_${u.navigation?"hide":"show"}`})})}),E.jsx("ul",{ref:d,id:"navigation",hidden:s.navigation||u.account?!1:!u.navigation,role:"menu","data-showing":!s.navigation&&u.account?"account":"default",children:Br.order.map(f=>E.jsx(Hn,{id:f,isLoggedIn:r,isDesktopVersion:s.navigation,menus:{navigation:u.navigation,account:u.account},callback:a},f))}),!s.search&&E.jsx("button",{className:"search toggle-search-button",onClick:f=>{f.preventDefault(),f.stopPropagation(),a("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:E.jsx(Ue,{children:e.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),E.jsx(zf,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:s.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),r?E.jsxs("button",{className:"account-button",onClick:f=>Ee.events.onClick(f,{id:"account",callback:a,isOpen:u.account}),onMouseEnter:()=>Ee.events.onMouseEnter({id:"account",callback:a}),onMouseLeave:()=>Ee.events.onBlur({id:"account",callback:a}),"aria-haspopup":"true","aria-expanded":u.account,"aria-controls":"navigation",children:[E.jsx(Ue,{children:e.formatMessage({id:`header_account_${u.account?"hide":"show"}`})}),E.jsx(Yn,{name:t&&t.name||"",src:t&&t.image&&t.image.thumbnail||""})]}):E.jsx("ul",{className:"sign-in-buttons",children:Br.buttons.order.map(f=>E.jsx(Hn,{id:`buttons.${f}`},f))})]}),E.jsx("hr",{id:"content-of-page"}),E.jsx("div",{className:ne("overlay",{open:u.navigation||u.account||!s.search&&u.search})})]})};const O_=()=>{const e=ue.useIntl();return E.jsxs(E.Fragment,{children:[E.jsx(Ra,{}),E.jsx("div",{className:"content",children:E.jsx(Yr,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),E.jsx(Aa,{})]})},T_=({children:e,reportError:t,showFooter:n=!0,background:r="default",className:s="",locale:o="en"})=>{const l=Ru();j.useEffect(()=>{window.scrollTo(0,0)},[l]);const i=Af(e,{locale:o});return E.jsx(hp.ErrorBoundary,{onError:t,fallback:E.jsx(O_,{}),children:E.jsx(j.Suspense,{fallback:E.jsx(jf,{layout:"overview-page"}),children:E.jsx("div",{id:"wrapper",className:ne(s,{[r]:r!=="default"}),children:E.jsxs(ia.CookiesProvider,{children:[E.jsx(Ra,{}),E.jsx("div",{className:"content",children:i}),n&&E.jsx(Aa,{}),E.jsx(Wf,{})]})})})})},Ou={default:"tags_",headerTopics:"header_topics_topics_"},Do={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"},x_={getTagDetails:e=>{if(e.includes("topic_")){if(e=Do.topic[e.replace("topic_","")],e){const t=Br.topics.topics[e].href;return t?{id:e,href:t,text:`${Ou.headerTopics}${e}`}:null}return null}return Do[e]?(e=Do[e],{id:e,text:`${Ou.default}${e}`}):null}};const A_=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:s="",gtmType:o="tag-click",gtmContext:l="tags"})=>{const i=ue.useIntl();if(!e||e.length<1)return null;const u=[];return e.forEach(c=>{if(!c)return;const a=x_.getTagDetails(c);a&&u.push(a)}),u.length<1?null:E.jsx("ul",{className:ne("tags text-small",t,s,{"one-line":n}),children:u.map(c=>{const a=i.formatMessage({id:c.text});return E.jsx("li",{children:c.href&&r?E.jsx("a",{href:c.href,className:"gtm-trackable","data-gtm-event-type":o,"data-gtm-event-context":l,children:a}):a},c.id)})})};const R_=({members:{total:e,data:t=[]},pagination:n,gtmContext:r="member",gtmType:s="member-click",className:o=""})=>{const l=ue.useIntl();return t.length===0?null:(e||(e=t.length),E.jsxs("div",{className:ne("members-list",o),children:[E.jsxs("h1",{children:[l.formatMessage({id:"membersList"}),E.jsx("span",{className:"count",children:e})]}),E.jsx("ul",{children:t.map((i,u)=>E.jsxs("li",{children:[E.jsx(Kn,{member:i,gtmContext:r,gtmType:s}),i.isAdmin&&E.jsx(kf,{children:l.formatMessage({id:"membersList_admin"})})]},u))}),n&&E.jsx(qf,{...n,icon:{icon:"arrow-down",position:"right"},gtmContext:r})]}))};let In=null;const Ye="discussion_form_",Ca=({content:e={type:"response",slugs:{}},userHasPermissions:t=!0,meta:n={isLoading:!1,isInWrapper:!1,isEditing:!1,showTitle:!1},inputRef:r,maxLength:s=5e4,minRows:o=4,forceShow:l={cancel:!1,error:!1},functions:i={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},props:{create:{projectNames:["questions-answers"]}}},gtmContext:u="DiscussionForm"})=>{var W,V;const c=ue.useIntl(),a=j.useContext(yt),[d,f]=j.useState(n.isEditing&&n.isEditing.text||""),[p,h]=j.useState(l.error||!1),[y,_]=j.useState(!1),S=j.useRef(null);if(r||(r=S),n.isLoading)return E.jsx(st,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const v=L=>{const U=L.target.value;f(U);let $;!a||!a.id?$=ot(c.formatMessage,`${Ye}error_loggedOut`,e.type,"action"):t?U.length>=s&&($=`${Ye}error_tooLong`):$=ot(c.formatMessage,`${Ye}error_noPermission`,e.type,"action"),$?h($):p&&h(!1)};let w=`${e.type}-form`;if(e.type==="response"||e.type==="reply"){const L=e.type==="response"?((W=e.slugs)==null?void 0:W.question)||"":((V=e.slugs)==null?void 0:V.answer)||"";L&&(w=`${w}-${L.slice(-15)}`)}const x=async L=>{var $;if(L.preventDefault(),L.stopPropagation(),!a||!a.id||!t||F)return;In&&clearTimeout(In),_("submitting");const U=window.location.pathname;try{let K;switch(e.type){case"post":K=await i.create({content:d});break;case"question":K=await i.create({title:d,authorId:a&&a.id,...($=i.props)==null?void 0:$.create});break;case"response":K=await i.create({question:e.slugs.question},{body:d,authorId:a&&a.id,contentPath:U});break;case"reply":K=await i.create({question:e.slugs.question,answer:e.slugs.answer},{body:d,authorId:a&&a.id,contentPath:U});break;default:break}await wv(1e3),i.callback&&await i.callback(K),In=setTimeout(()=>{f(""),_("submitted"),O()},500)}catch(K){const Q=K;let C=`${Ye}error`;Q.message.includes("entry already exists")&&(C=ot(c.formatMessage,`${Ye}error_alreadyExists`,e.type,"action")),Q.message.includes("429")?C=ot(c.formatMessage,`${Ye}error_tooMany`,e.type,"action"):Q.message.includes("400")&&(C=`${Ye}error`),h(C),O()}},O=()=>{In=setTimeout(()=>{h(!1),_(!1)},5e3)},F=!d||!Av(d),D=y==="submitting",R=[];return(n.isEditing&&!D||l.cancel)&&R.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:i.handleCancel,className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`cancel-${e.type}-click`,disabled:!l.cancel&&(!a||!a.id||!d),children:c.formatMessage({id:`${Ye}cancel`})}),R.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:L=>{if(n.isEditing){_("submitting"),i.handleSaveEdit&&i.handleSaveEdit(S.current&&"value"in S.current?S.current.value:"");return}x(L)},className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`${n.isEditing?"save":"submit"}-${e.type}-click`,"data-testid":"save-button",disabled:!a||!a.id||!t||F||D||n.isEditing&&d===n.isEditing.text,children:c.formatMessage({id:`${Ye}${D?n.isEditing?"saving":"posting":n.isEditing?"save":"post"}`})}),E.jsxs("form",{id:w,className:ne("discussion-card discussion-form",{"no-styling":n.isInWrapper&&n.isEditing}),"data-testid":`discussion-${e.type}-form`,children:[(n==null?void 0:n.showTitle)&&!n.isEditing&&["question"].includes(e.type)&&E.jsx("h2",{children:ot(c.formatMessage,`${Ye}title`,e.type,"action")}),E.jsx(Kn,{member:a||"community",gtmContext:u,gtmType:"profile-click"}),E.jsx(Ue,{element:"label",showOnFocus:!1,htmlFor:`${w}-input`,children:ot(c.formatMessage,`${Ye}label`,e.type,"action")}),E.jsx(mp,{ref:r,id:`${w}-input`,name:e.type,placeholder:ot(c.formatMessage,`${Ye}placeholder`,e.type,"action"),onChange:v,value:d,maxLength:s,"aria-invalid":!!p,"aria-errormessage":"error-message",minRows:o,autoFocus:!!n.isEditing}),E.jsx("small",{children:ot(c.formatMessage,`${Ye}explainer`,e.type,"action",{a:L=>E.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:L})})}),E.jsx(Qr,{buttons:R}),y==="submitted"&&E.jsx($n,{className:"success","data-testid":"success",children:ot(c.formatMessage,`${Ye}success`,e.type,"action")}),p&&E.jsx($n,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof p=="string"?p.includes(" ")?p:c.formatMessage({id:p},{action:c.formatMessage({id:`discussion_action_${e.type}`}),maxLength:s}):p})]})},Na=({contentType:e,createPost:t,membershipRequiredToPost:{isMember:n,required:r,join:s,leave:o,notMemberStateText:l}})=>r&&!n?E.jsx(Yr,{text:l,button:{component:E.jsx(Ta,{functions:{join:s,leave:o}})}}):E.jsx(Ca,{content:{type:e,slugs:{}},functions:{create:t}}),C_={showThread:!1,showForm:!1},Pa=j.createContext(C_),N_=({children:e})=>{const[t,n]=j.useState({showThread:!1,showForm:!1});return E.jsx(Pa.Provider,{value:{...t,updateConversation:n},children:e})},P_=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),I_=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);let Dr=!1;const Uo=()=>{Dr!==!1&&(clearTimeout(Dr),Dr=!1)},Bo=10,Xf=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:s=!1,content:o={type:"reply",slugs:{}},canLike:l=!0,functions:{createLike:i=()=>{},deleteLike:u=()=>{}}={}})=>{const c=ue.useIntl();j.useEffect(()=>{p(s)},[s]);const[a,d]=j.useState(t),[f,p]=j.useState(s),[h,y]=j.useState(!1),[_,S]=j.useState(!1),v=j.useMemo(()=>I_(n,Bo),[n]),w=O=>{if(O.preventDefault(),O.stopPropagation(),S(!1),Dr)return Uo(),!1;if(Uo(),h||!l)return!1;Dr=setTimeout(x,350)},x=async()=>{if(Uo(),h||!l)return!1;let O=f?a-1:a+1;O<0&&(O=0),y(!0),d(O),p(!f);try{if(o&&o.slugs){const F=P_(o.slugs);f?await u(F):await i(F,{contentPath:window.location.pathname})}}catch{d(t),p(s)}finally{y(!1)}};return j.createElement(e,{className:ne("likes-wrapper text-medium action-button",{"show-spinner":h,"is-liked":f,disabled:!l}),onClick:w,onMouseEnter:()=>{S(!0)},onMouseLeave:()=>{S(!1)},onFocus:()=>{S(!0)},onBlur:()=>{S(!1)},children:E.jsxs(E.Fragment,{children:[E.jsx(xe,{variant:"tertiary",size:"medium",icon:{icon:f?"heart":"heart_empty",animate:"bounce"},className:ne({"do-animation":f&&!s}),screenreaderText:l?c.formatMessage({id:`discussion_likes_${f?"unlike":"like"}`},{action:c.formatMessage({id:`discussion_action_${o.type}`})}):!1,onClick:w,disabled:!l,"aria-hidden":!l,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${o.type}-click`}),E.jsx("span",{className:ne("number-of-likes",{"no-likes":a===0}),"data-testid":"number-of-likes",children:c.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:a})}),n&&E.jsx(Cf,{isOpen:_,isLoading:n.length===0,children:n.length&&E.jsxs("ul",{children:[v.map(O=>typeof O=="string"||!O.name?null:E.jsx("li",{children:E.jsx(zr,{href:O.id?`/profiles/${O.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",children:O.name})},O.id||window.btoa(O.name))),n.length>Bo&&E.jsx("li",{children:c.formatMessage({id:"discussion_likes_more"},{number:n.length-Bo})})]})})]})})};const Zf=({element:e="section",children:t,className:n,...r})=>j.createElement(e,{className:ne("modal",n),children:typeof t=="string"?E.jsx("p",{children:t}):t,...r});const Ia=({id:e="content-overlay",isOpen:t=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:s=()=>{},onClose:o=()=>{}}={},forceShow:{error:l=!1}={},title:i,children:u,buttons:c,className:a="",gtmContext:d="Modal"})=>{const f=ue.useIntl(),[p,h]=j.useState(t),y=S=>{h(S),S?(s(),document.body.classList.add("has-overlay")):(o(),document.body.classList.remove("has-overlay"))};j.useEffect(()=>{y(t)},[t]);const _=r?{"--max-width":`${r/16}rem`}:{};return E.jsx("div",{className:ne("overlay",{open:p}),children:E.jsx(Zf,{id:e,className:ne("overlay-modal",a,{"has-max-width":r}),hidden:!p,style:_,children:t&&E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"top",children:[i&&E.jsx("h2",{className:"modal-title",children:i}),E.jsx(xe,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>y(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":d,screenreaderText:f.formatMessage({id:"overlay_close"})})]}),n&&E.jsx(Jt,{}),u,c&&E.jsxs("div",{className:"bottom",children:[E.jsx(Jt,{}),E.jsx(Qr,{buttons:c})]}),l&&E.jsx($n,{className:"error",children:l})]})})})},ed=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const k_=({className:e,showModal:t=!0,title:n,formTitle:r="Know someone who might like to join this workshop?",formLabel:s="Send an invitation to your colleagues below",ctaMessage:o="Send invites",showIcon:l,onClose:i,reportError:u=()=>{},sendInvites:c})=>E.jsx(Ia,{title:n,isOpen:t,showDivider:!1,showIcon:l,className:ne("invite-modal",e,{success:!!n}),children:E.jsx(Jf,{title:r,label:s,ctaMessage:o,onClose:i,sendInvites:c,reportError:u})}),Tu=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t};const pt="discussion_",Xn=({element:e="div",content:t,userHasPermissions:n=!0,isLoading:r=!1,originalAuthorId:s,functions:{content:{createContent:o,deleteContent:l,updateContent:i}={createContent:()=>{},deleteContent:()=>{},updateContent:()=>{}},likes:{createLike:u,deleteLike:c}={createLike:()=>{},deleteLike:()=>{}},comments:{openComments:a}={openComments:()=>{}}},links:d={},className:f,gtmContext:p="DiscussionAnswer",children:h})=>{const y=ue.useIntl(),_=j.useContext(yt),S=j.useContext(Pa),[v,w]=j.useState({body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1}),[x,O]=j.useState(!1),[F,D]=j.useState("");if(j.useEffect(()=>{w({...v,body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),r||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question))return E.jsx(st,{className:"discussion-card discussion-post"});const{author:R,canLike:W,createdAt:V,id:L,likes:U=0,userLiked:$,comments:K=0}=t,Q=_&&_.id&&typeof R!="string"&&R.id&&R.id===_.id||!1,C=typeof W=="boolean"?W:n?!Q:!1,q=async G=>{G||(G=""),D("");try{if(!gp(G,v.body)){const Z=t.type==="question"?{title:G}:{body:G};await i(Tu(t.slugs),Z)}w({body:G,isEditing:!1,didEdit:!0})}catch{D(`${pt}form_error`)}},Y=()=>{S&&S.updateConversation&&S.updateConversation({showThread:!0,showForm:!0}),setTimeout(()=>{const Z=`reply-form-${(t.type==="answer"?t.slug:t.slugs.answer||"").toLowerCase().slice(-15)}`,ae=document.getElementById(Z),Oe=document.getElementById(`${Z}-input`);Oe&&Oe.focus(),ae&&ae.scrollIntoView({behavior:"smooth"})},0)},oe=()=>{try{l(Tu(t.slugs))}catch{D("delete-error")}},ee=[{text:y.formatMessage({id:`${pt}moreMenu_report`}),href:`mailto:community@apolitical.co?subject=${encodeURI(y.formatMessage({id:`${pt}report_subject`}))}&body=${encodeURI(y.formatMessage({id:`${pt}report_body`},{contentType:t.type||"",contentSlug:t.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}))}`,icon:"flag"}];return n&&Q&&ee.push({text:y.formatMessage({id:`${pt}moreMenu_edit`}),onClick:()=>w({...v,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`edit-${t.type}-click`},{text:y.formatMessage({id:`${pt}moreMenu_delete`}),onClick:G=>{G.preventDefault(),G.stopPropagation(),O(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`delete-${t.type}-click`,...ed(`delete-${t.slug}-modal`,x)}),j.createElement(e,{className:ne("discussion-post",f),"data-testid":`discussion-${t.type}-thread`,children:E.jsxs(E.Fragment,{children:[E.jsxs("div",{id:L||t.slug,className:ne("discussion-card",t.type,{editing:v.isEditing,"has-link":d.post&&!v.isEditing}),onClick:G=>{!d.post||v.isEditing||(G.preventDefault(),G.stopPropagation(),window.location.href=d.post)},children:[!v.isEditing&&E.jsx(Kn,{member:R,additionalContent:{createdAt:V,didEdit:v.didEdit},className:typeof R!="string"&&R.id===s?"highlighted":"",gtmContext:p,gtmType:"profile-click"}),v.isEditing?E.jsx(Ca,{content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:r,isInWrapper:!0,isEditing:{text:v.body}},maxLength:t.type==="question"?250:5e4,forceShow:{error:F!==""&&F!=="delete-error"?y.formatMessage({id:F},{action:y.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:o,handleSaveEdit:q,handleCancel:()=>{D(""),w({...v,isEditing:!1})}},gtmContext:`${p}Form`}):d.post?E.jsx("a",{href:d.post,className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":"title-click",children:E.jsx(ra,{options:{overrides:{a:If}},children:v.body})}):E.jsx(ra,{options:{wrapper:t.type==="question"?"h1":j.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question"},children:v.body}),!v.isEditing&&E.jsxs("ul",{className:ne("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[E.jsx(Xf,{element:"li",likes:U,isShort:!1,userLiked:$,content:{type:t.type,slugs:t.slugs},canLike:C,functions:{createLike:u,deleteLike:c}}),(["question","post"].includes(t.type)||d.comments||typeof a=="function")&&E.jsxs("li",{className:"action-button",onClick:G=>{G.preventDefault(),G.stopPropagation(),d.comments&&(window.location.href=d.comments),typeof a=="function"&&a()},children:[E.jsx(xe,{variant:"tertiary",size:"medium",styling:{muted:!0},icon:{icon:"speech-bubble_square_thick"},href:d.comments?d.comments:!1,onClick:d.comments||typeof a!="function"?!1:a,className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:y.formatMessage({id:`${pt}comments_screenReader`},{count:K})}),E.jsx("span",{children:y.formatMessage({id:`${pt}comments`},{count:K})})]}),(t.type==="answer"||t.type==="reply")&&E.jsx("li",{children:E.jsx(xe,{variant:"tertiary",size:"medium",styling:{muted:!0},onClick:Y,children:y.formatMessage({id:`${pt}reply`})})}),E.jsx(Hf,{element:"li",id:`more-${t.slug}`,options:ee})]})]}),h,E.jsx(Ia,{id:`delete-${t.slug}-modal`,isOpen:x,functions:{onOpen:()=>{},onClose:()=>O(!1)},forceShow:{error:F==="delete-error"?y.formatMessage({id:"discussion_delete_error"},{action:y.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:y.formatMessage({id:"discussion_delete_title"},{action:y.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>O(!1),children:y.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:oe,children:y.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:E.jsx(ue.FormattedMessage,{id:"discussion_delete_text",values:{p:G=>E.jsx("p",{children:G}),action:y.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const $o="discussion_responses_",L_=({type:e="answer",responses:t=0})=>{const n=ue.useIntl();return E.jsxs("div",{className:"responses-heading",children:[E.jsx("h3",{children:n.formatMessage({id:`${$o}title`},{action:n.formatMessage({id:`${$o}${e}`}),count:t})}),t===0&&E.jsx("p",{children:ot(n.formatMessage,`${$o}empty`,e,e)})]})};const F_=({isOpen:e=!1,count:t=0,children:n})=>{const r=ue.useIntl(),s=j.useRef(null),[o,l]=j.useState(e),[i,u]=j.useState("closed");j.useEffect(()=>{const f=s.current;if(f)return f.addEventListener("transitionend",c),()=>{f.removeEventListener("transitionend",c)}},[]),jt(()=>{i==="closed"&&!o||u(["opening","open"].includes(i)?"ready-to-close":"opening")},[o]),j.useEffect(()=>{i==="ready-to-close"&&u("closing")},[i]);const c=({propertyName:f})=>{f==="max-height"&&u(p=>p==="opening"?"open":p==="closing"?"closed":p)},a=["opening","open"].includes(i),d=Af(n,{element:"li"});return E.jsxs("div",{className:"thread-wrapper",children:[E.jsx(xe,{variant:"secondary",size:"small",styling:{muted:!0},icon:{icon:`arrow_corner-down_${a?"left":"right"}`},onClick:()=>{l(!o)},children:r.formatMessage({id:`discussion_thread_${a?"hide":"show"}`},{count:t})}),E.jsx("ul",{ref:s,className:ne("thread",i),hidden:!o,children:d})]})},j_=({user:e,content:t,verb:n="post"})=>({actor:{id:e.id,data:{name:e.name,organization:e==null?void 0:e.organization,jobTitle:e==null?void 0:e.jobTitle}},content:t,latest_reactions:{like:[]},reaction_counts:{like:0},verb:n}),M_=({queryClient:e,queryKey:t,user:n,mutationFn:r})=>({mutationFn:r,onMutate:async({content:i})=>{if(!n)return;const u=j_({user:n,content:i,verb:"post"});await e.cancelQueries({queryKey:t});const c=e.getQueryData(t);return e.setQueryData(t,a=>[...a,u]),{previousActivities:c}},onError:(i,u,c)=>{e.setQueryData(t,c.previousActivities)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),D_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityInfo:l,content:{body:i}})=>{if(i.length===0)return;await e.cancelQueries({queryKey:t});const u=e.getQueryData(t),c=u==null?void 0:u.map(a=>((a==null?void 0:a.id)===(l==null?void 0:l.activityId)&&(a.content=i),a));return e.setQueryData(t,()=>c&&[...c]),{previousActivities:c}},onError:(l,i,u)=>{e.setQueryData(t,u.previousActivities)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),U_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityId:i})=>{await e.cancelQueries({queryKey:t});const u=e.getQueryData(t),c=u==null?void 0:u.map(a=>{var d;return(a==null?void 0:a.id)===i&&((d=a.reaction_counts)!=null&&d.like?a.reaction_counts.like+=1:a.reaction_counts.like=1),a});return e.setQueryData(t,()=>c&&[...c]),{previousActivities:c}},onError:(i,u,c)=>{e.setQueryData(t,c.previousActivities)},onSuccess:i=>{const u=e.getQueryData(t),c=u==null?void 0:u.map(a=>((a==null?void 0:a.id)===(i==null?void 0:i.activity_id)&&(a.latest_reactions.like?a.latest_reactions.like.push(i):a.latest_reactions.like=[i]),a));return e.setQueryData(t,()=>c&&[...c]),{previousActivities:u}},onSettled:(i,u,c)=>{e.invalidateQueries({queryKey:[...t,c.activityId]})}}),B_=({queryClient:e,queryKey:t,user:n,mutationFn:r})=>({mutationFn:r,onMutate:async({activityId:u})=>{await e.cancelQueries({queryKey:t});const c=e.getQueryData(t),a=c==null?void 0:c.map(d=>{var f;return(d==null?void 0:d.id)===u&&(f=d.reaction_counts)!=null&&f.like&&(d.reaction_counts.like-=1),d});return e.setQueryData(t,()=>a&&[...a]),{previousActivities:a}},onError:(u,c,a)=>{e.setQueryData(t,a.previousActivities)},onSuccess:(u,{activityId:c})=>{const a=e.getQueryData(t),d=a==null?void 0:a.map(f=>{var p,h,y,_;if(f.id===c){const S=(y=(h=(p=f.latest_reactions)==null?void 0:p.like)==null?void 0:h.find(v=>v.user_id===(n==null?void 0:n.id)))==null?void 0:y.id;return f.latest_reactions.like=(_=f.latest_reactions.like)==null?void 0:_.filter(v=>v.id!==S),f}else return f});return e.setQueryData(t,()=>d&&[...d]),{previousActivities:a}},onSettled:(u,c,a)=>{e.invalidateQueries({queryKey:[...t,a.activityId]})}}),$_=({basePath:e,parentId:t,isMember:n,functions:{list:r,create:s,edit:o,like:l,unlike:i,join:u,leave:c}})=>{const a=ue.useIntl(),d=Le.useQueryClient(),f=j.useContext(yt),{data:p,error:h,isLoading:y,isFetching:_}=Le.useQuery({queryKey:[e,t],queryFn:r}),S=M_({queryClient:d,queryKey:[e,t],user:f,mutationFn:s}),{mutate:v}=Le.useMutation(S),w=D_({queryClient:d,queryKey:[e,t],mutationFn:async L=>await o(L)}),{mutate:x}=Le.useMutation(w),O=U_({queryClient:d,queryKey:[e,t],mutationFn:l}),{mutate:F}=Le.useMutation(O),D=B_({queryClient:d,queryKey:[e,t],user:f,mutationFn:async({activityId:L})=>{var K,Q,C;const U=p&&(p==null?void 0:p.find(q=>q.id===L)),$=(C=(Q=(K=U==null?void 0:U.latest_reactions)==null?void 0:K.like)==null?void 0:Q.find(q=>q.user_id===(f==null?void 0:f.id)))==null?void 0:C.id;await i({reactionId:$||"",activityId:L})}}),{mutate:R}=Le.useMutation(D),W=j.useCallback(({activityId:L})=>F({activityId:L}),[F]),V=j.useCallback(({activityId:L})=>R({activityId:L}),[R]);return h?E.jsx(Yr,{variant:"error",text:h.message}):y?E.jsx(st,{style:{height:"400px"}}):E.jsxs(E.Fragment,{children:[E.jsx(Na,{contentType:"post",createPost:v,membershipRequiredToPost:{isMember:n,required:!0,join:u,leave:c,notMemberStateText:a.formatMessage({id:"community_joinToPost"})}}),!_&&Array.isArray(p)&&(p==null?void 0:p.map(L=>{var U,$,K,Q,C,q,Y,oe,ee,G,Z;return E.jsx(Xn,{content:{type:"post",body:L==null?void 0:L.content,createdAt:(L==null?void 0:L.time)||"",slugs:{parentId:t,activityId:L==null?void 0:L.id},slug:L==null?void 0:L.id,author:{id:(U=L==null?void 0:L.actor)==null?void 0:U.id,name:(K=($=L==null?void 0:L.actor)==null?void 0:$.data)==null?void 0:K.name,organization:(C=(Q=L==null?void 0:L.actor)==null?void 0:Q.data)==null?void 0:C.organization,jobTitle:(Y=(q=L==null?void 0:L.actor)==null?void 0:q.data)==null?void 0:Y.jobTitle,image:{thumbnail:((ee=(oe=L==null?void 0:L.actor)==null?void 0:oe.data)==null?void 0:ee.thumbnail)||void 0}},userLiked:((G=L==null?void 0:L.own_reactions)==null?void 0:G.like)&&((Z=L==null?void 0:L.own_reactions)==null?void 0:Z.like.length)>0,likes:(L==null?void 0:L.reaction_counts.like)||0,comments:(L==null?void 0:L.reaction_counts.reply)||0},links:{post:`${e}/${t}/${L==null?void 0:L.id}`,comments:`${e}/${t}/${L==null?void 0:L.id}`},functions:{content:{createContent:()=>null,deleteContent:()=>null,updateContent:(ae,Oe)=>x({activityInfo:ae,content:Oe})},likes:{createLike:()=>{W({activityId:L==null?void 0:L.id})},deleteLike:()=>{V({activityId:L==null?void 0:L.id})}},comments:{openComments:()=>null}}},L==null?void 0:L.id)}))]})},q_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async()=>{await e.cancelQueries({queryKey:t})},onError:(i,u,c)=>{e.setQueryData(t,c.previousActivity)},onSuccess:i=>{var c;const u=e.getQueryData(t);if(u)return(c=u==null?void 0:u.latest_reactions)!=null&&c.reply?(u.latest_reactions.reply.unshift(i),u&&(u.reaction_counts={reply:u.latest_reactions.reply.length})):(u.latest_reactions={reply:[i]},u.reaction_counts={reply:1}),e.setQueryData(t,()=>({...u})),{previousActivity:u}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),H_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({replyInfo:o,content:{body:l}})=>{var c,a,d;if(l.length===0)return;await e.cancelQueries({queryKey:t});const i=e.getQueryData(t);if(!i||!((c=i==null?void 0:i.latest_reactions)!=null&&c.reply))return;const u=(d=(a=i==null?void 0:i.latest_reactions)==null?void 0:a.reply)==null?void 0:d.map(f=>(f.id===o.replySlug&&(f.data.content=l),f));return e.setQueryData(t,()=>({...i,latest_reactions:{reply:u}})),{previousActivity:i}},onError:(o,l,i)=>{e.setQueryData(t,i.previousActivity)}}),W_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({replyId:l})=>{var c,a;await e.cancelQueries({queryKey:t});const i=e.getQueryData(t),u=(a=(c=i==null?void 0:i.latest_reactions)==null?void 0:c.reply)==null?void 0:a.map(d=>{var f;return d.id===l&&((f=d.children_counts)!=null&&f.like?d.children_counts.like+=1:d.children_counts={like:1}),d});return e.setQueryData(t,()=>({...i,latest_reactions:{reply:u}})),{previousActivity:i}},onError:(l,i,u)=>{e.setQueryData(t,u.previousActivity)},onSuccess:l=>{var c;const i=e.getQueryData(t),u=(c=i==null?void 0:i.latest_reactions.reply)==null?void 0:c.map(a=>(a.id===l.id&&(a.latest_children.like?a.latest_children.like.push(l):a.latest_children.like=[l]),a));return e.setQueryData(t,()=>({...i,latest_reactions:{reply:u}})),{previousActivity:i}}}),G_=({queryClient:e,queryKey:t,user:n,mutationFn:r})=>({mutationFn:r,onMutate:async({replyId:i})=>{var a;await e.cancelQueries({queryKey:t});const u=e.getQueryData(t);if(!u)return;const c=(a=u.latest_reactions.reply)==null?void 0:a.map(d=>(d.id===i&&d.children_counts.like&&(d.children_counts.like-=1),d));return e.setQueryData(t,()=>({...u,latest_reactions:{reply:c}})),{previousActivity:u}},onError:(i,u,c)=>{e.setQueryData(t,c.previousActivity)},onSuccess:(i,{replyId:u})=>{var d;const c=e.getQueryData(t);if(!c)return;const a=(d=c.latest_reactions.reply)==null?void 0:d.map(f=>{var p;return f.id===u?(p=f.latest_children.reply)==null?void 0:p.filter(y=>y.user_id!==(n==null?void 0:n.id)):f});return e.setQueryData(t,()=>({...c,latest_reactions:{reply:a}})),{previousActivity:c}}}),td=({basePath:e,parentId:t,activityId:n,repliesList:r,isMember:s,functions:{createReply:o,editReply:l,like:i,unlike:u,join:c,leave:a}})=>{const d=ue.useIntl(),f=Le.useQueryClient(),p=j.useContext(yt),h=q_({queryClient:f,queryKey:[e,t,n],mutationFn:o}),{mutate:y}=Le.useMutation(h),_=H_({queryClient:f,queryKey:[e,t,n],mutationFn:async R=>l(R)}),{mutate:S}=Le.useMutation(_),v=W_({queryClient:f,queryKey:[e,t,n],mutationFn:i}),{mutate:w}=Le.useMutation(v),x=G_({queryClient:f,queryKey:[e,t,n],user:p,mutationFn:u}),{mutate:O}=Le.useMutation(x),F=j.useCallback(({replyId:R})=>w({replyId:R}),[w]),D=j.useCallback(({replyId:R})=>O({replyId:R}),[O]);return E.jsxs(E.Fragment,{children:[E.jsx(Na,{contentType:"post",createPost:y,membershipRequiredToPost:{isMember:s,required:!0,join:c,leave:a,notMemberStateText:d.formatMessage({id:"community_joinToPost"})}}),(r==null?void 0:r.length)===0||(r==null?void 0:r.map(R=>{var V,L,U,$,K,Q,C,q,Y,oe,ee,G,Z,ae,Oe,ie;const W=((V=R==null?void 0:R.latest_children)==null?void 0:V.like)&&((L=R==null?void 0:R.latest_children)==null?void 0:L.like.filter(re=>re.user_id===(p==null?void 0:p.id)));return E.jsx(Xn,{content:{type:"post",body:typeof R.data.content=="string"?(U=R==null?void 0:R.data)==null?void 0:U.content:((K=($=R==null?void 0:R.data)==null?void 0:$.content)==null?void 0:K.text)||"",createdAt:R==null?void 0:R.created_at,slugs:{question:`${e}/${t}/${n}`,parentId:t,reply:R==null?void 0:R.id},slug:`${e}/${t}/${n}#${R==null?void 0:R.id}`,author:{id:(Q=R==null?void 0:R.user)==null?void 0:Q.id,name:(q=(C=R==null?void 0:R.user)==null?void 0:C.data)==null?void 0:q.name,organization:(oe=(Y=R==null?void 0:R.user)==null?void 0:Y.data)==null?void 0:oe.organization,jobTitle:(G=(ee=R==null?void 0:R.user)==null?void 0:ee.data)==null?void 0:G.jobTitle,image:{thumbnail:((ae=(Z=R==null?void 0:R.user)==null?void 0:Z.data)==null?void 0:ae.thumbnail)||void 0}},userLiked:!!(W!=null&&W.length),likes:((Oe=R==null?void 0:R.children_counts)==null?void 0:Oe.like)||0,comments:((ie=R==null?void 0:R.children_counts)==null?void 0:ie.reply)||0},functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>console.log("delete"),updateContent:(re,te)=>S({replyInfo:re,content:te})},likes:{createLike:()=>F({replyId:R==null?void 0:R.id}),deleteLike:()=>D({replyId:R==null?void 0:R.id})},comments:{openComments:()=>{}}}},R==null?void 0:R.id)}))]})},V_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityInfo:l,content:{body:i}})=>{if(i.length===0)return;await e.cancelQueries({queryKey:t});const u=e.getQueryData(t);return u&&u.id===(l==null?void 0:l.activityId)&&(u.content=i),e.setQueryData(t,()=>({...u})),{previousActivity:u}},onError:(l,i,u)=>{e.setQueryData(t,u.previousActivity)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),Q_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async()=>{var u;await e.cancelQueries({queryKey:t});const i=e.getQueryData(t);return(u=i==null?void 0:i.reaction_counts)!=null&&u.like?i.reaction_counts.like+=1:i&&(i.reaction_counts={like:1}),e.setQueryData(t,()=>({...i})),{previousActivity:i}},onError:(i,u,c)=>{e.setQueryData(t,c.previousActivity)},onSuccess:i=>{const u=e.getQueryData(t);return u!=null&&u.latest_reactions.like?u.latest_reactions.like.push(i):u&&(u.latest_reactions={like:[i]}),e.setQueryData(t,()=>({...u})),{previousActivity:u}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),z_=({queryClient:e,queryKey:t,user:n,activity:r,mutationFn:s})=>({mutationFn:s,onMutate:async()=>{var a;await e.cancelQueries({queryKey:t});const c=e.getQueryData(t);return(a=c==null?void 0:c.reaction_counts)!=null&&a.like&&c.reaction_counts.like>0&&(c.reaction_counts.like-=1),e.setQueryData(t,()=>({...c})),{previousActivity:c}},onError:(c,a,d)=>{e.setQueryData(t,d.previousActivity)},onSuccess:()=>{var d,f,p;if(!r)return;const c=(p=(f=(d=r.latest_reactions)==null?void 0:d.like)==null?void 0:f.find(h=>h.user_id===(n==null?void 0:n.id)))==null?void 0:p.id,a=e.getQueryData(t);if(a!=null&&a.latest_reactions.like)return a.latest_reactions.like=a.latest_reactions.like.filter(h=>h.id!==c),e.setQueryData(t,()=>({...a})),{previousActivity:a}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),Y_=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{get:s,editActivity:o,likeActivity:l,unlikeActivity:i,createReply:u,editReply:c,likeReply:a,unlikeReply:d,join:f,leave:p}})=>{var U,$,K,Q,C,q,Y,oe,ee,G;const h=j.useContext(yt),y=Le.useQueryClient(),{data:_,error:S,isLoading:v,isFetching:w}=Le.useQuery({queryKey:[e,t,n],queryFn:s}),x=V_({queryClient:y,queryKey:[e,t,n],mutationFn:async Z=>await o(Z)}),{mutate:O}=Le.useMutation(x),F=Q_({queryClient:y,queryKey:[e,t,n],mutationFn:l}),{mutate:D}=Le.useMutation(F),R=z_({queryClient:y,queryKey:[e,t,n],user:h,mutationFn:async()=>{var ae,Oe,ie;const Z=(ie=(Oe=(ae=_==null?void 0:_.latest_reactions)==null?void 0:ae.like)==null?void 0:Oe.find(re=>re.user_id===(h==null?void 0:h.id)))==null?void 0:ie.id;await i({activityId:n,reactionId:Z})},activity:_}),{mutate:W}=Le.useMutation(R),V=j.useCallback(({activityId:Z})=>D({activityId:Z}),[D]),L=j.useCallback(async({activityId:Z})=>W({activityId:Z}),[W]);return S?E.jsx(Yr,{variant:"error",text:S.message}):v||w?E.jsx(st,{style:{height:"400px"}}):E.jsx(Xn,{content:{type:"post",body:_==null?void 0:_.content,createdAt:(_==null?void 0:_.time)||"",slugs:{question:`${t}/${n}`,parentId:t,activityId:_==null?void 0:_.id},slug:n,author:{id:(U=_==null?void 0:_.actor)==null?void 0:U.id,name:($=_==null?void 0:_.actor)==null?void 0:$.data.name,organization:(K=_==null?void 0:_.actor)==null?void 0:K.data.organization,jobTitle:(Q=_==null?void 0:_.actor)==null?void 0:Q.data.jobTitle,image:{thumbnail:((C=_==null?void 0:_.actor)==null?void 0:C.data.thumbnail)||void 0}},userLiked:((q=_==null?void 0:_.own_reactions)==null?void 0:q.like)&&((Y=_==null?void 0:_.own_reactions)==null?void 0:Y.like.length)>0,likes:_&&(_==null?void 0:_.reaction_counts.like),comments:_&&(_==null?void 0:_.reaction_counts.reply)},originalAuthorId:(oe=_==null?void 0:_.actor)==null?void 0:oe.id,functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>console.log("delete"),updateContent:(Z,ae)=>O({activityInfo:Z,content:ae})},likes:{createLike:()=>V({activityId:n}),deleteLike:()=>L({activityId:n})},comments:{openComments:()=>{}}},children:E.jsxs(E.Fragment,{children:[E.jsxs("h3",{children:["Comments (",((ee=_==null?void 0:_.reaction_counts)==null?void 0:ee.reply)||0,")"]}),E.jsx(td,{basePath:e,parentId:t,activityId:n,repliesList:(G=_==null?void 0:_.latest_reactions)==null?void 0:G.reply,isMember:r,functions:{createReply:u,like:a,unlike:d,editReply:c,join:f,leave:p}})]})},n)},K_=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:s}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:s}});exports.ASSETS_BUCKET=Bn;exports.ActivitiesFeed=$_;exports.ActivitySection=Y_;exports.AddPost=Na;exports.BannerSection=Lv;exports.Breadcrumbs=Xv;exports.Button=xe;exports.ButtonWrapper=Qr;exports.CacheProvider=Uf;exports.CollapsibleSection=Sa;exports.Columns=n_;exports.CommunityDetails=Jv;exports.Contributors=Df;exports.ConversationContext=Pa;exports.CookieBanner=Wf;exports.DiscussionConversation=N_;exports.DiscussionForm=Ca;exports.DiscussionLikes=Xf;exports.DiscussionPost=Xn;exports.DiscussionThread=F_;exports.Divider=Jt;exports.DownloadSection=Nv;exports.EMAILS=Gt;exports.EmailHelperTextBox=i_;exports.EmptyStateBox=Yr;exports.Filters=Zv;exports.Footer=Aa;exports.FullWidthSection=ba;exports.GlobalProviders=Kv;exports.Header=Ra;exports.HelperTextBox=Pf;exports.HiddenFromScreenReaders=aa;exports.HideShowTextBox=Mv;exports.HighlightedTextBox=gt;exports.IntlProvider=Bf;exports.InviteForm=Jf;exports.InviteModal=k_;exports.JoinButton=Ta;exports.LanguageSwitcher=t_;exports.Link=zr;exports.LoadMore=qf;exports.LoadingBlock=Qv;exports.LoadingPlaceholder=st;exports.LoadingState=jf;exports.Logo=xa;exports.LogoSection=Pv;exports.MarkdownText=ra;exports.MarketingBox=Fv;exports.Member=Kn;exports.MembersList=R_;exports.Modal=Zf;exports.MoreMenu=Hf;exports.NUMBER_OF_USERS=jv;exports.Overlay=Ia;exports.PageLayout=T_;exports.PasswordRules=s_;exports.Pill=kf;exports.ProfilePicture=Yn;exports.ProgressBar=Lf;exports.Rating=c_;exports.RepliesFeed=td;exports.ResponsesHeading=L_;exports.ResponsiveImage=Rf;exports.SearchForm=zf;exports.Span=If;exports.StatusBanner=$n;exports.Tags=A_;exports.Tooltip=Cf;exports.UserContext=yt;exports.UserProvider=$f;exports.VisuallyHidden=Ue;exports.addAriaProps=ed;exports.getMember=Oa;exports.headerData=Br;exports.mapGetStreamData=K_;exports.useCurrentPath=Ru;exports.useEffectAfterMount=jt;exports.useFeatureFlag=mv;exports.useScreenWidth=Vr;exports.useScrollListener=Of;exports.useScrollToHash=yv;
|
|
74
|
+
`))},[r]),j.useEffect(()=>{c==="ready-to-close"&&a("closing")},[c]);const d=({propertyName:p})=>{p==="max-height"&&a(h=>h==="opening"?"open":h==="closing"?"closed":h)};if(!r)return null;const f=["opening","open"].includes(c);return E.jsxs(gt,{variant:"subtle",className:ne("hide-show-text-box",e),children:[E.jsxs("div",{ref:l,className:ne("content",c),children:[E.jsx(Wn,{options:{forceBlock:!0},children:c==="closed"?i:r}),c!=="closed"&&s]}),E.jsx("p",{className:"cta",children:E.jsx(xe,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:ne({"rotate-180":f}),onClick:()=>{a(f?"ready-to-close":"opening")},children:f?n||o.formatMessage({id:"hideShowTextBox_hide"}):t||o.formatMessage({id:"hideShowTextBox_show"})})})]})},Uv=()=>j.Fragment,Bv=({children:e})=>E.jsx(gt,{variant:"secondary",children:e}),$v=["span","strong","h1","h2","h3","h4","h5","h6","p"],qv=({children:e})=>{const t=ue.useIntl();if(!e)return null;let n=t.formatMessage({id:"markdown_collapsibleSection_summary"});const r=[];for(const o of j.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number"))if(j.isValidElement(o)&&o.type==="summary"){if(o.props&&o.props.children){for(const l of j.Children.toArray(o.props.children))if(!(!l||typeof l=="string"||typeof l=="number")&&j.isValidElement(l)){const i=l.type;if($v.includes(i)){for(n=l.props.children;typeof n!="string"&&(Array.isArray(n)&&n[0].props&&n[0].props.children&&n[0].props.children[0]);)n=n[0].props.children[0];break}}}}else r.push(o);const s=n?n.toString():"";return E.jsx(Sa,{label:s,className:["Sources","Resources"].includes(s)?"discrete-links":"",children:r.map(o=>o)})},Hv=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return E.jsx(gt,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return E.jsx(gt,{variant:"primary",children:e});case"pink-textbox":return E.jsx(gt,{variant:"tertiary",children:e});default:return E.jsx("div",{...t,children:e})}return E.jsx("div",{...t,children:e})},Wv=e=>{const t=ue.useIntl(),n=Date.now().toString();let r="default";const s=e.src;return s.includes("youtube")||s.includes("vimeo")?r="video":s.includes("riddle")||s.includes("sli.do")?r="poll":s.includes("padlet")&&(r="padlet"),E.jsxs(E.Fragment,{children:[E.jsx(Be,{children:E.jsx("a",{href:`#content-after-iframe-${n}`,children:t.formatMessage({id:`markdown_skip${r==="default"?"":`_${r}`}`})})}),E.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${r==="default"?"":`_${r}`}`})}),E.jsx("span",{id:`content-after-iframe-${n}`,tabIndex:-1})]})},Eu=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},Gv=({children:e,...t})=>{let n={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(n.target="_blank");let r=e,s=!1;for(const o of j.Children.toArray(e))if(!(!o||typeof o=="string"||typeof o=="number")&&j.isValidElement(o)){const l=o.type;if(["button","center","span","strong"].includes(l)&&o.props&&o.props.children&&o.props.children[0])for((l==="button"||Eu(o.props.children[0])==="button")&&(s=!0),r=o.props.children[0];r&&typeof r!="string"&&!(typeof r=="boolean"||typeof r=="number"||!j.isValidElement(r));)if(r.props&&r.props.children&&r.props.children[0])r=r.props.children[0],r&&Eu(r)==="button"&&(s=!0);else break}return s?(n={...n,className:"button primary medium"},E.jsx("p",{className:"center",children:E.jsx(xe,{variant:"primary",size:"medium",...n,children:r})})):E.jsx("a",{...n,children:r})},kf=({children:e})=>E.jsx("span",{children:e});const ra=({className:e="",options:t={},children:n})=>{n=n.replace(/^<br\/?>/,"");const r={wrapper:j.Fragment,forceBlock:!0,overrides:{a:Gv,CollapsibleSection:Sa,TextBox:gt,CaseStudy:Bv,style:Uv,details:qv,div:Hv,iframe:Wv}};return E.jsx("div",{className:ne("markdown-text",e),children:E.jsx(Wn,{options:{...r,...t},children:n})})};const Lf=({size:e="medium",variant:t="default",className:n="",children:r})=>E.jsx("span",{className:ne("pill",e,t,n),children:r});const $n=({element:e="p",children:t=null,className:n="",...r})=>j.createElement(e,{...r,className:ne("status-banner text-small",n),"aria-live":"assertive"},t);const Vv=({progress:e=0,text:t=!1,className:n=""})=>{const r=ue.useIntl(),s=e>75?100:e>50?75:e>25?50:e>5?25:0,o={"--progress":`${e}%`};return E.jsx("span",{className:ne(`progress-bar section-${s}`,n),style:o,children:E.jsx(Be,{children:t?`${e} ${t}`:r.formatMessage({id:"progressBar"},{number:e})})})},Ff=j.memo(Vv);const No="loadingBlock_",Qv=({progress:e=0,steps:t=!1,className:n=""})=>{const r=ue.useIntl();t||(t={0:{text:r.formatMessage({id:`${No}loading`})},75:{text:r.formatMessage({id:`${No}almostDone`})},100:{text:r.formatMessage({id:`${No}complete`})}});let s=null;const o=Object.keys(t);for(let i=0;i<o.length&&!(e<parseInt(o[i]));i++)s=o[i];const l=s&&t[s].icon?{"--icon":`url(${Bn}icons/${t[s].icon}.svg)`}:{};return E.jsxs(gt,{className:ne("loading-block",n,{"has-icon":s&&t[s].icon}),variant:"subtle",style:l,children:[s&&E.jsx("span",{className:"step",children:t[s].text}),E.jsx(Ff,{progress:e})]})},zv=j.memo(Qv);const st=({element:e="div",className:t="",...n})=>E.jsx(aa,{element:e,className:ne("loading-placeholder",t),...n});const na={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"]},jf=(e,t)=>e in na?E.jsx("div",{className:e,children:na[e].map((n,r)=>jf(n,r))},t):E.jsx(st,{className:e},t),Mf=({layout:e="overview-page"})=>E.jsx("div",{className:ne("loading-state",e),children:na[e].map((t,n)=>jf(t,n))}),Df=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):""},An=["#5AB6A3","#A2D7AF","#806056","#3962B3"],Yv=e=>{const t=Math.ceil(26/An.length),n=Df(e).toLowerCase();if(n==="")return An[0];const r=n.charCodeAt(0)-96;for(let s=0;s<An.length;s++)if(r<=t*(s+1))return An[s]};const wu=256,Yn=({className:e="",src:t="",name:n,alt:r,width:s=wu,height:o=wu,...l})=>{const[i,u]=j.useState(!1),c=j.useRef(null);j.useEffect(()=>{const d=c.current;if(!d)return;const f=d.getContext("2d");if(!f)return;const p=s,h=o;typeof window<"u"&&window.devicePixelRatio&&(d.width=p*window.devicePixelRatio,d.height=h*window.devicePixelRatio,f.scale(window.devicePixelRatio,window.devicePixelRatio)),f.fillStyle=Yv(n),f.fillRect(0,0,p,h),f.font=`${p/3}px Arial`,f.textAlign="center",f.fillStyle="white",f.fillText(Df(n),p/2,h/1.6)},[n]);let a=!1;return t&&t!==""&&!i&&(t.includes("http")||t.includes("//"))&&(a=!0),E.jsx("figure",{className:ne("profile-picture",e,{error:i}),...l,children:a?E.jsx("img",{src:t,alt:r||n,onError:()=>{u(!0)},width:s,height:o}):E.jsx("canvas",{ref:c})})},Oa=e=>e==="apolitical"?{image:`${Bn}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${Bn}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},Kv=({role:e="",organisation:t="",country:n="",maximumCharacters:r=80})=>{const s=e!=="",o=t!=="",l=n!=="";if(!s&&!o&&!l)return"";const i=`${e}${s&&o?` — ${t}`:t}`;let u=`${i}${(s||o)&&l?`, ${n}`:n}`;return u.length>r&&(u=i),u.length>r&&(u=oa(u,r)),u};const Kn=({element:e="div",member:t="community",additionalContent:n=!1,gtmContext:r="member",gtmType:s="member-click",className:o=""})=>{const l=ue.useIntl(),i=Oa(t);i.name||(i.name=l.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:u,url:c,image:a}=i,d=Kv(i),f=n&&n.createdAt?wv(n.createdAt):!1,p=n&&n.createdAt?Ev(n.createdAt):"";return j.createElement(e,{className:ne("member text-medium",o),children:E.jsxs(zr,{href:c,gtmType:s,gtmContext:r,onClick:h=>{h==null||h.stopPropagation()},children:[E.jsx(Yn,{name:u,src:a}),E.jsxs("p",{className:"details",children:[E.jsx("strong",{children:u}),n&&E.jsxs("span",{className:"additional-content",children:[n.createdAt&&f&&E.jsx("span",{className:"date",title:p,"aria-label":p,children:l.formatMessage({id:`dates_${f.path}`},{number:f.number})}),n.didEdit&&E.jsx("em",{children:l.formatMessage({id:"discussion_edited"})})]}),d&&E.jsx("small",{children:d})]})]})})};const bu={small:24,medium:48},Uf=({element:e="div",contributors:{total:t,data:n}={total:void 0,data:[]},styling:{showText:r,size:s,showGap:o,showPlaceholders:l}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:i=2,className:u=""})=>{const c=ue.useIntl();return!n||n.length===0?null:j.createElement(e,{className:ne("contributors",u,s,{"has-gap":o}),children:E.jsxs(E.Fragment,{children:[E.jsx("ul",{children:n.map((a,d)=>{let f,p="";if(d<i){const{name:h="",image:y=""}=Oa(a);if(l)return E.jsx(st,{element:"li",className:"contributor"},d);f=E.jsx(Yn,{name:h,src:y,width:bu[s||"medium"],height:bu[s||"medium"]})}else if(d===i){const h=(t||n.length)-i;f=E.jsxs("small",{className:ne({"large-number":h>99}),children:["+",Av(h,0)]}),p="number-left"}return f?E.jsx("li",{className:ne("contributor",p),children:f},d):null})}),r&&E.jsx("span",{className:"label",children:typeof r=="string"?r:n.length===1?typeof n[0]=="string"?c.formatMessage({id:`member_${n[0]}`}):oa(n[0].name||"",20):null})]})})},Bf=({showDevTools:e=!0,children:t})=>{const n=new Fe.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return E.jsxs(Fe.QueryClientProvider,{client:n,children:[t,e&&E.jsx(hp.ReactQueryDevtools,{initialIsOpen:!1})]})},$f=({children:e,locale:t,messages:n})=>{const r=t||"en",s={...xv[r],...n||{}};return E.jsx(ue.IntlProvider,{locale:r,messages:s,children:e})},yt=j.createContext(null),qf=({children:e,user:t})=>E.jsx(yt.Provider,{value:t,children:e}),Jv=({bootstrap:e,children:t,intl:n})=>{const[r,s]=j.useState({isLoading:!0});return j.useEffect(()=>{e().then(o=>s({...o,isLoading:!1})).catch(()=>s({isLoading:!1}))},[]),E.jsx($f,{locale:n==null?void 0:n.locale,messages:n==null?void 0:n.messages,children:E.jsx(qf,{user:r,children:E.jsx(Bf,{children:t})})})};const Po="joinCommunityButton",Ta=({isMember:e=!1,isShort:t=!1,functions:{join:n,leave:r}={join:()=>{},leave:()=>{}}})=>{const s=ue.useIntl(),o=j.useContext(yt),l=o&&typeof o.id=="string",[i,u]=j.useState(e),[c,a]=j.useState(e?"joined":"notJoined");j.useEffect(()=>{c==="joining"?a("joined"):c==="leaving"&&a("notJoined")},[i]);const d={},f={};return i&&c!=="leaving"&&(d["data-hover-text"]=s.formatMessage({id:`${Po}_leave`}),d["aria-label"]=s.formatMessage({id:`${Po}_member_aria`}),f["aria-hidden"]="true"),E.jsx(xe,{variant:i?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:i&&c!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async p=>{l&&(p.currentTarget.blur(),i?(a("leaving"),typeof r=="function"&&await r()):(a("joining"),typeof n=="function"&&await n()),u(!i))},className:ne("join-community-button",c,{active:c==="joining"}),disabled:!l,...d,children:E.jsx("span",{className:"text",...f,children:s.formatMessage({id:`${Po}${["joining","leaving"].includes(c)?`_${c}`:i?"_member":t?"_short":""}`})})})};const Io="communityDetails_",Xv=({isMember:e=!1,slug:t,members:{number:n,data:r}={number:void 0,data:[]},className:s="",...o})=>{const l=ue.useIntl(),i=n||(r==null?void 0:r.length)||0;return E.jsxs("div",{className:ne("community-details",s),children:[E.jsx(Jt,{}),E.jsxs("div",{className:"member-details",children:[E.jsxs("div",{className:"top",children:[E.jsxs("h3",{children:[l.formatMessage({id:`${Io}members`}),E.jsx("span",{className:"count",children:i})]}),E.jsx("p",{className:"text-small",children:E.jsx("a",{href:`/communities/${t}/members`,children:l.formatMessage({id:`${Io}viewAll`})})})]}),E.jsx(Uf,{contributors:{total:n,data:r!=null&&r.length?r:[{},{},{},{},{}]},styling:{size:"medium",showGap:!0,showPlaceholders:i===0},cutoff:5})]}),E.jsx(Ta,{isMember:e,...o}),e&&E.jsx(xe,{variant:"primary",icon:{icon:"plus"},styling:{fullWidth:!0},children:l.formatMessage({id:`${Io}invite`})})]})};const Zv=({breadcrumbs:e,cutoff:t=20,className:n=""})=>{const r=ue.useIntl();return E.jsxs(E.Fragment,{children:[E.jsx(Be,{element:"p",children:r.formatMessage({id:"breadcrumbs_label"})}),E.jsx("ul",{className:ne("breadcrumbs text-small",n),children:e.map(({text:s,href:o,current:l=!1},i)=>E.jsxs("li",{children:[l&&E.jsx(Be,{element:"span",children:r.formatMessage({id:"breadcrumbs_currentPage"})}),E.jsx(zr,{href:l?void 0:o,children:oa(s,t)})]},`${window.btoa(s)}_${i}`))})]})};const e_=({options:e,allOption:t=!1,allowMultiple:n=!0,onChange:r=()=>{},className:s=""})=>{const o=ue.useIntl(),l=t?[{id:"all",text:typeof t!="boolean"&&t.text||o.formatMessage({id:"filters_all"})},...e]:e,[i,u]=j.useState(t?["all"]:[]),c=(a,d)=>{let f=[];i.includes(a)?f=i.filter(p=>p!==a):a==="all"?f=["all"]:n?f=[...i.filter(p=>p!=="all"),a]:f=[a],u(p=>(r&&typeof r=="function"&&r({current:f,previous:p}),f)),d&&typeof d=="function"&&d()};return E.jsx("ul",{className:ne("filters",s),children:l.map(({id:a,text:d,disabled:f=!1,callback:p=()=>{}})=>{let h={};return f&&(h={disabled:!0,"aria-label":o.formatMessage({id:"filters_disabled"},{name:d})}),E.jsx("li",{children:E.jsx("button",{className:ne(a,{selected:i.includes(a)}),onClick:y=>{y.preventDefault(),y.stopPropagation(),c(a,p)},...h,children:d})},a)})})},t_=(e,t)=>{const n=String(e);if(!t||!t.length)return`/${n}`;let r="";return t.forEach(({url:s,position:o})=>{o==="before-lang"?r+=`/${s}`:(r.includes(`/${n}/`)||(r+=`/${n}`),r+=`/${s}`)}),r.includes(`/${n}/`)||(r+=`/${n}`),r};const ko={en:"English",es:"Español",fr:"Français",pt:"Português"},Rn="languageSwitcher_",r_=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:n=!1,translations:r,onChange:s=()=>{},urlParts:o,variant:l="default",label:i,className:u=""})=>{const c=ue.useIntl(),[a,d]=j.useState(e);if(j.useEffect(()=>{e!==a&&d(e)},[e]),!r||!Object.values(r).some(y=>y&&y.post_name))return null;const p=Object.keys(r),h=a!==e;return E.jsxs("div",{className:ne("language-switcher text-small",l,u),children:[E.jsxs("nav",{children:[l!=="short"&&E.jsx("p",{children:i||c.formatMessage({id:`${Rn}label`})}),E.jsx("ul",{children:p.map(y=>{if(!ko[y])return null;let _={className:y};return a===y?_["aria-label"]=c.formatMessage({id:`${Rn}selected`},{language:ko[y]}):_={..._,href:t_(y,o),onClick:S=>{S.preventDefault(),S.stopPropagation(),d(y),s(y)}},E.jsx("li",{children:E.jsx(zr,{..._,fallbackElement:"span",children:ko[y]})},y)})}),l!=="short"&&!h&&E.jsx("p",{children:c.formatMessage({id:`${Rn}translation_${t?"original":n?"human":"machine"}`})})]}),l!=="short"&&!h&&!t&&!n&&E.jsx("small",{children:c.formatMessage({id:`${Rn}disclaimer`},{email:Gt.support,link:y=>{const _=`mailto:${y}`;return E.jsx("a",{href:_,children:y})}})})]})};const Lo=ue.createIntl({locale:"en",messages:wa}),Hf=({page:e=1,length:t=0,limit:n=10,loadNextPage:r=()=>{},icon:s=!1,messages:o={button:Lo.formatMessage({id:"loadMore_button"}),endOfFeed:Lo.formatMessage({id:"loadMore_endOfFeed"}),error:Lo.formatMessage({id:"loadMore_error"})},className:l="",gtmContext:i="LoadMore"})=>{const[u,c]=j.useState(!1),[a,d]=j.useState(!1);if(t<=0||t<n*e)return null;const f=async p=>{try{await r(p)}catch(h){h instanceof Error&&h.message&&h.message.includes("Cannot read items")?d(!0):c(!0)}};return E.jsxs("footer",{className:ne("load-more",l),children:[u&&E.jsx("p",{className:"error",children:o.error}),a?E.jsx("p",{children:o.endOfFeed}):E.jsx(xe,{variant:"secondary",icon:s,onClick:f,"data-gtm-event-context":i,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:o.button})]})};let Cn=!1;const Wf=({element:e="div",id:t="more-menu",options:n,className:r=""})=>{const s=ue.useIntl(),o=j.useRef(null),[l,i]=j.useState(!1),u=c=>{o.current&&c.target instanceof HTMLElement&&!o.current.contains(c.target)&&i(!1)};return j.useEffect(()=>(document.addEventListener("click",u,!0),()=>{document.removeEventListener("click",u,!0)})),j.createElement(e,{ref:o,className:ne("more-menu text-medium",r),children:E.jsxs(E.Fragment,{children:[E.jsx(xe,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>i(!l),"aria-haspopup":"true","aria-expanded":l,"aria-controls":t,screenreaderText:s.formatMessage({id:"moreMenu"})}),E.jsx("ul",{id:t,hidden:!l,children:n.map(({href:c,onClick:a,text:d,icon:f,...p},h)=>{const y={...p,onClick:_=>{i(!1),typeof a=="function"&&a(_)},onFocus:()=>{Cn&&(clearTimeout(Cn),Cn=!1)},onBlur:()=>{Cn=setTimeout(()=>{i(!1)},100)}};return c&&(y.href=c),E.jsx("li",{children:E.jsx(xe,{variant:"tertiary",size:"medium",icon:f?{icon:f,position:"left"}:!1,...y,children:d})},`${window.btoa(d)}_${h}`)})})]})})};const xa=({variant:e="default",version:t="default",className:n="",...r})=>E.jsx("p",{className:"logo-wrapper",children:E.jsx("a",{href:"/home/",className:ne("logo",e,t,n),...r,children:E.jsx(Be,{children:E.jsx(ue.FormattedMessage,{id:"apolitical"})})})});const n_={"2-1":901},i_=({layout:e="2-1",hideOnMobile:t=!1,className:n="",children:r})=>{const s=Vr(!0);let o=r;return j.Children.count(r)===1&&(o=j.Children.toArray(r)[0],o.props&&(o=o.props.children)),E.jsx("section",{className:ne("columns",`layout-${e}`,n),children:j.Children.map(o,(l,i)=>t!==!1&&i===t&&s&&s<n_[e]?null:l)})};const Fo="cookieBanner_",jo=["apol-cookie-banner","apolitical-performance-cookie-consent","functional-cookie-consent"],Mo=new Date(Date.now()+12*30*24*60*60*1e3),Gf=()=>{const e=ue.useIntl(),[t,n,r]=ia.useCookies(jo),[s,o]=j.useState(!t["apol-cookie-banner"]),l=()=>{jo.forEach(a=>{n(a,!0,{path:"/",expires:Mo,domain:a==="apolitical-performance-cookie-consent"?".apolitical.co":void 0})}),o(!1),window.location.reload()},i=()=>{n("apol-cookie-banner",!0,{path:"/",expires:Mo}),jo.forEach(a=>{if(a==="apol-cookie-banner"){n(a,!0,{path:"/",expires:Mo});return}r(a)}),o(!1)};if(!s)return null;const u=[{id:"settings",href:"/pages/cookie-policy",gtmType:"policy-page"},{id:"reject",onClick:i,gtmType:"reject-all"},{id:"accept",onClick:l,gtmType:"accepted-all"}],c=[];return u.forEach(a=>{c.push({variant:a.href?"tertiary":"primary",href:a.href,onClick:a.onClick,className:"gtm-trackable","data-gtm-event-context":"cookie-banner","data-gtm-event-type":`cookie-${a.gtmType}-click`,children:e.formatMessage({id:`${Fo}buttons_${a.id}`})})}),E.jsxs("aside",{id:"cookie-banner",className:"text-medium",children:[E.jsx("h6",{children:e.formatMessage({id:`${Fo}title`})}),E.jsx("p",{children:e.formatMessage({id:`${Fo}text`})}),E.jsx(Qr,{buttons:c})]})},mt={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:Gt["data-protection"].default,gtmType:"email-dpo-link"},euDataProtection:{email:Gt["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:Gt.support,gtmType:"concierge-email-click"},business:{email:Gt.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 Vt="footer_",qn="SiteFooter",Su=({group:e})=>{const t=mt[e].order||[];let n=!1;return"text"in mt[e]&&(n=mt[e].text),E.jsxs(j.Fragment,{children:[E.jsx("p",{className:"pre-title",children:E.jsx(ue.FormattedMessage,{id:`${Vt}${e}`})}),Array.isArray(t)&&t.length>0&&E.jsx("ul",{className:"text-medium",children:t.map(r=>{if(["order","child","text"].includes(r))return null;const{href:s,gtmType:o}=mt[e][r],l={};return["legal"].includes(e)&&(l.target="_blank",l.rel="noopener"),E.jsx("li",{children:E.jsx("a",{href:s,className:"gtm-trackable","data-gtm-event-context":qn,"data-gtm-event-type":o,...l,children:E.jsx(ue.FormattedMessage,{id:`${Vt}${e}_${r}`})})},`${e}_${r}`)})}),typeof n!="boolean"&&"order"in n&&Array.isArray(n.order)&&E.jsx("dl",{className:"text-medium",children:n.order.map(r=>E.jsxs(j.Fragment,{children:[E.jsx("dt",{children:E.jsx(ue.FormattedMessage,{id:`${Vt}${e}_${r}`})}),E.jsxs("dd",{children:[typeof n!="boolean"&&n[r].address&&E.jsx("address",{children:E.jsx(ue.FormattedMessage,{id:`${Vt}${e}_${r}_address`,values:{br:E.jsx("br",{})}})}),typeof n!="boolean"&&n[r].email&&E.jsx("a",{href:`mailto:${n[r].email}`,className:"gtm-trackable","data-gtm-event-context":qn,"data-gtm-event-type":n[r].gtmType,children:n[r].email})]})]},`dl-${e}-${r}`))})]},e)},Aa=()=>E.jsx("div",{id:"footer",children:E.jsxs("div",{className:"wrapper",children:[E.jsx(aa,{element:"hr"}),E.jsx(xa,{variant:"inverted",version:"full",className:"gtm-trackable","data-gtm-event-context":qn,"data-gtm-event-type":"logo-homepage-link"}),E.jsx("footer",{children:["platform","community","company","contact"].map(e=>E.jsxs("div",{className:"group",children:[E.jsx(Su,{group:e}),Object.keys(mt[e]).includes("child")&&E.jsx(Su,{group:mt[e].child})]},e))}),E.jsx("hr",{}),E.jsxs("div",{className:"sub-footer",children:[E.jsx("ul",{children:Array.isArray(mt.social.order)&&mt.social.order.map(e=>{const t=mt.social[e];return E.jsx("li",{className:e,children:E.jsx("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"gtm-trackable","data-gtm-event-context":qn,"data-gtm-event-type":"social-click",children:E.jsx("span",{className:"hidden",children:E.jsx(ue.FormattedMessage,{id:`${Vt}social_${e}`})})})},e)})}),E.jsx("small",{children:E.jsx(ue.FormattedMessage,{id:`${Vt}copyright`,values:{currentYear:new Date().getFullYear()}})})]})]})});const Nn="emailHelperTextBox_",o_=({type:e,email:t,redirectPath:n,resendVerificationCode:r})=>{const s=ue.useIntl(),[o,l]=j.useState({path:`${Nn}default`,type:"default",link:{},mail:{},error:""}),[i,u]=j.useState(!1),c=j.useCallback(p=>{p.preventDefault(),p.stopPropagation();const h=y=>{l({path:`${Nn}error_verificationFailedToSend`,type:"error",link:{"data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:_=>c(_),href:"#","data-testid":"send-verify-email-click"},mail:{href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"ErrorVerifyingBox","data-gtm-event-type":"email-concierge-click"},error:y})};if(typeof r!="function"){h(s.formatMessage({id:`${Nn}error_noFunction`}));return}u(!0),r(t).then(()=>{localStorage.setItem("email",t),window.location.href=n||"/signup/verify-email"}).catch(y=>{h(y.message)}).finally(()=>{u(!1)})},[t,n,r]);j.useEffect(()=>{let p=Nn,h="default",y={},_={};switch(e){case"gov":p+="autoApproved",h="success";break;case"nonGov":p+="unrecognisedEmail",h="error",y={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"NonGovEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break;case"pending":p+="pendingApproval",h="error",_={href:"mailto:concierge@apolitical.co",className:"gtm-trackable","data-gtm-event-context":"EmailExistsBox","data-gtm-event-type":"email-concierge-click"};break;case"verify":p+="emailUnverified",h="error",y={href:"#","data-gtm-event-context":"VerifyEmailBox","data-gtm-event-type":"SendEmailClick",className:"gtm-trackable",onClick:S=>c(S),"data-testid":"send-verify-email-click"};break;case"exists":p+="emailAlreadyExists",h="error",y={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:p+="default",y={href:"https://about.apolitical.co/who-can-join-the-community","data-gtm-event-context":"DefaultEmailHelperTextBox","data-gtm-event-type":"LearnMoreClick"};break}l({...o,path:p,type:h,link:y,mail:_})},[e]);const a={};return["link","mail"].forEach(p=>{a[p]=Object.keys(o[p]).length?h=>E.jsx("a",{...o[p],children:h}):h=>h}),E.jsx(If,{type:o.type,heading:i?!1:s.formatMessage({id:`${o.path}_title`}),children:i?E.jsxs(E.Fragment,{children:[E.jsx(st,{element:"span"}),E.jsx(st,{element:"span"})]}):s.formatMessage({id:`${o.path}_text`},{...a,strong:p=>E.jsx("strong",{children:p}),em:p=>E.jsx("em",{children:p}),br:E.jsxs(E.Fragment,{children:[E.jsx("br",{}),E.jsx("br",{})]}),error:o.error})})};const Pn="passwordRules_",Vf="isMoreThanEightCharacters",Qf="includesNumberAndSymbol",zf="includesLowerAndUppercase",a_={[Vf]:"8Characters",[Qf]:"numberSymbol",[zf]:"lowercaseUppercase"},s_=({matchingRules:e={isMoreThanEightCharacters:!1,includesNumberAndSymbol:!1,includesLowerAndUppercase:!1},className:t=""})=>{const n=ue.useIntl();return E.jsxs("aside",{className:ne("password-rules",t),children:[E.jsx("small",{children:n.formatMessage({id:`${Pn}intro`})}),E.jsx("ul",{children:[Vf,Qf,zf].map(r=>E.jsxs("li",{className:ne({matches:e[r]}),children:[E.jsxs(Be,{children:[n.formatMessage({id:`${Pn}rule_label`})," "]}),E.jsx("span",{children:n.formatMessage({id:`${Pn}rule_${a_[r]}`})}),!e[r]&&E.jsxs(Be,{element:"strong",children:[" "," ",n.formatMessage({id:`${Pn}notMet`})]})]},`rule-${r}`))})]})},c_=j.memo(s_);const u_=({text:e={},topRating:t=5,functions:{createRating:n=()=>null,updateRating:r=()=>{},reportError:s=()=>{}},className:o="",hasLoaded:l=!1})=>{const i=ue.useIntl(),[u,c]=j.useState({setUp:!1,id:null,rating:null,disabled:!0}),a=async()=>{try{const S=await n();c(v=>({...v,setUp:!0,id:S&&S.id,disabled:!1}))}catch(S){c(v=>({...v,setUp:!0,disabled:!0})),s(S)}};if(j.useEffect(()=>{l&&!u.setUp&&a()},[l]),!l)return E.jsx(st,{className:"rating-placeholder"});const{id:d,rating:f,disabled:p}=u,h="ratings_",y={text:i.formatMessage({id:`${h}text`}),low:i.formatMessage({id:`${h}low`}),high:i.formatMessage({id:`${h}high`}),success:i.formatMessage({id:`${h}success`}),...e},_=async S=>{if(!(!d||p))try{c(v=>({...v,rating:S,disabled:!0})),await r({id:d,value:S})}catch(v){c(w=>({...w,rating:null})),s(v)}finally{c(v=>({...v,disabled:!1}))}};return E.jsxs("div",{className:ne("rating",o),children:[E.jsx("span",{className:"label",children:y[f?"success":"text"]}),E.jsx("ol",{children:Array.from(new Array(t).keys()).map(S=>{const v=S+1;return E.jsx("li",{className:ne({selected:f&&v<=f}),children:E.jsx(xe,{variant:"tertiary",size:"small",icon:{icon:`star${!f||v>f?"_empty":""}`,position:"left",hover:"star"},screenreaderText:`${i.formatMessage({id:`${h}stars`},{number:v,total:t})}${v===1||v===t?` - ${y[v===1?"low":"high"]}`:""}`,onClick:w=>{w.preventDefault(),w.stopPropagation(),_(v)},disabled:p})},`rating-${v}`)})})]})};const Yf=({id:e="search",className:t="",handleToggle:n=!1,defaultValue:r="",gtmContext:s="search-bar",gtmEvent:o="form-submission"})=>{const{searchIsOpen:l=!0,isDesktopVersion:i=!1}=n||{},u=ue.useIntl(),c=j.useRef(null);jt(()=>{!n||i||!l||c.current&&c.current.focus()},[l]);const a=d=>{d.preventDefault(),d.stopPropagation(),!(!c.current||!c.current.value||c.current.value.length<1)&&(window.location.href=`/search?search=${encodeURIComponent(c.current.value)}`)};return E.jsx("form",{onSubmit:a,className:ne("search-form gtm-trackable",t),"data-gtm-event-context":s,"data-gtm-event-type":o,children:E.jsx("fieldset",{id:`${e}-form`,hidden:n?!l:!1,role:"search",children:E.jsxs("p",{children:[E.jsx(Be,{element:"label",htmlFor:e,children:u.formatMessage({id:"search_label"})}),E.jsx("input",{ref:c,type:"search",id:e,name:e,defaultValue:r,placeholder:u.formatMessage({id:"search_placeholder"}),onKeyDown:d=>{d.key==="Enter"&&a(d)}}),E.jsx("button",{className:"clear",onClick:d=>{d.preventDefault(),d.stopPropagation(),c.current&&c.current.value&&(c.current.value="")},children:E.jsx(Be,{children:u.formatMessage({id:"search_clear"})})}),E.jsx("button",{className:"search",onClick:a,children:E.jsx(Be,{children:u.formatMessage({id:"search_cta"})})})]})})})};var Kf={},Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.isEmail=void 0;const l_={requireTld:!0,allowUnderscores:!1,allowTrailingDot:!1},f_={allowDisplayName:!1,requireDisplayName:!1,allowUtf8LocalPart:!0,requireTld:!0},d_=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\,\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i,p_=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,h_=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,m_=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,g_=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;function Ou(e,t){let n=0,r;const s=encodeURI(e).split(/%..|./).length-1;return t&&(n=Number(t.min)||0,r=Number(t.max)),s>=n&&(typeof r>"u"||s<=r)}function y_(e,t){t=Object.assign(Object.assign({},l_),t),t.allowTrailingDot&&e[e.length-1]==="."&&(e=e.substring(0,e.length-1));const n=e.split(".");if(t.requireTld){const r=""+n.pop();if(!n.length||!/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(r)||/[\s\u2002-\u200B\u202F\u205F\u3000\uFEFF\uDB40\uDC20]/.test(r))return!1}for(let r,s=0;s<n.length;s++)if(r=n[s],t.allowUnderscores&&(r=r.replace(/_/g,"")),!/^[a-z\u00a1-\uffff0-9-]+$/i.test(r)||/[\uff01-\uff5e]/.test(r)||r[0]==="-"||r[r.length-1]==="-")return!1;return!0}function v_(e,t){if(t=Object.assign(Object.assign({},f_),t),t.requireDisplayName||t.allowDisplayName){const u=e.match(d_);if(u)e=u[1];else if(t.requireDisplayName)return!1}const n=e.split("@"),r=""+n.pop(),s=r.toLowerCase();let o=n.join("@");if((s==="gmail.com"||s==="googlemail.com")&&(o=o.replace(/\./g,"").toLowerCase()),!Ou(o,{max:64})||!Ou(r,{max:254})||!y_(r,{requireTld:t.requireTld}))return!1;if(o[0]==='"')return o=o.slice(1,o.length-1),t.allowUtf8LocalPart?g_.test(o):h_.test(o);const l=t.allowUtf8LocalPart?m_:p_,i=o.split(".");for(let u=0;u<i.length;u++)if(!l.test(i[u]))return!1;return!0}Kr.isEmail=v_;var Jn={},__=ce&&ce.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),E_=ce&&ce.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),w_=ce&&ce.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&__(t,e,n);return E_(t,e),t},Lr=ce&&ce.__awaiter||function(e,t,n,r){function s(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function i(a){try{c(r.next(a))}catch(d){l(d)}}function u(a){try{c(r.throw(a))}catch(d){l(d)}}function c(a){a.done?o(a.value):s(a.value).then(i,u)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.ReactMultiEmail=void 0;const Ie=w_(j),Jf=Kr,b_=e=>typeof e>"u"?[]:e.filter(n=>(0,Jf.isEmail)(n));function S_(e){const{id:t,style:n,className:r="",noClass:s,placeholder:o,autoFocus:l,allowDisplayName:i=!1,stripDisplayName:u=!1,allowDuplicate:c=!1,delimiter:a=`[${i?"":" "},;]`,initialInputValue:d="",inputClassName:f,autoComplete:p,getLabel:h,enable:y,onDisabled:_,validateEmail:S,onChange:v,onChangeInput:w,onFocus:x,onBlur:O,onKeyDown:F,onKeyUp:D,spinner:R,disableOnBlurValidation:W=!1}=e,Q=Ie.useRef(null),[k,U]=Ie.useState(!1),[$,K]=Ie.useState([]),[V,C]=Ie.useState(d),[q,Y]=Ie.useState(!1),oe=Ie.useCallback((Z,he)=>Lr(this,void 0,void 0,function*(){var Ae;const Pe=[];let je="";const tt=new RegExp(a,"g"),Ge=S||Jf.isEmail,qe=Ve=>{if(!c){for(let _e=0,Me=$.length;_e<Me;_e++)if($[_e]===Ve)return!1}return Pe.push(Ve),!0};if(Z!=="")if(tt.test(Z)){const _e=[...new Set(Z.split(tt).filter(Me=>Me))];do{const Me=Ge(""+_e[0].trim());if(typeof Me=="boolean")if(Me)qe(""+_e.shift());else if(i)if(Ge(""+_e[0].trim(),{allowDisplayName:i})){const rt=u?(Ae=_e.shift())===null||Ae===void 0?void 0:Ae.split("<")[1].split(">")[0]:_e.shift();qe(""+rt)}else _e.length===1?je=""+_e.shift():_e.shift();else je=""+_e.shift();else Y(!0),(yield S==null?void 0:S(Z))===!0?(qe(""+_e.shift()),Y(!1)):_e.length===1?je=""+_e.shift():_e.shift()}while(_e.length)}else{if(y&&!y({emailCnt:$.length})){_==null||_();return}if(he){const Ve=Ge(Z);if(typeof Ve=="boolean")if(Ve)qe(Z);else if(i)if(Ge(Z,{allowDisplayName:i})){const Me=u?Z.split("<")[1].split(">")[0]:Z;qe(Me)}else je=Z;else je=Z;else Y(!0),(yield S==null?void 0:S(Z))===!0?(qe(Z),Y(!1)):je=Z}else je=Z}K([...$,...Pe]),C(je),Pe.length&&(v==null||v([...$,...Pe])),je!==je&&(w==null||w(je))}),[i,c,a,$,y,v,w,_,u,S]),re=Ie.useCallback(Z=>Lr(this,void 0,void 0,function*(){yield oe(Z),w==null||w(Z)}),[oe,w]),G=Ie.useCallback((Z,he)=>{if(he)return;const Ae=[...$.slice(0,Z),...$.slice(Z+1)];K(Ae),v==null||v(Ae)},[$,v]),ie=Ie.useCallback(Z=>{switch(F==null||F(Z),Z.key){case"Enter":Z.preventDefault();break;case"Backspace":Z.currentTarget.value||G($.length-1,!1);break}},[$.length,F,G]),ae=Ie.useCallback(Z=>Lr(this,void 0,void 0,function*(){switch(D==null||D(Z),Z.key){case"Enter":yield oe(Z.currentTarget.value,!0);break}}),[oe,D]),be=Ie.useCallback(Z=>Lr(this,void 0,void 0,function*(){return yield re(Z.currentTarget.value)}),[re]),ee=Ie.useCallback(Z=>Lr(this,void 0,void 0,function*(){U(!1),W||(yield oe(Z.currentTarget.value,!0)),O==null||O()}),[W,oe,O]),te=Ie.useCallback(()=>{U(!0),x==null||x()},[x]);return Ie.useEffect(()=>{K(b_(e.emails))},[e.emails]),Ie.createElement("div",{className:`${r} ${s?"":"react-multi-email"} ${k?"focused":""} ${V===""&&$.length===0?"empty":""}`,style:n,onClick:()=>{var Z;return(Z=Q.current)===null||Z===void 0?void 0:Z.focus()}},q&&(R==null?void 0:R()),o?Ie.createElement("span",{"data-placeholder":!0},o):null,Ie.createElement("div",{className:"data-labels",style:{opacity:q?.45:1,display:"contents",flexWrap:"inherit"}},$.map((Z,he)=>h(Z,he,G))),Ie.createElement("input",{id:t,style:{opacity:q?.45:1},ref:Q,type:"text",value:V,onFocus:te,onBlur:ee,onChange:be,onKeyDown:ie,onKeyUp:ae,autoFocus:l,className:f,autoComplete:p}))}Jn.ReactMultiEmail=S_;(function(e){var t=ce&&ce.__createBinding||(Object.create?function(r,s,o,l){l===void 0&&(l=o);var i=Object.getOwnPropertyDescriptor(s,o);(!i||("get"in i?!s.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(r,l,i)}:function(r,s,o,l){l===void 0&&(l=o),r[l]=s[o]}),n=ce&&ce.__exportStar||function(r,s){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(Kr,e),n(Jn,e)})(Kf);const Xf=({title:e,label:t,ctaMessage:n,titleColor:r,labelColor:s,backgroundColor:o,onClose:l,reportError:i,sendInvites:u,initialFormStatus:c="NOT_SUBMITTED"})=>{const[a,d]=j.useState([]),[f,p]=j.useState(!0),[h,y]=j.useState(c),{formatMessage:_}=ue.useIntl(),S=async x=>{x.preventDefault();try{await u(a),d([]),y("SUCCESS")}catch(O){y("ERROR"),i(O)}},v=x=>{x.preventDefault(),y("NOT_SUBMITTED"),p(!0),d([])},w=x=>{x.preventDefault(),l(),y("CLOSED")};return h==="CLOSED"?null:h==="ERROR"||h==="SUCCESS"?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"content centred",children:h==="SUCCESS"?E.jsx("h2",{className:"success-title",children:_({id:"inviteForm_success"})}):E.jsxs("h2",{className:"error-title",children:[" ",_({id:"inviteForm_error"})]})}),E.jsx(Jt,{}),E.jsx("div",{className:"footer",children:h==="SUCCESS"?E.jsxs(E.Fragment,{children:[E.jsx(xe,{variant:"secondary",onClick:v,children:_({id:"inviteForm_ctaSendMoreInvites"})}),E.jsx(xe,{onClick:w,children:_({id:"inviteForm_ctaDone"})})]}):E.jsx(xe,{onClick:v,children:_({id:"inviteForm_ctaTryAgain"})})})]}):E.jsxs("form",{style:{backgroundColor:o},onSubmit:S,className:ne("invite-form gtm-trackable"),children:[E.jsxs("fieldset",{className:"content",children:[E.jsx("h2",{className:"title",style:{color:r},children:e}),E.jsx("label",{htmlFor:"email-input",className:"label",style:{color:s},children:t}),E.jsx(Kf.ReactMultiEmail,{id:"email-input",inputClassName:"email-input input",placeholder:_({id:"inviteForm_email_placeholder"}),emails:a,onChange:x=>{d(x),p(!x.length)},autoFocus:!1,getLabel:(x,O,F)=>E.jsxs("div",{className:"email text-medium",children:[E.jsx("div",{"data-tag-item":!0,children:x}),E.jsx(xe,{variant:"tertiary",size:"small",icon:{icon:"close"},onClick:()=>{F(O),p(!a.length)},className:"remove-email-button",screenreaderText:_({id:"overlay_close"})})]},O)})]}),E.jsx(Jt,{}),E.jsx("fieldset",{className:"footer",children:E.jsx(xe,{className:"sendEmailsButton",disabled:f,children:n})})]})},we={timeouts:{},handlerCalled:{},getIsDesktopVersion:(e,t)=>{const n={navigation:{loggedIn:769,loggedOut:881},search:{loggedIn:961,loggedOut:1121}},r=o=>{const l=`logged${e?"In":"Out"}`;return t>=n[o][l]};let s={};return["navigation","search"].forEach(o=>{s[o]=r(o)}),s},shouldChangeHeaderIsVisible:(e,t,n)=>{Object.values(t).filter(s=>s===!0).length||n([{type:"headerIsVisible",value:e}])},handleMenus:({id:e,value:t,menus:n,dispatch:r})=>{if(n[e]===t||e==="account"&&t===!1&&n.navigation===!0)return;const s=Date.now();if(!t&&we.handlerCalled[e]&&s-we.handlerCalled[e]<500)return;we.handlerCalled[e]=s;let o=[{type:`menus.${e}`,value:t}];t===!0&&Object.keys(n).forEach(l=>{l===e||n[l]===!1||o.push({type:`menus.${l}`,value:!1})}),r(o)},findFirstChild:(e,t,n=!1)=>{if(!e||!e[0])return!1;for(let r=0;r<=e.length;r++){if(!e[r])continue;if(e[r][t]&&(!n||e[r][t].includes(n)))return e[r];if(!t.includes("."))continue;const s=Au(e[r],t);if(!(typeof s>"u")&&(!n||s[t]&&s[t].includes(n)||s.value&&s.value.includes(n)||s.toString().includes(n)))return e[r]}return e[0].children?we.findFirstChild(e[0].children,t,n):!1},autoFocus:({menu:e,navigationRef:t,isDesktopVersion:n,focusElements:r,dispatch:s})=>{if(!t.current||!t.current.children)return;const o=n?"desktop":"default";if(r[e][o]){r[e][o].focus();return}let l,i;switch(e){case"navigation":if(n){const u=we.findFirstChild(t.current.children,"attributes.aria-controls","navigation");l=we.findFirstChild(u.children,"href")}else l=we.findFirstChild(t.current.children,"href");l||(l=t.current);break;case"account":if(i=we.findFirstChild(t.current.children,"className","account"),!i||!i.children)return;l=we.findFirstChild(i.children,"href");break;default:return}l&&(s([{type:`focusElements.${e}.${o}`,value:l}]),l.focus())},events:{onClick:(e,{id:t,callback:n,isOpen:r})=>{e.target&&e.target.attributes&&e.target.attributes.href||(e.preventDefault(),e.stopPropagation(),clearTimeout(we.timeouts[t]),n(t,!r))},onFocus:({id:e})=>{clearTimeout(we.timeouts[e])},onMouseEnter:({id:e,callback:t})=>{clearTimeout(we.timeouts[e]),t(e,!0)},onBlur:({id:e,callback:t})=>{we.timeouts[e]=setTimeout(()=>{t(e,!1)},250)}}},Br={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"}}}},Hn=({id:e,isLoggedIn:t=!1,isDesktopVersion:n=!1,menus:r={},callback:s=()=>{},doTrack:o=null})=>{const l=ue.useIntl(),i=Au(Br,e);if(!i||i.onlyShow&&(i.onlyShow==="logged-in"&&!t||i.onlyShow==="logged-out"&&t))return null;const u="doTrack"in i,c=o===null?u?i.doTrack:!0:o,a=e.includes("buttons.");let d=`header_${e.replaceAll(".","_")}`;i.hasVariantText&&(d+=`_logged${t?"In":"Out"}`);let f=!1;if(i.href){let v=i.gtmType||`${e}-click`;if(v.includes(".")){const w=v.split("."),x=w[w.length-2];v=`${x==="topics"?`${x}-`:""}${w[w.length-1]}`}f={href:i.href,role:"menuitem"},c&&(f={...f,className:"gtm-trackable","data-gtm-event-type":v,"data-gtm-event-context":"HeaderButtons"}),a&&(f={...f,variant:"secondary",size:{mobile:"small",881:"large"},...i.props||{}})}const p=i.order&&i.order[0]&&i[i.order[0]],h=p&&i[i.order[0]].order,y=f&&window.location.pathname===i.href;let _={},S={};if(p){const v=i.menuId||e,w={onClick:x=>we.events.onClick(x,{id:v,callback:s,isOpen:r[v]}),onFocus:()=>we.events.onFocus({id:v}),onBlur:()=>we.events.onBlur({id:v,callback:s}),onMouseLeave:()=>we.events.onBlur({id:v,callback:s}),onMouseEnter:()=>we.events.onMouseEnter({id:v,callback:s})};n&&(h&&(_={...w,onKeyPress:x=>{x.key==="Enter"&&we.events.onClick(x,{id:v,callback:s,isOpen:r[v]})},tabIndex:"0","aria-haspopup":!0,"aria-expanded":r[v],"aria-controls":v}),S={hidden:v in r?!r[v]:!0}),h||(S={...S,...w})}return E.jsxs("li",{className:ne({[i.className]:i.className,"has-submenu":p,parent:h,active:y}),role:"none",..._,children:[f?j.createElement(a?xe:"a",f,l.formatMessage({id:d})):l.formatMessage({id:d}),i.order&&E.jsx("ul",{...S,children:i.order.map(v=>{if(!i[v])return null;const w={isLoggedIn:t,isDesktopVersion:n,menus:r,callback:s,doTrack:u?c:null};return i[v].order?E.jsxs("li",{className:ne({[i[v].className]:i[v].className}),children:[l.formatMessage({id:`${d}_${v}`}),E.jsx("ul",{children:i[v].order.map(x=>E.jsx(Hn,{id:`${e}.${v}.${x}`,...w},x))})]},v):E.jsx(Hn,{id:`${e}.${v}`,...w},v)})})]},e)};const O_={height:67,height_desktop:83},Ra=()=>{const e=ue.useIntl(),t=j.useContext(yt),n=Vr(!0,!0),r=t&&typeof t.id=="string",s=j.useMemo(()=>we.getIsDesktopVersion(r,n),[r,n]),[o,l]=j.useReducer(_v,{headerIsVisible:!0,menus:{navigation:!1,search:!1,account:!1},focusElements:{navigation:{desktop:!1,default:!1},account:{desktop:!1,default:!1}}}),{headerIsVisible:i,menus:u,focusElements:c}=o;Tf({scrollPosition:O_[`height${s.navigation?"_desktop":""}`],callbacks:{scrollUp:()=>{!s&&u.navigation||we.shouldChangeHeaderIsVisible(!0,u,l)},scrollDown:()=>{!s&&u.navigation||we.shouldChangeHeaderIsVisible(!1,u,l)}}});const a=(f,p)=>{we.handleMenus({id:f,value:p,menus:u,dispatch:l})},d=j.useRef(null);return jt(()=>{u.navigation&&we.autoFocus({menu:"navigation",navigationRef:d,isDesktopVersion:s.navigation,focusElements:c,dispatch:l})},[u.navigation]),jt(()=>{u.account&&we.autoFocus({menu:"account",navigationRef:d,isDesktopVersion:s.navigation,focusElements:c,dispatch:l})},[u.account]),t&&t.isLoading?null:E.jsxs(E.Fragment,{children:[E.jsxs("nav",{id:"header",className:ne({"logged-in":r,"logged-out":!r,visible:i}),children:[E.jsx(Be,{element:"a",href:"#content-of-page",children:e.formatMessage({id:"header_skip"})}),E.jsx(xa,{}),!s.navigation&&E.jsx("button",{className:"menu-button gtm-trackable",onClick:f=>{f.preventDefault(),f.stopPropagation(),a("navigation",!u.navigation)},"data-gtm-event-type":"open-tab-menu-click","data-gtm-event-context":"HeaderLeft-Chevron","aria-haspopup":"true","aria-expanded":u.navigation,"aria-controls":"navigation",children:E.jsx(Be,{children:e.formatMessage({id:`header_menu_${u.navigation?"hide":"show"}`})})}),E.jsx("ul",{ref:d,id:"navigation",hidden:s.navigation||u.account?!1:!u.navigation,role:"menu","data-showing":!s.navigation&&u.account?"account":"default",children:Br.order.map(f=>E.jsx(Hn,{id:f,isLoggedIn:r,isDesktopVersion:s.navigation,menus:{navigation:u.navigation,account:u.account},callback:a},f))}),!s.search&&E.jsx("button",{className:"search toggle-search-button",onClick:f=>{f.preventDefault(),f.stopPropagation(),a("search",!u.search)},"aria-haspopup":"true","aria-expanded":u.search,"aria-controls":"search-form",children:E.jsx(Be,{children:e.formatMessage({id:`header_search_${u.search?"hide":"show"}`})})}),E.jsx(Yf,{id:"global-search",handleToggle:{searchIsOpen:u.search,isDesktopVersion:s.search},gtmContext:"search-bar-header",gtmEvent:"form-submission"}),r?E.jsxs("button",{className:"account-button",onClick:f=>we.events.onClick(f,{id:"account",callback:a,isOpen:u.account}),onMouseEnter:()=>we.events.onMouseEnter({id:"account",callback:a}),onMouseLeave:()=>we.events.onBlur({id:"account",callback:a}),"aria-haspopup":"true","aria-expanded":u.account,"aria-controls":"navigation",children:[E.jsx(Be,{children:e.formatMessage({id:`header_account_${u.account?"hide":"show"}`})}),E.jsx(Yn,{name:t&&t.name||"",src:t&&t.image&&t.image.thumbnail||""})]}):E.jsx("ul",{className:"sign-in-buttons",children:Br.buttons.order.map(f=>E.jsx(Hn,{id:`buttons.${f}`},f))})]}),E.jsx("hr",{id:"content-of-page"}),E.jsx("div",{className:ne("overlay",{open:u.navigation||u.account||!s.search&&u.search})})]})};const T_=()=>{const e=ue.useIntl();return E.jsxs(E.Fragment,{children:[E.jsx(Ra,{}),E.jsx("div",{className:"content",children:E.jsx(Yr,{variant:"error",text:e.formatMessage({id:"pageLayout_error"})})}),E.jsx(Aa,{})]})},x_=({children:e,reportError:t,showFooter:n=!0,background:r="default",className:s="",locale:o="en"})=>{const l=Cu();j.useEffect(()=>{window.scrollTo(0,0)},[l]);const i=Rf(e,{locale:o});return E.jsx(mp.ErrorBoundary,{onError:t,fallback:E.jsx(T_,{}),children:E.jsx(j.Suspense,{fallback:E.jsx(Mf,{layout:"overview-page"}),children:E.jsx("div",{id:"wrapper",className:ne(s,{[r]:r!=="default"}),children:E.jsxs(ia.CookiesProvider,{children:[E.jsx(Ra,{}),E.jsx("div",{className:"content",children:i}),n&&E.jsx(Aa,{}),E.jsx(Gf,{})]})})})})},Tu={default:"tags_",headerTopics:"header_topics_topics_"},Do={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"},A_={getTagDetails:e=>{if(e.includes("topic_")){if(e=Do.topic[e.replace("topic_","")],e){const t=Br.topics.topics[e].href;return t?{id:e,href:t,text:`${Tu.headerTopics}${e}`}:null}return null}return Do[e]?(e=Do[e],{id:e,text:`${Tu.default}${e}`}):null}};const R_=({tags:e=[],color:t="default",forceOneLine:n=!1,canHaveLinks:r=!0,className:s="",gtmType:o="tag-click",gtmContext:l="tags"})=>{const i=ue.useIntl();if(!e||e.length<1)return null;const u=[];return e.forEach(c=>{if(!c)return;const a=A_.getTagDetails(c);a&&u.push(a)}),u.length<1?null:E.jsx("ul",{className:ne("tags text-small",t,s,{"one-line":n}),children:u.map(c=>{const a=i.formatMessage({id:c.text});return E.jsx("li",{children:c.href&&r?E.jsx("a",{href:c.href,className:"gtm-trackable","data-gtm-event-type":o,"data-gtm-event-context":l,children:a}):a},c.id)})})};const C_=({members:{total:e,data:t=[]},pagination:n,gtmContext:r="member",gtmType:s="member-click",className:o=""})=>{const l=ue.useIntl();return t.length===0?null:(e||(e=t.length),E.jsxs("div",{className:ne("members-list",o),children:[E.jsxs("h1",{children:[l.formatMessage({id:"membersList"}),E.jsx("span",{className:"count",children:e})]}),E.jsx("ul",{children:t.map((i,u)=>E.jsxs("li",{children:[E.jsx(Kn,{member:i,gtmContext:r,gtmType:s}),i.isAdmin&&E.jsx(Lf,{children:l.formatMessage({id:"membersList_admin"})})]},u))}),n&&E.jsx(Hf,{...n,icon:{icon:"arrow-down",position:"right"},gtmContext:r})]}))};let In=null;const Ye="discussion_form_",Ca=({content:e={type:"response",slugs:{}},userHasPermissions:t=!0,meta:n={isLoading:!1,isInWrapper:!1,isEditing:!1,showTitle:!1},inputRef:r,maxLength:s=5e4,minRows:o=4,forceShow:l={cancel:!1,error:!1},functions:i={create:()=>{},handleSaveEdit:()=>{},handleCancel:()=>{},callback:()=>{},props:{create:{projectNames:["questions-answers"]}}},gtmContext:u="DiscussionForm"})=>{var W,Q;const c=ue.useIntl(),a=j.useContext(yt),[d,f]=j.useState(n.isEditing&&n.isEditing.text||""),[p,h]=j.useState(l.error||!1),[y,_]=j.useState(!1),S=j.useRef(null);if(r||(r=S),n.isLoading)return E.jsx(st,{className:"discussion-card discussion-form","data-testid":"loading-placeholder"});const v=k=>{const U=k.target.value;f(U);let $;!a||!a.id?$=ot(c.formatMessage,`${Ye}error_loggedOut`,e.type,"action"):t?U.length>=s&&($=`${Ye}error_tooLong`):$=ot(c.formatMessage,`${Ye}error_noPermission`,e.type,"action"),$?h($):p&&h(!1)};let w=`${e.type}-form`;if(e.type==="response"||e.type==="reply"){const k=e.type==="response"?((W=e.slugs)==null?void 0:W.question)||"":((Q=e.slugs)==null?void 0:Q.answer)||"";k&&(w=`${w}-${k.slice(-15)}`)}const x=async k=>{var $;if(k.preventDefault(),k.stopPropagation(),!a||!a.id||!t||F)return;In&&clearTimeout(In),_("submitting");const U=window.location.pathname;try{let K;switch(e.type){case"post":K=await i.create({content:d});break;case"question":K=await i.create({title:d,authorId:a&&a.id,...($=i.props)==null?void 0:$.create});break;case"response":K=await i.create({question:e.slugs.question},{body:d,authorId:a&&a.id,contentPath:U});break;case"reply":K=await i.create({question:e.slugs.question,answer:e.slugs.answer},{body:d,authorId:a&&a.id,contentPath:U});break;default:break}await bv(1e3),i.callback&&await i.callback(K),In=setTimeout(()=>{f(""),_("submitted"),O()},500)}catch(K){const V=K;let C=`${Ye}error`;V.message.includes("entry already exists")&&(C=ot(c.formatMessage,`${Ye}error_alreadyExists`,e.type,"action")),V.message.includes("429")?C=ot(c.formatMessage,`${Ye}error_tooMany`,e.type,"action"):V.message.includes("400")&&(C=`${Ye}error`),h(C),O()}},O=()=>{In=setTimeout(()=>{h(!1),_(!1)},5e3)},F=!d||!Rv(d),D=y==="submitting",R=[];return(n.isEditing&&!D||l.cancel)&&R.push({variant:"secondary",size:{mobile:"small",600:"medium"},onClick:i.handleCancel,className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`cancel-${e.type}-click`,disabled:!l.cancel&&(!a||!a.id||!d),children:c.formatMessage({id:`${Ye}cancel`})}),R.push({variant:"primary",size:{mobile:"small",600:"medium"},onClick:k=>{if(n.isEditing){_("submitting"),i.handleSaveEdit&&i.handleSaveEdit(S.current&&"value"in S.current?S.current.value:"");return}x(k)},className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":`${n.isEditing?"save":"submit"}-${e.type}-click`,"data-testid":"save-button",disabled:!a||!a.id||!t||F||D||n.isEditing&&d===n.isEditing.text,children:c.formatMessage({id:`${Ye}${D?n.isEditing?"saving":"posting":n.isEditing?"save":"post"}`})}),E.jsxs("form",{id:w,className:ne("discussion-card discussion-form",{"no-styling":n.isInWrapper&&n.isEditing}),"data-testid":`discussion-${e.type}-form`,children:[(n==null?void 0:n.showTitle)&&!n.isEditing&&["question"].includes(e.type)&&E.jsx("h2",{children:ot(c.formatMessage,`${Ye}title`,e.type,"action")}),E.jsx(Kn,{member:a||"community",gtmContext:u,gtmType:"profile-click"}),E.jsx(Be,{element:"label",showOnFocus:!1,htmlFor:`${w}-input`,children:ot(c.formatMessage,`${Ye}label`,e.type,"action")}),E.jsx(gp,{ref:r,id:`${w}-input`,name:e.type,placeholder:ot(c.formatMessage,`${Ye}placeholder`,e.type,"action"),onChange:v,value:d,maxLength:s,"aria-invalid":!!p,"aria-errormessage":"error-message",minRows:o,autoFocus:!!n.isEditing}),E.jsx("small",{children:ot(c.formatMessage,`${Ye}explainer`,e.type,"action",{a:k=>E.jsx("a",{href:"https://about.apolitical.co/q-and-a-community-guidelines",target:"_blank",className:"gtm-trackable","data-gtm-event-context":u,"data-gtm-event-type":"community-guidelines-link",rel:"noreferrer",children:k})})}),E.jsx(Qr,{buttons:R}),y==="submitted"&&E.jsx($n,{className:"success","data-testid":"success",children:ot(c.formatMessage,`${Ye}success`,e.type,"action")}),p&&E.jsx($n,{id:"error-message",className:"error","data-testid":"error",children:l.error?l.error:typeof p=="string"?p.includes(" ")?p:c.formatMessage({id:p},{action:c.formatMessage({id:`discussion_action_${e.type}`}),maxLength:s}):p})]})},Na=({contentType:e,createPost:t,membershipRequiredToPost:{isMember:n,required:r,join:s,leave:o,notMemberStateText:l}})=>r&&!n?E.jsx(Yr,{text:l,button:{component:E.jsx(Ta,{functions:{join:s,leave:o}})}}):E.jsx(Ca,{content:{type:e,slugs:{}},functions:{create:t}}),N_={showThread:!1,showForm:!1},Pa=j.createContext(N_),P_=({children:e})=>{const[t,n]=j.useState({showThread:!1,showForm:!1});return E.jsx(Pa.Provider,{value:{...t,updateConversation:n},children:e})},I_=({question:e,answer:t,reply:n})=>({...e&&{questionSlug:e},...t&&{answerSlug:t},...n&&{replySlug:n}}),k_=(e,t=10)=>!e||e.length===0?[]:e.slice(0,t);let Dr=!1;const Uo=()=>{Dr!==!1&&(clearTimeout(Dr),Dr=!1)},Bo=10,Zf=({element:e="div",likes:t=0,peopleWhoLiked:n=!1,isShort:r=!0,userLiked:s=!1,content:o={type:"reply",slugs:{}},canLike:l=!0,functions:{createLike:i=()=>{},deleteLike:u=()=>{}}={}})=>{const c=ue.useIntl();j.useEffect(()=>{p(s)},[s]);const[a,d]=j.useState(t),[f,p]=j.useState(s),[h,y]=j.useState(!1),[_,S]=j.useState(!1),v=j.useMemo(()=>k_(n,Bo),[n]),w=O=>{if(O.preventDefault(),O.stopPropagation(),S(!1),Dr)return Uo(),!1;if(Uo(),h||!l)return!1;Dr=setTimeout(x,350)},x=async()=>{if(Uo(),h||!l)return!1;let O=f?a-1:a+1;O<0&&(O=0),y(!0),d(O),p(!f);try{if(o&&o.slugs){const F=I_(o.slugs);f?await u(F):await i(F,{contentPath:window.location.pathname})}}catch{d(t),p(s)}finally{y(!1)}};return j.createElement(e,{className:ne("likes-wrapper text-medium action-button",{"show-spinner":h,"is-liked":f,disabled:!l}),onClick:w,onMouseEnter:()=>{S(!0)},onMouseLeave:()=>{S(!1)},onFocus:()=>{S(!0)},onBlur:()=>{S(!1)},children:E.jsxs(E.Fragment,{children:[E.jsx(xe,{variant:"tertiary",size:"medium",icon:{icon:f?"heart":"heart_empty",animate:"bounce"},className:ne({"do-animation":f&&!s}),screenreaderText:l?c.formatMessage({id:`discussion_likes_${f?"unlike":"like"}`},{action:c.formatMessage({id:`discussion_action_${o.type}`})}):!1,onClick:w,disabled:!l,"aria-hidden":!l,"data-testid":"like-button","data-gtm-event-context":"Likes","data-gtm-event-type":`like-${o.type}-click`}),E.jsx("span",{className:ne("number-of-likes",{"no-likes":a===0}),"data-testid":"number-of-likes",children:c.formatMessage({id:`discussion_likes${r?"_short":""}`},{number:a})}),n&&E.jsx(Nf,{isOpen:_,isLoading:n.length===0,children:n.length&&E.jsxs("ul",{children:[v.map(O=>typeof O=="string"||!O.name?null:E.jsx("li",{children:E.jsx(zr,{href:O.id?`/profiles/${O.id}`:void 0,gtmContext:"Likes",gtmType:"liked-name-click",children:O.name})},O.id||window.btoa(O.name))),n.length>Bo&&E.jsx("li",{children:c.formatMessage({id:"discussion_likes_more"},{number:n.length-Bo})})]})})]})})};const ed=({element:e="section",children:t,className:n,...r})=>j.createElement(e,{className:ne("modal",n),children:typeof t=="string"?E.jsx("p",{children:t}):t,...r});const Ia=({id:e="content-overlay",isOpen:t=!1,showDivider:n=!0,maxWidth:r,functions:{onOpen:s=()=>{},onClose:o=()=>{}}={},forceShow:{error:l=!1}={},title:i,children:u,buttons:c,className:a="",gtmContext:d="Modal"})=>{const f=ue.useIntl(),[p,h]=j.useState(t),y=S=>{h(S),S?(s(),document.body.classList.add("has-overlay")):(o(),document.body.classList.remove("has-overlay"))};j.useEffect(()=>{y(t)},[t]);const _=r?{"--max-width":`${r/16}rem`}:{};return E.jsx("div",{className:ne("overlay",{open:p}),children:E.jsx(ed,{id:e,className:ne("overlay-modal",a,{"has-max-width":r}),hidden:!p,style:_,children:t&&E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"top",children:[i&&E.jsx("h2",{className:"modal-title",children:i}),E.jsx(xe,{variant:"tertiary",size:"medium",icon:{icon:"close"},onClick:()=>y(!1),className:"gtm-trackable","data-gtm-event-type":"close-modal-click","data-gtm-event-context":d,screenreaderText:f.formatMessage({id:"overlay_close"})})]}),n&&E.jsx(Jt,{}),u,c&&E.jsxs("div",{className:"bottom",children:[E.jsx(Jt,{}),E.jsx(Qr,{buttons:c})]}),l&&E.jsx($n,{className:"error",children:l})]})})})},td=(e,t)=>({"aria-haspopup":!0,"aria-expanded":t,"aria-controls":e});const L_=({className:e,showModal:t=!0,title:n,formTitle:r="Know someone who might like to join this workshop?",formLabel:s="Send an invitation to your colleagues below",ctaMessage:o="Send invites",showIcon:l,onClose:i,reportError:u=()=>{},sendInvites:c})=>E.jsx(Ia,{title:n,isOpen:t,showDivider:!1,showIcon:l,className:ne("invite-modal",e,{success:!!n}),children:E.jsx(Xf,{title:r,label:s,ctaMessage:o,onClose:i,sendInvites:c,reportError:u})}),xu=e=>{const t={};return Object.keys(e).forEach(n=>n.includes("Id")?t[n]=e[n]:t[`${n}Slug`]=e[n]),t},ka=(e,t)=>e&&!t;const pt="discussion_",Xn=({element:e="div",content:t,userHasPermissions:n=!0,isLoading:r=!1,originalAuthorId:s,functions:{content:{createContent:o,deleteContent:l,updateContent:i}={createContent:()=>{},deleteContent:()=>{},updateContent:()=>{}},likes:{createLike:u,deleteLike:c}={createLike:()=>{},deleteLike:()=>{}},comments:{openComments:a}={openComments:()=>{}}},links:d={},className:f,gtmContext:p="DiscussionAnswer",children:h})=>{const y=ue.useIntl(),_=j.useContext(yt),S=j.useContext(Pa),[v,w]=j.useState({body:t&&t.body||"",isEditing:!1,didEdit:t&&t.isEdited||!1}),[x,O]=j.useState(!1),[F,D]=j.useState("");if(j.useEffect(()=>{w({...v,body:t&&t.body||"",didEdit:t&&t.isEdited||!1})},[t.isEdited]),r||!t||t.type==="answer"&&(!t.slugs||!t.slugs.question))return E.jsx(st,{className:"discussion-card discussion-post"});const{author:R,canLike:W,createdAt:Q,id:k,likes:U=0,userLiked:$,comments:K=0}=t,V=_&&_.id&&typeof R!="string"&&R.id&&R.id===_.id||!1,C=typeof W=="boolean"?W:n?!V:!1,q=async G=>{G||(G=""),D("");try{if(!yp(G,v.body)){const ie=t.type==="question"?{title:G}:{body:G};await i(xu(t.slugs),ie)}w({body:G,isEditing:!1,didEdit:!0})}catch{D(`${pt}form_error`)}},Y=()=>{S&&S.updateConversation&&S.updateConversation({showThread:!0,showForm:!0}),setTimeout(()=>{const ie=`reply-form-${(t.type==="answer"?t.slug:t.slugs.answer||"").toLowerCase().slice(-15)}`,ae=document.getElementById(ie),be=document.getElementById(`${ie}-input`);be&&be.focus(),ae&&ae.scrollIntoView({behavior:"smooth"})},0)},oe=()=>{try{l(xu(t.slugs))}catch{D("delete-error")}},re=[{text:y.formatMessage({id:`${pt}moreMenu_report`}),href:`mailto:community@apolitical.co?subject=${encodeURI(y.formatMessage({id:`${pt}report_subject`}))}&body=${encodeURI(y.formatMessage({id:`${pt}report_body`},{contentType:t.type||"",contentSlug:t.slug||"",contentUrl:`${window.origin}${typeof process<"u"&&process.env.PUBLIC_URL||""}/${t.slugs.question||""}`}))}`,icon:"flag"}];return n&&V&&re.push({text:y.formatMessage({id:`${pt}moreMenu_edit`}),onClick:()=>w({...v,isEditing:!0}),icon:"pencil-paper",className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`edit-${t.type}-click`},{text:y.formatMessage({id:`${pt}moreMenu_delete`}),onClick:G=>{G.preventDefault(),G.stopPropagation(),O(!0)},icon:"trash",className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`delete-${t.type}-click`,...td(`delete-${t.slug}-modal`,x)}),j.createElement(e,{className:ne("discussion-post",f),"data-testid":`discussion-${t.type}-thread`,children:E.jsxs(E.Fragment,{children:[E.jsxs("div",{id:k||t.slug,className:ne("discussion-card",t.type,{editing:v.isEditing,"has-link":d.post&&!v.isEditing}),onClick:G=>{!d.post||v.isEditing||(G.preventDefault(),G.stopPropagation(),window.location.href=d.post)},children:[!v.isEditing&&E.jsx(Kn,{member:R,additionalContent:{createdAt:Q,didEdit:v.didEdit},className:typeof R!="string"&&R.id===s?"highlighted":"",gtmContext:p,gtmType:"profile-click"}),v.isEditing?E.jsx(Ca,{content:{type:t.type,slugs:t.slugs},userHasPermissions:n,meta:{isLoading:r,isInWrapper:!0,isEditing:{text:v.body}},maxLength:t.type==="question"?250:5e4,forceShow:{error:F!==""&&F!=="delete-error"?y.formatMessage({id:F},{action:y.formatMessage({id:`discussion_action_${t.type}`})}):!1},functions:{create:o,handleSaveEdit:q,handleCancel:()=>{D(""),w({...v,isEditing:!1})}},gtmContext:`${p}Form`}):d.post?E.jsx("a",{href:d.post,className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":"title-click",children:E.jsx(ra,{options:{overrides:{a:kf}},children:v.body})}):E.jsx(ra,{options:{wrapper:t.type==="question"?"h1":j.Fragment,forceWrapper:t.type==="question",forceInline:t.type==="question",forceBlock:t.type!=="question"},children:v.body}),!v.isEditing&&E.jsxs("ul",{className:ne("actions text-medium",t.type),"data-testid":`${t.type}-actions`,children:[E.jsx(Zf,{element:"li",likes:U,isShort:!1,userLiked:$,content:{type:t.type,slugs:t.slugs},canLike:C,functions:{createLike:u,deleteLike:c}}),(["question","post"].includes(t.type)||d.comments||typeof a=="function")&&E.jsxs("li",{className:"action-button",onClick:G=>{G.preventDefault(),G.stopPropagation(),d.comments&&(window.location.href=d.comments),typeof a=="function"&&a()},children:[E.jsx(xe,{variant:"tertiary",size:"medium",styling:{muted:!0},icon:{icon:"speech-bubble_square_thick"},href:d.comments?d.comments:!1,onClick:d.comments||typeof a!="function"?!1:a,className:"gtm-trackable","data-gtm-event-context":p,"data-gtm-event-type":`answer-${t.type}-click`,screenreaderText:y.formatMessage({id:`${pt}comments_screenReader`},{count:K})}),E.jsx("span",{children:y.formatMessage({id:`${pt}comments`},{count:K})})]}),(t.type==="answer"||t.type==="reply")&&E.jsx("li",{children:E.jsx(xe,{variant:"tertiary",size:"medium",styling:{muted:!0},onClick:Y,children:y.formatMessage({id:`${pt}reply`})})}),E.jsx(Wf,{element:"li",id:`more-${t.slug}`,options:re})]})]}),h,E.jsx(Ia,{id:`delete-${t.slug}-modal`,isOpen:x,functions:{onOpen:()=>{},onClose:()=>O(!1)},forceShow:{error:F==="delete-error"?y.formatMessage({id:"discussion_delete_error"},{action:y.formatMessage({id:`discussion_action_${t.type}`})}):!1},title:y.formatMessage({id:"discussion_delete_title"},{action:y.formatMessage({id:`discussion_action_${t.type}`})}),buttons:[{variant:"secondary",onClick:()=>O(!1),children:y.formatMessage({id:"discussion_delete_cancel"})},{variant:"primary",className:"destructive",onClick:oe,children:y.formatMessage({id:"discussion_delete_delete"})}],gtmContext:`${t.type.charAt(0).toUpperCase()}${t.type.slice(1)}:${t.slug}`,children:E.jsx(ue.FormattedMessage,{id:"discussion_delete_text",values:{p:G=>E.jsx("p",{children:G}),action:y.formatMessage({id:`discussion_action_${t.type}`})}})})]})})};const $o="discussion_responses_",F_=({type:e="answer",responses:t=0})=>{const n=ue.useIntl();return E.jsxs("div",{className:"responses-heading",children:[E.jsx("h3",{children:n.formatMessage({id:`${$o}title`},{action:n.formatMessage({id:`${$o}${e}`}),count:t})}),t===0&&E.jsx("p",{children:ot(n.formatMessage,`${$o}empty`,e,e)})]})};const j_=({isOpen:e=!1,count:t=0,children:n})=>{const r=ue.useIntl(),s=j.useRef(null),[o,l]=j.useState(e),[i,u]=j.useState("closed");j.useEffect(()=>{const f=s.current;if(f)return f.addEventListener("transitionend",c),()=>{f.removeEventListener("transitionend",c)}},[]),jt(()=>{i==="closed"&&!o||u(["opening","open"].includes(i)?"ready-to-close":"opening")},[o]),j.useEffect(()=>{i==="ready-to-close"&&u("closing")},[i]);const c=({propertyName:f})=>{f==="max-height"&&u(p=>p==="opening"?"open":p==="closing"?"closed":p)},a=["opening","open"].includes(i),d=Rf(n,{element:"li"});return E.jsxs("div",{className:"thread-wrapper",children:[E.jsx(xe,{variant:"secondary",size:"small",styling:{muted:!0},icon:{icon:`arrow_corner-down_${a?"left":"right"}`},onClick:()=>{l(!o)},children:r.formatMessage({id:`discussion_thread_${a?"hide":"show"}`},{count:t})}),E.jsx("ul",{ref:s,className:ne("thread",i),hidden:!o,children:d})]})},M_=({user:e,content:t,verb:n="post"})=>({actor:{id:e.id,data:{name:e.name,organization:e==null?void 0:e.organization,jobTitle:e==null?void 0:e.jobTitle}},content:t,latest_reactions:{like:[]},reaction_counts:{like:0},verb:n}),D_=({queryClient:e,queryKey:t,user:n,mutationFn:r})=>({mutationFn:r,onMutate:async({content:i})=>{if(!n)return;const u=M_({user:n,content:i,verb:"post"});await e.cancelQueries({queryKey:t});const c=e.getQueryData(t);return e.setQueryData(t,a=>[...a,u]),{previousActivities:c}},onError:(i,u,c)=>{e.setQueryData(t,c.previousActivities)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),U_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityInfo:l,content:{body:i}})=>{if(i.length===0)return;await e.cancelQueries({queryKey:t});const u=e.getQueryData(t),c=u==null?void 0:u.map(a=>((a==null?void 0:a.id)===(l==null?void 0:l.activityId)&&(a.content=i),a));return e.setQueryData(t,()=>c&&[...c]),{previousActivities:c}},onError:(l,i,u)=>{e.setQueryData(t,u.previousActivities)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),B_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityId:i})=>{await e.cancelQueries({queryKey:t});const u=e.getQueryData(t),c=u==null?void 0:u.map(a=>{var d;return(a==null?void 0:a.id)===i&&((d=a.reaction_counts)!=null&&d.like?a.reaction_counts.like+=1:a.reaction_counts.like=1),a});return e.setQueryData(t,()=>c&&[...c]),{previousActivities:c}},onError:(i,u,c)=>{e.setQueryData(t,c.previousActivities)},onSuccess:i=>{const u=e.getQueryData(t),c=u==null?void 0:u.map(a=>((a==null?void 0:a.id)===(i==null?void 0:i.activity_id)&&(a.latest_reactions.like?a.latest_reactions.like.push(i):a.latest_reactions.like=[i]),a));return e.setQueryData(t,()=>c&&[...c]),{previousActivities:u}},onSettled:(i,u,c)=>{e.invalidateQueries({queryKey:[...t,c.activityId]})}}),$_=({queryClient:e,queryKey:t,user:n,mutationFn:r})=>({mutationFn:r,onMutate:async({activityId:u})=>{await e.cancelQueries({queryKey:t});const c=e.getQueryData(t),a=c==null?void 0:c.map(d=>{var f;return(d==null?void 0:d.id)===u&&(f=d.reaction_counts)!=null&&f.like&&(d.reaction_counts.like-=1),d});return e.setQueryData(t,()=>a&&[...a]),{previousActivities:a}},onError:(u,c,a)=>{e.setQueryData(t,a.previousActivities)},onSuccess:(u,{activityId:c})=>{const a=e.getQueryData(t),d=a==null?void 0:a.map(f=>{var p,h,y,_;if(f.id===c){const S=(y=(h=(p=f.latest_reactions)==null?void 0:p.like)==null?void 0:h.find(v=>v.user_id===(n==null?void 0:n.id)))==null?void 0:y.id;return f.latest_reactions.like=(_=f.latest_reactions.like)==null?void 0:_.filter(v=>v.id!==S),f}else return f});return e.setQueryData(t,()=>d&&[...d]),{previousActivities:a}},onSettled:(u,c,a)=>{e.invalidateQueries({queryKey:[...t,a.activityId]})}}),q_=({basePath:e,parentId:t,isMember:n,functions:{list:r,create:s,edit:o,like:l,unlike:i,join:u,leave:c}})=>{const a=ue.useIntl(),d=Fe.useQueryClient(),f=j.useContext(yt),{data:p,error:h,isLoading:y,isFetching:_}=Fe.useQuery({queryKey:[e,t],queryFn:r}),S=D_({queryClient:d,queryKey:[e,t],user:f,mutationFn:s}),{mutate:v}=Fe.useMutation(S),w=U_({queryClient:d,queryKey:[e,t],mutationFn:async k=>await o(k)}),{mutate:x}=Fe.useMutation(w),O=B_({queryClient:d,queryKey:[e,t],mutationFn:l}),{mutate:F}=Fe.useMutation(O),D=$_({queryClient:d,queryKey:[e,t],user:f,mutationFn:async({activityId:k})=>{var K,V,C;const U=p&&(p==null?void 0:p.find(q=>q.id===k)),$=(C=(V=(K=U==null?void 0:U.latest_reactions)==null?void 0:K.like)==null?void 0:V.find(q=>q.user_id===(f==null?void 0:f.id)))==null?void 0:C.id;await i({reactionId:$||"",activityId:k})}}),{mutate:R}=Fe.useMutation(D),W=j.useCallback(({activityId:k})=>F({activityId:k}),[F]),Q=j.useCallback(({activityId:k})=>R({activityId:k}),[R]);return h?E.jsx(Yr,{variant:"error",text:h.message}):y?E.jsx(st,{style:{height:"400px"}}):E.jsxs(E.Fragment,{children:[E.jsx(Na,{contentType:"post",createPost:v,membershipRequiredToPost:{isMember:n,required:!0,join:u,leave:c,notMemberStateText:a.formatMessage({id:"community_joinToPost"})}}),!_&&Array.isArray(p)&&(p==null?void 0:p.map(k=>{var K,V,C,q,Y,oe,re,G,ie,ae,be,ee;const U=((K=k==null?void 0:k.actor)==null?void 0:K.id)===(f==null?void 0:f.id),$=ka(n,U);return E.jsx(Xn,{content:{type:"post",body:k==null?void 0:k.content,canLike:$,createdAt:(k==null?void 0:k.time)||"",slugs:{parentId:t,activityId:k==null?void 0:k.id},slug:k==null?void 0:k.id,author:{id:(V=k==null?void 0:k.actor)==null?void 0:V.id,name:`${(q=(C=k==null?void 0:k.actor)==null?void 0:C.data)==null?void 0:q.name}`,organization:(oe=(Y=k==null?void 0:k.actor)==null?void 0:Y.data)==null?void 0:oe.organization,jobTitle:(G=(re=k==null?void 0:k.actor)==null?void 0:re.data)==null?void 0:G.jobTitle,image:{thumbnail:((ae=(ie=k==null?void 0:k.actor)==null?void 0:ie.data)==null?void 0:ae.thumbnail)||void 0}},userLiked:((be=k==null?void 0:k.own_reactions)==null?void 0:be.like)&&((ee=k==null?void 0:k.own_reactions)==null?void 0:ee.like.length)>0,likes:(k==null?void 0:k.reaction_counts.like)||0,comments:(k==null?void 0:k.reaction_counts.reply)||0},links:{post:`${e}/${t}/${k==null?void 0:k.id}`,comments:`${e}/${t}/${k==null?void 0:k.id}`},functions:{content:{createContent:()=>null,deleteContent:()=>null,updateContent:(te,Z)=>x({activityInfo:te,content:Z})},likes:{createLike:()=>{W({activityId:k==null?void 0:k.id})},deleteLike:()=>{Q({activityId:k==null?void 0:k.id})}},comments:{openComments:()=>null}}},k==null?void 0:k.id)}))]})},H_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async()=>{await e.cancelQueries({queryKey:t})},onError:(i,u,c)=>{e.setQueryData(t,c.previousActivity)},onSuccess:i=>{var c;const u=e.getQueryData(t);if(u)return(c=u==null?void 0:u.latest_reactions)!=null&&c.reply?(u.latest_reactions.reply.unshift(i),u&&(u.reaction_counts={reply:u.latest_reactions.reply.length})):(u.latest_reactions={reply:[i]},u.reaction_counts={reply:1}),e.setQueryData(t,()=>({...u})),{previousActivity:u}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),W_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({replyInfo:o,content:{body:l}})=>{var c,a,d;if(l.length===0)return;await e.cancelQueries({queryKey:t});const i=e.getQueryData(t);if(!i||!((c=i==null?void 0:i.latest_reactions)!=null&&c.reply))return;const u=(d=(a=i==null?void 0:i.latest_reactions)==null?void 0:a.reply)==null?void 0:d.map(f=>(f.id===o.replySlug&&(f.data.content=l),f));return e.setQueryData(t,()=>({...i,latest_reactions:{reply:u}})),{previousActivity:i}},onError:(o,l,i)=>{e.setQueryData(t,i.previousActivity)}}),G_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({replyId:l})=>{var c,a;await e.cancelQueries({queryKey:t});const i=e.getQueryData(t),u=(a=(c=i==null?void 0:i.latest_reactions)==null?void 0:c.reply)==null?void 0:a.map(d=>{var f;return d.id===l&&((f=d.children_counts)!=null&&f.like?d.children_counts.like+=1:d.children_counts={like:1}),d});return e.setQueryData(t,()=>({...i,latest_reactions:{reply:u}})),{previousActivity:i}},onError:(l,i,u)=>{e.setQueryData(t,u.previousActivity)},onSuccess:l=>{var c;const i=e.getQueryData(t),u=(c=i==null?void 0:i.latest_reactions.reply)==null?void 0:c.map(a=>(a.id===l.id&&(a.latest_children.like?a.latest_children.like.push(l):a.latest_children.like=[l]),a));return e.setQueryData(t,()=>({...i,latest_reactions:{reply:u}})),{previousActivity:i}}}),V_=({queryClient:e,queryKey:t,user:n,mutationFn:r})=>({mutationFn:r,onMutate:async({replyId:i})=>{var a;await e.cancelQueries({queryKey:t});const u=e.getQueryData(t);if(!u)return;const c=(a=u.latest_reactions.reply)==null?void 0:a.map(d=>(d.id===i&&d.children_counts.like&&(d.children_counts.like-=1),d));return e.setQueryData(t,()=>({...u,latest_reactions:{reply:c}})),{previousActivity:u}},onError:(i,u,c)=>{e.setQueryData(t,c.previousActivity)},onSuccess:(i,{replyId:u})=>{var d;const c=e.getQueryData(t);if(!c)return;const a=(d=c.latest_reactions.reply)==null?void 0:d.map(f=>{var p;return f.id===u?(p=f.latest_children.reply)==null?void 0:p.filter(y=>y.user_id!==(n==null?void 0:n.id)):f});return e.setQueryData(t,()=>({...c,latest_reactions:{reply:a}})),{previousActivity:c}}}),rd=({basePath:e,parentId:t,activityId:n,repliesList:r,isMember:s,functions:{createReply:o,editReply:l,like:i,unlike:u,join:c,leave:a}})=>{const d=ue.useIntl(),f=Fe.useQueryClient(),p=j.useContext(yt),h=H_({queryClient:f,queryKey:[e,t,n],mutationFn:o}),{mutate:y}=Fe.useMutation(h),_=W_({queryClient:f,queryKey:[e,t,n],mutationFn:async R=>l(R)}),{mutate:S}=Fe.useMutation(_),v=G_({queryClient:f,queryKey:[e,t,n],mutationFn:i}),{mutate:w}=Fe.useMutation(v),x=V_({queryClient:f,queryKey:[e,t,n],user:p,mutationFn:u}),{mutate:O}=Fe.useMutation(x),F=j.useCallback(({replyId:R})=>w({replyId:R}),[w]),D=j.useCallback(({replyId:R})=>O({replyId:R}),[O]);return E.jsxs(E.Fragment,{children:[E.jsx(Na,{contentType:"post",createPost:y,membershipRequiredToPost:{isMember:s,required:!0,join:c,leave:a,notMemberStateText:d.formatMessage({id:"community_joinToPost"})}}),(r==null?void 0:r.length)===0||(r==null?void 0:r.map(R=>{var U,$,K,V,C,q,Y,oe,re,G,ie,ae,be,ee,te,Z,he;const W=((U=R==null?void 0:R.latest_children)==null?void 0:U.like)&&(($=R==null?void 0:R.latest_children)==null?void 0:$.like.filter(Ae=>Ae.user_id===(p==null?void 0:p.id))),Q=((K=R==null?void 0:R.user)==null?void 0:K.id)===(p==null?void 0:p.id),k=ka(s,Q);return E.jsx(Xn,{content:{type:"post",body:typeof R.data.content=="string"?(V=R==null?void 0:R.data)==null?void 0:V.content:((q=(C=R==null?void 0:R.data)==null?void 0:C.content)==null?void 0:q.text)||"",canLike:k,createdAt:R==null?void 0:R.created_at,slugs:{question:`${e}/${t}/${n}`,parentId:t,reply:R==null?void 0:R.id},slug:`${e}/${t}/${n}#${R==null?void 0:R.id}`,author:{id:(Y=R==null?void 0:R.user)==null?void 0:Y.id,name:(re=(oe=R==null?void 0:R.user)==null?void 0:oe.data)==null?void 0:re.name,organization:(ie=(G=R==null?void 0:R.user)==null?void 0:G.data)==null?void 0:ie.organization,jobTitle:(be=(ae=R==null?void 0:R.user)==null?void 0:ae.data)==null?void 0:be.jobTitle,image:{thumbnail:((te=(ee=R==null?void 0:R.user)==null?void 0:ee.data)==null?void 0:te.thumbnail)||void 0}},userLiked:!!(W!=null&&W.length),likes:((Z=R==null?void 0:R.children_counts)==null?void 0:Z.like)||0,comments:((he=R==null?void 0:R.children_counts)==null?void 0:he.reply)||0},functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>console.log("delete"),updateContent:(Ae,Pe)=>S({replyInfo:Ae,content:Pe})},likes:{createLike:()=>F({replyId:R==null?void 0:R.id}),deleteLike:()=>D({replyId:R==null?void 0:R.id})},comments:{openComments:()=>{}}}},R==null?void 0:R.id)}))]})},Q_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async({activityInfo:l,content:{body:i}})=>{if(i.length===0)return;await e.cancelQueries({queryKey:t});const u=e.getQueryData(t);return u&&u.id===(l==null?void 0:l.activityId)&&(u.content=i),e.setQueryData(t,()=>({...u})),{previousActivity:u}},onError:(l,i,u)=>{e.setQueryData(t,u.previousActivity)},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),z_=({queryClient:e,queryKey:t,mutationFn:n})=>({mutationFn:n,onMutate:async()=>{var u;await e.cancelQueries({queryKey:t});const i=e.getQueryData(t);return(u=i==null?void 0:i.reaction_counts)!=null&&u.like?i.reaction_counts.like+=1:i&&(i.reaction_counts={like:1}),e.setQueryData(t,()=>({...i})),{previousActivity:i}},onError:(i,u,c)=>{e.setQueryData(t,c.previousActivity)},onSuccess:i=>{const u=e.getQueryData(t);return u!=null&&u.latest_reactions.like?u.latest_reactions.like.push(i):u&&(u.latest_reactions={like:[i]}),e.setQueryData(t,()=>({...u})),{previousActivity:u}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),Y_=({queryClient:e,queryKey:t,user:n,activity:r,mutationFn:s})=>({mutationFn:s,onMutate:async()=>{var a;await e.cancelQueries({queryKey:t});const c=e.getQueryData(t);return(a=c==null?void 0:c.reaction_counts)!=null&&a.like&&c.reaction_counts.like>0&&(c.reaction_counts.like-=1),e.setQueryData(t,()=>({...c})),{previousActivity:c}},onError:(c,a,d)=>{e.setQueryData(t,d.previousActivity)},onSuccess:()=>{var d,f,p;if(!r)return;const c=(p=(f=(d=r.latest_reactions)==null?void 0:d.like)==null?void 0:f.find(h=>h.user_id===(n==null?void 0:n.id)))==null?void 0:p.id,a=e.getQueryData(t);if(a!=null&&a.latest_reactions.like)return a.latest_reactions.like=a.latest_reactions.like.filter(h=>h.id!==c),e.setQueryData(t,()=>({...a})),{previousActivity:a}},onSettled:()=>{e.invalidateQueries({queryKey:t})}}),K_=({basePath:e,parentId:t,activityId:n,isMember:r,functions:{get:s,editActivity:o,likeActivity:l,unlikeActivity:i,createReply:u,editReply:c,likeReply:a,unlikeReply:d,join:f,leave:p}})=>{var K,V,C,q,Y,oe,re,G,ie,ae,be;const h=j.useContext(yt),y=Fe.useQueryClient(),{data:_,error:S,isLoading:v,isFetching:w}=Fe.useQuery({queryKey:[e,t,n],queryFn:s}),x=Q_({queryClient:y,queryKey:[e,t,n],mutationFn:async ee=>await o(ee)}),{mutate:O}=Fe.useMutation(x),F=z_({queryClient:y,queryKey:[e,t,n],mutationFn:l}),{mutate:D}=Fe.useMutation(F),R=Y_({queryClient:y,queryKey:[e,t,n],user:h,mutationFn:async()=>{var te,Z,he;const ee=(he=(Z=(te=_==null?void 0:_.latest_reactions)==null?void 0:te.like)==null?void 0:Z.find(Ae=>Ae.user_id===(h==null?void 0:h.id)))==null?void 0:he.id;await i({activityId:n,reactionId:ee})},activity:_}),{mutate:W}=Fe.useMutation(R),Q=j.useCallback(({activityId:ee})=>D({activityId:ee}),[D]),k=j.useCallback(async({activityId:ee})=>W({activityId:ee}),[W]);if(S)return E.jsx(Yr,{variant:"error",text:S.message});if(v||w)return E.jsx(st,{style:{height:"400px"}});const U=((K=_==null?void 0:_.actor)==null?void 0:K.id)===(h==null?void 0:h.id),$=ka(r,U);return E.jsx(Xn,{content:{type:"post",body:_==null?void 0:_.content,canLike:$,createdAt:(_==null?void 0:_.time)||"",slugs:{question:`${t}/${n}`,parentId:t,activityId:_==null?void 0:_.id},slug:n,author:{id:(V=_==null?void 0:_.actor)==null?void 0:V.id,name:(C=_==null?void 0:_.actor)==null?void 0:C.data.name,organization:(q=_==null?void 0:_.actor)==null?void 0:q.data.organization,jobTitle:(Y=_==null?void 0:_.actor)==null?void 0:Y.data.jobTitle,image:{thumbnail:((oe=_==null?void 0:_.actor)==null?void 0:oe.data.thumbnail)||void 0}},userLiked:((re=_==null?void 0:_.own_reactions)==null?void 0:re.like)&&((G=_==null?void 0:_.own_reactions)==null?void 0:G.like.length)>0,likes:_&&(_==null?void 0:_.reaction_counts.like),comments:_&&(_==null?void 0:_.reaction_counts.reply)},originalAuthorId:(ie=_==null?void 0:_.actor)==null?void 0:ie.id,functions:{content:{createContent:()=>console.log("create"),deleteContent:()=>console.log("delete"),updateContent:(ee,te)=>O({activityInfo:ee,content:te})},likes:{createLike:()=>Q({activityId:n}),deleteLike:()=>k({activityId:n})},comments:{openComments:()=>{}}},children:E.jsxs(E.Fragment,{children:[E.jsxs("h3",{children:["Comments (",((ae=_==null?void 0:_.reaction_counts)==null?void 0:ae.reply)||0,")"]}),E.jsx(rd,{basePath:e,parentId:t,activityId:n,repliesList:(be=_==null?void 0:_.latest_reactions)==null?void 0:be.reply,isMember:r,functions:{createReply:u,like:a,unlike:d,editReply:c,join:f,leave:p}})]})},n)},J_=({id:e,data:{jobTitle:t,name:n,organization:r,thumbnail:s}})=>({id:e,name:n,jobTitle:t,organization:r,image:{thumbnail:s}});exports.ASSETS_BUCKET=Bn;exports.ActivitiesFeed=q_;exports.ActivitySection=K_;exports.AddPost=Na;exports.BannerSection=Fv;exports.Breadcrumbs=Zv;exports.Button=xe;exports.ButtonWrapper=Qr;exports.CacheProvider=Bf;exports.CollapsibleSection=Sa;exports.Columns=i_;exports.CommunityDetails=Xv;exports.Contributors=Uf;exports.ConversationContext=Pa;exports.CookieBanner=Gf;exports.DiscussionConversation=P_;exports.DiscussionForm=Ca;exports.DiscussionLikes=Zf;exports.DiscussionPost=Xn;exports.DiscussionThread=j_;exports.Divider=Jt;exports.DownloadSection=Pv;exports.EMAILS=Gt;exports.EmailHelperTextBox=o_;exports.EmptyStateBox=Yr;exports.Filters=e_;exports.Footer=Aa;exports.FullWidthSection=ba;exports.GlobalProviders=Jv;exports.Header=Ra;exports.HelperTextBox=If;exports.HiddenFromScreenReaders=aa;exports.HideShowTextBox=Dv;exports.HighlightedTextBox=gt;exports.IntlProvider=$f;exports.InviteForm=Xf;exports.InviteModal=L_;exports.JoinButton=Ta;exports.LanguageSwitcher=r_;exports.Link=zr;exports.LoadMore=Hf;exports.LoadingBlock=zv;exports.LoadingPlaceholder=st;exports.LoadingState=Mf;exports.Logo=xa;exports.LogoSection=Iv;exports.MarkdownText=ra;exports.MarketingBox=jv;exports.Member=Kn;exports.MembersList=C_;exports.Modal=ed;exports.MoreMenu=Wf;exports.NUMBER_OF_USERS=Mv;exports.Overlay=Ia;exports.PageLayout=x_;exports.PasswordRules=c_;exports.Pill=Lf;exports.ProfilePicture=Yn;exports.ProgressBar=Ff;exports.Rating=u_;exports.RepliesFeed=rd;exports.ResponsesHeading=F_;exports.ResponsiveImage=Cf;exports.SearchForm=Yf;exports.Span=kf;exports.StatusBanner=$n;exports.Tags=R_;exports.Tooltip=Nf;exports.UserContext=yt;exports.UserProvider=qf;exports.VisuallyHidden=Be;exports.addAriaProps=td;exports.getMember=Oa;exports.headerData=Br;exports.mapGetStreamData=J_;exports.useCurrentPath=Cu;exports.useEffectAfterMount=jt;exports.useFeatureFlag=gv;exports.useScreenWidth=Vr;exports.useScrollListener=Tf;exports.useScrollToHash=vv;
|