@apolitical/component-library 1.10.0-beta.1 → 1.10.0-beta.2
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/{4TNE5QTO-04c56612.mjs → 4TNE5QTO-98342ceb.mjs} +1 -1
- package/{4TNE5QTO-7341e8bc.js → 4TNE5QTO-f73ecbf4.js} +1 -1
- package/context/flags/flags.provider.d.ts +1 -1
- package/{index-5476c4fc.js → index-828b4830.js} +2 -2
- package/{index-aeeb4f98.mjs → index-ad7c274d.mjs} +2992 -2992
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -56,12 +56,12 @@ For more details see https://formatjs.io/docs/getting-started/message-distributi
|
|
|
56
56
|
`},paragraph:{t:J_,i:ie.LOW,l:Wa,h:(f,p,v)=>n("p",{key:v.k},p(f.v,v))},ref:{t:vr(w_),i:ie.MAX,l:f=>(a[f[1]]={B:f[2],F:f[4]},{}),h:Ya},refImage:{t:_r(x_),i:ie.MAX,l:f=>({D:f[1]||void 0,P:f[2]}),h:(f,p,v)=>n("img",{key:v.k,alt:f.D,src:On(a[f.P].B),title:a[f.P].F})},refLink:{t:vr(S_),i:ie.MAX,l:(f,p,v)=>({v:p(f[1],v),Z:p(f[0].replace(E_,"\\$1"),v),P:f[2]}),h:(f,p,v)=>a[f.P]?n("a",{key:v.k,href:On(a[f.P].B),title:a[f.P].F},p(f.v,v)):n("span",{key:v.k},p(f.Z,v))},table:{t:er(nh),i:ie.HIGH,l:Y_,h:(f,p,v)=>n("table",{key:v.k},n("thead",null,n("tr",null,f.L.map(function(x,S){return n("th",{key:S,style:ju(f,S)},p(x,v))}))),n("tbody",null,f.A.map(function(x,S){return n("tr",{key:S},x.map(function(k,T){return n("td",{key:T,style:ju(f,T)},p(k,v))}))})))},tableSeparator:{t:function(f,p){return p.$?(p._=!0,C_.exec(f)):null},i:ie.HIGH,l:function(){return{type:"tableSeparator"}},h:()=>" | "},text:{t:Fi(L_),i:ie.MIN,l:f=>({v:f[0].replace(p_,(p,v)=>t.namedCodesToUnicode[v]?t.namedCodesToUnicode[v]:p)}),h:f=>f.v},textBolded:{t:_r($_),i:ie.MED,l:(f,p,v)=>({v:p(f[2],v)}),h:(f,p,v)=>n("strong",{key:v.k},p(f.v,v))},textEmphasized:{t:_r(F_),i:ie.LOW,l:(f,p,v)=>({v:p(f[2],v)}),h:(f,p,v)=>n("em",{key:v.k},p(f.v,v))},textEscaped:{t:_r(N_),i:ie.HIGH,l:f=>({v:f[1],type:"text"})},textMarked:{t:_r(R_),i:ie.LOW,l:Wa,h:(f,p,v)=>n("mark",{key:v.k},p(f.v,v))},textStrikethroughed:{t:_r(j_),i:ie.LOW,l:Wa,h:(f,p,v)=>n("del",{key:v.k},p(f.v,v))}};t.disableParsingRawHTML!==!0&&(l.htmlBlock={t:Fi(Rl),i:ie.HIGH,l(f,p,v){const[,x]=f[3].match(B_),S=new RegExp(`^${x}`,"gm"),k=f[3].replace(S,""),T=(P=k,Q_.some(E=>E.test(P))?Z_:io);var P;const y=f[1].toLowerCase(),O=e_.indexOf(y)!==-1;v.N=v.N||y==="a";const M=O?f[3]:T(p,k,v);return v.N=!1,{O:s(f[2]),v:M,G:O,H:O?y:f[1]}},h:(f,p,v)=>n(f.H,Wr({key:v.k},f.O),f.G?f.v:p(f.v,v))},l.htmlSelfClosing={t:Fi(jl),i:ie.HIGH,l:f=>({O:s(f[2]||""),H:f[1]}),h:(f,p,v)=>n(f.H,Wr({},f.O,{key:v.k}))});const u=function(f){let p=Object.keys(f);function v(x,S){let k=[],T="";for(;x;){let P=0;for(;P<p.length;){const y=p[P],O=f[y],M=O.t(x,S,T);if(M){const E=M[0];x=x.substring(E.length);const I=O.l(M,v,S);I.type==null&&(I.type=y),k.push(I),T=E;break}P++}}return k}return p.sort(function(x,S){let k=f[x].i,T=f[S].i;return k!==T?k-T:x<S?-1:1}),function(x,S){return v(function(k){return k.replace(c_,`
|
|
57
57
|
`).replace(f_,"").replace(T_," ")}(x),S)}}(l),c=(h=function(f){return function(p,v,x){return f[p.type].h(p,v,x)}}(l),function f(p,v={}){if(Array.isArray(p)){const x=v.k,S=[];let k=!1;for(let T=0;T<p.length;T++){v.k=T;const P=f(p[T],v),y=typeof P=="string";y&&k?S[S.length-1]+=P:P!==null&&S.push(P),k=y}return v.k=x,S}return h(p,f,v)});var h;const m=i(e);return o.length?n("div",null,m,n("footer",{key:"footer"},o.map(function(f){return n("div",{id:t.slugify(f.j),key:f.j},f.j,c(u(f.I,{_:!0})))}))):m}(function(e){e[e.MAX=0]="MAX",e[e.HIGH=1]="HIGH",e[e.MED=2]="MED",e[e.LOW=3]="LOW",e[e.MIN=4]="MIN"})(ie||(ie={}));const Go=e=>{let{children:t,options:r}=e,n=function(i,s){if(i==null)return{};var o,a,l={},u=Object.keys(i);for(a=0;a<u.length;a++)s.indexOf(o=u[a])>=0||(l[o]=i[o]);return l}(e,Zv);return Q.cloneElement(ty(t,r),n)};const ar=({variant:e="primary",className:t="",children:r,...n})=>g.jsx("div",{className:L("highlighted-text-box",e,t),...n,children:r});const bs=({variant:e="empty",text:t=!1,button:r=!1,className:n=""})=>{let i=r&&!!Object.keys(r).length;const s=typeof r=="object"&&"breakpoints"in r,o=ms(s);if(s&&typeof r=="object"&&typeof o=="number"){const h=Object.assign({},r.breakpoints),m=ff(Object.keys(h));i=hf(o,m,h)}const{breakpoints:a,text:l="",component:u,...c}=r;return g.jsx(ar,{variant:"subtle",className:L("empty-state-box",e,n),children:g.jsxs(g.Fragment,{children:[t&&g.jsx(Go,{options:{forceBlock:!0},children:t}),i&&typeof r=="object"&&(u||g.jsx(Oe,{...c,variant:r.variant?r.variant:"secondary",children:l}))]})})};const Nl=({children:e,...t})=>g.jsx("p",{...t,children:e}),mh={q:Nl,blockquote:Nl};for(let e=1;e<=6;e++)mh[`h${e}`]={component:Nl,props:{className:"title"}};const gh=({type:e="default",className:t="",heading:r=!1,children:n})=>g.jsxs("div",{className:L("helper-text-box text-small",e,t),children:[r&&g.jsx("p",{className:"title",children:r}),typeof n=="string"?g.jsx(Go,{options:{wrapper:C.Fragment,forceBlock:!0,overrides:mh},children:n}):g.jsx("p",{children:n})]});const ry=({className:e="",show:t=!1,hide:r=!1,text:n,children:i})=>{const s=te(),o=C.useRef(null),[a,l]=C.useState(""),[u,c]=C.useState("closed");C.useEffect(()=>{const f=o.current;if(f)return f.addEventListener("transitionend",h),()=>{f.removeEventListener("transitionend",h)}},[]),C.useEffect(()=>{if(!n||typeof n!="string")return;const f=n.split(`
|
|
58
58
|
`);l(f.length<3?`${n.substring(0,400)}...`:f.slice(0,3).join(`
|
|
59
|
-
`))},[n]),C.useEffect(()=>{u==="ready-to-close"&&c("closing")},[u]);const h=({propertyName:f})=>{f==="max-height"&&c(p=>p==="opening"?"open":p==="closing"?"closed":p)};if(!n)return null;const m=["opening","open"].includes(u);return g.jsxs(ar,{variant:"subtle",className:L("hide-show-text-box",e),children:[g.jsxs("div",{ref:o,className:L("content",u),children:[g.jsx(Go,{options:{forceBlock:!0},children:u==="closed"?a:n}),u!=="closed"&&i]}),g.jsx("p",{className:"cta",children:g.jsx(Oe,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:L({"rotate-180":m}),onClick:()=>{c(m?"ready-to-close":"opening")},children:m?r||s.formatMessage({id:"hideShowTextBox_hide"}):t||s.formatMessage({id:"hideShowTextBox_show"})})})]})},ny=()=>C.Fragment,iy=({children:e})=>g.jsx(ar,{variant:"secondary",children:e}),sy=["span","strong","h1","h2","h3","h4","h5","h6","p"],oy=({children:e})=>{const t=te();if(!e)return null;let r=t.formatMessage({id:"markdown_collapsibleSection_summary"});const n=[];for(const s of C.Children.toArray(e))if(!(!s||typeof s=="string"||typeof s=="number"))if(C.isValidElement(s)&&s.type==="summary"){if(s.props&&s.props.children){for(const o of C.Children.toArray(s.props.children))if(!(!o||typeof o=="string"||typeof o=="number")&&C.isValidElement(o)){const a=o.type;if(sy.includes(a)){for(r=o.props.children;typeof r!="string"&&(Array.isArray(r)&&r[0].props&&r[0].props.children&&r[0].props.children[0]);)r=r[0].props.children[0];break}}}}else n.push(s);const i=r?r.toString():"";return g.jsx($c,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:n.map(s=>s)})},ay=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return g.jsx(ar,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return g.jsx(ar,{variant:"primary",children:e});case"pink-textbox":return g.jsx(ar,{variant:"tertiary",children:e});default:return g.jsx("div",{...t,children:e})}return g.jsx("div",{...t,children:e})},ly=e=>{const t=te(),r=Date.now().toString();let n="default";const i=e.src;return i.includes("youtube")||i.includes("vimeo")?n="video":i.includes("riddle")||i.includes("sli.do")?n="poll":i.includes("padlet")&&(n="padlet"),g.jsxs(g.Fragment,{children:[g.jsx(ze,{children:g.jsx("a",{href:`#content-after-iframe-${r}`,children:t.formatMessage({id:`markdown_skip${n==="default"?"":`_${n}`}`})})}),g.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${n==="default"?"":`_${n}`}`})}),g.jsx("span",{id:`content-after-iframe-${r}`,tabIndex:-1})]})},Lu=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},cy=({children:e,...t})=>{let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let n=e,i=!1;for(const s of C.Children.toArray(e))if(!(!s||typeof s=="string"||typeof s=="number")&&C.isValidElement(s)){const o=s.type;if(["button","center","span","strong"].includes(o)&&s.props&&s.props.children&&s.props.children[0])for((o==="button"||Lu(s.props.children[0])==="button")&&(i=!0),n=s.props.children[0];n&&typeof n!="string"&&!(typeof n=="boolean"||typeof n=="number"||!C.isValidElement(n));)if(n.props&&n.props.children&&n.props.children[0])n=n.props.children[0],n&&Lu(n)==="button"&&(i=!0);else break}return i?(r={...r,className:"button primary medium"},g.jsx("p",{className:"center",children:g.jsx(Oe,{variant:"primary",size:"medium",...r,children:n})})):g.jsx("a",{...r,children:n})},vh=({children:e})=>g.jsx("span",{children:e});const Ll=({className:e="",options:t={},children:r})=>{r=r.replace(/^<br\/?>/,"");const n={wrapper:C.Fragment,forceBlock:!0,overrides:{a:cy,CollapsibleSection:$c,TextBox:ar,CaseStudy:iy,style:ny,details:oy,div:ay,iframe:ly}};return g.jsx("div",{className:L("markdown-text",e),children:g.jsx(Go,{options:{...n,...t},children:r})})};const _h=({size:e="medium",variant:t="default",className:r="",children:n})=>g.jsx("span",{className:L("pill",e,t,r),children:n});const _o=({element:e="p",children:t=null,className:r="",...n})=>C.createElement(e,{...n,className:L("status-banner text-small",r),"aria-live":"assertive"},t);const uy=({progress:e=0,text:t=!1,className:r=""})=>{const n=te(),i=e>75?100:e>50?75:e>25?50:e>5?25:0,s={"--progress":`${e}%`};return g.jsx("span",{className:L(`progress-bar section-${i}`,r),style:s,children:g.jsx(ze,{children:t?`${e} ${t}`:n.formatMessage({id:"progressBar"},{number:e})})})},yh=C.memo(uy);const Ka="loadingBlock_",dy=({progress:e=0,steps:t=!1,className:r=""})=>{const n=te();t||(t={0:{text:n.formatMessage({id:`${Ka}loading`})},75:{text:n.formatMessage({id:`${Ka}almostDone`})},100:{text:n.formatMessage({id:`${Ka}complete`})}});let i=null;const s=Object.keys(t);for(let a=0;a<s.length&&!(e<parseInt(s[a]));a++)i=s[a];const o=i&&t[i].icon?{"--icon":`url(${vo}icons/${t[i].icon}.svg)`}:{};return g.jsxs(ar,{className:L("loading-block",r,{"has-icon":i&&t[i].icon}),variant:"subtle",style:o,children:[i&&g.jsx("span",{className:"step",children:t[i].text}),g.jsx(yh,{progress:e})]})},fy=C.memo(dy);const Vt=({element:e="div",className:t="",...r})=>g.jsx(xc,{element:e,className:L("loading-placeholder",t),...r});const Dl={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"]},bh=(e,t)=>e in Dl?g.jsx("div",{className:e,children:Dl[e].map((r,n)=>bh(r,n))},t):g.jsx(Vt,{className:e},t),wh=({layout:e="overview-page"})=>g.jsx("div",{className:L("loading-state",e),children:Dl[e].map((t,r)=>bh(t,r))}),xh=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):""},zs=["#5AB6A3","#A2D7AF","#806056","#3962B3"],hy=e=>{const t=Math.ceil(26/zs.length),r=xh(e).toLowerCase();if(r==="")return zs[0];const n=r.charCodeAt(0)-96;for(let i=0;i<zs.length;i++)if(n<=t*(i+1))return zs[i]};const Du=256,zo=({className:e="",src:t="",name:r,alt:n,width:i=Du,height:s=Du,...o})=>{const[a,l]=C.useState(!1),u=C.useRef(null);C.useEffect(()=>{const h=u.current;if(!h)return;const m=h.getContext("2d");if(!m)return;const f=i,p=s;typeof window<"u"&&window.devicePixelRatio&&(h.width=f*window.devicePixelRatio,h.height=p*window.devicePixelRatio,m.scale(window.devicePixelRatio,window.devicePixelRatio)),m.fillStyle=hy(r),m.fillRect(0,0,f,p),m.font=`${f/3}px Arial`,m.textAlign="center",m.fillStyle="white",m.fillText(xh(r),f/2,p/1.6)},[r]);let c=!1;return t&&t!==""&&!a&&(t.includes("http")||t.includes("//"))&&(c=!0),g.jsx("figure",{className:L("profile-picture",e,{error:a}),...o,children:c?g.jsx("img",{src:t,alt:n||r,onError:()=>{l(!0)},width:i,height:s}):g.jsx("canvas",{ref:u})})},jc=e=>e==="apolitical"?{image:`${vo}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${vo}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},py=({role:e="",organisation:t="",country:r="",maximumCharacters:n=80})=>{const i=e!=="",s=t!=="",o=r!=="";if(!i&&!s&&!o)return"";const a=`${e}${i&&s?` — ${t}`:t}`;let l=`${a}${(i||s)&&o?`, ${r}`:r}`;return l.length>n&&(l=a),l.length>n&&(l=Ic(l,n)),l};const qo=({element:e="div",member:t="community",additionalContent:r=!1,gtmContext:n="member",gtmType:i="member-click",className:s=""})=>{const o=te(),a=jc(t);a.name||(a.name=o.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:l,url:u,image:c}=a,h=py(a),m=r&&r.createdAt?cg(r.createdAt):!1,f=r&&r.createdAt?lg(r.createdAt):"";return C.createElement(e,{className:L("member text-medium",s),children:g.jsxs(vs,{href:u,gtmType:i,gtmContext:n,onClick:p=>{p==null||p.stopPropagation()},children:[g.jsx(zo,{name:l,src:c}),g.jsxs("p",{className:"details",children:[g.jsx("strong",{children:l}),r&&g.jsxs("span",{className:"additional-content",children:[r.createdAt&&m&&g.jsx("span",{className:"date",title:f,"aria-label":f,children:o.formatMessage({id:`dates_${m.path}`},{number:m.number})}),r.didEdit&&g.jsx("em",{children:o.formatMessage({id:"discussion_edited"})})]}),h&&g.jsx("small",{children:h})]})]})})};const Bu={small:24,medium:48},Sh=({element:e="div",contributors:{total:t,data:r}={total:void 0,data:[]},styling:{showText:n,size:i,showGap:s,showPlaceholders:o}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:a=2,className:l=""})=>{const u=te();return!r||r.length===0?null:C.createElement(e,{className:L("contributors",l,i,{"has-gap":s}),children:g.jsxs(g.Fragment,{children:[g.jsx("ul",{children:r.map((c,h)=>{let m,f="";if(h<a){const{name:p="",image:v=""}=jc(c);if(o)return g.jsx(Vt,{element:"li",className:"contributor"},h);m=g.jsx(zo,{name:p,src:v,width:Bu[i||"medium"],height:Bu[i||"medium"]})}else if(h===a){const p=(t||r.length)-a;m=g.jsxs("small",{className:L({"large-number":p>99}),children:["+",mg(p,0)]}),f="number-left"}return m?g.jsx("li",{className:L("contributor",f),children:m},h):null})}),n&&g.jsx("span",{className:"label",children:typeof n=="string"?n:r.length===1?typeof r[0]=="string"?u.formatMessage({id:`member_${r[0]}`}):Ic(r[0].name||"",20):null})]})})};var pi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ci=typeof window>"u"||"Deno"in window;function Et(){}function my(e,t){return typeof e=="function"?e(t):e}function Bl(e){return typeof e=="number"&&e>=0&&e!==1/0}function Eh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Hu(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==Nc(o,t.options))return!1}else if(!Vi(t.queryKey,o))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof i<"u"&&i!==t.state.fetchStatus||s&&!s(t))}function Uu(e,t){const{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(qi(t.options.mutationKey)!==qi(s))return!1}else if(!Vi(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Nc(e,t){return((t==null?void 0:t.queryKeyHashFn)||qi)(e)}function qi(e){return JSON.stringify(e,(t,r)=>Hl(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Vi(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!Vi(e[r],t[r])):!1}function kh(e,t){if(e===t)return e;const r=Gu(e)&&Gu(t);if(r||Hl(e)&&Hl(t)){const n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),s=i.length,o=r?[]:{};let a=0;for(let l=0;l<s;l++){const u=r?l:i[l];o[u]=kh(e[u],t[u]),o[u]===e[u]&&a++}return n===s&&a===n?e:o}return t}function yo(e,t){if(e&&!t||t&&!e)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Gu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Hl(e){if(!zu(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!zu(r)||!r.hasOwnProperty("isPrototypeOf"))}function zu(e){return Object.prototype.toString.call(e)==="[object Object]"}function Th(e){return new Promise(t=>{setTimeout(t,e)})}function qu(e){Th(0).then(e)}function Ul(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?kh(e,t):t}function gy(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function vy(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Yr,Sr,Dn,Ud,_y=(Ud=class extends pi{constructor(){super();F(this,Yr,void 0);F(this,Sr,void 0);F(this,Dn,void 0);$(this,Dn,t=>{if(!ci&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){b(this,Sr)||this.setEventListener(b(this,Dn))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,Sr))==null||t.call(this),$(this,Sr,void 0))}setEventListener(t){var r;$(this,Dn,t),(r=b(this,Sr))==null||r.call(this),$(this,Sr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){b(this,Yr)!==t&&($(this,Yr,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof b(this,Yr)=="boolean"?b(this,Yr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Yr=new WeakMap,Sr=new WeakMap,Dn=new WeakMap,Ud),bo=new _y,Bn,Er,Hn,Gd,yy=(Gd=class extends pi{constructor(){super();F(this,Bn,!0);F(this,Er,void 0);F(this,Hn,void 0);$(this,Hn,t=>{if(!ci&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){b(this,Er)||this.setEventListener(b(this,Hn))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,Er))==null||t.call(this),$(this,Er,void 0))}setEventListener(t){var r;$(this,Hn,t),(r=b(this,Er))==null||r.call(this),$(this,Er,t(this.setOnline.bind(this)))}setOnline(t){b(this,Bn)!==t&&($(this,Bn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return b(this,Bn)}},Bn=new WeakMap,Er=new WeakMap,Hn=new WeakMap,Gd),Qi=new yy;function by(e){return Math.min(1e3*2**e,3e4)}function Vo(e){return(e??"online")==="online"?Qi.isOnline():!0}var Ch=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Za(e){return e instanceof Ch}function Ph(e){let t=!1,r=0,n=!1,i,s,o;const a=new Promise((x,S)=>{s=x,o=S}),l=x=>{var S;n||(f(new Ch(x)),(S=e.abort)==null||S.call(e))},u=()=>{t=!0},c=()=>{t=!1},h=()=>!bo.isFocused()||e.networkMode!=="always"&&!Qi.isOnline(),m=x=>{var S;n||(n=!0,(S=e.onSuccess)==null||S.call(e,x),i==null||i(),s(x))},f=x=>{var S;n||(n=!0,(S=e.onError)==null||S.call(e,x),i==null||i(),o(x))},p=()=>new Promise(x=>{var S;i=k=>{const T=n||!h();return T&&x(k),T},(S=e.onPause)==null||S.call(e)}).then(()=>{var x;i=void 0,n||(x=e.onContinue)==null||x.call(e)}),v=()=>{if(n)return;let x;try{x=e.fn()}catch(S){x=Promise.reject(S)}Promise.resolve(x).then(m).catch(S=>{var O;if(n)return;const k=e.retry??(ci?0:3),T=e.retryDelay??by,P=typeof T=="function"?T(r,S):T,y=k===!0||typeof k=="number"&&r<k||typeof k=="function"&&k(r,S);if(t||!y){f(S);return}r++,(O=e.onFail)==null||O.call(e,r,S),Th(P).then(()=>{if(h())return p()}).then(()=>{t?f(S):v()})})};return Vo(e.networkMode)?v():p().then(v),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:u,continueRetry:c}}function wy(){let e=[],t=0,r=c=>{c()},n=c=>{c()};const i=c=>{let h;t++;try{h=c()}finally{t--,t||a()}return h},s=c=>{t?e.push(c):qu(()=>{r(c)})},o=c=>(...h)=>{s(()=>{c(...h)})},a=()=>{const c=e;e=[],c.length&&qu(()=>{n(()=>{c.forEach(h=>{r(h)})})})};return{batch:i,batchCalls:o,schedule:s,setNotifyFunction:c=>{r=c},setBatchNotifyFunction:c=>{n=c}}}var Re=wy(),Jr,zd,Ah=(zd=class{constructor(){F(this,Jr,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Bl(this.gcTime)&&$(this,Jr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ci?1/0:5*60*1e3))}clearGcTimeout(){b(this,Jr)&&(clearTimeout(b(this,Jr)),$(this,Jr,void 0))}},Jr=new WeakMap,zd),Un,Gn,bt,kr,wt,Ne,Zi,Kr,zn,so,At,nr,qd,xy=(qd=class extends Ah{constructor(t){super();F(this,zn);F(this,At);F(this,Un,void 0);F(this,Gn,void 0);F(this,bt,void 0);F(this,kr,void 0);F(this,wt,void 0);F(this,Ne,void 0);F(this,Zi,void 0);F(this,Kr,void 0);$(this,Kr,!1),$(this,Zi,t.defaultOptions),X(this,zn,so).call(this,t.options),$(this,Ne,[]),$(this,bt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,$(this,Un,t.state||Sy(this.options)),this.state=b(this,Un),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!b(this,Ne).length&&this.state.fetchStatus==="idle"&&b(this,bt).remove(this)}setData(t,r){const n=Ul(this.state.data,t,this.options);return X(this,At,nr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){X(this,At,nr).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n;const r=b(this,kr);return(n=b(this,wt))==null||n.cancel(t),r?r.then(Et).catch(Et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(b(this,Un))}isActive(){return b(this,Ne).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||b(this,Ne).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Eh(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=b(this,Ne).find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=b(this,wt))==null||r.continue()}onOnline(){var r;const t=b(this,Ne).find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=b(this,wt))==null||r.continue()}addObserver(t){b(this,Ne).includes(t)||(b(this,Ne).push(t),this.clearGcTimeout(),b(this,bt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){b(this,Ne).includes(t)&&($(this,Ne,b(this,Ne).filter(r=>r!==t)),b(this,Ne).length||(b(this,wt)&&(b(this,Kr)?b(this,wt).cancel({revert:!0}):b(this,wt).cancelRetry()),this.scheduleGc()),b(this,bt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return b(this,Ne).length}invalidate(){this.state.isInvalidated||X(this,At,nr).call(this,{type:"invalidate"})}fetch(t,r){var u,c,h,m;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(b(this,kr))return(u=b(this,wt))==null||u.continueRetry(),b(this,kr)}if(t&&X(this,zn,so).call(this,t),!this.options.queryFn){const f=b(this,Ne).find(p=>p.options.queryFn);f&&X(this,zn,so).call(this,f.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,i={queryKey:this.queryKey,meta:this.meta},s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>($(this,Kr,!0),n.signal)})};s(i);const o=()=>this.options.queryFn?($(this,Kr,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};s(a),(c=this.options.behavior)==null||c.onFetch(a,this),$(this,Gn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&X(this,At,nr).call(this,{type:"fetch",meta:(m=a.fetchOptions)==null?void 0:m.meta});const l=f=>{var p,v,x,S;Za(f)&&f.silent||X(this,At,nr).call(this,{type:"error",error:f}),Za(f)||((v=(p=b(this,bt).config).onError)==null||v.call(p,f,this),(S=(x=b(this,bt).config).onSettled)==null||S.call(x,this.state.data,f,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return $(this,wt,Ph({fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var p,v,x,S;if(typeof f>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(f),(v=(p=b(this,bt).config).onSuccess)==null||v.call(p,f,this),(S=(x=b(this,bt).config).onSettled)==null||S.call(x,f,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(f,p)=>{X(this,At,nr).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{X(this,At,nr).call(this,{type:"pause"})},onContinue:()=>{X(this,At,nr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),$(this,kr,b(this,wt).promise),b(this,kr)}},Un=new WeakMap,Gn=new WeakMap,bt=new WeakMap,kr=new WeakMap,wt=new WeakMap,Ne=new WeakMap,Zi=new WeakMap,Kr=new WeakMap,zn=new WeakSet,so=function(t){this.options={...b(this,Zi),...t},this.updateGcTime(this.options.gcTime)},At=new WeakSet,nr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Vo(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Za(i)&&i.revert&&b(this,Gn)?{...b(this,Gn),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Re.batch(()=>{b(this,Ne).forEach(n=>{n.onQueryUpdate()}),b(this,bt).notify({query:this,type:"updated",action:t})})},qd);function Sy(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof t<"u",n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Bt,Vd,Ey=(Vd=class extends pi{constructor(t={}){super();F(this,Bt,void 0);this.config=t,$(this,Bt,new Map)}build(t,r,n){const i=r.queryKey,s=r.queryHash??Nc(i,r);let o=this.get(s);return o||(o=new xy({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){b(this,Bt).has(t.queryHash)||(b(this,Bt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=b(this,Bt).get(t.queryHash);r&&(t.destroy(),r===t&&b(this,Bt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Re.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return b(this,Bt).get(t)}getAll(){return[...b(this,Bt).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Hu(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Hu(t,n)):r}notify(t){Re.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Re.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Re.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Bt=new WeakMap,Vd),Ht,es,mt,qn,Ut,yr,Qd,ky=(Qd=class extends Ah{constructor(t){super();F(this,Ut);F(this,Ht,void 0);F(this,es,void 0);F(this,mt,void 0);F(this,qn,void 0);this.mutationId=t.mutationId,$(this,es,t.defaultOptions),$(this,mt,t.mutationCache),$(this,Ht,[]),this.state=t.state||Oh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...b(this,es),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){b(this,Ht).includes(t)||(b(this,Ht).push(t),this.clearGcTimeout(),b(this,mt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){$(this,Ht,b(this,Ht).filter(r=>r!==t)),this.scheduleGc(),b(this,mt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){b(this,Ht).length||(this.state.status==="pending"?this.scheduleGc():b(this,mt).remove(this))}continue(){var t;return((t=b(this,qn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,u,c,h,m,f,p,v,x,S,k,T,P,y,O,M;const r=()=>($(this,qn,Ph({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,I)=>{X(this,Ut,yr).call(this,{type:"failed",failureCount:E,error:I})},onPause:()=>{X(this,Ut,yr).call(this,{type:"pause"})},onContinue:()=>{X(this,Ut,yr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),b(this,qn).promise),n=this.state.status==="pending";try{if(!n){X(this,Ut,yr).call(this,{type:"pending",variables:t}),await((s=(i=b(this,mt).config).onMutate)==null?void 0:s.call(i,t,this));const I=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));I!==this.state.context&&X(this,Ut,yr).call(this,{type:"pending",context:I,variables:t})}const E=await r();return await((u=(l=b(this,mt).config).onSuccess)==null?void 0:u.call(l,E,t,this.state.context,this)),await((h=(c=this.options).onSuccess)==null?void 0:h.call(c,E,t,this.state.context)),await((f=(m=b(this,mt).config).onSettled)==null?void 0:f.call(m,E,null,this.state.variables,this.state.context,this)),await((v=(p=this.options).onSettled)==null?void 0:v.call(p,E,null,t,this.state.context)),X(this,Ut,yr).call(this,{type:"success",data:E}),E}catch(E){try{throw await((S=(x=b(this,mt).config).onError)==null?void 0:S.call(x,E,t,this.state.context,this)),await((T=(k=this.options).onError)==null?void 0:T.call(k,E,t,this.state.context)),await((y=(P=b(this,mt).config).onSettled)==null?void 0:y.call(P,void 0,E,this.state.variables,this.state.context,this)),await((M=(O=this.options).onSettled)==null?void 0:M.call(O,void 0,E,t,this.state.context)),E}finally{X(this,Ut,yr).call(this,{type:"error",error:E})}}}},Ht=new WeakMap,es=new WeakMap,mt=new WeakMap,qn=new WeakMap,Ut=new WeakSet,yr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Vo(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Re.batch(()=>{b(this,Ht).forEach(n=>{n.onMutationUpdate(t)}),b(this,mt).notify({mutation:this,type:"updated",action:t})})},Qd);function Oh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xt,ts,Zr,Wd,Ty=(Wd=class extends pi{constructor(t={}){super();F(this,xt,void 0);F(this,ts,void 0);F(this,Zr,void 0);this.config=t,$(this,xt,[]),$(this,ts,0)}build(t,r,n){const i=new ky({mutationCache:this,mutationId:++Hs(this,ts)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){b(this,xt).push(t),this.notify({type:"added",mutation:t})}remove(t){$(this,xt,b(this,xt).filter(r=>r!==t)),this.notify({type:"removed",mutation:t})}clear(){Re.batch(()=>{b(this,xt).forEach(t=>{this.remove(t)})})}getAll(){return b(this,xt)}find(t){const r={exact:!0,...t};return b(this,xt).find(n=>Uu(r,n))}findAll(t={}){return b(this,xt).filter(r=>Uu(t,r))}notify(t){Re.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){return $(this,Zr,(b(this,Zr)??Promise.resolve()).then(()=>{const t=b(this,xt).filter(r=>r.state.isPaused);return Re.batch(()=>t.reduce((r,n)=>r.then(()=>n.continue().catch(Et)),Promise.resolve()))}).then(()=>{$(this,Zr,void 0)})),b(this,Zr)}},xt=new WeakMap,ts=new WeakMap,Zr=new WeakMap,Wd);function Cy(e){return{onFetch:(t,r)=>{const n=async()=>{var p,v,x,S,k;const i=t.options,s=(x=(v=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:v.fetchMore)==null?void 0:x.direction,o=((S=t.state.data)==null?void 0:S.pages)||[],a=((k=t.state.data)==null?void 0:k.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const c=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},h=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),m=async(T,P,y)=>{if(u)return Promise.reject();if(P==null&&T.pages.length)return Promise.resolve(T);const O={queryKey:t.queryKey,pageParam:P,direction:y?"backward":"forward",meta:t.options.meta};c(O);const M=await h(O),{maxPages:E}=t.options,I=y?vy:gy;return{pages:I(T.pages,M,E),pageParams:I(T.pageParams,P,E)}};let f;if(s&&o.length){const T=s==="backward",P=T?Py:Vu,y={pages:o,pageParams:a},O=P(i,y);f=await m(y,O,T)}else{f=await m(l,a[0]??i.initialPageParam);const T=e??o.length;for(let P=1;P<T;P++){const y=Vu(i,f);f=await m(f,y)}}return f};t.options.persister?t.fetchFn=()=>{var i,s;return(s=(i=t.options).persister)==null?void 0:s.call(i,n,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=n}}}function Vu(e,{pages:t,pageParams:r}){const n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Py(e,{pages:t,pageParams:r}){var n;return(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r)}var Fe,Tr,Cr,Vn,Qn,Pr,Wn,Xn,Xd,Ay=(Xd=class{constructor(e={}){F(this,Fe,void 0);F(this,Tr,void 0);F(this,Cr,void 0);F(this,Vn,void 0);F(this,Qn,void 0);F(this,Pr,void 0);F(this,Wn,void 0);F(this,Xn,void 0);$(this,Fe,e.queryCache||new Ey),$(this,Tr,e.mutationCache||new Ty),$(this,Cr,e.defaultOptions||{}),$(this,Vn,new Map),$(this,Qn,new Map),$(this,Pr,0)}mount(){Hs(this,Pr)._++,b(this,Pr)===1&&($(this,Wn,bo.subscribe(()=>{bo.isFocused()&&(this.resumePausedMutations(),b(this,Fe).onFocus())})),$(this,Xn,Qi.subscribe(()=>{Qi.isOnline()&&(this.resumePausedMutations(),b(this,Fe).onOnline())})))}unmount(){var e,t;Hs(this,Pr)._--,b(this,Pr)===0&&((e=b(this,Wn))==null||e.call(this),$(this,Wn,void 0),(t=b(this,Xn))==null||t.call(this),$(this,Xn,void 0))}isFetching(e){return b(this,Fe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return b(this,Tr).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=b(this,Fe).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=b(this,Fe).find({queryKey:e}),i=n==null?void 0:n.state.data,s=my(t,i);if(typeof s>"u")return;const o=this.defaultQueryOptions({queryKey:e});return b(this,Fe).build(this,o).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return Re.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var t;return(t=b(this,Fe).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=b(this,Fe);Re.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=b(this,Fe),n={type:"active",...e};return Re.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=Re.batch(()=>b(this,Fe).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Et).catch(Et)}invalidateQueries(e={},t={}){return Re.batch(()=>{if(b(this,Fe).findAll(e).forEach(n=>{n.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){const r={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},n=Re.batch(()=>b(this,Fe).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Et)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Et)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const r=b(this,Fe).build(this,t);return r.isStaleByTime(t.staleTime)?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Et).catch(Et)}fetchInfiniteQuery(e){return e.behavior=Cy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Et).catch(Et)}resumePausedMutations(){return b(this,Tr).resumePausedMutations()}getQueryCache(){return b(this,Fe)}getMutationCache(){return b(this,Tr)}getDefaultOptions(){return b(this,Cr)}setDefaultOptions(e){$(this,Cr,e)}setQueryDefaults(e,t){b(this,Vn).set(qi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...b(this,Vn).values()];let r={};return t.forEach(n=>{Vi(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){b(this,Qn).set(qi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...b(this,Qn).values()];let r={};return t.forEach(n=>{Vi(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...b(this,Cr).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Nc(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...b(this,Cr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){b(this,Fe).clear(),b(this,Tr).clear()}},Fe=new WeakMap,Tr=new WeakMap,Cr=new WeakMap,Vn=new WeakMap,Qn=new WeakMap,Pr=new WeakMap,Wn=new WeakMap,Xn=new WeakMap,Xd),ft,we,Yn,We,en,Jn,Gt,rs,Kn,Zn,tn,rn,Ar,nn,sn,Ni,ns,Gl,is,zl,ss,ql,os,Vl,as,Ql,ls,Wl,cs,Xl,Lo,Mh,Yd,Oy=(Yd=class extends pi{constructor(t,r){super();F(this,sn);F(this,ns);F(this,is);F(this,ss);F(this,os);F(this,as);F(this,ls);F(this,cs);F(this,Lo);F(this,ft,void 0);F(this,we,void 0);F(this,Yn,void 0);F(this,We,void 0);F(this,en,void 0);F(this,Jn,void 0);F(this,Gt,void 0);F(this,rs,void 0);F(this,Kn,void 0);F(this,Zn,void 0);F(this,tn,void 0);F(this,rn,void 0);F(this,Ar,void 0);F(this,nn,void 0);$(this,we,void 0),$(this,Yn,void 0),$(this,We,void 0),$(this,nn,new Set),$(this,ft,t),this.options=r,$(this,Gt,null),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(b(this,we).addObserver(this),Qu(b(this,we),this.options)&&X(this,sn,Ni).call(this),X(this,os,Vl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Yl(b(this,we),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Yl(b(this,we),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,as,Ql).call(this),X(this,ls,Wl).call(this),b(this,we).removeObserver(this)}setOptions(t,r){const n=this.options,i=b(this,we);if(this.options=b(this,ft).defaultQueryOptions(t),yo(n,this.options)||b(this,ft).getQueryCache().notify({type:"observerOptionsUpdated",query:b(this,we),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),X(this,cs,Xl).call(this);const s=this.hasListeners();s&&Wu(b(this,we),i,this.options,n)&&X(this,sn,Ni).call(this),this.updateResult(r),s&&(b(this,we)!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&X(this,ns,Gl).call(this);const o=X(this,is,zl).call(this);s&&(b(this,we)!==i||this.options.enabled!==n.enabled||o!==b(this,Ar))&&X(this,ss,ql).call(this,o)}getOptimisticResult(t){const r=b(this,ft).getQueryCache().build(b(this,ft),t),n=this.createResult(r,t);return Iy(this,n)&&($(this,We,n),$(this,Jn,this.options),$(this,en,b(this,we).state)),n}getCurrentResult(){return b(this,We)}trackResult(t){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(b(this,nn).add(n),t[n])})}),r}getCurrentQuery(){return b(this,we)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=b(this,ft).defaultQueryOptions(t),n=b(this,ft).getQueryCache().build(b(this,ft),r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(t){return X(this,sn,Ni).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),b(this,We)))}createResult(t,r){var O;const n=b(this,we),i=this.options,s=b(this,We),o=b(this,en),a=b(this,Jn),u=t!==n?t.state:b(this,Yn),{state:c}=t;let{error:h,errorUpdatedAt:m,fetchStatus:f,status:p}=c,v=!1,x;if(r._optimisticResults){const M=this.hasListeners(),E=!M&&Qu(t,r),I=M&&Wu(t,n,r,i);(E||I)&&(f=Vo(t.options.networkMode)?"fetching":"paused",c.dataUpdatedAt||(p="pending")),r._optimisticResults==="isRestoring"&&(f="idle")}if(r.select&&typeof c.data<"u")if(s&&c.data===(o==null?void 0:o.data)&&r.select===b(this,rs))x=b(this,Kn);else try{$(this,rs,r.select),x=r.select(c.data),x=Ul(s==null?void 0:s.data,x,r),$(this,Kn,x),$(this,Gt,null)}catch(M){$(this,Gt,M)}else x=c.data;if(typeof r.placeholderData<"u"&&typeof x>"u"&&p==="pending"){let M;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))M=s.data;else if(M=typeof r.placeholderData=="function"?r.placeholderData((O=b(this,Zn))==null?void 0:O.state.data,b(this,Zn)):r.placeholderData,r.select&&typeof M<"u")try{M=r.select(M),$(this,Gt,null)}catch(E){$(this,Gt,E)}typeof M<"u"&&(p="success",x=Ul(s==null?void 0:s.data,M,r),v=!0)}b(this,Gt)&&(h=b(this,Gt),x=b(this,Kn),m=Date.now(),p="error");const S=f==="fetching",k=p==="pending",T=p==="error",P=k&&S;return{status:p,fetchStatus:f,isPending:k,isSuccess:p==="success",isError:T,isInitialLoading:P,isLoading:P,data:x,dataUpdatedAt:c.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!k,isLoadingError:T&&c.dataUpdatedAt===0,isPaused:f==="paused",isPlaceholderData:v,isRefetchError:T&&c.dataUpdatedAt!==0,isStale:Lc(t,r),refetch:this.refetch}}updateResult(t){const r=b(this,We),n=this.createResult(b(this,we),this.options);if($(this,en,b(this,we).state),$(this,Jn,this.options),yo(n,r))return;b(this,en).data!==void 0&&$(this,Zn,b(this,we)),$(this,We,n);const i={},s=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!b(this,nn).size)return!0;const l=new Set(a??b(this,nn));return this.options.throwOnError&&l.add("error"),Object.keys(b(this,We)).some(u=>{const c=u;return b(this,We)[c]!==r[c]&&l.has(c)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),X(this,Lo,Mh).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,os,Vl).call(this)}},ft=new WeakMap,we=new WeakMap,Yn=new WeakMap,We=new WeakMap,en=new WeakMap,Jn=new WeakMap,Gt=new WeakMap,rs=new WeakMap,Kn=new WeakMap,Zn=new WeakMap,tn=new WeakMap,rn=new WeakMap,Ar=new WeakMap,nn=new WeakMap,sn=new WeakSet,Ni=function(t){X(this,cs,Xl).call(this);let r=b(this,we).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Et)),r},ns=new WeakSet,Gl=function(){if(X(this,as,Ql).call(this),ci||b(this,We).isStale||!Bl(this.options.staleTime))return;const r=Eh(b(this,We).dataUpdatedAt,this.options.staleTime)+1;$(this,tn,setTimeout(()=>{b(this,We).isStale||this.updateResult()},r))},is=new WeakSet,zl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(b(this,we)):this.options.refetchInterval)??!1},ss=new WeakSet,ql=function(t){X(this,ls,Wl).call(this),$(this,Ar,t),!(ci||this.options.enabled===!1||!Bl(b(this,Ar))||b(this,Ar)===0)&&$(this,rn,setInterval(()=>{(this.options.refetchIntervalInBackground||bo.isFocused())&&X(this,sn,Ni).call(this)},b(this,Ar)))},os=new WeakSet,Vl=function(){X(this,ns,Gl).call(this),X(this,ss,ql).call(this,X(this,is,zl).call(this))},as=new WeakSet,Ql=function(){b(this,tn)&&(clearTimeout(b(this,tn)),$(this,tn,void 0))},ls=new WeakSet,Wl=function(){b(this,rn)&&(clearInterval(b(this,rn)),$(this,rn,void 0))},cs=new WeakSet,Xl=function(){const t=b(this,ft).getQueryCache().build(b(this,ft),this.options);if(t===b(this,we))return;const r=b(this,we);$(this,we,t),$(this,Yn,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Lo=new WeakSet,Mh=function(t){Re.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(b(this,We))}),b(this,ft).getQueryCache().notify({query:b(this,we),type:"observerResultsUpdated"})})},Yd);function My(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Qu(e,t){return My(e,t)||e.state.dataUpdatedAt>0&&Yl(e,t,t.refetchOnMount)}function Yl(e,t,r){if(t.enabled!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Lc(e,t)}return!1}function Wu(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&Lc(e,r)}function Lc(e,t){return e.isStaleByTime(t.staleTime)}function Iy(e,t){return!yo(e.getCurrentResult(),t)}var Or,nt,St,ir,ei,oo,us,Jl,Jd,$y=(Jd=class extends pi{constructor(t,r){super();F(this,ei);F(this,us);F(this,Or,void 0);F(this,nt,void 0);F(this,St,void 0);F(this,ir,void 0);$(this,nt,void 0),$(this,Or,t),this.setOptions(r),this.bindMethods(),X(this,ei,oo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=b(this,Or).defaultMutationOptions(t),yo(r,this.options)||b(this,Or).getMutationCache().notify({type:"observerOptionsUpdated",mutation:b(this,St),observer:this}),(n=b(this,St))==null||n.setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=b(this,St))==null||t.removeObserver(this)}onMutationUpdate(t){X(this,ei,oo).call(this),X(this,us,Jl).call(this,t)}getCurrentResult(){return b(this,nt)}reset(){$(this,St,void 0),X(this,ei,oo).call(this),X(this,us,Jl).call(this)}mutate(t,r){var n;return $(this,ir,r),(n=b(this,St))==null||n.removeObserver(this),$(this,St,b(this,Or).getMutationCache().build(b(this,Or),this.options)),b(this,St).addObserver(this),b(this,St).execute(t)}},Or=new WeakMap,nt=new WeakMap,St=new WeakMap,ir=new WeakMap,ei=new WeakSet,oo=function(){var r;const t=((r=b(this,St))==null?void 0:r.state)??Oh();$(this,nt,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},us=new WeakSet,Jl=function(t){Re.batch(()=>{var r,n,i,s,o,a,l,u;b(this,ir)&&this.hasListeners()&&((t==null?void 0:t.type)==="success"?((n=(r=b(this,ir)).onSuccess)==null||n.call(r,t.data,b(this,nt).variables,b(this,nt).context),(s=(i=b(this,ir)).onSettled)==null||s.call(i,t.data,null,b(this,nt).variables,b(this,nt).context)):(t==null?void 0:t.type)==="error"&&((a=(o=b(this,ir)).onError)==null||a.call(o,t.error,b(this,nt).variables,b(this,nt).context),(u=(l=b(this,ir)).onSettled)==null||u.call(l,void 0,t.error,b(this,nt).variables,b(this,nt).context))),this.listeners.forEach(c=>{c(b(this,nt))})})},Jd),Ih=Q.createContext(void 0),mi=e=>{const t=Q.useContext(Ih);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Fy=({client:e,children:t})=>(Q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),Q.createElement(Ih.Provider,{value:e},t)),$h=Q.createContext(!1),Ry=()=>Q.useContext($h);$h.Provider;function jy(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ny=Q.createContext(jy()),Ly=()=>Q.useContext(Ny);function Fh(e,t){return typeof e=="function"?e(...t):!!e}var Dy=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},By=e=>{Q.useEffect(()=>{e.clearReset()},[e])},Hy=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&Fh(r,[e.error,n]),Uy=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},Gy=(e,t)=>e.isLoading&&e.isFetching&&!t,zy=(e,t,r)=>(e==null?void 0:e.suspense)&&Gy(t,r),qy=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Vy(e,t,r){const n=mi(r),i=Ry(),s=Ly(),o=n.defaultQueryOptions(e);o._optimisticResults=i?"isRestoring":"optimistic",Uy(o),Dy(o,s),By(s);const[a]=Q.useState(()=>new t(n,o)),l=a.getOptimisticResult(o);if(Q.useSyncExternalStore(Q.useCallback(u=>{const c=i?()=>{}:a.subscribe(Re.batchCalls(u));return a.updateResult(),c},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),Q.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),zy(o,l,i))throw qy(o,a,s);if(Hy({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getCurrentQuery()}))throw l.error;return o.notifyOnChangeProps?l:a.trackResult(l)}function Rh(e,t){return Vy(e,Oy,t)}function Ir(e,t){const r=mi(t),[n]=Q.useState(()=>new $y(r,e));Q.useEffect(()=>{n.setOptions(e)},[n,e]);const i=Q.useSyncExternalStore(Q.useCallback(o=>n.subscribe(Re.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=Q.useCallback((o,a)=>{n.mutate(o,a).catch(Qy)},[n]);if(i.error&&Fh(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function Qy(){}var K={context:void 0,registry:void 0};function Li(e){K.context=e}var Wy=(e,t)=>e===t,Wi=Symbol("solid-proxy"),Dc=Symbol("solid-track"),Xy=Symbol("solid-dev-component"),wo={equals:Wy},jh=Bh,ur=1,xo=2,Nh={owned:null,cleanups:null,context:null,owner:null},el={},xe=null,tl=null,me=null,Je=null,lr=null,Qo=0,[Yy,F1]=st(!1);function $r(e,t){const r=me,n=xe,i=e.length===0,s=i?Nh:{owned:null,cleanups:null,context:null,owner:t===void 0?n:t},o=i?e:()=>e(()=>je(()=>Xo(s)));xe=s,me=null;try{return Qt(o,!0)}finally{me=r,xe=n}}function st(e,t){t=t?Object.assign({},wo,t):wo;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=i=>(typeof i=="function"&&(i=i(r.value)),Dh(r,i));return[Lh.bind(r),n]}function Kl(e,t,r){const n=Wo(e,t,!0,ur);gi(n)}function Fr(e,t,r){const n=Wo(e,t,!1,ur);gi(n)}function Bc(e,t,r){jh=u0;const n=Wo(e,t,!1,ur);(!r||!r.render)&&(n.user=!0),lr?lr.push(n):gi(n)}function at(e,t,r){r=r?Object.assign({},wo,r):wo;const n=Wo(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,gi(n),Lh.bind(n)}function Jy(e,t,r){let n,i,s;arguments.length===2&&typeof t=="object"||arguments.length===1?(n=!0,i=e,s=t||{}):(n=e,i=t,s=r||{});let o=null,a=el,l=null,u=!1,c="initialValue"in s,h=typeof n=="function"&&at(n);const m=new Set,[f,p]=(s.storage||st)(s.initialValue),[v,x]=st(void 0),[S,k]=st(void 0,{equals:!1}),[T,P]=st(c?"ready":"unresolved");if(K.context){l=`${K.context.id}${K.context.count++}`;let I;s.ssrLoadFrom==="initial"?a=s.initialValue:K.load&&(I=K.load(l))&&(a=I[0])}function y(I,R,N,z){return o===I&&(o=null,z!==void 0&&(c=!0),(I===a||R===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(z,{value:R})),a=el,O(R,N)),R}function O(I,R){Qt(()=>{R===void 0&&p(()=>I),P(R!==void 0?"errored":c?"ready":"unresolved"),x(R);for(const N of m.keys())N.decrement();m.clear()},!1)}function M(){const I=a0,R=f(),N=v();if(N!==void 0&&!o)throw N;return me&&!me.user&&I&&Kl(()=>{S(),o&&(I.resolved||m.has(I)||(I.increment(),m.add(I)))}),R}function E(I=!0){if(I!==!1&&u)return;u=!1;const R=h?h():n;if(R==null||R===!1){y(o,je(f));return}const N=a!==el?a:je(()=>i(R,{value:f(),refetching:I}));return typeof N!="object"||!(N&&"then"in N)?(y(o,N,void 0,R),N):(o=N,u=!0,queueMicrotask(()=>u=!1),Qt(()=>{P(c?"refreshing":"pending"),k()},!1),N.then(z=>y(N,z,void 0,R),z=>y(N,void 0,Uh(z),R)))}return Object.defineProperties(M,{state:{get:()=>T()},error:{get:()=>v()},loading:{get(){const I=T();return I==="pending"||I==="refreshing"}},latest:{get(){if(!c)return M();const I=v();if(I&&!o)throw I;return f()}}}),h?Kl(()=>E(!1)):E(!1),[M,{refetch:E,mutate:p}]}function Ky(e){return Qt(e,!1)}function je(e){if(me===null)return e();const t=me;me=null;try{return e()}finally{me=t}}function Zy(e,t,r){const n=Array.isArray(e);let i,s=r&&r.defer;return o=>{let a;if(n){a=Array(e.length);for(let u=0;u<e.length;u++)a[u]=e[u]()}else a=e();if(s){s=!1;return}const l=je(()=>t(a,i,o));return i=a,l}}function e0(e){Bc(()=>je(e))}function Xi(e){return xe===null||(xe.cleanups===null?xe.cleanups=[e]:xe.cleanups.push(e)),e}function t0(){return me}function Xu(){return xe}function r0(e,t){const r=xe,n=me;xe=e,me=null;try{return Qt(t,!0)}catch(i){Uc(i)}finally{xe=r,me=n}}function n0(e){const t=me,r=xe;return Promise.resolve().then(()=>{me=t,xe=r;let n;return Qt(e,!1),me=xe=null,n?n.done:void 0})}function i0(){return[Yy,n0]}function s0(e,t){const r=Symbol("context");return{id:r,Provider:d0(r),defaultValue:e}}function o0(e){let t;return(t=Gh(xe,e.id))!==void 0?t:e.defaultValue}function Hc(e){const t=at(e),r=at(()=>Zl(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}var a0;function Lh(){if(this.sources&&this.state)if(this.state===ur)gi(this);else{const e=Je;Je=null,Qt(()=>Eo(this),!1),Je=e}if(me){const e=this.observers?this.observers.length:0;me.sources?(me.sources.push(this),me.sourceSlots.push(e)):(me.sources=[this],me.sourceSlots=[e]),this.observers?(this.observers.push(me),this.observerSlots.push(me.sources.length-1)):(this.observers=[me],this.observerSlots=[me.sources.length-1])}return this.value}function Dh(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&Qt(()=>{for(let i=0;i<e.observers.length;i+=1){const s=e.observers[i],o=tl&&tl.running;o&&tl.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?Je.push(s):lr.push(s),s.observers&&Hh(s)),o||(s.state=ur)}if(Je.length>1e6)throw Je=[],new Error},!1)),t}function gi(e){if(!e.fn)return;Xo(e);const t=xe,r=me,n=Qo;me=xe=e,l0(e,e.value,n),me=r,xe=t}function l0(e,t,r){let n;try{n=e.fn(t)}catch(i){return e.pure&&(e.state=ur,e.owned&&e.owned.forEach(Xo),e.owned=null),e.updatedAt=r+1,Uc(i)}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?Dh(e,n):e.value=n,e.updatedAt=r)}function Wo(e,t,r,n=ur,i){const s={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:xe,context:null,pure:r};return xe===null||xe!==Nh&&(xe.owned?xe.owned.push(s):xe.owned=[s]),s}function So(e){if(e.state===0)return;if(e.state===xo)return Eo(e);if(e.suspense&&je(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Qo);)e.state&&t.push(e);for(let r=t.length-1;r>=0;r--)if(e=t[r],e.state===ur)gi(e);else if(e.state===xo){const n=Je;Je=null,Qt(()=>Eo(e,t[0]),!1),Je=n}}function Qt(e,t){if(Je)return e();let r=!1;t||(Je=[]),lr?r=!0:lr=[],Qo++;try{const n=e();return c0(r),n}catch(n){r||(lr=null),Je=null,Uc(n)}}function c0(e){if(Je&&(Bh(Je),Je=null),e)return;const t=lr;lr=null,t.length&&Qt(()=>jh(t),!1)}function Bh(e){for(let t=0;t<e.length;t++)So(e[t])}function u0(e){let t,r=0;for(t=0;t<e.length;t++){const n=e[t];n.user?e[r++]=n:So(n)}if(K.context){if(K.count){K.effects||(K.effects=[]),K.effects.push(...e.slice(0,r));return}else K.effects&&(e=[...K.effects,...e],r+=K.effects.length,delete K.effects);Li()}for(t=0;t<r;t++)So(e[t])}function Eo(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){const n=e.sources[r];if(n.sources){const i=n.state;i===ur?n!==t&&(!n.updatedAt||n.updatedAt<Qo)&&So(n):i===xo&&Eo(n,t)}}}function Hh(e){for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t];r.state||(r.state=xo,r.pure?Je.push(r):lr.push(r),r.observers&&Hh(r))}}function Xo(e){let t;if(e.sources)for(;e.sources.length;){const r=e.sources.pop(),n=e.sourceSlots.pop(),i=r.observers;if(i&&i.length){const s=i.pop(),o=r.observerSlots.pop();n<i.length&&(s.sourceSlots[o]=n,i[n]=s,r.observerSlots[n]=o)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Xo(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function Uh(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Uc(e,t=xe){throw Uh(e)}function Gh(e,t){return e?e.context&&e.context[t]!==void 0?e.context[t]:Gh(e.owner,t):void 0}function Zl(e){if(typeof e=="function"&&!e.length)return Zl(e());if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++){const n=Zl(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function d0(e,t){return function(n){let i;return Fr(()=>i=je(()=>(xe.context={[e]:n.value},Hc(()=>n.children))),void 0),i}}var ec=Symbol("fallback");function ko(e){for(let t=0;t<e.length;t++)e[t]()}function f0(e,t,r={}){let n=[],i=[],s=[],o=0,a=t.length>1?[]:null;return Xi(()=>ko(s)),()=>{let l=e()||[],u,c;return l[Dc],je(()=>{let m=l.length,f,p,v,x,S,k,T,P,y;if(m===0)o!==0&&(ko(s),s=[],n=[],i=[],o=0,a&&(a=[])),r.fallback&&(n=[ec],i[0]=$r(O=>(s[0]=O,r.fallback())),o=1);else if(o===0){for(i=new Array(m),c=0;c<m;c++)n[c]=l[c],i[c]=$r(h);o=m}else{for(v=new Array(m),x=new Array(m),a&&(S=new Array(m)),k=0,T=Math.min(o,m);k<T&&n[k]===l[k];k++);for(T=o-1,P=m-1;T>=k&&P>=k&&n[T]===l[P];T--,P--)v[P]=i[T],x[P]=s[T],a&&(S[P]=a[T]);for(f=new Map,p=new Array(P+1),c=P;c>=k;c--)y=l[c],u=f.get(y),p[c]=u===void 0?-1:u,f.set(y,c);for(u=k;u<=T;u++)y=n[u],c=f.get(y),c!==void 0&&c!==-1?(v[c]=i[u],x[c]=s[u],a&&(S[c]=a[u]),c=p[c],f.set(y,c)):s[u]();for(c=k;c<m;c++)c in v?(i[c]=v[c],s[c]=x[c],a&&(a[c]=S[c],a[c](c))):i[c]=$r(h);i=i.slice(0,o=m),n=l.slice(0)}return i});function h(m){if(s[c]=m,a){const[f,p]=st(c);return a[c]=p,t(l[c],f)}return t(l[c])}}}function h0(e,t,r={}){let n=[],i=[],s=[],o=[],a=0,l;return Xi(()=>ko(s)),()=>{const u=e()||[];return u[Dc],je(()=>{if(u.length===0)return a!==0&&(ko(s),s=[],n=[],i=[],a=0,o=[]),r.fallback&&(n=[ec],i[0]=$r(h=>(s[0]=h,r.fallback())),a=1),i;for(n[0]===ec&&(s[0](),s=[],n=[],i=[],a=0),l=0;l<u.length;l++)l<n.length&&n[l]!==u[l]?o[l](()=>u[l]):l>=n.length&&(i[l]=$r(c));for(;l<n.length;l++)s[l]();return a=o.length=s.length=u.length,n=u.slice(0),i=i.slice(0,a)});function c(h){s[l]=h;const[m,f]=st(u[l]);return o[l]=f,t(m,l)}}}function zh(e,t){return je(()=>e(t||{}))}function qs(){return!0}var tc={get(e,t,r){return t===Wi?r:e.get(t)},has(e,t){return t===Wi?!0:e.has(t)},set:qs,deleteProperty:qs,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:qs,deleteProperty:qs}},ownKeys(e){return e.keys()}};function rl(e){return(e=typeof e=="function"?e():e)?e:{}}function p0(){for(let e=0,t=this.length;e<t;++e){const r=this[e]();if(r!==void 0)return r}}function qh(...e){let t=!1;for(let s=0;s<e.length;s++){const o=e[s];t=t||!!o&&Wi in o,e[s]=typeof o=="function"?(t=!0,at(o)):o}if(t)return new Proxy({get(s){for(let o=e.length-1;o>=0;o--){const a=rl(e[o])[s];if(a!==void 0)return a}},has(s){for(let o=e.length-1;o>=0;o--)if(s in rl(e[o]))return!0;return!1},keys(){const s=[];for(let o=0;o<e.length;o++)s.push(...Object.keys(rl(e[o])));return[...new Set(s)]}},tc);const r={},n={},i=new Set;for(let s=e.length-1;s>=0;s--){const o=e[s];if(!o)continue;const a=Object.getOwnPropertyNames(o);for(let l=0,u=a.length;l<u;l++){const c=a[l];if(c==="__proto__"||c==="constructor")continue;const h=Object.getOwnPropertyDescriptor(o,c);if(!i.has(c))h.get?(i.add(c),Object.defineProperty(r,c,{enumerable:!0,configurable:!0,get:p0.bind(n[c]=[h.get.bind(o)])})):(h.value!==void 0&&i.add(c),r[c]=h.value);else{const m=n[c];m?h.get?m.push(h.get.bind(o)):h.value!==void 0&&m.push(()=>h.value):r[c]===void 0&&(r[c]=h.value)}}}return r}function Vh(e,...t){if(Wi in e){const i=new Set(t.length>1?t.flat():t[0]),s=t.map(o=>new Proxy({get(a){return o.includes(a)?e[a]:void 0},has(a){return o.includes(a)&&a in e},keys(){return o.filter(a=>a in e)}},tc));return s.push(new Proxy({get(o){return i.has(o)?void 0:e[o]},has(o){return i.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.has(o))}},tc)),s}const r={},n=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const s=Object.getOwnPropertyDescriptor(e,i),o=!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable;let a=!1,l=0;for(const u of t)u.includes(i)&&(a=!0,o?n[l][i]=s.value:Object.defineProperty(n[l],i,s)),++l;a||(o?r[i]=s.value:Object.defineProperty(r,i,s))}return[...n,r]}function m0(e){let t,r;const n=i=>{const s=K.context;if(s){const[a,l]=st();K.count||(K.count=0),K.count++,(r||(r=e())).then(u=>{Li(s),K.count--,l(()=>u.default),Li()}),t=a}else if(!t){const[a]=Jy(()=>(r||(r=e())).then(l=>l.default));t=a}let o;return at(()=>(o=t())&&je(()=>{if(!s)return o(i);const a=K.context;Li(s);const l=o(i);return Li(a),l}))};return n.preload=()=>r||((r=e()).then(i=>t=()=>i.default),r),n}var g0=0;function v0(){const e=K.context;return e?`${e.id}${e.count++}`:`cl-${g0++}`}var Qh=e=>`Stale read from <${e}>.`;function _0(e){const t="fallback"in e&&{fallback:()=>e.fallback};return at(f0(()=>e.each,e.children,t||void 0))}function y0(e){const t="fallback"in e&&{fallback:()=>e.fallback};return at(h0(()=>e.each,e.children,t||void 0))}function b0(e){const t=e.keyed,r=at(()=>e.when,void 0,{equals:(n,i)=>t?n===i:!n==!i});return at(()=>{const n=r();if(n){const i=e.children;return typeof i=="function"&&i.length>0?je(()=>i(t?n:()=>{if(!je(r))throw Qh("Show");return e.when})):i}return e.fallback},void 0,void 0)}function w0(e){let t=!1;const r=(s,o)=>s[0]===o[0]&&(t?s[1]===o[1]:!s[1]==!o[1])&&s[2]===o[2],n=Hc(()=>e.children),i=at(()=>{let s=n();Array.isArray(s)||(s=[s]);for(let o=0;o<s.length;o++){const a=s[o].when;if(a)return t=!!s[o].keyed,[o,a,s[o]]}return[-1]},void 0,{equals:r});return at(()=>{const[s,o,a]=i();if(s<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?je(()=>l(t?o:()=>{if(je(i)[0]!==s)throw Qh("Match");return a.when})):l},void 0,void 0)}function x0(e){return e}var S0=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],E0=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...S0]),k0=new Set(["innerHTML","textContent","innerText","children"]),T0=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),C0=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function P0(e,t){const r=C0[e];return typeof r=="object"?r[t]?r.$:void 0:r}var A0=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),O0=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),M0={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function I0(e,t,r){let n=r.length,i=t.length,s=n,o=0,a=0,l=t[i-1].nextSibling,u=null;for(;o<i||a<s;){if(t[o]===r[a]){o++,a++;continue}for(;t[i-1]===r[s-1];)i--,s--;if(i===o){const c=s<n?a?r[a-1].nextSibling:r[s-a]:l;for(;a<s;)e.insertBefore(r[a++],c)}else if(s===a)for(;o<i;)(!u||!u.has(t[o]))&&t[o].remove(),o++;else if(t[o]===r[s-1]&&r[a]===t[i-1]){const c=t[--i].nextSibling;e.insertBefore(r[a++],t[o++].nextSibling),e.insertBefore(r[--s],c),t[i]=r[s]}else{if(!u){u=new Map;let h=a;for(;h<s;)u.set(r[h],h++)}const c=u.get(t[o]);if(c!=null)if(a<c&&c<s){let h=o,m=1,f;for(;++h<i&&h<s&&!((f=u.get(t[h]))==null||f!==c+m);)m++;if(m>c-a){const p=t[o];for(;a<c;)e.insertBefore(r[a++],p)}else e.replaceChild(r[a++],t[o++])}else o++;else t[o++].remove()}}}var Yu="_$DX_DELEGATE";function $0(e,t,r,n={}){let i;return $r(s=>{i=s,t===document?e():Co(t,e(),t.firstChild?null:void 0,r)},n.owner),()=>{i(),t.textContent=""}}function F0(e,t,r){let n;const i=()=>{const o=document.createElement("template");return o.innerHTML=e,r?o.content.firstChild.firstChild:o.content.firstChild},s=t?()=>je(()=>document.importNode(n||(n=i()),!0)):()=>(n||(n=i())).cloneNode(!0);return s.cloneNode=s,s}function Wh(e,t=window.document){const r=t[Yu]||(t[Yu]=new Set);for(let n=0,i=e.length;n<i;n++){const s=e[n];r.has(s)||(r.add(s),t.addEventListener(s,U0))}}function To(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}function R0(e,t,r,n){n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n)}function Xh(e,t){t==null?e.removeAttribute("class"):e.className=t}function Yh(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){const i=r[0];e.addEventListener(t,r[0]=s=>i.call(e,r[1],s))}else e.addEventListener(t,r)}function j0(e,t,r={}){const n=Object.keys(t||{}),i=Object.keys(r);let s,o;for(s=0,o=i.length;s<o;s++){const a=i[s];!a||a==="undefined"||t[a]||(Ju(e,a,!1),delete r[a])}for(s=0,o=n.length;s<o;s++){const a=n[s],l=!!t[a];!a||a==="undefined"||r[a]===l||!l||(Ju(e,a,!0),r[a]=l)}return r}function N0(e,t,r){if(!t)return r?To(e,"style"):t;const n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let i,s;for(s in r)t[s]==null&&n.removeProperty(s),delete r[s];for(s in t)i=t[s],i!==r[s]&&(n.setProperty(s,i),r[s]=i);return r}function Jh(e,t={},r,n){const i={};return n||Fr(()=>i.children=ui(e,t.children,i.children)),Fr(()=>t.ref&&t.ref(e)),Fr(()=>D0(e,t,r,!0,i,!0)),i}function L0(e,t,r){return je(()=>e(t,r))}function Co(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return ui(e,t,n,r);Fr(i=>ui(e,t(),i,r),n)}function D0(e,t,r,n,i={},s=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=Ku(e,o,null,i[o],r,s)}for(const o in t){if(o==="children"){n||ui(e,t.children);continue}const a=t[o];i[o]=Ku(e,o,a,i[o],r,s)}}function B0(e){let t,r;if(!K.context||!(t=K.registry.get(r=G0()))){if(K.context,!e)throw new Error("Unrecoverable Hydration Mismatch. No template for key: "+r);return e()}return K.completed&&K.completed.add(t),K.registry.delete(r),t}function H0(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function Ju(e,t,r){const n=t.trim().split(/\s+/);for(let i=0,s=n.length;i<s;i++)e.classList.toggle(n[i],r)}function Ku(e,t,r,n,i,s){let o,a,l,u,c;if(t==="style")return N0(e,r,n);if(t==="classList")return j0(e,r,n);if(r===n)return n;if(t==="ref")s||r(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);n&&e.removeEventListener(h,n),r&&e.addEventListener(h,r)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);n&&e.removeEventListener(h,n,!0),r&&e.addEventListener(h,r,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),m=A0.has(h);if(!m&&n){const f=Array.isArray(n)?n[0]:n;e.removeEventListener(h,f)}(m||r)&&(Yh(e,h,r,m),m&&Wh([h]))}else if(t.slice(0,5)==="attr:")To(e,t.slice(5),r);else if((c=t.slice(0,5)==="prop:")||(l=k0.has(t))||!i&&((u=P0(t,e.tagName))||(a=E0.has(t)))||(o=e.nodeName.includes("-")))c&&(t=t.slice(5),a=!0),t==="class"||t==="className"?Xh(e,r):o&&!a&&!l?e[H0(t)]=r:e[u||t]=r;else{const h=i&&t.indexOf(":")>-1&&M0[t.split(":")[0]];h?R0(e,h,t,r):To(e,T0[t]||t,r)}return r}function U0(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return r||document}}),K.registry&&!K.done&&(K.done=_$HY.done=!0);r;){const n=r[t];if(n&&!r.disabled){const i=r[`${t}Data`];if(i!==void 0?n.call(r,i,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function ui(e,t,r,n,i){if(K.context){!r&&(r=[...e.childNodes]);let a=[];for(let l=0;l<r.length;l++){const u=r[l];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():a.push(u)}r=a}for(;typeof r=="function";)r=r();if(t===r)return r;const s=typeof t,o=n!==void 0;if(e=o&&r[0]&&r[0].parentNode||e,s==="string"||s==="number"){if(K.context)return r;if(s==="number"&&(t=t.toString()),o){let a=r[0];a&&a.nodeType===3?a.data=t:a=document.createTextNode(t),r=Mn(e,r,n,a)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||s==="boolean"){if(K.context)return r;r=Mn(e,r,n)}else{if(s==="function")return Fr(()=>{let a=t();for(;typeof a=="function";)a=a();r=ui(e,a,r,n)}),()=>r;if(Array.isArray(t)){const a=[],l=r&&Array.isArray(r);if(rc(a,t,r,i))return Fr(()=>r=ui(e,a,r,n,!0)),()=>r;if(K.context){if(!a.length)return r;for(let u=0;u<a.length;u++)if(a[u].parentNode)return r=a}if(a.length===0){if(r=Mn(e,r,n),o)return r}else l?r.length===0?Zu(e,a,n):I0(e,r,a):(r&&Mn(e),Zu(e,a));r=a}else if(t.nodeType){if(K.context&&t.parentNode)return r=o?[t]:t;if(Array.isArray(r)){if(o)return r=Mn(e,r,n,t);Mn(e,r,null,t)}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t}}return r}function rc(e,t,r,n){let i=!1;for(let s=0,o=t.length;s<o;s++){let a=t[s],l=r&&r[s],u;if(!(a==null||a===!0||a===!1))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))i=rc(e,a,l)||i;else if(u==="function")if(n){for(;typeof a=="function";)a=a();i=rc(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||i}else e.push(a),i=!0;else{const c=String(a);l&&l.nodeType===3&&l.data===c?e.push(l):e.push(document.createTextNode(c))}}return i}function Zu(e,t,r=null){for(let n=0,i=t.length;n<i;n++)e.insertBefore(t[n],r)}function Mn(e,t,r,n){if(r===void 0)return e.textContent="";const i=n||document.createTextNode("");if(t.length){let s=!1;for(let o=t.length-1;o>=0;o--){const a=t[o];if(i!==a){const l=a.parentNode===e;!s&&!o?l?e.replaceChild(i,a):e.insertBefore(i,r):l&&a.remove()}else s=!0}}else e.insertBefore(i,r);return[i]}function G0(){const e=K.context;return`${e.id}${e.count++}`}var z0="http://www.w3.org/2000/svg";function Kh(e,t=!1){return t?document.createElementNS(z0,e):document.createElement(e)}function q0(e){const{useShadow:t}=e,r=document.createTextNode(""),n=()=>e.mount||document.body,i=Xu();let s,o=!!K.context;return Bc(()=>{o&&(Xu().user=o=!1),s||(s=r0(i,()=>at(()=>e.children)));const a=n();if(a instanceof HTMLHeadElement){const[l,u]=st(!1),c=()=>u(!0);$r(h=>Co(a,()=>l()?h():s(),null)),Xi(c)}else{const l=Kh(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return r.parentNode},configurable:!0}),Co(u,s),a.appendChild(l),e.ref&&e.ref(l),Xi(()=>a.removeChild(l))}},void 0,{render:!o}),r}function V0(e){const[t,r]=Vh(e,["component"]),n=at(()=>t.component);return at(()=>{const i=n();switch(typeof i){case"function":return Object.assign(i,{[Xy]:!0}),je(()=>i(r));case"string":const s=O0.has(i),o=K.context?B0():Kh(i,s);return Jh(o,r,s),o}})}var ti,ds,fs,hs,on,ri,ni,ii,si,oi,ps,Kd,Q0=(Kd=class{constructor(e){F(this,ti,void 0);F(this,ds,void 0);F(this,fs,void 0);F(this,hs,void 0);F(this,on,!1);F(this,ri,void 0);F(this,ni,void 0);F(this,ii,void 0);F(this,si,void 0);F(this,oi,void 0);F(this,ps,void 0);const{client:t,queryFlavor:r,version:n,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l}=e;$(this,ti,st(t)),$(this,fs,r),$(this,hs,n),$(this,ds,i),$(this,ri,st(s)),$(this,ni,st(o)),$(this,ii,st(a)),$(this,si,st(l))}setButtonPosition(e){b(this,ri)[1](e)}setPosition(e){b(this,ni)[1](e)}setInitialIsOpen(e){b(this,ii)[1](e)}setErrorTypes(e){b(this,si)[1](e)}setClient(e){b(this,ti)[1](e)}mount(e){if(b(this,on))throw new Error("Devtools is already mounted");const t=$0(()=>{const[r]=b(this,ri),[n]=b(this,ni),[i]=b(this,ii),[s]=b(this,si),[o]=b(this,ti);let a;b(this,oi)?a=b(this,oi):(a=m0(()=>Promise.resolve().then(()=>require("./4TNE5QTO-7341e8bc.js"))),$(this,oi,a));const l=this;return zh(a,qh({get queryFlavor(){return b(l,fs)},get version(){return b(l,hs)},get onlineManager(){return b(l,ds)}},{get client(){return o()},get buttonPosition(){return r()},get position(){return n()},get initialIsOpen(){return i()},get errorTypes(){return s()}}))},e);$(this,on,!0),$(this,ps,t)}unmount(){var e;if(!b(this,on))throw new Error("Devtools is not mounted");(e=b(this,ps))==null||e.call(this),$(this,on,!1)}},ti=new WeakMap,ds=new WeakMap,fs=new WeakMap,hs=new WeakMap,on=new WeakMap,ri=new WeakMap,ni=new WeakMap,ii=new WeakMap,si=new WeakMap,oi=new WeakMap,ps=new WeakMap,Kd);function W0(e){const t=mi(),r=e.client||t,n=C.useRef(null),{buttonPosition:i,position:s,initialIsOpen:o,errorTypes:a}=e,[l]=C.useState(new Q0({client:r,queryFlavor:"React Query",version:"5",onlineManager:Qi,buttonPosition:i,position:s,initialIsOpen:o,errorTypes:a}));return C.useEffect(()=>{l.setClient(r)},[r,l]),C.useEffect(()=>{i&&l.setButtonPosition(i)},[i,l]),C.useEffect(()=>{s&&l.setPosition(s)},[s,l]),C.useEffect(()=>{l.setInitialIsOpen(o||!1)},[o,l]),C.useEffect(()=>{l.setErrorTypes(a||[])},[a,l]),C.useEffect(()=>(n.current&&l.mount(n.current),()=>{l.unmount()}),[l]),C.createElement("div",{className:"tsqd-parent-container",ref:n})}var X0=process.env.NODE_ENV!=="development"?function(){return null}:W0;const Zh=({children:e,showDevTools:t=!0})=>{const r=new Ay({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return g.jsxs(Fy,{client:r,children:[e,t&&g.jsx(X0,{initialIsOpen:!1})]})};function ed(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ed(Object(r),!0).forEach(function(n){H(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ed(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nc(e){return nc=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},nc(e)}function Me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function td(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ie(e,t,r){return t&&td(e.prototype,t),r&&td(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function H(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ep(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&&ic(e,t)}function Po(e){return Po=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Po(e)}function ic(e,t){return ic=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},ic(e,t)}function Y0(e,t){if(e==null)return{};var r,n,i=function(o,a){if(o==null)return{};var l,u,c={},h=Object.keys(o);for(u=0;u<h.length;u++)l=h[u],a.indexOf(l)>=0||(c[l]=o[l]);return c}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function J0(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(e)}function tp(e){var t=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var r,n=Po(e);if(t){var i=Po(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return J0(this,r)}}function ws(e,t){return function(r){if(Array.isArray(r))return r}(e)||function(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var s,o,a=[],l=!0,u=!1;try{for(i=i.call(r);!(l=(s=i.next()).done)&&(a.push(s.value),!n||a.length!==n);l=!0);}catch(c){u=!0,o=c}finally{try{l||i.return==null||i.return()}finally{if(u)throw o}}return a}}(e,t)||Gc(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
59
|
+
`))},[n]),C.useEffect(()=>{u==="ready-to-close"&&c("closing")},[u]);const h=({propertyName:f})=>{f==="max-height"&&c(p=>p==="opening"?"open":p==="closing"?"closed":p)};if(!n)return null;const m=["opening","open"].includes(u);return g.jsxs(ar,{variant:"subtle",className:L("hide-show-text-box",e),children:[g.jsxs("div",{ref:o,className:L("content",u),children:[g.jsx(Go,{options:{forceBlock:!0},children:u==="closed"?a:n}),u!=="closed"&&i]}),g.jsx("p",{className:"cta",children:g.jsx(Oe,{variant:"tertiary",icon:{icon:"navigation_arrow",position:"left",animate:!0},styling:{muted:!0},className:L({"rotate-180":m}),onClick:()=>{c(m?"ready-to-close":"opening")},children:m?r||s.formatMessage({id:"hideShowTextBox_hide"}):t||s.formatMessage({id:"hideShowTextBox_show"})})})]})},ny=()=>C.Fragment,iy=({children:e})=>g.jsx(ar,{variant:"secondary",children:e}),sy=["span","strong","h1","h2","h3","h4","h5","h6","p"],oy=({children:e})=>{const t=te();if(!e)return null;let r=t.formatMessage({id:"markdown_collapsibleSection_summary"});const n=[];for(const s of C.Children.toArray(e))if(!(!s||typeof s=="string"||typeof s=="number"))if(C.isValidElement(s)&&s.type==="summary"){if(s.props&&s.props.children){for(const o of C.Children.toArray(s.props.children))if(!(!o||typeof o=="string"||typeof o=="number")&&C.isValidElement(o)){const a=o.type;if(sy.includes(a)){for(r=o.props.children;typeof r!="string"&&(Array.isArray(r)&&r[0].props&&r[0].props.children&&r[0].props.children[0]);)r=r[0].props.children[0];break}}}}else n.push(s);const i=r?r.toString():"";return g.jsx($c,{label:i,className:["Sources","Resources"].includes(i)?"discrete-links":"",children:n.map(s=>s)})},ay=({children:e,...t})=>{if(t.class)switch(t.class){case"casestudy":return g.jsx(ar,{variant:"secondary",children:e});case"general-textbox":case"highlight-box":return g.jsx(ar,{variant:"primary",children:e});case"pink-textbox":return g.jsx(ar,{variant:"tertiary",children:e});default:return g.jsx("div",{...t,children:e})}return g.jsx("div",{...t,children:e})},ly=e=>{const t=te(),r=Date.now().toString();let n="default";const i=e.src;return i.includes("youtube")||i.includes("vimeo")?n="video":i.includes("riddle")||i.includes("sli.do")?n="poll":i.includes("padlet")&&(n="padlet"),g.jsxs(g.Fragment,{children:[g.jsx(ze,{children:g.jsx("a",{href:`#content-after-iframe-${r}`,children:t.formatMessage({id:`markdown_skip${n==="default"?"":`_${n}`}`})})}),g.jsx("iframe",{...e,title:t.formatMessage({id:`markdown_iframe${n==="default"?"":`_${n}`}`})}),g.jsx("span",{id:`content-after-iframe-${r}`,tabIndex:-1})]})},Lu=e=>{let t="";return e&&typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"&&"type"in e&&(t=e.type),t},cy=({children:e,...t})=>{let r={...t};t.href&&(t.href.includes("http:")||t.href.includes("https:"))&&!t.target&&(r.target="_blank");let n=e,i=!1;for(const s of C.Children.toArray(e))if(!(!s||typeof s=="string"||typeof s=="number")&&C.isValidElement(s)){const o=s.type;if(["button","center","span","strong"].includes(o)&&s.props&&s.props.children&&s.props.children[0])for((o==="button"||Lu(s.props.children[0])==="button")&&(i=!0),n=s.props.children[0];n&&typeof n!="string"&&!(typeof n=="boolean"||typeof n=="number"||!C.isValidElement(n));)if(n.props&&n.props.children&&n.props.children[0])n=n.props.children[0],n&&Lu(n)==="button"&&(i=!0);else break}return i?(r={...r,className:"button primary medium"},g.jsx("p",{className:"center",children:g.jsx(Oe,{variant:"primary",size:"medium",...r,children:n})})):g.jsx("a",{...r,children:n})},vh=({children:e})=>g.jsx("span",{children:e});const Ll=({className:e="",options:t={},children:r})=>{r=r.replace(/^<br\/?>/,"");const n={wrapper:C.Fragment,forceBlock:!0,overrides:{a:cy,CollapsibleSection:$c,TextBox:ar,CaseStudy:iy,style:ny,details:oy,div:ay,iframe:ly}};return g.jsx("div",{className:L("markdown-text",e),children:g.jsx(Go,{options:{...n,...t},children:r})})};const _h=({size:e="medium",variant:t="default",className:r="",children:n})=>g.jsx("span",{className:L("pill",e,t,r),children:n});const _o=({element:e="p",children:t=null,className:r="",...n})=>C.createElement(e,{...n,className:L("status-banner text-small",r),"aria-live":"assertive"},t);const uy=({progress:e=0,text:t=!1,className:r=""})=>{const n=te(),i=e>75?100:e>50?75:e>25?50:e>5?25:0,s={"--progress":`${e}%`};return g.jsx("span",{className:L(`progress-bar section-${i}`,r),style:s,children:g.jsx(ze,{children:t?`${e} ${t}`:n.formatMessage({id:"progressBar"},{number:e})})})},yh=C.memo(uy);const Ka="loadingBlock_",dy=({progress:e=0,steps:t=!1,className:r=""})=>{const n=te();t||(t={0:{text:n.formatMessage({id:`${Ka}loading`})},75:{text:n.formatMessage({id:`${Ka}almostDone`})},100:{text:n.formatMessage({id:`${Ka}complete`})}});let i=null;const s=Object.keys(t);for(let a=0;a<s.length&&!(e<parseInt(s[a]));a++)i=s[a];const o=i&&t[i].icon?{"--icon":`url(${vo}icons/${t[i].icon}.svg)`}:{};return g.jsxs(ar,{className:L("loading-block",r,{"has-icon":i&&t[i].icon}),variant:"subtle",style:o,children:[i&&g.jsx("span",{className:"step",children:t[i].text}),g.jsx(yh,{progress:e})]})},fy=C.memo(dy);const Vt=({element:e="div",className:t="",...r})=>g.jsx(xc,{element:e,className:L("loading-placeholder",t),...r});const Dl={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"]},bh=(e,t)=>e in Dl?g.jsx("div",{className:e,children:Dl[e].map((r,n)=>bh(r,n))},t):g.jsx(Vt,{className:e},t),wh=({layout:e="overview-page"})=>g.jsx("div",{className:L("loading-state",e),children:Dl[e].map((t,r)=>bh(t,r))}),xh=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):""},zs=["#5AB6A3","#A2D7AF","#806056","#3962B3"],hy=e=>{const t=Math.ceil(26/zs.length),r=xh(e).toLowerCase();if(r==="")return zs[0];const n=r.charCodeAt(0)-96;for(let i=0;i<zs.length;i++)if(n<=t*(i+1))return zs[i]};const Du=256,zo=({className:e="",src:t="",name:r,alt:n,width:i=Du,height:s=Du,...o})=>{const[a,l]=C.useState(!1),u=C.useRef(null);C.useEffect(()=>{const h=u.current;if(!h)return;const m=h.getContext("2d");if(!m)return;const f=i,p=s;typeof window<"u"&&window.devicePixelRatio&&(h.width=f*window.devicePixelRatio,h.height=p*window.devicePixelRatio,m.scale(window.devicePixelRatio,window.devicePixelRatio)),m.fillStyle=hy(r),m.fillRect(0,0,f,p),m.font=`${f/3}px Arial`,m.textAlign="center",m.fillStyle="white",m.fillText(xh(r),f/2,p/1.6)},[r]);let c=!1;return t&&t!==""&&!a&&(t.includes("http")||t.includes("//"))&&(c=!0),g.jsx("figure",{className:L("profile-picture",e,{error:a}),...o,children:c?g.jsx("img",{src:t,alt:n||r,onError:()=>{l(!0)},width:i,height:s}):g.jsx("canvas",{ref:u})})},jc=e=>e==="apolitical"?{image:`${vo}logos/member_apolitical.svg`}:e==="community"||typeof e=="object"&&!e.name?{image:`${vo}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},py=({role:e="",organisation:t="",country:r="",maximumCharacters:n=80})=>{const i=e!=="",s=t!=="",o=r!=="";if(!i&&!s&&!o)return"";const a=`${e}${i&&s?` — ${t}`:t}`;let l=`${a}${(i||s)&&o?`, ${r}`:r}`;return l.length>n&&(l=a),l.length>n&&(l=Ic(l,n)),l};const qo=({element:e="div",member:t="community",additionalContent:r=!1,gtmContext:n="member",gtmType:i="member-click",className:s=""})=>{const o=te(),a=jc(t);a.name||(a.name=o.formatMessage({id:`member_${typeof t=="string"?t:"community"}`}));const{name:l,url:u,image:c}=a,h=py(a),m=r&&r.createdAt?cg(r.createdAt):!1,f=r&&r.createdAt?lg(r.createdAt):"";return C.createElement(e,{className:L("member text-medium",s),children:g.jsxs(vs,{href:u,gtmType:i,gtmContext:n,onClick:p=>{p==null||p.stopPropagation()},children:[g.jsx(zo,{name:l,src:c}),g.jsxs("p",{className:"details",children:[g.jsx("strong",{children:l}),r&&g.jsxs("span",{className:"additional-content",children:[r.createdAt&&m&&g.jsx("span",{className:"date",title:f,"aria-label":f,children:o.formatMessage({id:`dates_${m.path}`},{number:m.number})}),r.didEdit&&g.jsx("em",{children:o.formatMessage({id:"discussion_edited"})})]}),h&&g.jsx("small",{children:h})]})]})})};const Bu={small:24,medium:48},Sh=({element:e="div",contributors:{total:t,data:r}={total:void 0,data:[]},styling:{showText:n,size:i,showGap:s,showPlaceholders:o}={showText:!0,size:"medium",showGap:!0,showPlaceholders:!1},cutoff:a=2,className:l=""})=>{const u=te();return!r||r.length===0?null:C.createElement(e,{className:L("contributors",l,i,{"has-gap":s}),children:g.jsxs(g.Fragment,{children:[g.jsx("ul",{children:r.map((c,h)=>{let m,f="";if(h<a){const{name:p="",image:v=""}=jc(c);if(o)return g.jsx(Vt,{element:"li",className:"contributor"},h);m=g.jsx(zo,{name:p,src:v,width:Bu[i||"medium"],height:Bu[i||"medium"]})}else if(h===a){const p=(t||r.length)-a;m=g.jsxs("small",{className:L({"large-number":p>99}),children:["+",mg(p,0)]}),f="number-left"}return m?g.jsx("li",{className:L("contributor",f),children:m},h):null})}),n&&g.jsx("span",{className:"label",children:typeof n=="string"?n:r.length===1?typeof r[0]=="string"?u.formatMessage({id:`member_${r[0]}`}):Ic(r[0].name||"",20):null})]})})};var pi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ci=typeof window>"u"||"Deno"in window;function Et(){}function my(e,t){return typeof e=="function"?e(t):e}function Bl(e){return typeof e=="number"&&e>=0&&e!==1/0}function Eh(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Hu(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==Nc(o,t.options))return!1}else if(!Vi(t.queryKey,o))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof i<"u"&&i!==t.state.fetchStatus||s&&!s(t))}function Uu(e,t){const{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(qi(t.options.mutationKey)!==qi(s))return!1}else if(!Vi(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Nc(e,t){return((t==null?void 0:t.queryKeyHashFn)||qi)(e)}function qi(e){return JSON.stringify(e,(t,r)=>Hl(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Vi(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!Vi(e[r],t[r])):!1}function kh(e,t){if(e===t)return e;const r=Gu(e)&&Gu(t);if(r||Hl(e)&&Hl(t)){const n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),s=i.length,o=r?[]:{};let a=0;for(let l=0;l<s;l++){const u=r?l:i[l];o[u]=kh(e[u],t[u]),o[u]===e[u]&&a++}return n===s&&a===n?e:o}return t}function yo(e,t){if(e&&!t||t&&!e)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Gu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Hl(e){if(!zu(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!zu(r)||!r.hasOwnProperty("isPrototypeOf"))}function zu(e){return Object.prototype.toString.call(e)==="[object Object]"}function Th(e){return new Promise(t=>{setTimeout(t,e)})}function qu(e){Th(0).then(e)}function Ul(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?kh(e,t):t}function gy(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function vy(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Yr,Sr,Dn,Ud,_y=(Ud=class extends pi{constructor(){super();F(this,Yr,void 0);F(this,Sr,void 0);F(this,Dn,void 0);$(this,Dn,t=>{if(!ci&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){b(this,Sr)||this.setEventListener(b(this,Dn))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,Sr))==null||t.call(this),$(this,Sr,void 0))}setEventListener(t){var r;$(this,Dn,t),(r=b(this,Sr))==null||r.call(this),$(this,Sr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){b(this,Yr)!==t&&($(this,Yr,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof b(this,Yr)=="boolean"?b(this,Yr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Yr=new WeakMap,Sr=new WeakMap,Dn=new WeakMap,Ud),bo=new _y,Bn,Er,Hn,Gd,yy=(Gd=class extends pi{constructor(){super();F(this,Bn,!0);F(this,Er,void 0);F(this,Hn,void 0);$(this,Hn,t=>{if(!ci&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){b(this,Er)||this.setEventListener(b(this,Hn))}onUnsubscribe(){var t;this.hasListeners()||((t=b(this,Er))==null||t.call(this),$(this,Er,void 0))}setEventListener(t){var r;$(this,Hn,t),(r=b(this,Er))==null||r.call(this),$(this,Er,t(this.setOnline.bind(this)))}setOnline(t){b(this,Bn)!==t&&($(this,Bn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return b(this,Bn)}},Bn=new WeakMap,Er=new WeakMap,Hn=new WeakMap,Gd),Qi=new yy;function by(e){return Math.min(1e3*2**e,3e4)}function Vo(e){return(e??"online")==="online"?Qi.isOnline():!0}var Ch=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Za(e){return e instanceof Ch}function Ph(e){let t=!1,r=0,n=!1,i,s,o;const a=new Promise((x,S)=>{s=x,o=S}),l=x=>{var S;n||(f(new Ch(x)),(S=e.abort)==null||S.call(e))},u=()=>{t=!0},c=()=>{t=!1},h=()=>!bo.isFocused()||e.networkMode!=="always"&&!Qi.isOnline(),m=x=>{var S;n||(n=!0,(S=e.onSuccess)==null||S.call(e,x),i==null||i(),s(x))},f=x=>{var S;n||(n=!0,(S=e.onError)==null||S.call(e,x),i==null||i(),o(x))},p=()=>new Promise(x=>{var S;i=k=>{const T=n||!h();return T&&x(k),T},(S=e.onPause)==null||S.call(e)}).then(()=>{var x;i=void 0,n||(x=e.onContinue)==null||x.call(e)}),v=()=>{if(n)return;let x;try{x=e.fn()}catch(S){x=Promise.reject(S)}Promise.resolve(x).then(m).catch(S=>{var O;if(n)return;const k=e.retry??(ci?0:3),T=e.retryDelay??by,P=typeof T=="function"?T(r,S):T,y=k===!0||typeof k=="number"&&r<k||typeof k=="function"&&k(r,S);if(t||!y){f(S);return}r++,(O=e.onFail)==null||O.call(e,r,S),Th(P).then(()=>{if(h())return p()}).then(()=>{t?f(S):v()})})};return Vo(e.networkMode)?v():p().then(v),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:u,continueRetry:c}}function wy(){let e=[],t=0,r=c=>{c()},n=c=>{c()};const i=c=>{let h;t++;try{h=c()}finally{t--,t||a()}return h},s=c=>{t?e.push(c):qu(()=>{r(c)})},o=c=>(...h)=>{s(()=>{c(...h)})},a=()=>{const c=e;e=[],c.length&&qu(()=>{n(()=>{c.forEach(h=>{r(h)})})})};return{batch:i,batchCalls:o,schedule:s,setNotifyFunction:c=>{r=c},setBatchNotifyFunction:c=>{n=c}}}var Re=wy(),Jr,zd,Ah=(zd=class{constructor(){F(this,Jr,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Bl(this.gcTime)&&$(this,Jr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ci?1/0:5*60*1e3))}clearGcTimeout(){b(this,Jr)&&(clearTimeout(b(this,Jr)),$(this,Jr,void 0))}},Jr=new WeakMap,zd),Un,Gn,bt,kr,wt,Ne,Zi,Kr,zn,so,At,nr,qd,xy=(qd=class extends Ah{constructor(t){super();F(this,zn);F(this,At);F(this,Un,void 0);F(this,Gn,void 0);F(this,bt,void 0);F(this,kr,void 0);F(this,wt,void 0);F(this,Ne,void 0);F(this,Zi,void 0);F(this,Kr,void 0);$(this,Kr,!1),$(this,Zi,t.defaultOptions),X(this,zn,so).call(this,t.options),$(this,Ne,[]),$(this,bt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,$(this,Un,t.state||Sy(this.options)),this.state=b(this,Un),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!b(this,Ne).length&&this.state.fetchStatus==="idle"&&b(this,bt).remove(this)}setData(t,r){const n=Ul(this.state.data,t,this.options);return X(this,At,nr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){X(this,At,nr).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n;const r=b(this,kr);return(n=b(this,wt))==null||n.cancel(t),r?r.then(Et).catch(Et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(b(this,Un))}isActive(){return b(this,Ne).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||b(this,Ne).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Eh(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=b(this,Ne).find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=b(this,wt))==null||r.continue()}onOnline(){var r;const t=b(this,Ne).find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=b(this,wt))==null||r.continue()}addObserver(t){b(this,Ne).includes(t)||(b(this,Ne).push(t),this.clearGcTimeout(),b(this,bt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){b(this,Ne).includes(t)&&($(this,Ne,b(this,Ne).filter(r=>r!==t)),b(this,Ne).length||(b(this,wt)&&(b(this,Kr)?b(this,wt).cancel({revert:!0}):b(this,wt).cancelRetry()),this.scheduleGc()),b(this,bt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return b(this,Ne).length}invalidate(){this.state.isInvalidated||X(this,At,nr).call(this,{type:"invalidate"})}fetch(t,r){var u,c,h,m;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(b(this,kr))return(u=b(this,wt))==null||u.continueRetry(),b(this,kr)}if(t&&X(this,zn,so).call(this,t),!this.options.queryFn){const f=b(this,Ne).find(p=>p.options.queryFn);f&&X(this,zn,so).call(this,f.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,i={queryKey:this.queryKey,meta:this.meta},s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>($(this,Kr,!0),n.signal)})};s(i);const o=()=>this.options.queryFn?($(this,Kr,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};s(a),(c=this.options.behavior)==null||c.onFetch(a,this),$(this,Gn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&X(this,At,nr).call(this,{type:"fetch",meta:(m=a.fetchOptions)==null?void 0:m.meta});const l=f=>{var p,v,x,S;Za(f)&&f.silent||X(this,At,nr).call(this,{type:"error",error:f}),Za(f)||((v=(p=b(this,bt).config).onError)==null||v.call(p,f,this),(S=(x=b(this,bt).config).onSettled)==null||S.call(x,this.state.data,f,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return $(this,wt,Ph({fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var p,v,x,S;if(typeof f>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(f),(v=(p=b(this,bt).config).onSuccess)==null||v.call(p,f,this),(S=(x=b(this,bt).config).onSettled)==null||S.call(x,f,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(f,p)=>{X(this,At,nr).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{X(this,At,nr).call(this,{type:"pause"})},onContinue:()=>{X(this,At,nr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),$(this,kr,b(this,wt).promise),b(this,kr)}},Un=new WeakMap,Gn=new WeakMap,bt=new WeakMap,kr=new WeakMap,wt=new WeakMap,Ne=new WeakMap,Zi=new WeakMap,Kr=new WeakMap,zn=new WeakSet,so=function(t){this.options={...b(this,Zi),...t},this.updateGcTime(this.options.gcTime)},At=new WeakSet,nr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Vo(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Za(i)&&i.revert&&b(this,Gn)?{...b(this,Gn),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Re.batch(()=>{b(this,Ne).forEach(n=>{n.onQueryUpdate()}),b(this,bt).notify({query:this,type:"updated",action:t})})},qd);function Sy(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof t<"u",n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Bt,Vd,Ey=(Vd=class extends pi{constructor(t={}){super();F(this,Bt,void 0);this.config=t,$(this,Bt,new Map)}build(t,r,n){const i=r.queryKey,s=r.queryHash??Nc(i,r);let o=this.get(s);return o||(o=new xy({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){b(this,Bt).has(t.queryHash)||(b(this,Bt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=b(this,Bt).get(t.queryHash);r&&(t.destroy(),r===t&&b(this,Bt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Re.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return b(this,Bt).get(t)}getAll(){return[...b(this,Bt).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Hu(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Hu(t,n)):r}notify(t){Re.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Re.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Re.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Bt=new WeakMap,Vd),Ht,es,mt,qn,Ut,yr,Qd,ky=(Qd=class extends Ah{constructor(t){super();F(this,Ut);F(this,Ht,void 0);F(this,es,void 0);F(this,mt,void 0);F(this,qn,void 0);this.mutationId=t.mutationId,$(this,es,t.defaultOptions),$(this,mt,t.mutationCache),$(this,Ht,[]),this.state=t.state||Oh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...b(this,es),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){b(this,Ht).includes(t)||(b(this,Ht).push(t),this.clearGcTimeout(),b(this,mt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){$(this,Ht,b(this,Ht).filter(r=>r!==t)),this.scheduleGc(),b(this,mt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){b(this,Ht).length||(this.state.status==="pending"?this.scheduleGc():b(this,mt).remove(this))}continue(){var t;return((t=b(this,qn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,u,c,h,m,f,p,v,x,S,k,T,P,y,O,M;const r=()=>($(this,qn,Ph({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,I)=>{X(this,Ut,yr).call(this,{type:"failed",failureCount:E,error:I})},onPause:()=>{X(this,Ut,yr).call(this,{type:"pause"})},onContinue:()=>{X(this,Ut,yr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),b(this,qn).promise),n=this.state.status==="pending";try{if(!n){X(this,Ut,yr).call(this,{type:"pending",variables:t}),await((s=(i=b(this,mt).config).onMutate)==null?void 0:s.call(i,t,this));const I=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));I!==this.state.context&&X(this,Ut,yr).call(this,{type:"pending",context:I,variables:t})}const E=await r();return await((u=(l=b(this,mt).config).onSuccess)==null?void 0:u.call(l,E,t,this.state.context,this)),await((h=(c=this.options).onSuccess)==null?void 0:h.call(c,E,t,this.state.context)),await((f=(m=b(this,mt).config).onSettled)==null?void 0:f.call(m,E,null,this.state.variables,this.state.context,this)),await((v=(p=this.options).onSettled)==null?void 0:v.call(p,E,null,t,this.state.context)),X(this,Ut,yr).call(this,{type:"success",data:E}),E}catch(E){try{throw await((S=(x=b(this,mt).config).onError)==null?void 0:S.call(x,E,t,this.state.context,this)),await((T=(k=this.options).onError)==null?void 0:T.call(k,E,t,this.state.context)),await((y=(P=b(this,mt).config).onSettled)==null?void 0:y.call(P,void 0,E,this.state.variables,this.state.context,this)),await((M=(O=this.options).onSettled)==null?void 0:M.call(O,void 0,E,t,this.state.context)),E}finally{X(this,Ut,yr).call(this,{type:"error",error:E})}}}},Ht=new WeakMap,es=new WeakMap,mt=new WeakMap,qn=new WeakMap,Ut=new WeakSet,yr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Vo(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Re.batch(()=>{b(this,Ht).forEach(n=>{n.onMutationUpdate(t)}),b(this,mt).notify({mutation:this,type:"updated",action:t})})},Qd);function Oh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xt,ts,Zr,Wd,Ty=(Wd=class extends pi{constructor(t={}){super();F(this,xt,void 0);F(this,ts,void 0);F(this,Zr,void 0);this.config=t,$(this,xt,[]),$(this,ts,0)}build(t,r,n){const i=new ky({mutationCache:this,mutationId:++Hs(this,ts)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){b(this,xt).push(t),this.notify({type:"added",mutation:t})}remove(t){$(this,xt,b(this,xt).filter(r=>r!==t)),this.notify({type:"removed",mutation:t})}clear(){Re.batch(()=>{b(this,xt).forEach(t=>{this.remove(t)})})}getAll(){return b(this,xt)}find(t){const r={exact:!0,...t};return b(this,xt).find(n=>Uu(r,n))}findAll(t={}){return b(this,xt).filter(r=>Uu(t,r))}notify(t){Re.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){return $(this,Zr,(b(this,Zr)??Promise.resolve()).then(()=>{const t=b(this,xt).filter(r=>r.state.isPaused);return Re.batch(()=>t.reduce((r,n)=>r.then(()=>n.continue().catch(Et)),Promise.resolve()))}).then(()=>{$(this,Zr,void 0)})),b(this,Zr)}},xt=new WeakMap,ts=new WeakMap,Zr=new WeakMap,Wd);function Cy(e){return{onFetch:(t,r)=>{const n=async()=>{var p,v,x,S,k;const i=t.options,s=(x=(v=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:v.fetchMore)==null?void 0:x.direction,o=((S=t.state.data)==null?void 0:S.pages)||[],a=((k=t.state.data)==null?void 0:k.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const c=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},h=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),m=async(T,P,y)=>{if(u)return Promise.reject();if(P==null&&T.pages.length)return Promise.resolve(T);const O={queryKey:t.queryKey,pageParam:P,direction:y?"backward":"forward",meta:t.options.meta};c(O);const M=await h(O),{maxPages:E}=t.options,I=y?vy:gy;return{pages:I(T.pages,M,E),pageParams:I(T.pageParams,P,E)}};let f;if(s&&o.length){const T=s==="backward",P=T?Py:Vu,y={pages:o,pageParams:a},O=P(i,y);f=await m(y,O,T)}else{f=await m(l,a[0]??i.initialPageParam);const T=e??o.length;for(let P=1;P<T;P++){const y=Vu(i,f);f=await m(f,y)}}return f};t.options.persister?t.fetchFn=()=>{var i,s;return(s=(i=t.options).persister)==null?void 0:s.call(i,n,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=n}}}function Vu(e,{pages:t,pageParams:r}){const n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function Py(e,{pages:t,pageParams:r}){var n;return(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r)}var Fe,Tr,Cr,Vn,Qn,Pr,Wn,Xn,Xd,Ay=(Xd=class{constructor(e={}){F(this,Fe,void 0);F(this,Tr,void 0);F(this,Cr,void 0);F(this,Vn,void 0);F(this,Qn,void 0);F(this,Pr,void 0);F(this,Wn,void 0);F(this,Xn,void 0);$(this,Fe,e.queryCache||new Ey),$(this,Tr,e.mutationCache||new Ty),$(this,Cr,e.defaultOptions||{}),$(this,Vn,new Map),$(this,Qn,new Map),$(this,Pr,0)}mount(){Hs(this,Pr)._++,b(this,Pr)===1&&($(this,Wn,bo.subscribe(()=>{bo.isFocused()&&(this.resumePausedMutations(),b(this,Fe).onFocus())})),$(this,Xn,Qi.subscribe(()=>{Qi.isOnline()&&(this.resumePausedMutations(),b(this,Fe).onOnline())})))}unmount(){var e,t;Hs(this,Pr)._--,b(this,Pr)===0&&((e=b(this,Wn))==null||e.call(this),$(this,Wn,void 0),(t=b(this,Xn))==null||t.call(this),$(this,Xn,void 0))}isFetching(e){return b(this,Fe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return b(this,Tr).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=b(this,Fe).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=b(this,Fe).find({queryKey:e}),i=n==null?void 0:n.state.data,s=my(t,i);if(typeof s>"u")return;const o=this.defaultQueryOptions({queryKey:e});return b(this,Fe).build(this,o).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return Re.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var t;return(t=b(this,Fe).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=b(this,Fe);Re.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=b(this,Fe),n={type:"active",...e};return Re.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=Re.batch(()=>b(this,Fe).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Et).catch(Et)}invalidateQueries(e={},t={}){return Re.batch(()=>{if(b(this,Fe).findAll(e).forEach(n=>{n.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){const r={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},n=Re.batch(()=>b(this,Fe).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Et)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Et)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const r=b(this,Fe).build(this,t);return r.isStaleByTime(t.staleTime)?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Et).catch(Et)}fetchInfiniteQuery(e){return e.behavior=Cy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Et).catch(Et)}resumePausedMutations(){return b(this,Tr).resumePausedMutations()}getQueryCache(){return b(this,Fe)}getMutationCache(){return b(this,Tr)}getDefaultOptions(){return b(this,Cr)}setDefaultOptions(e){$(this,Cr,e)}setQueryDefaults(e,t){b(this,Vn).set(qi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...b(this,Vn).values()];let r={};return t.forEach(n=>{Vi(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){b(this,Qn).set(qi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...b(this,Qn).values()];let r={};return t.forEach(n=>{Vi(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...b(this,Cr).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Nc(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...b(this,Cr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){b(this,Fe).clear(),b(this,Tr).clear()}},Fe=new WeakMap,Tr=new WeakMap,Cr=new WeakMap,Vn=new WeakMap,Qn=new WeakMap,Pr=new WeakMap,Wn=new WeakMap,Xn=new WeakMap,Xd),ft,we,Yn,We,en,Jn,Gt,rs,Kn,Zn,tn,rn,Ar,nn,sn,Ni,ns,Gl,is,zl,ss,ql,os,Vl,as,Ql,ls,Wl,cs,Xl,Lo,Mh,Yd,Oy=(Yd=class extends pi{constructor(t,r){super();F(this,sn);F(this,ns);F(this,is);F(this,ss);F(this,os);F(this,as);F(this,ls);F(this,cs);F(this,Lo);F(this,ft,void 0);F(this,we,void 0);F(this,Yn,void 0);F(this,We,void 0);F(this,en,void 0);F(this,Jn,void 0);F(this,Gt,void 0);F(this,rs,void 0);F(this,Kn,void 0);F(this,Zn,void 0);F(this,tn,void 0);F(this,rn,void 0);F(this,Ar,void 0);F(this,nn,void 0);$(this,we,void 0),$(this,Yn,void 0),$(this,We,void 0),$(this,nn,new Set),$(this,ft,t),this.options=r,$(this,Gt,null),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(b(this,we).addObserver(this),Qu(b(this,we),this.options)&&X(this,sn,Ni).call(this),X(this,os,Vl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Yl(b(this,we),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Yl(b(this,we),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,as,Ql).call(this),X(this,ls,Wl).call(this),b(this,we).removeObserver(this)}setOptions(t,r){const n=this.options,i=b(this,we);if(this.options=b(this,ft).defaultQueryOptions(t),yo(n,this.options)||b(this,ft).getQueryCache().notify({type:"observerOptionsUpdated",query:b(this,we),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),X(this,cs,Xl).call(this);const s=this.hasListeners();s&&Wu(b(this,we),i,this.options,n)&&X(this,sn,Ni).call(this),this.updateResult(r),s&&(b(this,we)!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&X(this,ns,Gl).call(this);const o=X(this,is,zl).call(this);s&&(b(this,we)!==i||this.options.enabled!==n.enabled||o!==b(this,Ar))&&X(this,ss,ql).call(this,o)}getOptimisticResult(t){const r=b(this,ft).getQueryCache().build(b(this,ft),t),n=this.createResult(r,t);return Iy(this,n)&&($(this,We,n),$(this,Jn,this.options),$(this,en,b(this,we).state)),n}getCurrentResult(){return b(this,We)}trackResult(t){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(b(this,nn).add(n),t[n])})}),r}getCurrentQuery(){return b(this,we)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=b(this,ft).defaultQueryOptions(t),n=b(this,ft).getQueryCache().build(b(this,ft),r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(t){return X(this,sn,Ni).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),b(this,We)))}createResult(t,r){var O;const n=b(this,we),i=this.options,s=b(this,We),o=b(this,en),a=b(this,Jn),u=t!==n?t.state:b(this,Yn),{state:c}=t;let{error:h,errorUpdatedAt:m,fetchStatus:f,status:p}=c,v=!1,x;if(r._optimisticResults){const M=this.hasListeners(),E=!M&&Qu(t,r),I=M&&Wu(t,n,r,i);(E||I)&&(f=Vo(t.options.networkMode)?"fetching":"paused",c.dataUpdatedAt||(p="pending")),r._optimisticResults==="isRestoring"&&(f="idle")}if(r.select&&typeof c.data<"u")if(s&&c.data===(o==null?void 0:o.data)&&r.select===b(this,rs))x=b(this,Kn);else try{$(this,rs,r.select),x=r.select(c.data),x=Ul(s==null?void 0:s.data,x,r),$(this,Kn,x),$(this,Gt,null)}catch(M){$(this,Gt,M)}else x=c.data;if(typeof r.placeholderData<"u"&&typeof x>"u"&&p==="pending"){let M;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))M=s.data;else if(M=typeof r.placeholderData=="function"?r.placeholderData((O=b(this,Zn))==null?void 0:O.state.data,b(this,Zn)):r.placeholderData,r.select&&typeof M<"u")try{M=r.select(M),$(this,Gt,null)}catch(E){$(this,Gt,E)}typeof M<"u"&&(p="success",x=Ul(s==null?void 0:s.data,M,r),v=!0)}b(this,Gt)&&(h=b(this,Gt),x=b(this,Kn),m=Date.now(),p="error");const S=f==="fetching",k=p==="pending",T=p==="error",P=k&&S;return{status:p,fetchStatus:f,isPending:k,isSuccess:p==="success",isError:T,isInitialLoading:P,isLoading:P,data:x,dataUpdatedAt:c.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!k,isLoadingError:T&&c.dataUpdatedAt===0,isPaused:f==="paused",isPlaceholderData:v,isRefetchError:T&&c.dataUpdatedAt!==0,isStale:Lc(t,r),refetch:this.refetch}}updateResult(t){const r=b(this,We),n=this.createResult(b(this,we),this.options);if($(this,en,b(this,we).state),$(this,Jn,this.options),yo(n,r))return;b(this,en).data!==void 0&&$(this,Zn,b(this,we)),$(this,We,n);const i={},s=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!b(this,nn).size)return!0;const l=new Set(a??b(this,nn));return this.options.throwOnError&&l.add("error"),Object.keys(b(this,We)).some(u=>{const c=u;return b(this,We)[c]!==r[c]&&l.has(c)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),X(this,Lo,Mh).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,os,Vl).call(this)}},ft=new WeakMap,we=new WeakMap,Yn=new WeakMap,We=new WeakMap,en=new WeakMap,Jn=new WeakMap,Gt=new WeakMap,rs=new WeakMap,Kn=new WeakMap,Zn=new WeakMap,tn=new WeakMap,rn=new WeakMap,Ar=new WeakMap,nn=new WeakMap,sn=new WeakSet,Ni=function(t){X(this,cs,Xl).call(this);let r=b(this,we).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Et)),r},ns=new WeakSet,Gl=function(){if(X(this,as,Ql).call(this),ci||b(this,We).isStale||!Bl(this.options.staleTime))return;const r=Eh(b(this,We).dataUpdatedAt,this.options.staleTime)+1;$(this,tn,setTimeout(()=>{b(this,We).isStale||this.updateResult()},r))},is=new WeakSet,zl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(b(this,we)):this.options.refetchInterval)??!1},ss=new WeakSet,ql=function(t){X(this,ls,Wl).call(this),$(this,Ar,t),!(ci||this.options.enabled===!1||!Bl(b(this,Ar))||b(this,Ar)===0)&&$(this,rn,setInterval(()=>{(this.options.refetchIntervalInBackground||bo.isFocused())&&X(this,sn,Ni).call(this)},b(this,Ar)))},os=new WeakSet,Vl=function(){X(this,ns,Gl).call(this),X(this,ss,ql).call(this,X(this,is,zl).call(this))},as=new WeakSet,Ql=function(){b(this,tn)&&(clearTimeout(b(this,tn)),$(this,tn,void 0))},ls=new WeakSet,Wl=function(){b(this,rn)&&(clearInterval(b(this,rn)),$(this,rn,void 0))},cs=new WeakSet,Xl=function(){const t=b(this,ft).getQueryCache().build(b(this,ft),this.options);if(t===b(this,we))return;const r=b(this,we);$(this,we,t),$(this,Yn,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Lo=new WeakSet,Mh=function(t){Re.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(b(this,We))}),b(this,ft).getQueryCache().notify({query:b(this,we),type:"observerResultsUpdated"})})},Yd);function My(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Qu(e,t){return My(e,t)||e.state.dataUpdatedAt>0&&Yl(e,t,t.refetchOnMount)}function Yl(e,t,r){if(t.enabled!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Lc(e,t)}return!1}function Wu(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&Lc(e,r)}function Lc(e,t){return e.isStaleByTime(t.staleTime)}function Iy(e,t){return!yo(e.getCurrentResult(),t)}var Or,nt,St,ir,ei,oo,us,Jl,Jd,$y=(Jd=class extends pi{constructor(t,r){super();F(this,ei);F(this,us);F(this,Or,void 0);F(this,nt,void 0);F(this,St,void 0);F(this,ir,void 0);$(this,nt,void 0),$(this,Or,t),this.setOptions(r),this.bindMethods(),X(this,ei,oo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=b(this,Or).defaultMutationOptions(t),yo(r,this.options)||b(this,Or).getMutationCache().notify({type:"observerOptionsUpdated",mutation:b(this,St),observer:this}),(n=b(this,St))==null||n.setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=b(this,St))==null||t.removeObserver(this)}onMutationUpdate(t){X(this,ei,oo).call(this),X(this,us,Jl).call(this,t)}getCurrentResult(){return b(this,nt)}reset(){$(this,St,void 0),X(this,ei,oo).call(this),X(this,us,Jl).call(this)}mutate(t,r){var n;return $(this,ir,r),(n=b(this,St))==null||n.removeObserver(this),$(this,St,b(this,Or).getMutationCache().build(b(this,Or),this.options)),b(this,St).addObserver(this),b(this,St).execute(t)}},Or=new WeakMap,nt=new WeakMap,St=new WeakMap,ir=new WeakMap,ei=new WeakSet,oo=function(){var r;const t=((r=b(this,St))==null?void 0:r.state)??Oh();$(this,nt,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},us=new WeakSet,Jl=function(t){Re.batch(()=>{var r,n,i,s,o,a,l,u;b(this,ir)&&this.hasListeners()&&((t==null?void 0:t.type)==="success"?((n=(r=b(this,ir)).onSuccess)==null||n.call(r,t.data,b(this,nt).variables,b(this,nt).context),(s=(i=b(this,ir)).onSettled)==null||s.call(i,t.data,null,b(this,nt).variables,b(this,nt).context)):(t==null?void 0:t.type)==="error"&&((a=(o=b(this,ir)).onError)==null||a.call(o,t.error,b(this,nt).variables,b(this,nt).context),(u=(l=b(this,ir)).onSettled)==null||u.call(l,void 0,t.error,b(this,nt).variables,b(this,nt).context))),this.listeners.forEach(c=>{c(b(this,nt))})})},Jd),Ih=Q.createContext(void 0),mi=e=>{const t=Q.useContext(Ih);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Fy=({client:e,children:t})=>(Q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),Q.createElement(Ih.Provider,{value:e},t)),$h=Q.createContext(!1),Ry=()=>Q.useContext($h);$h.Provider;function jy(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ny=Q.createContext(jy()),Ly=()=>Q.useContext(Ny);function Fh(e,t){return typeof e=="function"?e(...t):!!e}var Dy=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},By=e=>{Q.useEffect(()=>{e.clearReset()},[e])},Hy=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&Fh(r,[e.error,n]),Uy=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},Gy=(e,t)=>e.isLoading&&e.isFetching&&!t,zy=(e,t,r)=>(e==null?void 0:e.suspense)&&Gy(t,r),qy=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Vy(e,t,r){const n=mi(r),i=Ry(),s=Ly(),o=n.defaultQueryOptions(e);o._optimisticResults=i?"isRestoring":"optimistic",Uy(o),Dy(o,s),By(s);const[a]=Q.useState(()=>new t(n,o)),l=a.getOptimisticResult(o);if(Q.useSyncExternalStore(Q.useCallback(u=>{const c=i?()=>{}:a.subscribe(Re.batchCalls(u));return a.updateResult(),c},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),Q.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),zy(o,l,i))throw qy(o,a,s);if(Hy({result:l,errorResetBoundary:s,throwOnError:o.throwOnError,query:a.getCurrentQuery()}))throw l.error;return o.notifyOnChangeProps?l:a.trackResult(l)}function Rh(e,t){return Vy(e,Oy,t)}function Ir(e,t){const r=mi(t),[n]=Q.useState(()=>new $y(r,e));Q.useEffect(()=>{n.setOptions(e)},[n,e]);const i=Q.useSyncExternalStore(Q.useCallback(o=>n.subscribe(Re.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=Q.useCallback((o,a)=>{n.mutate(o,a).catch(Qy)},[n]);if(i.error&&Fh(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function Qy(){}var K={context:void 0,registry:void 0};function Li(e){K.context=e}var Wy=(e,t)=>e===t,Wi=Symbol("solid-proxy"),Dc=Symbol("solid-track"),Xy=Symbol("solid-dev-component"),wo={equals:Wy},jh=Bh,ur=1,xo=2,Nh={owned:null,cleanups:null,context:null,owner:null},el={},xe=null,tl=null,me=null,Je=null,lr=null,Qo=0,[Yy,F1]=st(!1);function $r(e,t){const r=me,n=xe,i=e.length===0,s=i?Nh:{owned:null,cleanups:null,context:null,owner:t===void 0?n:t},o=i?e:()=>e(()=>je(()=>Xo(s)));xe=s,me=null;try{return Qt(o,!0)}finally{me=r,xe=n}}function st(e,t){t=t?Object.assign({},wo,t):wo;const r={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=i=>(typeof i=="function"&&(i=i(r.value)),Dh(r,i));return[Lh.bind(r),n]}function Kl(e,t,r){const n=Wo(e,t,!0,ur);gi(n)}function Fr(e,t,r){const n=Wo(e,t,!1,ur);gi(n)}function Bc(e,t,r){jh=u0;const n=Wo(e,t,!1,ur);(!r||!r.render)&&(n.user=!0),lr?lr.push(n):gi(n)}function at(e,t,r){r=r?Object.assign({},wo,r):wo;const n=Wo(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,gi(n),Lh.bind(n)}function Jy(e,t,r){let n,i,s;arguments.length===2&&typeof t=="object"||arguments.length===1?(n=!0,i=e,s=t||{}):(n=e,i=t,s=r||{});let o=null,a=el,l=null,u=!1,c="initialValue"in s,h=typeof n=="function"&&at(n);const m=new Set,[f,p]=(s.storage||st)(s.initialValue),[v,x]=st(void 0),[S,k]=st(void 0,{equals:!1}),[T,P]=st(c?"ready":"unresolved");if(K.context){l=`${K.context.id}${K.context.count++}`;let I;s.ssrLoadFrom==="initial"?a=s.initialValue:K.load&&(I=K.load(l))&&(a=I[0])}function y(I,R,N,z){return o===I&&(o=null,z!==void 0&&(c=!0),(I===a||R===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(z,{value:R})),a=el,O(R,N)),R}function O(I,R){Qt(()=>{R===void 0&&p(()=>I),P(R!==void 0?"errored":c?"ready":"unresolved"),x(R);for(const N of m.keys())N.decrement();m.clear()},!1)}function M(){const I=a0,R=f(),N=v();if(N!==void 0&&!o)throw N;return me&&!me.user&&I&&Kl(()=>{S(),o&&(I.resolved||m.has(I)||(I.increment(),m.add(I)))}),R}function E(I=!0){if(I!==!1&&u)return;u=!1;const R=h?h():n;if(R==null||R===!1){y(o,je(f));return}const N=a!==el?a:je(()=>i(R,{value:f(),refetching:I}));return typeof N!="object"||!(N&&"then"in N)?(y(o,N,void 0,R),N):(o=N,u=!0,queueMicrotask(()=>u=!1),Qt(()=>{P(c?"refreshing":"pending"),k()},!1),N.then(z=>y(N,z,void 0,R),z=>y(N,void 0,Uh(z),R)))}return Object.defineProperties(M,{state:{get:()=>T()},error:{get:()=>v()},loading:{get(){const I=T();return I==="pending"||I==="refreshing"}},latest:{get(){if(!c)return M();const I=v();if(I&&!o)throw I;return f()}}}),h?Kl(()=>E(!1)):E(!1),[M,{refetch:E,mutate:p}]}function Ky(e){return Qt(e,!1)}function je(e){if(me===null)return e();const t=me;me=null;try{return e()}finally{me=t}}function Zy(e,t,r){const n=Array.isArray(e);let i,s=r&&r.defer;return o=>{let a;if(n){a=Array(e.length);for(let u=0;u<e.length;u++)a[u]=e[u]()}else a=e();if(s){s=!1;return}const l=je(()=>t(a,i,o));return i=a,l}}function e0(e){Bc(()=>je(e))}function Xi(e){return xe===null||(xe.cleanups===null?xe.cleanups=[e]:xe.cleanups.push(e)),e}function t0(){return me}function Xu(){return xe}function r0(e,t){const r=xe,n=me;xe=e,me=null;try{return Qt(t,!0)}catch(i){Uc(i)}finally{xe=r,me=n}}function n0(e){const t=me,r=xe;return Promise.resolve().then(()=>{me=t,xe=r;let n;return Qt(e,!1),me=xe=null,n?n.done:void 0})}function i0(){return[Yy,n0]}function s0(e,t){const r=Symbol("context");return{id:r,Provider:d0(r),defaultValue:e}}function o0(e){let t;return(t=Gh(xe,e.id))!==void 0?t:e.defaultValue}function Hc(e){const t=at(e),r=at(()=>Zl(t()));return r.toArray=()=>{const n=r();return Array.isArray(n)?n:n!=null?[n]:[]},r}var a0;function Lh(){if(this.sources&&this.state)if(this.state===ur)gi(this);else{const e=Je;Je=null,Qt(()=>Eo(this),!1),Je=e}if(me){const e=this.observers?this.observers.length:0;me.sources?(me.sources.push(this),me.sourceSlots.push(e)):(me.sources=[this],me.sourceSlots=[e]),this.observers?(this.observers.push(me),this.observerSlots.push(me.sources.length-1)):(this.observers=[me],this.observerSlots=[me.sources.length-1])}return this.value}function Dh(e,t,r){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&Qt(()=>{for(let i=0;i<e.observers.length;i+=1){const s=e.observers[i],o=tl&&tl.running;o&&tl.disposed.has(s),(o?!s.tState:!s.state)&&(s.pure?Je.push(s):lr.push(s),s.observers&&Hh(s)),o||(s.state=ur)}if(Je.length>1e6)throw Je=[],new Error},!1)),t}function gi(e){if(!e.fn)return;Xo(e);const t=xe,r=me,n=Qo;me=xe=e,l0(e,e.value,n),me=r,xe=t}function l0(e,t,r){let n;try{n=e.fn(t)}catch(i){return e.pure&&(e.state=ur,e.owned&&e.owned.forEach(Xo),e.owned=null),e.updatedAt=r+1,Uc(i)}(!e.updatedAt||e.updatedAt<=r)&&(e.updatedAt!=null&&"observers"in e?Dh(e,n):e.value=n,e.updatedAt=r)}function Wo(e,t,r,n=ur,i){const s={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:xe,context:null,pure:r};return xe===null||xe!==Nh&&(xe.owned?xe.owned.push(s):xe.owned=[s]),s}function So(e){if(e.state===0)return;if(e.state===xo)return Eo(e);if(e.suspense&&je(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Qo);)e.state&&t.push(e);for(let r=t.length-1;r>=0;r--)if(e=t[r],e.state===ur)gi(e);else if(e.state===xo){const n=Je;Je=null,Qt(()=>Eo(e,t[0]),!1),Je=n}}function Qt(e,t){if(Je)return e();let r=!1;t||(Je=[]),lr?r=!0:lr=[],Qo++;try{const n=e();return c0(r),n}catch(n){r||(lr=null),Je=null,Uc(n)}}function c0(e){if(Je&&(Bh(Je),Je=null),e)return;const t=lr;lr=null,t.length&&Qt(()=>jh(t),!1)}function Bh(e){for(let t=0;t<e.length;t++)So(e[t])}function u0(e){let t,r=0;for(t=0;t<e.length;t++){const n=e[t];n.user?e[r++]=n:So(n)}if(K.context){if(K.count){K.effects||(K.effects=[]),K.effects.push(...e.slice(0,r));return}else K.effects&&(e=[...K.effects,...e],r+=K.effects.length,delete K.effects);Li()}for(t=0;t<r;t++)So(e[t])}function Eo(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){const n=e.sources[r];if(n.sources){const i=n.state;i===ur?n!==t&&(!n.updatedAt||n.updatedAt<Qo)&&So(n):i===xo&&Eo(n,t)}}}function Hh(e){for(let t=0;t<e.observers.length;t+=1){const r=e.observers[t];r.state||(r.state=xo,r.pure?Je.push(r):lr.push(r),r.observers&&Hh(r))}}function Xo(e){let t;if(e.sources)for(;e.sources.length;){const r=e.sources.pop(),n=e.sourceSlots.pop(),i=r.observers;if(i&&i.length){const s=i.pop(),o=r.observerSlots.pop();n<i.length&&(s.sourceSlots[o]=n,i[n]=s,r.observerSlots[n]=o)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Xo(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function Uh(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Uc(e,t=xe){throw Uh(e)}function Gh(e,t){return e?e.context&&e.context[t]!==void 0?e.context[t]:Gh(e.owner,t):void 0}function Zl(e){if(typeof e=="function"&&!e.length)return Zl(e());if(Array.isArray(e)){const t=[];for(let r=0;r<e.length;r++){const n=Zl(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function d0(e,t){return function(n){let i;return Fr(()=>i=je(()=>(xe.context={[e]:n.value},Hc(()=>n.children))),void 0),i}}var ec=Symbol("fallback");function ko(e){for(let t=0;t<e.length;t++)e[t]()}function f0(e,t,r={}){let n=[],i=[],s=[],o=0,a=t.length>1?[]:null;return Xi(()=>ko(s)),()=>{let l=e()||[],u,c;return l[Dc],je(()=>{let m=l.length,f,p,v,x,S,k,T,P,y;if(m===0)o!==0&&(ko(s),s=[],n=[],i=[],o=0,a&&(a=[])),r.fallback&&(n=[ec],i[0]=$r(O=>(s[0]=O,r.fallback())),o=1);else if(o===0){for(i=new Array(m),c=0;c<m;c++)n[c]=l[c],i[c]=$r(h);o=m}else{for(v=new Array(m),x=new Array(m),a&&(S=new Array(m)),k=0,T=Math.min(o,m);k<T&&n[k]===l[k];k++);for(T=o-1,P=m-1;T>=k&&P>=k&&n[T]===l[P];T--,P--)v[P]=i[T],x[P]=s[T],a&&(S[P]=a[T]);for(f=new Map,p=new Array(P+1),c=P;c>=k;c--)y=l[c],u=f.get(y),p[c]=u===void 0?-1:u,f.set(y,c);for(u=k;u<=T;u++)y=n[u],c=f.get(y),c!==void 0&&c!==-1?(v[c]=i[u],x[c]=s[u],a&&(S[c]=a[u]),c=p[c],f.set(y,c)):s[u]();for(c=k;c<m;c++)c in v?(i[c]=v[c],s[c]=x[c],a&&(a[c]=S[c],a[c](c))):i[c]=$r(h);i=i.slice(0,o=m),n=l.slice(0)}return i});function h(m){if(s[c]=m,a){const[f,p]=st(c);return a[c]=p,t(l[c],f)}return t(l[c])}}}function h0(e,t,r={}){let n=[],i=[],s=[],o=[],a=0,l;return Xi(()=>ko(s)),()=>{const u=e()||[];return u[Dc],je(()=>{if(u.length===0)return a!==0&&(ko(s),s=[],n=[],i=[],a=0,o=[]),r.fallback&&(n=[ec],i[0]=$r(h=>(s[0]=h,r.fallback())),a=1),i;for(n[0]===ec&&(s[0](),s=[],n=[],i=[],a=0),l=0;l<u.length;l++)l<n.length&&n[l]!==u[l]?o[l](()=>u[l]):l>=n.length&&(i[l]=$r(c));for(;l<n.length;l++)s[l]();return a=o.length=s.length=u.length,n=u.slice(0),i=i.slice(0,a)});function c(h){s[l]=h;const[m,f]=st(u[l]);return o[l]=f,t(m,l)}}}function zh(e,t){return je(()=>e(t||{}))}function qs(){return!0}var tc={get(e,t,r){return t===Wi?r:e.get(t)},has(e,t){return t===Wi?!0:e.has(t)},set:qs,deleteProperty:qs,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:qs,deleteProperty:qs}},ownKeys(e){return e.keys()}};function rl(e){return(e=typeof e=="function"?e():e)?e:{}}function p0(){for(let e=0,t=this.length;e<t;++e){const r=this[e]();if(r!==void 0)return r}}function qh(...e){let t=!1;for(let s=0;s<e.length;s++){const o=e[s];t=t||!!o&&Wi in o,e[s]=typeof o=="function"?(t=!0,at(o)):o}if(t)return new Proxy({get(s){for(let o=e.length-1;o>=0;o--){const a=rl(e[o])[s];if(a!==void 0)return a}},has(s){for(let o=e.length-1;o>=0;o--)if(s in rl(e[o]))return!0;return!1},keys(){const s=[];for(let o=0;o<e.length;o++)s.push(...Object.keys(rl(e[o])));return[...new Set(s)]}},tc);const r={},n={},i=new Set;for(let s=e.length-1;s>=0;s--){const o=e[s];if(!o)continue;const a=Object.getOwnPropertyNames(o);for(let l=0,u=a.length;l<u;l++){const c=a[l];if(c==="__proto__"||c==="constructor")continue;const h=Object.getOwnPropertyDescriptor(o,c);if(!i.has(c))h.get?(i.add(c),Object.defineProperty(r,c,{enumerable:!0,configurable:!0,get:p0.bind(n[c]=[h.get.bind(o)])})):(h.value!==void 0&&i.add(c),r[c]=h.value);else{const m=n[c];m?h.get?m.push(h.get.bind(o)):h.value!==void 0&&m.push(()=>h.value):r[c]===void 0&&(r[c]=h.value)}}}return r}function Vh(e,...t){if(Wi in e){const i=new Set(t.length>1?t.flat():t[0]),s=t.map(o=>new Proxy({get(a){return o.includes(a)?e[a]:void 0},has(a){return o.includes(a)&&a in e},keys(){return o.filter(a=>a in e)}},tc));return s.push(new Proxy({get(o){return i.has(o)?void 0:e[o]},has(o){return i.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.has(o))}},tc)),s}const r={},n=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const s=Object.getOwnPropertyDescriptor(e,i),o=!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable;let a=!1,l=0;for(const u of t)u.includes(i)&&(a=!0,o?n[l][i]=s.value:Object.defineProperty(n[l],i,s)),++l;a||(o?r[i]=s.value:Object.defineProperty(r,i,s))}return[...n,r]}function m0(e){let t,r;const n=i=>{const s=K.context;if(s){const[a,l]=st();K.count||(K.count=0),K.count++,(r||(r=e())).then(u=>{Li(s),K.count--,l(()=>u.default),Li()}),t=a}else if(!t){const[a]=Jy(()=>(r||(r=e())).then(l=>l.default));t=a}let o;return at(()=>(o=t())&&je(()=>{if(!s)return o(i);const a=K.context;Li(s);const l=o(i);return Li(a),l}))};return n.preload=()=>r||((r=e()).then(i=>t=()=>i.default),r),n}var g0=0;function v0(){const e=K.context;return e?`${e.id}${e.count++}`:`cl-${g0++}`}var Qh=e=>`Stale read from <${e}>.`;function _0(e){const t="fallback"in e&&{fallback:()=>e.fallback};return at(f0(()=>e.each,e.children,t||void 0))}function y0(e){const t="fallback"in e&&{fallback:()=>e.fallback};return at(h0(()=>e.each,e.children,t||void 0))}function b0(e){const t=e.keyed,r=at(()=>e.when,void 0,{equals:(n,i)=>t?n===i:!n==!i});return at(()=>{const n=r();if(n){const i=e.children;return typeof i=="function"&&i.length>0?je(()=>i(t?n:()=>{if(!je(r))throw Qh("Show");return e.when})):i}return e.fallback},void 0,void 0)}function w0(e){let t=!1;const r=(s,o)=>s[0]===o[0]&&(t?s[1]===o[1]:!s[1]==!o[1])&&s[2]===o[2],n=Hc(()=>e.children),i=at(()=>{let s=n();Array.isArray(s)||(s=[s]);for(let o=0;o<s.length;o++){const a=s[o].when;if(a)return t=!!s[o].keyed,[o,a,s[o]]}return[-1]},void 0,{equals:r});return at(()=>{const[s,o,a]=i();if(s<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?je(()=>l(t?o:()=>{if(je(i)[0]!==s)throw Qh("Match");return a.when})):l},void 0,void 0)}function x0(e){return e}var S0=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],E0=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...S0]),k0=new Set(["innerHTML","textContent","innerText","children"]),T0=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),C0=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function P0(e,t){const r=C0[e];return typeof r=="object"?r[t]?r.$:void 0:r}var A0=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),O0=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),M0={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function I0(e,t,r){let n=r.length,i=t.length,s=n,o=0,a=0,l=t[i-1].nextSibling,u=null;for(;o<i||a<s;){if(t[o]===r[a]){o++,a++;continue}for(;t[i-1]===r[s-1];)i--,s--;if(i===o){const c=s<n?a?r[a-1].nextSibling:r[s-a]:l;for(;a<s;)e.insertBefore(r[a++],c)}else if(s===a)for(;o<i;)(!u||!u.has(t[o]))&&t[o].remove(),o++;else if(t[o]===r[s-1]&&r[a]===t[i-1]){const c=t[--i].nextSibling;e.insertBefore(r[a++],t[o++].nextSibling),e.insertBefore(r[--s],c),t[i]=r[s]}else{if(!u){u=new Map;let h=a;for(;h<s;)u.set(r[h],h++)}const c=u.get(t[o]);if(c!=null)if(a<c&&c<s){let h=o,m=1,f;for(;++h<i&&h<s&&!((f=u.get(t[h]))==null||f!==c+m);)m++;if(m>c-a){const p=t[o];for(;a<c;)e.insertBefore(r[a++],p)}else e.replaceChild(r[a++],t[o++])}else o++;else t[o++].remove()}}}var Yu="_$DX_DELEGATE";function $0(e,t,r,n={}){let i;return $r(s=>{i=s,t===document?e():Co(t,e(),t.firstChild?null:void 0,r)},n.owner),()=>{i(),t.textContent=""}}function F0(e,t,r){let n;const i=()=>{const o=document.createElement("template");return o.innerHTML=e,r?o.content.firstChild.firstChild:o.content.firstChild},s=t?()=>je(()=>document.importNode(n||(n=i()),!0)):()=>(n||(n=i())).cloneNode(!0);return s.cloneNode=s,s}function Wh(e,t=window.document){const r=t[Yu]||(t[Yu]=new Set);for(let n=0,i=e.length;n<i;n++){const s=e[n];r.has(s)||(r.add(s),t.addEventListener(s,U0))}}function To(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}function R0(e,t,r,n){n==null?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,n)}function Xh(e,t){t==null?e.removeAttribute("class"):e.className=t}function Yh(e,t,r,n){if(n)Array.isArray(r)?(e[`$$${t}`]=r[0],e[`$$${t}Data`]=r[1]):e[`$$${t}`]=r;else if(Array.isArray(r)){const i=r[0];e.addEventListener(t,r[0]=s=>i.call(e,r[1],s))}else e.addEventListener(t,r)}function j0(e,t,r={}){const n=Object.keys(t||{}),i=Object.keys(r);let s,o;for(s=0,o=i.length;s<o;s++){const a=i[s];!a||a==="undefined"||t[a]||(Ju(e,a,!1),delete r[a])}for(s=0,o=n.length;s<o;s++){const a=n[s],l=!!t[a];!a||a==="undefined"||r[a]===l||!l||(Ju(e,a,!0),r[a]=l)}return r}function N0(e,t,r){if(!t)return r?To(e,"style"):t;const n=e.style;if(typeof t=="string")return n.cssText=t;typeof r=="string"&&(n.cssText=r=void 0),r||(r={}),t||(t={});let i,s;for(s in r)t[s]==null&&n.removeProperty(s),delete r[s];for(s in t)i=t[s],i!==r[s]&&(n.setProperty(s,i),r[s]=i);return r}function Jh(e,t={},r,n){const i={};return n||Fr(()=>i.children=ui(e,t.children,i.children)),Fr(()=>t.ref&&t.ref(e)),Fr(()=>D0(e,t,r,!0,i,!0)),i}function L0(e,t,r){return je(()=>e(t,r))}function Co(e,t,r,n){if(r!==void 0&&!n&&(n=[]),typeof t!="function")return ui(e,t,n,r);Fr(i=>ui(e,t(),i,r),n)}function D0(e,t,r,n,i={},s=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=Ku(e,o,null,i[o],r,s)}for(const o in t){if(o==="children"){n||ui(e,t.children);continue}const a=t[o];i[o]=Ku(e,o,a,i[o],r,s)}}function B0(e){let t,r;if(!K.context||!(t=K.registry.get(r=G0()))){if(K.context,!e)throw new Error("Unrecoverable Hydration Mismatch. No template for key: "+r);return e()}return K.completed&&K.completed.add(t),K.registry.delete(r),t}function H0(e){return e.toLowerCase().replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}function Ju(e,t,r){const n=t.trim().split(/\s+/);for(let i=0,s=n.length;i<s;i++)e.classList.toggle(n[i],r)}function Ku(e,t,r,n,i,s){let o,a,l,u,c;if(t==="style")return N0(e,r,n);if(t==="classList")return j0(e,r,n);if(r===n)return n;if(t==="ref")s||r(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);n&&e.removeEventListener(h,n),r&&e.addEventListener(h,r)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);n&&e.removeEventListener(h,n,!0),r&&e.addEventListener(h,r,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),m=A0.has(h);if(!m&&n){const f=Array.isArray(n)?n[0]:n;e.removeEventListener(h,f)}(m||r)&&(Yh(e,h,r,m),m&&Wh([h]))}else if(t.slice(0,5)==="attr:")To(e,t.slice(5),r);else if((c=t.slice(0,5)==="prop:")||(l=k0.has(t))||!i&&((u=P0(t,e.tagName))||(a=E0.has(t)))||(o=e.nodeName.includes("-")))c&&(t=t.slice(5),a=!0),t==="class"||t==="className"?Xh(e,r):o&&!a&&!l?e[H0(t)]=r:e[u||t]=r;else{const h=i&&t.indexOf(":")>-1&&M0[t.split(":")[0]];h?R0(e,h,t,r):To(e,T0[t]||t,r)}return r}function U0(e){const t=`$$${e.type}`;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return r||document}}),K.registry&&!K.done&&(K.done=_$HY.done=!0);r;){const n=r[t];if(n&&!r.disabled){const i=r[`${t}Data`];if(i!==void 0?n.call(r,i,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function ui(e,t,r,n,i){if(K.context){!r&&(r=[...e.childNodes]);let a=[];for(let l=0;l<r.length;l++){const u=r[l];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():a.push(u)}r=a}for(;typeof r=="function";)r=r();if(t===r)return r;const s=typeof t,o=n!==void 0;if(e=o&&r[0]&&r[0].parentNode||e,s==="string"||s==="number"){if(K.context)return r;if(s==="number"&&(t=t.toString()),o){let a=r[0];a&&a.nodeType===3?a.data=t:a=document.createTextNode(t),r=Mn(e,r,n,a)}else r!==""&&typeof r=="string"?r=e.firstChild.data=t:r=e.textContent=t}else if(t==null||s==="boolean"){if(K.context)return r;r=Mn(e,r,n)}else{if(s==="function")return Fr(()=>{let a=t();for(;typeof a=="function";)a=a();r=ui(e,a,r,n)}),()=>r;if(Array.isArray(t)){const a=[],l=r&&Array.isArray(r);if(rc(a,t,r,i))return Fr(()=>r=ui(e,a,r,n,!0)),()=>r;if(K.context){if(!a.length)return r;for(let u=0;u<a.length;u++)if(a[u].parentNode)return r=a}if(a.length===0){if(r=Mn(e,r,n),o)return r}else l?r.length===0?Zu(e,a,n):I0(e,r,a):(r&&Mn(e),Zu(e,a));r=a}else if(t.nodeType){if(K.context&&t.parentNode)return r=o?[t]:t;if(Array.isArray(r)){if(o)return r=Mn(e,r,n,t);Mn(e,r,null,t)}else r==null||r===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);r=t}}return r}function rc(e,t,r,n){let i=!1;for(let s=0,o=t.length;s<o;s++){let a=t[s],l=r&&r[s],u;if(!(a==null||a===!0||a===!1))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))i=rc(e,a,l)||i;else if(u==="function")if(n){for(;typeof a=="function";)a=a();i=rc(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||i}else e.push(a),i=!0;else{const c=String(a);l&&l.nodeType===3&&l.data===c?e.push(l):e.push(document.createTextNode(c))}}return i}function Zu(e,t,r=null){for(let n=0,i=t.length;n<i;n++)e.insertBefore(t[n],r)}function Mn(e,t,r,n){if(r===void 0)return e.textContent="";const i=n||document.createTextNode("");if(t.length){let s=!1;for(let o=t.length-1;o>=0;o--){const a=t[o];if(i!==a){const l=a.parentNode===e;!s&&!o?l?e.replaceChild(i,a):e.insertBefore(i,r):l&&a.remove()}else s=!0}}else e.insertBefore(i,r);return[i]}function G0(){const e=K.context;return`${e.id}${e.count++}`}var z0="http://www.w3.org/2000/svg";function Kh(e,t=!1){return t?document.createElementNS(z0,e):document.createElement(e)}function q0(e){const{useShadow:t}=e,r=document.createTextNode(""),n=()=>e.mount||document.body,i=Xu();let s,o=!!K.context;return Bc(()=>{o&&(Xu().user=o=!1),s||(s=r0(i,()=>at(()=>e.children)));const a=n();if(a instanceof HTMLHeadElement){const[l,u]=st(!1),c=()=>u(!0);$r(h=>Co(a,()=>l()?h():s(),null)),Xi(c)}else{const l=Kh(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return r.parentNode},configurable:!0}),Co(u,s),a.appendChild(l),e.ref&&e.ref(l),Xi(()=>a.removeChild(l))}},void 0,{render:!o}),r}function V0(e){const[t,r]=Vh(e,["component"]),n=at(()=>t.component);return at(()=>{const i=n();switch(typeof i){case"function":return Object.assign(i,{[Xy]:!0}),je(()=>i(r));case"string":const s=O0.has(i),o=K.context?B0():Kh(i,s);return Jh(o,r,s),o}})}var ti,ds,fs,hs,on,ri,ni,ii,si,oi,ps,Kd,Q0=(Kd=class{constructor(e){F(this,ti,void 0);F(this,ds,void 0);F(this,fs,void 0);F(this,hs,void 0);F(this,on,!1);F(this,ri,void 0);F(this,ni,void 0);F(this,ii,void 0);F(this,si,void 0);F(this,oi,void 0);F(this,ps,void 0);const{client:t,queryFlavor:r,version:n,onlineManager:i,buttonPosition:s,position:o,initialIsOpen:a,errorTypes:l}=e;$(this,ti,st(t)),$(this,fs,r),$(this,hs,n),$(this,ds,i),$(this,ri,st(s)),$(this,ni,st(o)),$(this,ii,st(a)),$(this,si,st(l))}setButtonPosition(e){b(this,ri)[1](e)}setPosition(e){b(this,ni)[1](e)}setInitialIsOpen(e){b(this,ii)[1](e)}setErrorTypes(e){b(this,si)[1](e)}setClient(e){b(this,ti)[1](e)}mount(e){if(b(this,on))throw new Error("Devtools is already mounted");const t=$0(()=>{const[r]=b(this,ri),[n]=b(this,ni),[i]=b(this,ii),[s]=b(this,si),[o]=b(this,ti);let a;b(this,oi)?a=b(this,oi):(a=m0(()=>Promise.resolve().then(()=>require("./4TNE5QTO-f73ecbf4.js"))),$(this,oi,a));const l=this;return zh(a,qh({get queryFlavor(){return b(l,fs)},get version(){return b(l,hs)},get onlineManager(){return b(l,ds)}},{get client(){return o()},get buttonPosition(){return r()},get position(){return n()},get initialIsOpen(){return i()},get errorTypes(){return s()}}))},e);$(this,on,!0),$(this,ps,t)}unmount(){var e;if(!b(this,on))throw new Error("Devtools is not mounted");(e=b(this,ps))==null||e.call(this),$(this,on,!1)}},ti=new WeakMap,ds=new WeakMap,fs=new WeakMap,hs=new WeakMap,on=new WeakMap,ri=new WeakMap,ni=new WeakMap,ii=new WeakMap,si=new WeakMap,oi=new WeakMap,ps=new WeakMap,Kd);function W0(e){const t=mi(),r=e.client||t,n=C.useRef(null),{buttonPosition:i,position:s,initialIsOpen:o,errorTypes:a}=e,[l]=C.useState(new Q0({client:r,queryFlavor:"React Query",version:"5",onlineManager:Qi,buttonPosition:i,position:s,initialIsOpen:o,errorTypes:a}));return C.useEffect(()=>{l.setClient(r)},[r,l]),C.useEffect(()=>{i&&l.setButtonPosition(i)},[i,l]),C.useEffect(()=>{s&&l.setPosition(s)},[s,l]),C.useEffect(()=>{l.setInitialIsOpen(o||!1)},[o,l]),C.useEffect(()=>{l.setErrorTypes(a||[])},[a,l]),C.useEffect(()=>(n.current&&l.mount(n.current),()=>{l.unmount()}),[l]),C.createElement("div",{className:"tsqd-parent-container",ref:n})}var X0=process.env.NODE_ENV!=="development"?function(){return null}:W0;const Zh=({children:e,showDevTools:t=!0})=>{const r=new Ay({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4}}});return g.jsxs(Fy,{client:r,children:[e,t&&g.jsx(X0,{initialIsOpen:!1})]})};function ed(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ed(Object(r),!0).forEach(function(n){H(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ed(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nc(e){return nc=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},nc(e)}function Me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function td(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ie(e,t,r){return t&&td(e.prototype,t),r&&td(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function H(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ep(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&&ic(e,t)}function Po(e){return Po=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Po(e)}function ic(e,t){return ic=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},ic(e,t)}function Y0(e,t){if(e==null)return{};var r,n,i=function(o,a){if(o==null)return{};var l,u,c={},h=Object.keys(o);for(u=0;u<h.length;u++)l=h[u],a.indexOf(l)>=0||(c[l]=o[l]);return c}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function J0(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(e)}function tp(e){var t=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var r,n=Po(e);if(t){var i=Po(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return J0(this,r)}}function ws(e,t){return function(r){if(Array.isArray(r))return r}(e)||function(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var s,o,a=[],l=!0,u=!1;try{for(i=i.call(r);!(l=(s=i.next()).done)&&(a.push(s.value),!n||a.length!==n);l=!0);}catch(c){u=!0,o=c}finally{try{l||i.return==null||i.return()}finally{if(u)throw o}}return a}}(e,t)||Gc(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
60
60
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function sc(e){return function(t){if(Array.isArray(t))return oc(t)}(e)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||Gc(e)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
61
61
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Gc(e,t){if(e){if(typeof e=="string")return oc(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oc(e,t):void 0}}function oc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dn(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Gc(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
62
62
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{o||r.return==null||r.return()}finally{if(a)throw s}}}}var fn={DEBUG:!1,LIB_VERSION:"1.87.6"},K0=Array.isArray,rp=Object.prototype,np=rp.hasOwnProperty,xs=rp.toString,Ge=K0||function(e){return xs.call(e)==="[object Array]"},rd=function(e){return xs.call(e)==="[object Uint8Array]"},hn=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}},Rr=function(e){return e===Object(e)&&!Ge(e)},Z0=function(e){if(Rr(e)){for(var t in e)if(np.call(e,t))return!1;return!0}return!1},se=function(e){return e===void 0},gt=function(e){return xs.call(e)=="[object String]"},Wt=function(e){return e===null},sr=function(e){return xs.call(e)=="[object Number]"},ac=function(e){return xs.call(e)==="[object Boolean]"},ip=Array.prototype,nd=ip.forEach,id=ip.indexOf,U=typeof window<"u"?window:{},eb=U.navigator||{userAgent:""},Ce=U.document||{},dt=eb.userAgent,sd="[PostHog.js]",j={_log:function(e){if((fn.DEBUG||U.POSTHOG_DEBUG)&&!se(U.console)&&U.console){for(var t=("__rrweb_original__"in U.console[e])?U.console[e].__rrweb_original__:U.console[e],r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];t.apply(void 0,[sd].concat(n))}},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];j._log.apply(j,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];j._log.apply(j,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];j._log.apply(j,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];(e=console).error.apply(e,[sd].concat(r))},uninitializedWarning:function(e){j.error("You must initialize PostHog before calling ".concat(e))}},zc={},lc=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Ln(e,t,r){if(Ge(e)){if(nd&&e.forEach===nd)e.forEach(t,r);else if("length"in e&&e.length===+e.length){for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n)===zc)return}}}function be(e,t,r){if(!Wt(e)&&!se(e)){if(Ge(e))return Ln(e,t,r);for(var n in e)if(np.call(e,n)&&t.call(r,e[n],n)===zc)return}}var Xe=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Ln(r,function(i){for(var s in i)i[s]!==void 0&&(e[s]=i[s])}),e};function de(e,t){return e.indexOf(t)!==-1}var sp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},od=function(e){try{return e()}catch{return}},op=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.apply(this,r)}catch(i){j.critical("Implementation error. Please turn on debug and contact support@posthog.com."),j.critical(i)}}},cc=function(e){var t={};return be(e,function(r,n){gt(r)&&r.length>0&&(t[n]=r)}),t},tb=["$performance_raw"];function rb(e,t){return r=e,n=function(s,o){return o&&tb.indexOf(o)>-1?s:gt(s)&&!Wt(t)?s.slice(0,t):s},i=new Set,function s(o,a){return o!==Object(o)?n?n(o,a):o:i.has(o)?void 0:(i.add(o),Ge(o)?(l=[],Ln(o,function(u){l.push(s(u))})):(l={},be(o,function(u,c){i.has(u)||(l[c]=s(u,c))})),l);var l}(r);var r,n,i}function qc(e){var t,r,n,i,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",c=[];if(!e)return e;e=nb(e);do t=(s=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=s>>12&63,n=s>>6&63,i=63&s,c[l++]=o.charAt(t)+o.charAt(r)+o.charAt(n)+o.charAt(i);while(a<e.length);switch(u=c.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}var nb=function(e){var t,r,n,i,s="";for(t=r=0,n=(e=(e+"").replace(/\r\n/g,`
|
|
63
63
|
`).replace(/\r/g,`
|
|
64
|
-
`)).length,i=0;i<n;i++){var o=e.charCodeAt(i),a=null;o<128?r++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Wt(a)||(r>t&&(s+=e.substring(t,r)),s+=a,t=r=i+1)}return r>t&&(s+=e.substring(t,e.length)),s},ib=["ahrefsbot","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","hubspot","linkedinbot","mj12bot","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","twitterbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],sb=function(e,t){if(!e)return!1;var r=e.toLowerCase();return ib.concat(t||[]).some(function(n){var i=n.toLowerCase();return r.includes?r.includes(i):r.indexOf(i)!==-1})},Bi=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,r,n,i,s){if(t)if(t.addEventListener&&!i)t.addEventListener(r,n,!!s);else{var o="on"+r,a=t[o];t[o]=function(l,u,c){return function(h){if(h=h||e(window.event)){var m,f=!0;hn(c)&&(m=c(h));var p=u.call(l,h);return m!==!1&&p!==!1||(f=!1),f}}}(t,n,a)}else j.error("No valid element provided to register_event")}}();function Hi(e,t){var r=function(){var n=Ce.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(o){return t(void 0,o)},n.onerror=function(o){return t(o)};var i,s=Ce.querySelectorAll("body > script");s.length>0?(i=s[0].parentNode)===null||i===void 0||i.insertBefore(n,s[0]):Ce.body.appendChild(n)};Ce.body?r():Ce.addEventListener("DOMContentLoaded",r)}function Ao(e){switch(nc(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function Oo(e){var t="";return ao(e)&&!lp(e)&&e.childNodes&&e.childNodes.length&&be(e.childNodes,function(r){ap(r)&&r.textContent&&(t+=lc(r.textContent).split(/(\s+)/).filter($n).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),lc(t)}function ad(e){return!!e&&e.nodeType===1}function an(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ap(e){return!!e&&e.nodeType===3}function ld(e){return!!e&&e.nodeType===11}var nl=["a","button","form","input","select","textarea","label"];function ao(e){for(var t=e;t.parentNode&&!an(t,"body");t=t.parentNode){var r=Ao(t).split(" ");if(de(r,"ph-sensitive")||de(r,"ph-no-capture"))return!1}if(de(Ao(e).split(" "),"ph-include"))return!0;var n=e.type||"";if(gt(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!(gt(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function lp(e){return!!(an(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||an(e,"select")||an(e,"textarea")||e.getAttribute("contenteditable")==="true")}function $n(e){return!(Wt(e)||se(e)||gt(e)&&(e=lc(e),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(e)))}function cd(e){var t=Oo(e);return $n(t="".concat(t," ").concat(cp(e)).trim())?t:""}function cp(e){var t="";return e&&e.childNodes&&e.childNodes.length&&be(e.childNodes,function(r){var n;if(r&&((n=r.tagName)===null||n===void 0?void 0:n.toLowerCase())==="span")try{var i=Oo(r);t="".concat(t," ").concat(i).trim(),r.childNodes&&r.childNodes.length&&(t="".concat(t," ").concat(cp(r)).trim())}catch(s){j.error(s)}}),t}var ob=function(){function e(t){Me(this,e),this.clicks=[],this.enabled=t}return Ie(e,[{key:"isRageClick",value:function(t,r,n){if(!this.enabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(r-i.y)<30&&n-i.timestamp<1e3){if(this.clicks.push({x:t,y:r,timestamp:n}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:r,timestamp:n}];return!1}}]),e}(),up="$people_distinct_id",lo="__alias",Di="__timers",ud="$autocapture_disabled_server_side",uc="$session_recording_enabled_server_side",dd="$console_log_recording_enabled_server_side",fd="$session_recording_recorder_version_server_side",Mo="$sesid",co="$session_is_sampled",Fn="$enabled_feature_flags",dc="$early_access_features",Rn="$stored_person_properties",wr="$stored_group_properties",fc="$surveys",Io="$flag_call_reported",hc="$user_state",pc="$posthog_quota_limited",ab=[up,lo,"__cmpns",Di,uc,Mo,Fn,hc,pc,dc,wr,Rn,fc,Io];function il(e,t){return t.length>e?t.slice(0,e)+"...":t}var xr={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t,r=Wt(this._isDisabledServerSide)?!((t=e.persistence)===null||t===void 0||!t.props[ud]):this._isDisabledServerSide,n=!!e.config.autocapture;this._isAutocaptureEnabled=n&&!r},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!ad(t));return t},_getAugmentPropertiesFromElement:function(e){if(!ao(e))return{};var t={};return be(e.attributes,function(r){if(r.name.indexOf("data-ph-capture-attribute")===0){var n=r.name.replace("data-ph-capture-attribute-",""),i=r.value;n&&i&&$n(i)&&(t[n]=i)}}),t},_getPropertiesFromElement:function(e,t,r){var n,i=e.tagName.toLowerCase(),s={tag_name:i};nl.indexOf(i)>-1&&!r&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?s.$el_text=il(1024,cd(e)):s.$el_text=il(1024,Oo(e)));var o=Ao(e);o.length>0&&(s.classes=o.split(" ").filter(function(h){return h!==""}));var a=(n=this.config)===null||n===void 0?void 0:n.element_attribute_ignorelist;be(e.attributes,function(h){var m;lp(e)&&["name","id","class"].indexOf(h.name)===-1||a!=null&&a.includes(h.name)||!t&&$n(h.value)&&(m=h.name,!gt(m)||m.substring(0,10)!=="_ngcontent"&&m.substring(0,7)!=="_nghost")&&(s["attr__"+h.name]=il(1024,h.value))});for(var l=1,u=1,c=e;c=this._previousElementSibling(c);)l++,c.tagName===e.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return be(document.querySelectorAll(e.css_selector),function(r){var n;["input","select"].indexOf(r.tagName.toLowerCase())>-1?n=r.value:r.textContent&&(n=r.textContent),$n(n)&&t.push(n)}),t.join(", ")},_getCustomProperties:function(e){var t=this,r={};return be(this._customProperties,function(n){be(n.event_selectors,function(i){be(document.querySelectorAll(i),function(s){de(e,s)&&ao(s)&&(r[n.name]=t._extractCustomPropertyValue(n))})})}),r},_getEventTarget:function(e){return se(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var r,n=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"$autocapture",s=this._getEventTarget(e);if(ap(s)&&(s=s.parentNode||null),i==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,t,"$rageclick"),s&&function(v,x){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!v||an(v,"html")||!ad(v))return!1;if(S!=null&&S.url_allowlist){var k=window.location.href,T=S.url_allowlist;if(T&&!T.some(function(q){return k.match(q)}))return!1}if(S!=null&&S.dom_event_allowlist){var P=S.dom_event_allowlist;if(P&&!P.some(function(q){return x.type===q}))return!1}if(S!=null&&S.element_allowlist){var y=S.element_allowlist;if(y&&!y.some(function(q){return v.tagName.toLowerCase()===q}))return!1}if(S!=null&&S.css_selector_allowlist){var O=S.css_selector_allowlist;if(O&&!O.some(function(q){return v.matches(q)}))return!1}for(var M=!1,E=[v],I=!0,R=v;R.parentNode&&!an(R,"body");)if(ld(R.parentNode))E.push(R.parentNode.host),R=R.parentNode.host;else{if(!(I=R.parentNode||!1))break;if(nl.indexOf(I.tagName.toLowerCase())>-1)M=!0;else{var N=window.getComputedStyle(I);N&&N.getPropertyValue("cursor")==="pointer"&&(M=!0)}E.push(I),R=I}var z=window.getComputedStyle(v);if(z&&z.getPropertyValue("cursor")==="pointer"&&x.type==="click")return!0;var Y=v.tagName.toLowerCase();switch(Y){case"html":return!1;case"form":return x.type==="submit";case"input":case"select":case"textarea":return x.type==="change"||x.type==="click";default:return M?x.type==="click":x.type==="click"&&(nl.indexOf(Y)>-1||v.getAttribute("contenteditable")==="true")}}(s,e,this.config)){for(var o,a,l=[s],u=s;u.parentNode&&!an(u,"body");)ld(u.parentNode)?(l.push(u.parentNode.host),u=u.parentNode.host):(l.push(u.parentNode),u=u.parentNode);var c,h=[],m={},f=!1;if(be(l,function(v){var x=ao(v);v.tagName.toLowerCase()==="a"&&(c=v.getAttribute("href"),c=x&&$n(c)&&c),de(Ao(v).split(" "),"ph-no-capture")&&(f=!0),h.push(n._getPropertiesFromElement(v,t.config.mask_all_element_attributes,t.config.mask_all_text));var S=n._getAugmentPropertiesFromElement(v);Xe(m,S)}),t.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?h[0].$el_text=cd(s):h[0].$el_text=Oo(s)),c&&(h[0].attr__href=c),f)return!1;var p=Xe(this._getDefaultProperties(e.type),{$elements:h},(o=h[0])!==null&&o!==void 0&&o.$el_text?{$el_text:(a=h[0])===null||a===void 0?void 0:a.$el_text}:{},this._getCustomProperties(l),m);return t.capture(i,p),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,r=function(n){n=n||window.event,t._captureEvent(n,e)};Bi(document,"submit",r,!1,!0),Bi(document,"change",r,!1,!0),Bi(document,"click",r,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;ac(e.__autocapture)||(this.config=e.__autocapture),(t=this.config)!==null&&t!==void 0&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function(r){return new RegExp(r)})),this.rageclicks=new ob(e.config.rageclick)},afterDecideResponse:function(e,t){var r=t.config.token;this._initializedTokens.indexOf(r)>-1?j.info('autocapture already initialized for token "'+r+'"'):(t.persistence&&t.persistence.register(H({},ud,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(r),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,r){if(!e)return!0;t=se(t)?10:t,r=se(r)?10:r;for(var n=0,i=0;i<e.length;i++)n+=e.charCodeAt(i);return n%t<r},isBrowserSupported:function(){return hn(document.querySelectorAll)}};(function(e){for(var t in e)hn(e[t])&&(e[t]=e[t].bind(e))})(xr),function(e){for(var t in e)hn(e[t])&&(e[t]=op(e[t]))}(xr);var sl="$active_feature_flags",Vs="$override_feature_flags",hd="$feature_flag_payloads",pd=function(e){var t,r={},n=dn(function(a){for(var l=Object.keys(a),u=l.length,c=new Array(u);u--;)c[u]=[l[u],a[l[u]]];return c}(e||{}));try{for(n.s();!(t=n.n()).done;){var i=ws(t.value,2),s=i[0],o=i[1];o&&(r[s]=o)}}catch(a){n.e(a)}finally{n.f()}return r},lb=function(){function e(t){Me(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return Ie(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var t=this.instance.get_property(Fn),r=this.instance.get_property(Vs);if(!r)return t||{};for(var n=Xe({},t),i=Object.keys(r),s=0;s<i.length;s++)r[i[s]]===!1?delete n[i[s]]:n[i[s]]=r[i[s]];return this._override_warning||(j.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:r,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(hd)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(t){this.$anon_distinct_id=t}},{key:"setReloadingPaused",value:function(t){this.reloadFeatureFlagsInAction=t}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var t=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!t.reloadFeatureFlagsInAction&&t.reloadFeatureFlagsQueued&&(t.reloadFeatureFlagsQueued=!1,t._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var t=this;this.setReloadingPaused(!0);var r=this.instance.config.token,n=this.instance.get_property(Rn),i=this.instance.get_property(wr),s=qc(JSON.stringify({token:r,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:i,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0}));this.instance._send_request(this.instance.config.api_host+"/decide/?v=3",{data:s},{method:"POST"},this.instance._prepare_callback(function(o){t.$anon_distinct_id=void 0,t.receivedFeatureFlags(o),t.setReloadingPaused(!1),t._startReloadTimer()}))}},{key:"getFeatureFlag",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,i=this.getFlagVariants()[t],s="".concat(i),o=this.instance.get_property(Io)||{};return(r.send_event||!("send_event"in r))&&(!(t in o)||!o[t].includes(s))&&(Ge(o[t])?o[t].push(s):o[t]=[s],(n=this.instance.persistence)===null||n===void 0||n.register(H({},Io,o)),this.instance.capture("$feature_flag_called",{$feature_flag:t,$feature_flag_response:i})),i}j.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(t){return this.getFlagPayloads()[t]}},{key:"isFeatureEnabled",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(t,r);j.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(t){this.featureFlagEventHandlers.push(t)}},{key:"removeFeatureFlagsHandler",value:function(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(r){return r!==t})}},{key:"receivedFeatureFlags",value:function(t){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),n=this.getFlagPayloads();(function(i,s){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=i.featureFlags,u=i.featureFlagPayloads;if(l)if(Ge(l)){var c,h={};if(l)for(var m=0;m<l.length;m++)h[l[m]]=!0;s&&s.register((H(c={},sl,l),H(c,Fn,h),c))}else{var f,p=l,v=u;i.errorsWhileComputingFlags&&(p=J(J({},o),p),v=J(J({},a),v)),s&&s.register((H(f={},sl,Object.keys(pd(p))),H(f,Fn,p||{}),H(f,hd,v||{}),f))}})(t,this.instance.persistence,r,n),this._fireFeatureFlagsCallbacks()}}},{key:"override",value:function(t){if(!this.instance.__loaded||!this.instance.persistence)return j.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,t===!1)this.instance.persistence.unregister(Vs);else if(Ge(t)){for(var r={},n=0;n<t.length;n++)r[t[n]]=!0;this.instance.persistence.register(H({},Vs,r))}else this.instance.persistence.register(H({},Vs,t))}},{key:"onFeatureFlags",value:function(t){var r=this;if(this.addFeatureFlagsHandler(t),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),i=n.flags,s=n.flagVariants;t(i,s)}return function(){return r.removeFeatureFlagsHandler(t)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(t,r){var n,i,s=H({},"$feature_enrollment/".concat(t),r);this.instance.capture("$feature_enrollment_update",{$feature_flag:t,$feature_enrollment:r,$set:s}),this.setPersonPropertiesForFlags(s,!1);var o=J(J({},this.getFlagVariants()),{},H({},t,r));(n=this.instance.persistence)===null||n===void 0||n.register((H(i={},sl,Object.keys(pd(o))),H(i,Fn,o),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(t){var r=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(dc);if(i&&!n)return t(i);this.instance._send_request("".concat(this.instance.config.api_host,"/api/early_access_features/?token=").concat(this.instance.config.token),{},{method:"GET"},function(s){var o,a=s.earlyAccessFeatures;return(o=r.instance.persistence)===null||o===void 0||o.register(H({},dc,a)),t(a)})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var t=this.getFlags(),r=this.getFlagVariants();return{flags:t.filter(function(n){return r[n]}),flagVariants:Object.keys(r).filter(function(n){return r[n]}).reduce(function(n,i){return n[i]=r[i],n},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var t=this._prepareFeatureFlagsForCallbacks(),r=t.flags,n=t.flagVariants;this.featureFlagEventHandlers.forEach(function(i){return i(r,n)})}},{key:"setPersonPropertiesForFlags",value:function(t){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.instance.get_property(Rn)||{};this.instance.register(H({},Rn,J(J({},n),t))),r&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Rn)}},{key:"setGroupPropertiesForFlags",value:function(t){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.instance.get_property(wr)||{};Object.keys(n).length!==0&&Object.keys(n).forEach(function(i){n[i]=J(J({},n[i]),t[i]),delete t[i]}),this.instance.register(H({},wr,J(J({},n),t))),r&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(t){if(t){var r=this.instance.get_property(wr)||{};this.instance.register(H({},wr,J(J({},r),{},H({},t,{}))))}else this.instance.unregister(wr)}}]),e}(),cb=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,cr={is_supported:function(){return!0},error:function(e){j.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",r=document.cookie.split(";").filter(function(s){return s.length}),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null},parse:function(e){var t;try{t=JSON.parse(cr.get(e))||{}}catch{}return t},set:function(e,t,r,n,i){try{var s="",o="",a="";if(n){var l=document.location.hostname.match(cb),u=l?l[0]:"";s=u?"; domain=."+u:""}if(r){var c=new Date;c.setTime(c.getTime()+24*r*60*60*1e3),o="; expires="+c.toUTCString()}i&&(a="; secure");var h=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+s+a;return document.cookie=h,h}catch{return}},remove:function(e,t){try{cr.set(e,"",-1,t)}catch{return}}},ol=null,Ae={is_supported:function(){if(!Wt(ol))return ol;var e=!0;if(se(window))e=!1;else try{var t="__mplssupport__";Ae.set(t,"xyz"),Ae.get(t)!=='"xyz"'&&(e=!1),Ae.remove(t)}catch{e=!1}return e||j.error("localStorage unsupported; falling back to cookie store"),ol=e,e},error:function(e){j.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){Ae.error(t)}return null},parse:function(e){try{return JSON.parse(Ae.get(e))||{}}catch{}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(r){Ae.error(r)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){Ae.error(t)}}},ub=["distinct_id",Mo,co],mc=J(J({},Ae),{},{parse:function(e){try{var t={};try{t=cr.parse(e)||{}}catch{}var r=Xe(t,JSON.parse(Ae.get(e)||"{}"));return Ae.set(e,r),r}catch{}return null},set:function(e,t,r,n,i){try{Ae.set(e,t);var s={};ub.forEach(function(o){t[o]&&(s[o]=t[o])}),Object.keys(s).length&&cr.set(e,s,r,n,i)}catch(o){Ae.error(o)}},remove:function(e,t){try{window.localStorage.removeItem(e),cr.remove(e,t)}catch(r){Ae.error(r)}}}),Qs={},db={is_supported:function(){return!0},error:function(e){j.error("memoryStorage error: "+e)},get:function(e){return Qs[e]||null},parse:function(e){return Qs[e]||null},set:function(e,t){Qs[e]=t},remove:function(e){delete Qs[e]}},Vr=null,Ue={is_supported:function(){if(!Wt(Vr))return Vr;if(Vr=!0,se(window))Vr=!1;else try{var e="__support__";Ue.set(e,"xyz"),Ue.get(e)!=='"xyz"'&&(Vr=!1),Ue.remove(e)}catch{Vr=!1}return Vr},error:function(e){j.error("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(t){Ue.error(t)}return null},parse:function(e){try{return JSON.parse(Ue.get(e))||null}catch{}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(r){Ue.error(r)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(t){Ue.error(t)}}},fb=["localhost","127.0.0.1"],hb=function(e,t){return!!function(r){try{new RegExp(r)}catch{return!1}return!0}(t)&&new RegExp(t).test(e)},md=function(e,t){for(var r,n=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<n.length;i++){var s=n[i].split("=");if(s[0]===t){r=s;break}}if(!Ge(r)||r.length<2)return"";var o=r[1];try{o=decodeURIComponent(o)}catch{j.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},$o=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null},Be={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(e||[]),r={};return be(t,function(n){var i=md(Ce.URL,n);i.length&&(r[n]=i)}),r},searchEngine:function(){var e=Ce.referrer;return e?e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null},searchInfo:function(){var e=Be.searchEngine(),t=e!="yahoo"?"q":"p",r={};if(!Wt(e)){r.$search_engine=e;var n=md(Ce.referrer,t);n.length&&(r.ph_keyword=n)}return r},browser:function(e,t,r){return t=t||"",r||de(e," OPR/")?de(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":de(e,"IEMobile")||de(e,"WPDesktop")?"Internet Explorer Mobile":de(e,"SamsungBrowser/")?"Samsung Internet":de(e,"Edge")||de(e,"Edg/")?"Microsoft Edge":de(e,"FBIOS")?"Facebook Mobile":de(e,"Chrome")?"Chrome":de(e,"CriOS")?"Chrome iOS":de(e,"UCWEB")||de(e,"UCBrowser")?"UC Browser":de(e,"FxiOS")?"Firefox iOS":de(t,"Apple")||function(n){return de(n,"Safari")&&!de(n,"Chrome")&&!de(n,"Android")}(e)?de(e,"Mobile")?"Mobile Safari":"Safari":de(e,"Android")?"Android Mobile":de(e,"Konqueror")||de(e,"konqueror")?"Konqueror":de(e,"Firefox")?"Firefox":de(e,"MSIE")||de(e,"Trident/")?"Internet Explorer":de(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n={"Internet Explorer Mobile":[/rv:(\d+(\.\d+)?)/],"Microsoft Edge":[/Edge?\/(\d+(\.\d+)?)/],Chrome:[/Chrome\/(\d+(\.\d+)?)/],"Chrome iOS":[/CriOS\/(\d+(\.\d+)?)/],"UC Browser":[/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/],Safari:[/Version\/(\d+(\.\d+)?)/],"Mobile Safari":[/Version\/(\d+(\.\d+)?)/],Opera:[/(Opera|OPR)\/(\d+(\.\d+)?)/],Firefox:[/Firefox\/(\d+(\.\d+)?)/],"Firefox iOS":[/FxiOS\/(\d+(\.\d+)?)/],Konqueror:[/Konqueror[:/]?(\d+(\.\d+)?)/i],BlackBerry:[/BlackBerry (\d+(\.\d+)?)/,/Version\/(\d+(\.\d+)?)/],"Android Mobile":[/android\s(\d+(\.\d+)?)/],"Samsung Internet":[/SamsungBrowser\/(\d+(\.\d+)?)/],"Internet Explorer":[/(rv:|MSIE )(\d+(\.\d+)?)/],Mozilla:[/rv:(\d+(\.\d+)?)/]}[Be.browser(e,t,r)];if(se(n))return null;for(var i=0;i<n.length;i++){var s=n[i],o=e.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){if(/Windows/i.test(e)){if(/Phone/.test(e)||/WPDesktop/.test(e))return{os_name:"Windows Phone",os_version:""};var t=/Windows NT ([0-9.]+)/i.exec(e);return t&&t[1]?{os_name:"Windows",os_version:t[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(e)){var r=/OS (\d+)_(\d+)_?(\d+)?/i.exec(e);return r&&r[1]?{os_name:"iOS",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(e)){var n=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(e);return n&&n[1]?{os_name:"Android",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(e))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(e)){var i=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(e);return i&&i[1]?{os_name:"Mac OS X",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(e)?{os_name:"Linux",os_version:""}:/CrOS/.test(e)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return t==="iPad"||t==="Android Tablet"?"Tablet":t?"Mobile":"Desktop"},referrer:function(){return Ce.referrer||"$direct"},referringDomain:function(){if(!Ce.referrer)return"$direct";var e=Ce.createElement("a");return e.href=Ce.referrer,e.host},properties:function(){var e,t,r,n,i,s,o,a=Be.os(dt),l=a.os_name,u=a.os_version;return Xe(cc({$os:l,$os_version:u,$browser:Be.browser(dt,navigator.vendor,window.opera),$device:Be.device(dt),$device_type:Be.deviceType(dt)}),{$current_url:(e=window)===null||e===void 0?void 0:e.location.href,$host:(t=window)===null||t===void 0?void 0:t.location.host,$pathname:(r=window)===null||r===void 0?void 0:r.location.pathname,$raw_user_agent:dt.length>1e3?dt.substring(0,997)+"...":dt,$browser_version:Be.browserVersion(dt,navigator.vendor,window.opera),$browser_language:Be.browserLanguage(),$screen_height:(n=window)===null||n===void 0?void 0:n.screen.height,$screen_width:(i=window)===null||i===void 0?void 0:i.screen.width,$viewport_height:(s=window)===null||s===void 0?void 0:s.innerHeight,$viewport_width:(o=window)===null||o===void 0?void 0:o.innerWidth,$lib:"web",$lib_version:fn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:sp()/1e3})},people_properties:function(){var e=Be.os(dt),t=e.os_name,r=e.os_version;return Xe(cc({$os:t,$os_version:r,$browser:Be.browser(dt,navigator.vendor,window.opera)}),{$browser_version:Be.browserVersion(dt,navigator.vendor,window.opera)})}},pb=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],gd=function(){function e(t){Me(this,e);var r="";t.token&&(r=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=t.custom_campaign_params||[],t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+r+"_posthog",pb.indexOf(t.persistence.toLowerCase())===-1&&(j.critical("Unknown persistence type "+t.persistence+"; falling back to cookie"),t.persistence="cookie");var n=t.persistence.toLowerCase();n==="localstorage"&&Ae.is_supported()?this.storage=Ae:n==="localstorage+cookie"&&mc.is_supported()?this.storage=mc:n==="sessionstorage"&&Ue.is_supported()?this.storage=Ue:this.storage=n==="memory"?db:cr,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return Ie(e,[{key:"properties",value:function(){var t={};return be(this.props,function(r,n){if(n===Fn&&Rr(r))for(var i=Object.keys(r),s=0;s<i.length;s++)t["$feature/".concat(i[s])]=r[i[s]];else a=n,l=!1,(Wt(o=ab)?l:id&&o.indexOf===id?o.indexOf(a)!=-1:(be(o,function(u){if(l||(l=u===a))return zc}),l))||(t[n]=r);var o,a,l}),t}},{key:"load",value:function(){if(!this.disabled){var t=this.storage.parse(this.name);t&&(this.props=Xe({},t))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(t,r,n){var i=this;if(Rr(t)){se(r)&&(r="None"),this.expire_days=se(n)?this.default_expiry:n;var s=!1;if(be(t,function(o,a){i.props.hasOwnProperty(a)&&i.props[a]!==r||(i.props[a]=o,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(t,r){var n=this;if(Rr(t)){this.expire_days=se(r)?this.default_expiry:r;var i=!1;if(be(t,function(s,o){t.hasOwnProperty(o)&&n.props[o]!==s&&(n.props[o]=s,i=!0)}),i)return this.save(),!0}return!1}},{key:"unregister",value:function(t){t in this.props&&(delete this.props[t],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(Be.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(Be.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||Be.referrer(),$referring_domain:this.props.$referring_domain||Be.referringDomain()})}},{key:"get_referrer_info",value:function(){return cc({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(t){return be(this.props,function(r,n){n in t||(t[n]=r)}),t}},{key:"update_config",value:function(t){this.default_expiry=this.expire_days=t.cookie_expiration,this.set_disabled(t.disable_persistence),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie)}},{key:"set_disabled",value:function(t){this.disabled=t,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(t){t!==this.cross_subdomain&&(this.cross_subdomain=t,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(t){t!==this.secure&&(this.secure=t,this.remove(),this.save())}},{key:"set_event_timer",value:function(t,r){var n=this.props[Di]||{};n[t]=r,this.props[Di]=n,this.save()}},{key:"remove_event_timer",value:function(t){var r=(this.props[Di]||{})[t];return se(r)||(delete this.props[Di][t],this.save()),r}},{key:"get_user_state",value:function(){return this.props[hc]||"anonymous"}},{key:"set_user_state",value:function(t){this.props[hc]=t,this.save()}},{key:"get_quota_limits",value:function(){return this.props[pc]||{}}},{key:"set_quota_limits",value:function(t){this.props[pc]=t,this.save()}}]),e}(),vd=2,mb=4,dp=3,gb=6,vb=0,_b="rrweb/console@1",Nt,yb=Ie(function e(t){var r,n,i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Me(this,e),H(this,"bucketSize",100),H(this,"refillRate",10),H(this,"mutationBuckets",{}),H(this,"loggedTracker",{}),H(this,"refillBuckets",function(){Object.keys(i.mutationBuckets).forEach(function(o){i.mutationBuckets[o]=i.mutationBuckets[o]+i.refillRate,i.mutationBuckets[o]>=i.bucketSize&&delete i.mutationBuckets[o]})}),H(this,"getNodeOrRelevantParent",function(o){var a=i.rrweb.mirror.getNode(o);if((a==null?void 0:a.nodeName)!=="svg"&&a instanceof Element){var l=a.closest("svg");if(l)return[i.rrweb.mirror.getId(l),l]}return[o,a]}),H(this,"numberOfChanges",function(o){var a,l,u,c,h,m,f,p;return((a=(l=o.removes)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)+((u=(c=o.attributes)===null||c===void 0?void 0:c.length)!==null&&u!==void 0?u:0)+((h=(m=o.texts)===null||m===void 0?void 0:m.length)!==null&&h!==void 0?h:0)+((f=(p=o.adds)===null||p===void 0?void 0:p.length)!==null&&f!==void 0?f:0)}),H(this,"throttleMutations",function(o){if(o.type!==dp||o.data.source!==vb)return o;var a=o.data,l=i.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(function(c){var h,m,f,p=ws(i.getNodeOrRelevantParent(c.id),2),v=p[0],x=p[1];return i.mutationBuckets[v]===0?!1:(i.mutationBuckets[v]=(h=i.mutationBuckets[v])!==null&&h!==void 0?h:i.bucketSize,i.mutationBuckets[v]=Math.max(i.mutationBuckets[v]-1,0),i.mutationBuckets[v]===0&&(i.loggedTracker[v]||(i.loggedTracker[v]=!0,(m=(f=i.options).onBlockedNode)===null||m===void 0||m.call(f,v,x))),c)}));var u=i.numberOfChanges(a);return u!==0||l===u?o:void 0}),this.rrweb=t,this.options=s,this.refillRate=(r=this.options.refillRate)!==null&&r!==void 0?r:this.refillRate,this.bucketSize=(n=this.options.bucketSize)!==null&&n!==void 0?n:this.bucketSize,setInterval(function(){i.refillBuckets()},1e3)}),fp=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(fp||{}),bb="/s/";(function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"})(Nt||(Nt={}));var wb=[Nt.MouseMove,Nt.MouseInteraction,Nt.Scroll,Nt.ViewportResize,Nt.Input,Nt.TouchMove,Nt.MediaInteraction,Nt.Drag],xb=function(){function e(t){var r=this;if(Me(this,e),H(this,"_linkedFlagSeen",!1),H(this,"_lastActivityTimestamp",Date.now()),H(this,"isIdle",!1),H(this,"_linkedFlag",null),H(this,"_sampleRate",null),H(this,"_minimumDuration",null),this.instance=t,this._captureStarted=!1,this._endpoint=bb,this.stopRrweb=void 0,this.receivedDecide=!1,window.addEventListener("beforeunload",function(){r._flushBuffer()}),!this.instance.sessionManager)throw j.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=n.sessionId,s=n.windowId;this.windowId=s,this.sessionId=i,this.buffer=this.clearBuffer()}return Ie(e,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw j.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return sr(this._sampleRate)?this.instance.get_property(co):null}},{key:"sessionDuration",get:function(){var t,r,n=(t=this.buffer)===null||t===void 0?void 0:t.data[((r=this.buffer)===null||r===void 0?void 0:r.data.length)-1],i=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-i:null}},{key:"isRecordingEnabled",get:function(){var t=!!this.instance.get_property(uc),r=!this.instance.config.disable_session_recording;return t&&r}},{key:"isConsoleLogCaptureEnabled",get:function(){var t=!!this.instance.get_property(dd),r=this.instance.config.enable_recording_console_log;return r??t}},{key:"recordingVersion",get:function(){var t,r=this.instance.get_property(fd);return((t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recorderVersion)||r||"v1"}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?gt(this._linkedFlag)&&!this._linkedFlagSeen?"buffering":ac(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?this.startCaptureAndTrySendingQueuedSnapshots():(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1)}},{key:"makeSamplingDecision",value:function(t){var r,n=this.sessionId!==t;if(sr(this._sampleRate)){var i,s=this.isSampled;n||!ac(s)?i=Math.random()<this._sampleRate:i=s,i||j.warn("[SessionSampling] Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(t,") will not be sent to the server.")),(r=this.instance.persistence)===null||r===void 0||r.register(H({},co,i))}else{var o;(o=this.instance.persistence)===null||o===void 0||o.register(H({},co,null))}}},{key:"afterDecideResponse",value:function(t){var r,n,i,s,o,a,l,u=this;this.instance.persistence&&this.instance.persistence.register((H(l={},uc,!!t.sessionRecording),H(l,dd,(o=t.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled),H(l,fd,(a=t.sessionRecording)===null||a===void 0?void 0:a.recorderVersion),l));var c=(r=t.sessionRecording)===null||r===void 0?void 0:r.sampleRate;this._sampleRate=se(c)||Wt(c)?null:parseFloat(c);var h,m=(n=t.sessionRecording)===null||n===void 0?void 0:n.minimumDurationMilliseconds;if(this._minimumDuration=se(m)?null:m,this._linkedFlag=((i=t.sessionRecording)===null||i===void 0?void 0:i.linkedFlag)||null,(s=t.sessionRecording)!==null&&s!==void 0&&s.endpoint&&(this._endpoint=(h=t.sessionRecording)===null||h===void 0?void 0:h.endpoint),sr(this._sampleRate)&&this.sessionManager.onSessionId(function(p){u.makeSamplingDecision(p)}),gt(this._linkedFlag)){var f=this._linkedFlag;this.instance.onFeatureFlags(function(p){u._linkedFlagSeen=p.includes(f)})}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(r=this.instance.sessionRecording)===null||r===void 0||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(t)]}},timestamp:sp()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){this._startCapture()}},{key:"_startCapture",value:function(){var t=this;if(!se(Object.assign)&&!this._captureStarted&&!this.instance.config.disable_session_recording){this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId();var r=this.recordingVersion==="v2"?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.recordingVersion?Hi(this.instance.config.api_host+"/static/".concat(r,"?v=").concat(fn.LIB_VERSION),function(n){if(n)return j.error("Could not load ".concat(r),n);t._onScriptLoaded()}):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(t){var r;return t.type===dp&&wb.indexOf((r=t.data)===null||r===void 0?void 0:r.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(t){var r=this._isInteractiveEvent(t);if(r||this.isIdle||t.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0),r&&(this._lastActivityTimestamp=t.timestamp,this.isIdle&&(this.isIdle=!1,this._tryTakeFullSnapshot())),!this.isIdle){var n=this.sessionManager.checkAndGetSessionAndWindowId(!r,t.timestamp),i=n.windowId,s=n.sessionId,o=this.sessionId!==s,a=this.windowId!==i;this.windowId=i,this.sessionId=s,[vd,mb].indexOf(t.type)===-1&&(a||o)&&this._tryTakeFullSnapshot()}}},{key:"_tryTakeFullSnapshot",value:function(){if(!this._captureStarted)return!1;try{var t;return(t=this.rrwebRecord)===null||t===void 0||t.takeFullSnapshot(),!0}catch(r){return j.error("Error taking full snapshot.",r),!1}}},{key:"_onScriptLoaded",value:function(){var t,r=this,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var i=this.instance.config.session_recording,s=0,o=Object.entries(i||{});s<o.length;s++){var a=ws(o[s],2),l=a[0],u=a[1];l in n&&(n[l]=u)}this.rrwebRecord?(this.mutationRateLimiter=(t=this.mutationRateLimiter)!==null&&t!==void 0?t:new yb(this.rrwebRecord,{onBlockedNode:function(c,h){var m="Too many mutations on node '".concat(c,"'. Rate limiting. This could be due to SVG animations or something similar");j.info(m,{node:h}),r.log("[PostHog Recorder] "+m,"warn")}}),this.stopRrweb=this.rrwebRecord(J({emit:function(c){r.onRRwebEmit(c)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},n)),this.instance._addCaptureHook(function(c){try{if(c==="$pageview"){var h,m=r._maskUrl(window.location.href);if(!m)return;(h=r.rrwebRecord)===null||h===void 0||h.addCustomEvent("$pageview",{href:m})}}catch(f){j.error("Could not add $pageview to rrweb session",f)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1):j.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"onRRwebEmit",value:function(t){if(t&&Rr(t)){if(t.type===fp.Meta){var r=this._maskUrl(t.data.href);if(!r)return;t.data.href=r}var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(t):t;if(n){var i=function(o){var a=o;if(a&&Rr(a)&&a.type===gb&&Rr(a.data)&&a.data.plugin===_b){a.data.payload.payload.length>10&&(a.data.payload.payload=a.data.payload.payload.slice(0,10),a.data.payload.payload.push("...[truncated]"));for(var l=[],u=0;u<a.data.payload.payload.length;u++)a.data.payload.payload[u]&&a.data.payload.payload[u].length>2e3?l.push(a.data.payload.payload[u].slice(0,2e3)+"...[truncated]"):l.push(a.data.payload.payload[u]);return a.data.payload.payload=l,o}return o}(n),s={$snapshot_bytes:JSON.stringify(i).length,$snapshot_data:i,$session_id:this.sessionId,$window_id:this.windowId};this._updateWindowAndSessionIds(i),this.isIdle||(this.status!=="disabled"?this._captureSnapshotBuffered(s):this.clearBuffer())}}}},{key:"_maskUrl",value:function(t){var r=this.instance.config.session_recording;if(r.maskNetworkRequestFn){var n,i={url:t};return(n=i=r.maskNetworkRequestFn(i))===null||n===void 0?void 0:n.url}return t}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var t=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var r=this._minimumDuration,n=this.sessionDuration,i=sr(r)&&sr(n)&&n<r;return this.status==="buffering"||i?(this.flushBufferTimer=setTimeout(function(){t._flushBuffer()},2e3),this.buffer||this.clearBuffer()):this.buffer&&this.buffer.data.length!==0?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(t){var r,n=this,i=2+(((r=this.buffer)===null||r===void 0?void 0:r.data.length)||0);(!this.buffer||this.buffer.size+t.$snapshot_bytes+i>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=t.$snapshot_bytes,this.buffer.data.push(t.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){n._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(t){this.instance.capture("$snapshot",t,{transport:"XHR",method:"POST",endpoint:this._endpoint,_noTruncate:!0,_batchKey:"recordings",_metrics:{rrweb_full_snapshot:t.$snapshot_data.type===vd}})}}]),e}(),Rt={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},Sb=["first-input","navigation","paint","resource"],Eb=["/s/","/e/"],kb=function(){function e(t){Me(this,e),H(this,"_forceAllowLocalhost",!1),this.instance=t}return Ie(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var t,r,n=this;if(!this.observer)if(se((t=window)===null||t===void 0||(r=t.PerformanceObserver)===null||r===void 0?void 0:r.supportedEntryTypes))j.info("[PerformanceObserver] not started because PerformanceObserver is not supported by this browser.");else if(!fb.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver(function(s){s.getEntries().forEach(function(o){n._capturePerformanceEvent(o)})});var i=PerformanceObserver.supportedEntryTypes.filter(function(s){return Sb.includes(s)});i.forEach(function(s){var o;(o=n.observer)===null||o===void 0||o.observe({type:s,buffered:!0})})}catch(s){j.error("PostHog failed to start performance observer",s),this.stopObserving()}else j.info("[PerformanceObserver] not started because we are on localhost.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var t,r;return(t=(r=this.instance.config.capture_performance)!==null&&r!==void 0?r:this.remoteEnabled)!==null&&t!==void 0&&t}},{key:"afterDecideResponse",value:function(t){this.remoteEnabled=t.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(t){if(t.name.indexOf(this.instance.config.api_host)===0){var r=t.name.replace(this.instance.config.api_host,"");if(Eb.find(function(f){return r.indexOf(f)===0}))return}var n={url:t.name},i=this.instance.config.session_recording;if(i.maskNetworkRequestFn&&(n=i.maskNetworkRequestFn(n)),n){var s=t.toJSON();s.name=n.url;var o={},a=Math.floor(Date.now()-performance.now());for(var l in o[Rt.timeOrigin]=a,o[Rt.timestamp]=Math.floor(a+t.startTime),Rt)se(s[l])||(o[Rt[l]]=s[l]);if(this.capturePerformanceEvent(o),Tb(t)){var u,c=dn(t.serverTiming||[]);try{for(c.s();!(u=c.n()).done;){var h,m=u.value;this.capturePerformanceEvent((H(h={},Rt.timeOrigin,a),H(h,Rt.timestamp,Math.floor(a+t.startTime)),H(h,Rt.name,m.name),H(h,Rt.duration,m.duration),H(h,Rt.entryType,"serverTiming"),h))}}catch(f){c.e(f)}finally{c.f()}}}}},{key:"capturePerformanceEvent",value:function(t){var r,n=t[Rt.timestamp];(r=this.instance.sessionRecording)===null||r===void 0||r.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:t},timestamp:n})}}]),e}(),Tb=function(e){return e.entryType==="navigation"||e.entryType==="resource"},Cb=function(){function e(t){Me(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return Ie(e,[{key:"call",value:function(){var t=this,r=qc(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Rn),group_properties:this.instance.get_property(wr),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0}));this.instance._send_request("".concat(this.instance.config.api_host,"/decide/?v=3"),{data:r,verbose:!0},{method:"POST"},function(n){return t.parseDecideResponse(n)})}},{key:"parseDecideResponse",value:function(t){var r,n,i,s,o=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),(t==null?void 0:t.status)!==0){if(!document||!document.body)return j.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){o.parseDecideResponse(t)},500);this.instance.toolbar.afterDecideResponse(t),(r=this.instance.sessionRecording)===null||r===void 0||r.afterDecideResponse(t),xr.afterDecideResponse(t,this.instance),(n=this.instance.webPerformance)===null||n===void 0||n.afterDecideResponse(t),this.instance._afterDecideResponse(t),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.featureFlags.receivedFeatureFlags(t);var a=(i=window)===null||i===void 0?void 0:i.extendPostHogWithSurveys;t.surveys&&!a&&Hi(this.instance.config.api_host+"/static/surveys.js",function(f){if(f)return j.error("Could not load surveys script",f);window.extendPostHogWithSurveys(o.instance)});var l=(s=window)===null||s===void 0?void 0:s.extendPostHogWithExceptionAutoCapture;if(t.autocaptureExceptions&&t.autocaptureExceptions&&se(l)&&Hi(this.instance.config.api_host+"/static/exception-autocapture.js",function(f){if(f)return j.error("Could not load exception autocapture script",f);window.extendPostHogWithExceptionAutocapture(o.instance,t)}),t.siteApps)if(this.instance.config.opt_in_site_apps){var u,c=this.instance.config.api_host,h=dn(t.siteApps);try{var m=function(){var f=u.value,p=f.id,v=f.url,x=[c,c[c.length-1]==="/"&&v[0]==="/"?v.substring(1):v].join("");window["__$$ph_site_app_".concat(p)]=o.instance,Hi(x,function(S){S&&j.error("Error while initializing PostHog app with config id ".concat(p),S)})};for(h.s();!(u=h.n()).done;)m()}catch(f){h.e(f)}finally{h.f()}}else t.siteApps.length>0&&j.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else j.error("Failed to fetch feature flags from PostHog.")}}]),e}(),Pb=["https://app.posthog.com","https://eu.posthog.com"],Ab=["source"],Ob=U.location?$o(U.location.hash,"__posthog")||$o(location.hash,"state"):null,Mb=function(){function e(t){Me(this,e),this.instance=t}return Ie(e,[{key:"afterDecideResponse",value:function(t){var r=t.toolbarParams||t.editorParams||(t.toolbarVersion?{toolbarVersion:t.toolbarVersion}:{});t.isAuthenticated&&r.toolbarVersion&&r.toolbarVersion.indexOf("toolbar")===0&&this.loadToolbar(J({},r))}},{key:"maybeLoadToolbar",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U.location,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:U.history;try{if(!r){try{U.localStorage.setItem("test","test"),U.localStorage.removeItem("test")}catch{return!1}r=U.localStorage}var i,s=Ob||$o(t.hash,"__posthog")||$o(t.hash,"state"),o=s?od(function(){return JSON.parse(atob(decodeURIComponent(s)))})||od(function(){return JSON.parse(decodeURIComponent(s))}):null;return o&&o.action==="ph_authorize"?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:n?n.replaceState("",document.title,t.pathname+t.search):t.hash="")):((i=JSON.parse(r.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}},{key:"loadToolbar",value:function(t){var r=this;if(U._postHogToolbarLoaded)return!1;U._postHogToolbarLoaded=!0;var n=this.instance.config.api_host,i=3e5,s=Math.floor(Date.now()/i)*i,o="".concat(n).concat(n.endsWith("/")?"":"/","static/toolbar.js?t=").concat(s),a=!Pb.includes(this.instance.config.api_host)&&this.instance.config.advanced_disable_toolbar_metrics,l=J(J({token:this.instance.config.token},t),{},{apiURL:n},a?{instrument:!1}:{});l.source;var u=Y0(l,Ab);return U.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),Hi(o,function(c){c?j.error("Failed to load toolbar",c):(U.ph_load_toolbar||U.ph_load_editor)(l,r.instance)}),Bi(U,"turbolinks:load",function(){U._postHogToolbarLoaded=!1,r.loadToolbar(l)}),!0}},{key:"_loadEditor",value:function(t){return this.loadToolbar(t)}},{key:"maybeLoadEditor",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U.location,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:U.history;return this.maybeLoadToolbar(t,r,n)}}]),e}(),Ib="__ph_opt_in_out_";function $b(e,t){pp(!0,e,t)}function Fb(e,t){pp(!1,e,t)}function Rb(e,t){return hp(e,t)==="1"}function _d(e,t){return!!function(r){if(r&&r.respectDnt){var n=r&&r.window||U,i=n.navigator||{},s=!1;return be([i.doNotTrack,i.msDoNotTrack,n.doNotTrack],function(o){de([!0,1,"1","yes"],o)&&(s=!0)}),s}return!1}(t)||hp(e,t)==="0"}function jb(e,t){Vc(t=t||{}).remove(Qc(e,t),!!t.crossSubdomainCookie)}function Vc(e){return(e=e||{}).persistenceType==="localStorage"?Ae:e.persistenceType==="localStorage+cookie"?mc:cr}function Qc(e,t){return((t=t||{}).persistencePrefix||Ib)+e}function hp(e,t){return Vc(t).get(Qc(e,t))}function pp(e,t,r){gt(t)&&t.length?(Vc(r=r||{}).set(Qc(t,r),e?1:0,sr(r.cookieExpiration)?r.cookieExpiration:null,r.crossSubdomainCookie,r.secureCookie),r.capture&&e&&r.capture(r.captureEventName||"$opt_in",r.captureProperties||{},{send_instantly:!0})):j.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}var mp=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3e3;Me(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return Ie(e,[{key:"setPollInterval",value:function(t){this._pollInterval=t,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return new Date().getTime()}}]),e}(),Nb=function(e){ep(r,mp);var t=tp(r);function r(n){var i,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e3;return Me(this,r),(i=t.call(this,s)).handlePollRequest=n,i}return Ie(r,[{key:"enqueue",value:function(n,i,s){this._event_queue.push({url:n,data:i,options:s}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var n=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(n._event_queue.length>0){var i=n.formatQueue(),s=function(a){var l=i[a],u=l.url,c=l.data,h=l.options;be(c,function(m,f){c[f].offset=Math.abs(c[f].timestamp-n.getTime()),delete c[f].timestamp}),n.handlePollRequest(u,c,h)};for(var o in i)s(o);n._event_queue.length=0,n._empty_queue_count=0}else n._empty_queue_count++;n._empty_queue_count>4&&(n.isPolling=!1,n._empty_queue_count=0),n.isPolling&&n.poll()},this._pollInterval)}},{key:"unload",value:function(){var n=this;clearTimeout(this._poller);var i=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var s=Object.values(i);[].concat(sc(s.filter(function(o){return o.url.indexOf("/e")===0})),sc(s.filter(function(o){return o.url.indexOf("/e")!==0}))).map(function(o){var a=o.url,l=o.data,u=o.options;n.handlePollRequest(a,l,J(J({},u),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var n={};return be(this._event_queue,function(i){var s=i.url,o=i.data,a=i.options,l=(a?a._batchKey:null)||s;se(n[l])&&(n[l]={data:[],url:s,options:a}),a&&n[l].options&&n[l].options._metrics&&!n[l].options._metrics.rrweb_full_snapshot&&(n[l].options._metrics.rrweb_full_snapshot=a._metrics.rrweb_full_snapshot),n[l].data.push(o)}),n}}]),r}(),vt=Uint8Array,ot=Uint16Array,di=Uint32Array,Wc=new vt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Xc=new vt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),yd=new vt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gp=function(e,t){for(var r=new ot(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new di(r[30]);for(n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)i[s]=s-r[n]<<5|n;return[r,i]},vp=gp(Wc,2),Lb=vp[0],gc=vp[1];Lb[28]=258,gc[258]=28;for(var bd=gp(Xc,0)[1],vc=new ot(32768),ke=0;ke<32768;++ke){var Qr=(43690&ke)>>>1|(21845&ke)<<1;Qr=(61680&(Qr=(52428&Qr)>>>2|(13107&Qr)<<2))>>>4|(3855&Qr)<<4,vc[ke]=((65280&Qr)>>>8|(255&Qr)<<8)>>>1}var Ui=function(e,t,r){for(var n=e.length,i=0,s=new ot(t);i<n;++i)++s[e[i]-1];var o,a=new ot(t);for(i=0;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;if(r){o=new ot(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],h=a[e[i]-1]++<<c,m=h|(1<<c)-1;h<=m;++h)o[vc[h]>>>l]=u}else for(o=new ot(n),i=0;i<n;++i)o[i]=vc[a[e[i]-1]++]>>>15-e[i];return o},pn=new vt(288);for(ke=0;ke<144;++ke)pn[ke]=8;for(ke=144;ke<256;++ke)pn[ke]=9;for(ke=256;ke<280;++ke)pn[ke]=7;for(ke=280;ke<288;++ke)pn[ke]=8;var Fo=new vt(32);for(ke=0;ke<32;++ke)Fo[ke]=5;var Xr,Db=Ui(pn,9,0),Bb=Ui(Fo,5,0),_p=function(e){return(e/8>>0)+(7&e&&1)},yp=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof ot?ot:e instanceof di?di:vt)(r-t);return n.set(e.subarray(t,r)),n},tr=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Ri=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},al=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,s=r.slice();if(!i)return[new vt(0),0];if(i==1){var o=new vt(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort(function(y,O){return y.f-O.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=r[r[u].f<r[h].f?u++:h++],l=r[u!=c&&r[u].f<r[h].f?u++:h++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var m=s[0].s;for(n=1;n<i;++n)s[n].s>m&&(m=s[n].s);var f=new ot(m+1),p=Hb(r[c-1],f,0);if(p>t){n=0;var v=0,x=p-t,S=1<<x;for(s.sort(function(y,O){return f[O.s]-f[y.s]||y.f-O.f});n<i;++n){var k=s[n].s;if(!(f[k]>t))break;v+=S-(1<<p-f[k]),f[k]=t}for(v>>>=x;v>0;){var T=s[n].s;f[T]<t?v-=1<<t-f[T]++-1:++n}for(;n>=0&&v;--n){var P=s[n].s;f[P]==t&&(--f[P],++v)}p=t}return[new vt(f),p]},Hb=function e(t,r,n){return t.s==-1?Math.max(e(t.l,r,n+1),e(t.r,r,n+1)):r[t.s]=n},wd=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ot(++t),n=0,i=e[0],s=1,o=function(l){r[n++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[r.subarray(0,n),t]},ji=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},uo=function(e,t,r){var n=r.length,i=_p(t+2);e[i]=255&n,e[i+1]=n>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;s<n;++s)e[i+s+4]=r[s];return 8*(i+4+n)},xd=function(e,t,r,n,i,s,o,a,l,u,c){tr(t,c++,r),++i[256];for(var h=al(i,15),m=h[0],f=h[1],p=al(s,15),v=p[0],x=p[1],S=wd(m),k=S[0],T=S[1],P=wd(v),y=P[0],O=P[1],M=new ot(19),E=0;E<k.length;++E)M[31&k[E]]++;for(E=0;E<y.length;++E)M[31&y[E]]++;for(var I=al(M,7),R=I[0],N=I[1],z=19;z>4&&!R[yd[z-1]];--z);var Y,q,ae,ge,Se=u+5<<3,ve=ji(i,pn)+ji(s,Fo)+o,ye=ji(i,m)+ji(s,v)+o+14+3*z+ji(M,R)+(2*M[16]+3*M[17]+7*M[18]);if(Se<=ve&&Se<=ye)return uo(t,c,e.subarray(l,l+u));if(tr(t,c,1+(ye<ve)),c+=2,ye<ve){Y=Ui(m,f,0),q=m,ae=Ui(v,x,0),ge=v;var V=Ui(R,N,0);for(tr(t,c,T-257),tr(t,c+5,O-1),tr(t,c+10,z-4),c+=14,E=0;E<z;++E)tr(t,c+3*E,R[yd[E]]);c+=3*z;for(var Z=[k,y],ce=0;ce<2;++ce){var ue=Z[ce];for(E=0;E<ue.length;++E){var Te=31&ue[E];tr(t,c,V[Te]),c+=R[Te],Te>15&&(tr(t,c,ue[E]>>>5&127),c+=ue[E]>>>12)}}}else Y=Db,q=pn,ae=Bb,ge=Fo;for(E=0;E<a;++E)if(n[E]>255){Te=n[E]>>>18&31,Ri(t,c,Y[Te+257]),c+=q[Te+257],Te>7&&(tr(t,c,n[E]>>>23&31),c+=Wc[Te]);var ee=31&n[E];Ri(t,c,ae[ee]),c+=ge[ee],ee>3&&(Ri(t,c,n[E]>>>5&8191),c+=Xc[ee])}else Ri(t,c,Y[n[E]]),c+=q[n[E]];return Ri(t,c,Y[256]),c+q[256]},Ub=new di([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Gb=new vt(0),zb=function(){for(var e=new di(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),qb=function(){var e=4294967295;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=zb[255&r^t[n]]^r>>>8;e=r},d:function(){return 4294967295^e}}},Vb=function(e,t,r,n,i){return function(s,o,a,l,u,c){var h=s.length,m=new vt(l+h+5*(1+Math.floor(h/7e3))+u),f=m.subarray(l,m.length-u),p=0;if(!o||h<8)for(var v=0;v<=h;v+=65535){var x=v+65535;x<h?p=uo(f,p,s.subarray(v,x)):(f[v]=c,p=uo(f,p,s.subarray(v,h)))}else{for(var S=Ub[o-1],k=S>>>13,T=8191&S,P=(1<<a)-1,y=new ot(32768),O=new ot(P+1),M=Math.ceil(a/3),E=2*M,I=function(pr){return(s[pr]^s[pr+1]<<M^s[pr+2]<<E)&P},R=new di(25e3),N=new ot(288),z=new ot(32),Y=0,q=0,ae=(v=0,0),ge=0,Se=0;v<h;++v){var ve=I(v),ye=32767&v,V=O[ve];if(y[ye]=V,O[ve]=ye,ge<=v){var Z=h-v;if((Y>7e3||ae>24576)&&Z>423){p=xd(s,f,0,R,N,z,q,ae,Se,v-Se,p),ae=Y=q=0,Se=v;for(var ce=0;ce<286;++ce)N[ce]=0;for(ce=0;ce<30;++ce)z[ce]=0}var ue=2,Te=0,ee=T,Ke=ye-V&32767;if(Z>2&&ve==I(v-Ke))for(var Nr=Math.min(k,Z)-1,Ze=Math.min(32767,v),fr=Math.min(258,Z);Ke<=Ze&&--ee&&ye!=V;){if(s[v+ue]==s[v+ue-Ke]){for(var et=0;et<fr&&s[v+et]==s[v+et-Ke];++et);if(et>ue){if(ue=et,Te=Ke,et>Nr)break;var Xt=Math.min(Ke,et-2),D=0;for(ce=0;ce<Xt;++ce){var _t=v-Ke+ce+32768&32767,pt=_t-y[_t]+32768&32767;pt>D&&(D=pt,V=_t)}}}Ke+=(ye=V)-(V=y[ye])+32768&32767}if(Te){R[ae++]=268435456|gc[ue]<<18|bd[Te];var Ot=31&gc[ue],hr=31&bd[Te];q+=Wc[Ot]+Xc[hr],++N[257+Ot],++z[hr],ge=v+ue,++Y}else R[ae++]=s[v],++N[s[v]]}}p=xd(s,f,c,R,N,z,q,ae,Se,v-Se,p),c||(p=uo(f,p,Gb))}return yp(m,0,l+_p(p)+u)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!i)},_c=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Qb=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&_c(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}},Wb=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Xb(e,t){t===void 0&&(t={});var r=qb(),n=e.length;r.p(e);var i=Vb(e,t,Wb(t),8),s=i.length;return Qb(i,t),_c(i,s-8,r.d()),_c(i,s-4,n),i}function Yb(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new vt(e.length+(e.length>>>1)),i=0,s=function(u){n[i++]=u},o=0;o<r;++o){if(i+5>n.length){var a=new vt(i+8+(r-o<<1));a.set(n),n=a}var l=e.charCodeAt(o);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return yp(n,0,i)}(function(e){e.GZipJS="gzip-js",e.Base64="base64"})(Xr||(Xr={}));var bp=function(e,t,r){var n=t||{};n.ip=r.ip?1:0,n._=new Date().getTime().toString(),n.ver=fn.LIB_VERSION;var i=e.split("?");if(i.length>1){var s,o=dn(i[1].split("&"));try{for(o.s();!(s=o.n()).done;){var a=s.value.split("=")[0];se(n[a])||delete n[a]}}catch(u){o.e(u)}finally{o.f()}}var l=e.indexOf("?")>-1?"&":"?";return e+l+function(u){var c,h,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",f=[];return be(u,function(p,v){se(p)||se(v)||v==="undefined"||(c=encodeURIComponent(p.toString()),h=encodeURIComponent(v),f[f.length]=h+"="+c)}),f.join(m)}(n)},Yc=function e(t,r){if(r.blob&&t.buffer)return new Blob([rd(t)?t:t.buffer],{type:"text/plain"});if(r.sendBeacon||r.blob){var n=e(t,{method:"POST"});return new Blob([n],{type:"application/x-www-form-urlencoded"})}return r.method!=="POST"?null:(i=Ge(t)||rd(t)?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i);var i},wp=function(e){var t=e.url,r=e.data,n=e.headers,i=e.options,s=e.callback,o=e.retriesPerformedSoFar,a=e.retryQueue,l=e.onXHRError,u=e.timeout,c=u===void 0?6e4:u,h=e.onResponse;sr(o)&&o>0&&(t=bp(t,{retry_count:o},{}));var m=new XMLHttpRequest;m.open(i.method||"GET",t,!0);var f=Yc(r,i);be(n,function(p,v){m.setRequestHeader(v,p)}),i.method!=="POST"||i.blob||m.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),m.timeout=c,m.withCredentials=!0,m.onreadystatechange=function(){if(m.readyState===4)if(h==null||h(m),m.status===200){if(s){var p;try{p=JSON.parse(m.responseText)}catch(v){return void j.error(v)}s(p)}}else hn(l)&&l(m),(m.status<400||m.status>500)&&a.enqueue({url:t,data:r,options:i,headers:n,retriesPerformedSoFar:(o||0)+1,callback:s}),s==null||s({status:0})},m.send(f)},Jb=18e5,Kb=function(e){ep(r,mp);var t=tp(r);function r(n,i){var s;return Me(this,r),(s=t.call(this)).isPolling=!1,s.queue=[],s.areWeOnline=!0,s.onXHRError=n,s.rateLimiter=i,!se(window)&&"onLine"in window.navigator&&(s.areWeOnline=window.navigator.onLine,window.addEventListener("online",function(){s._handleWeAreNowOnline()}),window.addEventListener("offline",function(){s.areWeOnline=!1})),s}return Ie(r,[{key:"enqueue",value:function(n){var i=n.retriesPerformedSoFar||0;if(!(i>=10)){var s=function(l){var u=3e3*Math.pow(2,l),c=u/2,h=Math.min(Jb,u),m=(Math.random()-.5)*(h-c);return Math.ceil(h+m)}(i),o=new Date(Date.now()+s);this.queue.push({retryAt:o,requestData:n});var a="Enqueued failed request for retry in ".concat(s);navigator.onLine||(a+=" (Browser is offline)"),j.warn(a),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var n=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){n.areWeOnline&&n.queue.length>0&&n.flush(),n.poll()},this._pollInterval)}},{key:"flush",value:function(){var n=new Date(Date.now()),i=this.queue.filter(function(l){return l.retryAt<n});if(i.length>0){this.queue=this.queue.filter(function(l){return l.retryAt>=n});var s,o=dn(i);try{for(o.s();!(s=o.n()).done;){var a=s.value.requestData;this._executeXhrRequest(a)}}catch(l){o.e(l)}finally{o.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var n,i=dn(this.queue);try{for(i.s();!(n=i.n()).done;){var s=n.value.requestData,o=s.url,a=s.data,l=s.options;if(this.rateLimiter.isRateLimited(l._batchKey))j.warn("[RetryQueue] is quota limited. Dropping request.");else try{window.navigator.sendBeacon(o,Yc(a,J(J({},l),{},{sendBeacon:!0})))}catch(u){j.error(u)}}}catch(u){i.e(u)}finally{i.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(n){var i=n.url,s=n.data,o=n.options,a=n.headers,l=n.callback,u=n.retriesPerformedSoFar;this.rateLimiter.isRateLimited(o._batchKey)||wp({url:i,data:s||{},options:o||{},headers:a||{},retriesPerformedSoFar:u||0,callback:l,retryQueue:this,onXHRError:this.onXHRError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),r}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return sr(e)&&isFinite(e)&&Math.floor(e)===e});var Sd="0123456789abcdef",Zb=function(){function e(t){if(Me(this,e),this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}return Ie(e,[{key:"toString",value:function(){for(var t="",r=0;r<this.bytes.length;r++)t=t+Sd.charAt(this.bytes[r]>>>4)+Sd.charAt(15&this.bytes[r]),r!==3&&r!==5&&r!==7&&r!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(t){return this.compareTo(t)===0}},{key:"compareTo",value:function(t){for(var r=0;r<16;r++){var n=this.bytes[r]-t.bytes[r];if(n!==0)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,r,n,i){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(i)||t<0||r<0||n<0||i<0||t>0xffffffffffff||r>4095||n>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|r>>>8,s[7]=r,s[8]=128|n>>>24,s[9]=n>>>16,s[10]=n>>>8,s[11]=n,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new e(s)}}]),e}(),ew=function(){function e(){Me(this,e),H(this,"timestamp",0),H(this,"counter",0),H(this,"random",new tw)}return Ie(e,[{key:"generate",value:function(){var t=this.generateOrAbort();if(se(t)){this.timestamp=0;var r=this.generateOrAbort();if(se(r))throw new Error("Could not generate UUID after timestamp reset");return r}return t}},{key:"generateOrAbort",value:function(){var t=Date.now();if(t>this.timestamp)this.timestamp=t,this.resetCounter();else{if(!(t+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Zb.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),xp=function(e){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};!se(U.crypto)&&crypto.getRandomValues&&(xp=function(e){return crypto.getRandomValues(e)});var Ed,tw=function(){function e(){Me(this,e),H(this,"buffer",new Uint32Array(8)),H(this,"cursor",1/0)}return Ie(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(xp(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),jn=function(){return rw().toString()},rw=function(){return(Ed||(Ed=new ew)).generate()},Ws=1800,kd=60,nw=864e5,iw=function(){function e(t,r,n,i){Me(this,e),H(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=r,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||jn,this._windowIdGenerator=i||jn;var s=t.persistence_name||t.token,o=t.session_idle_timeout_seconds||Ws;if(sr(o)?o>Ws?j.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):o<kd&&j.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(j.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),o=Ws),this._sessionTimeoutMs=1e3*Math.min(Math.max(o,kd),Ws),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var a=Ue.parse(this._window_id_storage_key),l=Ue.parse(this._primary_window_exists_storage_key);a&&!l?this._windowId=a:Ue.remove(this._window_id_storage_key),Ue.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return Ie(e,[{key:"onSessionId",value:function(t){var r=this;return se(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(t),this._sessionId&&t(this._sessionId,this._windowId),function(){r._sessionIdChangedHandlers=r._sessionIdChangedHandlers.filter(function(n){return n!==t})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Ue.is_supported()}},{key:"_setWindowId",value:function(t){t!==this._windowId&&(this._windowId=t,this._canUseSessionStorage()&&Ue.set(this._window_id_storage_key,t))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ue.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(t,r,n){t===this._sessionId&&r===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=r,this._sessionId=t,this.persistence.register(H({},Mo,[r,t,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var t=this.persistence.props[Mo];return Ge(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var t=this;U.addEventListener("beforeunload",function(){t._canUseSessionStorage()&&Ue.remove(t._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),n=ws(this._getSessionId(),3),i=n[0],s=n[1],o=n[2],a=this._getWindowId(),l=o&&o>0&&Math.abs(r-o)>nw,u=!1,c=!s,h=!t&&Math.abs(r-i)>this._sessionTimeoutMs;c||h||l?(s=this._sessionIdGenerator(),a=this._windowIdGenerator(),o=r,u=!0):a||(a=this._windowIdGenerator(),u=!0);var m=i===0||!t||l?r:i,f=o===0?new Date().getTime():o;return this._setWindowId(a),this._setSessionId(s,m,f),u&&this._sessionIdChangedHandlers.forEach(function(p){return p(s,a)}),{sessionId:s,windowId:a,sessionStartTimestamp:f}}}]),e}(),sw=Ie(function e(t,r,n,i){Me(this,e),this.name="posthog-js",this.setupOnce=function(s){s(function(o){var a,l,u,c,h;if(o.level!=="error"||!t.__loaded)return o;o.tags||(o.tags={});var m=t.config.ui_host||t.config.api_host;o.tags["PostHog Person URL"]=m+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=((a=o.exception)===null||a===void 0?void 0:a.values)||[],p={$exception_message:(l=f[0])===null||l===void 0?void 0:l.value,$exception_type:(u=f[0])===null||u===void 0?void 0:u.type,$exception_personURL:m+"/person/"+t.get_distinct_id(),$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(c=f[0])===null||c===void 0?void 0:c.value,$sentry_exception_type:(h=f[0])===null||h===void 0?void 0:h.type,$sentry_tags:o.tags};return r&&n&&(p.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+o.event_id),t.capture("$exception",p),o})}}),ow=function(e){Promise&&Promise.resolve||j.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(r,n){r.event.userId||r.event.anonymousId===e.get_distinct_id()||e.reset(),r.event.userId&&r.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:r.event.userId}),e.reloadFeatureFlags());var i=e._calculate_event_properties(n,r.event.properties);return r.event.properties=Object.assign({},i,r.event.properties),r};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(r){return t(r,r.event.event)},page:function(r){return t(r,"$pageview")},identify:function(r){return t(r,"$identify")},screen:function(r){return t(r,"$screen")}}},aw=function(){function e(){var t=this;Me(this,e),H(this,"_hasSeenPageView",!1),H(this,"_updateScrollData",function(){var r,n,i,s;t._pageViewData||(t._pageViewData=t._createPageViewData());var o=t._pageViewData,a=t._scrollY(),l=t._scrollHeight(),u=t._contentY(),c=t._contentHeight();o.lastScrollY=a,o.maxScrollY=Math.max(a,(r=o.maxScrollY)!==null&&r!==void 0?r:0),o.maxScrollHeight=Math.max(l,(n=o.maxScrollHeight)!==null&&n!==void 0?n:0),o.lastContentY=u,o.maxContentY=Math.max(u,(i=o.maxContentY)!==null&&i!==void 0?i:0),o.maxContentHeight=Math.max(c,(s=o.maxContentHeight)!==null&&s!==void 0?s:0)})}return Ie(e,[{key:"_createPageViewData",value:function(){return{pathname:U.location.pathname}}},{key:"doPageView",value:function(){var t,r;return this._hasSeenPageView?(r=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,r=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),J({$prev_pageview_pathname:(t=r)===null||t===void 0?void 0:t.pathname},this._calculatePrevPageScrollProperties(r))}},{key:"doPageLeave",value:function(){var t=this._pageViewData;return J({$prev_pageview_pathname:t==null?void 0:t.pathname},this._calculatePrevPageScrollProperties(t))}},{key:"_calculatePrevPageScrollProperties",value:function(t){if(!t||t.maxScrollHeight==null||t.lastScrollY==null||t.maxScrollY==null||t.maxContentHeight==null||t.lastContentY==null||t.maxContentY==null)return{};var r=t.maxScrollHeight,n=t.lastScrollY,i=t.maxScrollY,s=t.maxContentHeight,o=t.lastContentY,a=t.maxContentY;return r=Math.ceil(r),n=Math.ceil(n),i=Math.ceil(i),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),{$prev_pageview_last_scroll:n,$prev_pageview_last_scroll_percentage:r<=1?1:Xs(n/r,0,1),$prev_pageview_max_scroll:i,$prev_pageview_max_scroll_percentage:r<=1?1:Xs(i/r,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:s<=1?1:Xs(o/s,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:s<=1?1:Xs(a/s,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){U.addEventListener("scroll",this._updateScrollData),U.addEventListener("scrollend",this._updateScrollData),U.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){U.removeEventListener("scroll",this._updateScrollData),U.removeEventListener("scrollend",this._updateScrollData),U.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollHeight",value:function(){return Math.max(0,U.document.documentElement.scrollHeight-U.document.documentElement.clientHeight)}},{key:"_scrollY",value:function(){return U.scrollY||U.pageYOffset||U.document.documentElement.scrollTop||0}},{key:"_contentHeight",value:function(){return U.document.documentElement.scrollHeight||0}},{key:"_contentY",value:function(){var t=U.document.documentElement.clientHeight||0;return this._scrollY()+t}}]),e}();function Xs(e,t,r){return Math.max(t,Math.min(e,r))}var Yi,Jc,He,lw={icontains:function(e){return window.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},regex:function(e){return hb(window.location.href,e)},exact:function(e){return window.location.href===e}},cw=function(){function e(t){Me(this,e),this.instance=t}return Ie(e,[{key:"getSurveys",value:function(t){var r=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(fc);if(i&&!n)return t(i);this.instance._send_request("".concat(this.instance.config.api_host,"/api/surveys/?token=").concat(this.instance.config.token),{},{method:"GET"},function(s){var o,a=s.surveys||[];return(o=r.instance.persistence)===null||o===void 0||o.register(H({},fc,a)),t(a)})}},{key:"getActiveMatchingSurveys",value:function(t){var r=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(i){var s=i.filter(function(o){return!(!o.start_date||o.end_date)}).filter(function(o){var a,l,u,c;if(!o.conditions)return!0;var h=(a=o.conditions)===null||a===void 0||!a.url||lw[(l=(u=o.conditions)===null||u===void 0?void 0:u.urlMatchType)!==null&&l!==void 0?l:"icontains"](o.conditions.url),m=(c=o.conditions)===null||c===void 0||!c.selector||document.querySelector(o.conditions.selector);return h&&m}).filter(function(o){if(!o.linked_flag_key&&!o.targeting_flag_key)return!0;var a=!o.linked_flag_key||r.instance.featureFlags.isFeatureEnabled(o.linked_flag_key),l=!o.targeting_flag_key||r.instance.featureFlags.isFeatureEnabled(o.targeting_flag_key);return a&&l});return t(s)},n)}}]),e}(),uw=6e4,dw=function(){function e(){var t=this;Me(this,e),H(this,"limits",{}),H(this,"checkForLimiting",function(r){try{var n=r.responseText;if(!n||!n.length)return;(JSON.parse(n).quota_limited||[]).forEach(function(i){j.info("[RateLimiter] ".concat(i||"events"," is quota limited.")),t.limits[i]=new Date().getTime()+uw})}catch(i){return void j.error(i)}})}return Ie(e,[{key:"isRateLimited",value:function(t){var r=this.limits[t||"events"]||!1;return r!==!1&&new Date().getTime()<r}}]),e}();(function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"})(Yi||(Yi={}));var yc=function(){},Ys={},ht="posthog",fo=U.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Sp=!fo&&dt.indexOf("MSIE")===-1&&dt.indexOf("Mozilla")===-1,Td=function(){var e,t,r;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=Ce==null?void 0:Ce.location,r=t==null?void 0:t.hostname,!!gt(r)&&r.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:yc,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:(U==null||(e=U.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(n){var i="Bad HTTP status: "+n.status+" "+n.statusText;j.error(i)},get_device_id:function(n){return n},_onCapture:yc,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},bc=function(e,t,r,n){var i,s=r!==ht&&He?r?He[r]:void 0:He,o={initComplete:!1,syncCode:!1},a=function(l){return function(u){o[l]||(o[l]=!0,o.initComplete&&o.syncCode&&(n==null||n(u)))}};if(s&&Jc===Yi.INIT_MODULE)i=s;else{if(s&&!Ge(s))return void j.error("You have already initialized "+r);i=new Kc}return i._init(e,t,r,a("initComplete")),i.toolbar.maybeLoadToolbar(),i.sessionRecording=new xb(i),i.sessionRecording.startRecordingIfEnabled(),i.webPerformance=new kb(i),i.webPerformance.startObservingIfEnabled(),i.config.__preview_measure_pageview_stats&&i.pageViewManager.startMeasuringScrollPosition(),i.__autocapture=i.config.autocapture,xr._setIsAutocaptureEnabled(i),xr._isAutocaptureEnabled&&(i.__autocapture=i.config.autocapture,xr.enabledForProject(i.config.token,100,100)?xr.isBrowserSupported()?xr.init(i):(i.__autocapture=!1,j.info("Disabling Automatic Event Collection because this browser is not supported")):(i.__autocapture=!1,j.info("Not in active bucket: disabling Automatic Event Collection."))),fn.DEBUG=fn.DEBUG||i.config.debug,!se(s)&&Ge(s)&&(i._execute_array.call(i.people,s.people),i._execute_array(s)),a("syncCode")(i),i},Kc=function(){function e(){var t=this;Me(this,e),this.config=Td(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=sw,this.segmentIntegration=function(){return ow(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.analyticsDefaultEndpoint="/e/",this.featureFlags=new lb(this),this.toolbar=new Mb(this),this.pageViewManager=new aw,this.surveys=new cw(this),this.rateLimiter=new dw,this.people={set:function(r,n,i){var s=gt(r)?H({},r,n):r;t.setPersonProperties(s),i==null||i({})},set_once:function(r,n,i){var s=gt(r)?H({},r,n):r;t.setPersonProperties(void 0,s),i==null||i({})}}}return Ie(e,[{key:"init",value:function(t,r,n){if(se(n))j.critical("You must name your new library: init(token, config, name)");else{if(n!==ht){var i=bc(t,r,n,function(s){He[n]=s,s._loaded()});return He[n]=i,i}j.critical("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(t){var r,n,i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var l,u={segmentRegister:!1,syncCode:!1},c=function(P){return function(){u[P]||(u[P]=!0,u.segmentRegister&&u.syncCode&&(a==null||a(i)))}};if(this.set_config(Xe({},Td(),s,{name:o,token:t,callback_fn:(o===ht?o:ht+"."+o)+"._jsc"})),this._jsc=function(){},(U!=null&&(r=U.rrweb)!==null&&r!==void 0&&r.record||U!=null&&U.rrwebRecord)&&(this.__loaded_recorder_version=U==null||(l=U.rrweb)===null||l===void 0?void 0:l.version),this.persistence=new gd(this.config),this._requestQueue=new Nb(this._handle_queued_event.bind(this)),this._retryQueue=new Kb(this.config.on_xhr_error,this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new iw(this.config,this.persistence),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new gd(J(J({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),s.segment?(this.config.get_device_id=function(){return s.segment.user().anonymousId()},s.segment.user().id()&&(this.register({distinct_id:s.segment.user().id()}),this.persistence.set_user_state("identified")),s.segment.register(this.segmentIntegration()).then(c("segmentRegister"))):c("segmentRegister")(),((n=s.bootstrap)===null||n===void 0?void 0:n.distinctID)!==void 0){var h,m,f=this.config.get_device_id(jn()),p=(h=s.bootstrap)!==null&&h!==void 0&&h.isIdentifiedID?f:s.bootstrap.distinctID;this.persistence.set_user_state((m=s.bootstrap)!==null&&m!==void 0&&m.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:p})}if(this._hasBootstrappedFeatureFlags()){var v,x,S=Object.keys(((v=s.bootstrap)===null||v===void 0?void 0:v.featureFlags)||{}).filter(function(P){var y,O;return!((y=s.bootstrap)===null||y===void 0||(O=y.featureFlags)===null||O===void 0||!O[P])}).reduce(function(P,y){var O,M;return P[y]=((O=s.bootstrap)===null||O===void 0||(M=O.featureFlags)===null||M===void 0?void 0:M[y])||!1,P},{}),k=Object.keys(((x=s.bootstrap)===null||x===void 0?void 0:x.featureFlagPayloads)||{}).filter(function(P){return S[P]}).reduce(function(P,y){var O,M,E,I;return(O=s.bootstrap)!==null&&O!==void 0&&(M=O.featureFlagPayloads)!==null&&M!==void 0&&M[y]&&(P[y]=(E=s.bootstrap)===null||E===void 0||(I=E.featureFlagPayloads)===null||I===void 0?void 0:I[y]),P},{});this.featureFlags.receivedFeatureFlags({featureFlags:S,featureFlagPayloads:k})}if(!this.get_distinct_id()){var T=this.config.get_device_id(jn());this.register_once({distinct_id:T,$device_id:T},""),this.persistence.set_user_state("anonymous")}U.addEventListener&&U.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),c("syncCode")()}},{key:"_afterDecideResponse",value:function(t){var r;if(this.compression={},t.supportedCompression&&!this.config.disable_compression){var n,i={},s=dn(t.supportedCompression);try{for(s.s();!(n=s.n()).done;)i[n.value]=!0}catch(o){s.e(o)}finally{s.f()}this.compression=i}(r=t.analytics)!==null&&r!==void 0&&r.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint)}},{key:"_loaded",value:function(){var t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(r){j.critical("`loaded` function failed",r)}this._start_queue_if_opted_in(),this.config.capture_pageview&&this.capture("$pageview",{title:Ce.title},{send_instantly:!0}),t||(new Cb(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var t;this.has_opted_out_capturing()||this.config.request_batching&&((t=this._requestQueue)===null||t===void 0||t.poll())}},{key:"_dom_loaded",value:function(){var t=this;this.has_opted_out_capturing()||Ln(this.__request_queue,function(r){t._send_request.apply(t,sc(r))}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(t,r){if(se(t))return null;if(fo)return function(o){t(o,r)};var n=this._jsc,i=""+Math.floor(1e8*Math.random()),s=this.config.callback_fn+"["+i+"]";return n[i]=function(o){delete n[i],t(o,r)},s}},{key:"_handle_unload",value:function(){var t,r;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),(t=this._requestQueue)===null||t===void 0||t.unload(),(r=this._retryQueue)===null||r===void 0||r.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(t,r,n){var i=JSON.stringify(r);this.__compress_and_send_json_request(t,i,n||Ys,yc)}},{key:"__compress_and_send_json_request",value:function(t,r,n,i){var s=function(u,c,h){return u===Xr.GZipJS?[Xb(Yb(c),{mtime:0}),J(J({},h),{},{blob:!0,urlQueryArgs:{compression:Xr.GZipJS}})]:[{data:qc(c)},h]}(this.compression[Xr.GZipJS]?Xr.GZipJS:Xr.Base64,r,n),o=ws(s,2),a=o[0],l=o[1];this._send_request(t,a,l,i)}},{key:"_send_request",value:function(t,r,n,i){if(this.__loaded&&this._retryQueue&&!this.rateLimiter.isRateLimited(n._batchKey))if(Sp)this.__request_queue.push([t,r,n,i]);else{var s={method:this.config.api_method,transport:this.config.api_transport,verbose:this.config.verbose};n=Xe(s,n||{}),fo||(n.method="GET");var o="sendBeacon"in U.navigator&&n.transport==="sendBeacon";if(t=bp(t,n.urlQueryArgs||{},{ip:this.config.ip}),o)try{U.navigator.sendBeacon(t,Yc(r,J(J({},n),{},{sendBeacon:!0})))}catch{}else if(fo)try{wp({url:t,data:r,headers:this.config.xhr_headers,options:n,callback:i,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.config.on_xhr_error,onResponse:this.rateLimiter.checkForLimiting})}catch(c){j.error(c)}else{var a,l=Ce.createElement("script");l.type="text/javascript",l.async=!0,l.defer=!0,l.src=t;var u=Ce.getElementsByTagName("script")[0];(a=u.parentNode)===null||a===void 0||a.insertBefore(l,u)}}}},{key:"_execute_array",value:function(t){var r,n=this,i=[],s=[],o=[];Ln(t,function(l){l&&(r=l[0],Ge(r)?o.push(l):hn(l)?l.call(n):Ge(l)&&r==="alias"?i.push(l):Ge(l)&&r.indexOf("capture")!==-1&&hn(n[r])?o.push(l):s.push(l))});var a=function(l,u){Ln(l,function(c){if(Ge(c[0])){var h=u;be(c,function(m){h=h[m[0]].apply(h,m.slice(1))})}else this[c[0]].apply(this,c.slice(1))},u)};a(i,this),a(s,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var t,r;return((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags)&&Object.keys((r=this.config.bootstrap)===null||r===void 0?void 0:r.featureFlags).length>0||!1}},{key:"push",value:function(t){this._execute_array([t])}},{key:"capture",value:function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ys;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return j.uninitializedWarning("posthog.capture");if(!function(c){var h=!1;try{var m=c.config.token,f=c.config.respect_dnt,p=c.config.opt_out_capturing_persistence_type,v=c.config.opt_out_capturing_cookie_prefix||void 0,x=c.config.window;m&&(h=_d(m,{respectDnt:f,persistenceType:p,persistencePrefix:v,window:x}))}catch(S){j.error("Unexpected error when checking capturing opt-out status: "+S)}return h}(this)){var i=(n=n||Ys).transport;if(i&&(n.transport=i),!se(t)&>(t)){if(!sb(dt,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var s={uuid:jn(),event:t,properties:this._calculate_event_properties(t,r||{})};t==="$identify"&&(s.$set=n.$set,s.$set_once=n.$set_once),(s=rb(s,n._noTruncate?null:this.config.properties_string_max_length)).timestamp=n.timestamp||new Date;var o=J(J({},s.properties.$set),s.$set);Z0(o)||this.setPersonPropertiesForFlags(o),j.info("send",s);var a=JSON.stringify(s),l=this.config.api_host+(n.endpoint||this.analyticsDefaultEndpoint),u=n!==Ys;return!this.config.request_batching||u&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(l,a,n):this._requestQueue.enqueue(l,s,n),this._invokeCaptureHooks(t,s),s}}else j.error("No event name provided to posthog.capture")}}},{key:"_addCaptureHook",value:function(t){this.__captureHooks.push(t)}},{key:"_invokeCaptureHooks",value:function(t,r){this.config._onCapture(t,r),be(this.__captureHooks,function(n){return n(t)})}},{key:"_calculate_event_properties",value:function(t,r){if(!this.persistence||!this.sessionPersistence)return r;var n=this.persistence.remove_event_timer(t),i=J({},r);if(i.token=this.config.token,t==="$snapshot"){var s=J(J({},this.persistence.properties()),this.sessionPersistence.properties());return i.distinct_id=s.distinct_id,i}var o=Be.properties();if(this.sessionManager){var a=this.sessionManager.checkAndGetSessionAndWindowId(),l=a.sessionId,u=a.windowId;i.$session_id=l,i.$window_id=u}if(this.config.__preview_measure_pageview_stats){var c={};t==="$pageview"?c=this.pageViewManager.doPageView():t==="$pageleave"&&(c=this.pageViewManager.doPageLeave()),i=Xe(i,c)}if(t==="$pageview"&&(i.title=Ce.title),t==="$performance_event"){var h=this.persistence.properties();return i.distinct_id=h.distinct_id,i.$current_url=o.$current_url,i}if(!se(n)){var m=new Date().getTime()-n;i.$duration=parseFloat((m/1e3).toFixed(3))}i=Xe({},Be.properties(),this.persistence.properties(),this.sessionPersistence.properties(),i);var f=this.config.property_blacklist;Ge(f)?be(f,function(v){delete i[v]}):j.error("Invalid value for property_blacklist config: "+f);var p=this.config.sanitize_properties;return p&&(i=p(i,t)),i}},{key:"register",value:function(t,r){var n;(n=this.persistence)===null||n===void 0||n.register(t,r)}},{key:"register_once",value:function(t,r,n){var i;(i=this.persistence)===null||i===void 0||i.register_once(t,r,n)}},{key:"register_for_session",value:function(t){var r;(r=this.sessionPersistence)===null||r===void 0||r.register(t)}},{key:"unregister",value:function(t){var r;(r=this.persistence)===null||r===void 0||r.unregister(t)}},{key:"unregister_for_session",value:function(t){var r;(r=this.sessionPersistence)===null||r===void 0||r.unregister(t)}},{key:"_register_single",value:function(t,r){this.register(H({},t,r))}},{key:"getFeatureFlag",value:function(t,r){return this.featureFlags.getFeatureFlag(t,r)}},{key:"getFeatureFlagPayload",value:function(t){var r=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(r)}catch{return r}}},{key:"isFeatureEnabled",value:function(t,r){return this.featureFlags.isFeatureEnabled(t,r)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(t,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,r)}},{key:"getEarlyAccessFeatures",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(t,r)}},{key:"onFeatureFlags",value:function(t){return this.featureFlags.onFeatureFlags(t)}},{key:"onSessionId",value:function(t){var r,n;return(r=(n=this.sessionManager)===null||n===void 0?void 0:n.onSessionId(t))!==null&&r!==void 0?r:function(){}}},{key:"getSurveys",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(t,r)}},{key:"getActiveMatchingSurveys",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(t,r)}},{key:"identify",value:function(t,r,n){if(!this.__loaded||!this.persistence)return j.uninitializedWarning("posthog.identify");if(t){var i=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==i&&t!==this.get_property(lo)&&(this.unregister(lo),this.register({distinct_id:t}));var o=this.persistence.get_user_state()==="anonymous";t!==i&&o?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(r||{},!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:i},{$set:r||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(i)):(r||n)&&this.setPersonProperties(r,n),t!==i&&(this.reloadFeatureFlags(),this.unregister(Io))}else j.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(t,r){(t||r)&&(this.setPersonPropertiesForFlags(t||{}),this.capture("$set",{$set:t||{},$set_once:r||{}}))}},{key:"group",value:function(t,r,n){if(t&&r){var i=this.getGroups();i[t]!==r&&this.resetGroupPropertiesForFlags(t),this.register({$groups:J(J({},i),{},H({},t,r))}),n&&(this.capture("$groupidentify",{$group_type:t,$group_key:r,$group_set:n}),this.setGroupPropertiesForFlags(H({},t,n))),i[t]===r||n||this.reloadFeatureFlags()}else j.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(t){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(t,r)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(t){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setGroupPropertiesForFlags(t,r)}},{key:"resetGroupPropertiesForFlags",value:function(t){this.featureFlags.resetGroupPropertiesForFlags(t)}},{key:"reset",value:function(t){var r,n,i,s;if(!this.__loaded)return j.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");(r=this.persistence)===null||r===void 0||r.clear(),(n=this.sessionPersistence)===null||n===void 0||n.clear(),(i=this.persistence)===null||i===void 0||i.set_user_state("anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var a=this.config.get_device_id(jn());this.register_once({distinct_id:a,$device_id:t?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var t,r;return(t=(r=this.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}},{key:"get_session_replay_url",value:function(t){if(!this.sessionManager)return"";var r=this.config.ui_host||this.config.api_host,n=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=n.sessionId,s=n.sessionStartTimestamp,o=r+"/replay/"+i;if(t!=null&&t.withTimestamp&&s){var a,l=(a=t.timestampLookBack)!==null&&a!==void 0?a:10;if(!s)return o;var u=Math.max(Math.floor((new Date().getTime()-s)/1e3)-l,0);o+="?t=".concat(u)}return o}},{key:"alias",value:function(t,r){return t===this.get_property(up)?(j.critical("Attempting to create alias for existing People user - aborting."),-2):(se(r)&&(r=this.get_distinct_id()),t!==r?(this._register_single(lo,t),this.capture("$create_alias",{alias:t,distinct_id:r})):(j.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1))}},{key:"set_config",value:function(t){var r,n,i=J({},this.config);Rr(t)&&(Xe(this.config,t),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),(r=this.persistence)===null||r===void 0||r.update_config(this.config),(n=this.sessionPersistence)===null||n===void 0||n.update_config(this.config),Ae.is_supported()&&Ae.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(fn.DEBUG=!0),this.sessionRecording&&!se(t.disable_session_recording)&&i.disable_session_recording!==t.disable_session_recording&&(t.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var t;return!((t=this.sessionRecording)===null||t===void 0||!t.started)}},{key:"loadToolbar",value:function(t){return this.toolbar.loadToolbar(t)}},{key:"get_property",value:function(t){var r;return(r=this.persistence)===null||r===void 0?void 0:r.props[t]}},{key:"getSessionProperty",value:function(t){var r;return(r=this.sessionPersistence)===null||r===void 0?void 0:r.props[t]}},{key:"toString",value:function(){var t,r=(t=this.config.name)!==null&&t!==void 0?t:ht;return r!==ht&&(r=ht+"."+r),r}},{key:"_gdpr_init",value:function(){this.config.opt_out_capturing_persistence_type==="localStorage"&&Ae.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.config.opt_out_capturing_by_default&&!cr.get("ph_optout")||(cr.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(t){var r,n,i,s,o;if(t&&t.clear_persistence)i=!0;else{if(!t||!t.enable_persistence)return;i=!1}this.config.disable_persistence||((r=this.persistence)===null||r===void 0?void 0:r.disabled)===i||(s=this.persistence)===null||s===void 0||s.set_disabled(i),this.config.disable_persistence||((n=this.sessionPersistence)===null||n===void 0?void 0:n.disabled)===i||(o=this.sessionPersistence)===null||o===void 0||o.set_disabled(i)}},{key:"_gdpr_call_func",value:function(t,r){return r=Xe({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},r||{}),Ae.is_supported()||r.persistence_type!=="localStorage"||(r.persistence_type="cookie"),t(this.config.token,{capture:r.capture,captureEventName:r.capture_event_name,captureProperties:r.capture_properties,persistenceType:r.persistence_type,persistencePrefix:r.cookie_prefix,cookieExpiration:r.cookie_expiration,crossSubdomainCookie:r.cross_subdomain_cookie,secureCookie:r.secure_cookie})}},{key:"opt_in_capturing",value:function(t){t=Xe({enable_persistence:!0},t||{}),this._gdpr_call_func($b,t),this._gdpr_update_persistence(t)}},{key:"opt_out_capturing",value:function(t){var r=Xe({clear_persistence:!0},t||{});this._gdpr_call_func(Fb,r),this._gdpr_update_persistence(r)}},{key:"has_opted_in_capturing",value:function(t){return this._gdpr_call_func(Rb,t)}},{key:"has_opted_out_capturing",value:function(t){return this._gdpr_call_func(_d,t)}},{key:"clear_opt_in_out_capturing",value:function(t){var r=Xe({enable_persistence:!0},t??{});this._gdpr_call_func(jb,r),this._gdpr_update_persistence(r)}},{key:"debug",value:function(t){t===!1?(U.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(U.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),e}();(function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=op(e.prototype[t[r]])})(Kc,["identify"]);var Cd,Pd,br={},fw=function(){He.init=function(e,t,r){if(r)return He[r]||(He[r]=br[r]=bc(e||"",t||{},r,function(i){He[r]=br[r]=i,i._loaded()})),He[r];var n=He;return br[ht]?n=br[ht]:e&&(n=bc(e,t||{},ht,function(i){br[ht]=i,i._loaded()}),br[ht]=n),He=n,Jc===Yi.INIT_SNIPPET&&(U[ht]=He),be(br,function(i,s){s!==ht&&(He[s]=i)}),n}},hw=function(){function e(){e.done||(e.done=!0,Sp=!1,be(br,function(t){t._dom_loaded()}))}Ce.addEventListener&&(Ce.readyState==="complete"?e():Ce.addEventListener("DOMContentLoaded",e,!1)),Bi(U,"load",e,!0)};(function(e){e.Popover="popover",e.API="api"})(Cd||(Cd={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Pd||(Pd={}));var ho=(Jc=Yi.INIT_MODULE,He=new Kc,fw(),He.init(),hw(),He),pw=C.createContext({client:ho});function mw(e){var t=e.children,r=e.client,n=e.apiKey,i=e.options,s=C.useMemo(function(){return r&&n&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),r&&i&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),r||(n&&(ho.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),ho.init(n,i)),ho)},[r,n]);return C.createElement(pw.Provider,{value:{client:s}},t)}const Ep=({children:e,user:t})=>t!=null&&t.isLoading?e:g.jsx(mw,{apiKey:process.env.REACT_APP_PUBLIC_POSTHOG_KEY,options:{api_host:process.env.REACT_APP_PUBLIC_POSTHOG_HOST,autocapture:!1,secure_cookie:!0,bootstrap:{distinctID:(t==null?void 0:t.id)||"anonymous",isIdentifiedID:!!(t!=null&&t.id)}},children:e}),kp=({children:e,locale:t,messages:r})=>{const n=t||"en",i={...pg[n],...r||{}};return g.jsx(Gv,{locale:n,messages:i,children:e})},dr=C.createContext(null),Tp=({children:e,user:t})=>g.jsx(dr.Provider,{value:t,children:e}),gw=({children:e,intl:t,user:r})=>g.jsx(kp,{locale:t==null?void 0:t.locale,messages:t==null?void 0:t.messages,children:g.jsx(Tp,{user:r,children:g.jsx(Zh,{children:g.jsx(Ep,{user:r,children:e})})})});const ll="joinCommunityButton",Zc=({isMember:e=!1,isShort:t=!1,functions:{join:r,leave:n}={join:()=>{},leave:()=>{}}})=>{const i=te(),s=C.useContext(dr),o=s&&typeof s.id=="string",[a,l]=C.useState(e),[u,c]=C.useState(e?"joined":"notJoined");C.useEffect(()=>{u==="joining"?c("joined"):u==="leaving"&&c("notJoined")},[a]);const h={},m={};return a&&u!=="leaving"&&(h["data-hover-text"]=i.formatMessage({id:`${ll}_leave`}),h["aria-label"]=i.formatMessage({id:`${ll}_member_aria`}),m["aria-hidden"]="true"),g.jsx(Oe,{variant:a?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:a&&u!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async f=>{o&&(f.currentTarget.blur(),a?(c("leaving"),typeof n=="function"&&await n()):(c("joining"),typeof r=="function"&&await r()),l(!a))},className:L("join-community-button",u,{active:u==="joining"}),disabled:!o,...h,children:g.jsx("span",{className:"text",...m,children:i.formatMessage({id:`${ll}${["joining","leaving"].includes(u)?`_${u}`:a?"_member":t?"_short":""}`})})})};const cl="communityDetails_",vw=({isMember:e=!1,slug:t,members:{number:r,data:n}={number:void 0,data:[]},className:i="",...s})=>{const o=te(),a=r||(n==null?void 0:n.length)||0;return g.jsxs("div",{className:L("community-details",i),children:[g.jsx(go,{}),g.jsxs("div",{className:"member-details",children:[g.jsxs("div",{className:"top",children:[g.jsxs("h3",{children:[o.formatMessage({id:`${cl}members`}),g.jsx("span",{className:"count",children:a})]}),g.jsx("p",{className:"text-small",children:g.jsx("a",{href:`/communities/${t}/members`,children:o.formatMessage({id:`${cl}viewAll`})})})]}),g.jsx(Sh,{contributors:{total:r,data:n!=null&&n.length?n:[{},{},{},{},{}]},styling:{size:"medium",showGap:!0,showPlaceholders:a===0},cutoff:5})]}),g.jsx(Zc,{isMember:e,...s}),e&&g.jsx(Oe,{variant:"primary",icon:{icon:"plus"},styling:{fullWidth:!0},children:o.formatMessage({id:`${cl}invite`})})]})};const _w=({breadcrumbs:e,cutoff:t=20,className:r=""})=>{const n=te();return g.jsxs(g.Fragment,{children:[g.jsx(ze,{element:"p",children:n.formatMessage({id:"breadcrumbs_label"})}),g.jsx("ul",{className:L("breadcrumbs text-small",r),children:e.map(({text:i,href:s,current:o=!1},a)=>g.jsxs("li",{children:[o&&g.jsx(ze,{element:"span",children:n.formatMessage({id:"breadcrumbs_currentPage"})}),g.jsx(vs,{href:o?void 0:s,children:Ic(i,t)})]},`${window.btoa(i)}_${a}`))})]})};const yw=({options:e,allOption:t=!1,allowMultiple:r=!0,onChange:n=()=>{},className:i=""})=>{const s=te(),o=t?[{id:"all",text:typeof t!="boolean"&&t.text||s.formatMessage({id:"filters_all"})},...e]:e,[a,l]=C.useState(t?["all"]:[]),u=(c,h)=>{let m=[];a.includes(c)?m=a.filter(f=>f!==c):c==="all"?m=["all"]:r?m=[...a.filter(f=>f!=="all"),c]:m=[c],l(f=>(n&&typeof n=="function"&&n({current:m,previous:f}),m)),h&&typeof h=="function"&&h()};return g.jsx("ul",{className:L("filters",i),children:o.map(({id:c,text:h,disabled:m=!1,callback:f=()=>{}})=>{let p={};return m&&(p={disabled:!0,"aria-label":s.formatMessage({id:"filters_disabled"},{name:h})}),g.jsx("li",{children:g.jsx("button",{className:L(c,{selected:a.includes(c)}),onClick:v=>{v.preventDefault(),v.stopPropagation(),u(c,f)},...p,children:h})},c)})})},bw=(e,t)=>{const r=String(e);if(!t||!t.length)return`/${r}`;let n="";return t.forEach(({url:i,position:s})=>{s==="before-lang"?n+=`/${i}`:(n.includes(`/${r}/`)||(n+=`/${r}`),n+=`/${i}`)}),n.includes(`/${r}/`)||(n+=`/${r}`),n};const ul={en:"English",es:"Español",fr:"Français",pt:"Português"},Js="languageSwitcher_",ww=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:r=!1,translations:n,onChange:i=()=>{},urlParts:s,variant:o="default",label:a,className:l=""})=>{const u=te(),[c,h]=C.useState(e);if(C.useEffect(()=>{e!==c&&h(e)},[e]),!n||!Object.values(n).some(v=>v&&v.post_name))return null;const f=Object.keys(n),p=c!==e;return g.jsxs("div",{className:L("language-switcher text-small",o,l),children:[g.jsxs("nav",{children:[o!=="short"&&g.jsx("p",{children:a||u.formatMessage({id:`${Js}label`})}),g.jsx("ul",{children:f.map(v=>{if(!ul[v])return null;let x={className:v};return c===v?x["aria-label"]=u.formatMessage({id:`${Js}selected`},{language:ul[v]}):x={...x,href:bw(v,s),onClick:S=>{S.preventDefault(),S.stopPropagation(),h(v),i(v)}},g.jsx("li",{children:g.jsx(vs,{...x,fallbackElement:"span",children:ul[v]})},v)})}),o!=="short"&&!p&&g.jsx("p",{children:u.formatMessage({id:`${Js}translation_${t?"original":r?"human":"machine"}`})})]}),o!=="short"&&!p&&!t&&!r&&g.jsx("small",{children:u.formatMessage({id:`${Js}disclaimer`},{email:In.support,link:v=>{const x=`mailto:${v}`;return g.jsx("a",{href:x,children:v})}})})]})};const dl=Fl({locale:"en",messages:Tc}),Cp=({page:e=1,length:t=0,limit:r=10,loadNextPage:n=()=>{},icon:i=!1,messages:s={button:dl.formatMessage({id:"loadMore_button"}),endOfFeed:dl.formatMessage({id:"loadMore_endOfFeed"}),error:dl.formatMessage({id:"loadMore_error"})},className:o="",gtmContext:a="LoadMore"})=>{const[l,u]=C.useState(!1),[c,h]=C.useState(!1);if(t<=0||t<r*e)return null;const m=async f=>{try{await n(f)}catch(p){p instanceof Error&&p.message&&p.message.includes("Cannot read items")?h(!0):u(!0)}};return g.jsxs("footer",{className:L("load-more",o),children:[l&&g.jsx("p",{className:"error",children:s.error}),c?g.jsx("p",{children:s.endOfFeed}):g.jsx(Oe,{variant:"secondary",icon:i,onClick:m,"data-gtm-event-context":a,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:s.button})]})};let Ks=!1;const Pp=({element:e="div",id:t="more-menu",options:r,className:n=""})=>{const i=te(),s=C.useRef(null),[o,a]=C.useState(!1),l=u=>{s.current&&u.target instanceof HTMLElement&&!s.current.contains(u.target)&&a(!1)};return C.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),C.createElement(e,{ref:s,className:L("more-menu text-medium",n),children:g.jsxs(g.Fragment,{children:[g.jsx(Oe,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>a(!o),"aria-haspopup":"true","aria-expanded":o,"aria-controls":t,screenreaderText:i.formatMessage({id:"moreMenu"})}),g.jsx("ul",{id:t,hidden:!o,children:r.map(({href:u,onClick:c,text:h,icon:m,...f},p)=>{const v={...f,onClick:x=>{a(!1),typeof c=="function"&&c(x)},onFocus:()=>{Ks&&(clearTimeout(Ks),Ks=!1)},onBlur:()=>{Ks=setTimeout(()=>{a(!1)},100)}};return u&&(v.href=u),g.jsx("li",{children:g.jsx(Oe,{variant:"tertiary",size:"medium",icon:m?{icon:m,position:"left"}:!1,...v,children:h})},`${window.btoa(h)}_${p}`)})})]})})};const eu=({variant:e="default",version:t="default",className:r="",...n})=>g.jsx("p",{className:"logo-wrapper",children:g.jsx("a",{href:"/home/",className:L("logo",e,t,r),...n,children:g.jsx(ze,{children:g.jsx(Mr,{id:"apolitical"})})})});const xw={"2-1":901},Sw=({layout:e="2-1",hideOnMobile:t=!1,className:r="",children:n})=>{const i=ms(!0);let s=n;return C.Children.count(n)===1&&(s=C.Children.toArray(n)[0],s.props&&(s=s.props.children)),g.jsx("section",{className:L("columns",`layout-${e}`,r),children:C.Children.map(s,(o,a)=>t!==!1&&a===t&&i&&i<xw[e]?null:o)})};/*!
|
|
64
|
+
`)).length,i=0;i<n;i++){var o=e.charCodeAt(i),a=null;o<128?r++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Wt(a)||(r>t&&(s+=e.substring(t,r)),s+=a,t=r=i+1)}return r>t&&(s+=e.substring(t,e.length)),s},ib=["ahrefsbot","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","hubspot","linkedinbot","mj12bot","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","twitterbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],sb=function(e,t){if(!e)return!1;var r=e.toLowerCase();return ib.concat(t||[]).some(function(n){var i=n.toLowerCase();return r.includes?r.includes(i):r.indexOf(i)!==-1})},Bi=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,r,n,i,s){if(t)if(t.addEventListener&&!i)t.addEventListener(r,n,!!s);else{var o="on"+r,a=t[o];t[o]=function(l,u,c){return function(h){if(h=h||e(window.event)){var m,f=!0;hn(c)&&(m=c(h));var p=u.call(l,h);return m!==!1&&p!==!1||(f=!1),f}}}(t,n,a)}else j.error("No valid element provided to register_event")}}();function Hi(e,t){var r=function(){var n=Ce.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(o){return t(void 0,o)},n.onerror=function(o){return t(o)};var i,s=Ce.querySelectorAll("body > script");s.length>0?(i=s[0].parentNode)===null||i===void 0||i.insertBefore(n,s[0]):Ce.body.appendChild(n)};Ce.body?r():Ce.addEventListener("DOMContentLoaded",r)}function Ao(e){switch(nc(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function Oo(e){var t="";return ao(e)&&!lp(e)&&e.childNodes&&e.childNodes.length&&be(e.childNodes,function(r){ap(r)&&r.textContent&&(t+=lc(r.textContent).split(/(\s+)/).filter($n).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),lc(t)}function ad(e){return!!e&&e.nodeType===1}function an(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ap(e){return!!e&&e.nodeType===3}function ld(e){return!!e&&e.nodeType===11}var nl=["a","button","form","input","select","textarea","label"];function ao(e){for(var t=e;t.parentNode&&!an(t,"body");t=t.parentNode){var r=Ao(t).split(" ");if(de(r,"ph-sensitive")||de(r,"ph-no-capture"))return!1}if(de(Ao(e).split(" "),"ph-include"))return!0;var n=e.type||"";if(gt(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!(gt(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function lp(e){return!!(an(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||an(e,"select")||an(e,"textarea")||e.getAttribute("contenteditable")==="true")}function $n(e){return!(Wt(e)||se(e)||gt(e)&&(e=lc(e),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(e)))}function cd(e){var t=Oo(e);return $n(t="".concat(t," ").concat(cp(e)).trim())?t:""}function cp(e){var t="";return e&&e.childNodes&&e.childNodes.length&&be(e.childNodes,function(r){var n;if(r&&((n=r.tagName)===null||n===void 0?void 0:n.toLowerCase())==="span")try{var i=Oo(r);t="".concat(t," ").concat(i).trim(),r.childNodes&&r.childNodes.length&&(t="".concat(t," ").concat(cp(r)).trim())}catch(s){j.error(s)}}),t}var ob=function(){function e(t){Me(this,e),this.clicks=[],this.enabled=t}return Ie(e,[{key:"isRageClick",value:function(t,r,n){if(!this.enabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(r-i.y)<30&&n-i.timestamp<1e3){if(this.clicks.push({x:t,y:r,timestamp:n}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:r,timestamp:n}];return!1}}]),e}(),up="$people_distinct_id",lo="__alias",Di="__timers",ud="$autocapture_disabled_server_side",uc="$session_recording_enabled_server_side",dd="$console_log_recording_enabled_server_side",fd="$session_recording_recorder_version_server_side",Mo="$sesid",co="$session_is_sampled",Fn="$enabled_feature_flags",dc="$early_access_features",Rn="$stored_person_properties",wr="$stored_group_properties",fc="$surveys",Io="$flag_call_reported",hc="$user_state",pc="$posthog_quota_limited",ab=[up,lo,"__cmpns",Di,uc,Mo,Fn,hc,pc,dc,wr,Rn,fc,Io];function il(e,t){return t.length>e?t.slice(0,e)+"...":t}var xr={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t,r=Wt(this._isDisabledServerSide)?!((t=e.persistence)===null||t===void 0||!t.props[ud]):this._isDisabledServerSide,n=!!e.config.autocapture;this._isAutocaptureEnabled=n&&!r},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!ad(t));return t},_getAugmentPropertiesFromElement:function(e){if(!ao(e))return{};var t={};return be(e.attributes,function(r){if(r.name.indexOf("data-ph-capture-attribute")===0){var n=r.name.replace("data-ph-capture-attribute-",""),i=r.value;n&&i&&$n(i)&&(t[n]=i)}}),t},_getPropertiesFromElement:function(e,t,r){var n,i=e.tagName.toLowerCase(),s={tag_name:i};nl.indexOf(i)>-1&&!r&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?s.$el_text=il(1024,cd(e)):s.$el_text=il(1024,Oo(e)));var o=Ao(e);o.length>0&&(s.classes=o.split(" ").filter(function(h){return h!==""}));var a=(n=this.config)===null||n===void 0?void 0:n.element_attribute_ignorelist;be(e.attributes,function(h){var m;lp(e)&&["name","id","class"].indexOf(h.name)===-1||a!=null&&a.includes(h.name)||!t&&$n(h.value)&&(m=h.name,!gt(m)||m.substring(0,10)!=="_ngcontent"&&m.substring(0,7)!=="_nghost")&&(s["attr__"+h.name]=il(1024,h.value))});for(var l=1,u=1,c=e;c=this._previousElementSibling(c);)l++,c.tagName===e.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return be(document.querySelectorAll(e.css_selector),function(r){var n;["input","select"].indexOf(r.tagName.toLowerCase())>-1?n=r.value:r.textContent&&(n=r.textContent),$n(n)&&t.push(n)}),t.join(", ")},_getCustomProperties:function(e){var t=this,r={};return be(this._customProperties,function(n){be(n.event_selectors,function(i){be(document.querySelectorAll(i),function(s){de(e,s)&&ao(s)&&(r[n.name]=t._extractCustomPropertyValue(n))})})}),r},_getEventTarget:function(e){return se(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var r,n=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"$autocapture",s=this._getEventTarget(e);if(ap(s)&&(s=s.parentNode||null),i==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,t,"$rageclick"),s&&function(v,x){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!v||an(v,"html")||!ad(v))return!1;if(S!=null&&S.url_allowlist){var k=window.location.href,T=S.url_allowlist;if(T&&!T.some(function(q){return k.match(q)}))return!1}if(S!=null&&S.dom_event_allowlist){var P=S.dom_event_allowlist;if(P&&!P.some(function(q){return x.type===q}))return!1}if(S!=null&&S.element_allowlist){var y=S.element_allowlist;if(y&&!y.some(function(q){return v.tagName.toLowerCase()===q}))return!1}if(S!=null&&S.css_selector_allowlist){var O=S.css_selector_allowlist;if(O&&!O.some(function(q){return v.matches(q)}))return!1}for(var M=!1,E=[v],I=!0,R=v;R.parentNode&&!an(R,"body");)if(ld(R.parentNode))E.push(R.parentNode.host),R=R.parentNode.host;else{if(!(I=R.parentNode||!1))break;if(nl.indexOf(I.tagName.toLowerCase())>-1)M=!0;else{var N=window.getComputedStyle(I);N&&N.getPropertyValue("cursor")==="pointer"&&(M=!0)}E.push(I),R=I}var z=window.getComputedStyle(v);if(z&&z.getPropertyValue("cursor")==="pointer"&&x.type==="click")return!0;var Y=v.tagName.toLowerCase();switch(Y){case"html":return!1;case"form":return x.type==="submit";case"input":case"select":case"textarea":return x.type==="change"||x.type==="click";default:return M?x.type==="click":x.type==="click"&&(nl.indexOf(Y)>-1||v.getAttribute("contenteditable")==="true")}}(s,e,this.config)){for(var o,a,l=[s],u=s;u.parentNode&&!an(u,"body");)ld(u.parentNode)?(l.push(u.parentNode.host),u=u.parentNode.host):(l.push(u.parentNode),u=u.parentNode);var c,h=[],m={},f=!1;if(be(l,function(v){var x=ao(v);v.tagName.toLowerCase()==="a"&&(c=v.getAttribute("href"),c=x&&$n(c)&&c),de(Ao(v).split(" "),"ph-no-capture")&&(f=!0),h.push(n._getPropertiesFromElement(v,t.config.mask_all_element_attributes,t.config.mask_all_text));var S=n._getAugmentPropertiesFromElement(v);Xe(m,S)}),t.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?h[0].$el_text=cd(s):h[0].$el_text=Oo(s)),c&&(h[0].attr__href=c),f)return!1;var p=Xe(this._getDefaultProperties(e.type),{$elements:h},(o=h[0])!==null&&o!==void 0&&o.$el_text?{$el_text:(a=h[0])===null||a===void 0?void 0:a.$el_text}:{},this._getCustomProperties(l),m);return t.capture(i,p),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,r=function(n){n=n||window.event,t._captureEvent(n,e)};Bi(document,"submit",r,!1,!0),Bi(document,"change",r,!1,!0),Bi(document,"click",r,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;ac(e.__autocapture)||(this.config=e.__autocapture),(t=this.config)!==null&&t!==void 0&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function(r){return new RegExp(r)})),this.rageclicks=new ob(e.config.rageclick)},afterDecideResponse:function(e,t){var r=t.config.token;this._initializedTokens.indexOf(r)>-1?j.info('autocapture already initialized for token "'+r+'"'):(t.persistence&&t.persistence.register(H({},ud,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(r),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,r){if(!e)return!0;t=se(t)?10:t,r=se(r)?10:r;for(var n=0,i=0;i<e.length;i++)n+=e.charCodeAt(i);return n%t<r},isBrowserSupported:function(){return hn(document.querySelectorAll)}};(function(e){for(var t in e)hn(e[t])&&(e[t]=e[t].bind(e))})(xr),function(e){for(var t in e)hn(e[t])&&(e[t]=op(e[t]))}(xr);var sl="$active_feature_flags",Vs="$override_feature_flags",hd="$feature_flag_payloads",pd=function(e){var t,r={},n=dn(function(a){for(var l=Object.keys(a),u=l.length,c=new Array(u);u--;)c[u]=[l[u],a[l[u]]];return c}(e||{}));try{for(n.s();!(t=n.n()).done;){var i=ws(t.value,2),s=i[0],o=i[1];o&&(r[s]=o)}}catch(a){n.e(a)}finally{n.f()}return r},lb=function(){function e(t){Me(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return Ie(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var t=this.instance.get_property(Fn),r=this.instance.get_property(Vs);if(!r)return t||{};for(var n=Xe({},t),i=Object.keys(r),s=0;s<i.length;s++)r[i[s]]===!1?delete n[i[s]]:n[i[s]]=r[i[s]];return this._override_warning||(j.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:r,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(hd)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(t){this.$anon_distinct_id=t}},{key:"setReloadingPaused",value:function(t){this.reloadFeatureFlagsInAction=t}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var t=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!t.reloadFeatureFlagsInAction&&t.reloadFeatureFlagsQueued&&(t.reloadFeatureFlagsQueued=!1,t._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var t=this;this.setReloadingPaused(!0);var r=this.instance.config.token,n=this.instance.get_property(Rn),i=this.instance.get_property(wr),s=qc(JSON.stringify({token:r,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:i,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0}));this.instance._send_request(this.instance.config.api_host+"/decide/?v=3",{data:s},{method:"POST"},this.instance._prepare_callback(function(o){t.$anon_distinct_id=void 0,t.receivedFeatureFlags(o),t.setReloadingPaused(!1),t._startReloadTimer()}))}},{key:"getFeatureFlag",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,i=this.getFlagVariants()[t],s="".concat(i),o=this.instance.get_property(Io)||{};return(r.send_event||!("send_event"in r))&&(!(t in o)||!o[t].includes(s))&&(Ge(o[t])?o[t].push(s):o[t]=[s],(n=this.instance.persistence)===null||n===void 0||n.register(H({},Io,o)),this.instance.capture("$feature_flag_called",{$feature_flag:t,$feature_flag_response:i})),i}j.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(t){return this.getFlagPayloads()[t]}},{key:"isFeatureEnabled",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(t,r);j.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(t){this.featureFlagEventHandlers.push(t)}},{key:"removeFeatureFlagsHandler",value:function(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(r){return r!==t})}},{key:"receivedFeatureFlags",value:function(t){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),n=this.getFlagPayloads();(function(i,s){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=i.featureFlags,u=i.featureFlagPayloads;if(l)if(Ge(l)){var c,h={};if(l)for(var m=0;m<l.length;m++)h[l[m]]=!0;s&&s.register((H(c={},sl,l),H(c,Fn,h),c))}else{var f,p=l,v=u;i.errorsWhileComputingFlags&&(p=J(J({},o),p),v=J(J({},a),v)),s&&s.register((H(f={},sl,Object.keys(pd(p))),H(f,Fn,p||{}),H(f,hd,v||{}),f))}})(t,this.instance.persistence,r,n),this._fireFeatureFlagsCallbacks()}}},{key:"override",value:function(t){if(!this.instance.__loaded||!this.instance.persistence)return j.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,t===!1)this.instance.persistence.unregister(Vs);else if(Ge(t)){for(var r={},n=0;n<t.length;n++)r[t[n]]=!0;this.instance.persistence.register(H({},Vs,r))}else this.instance.persistence.register(H({},Vs,t))}},{key:"onFeatureFlags",value:function(t){var r=this;if(this.addFeatureFlagsHandler(t),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),i=n.flags,s=n.flagVariants;t(i,s)}return function(){return r.removeFeatureFlagsHandler(t)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(t,r){var n,i,s=H({},"$feature_enrollment/".concat(t),r);this.instance.capture("$feature_enrollment_update",{$feature_flag:t,$feature_enrollment:r,$set:s}),this.setPersonPropertiesForFlags(s,!1);var o=J(J({},this.getFlagVariants()),{},H({},t,r));(n=this.instance.persistence)===null||n===void 0||n.register((H(i={},sl,Object.keys(pd(o))),H(i,Fn,o),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(t){var r=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(dc);if(i&&!n)return t(i);this.instance._send_request("".concat(this.instance.config.api_host,"/api/early_access_features/?token=").concat(this.instance.config.token),{},{method:"GET"},function(s){var o,a=s.earlyAccessFeatures;return(o=r.instance.persistence)===null||o===void 0||o.register(H({},dc,a)),t(a)})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var t=this.getFlags(),r=this.getFlagVariants();return{flags:t.filter(function(n){return r[n]}),flagVariants:Object.keys(r).filter(function(n){return r[n]}).reduce(function(n,i){return n[i]=r[i],n},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var t=this._prepareFeatureFlagsForCallbacks(),r=t.flags,n=t.flagVariants;this.featureFlagEventHandlers.forEach(function(i){return i(r,n)})}},{key:"setPersonPropertiesForFlags",value:function(t){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.instance.get_property(Rn)||{};this.instance.register(H({},Rn,J(J({},n),t))),r&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Rn)}},{key:"setGroupPropertiesForFlags",value:function(t){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.instance.get_property(wr)||{};Object.keys(n).length!==0&&Object.keys(n).forEach(function(i){n[i]=J(J({},n[i]),t[i]),delete t[i]}),this.instance.register(H({},wr,J(J({},n),t))),r&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(t){if(t){var r=this.instance.get_property(wr)||{};this.instance.register(H({},wr,J(J({},r),{},H({},t,{}))))}else this.instance.unregister(wr)}}]),e}(),cb=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,cr={is_supported:function(){return!0},error:function(e){j.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",r=document.cookie.split(";").filter(function(s){return s.length}),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null},parse:function(e){var t;try{t=JSON.parse(cr.get(e))||{}}catch{}return t},set:function(e,t,r,n,i){try{var s="",o="",a="";if(n){var l=document.location.hostname.match(cb),u=l?l[0]:"";s=u?"; domain=."+u:""}if(r){var c=new Date;c.setTime(c.getTime()+24*r*60*60*1e3),o="; expires="+c.toUTCString()}i&&(a="; secure");var h=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+s+a;return document.cookie=h,h}catch{return}},remove:function(e,t){try{cr.set(e,"",-1,t)}catch{return}}},ol=null,Ae={is_supported:function(){if(!Wt(ol))return ol;var e=!0;if(se(window))e=!1;else try{var t="__mplssupport__";Ae.set(t,"xyz"),Ae.get(t)!=='"xyz"'&&(e=!1),Ae.remove(t)}catch{e=!1}return e||j.error("localStorage unsupported; falling back to cookie store"),ol=e,e},error:function(e){j.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){Ae.error(t)}return null},parse:function(e){try{return JSON.parse(Ae.get(e))||{}}catch{}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(r){Ae.error(r)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){Ae.error(t)}}},ub=["distinct_id",Mo,co],mc=J(J({},Ae),{},{parse:function(e){try{var t={};try{t=cr.parse(e)||{}}catch{}var r=Xe(t,JSON.parse(Ae.get(e)||"{}"));return Ae.set(e,r),r}catch{}return null},set:function(e,t,r,n,i){try{Ae.set(e,t);var s={};ub.forEach(function(o){t[o]&&(s[o]=t[o])}),Object.keys(s).length&&cr.set(e,s,r,n,i)}catch(o){Ae.error(o)}},remove:function(e,t){try{window.localStorage.removeItem(e),cr.remove(e,t)}catch(r){Ae.error(r)}}}),Qs={},db={is_supported:function(){return!0},error:function(e){j.error("memoryStorage error: "+e)},get:function(e){return Qs[e]||null},parse:function(e){return Qs[e]||null},set:function(e,t){Qs[e]=t},remove:function(e){delete Qs[e]}},Vr=null,Ue={is_supported:function(){if(!Wt(Vr))return Vr;if(Vr=!0,se(window))Vr=!1;else try{var e="__support__";Ue.set(e,"xyz"),Ue.get(e)!=='"xyz"'&&(Vr=!1),Ue.remove(e)}catch{Vr=!1}return Vr},error:function(e){j.error("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(t){Ue.error(t)}return null},parse:function(e){try{return JSON.parse(Ue.get(e))||null}catch{}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(r){Ue.error(r)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(t){Ue.error(t)}}},fb=["localhost","127.0.0.1"],hb=function(e,t){return!!function(r){try{new RegExp(r)}catch{return!1}return!0}(t)&&new RegExp(t).test(e)},md=function(e,t){for(var r,n=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<n.length;i++){var s=n[i].split("=");if(s[0]===t){r=s;break}}if(!Ge(r)||r.length<2)return"";var o=r[1];try{o=decodeURIComponent(o)}catch{j.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},$o=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null},Be={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(e||[]),r={};return be(t,function(n){var i=md(Ce.URL,n);i.length&&(r[n]=i)}),r},searchEngine:function(){var e=Ce.referrer;return e?e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null},searchInfo:function(){var e=Be.searchEngine(),t=e!="yahoo"?"q":"p",r={};if(!Wt(e)){r.$search_engine=e;var n=md(Ce.referrer,t);n.length&&(r.ph_keyword=n)}return r},browser:function(e,t,r){return t=t||"",r||de(e," OPR/")?de(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":de(e,"IEMobile")||de(e,"WPDesktop")?"Internet Explorer Mobile":de(e,"SamsungBrowser/")?"Samsung Internet":de(e,"Edge")||de(e,"Edg/")?"Microsoft Edge":de(e,"FBIOS")?"Facebook Mobile":de(e,"Chrome")?"Chrome":de(e,"CriOS")?"Chrome iOS":de(e,"UCWEB")||de(e,"UCBrowser")?"UC Browser":de(e,"FxiOS")?"Firefox iOS":de(t,"Apple")||function(n){return de(n,"Safari")&&!de(n,"Chrome")&&!de(n,"Android")}(e)?de(e,"Mobile")?"Mobile Safari":"Safari":de(e,"Android")?"Android Mobile":de(e,"Konqueror")||de(e,"konqueror")?"Konqueror":de(e,"Firefox")?"Firefox":de(e,"MSIE")||de(e,"Trident/")?"Internet Explorer":de(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n={"Internet Explorer Mobile":[/rv:(\d+(\.\d+)?)/],"Microsoft Edge":[/Edge?\/(\d+(\.\d+)?)/],Chrome:[/Chrome\/(\d+(\.\d+)?)/],"Chrome iOS":[/CriOS\/(\d+(\.\d+)?)/],"UC Browser":[/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/],Safari:[/Version\/(\d+(\.\d+)?)/],"Mobile Safari":[/Version\/(\d+(\.\d+)?)/],Opera:[/(Opera|OPR)\/(\d+(\.\d+)?)/],Firefox:[/Firefox\/(\d+(\.\d+)?)/],"Firefox iOS":[/FxiOS\/(\d+(\.\d+)?)/],Konqueror:[/Konqueror[:/]?(\d+(\.\d+)?)/i],BlackBerry:[/BlackBerry (\d+(\.\d+)?)/,/Version\/(\d+(\.\d+)?)/],"Android Mobile":[/android\s(\d+(\.\d+)?)/],"Samsung Internet":[/SamsungBrowser\/(\d+(\.\d+)?)/],"Internet Explorer":[/(rv:|MSIE )(\d+(\.\d+)?)/],Mozilla:[/rv:(\d+(\.\d+)?)/]}[Be.browser(e,t,r)];if(se(n))return null;for(var i=0;i<n.length;i++){var s=n[i],o=e.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){if(/Windows/i.test(e)){if(/Phone/.test(e)||/WPDesktop/.test(e))return{os_name:"Windows Phone",os_version:""};var t=/Windows NT ([0-9.]+)/i.exec(e);return t&&t[1]?{os_name:"Windows",os_version:t[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(e)){var r=/OS (\d+)_(\d+)_?(\d+)?/i.exec(e);return r&&r[1]?{os_name:"iOS",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(e)){var n=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(e);return n&&n[1]?{os_name:"Android",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(e))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(e)){var i=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(e);return i&&i[1]?{os_name:"Mac OS X",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(e)?{os_name:"Linux",os_version:""}:/CrOS/.test(e)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return t==="iPad"||t==="Android Tablet"?"Tablet":t?"Mobile":"Desktop"},referrer:function(){return Ce.referrer||"$direct"},referringDomain:function(){if(!Ce.referrer)return"$direct";var e=Ce.createElement("a");return e.href=Ce.referrer,e.host},properties:function(){var e,t,r,n,i,s,o,a=Be.os(dt),l=a.os_name,u=a.os_version;return Xe(cc({$os:l,$os_version:u,$browser:Be.browser(dt,navigator.vendor,window.opera),$device:Be.device(dt),$device_type:Be.deviceType(dt)}),{$current_url:(e=window)===null||e===void 0?void 0:e.location.href,$host:(t=window)===null||t===void 0?void 0:t.location.host,$pathname:(r=window)===null||r===void 0?void 0:r.location.pathname,$raw_user_agent:dt.length>1e3?dt.substring(0,997)+"...":dt,$browser_version:Be.browserVersion(dt,navigator.vendor,window.opera),$browser_language:Be.browserLanguage(),$screen_height:(n=window)===null||n===void 0?void 0:n.screen.height,$screen_width:(i=window)===null||i===void 0?void 0:i.screen.width,$viewport_height:(s=window)===null||s===void 0?void 0:s.innerHeight,$viewport_width:(o=window)===null||o===void 0?void 0:o.innerWidth,$lib:"web",$lib_version:fn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:sp()/1e3})},people_properties:function(){var e=Be.os(dt),t=e.os_name,r=e.os_version;return Xe(cc({$os:t,$os_version:r,$browser:Be.browser(dt,navigator.vendor,window.opera)}),{$browser_version:Be.browserVersion(dt,navigator.vendor,window.opera)})}},pb=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],gd=function(){function e(t){Me(this,e);var r="";t.token&&(r=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=t.custom_campaign_params||[],t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+r+"_posthog",pb.indexOf(t.persistence.toLowerCase())===-1&&(j.critical("Unknown persistence type "+t.persistence+"; falling back to cookie"),t.persistence="cookie");var n=t.persistence.toLowerCase();n==="localstorage"&&Ae.is_supported()?this.storage=Ae:n==="localstorage+cookie"&&mc.is_supported()?this.storage=mc:n==="sessionstorage"&&Ue.is_supported()?this.storage=Ue:this.storage=n==="memory"?db:cr,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return Ie(e,[{key:"properties",value:function(){var t={};return be(this.props,function(r,n){if(n===Fn&&Rr(r))for(var i=Object.keys(r),s=0;s<i.length;s++)t["$feature/".concat(i[s])]=r[i[s]];else a=n,l=!1,(Wt(o=ab)?l:id&&o.indexOf===id?o.indexOf(a)!=-1:(be(o,function(u){if(l||(l=u===a))return zc}),l))||(t[n]=r);var o,a,l}),t}},{key:"load",value:function(){if(!this.disabled){var t=this.storage.parse(this.name);t&&(this.props=Xe({},t))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(t,r,n){var i=this;if(Rr(t)){se(r)&&(r="None"),this.expire_days=se(n)?this.default_expiry:n;var s=!1;if(be(t,function(o,a){i.props.hasOwnProperty(a)&&i.props[a]!==r||(i.props[a]=o,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(t,r){var n=this;if(Rr(t)){this.expire_days=se(r)?this.default_expiry:r;var i=!1;if(be(t,function(s,o){t.hasOwnProperty(o)&&n.props[o]!==s&&(n.props[o]=s,i=!0)}),i)return this.save(),!0}return!1}},{key:"unregister",value:function(t){t in this.props&&(delete this.props[t],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(Be.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(Be.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||Be.referrer(),$referring_domain:this.props.$referring_domain||Be.referringDomain()})}},{key:"get_referrer_info",value:function(){return cc({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(t){return be(this.props,function(r,n){n in t||(t[n]=r)}),t}},{key:"update_config",value:function(t){this.default_expiry=this.expire_days=t.cookie_expiration,this.set_disabled(t.disable_persistence),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie)}},{key:"set_disabled",value:function(t){this.disabled=t,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(t){t!==this.cross_subdomain&&(this.cross_subdomain=t,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(t){t!==this.secure&&(this.secure=t,this.remove(),this.save())}},{key:"set_event_timer",value:function(t,r){var n=this.props[Di]||{};n[t]=r,this.props[Di]=n,this.save()}},{key:"remove_event_timer",value:function(t){var r=(this.props[Di]||{})[t];return se(r)||(delete this.props[Di][t],this.save()),r}},{key:"get_user_state",value:function(){return this.props[hc]||"anonymous"}},{key:"set_user_state",value:function(t){this.props[hc]=t,this.save()}},{key:"get_quota_limits",value:function(){return this.props[pc]||{}}},{key:"set_quota_limits",value:function(t){this.props[pc]=t,this.save()}}]),e}(),vd=2,mb=4,dp=3,gb=6,vb=0,_b="rrweb/console@1",Nt,yb=Ie(function e(t){var r,n,i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Me(this,e),H(this,"bucketSize",100),H(this,"refillRate",10),H(this,"mutationBuckets",{}),H(this,"loggedTracker",{}),H(this,"refillBuckets",function(){Object.keys(i.mutationBuckets).forEach(function(o){i.mutationBuckets[o]=i.mutationBuckets[o]+i.refillRate,i.mutationBuckets[o]>=i.bucketSize&&delete i.mutationBuckets[o]})}),H(this,"getNodeOrRelevantParent",function(o){var a=i.rrweb.mirror.getNode(o);if((a==null?void 0:a.nodeName)!=="svg"&&a instanceof Element){var l=a.closest("svg");if(l)return[i.rrweb.mirror.getId(l),l]}return[o,a]}),H(this,"numberOfChanges",function(o){var a,l,u,c,h,m,f,p;return((a=(l=o.removes)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)+((u=(c=o.attributes)===null||c===void 0?void 0:c.length)!==null&&u!==void 0?u:0)+((h=(m=o.texts)===null||m===void 0?void 0:m.length)!==null&&h!==void 0?h:0)+((f=(p=o.adds)===null||p===void 0?void 0:p.length)!==null&&f!==void 0?f:0)}),H(this,"throttleMutations",function(o){if(o.type!==dp||o.data.source!==vb)return o;var a=o.data,l=i.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(function(c){var h,m,f,p=ws(i.getNodeOrRelevantParent(c.id),2),v=p[0],x=p[1];return i.mutationBuckets[v]===0?!1:(i.mutationBuckets[v]=(h=i.mutationBuckets[v])!==null&&h!==void 0?h:i.bucketSize,i.mutationBuckets[v]=Math.max(i.mutationBuckets[v]-1,0),i.mutationBuckets[v]===0&&(i.loggedTracker[v]||(i.loggedTracker[v]=!0,(m=(f=i.options).onBlockedNode)===null||m===void 0||m.call(f,v,x))),c)}));var u=i.numberOfChanges(a);return u!==0||l===u?o:void 0}),this.rrweb=t,this.options=s,this.refillRate=(r=this.options.refillRate)!==null&&r!==void 0?r:this.refillRate,this.bucketSize=(n=this.options.bucketSize)!==null&&n!==void 0?n:this.bucketSize,setInterval(function(){i.refillBuckets()},1e3)}),fp=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(fp||{}),bb="/s/";(function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"})(Nt||(Nt={}));var wb=[Nt.MouseMove,Nt.MouseInteraction,Nt.Scroll,Nt.ViewportResize,Nt.Input,Nt.TouchMove,Nt.MediaInteraction,Nt.Drag],xb=function(){function e(t){var r=this;if(Me(this,e),H(this,"_linkedFlagSeen",!1),H(this,"_lastActivityTimestamp",Date.now()),H(this,"isIdle",!1),H(this,"_linkedFlag",null),H(this,"_sampleRate",null),H(this,"_minimumDuration",null),this.instance=t,this._captureStarted=!1,this._endpoint=bb,this.stopRrweb=void 0,this.receivedDecide=!1,window.addEventListener("beforeunload",function(){r._flushBuffer()}),!this.instance.sessionManager)throw j.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=n.sessionId,s=n.windowId;this.windowId=s,this.sessionId=i,this.buffer=this.clearBuffer()}return Ie(e,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw j.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return sr(this._sampleRate)?this.instance.get_property(co):null}},{key:"sessionDuration",get:function(){var t,r,n=(t=this.buffer)===null||t===void 0?void 0:t.data[((r=this.buffer)===null||r===void 0?void 0:r.data.length)-1],i=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-i:null}},{key:"isRecordingEnabled",get:function(){var t=!!this.instance.get_property(uc),r=!this.instance.config.disable_session_recording;return t&&r}},{key:"isConsoleLogCaptureEnabled",get:function(){var t=!!this.instance.get_property(dd),r=this.instance.config.enable_recording_console_log;return r??t}},{key:"recordingVersion",get:function(){var t,r=this.instance.get_property(fd);return((t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recorderVersion)||r||"v1"}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?gt(this._linkedFlag)&&!this._linkedFlagSeen?"buffering":ac(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?this.startCaptureAndTrySendingQueuedSnapshots():(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1)}},{key:"makeSamplingDecision",value:function(t){var r,n=this.sessionId!==t;if(sr(this._sampleRate)){var i,s=this.isSampled;n||!ac(s)?i=Math.random()<this._sampleRate:i=s,i||j.warn("[SessionSampling] Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(t,") will not be sent to the server.")),(r=this.instance.persistence)===null||r===void 0||r.register(H({},co,i))}else{var o;(o=this.instance.persistence)===null||o===void 0||o.register(H({},co,null))}}},{key:"afterDecideResponse",value:function(t){var r,n,i,s,o,a,l,u=this;this.instance.persistence&&this.instance.persistence.register((H(l={},uc,!!t.sessionRecording),H(l,dd,(o=t.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled),H(l,fd,(a=t.sessionRecording)===null||a===void 0?void 0:a.recorderVersion),l));var c=(r=t.sessionRecording)===null||r===void 0?void 0:r.sampleRate;this._sampleRate=se(c)||Wt(c)?null:parseFloat(c);var h,m=(n=t.sessionRecording)===null||n===void 0?void 0:n.minimumDurationMilliseconds;if(this._minimumDuration=se(m)?null:m,this._linkedFlag=((i=t.sessionRecording)===null||i===void 0?void 0:i.linkedFlag)||null,(s=t.sessionRecording)!==null&&s!==void 0&&s.endpoint&&(this._endpoint=(h=t.sessionRecording)===null||h===void 0?void 0:h.endpoint),sr(this._sampleRate)&&this.sessionManager.onSessionId(function(p){u.makeSamplingDecision(p)}),gt(this._linkedFlag)){var f=this._linkedFlag;this.instance.onFeatureFlags(function(p){u._linkedFlagSeen=p.includes(f)})}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(r=this.instance.sessionRecording)===null||r===void 0||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(t)]}},timestamp:sp()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){this._startCapture()}},{key:"_startCapture",value:function(){var t=this;if(!se(Object.assign)&&!this._captureStarted&&!this.instance.config.disable_session_recording){this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId();var r=this.recordingVersion==="v2"?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.recordingVersion?Hi(this.instance.config.api_host+"/static/".concat(r,"?v=").concat(fn.LIB_VERSION),function(n){if(n)return j.error("Could not load ".concat(r),n);t._onScriptLoaded()}):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(t){var r;return t.type===dp&&wb.indexOf((r=t.data)===null||r===void 0?void 0:r.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(t){var r=this._isInteractiveEvent(t);if(r||this.isIdle||t.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0),r&&(this._lastActivityTimestamp=t.timestamp,this.isIdle&&(this.isIdle=!1,this._tryTakeFullSnapshot())),!this.isIdle){var n=this.sessionManager.checkAndGetSessionAndWindowId(!r,t.timestamp),i=n.windowId,s=n.sessionId,o=this.sessionId!==s,a=this.windowId!==i;this.windowId=i,this.sessionId=s,[vd,mb].indexOf(t.type)===-1&&(a||o)&&this._tryTakeFullSnapshot()}}},{key:"_tryTakeFullSnapshot",value:function(){if(!this._captureStarted)return!1;try{var t;return(t=this.rrwebRecord)===null||t===void 0||t.takeFullSnapshot(),!0}catch(r){return j.error("Error taking full snapshot.",r),!1}}},{key:"_onScriptLoaded",value:function(){var t,r=this,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var i=this.instance.config.session_recording,s=0,o=Object.entries(i||{});s<o.length;s++){var a=ws(o[s],2),l=a[0],u=a[1];l in n&&(n[l]=u)}this.rrwebRecord?(this.mutationRateLimiter=(t=this.mutationRateLimiter)!==null&&t!==void 0?t:new yb(this.rrwebRecord,{onBlockedNode:function(c,h){var m="Too many mutations on node '".concat(c,"'. Rate limiting. This could be due to SVG animations or something similar");j.info(m,{node:h}),r.log("[PostHog Recorder] "+m,"warn")}}),this.stopRrweb=this.rrwebRecord(J({emit:function(c){r.onRRwebEmit(c)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},n)),this.instance._addCaptureHook(function(c){try{if(c==="$pageview"){var h,m=r._maskUrl(window.location.href);if(!m)return;(h=r.rrwebRecord)===null||h===void 0||h.addCustomEvent("$pageview",{href:m})}}catch(f){j.error("Could not add $pageview to rrweb session",f)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1):j.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"onRRwebEmit",value:function(t){if(t&&Rr(t)){if(t.type===fp.Meta){var r=this._maskUrl(t.data.href);if(!r)return;t.data.href=r}var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(t):t;if(n){var i=function(o){var a=o;if(a&&Rr(a)&&a.type===gb&&Rr(a.data)&&a.data.plugin===_b){a.data.payload.payload.length>10&&(a.data.payload.payload=a.data.payload.payload.slice(0,10),a.data.payload.payload.push("...[truncated]"));for(var l=[],u=0;u<a.data.payload.payload.length;u++)a.data.payload.payload[u]&&a.data.payload.payload[u].length>2e3?l.push(a.data.payload.payload[u].slice(0,2e3)+"...[truncated]"):l.push(a.data.payload.payload[u]);return a.data.payload.payload=l,o}return o}(n),s={$snapshot_bytes:JSON.stringify(i).length,$snapshot_data:i,$session_id:this.sessionId,$window_id:this.windowId};this._updateWindowAndSessionIds(i),this.isIdle||(this.status!=="disabled"?this._captureSnapshotBuffered(s):this.clearBuffer())}}}},{key:"_maskUrl",value:function(t){var r=this.instance.config.session_recording;if(r.maskNetworkRequestFn){var n,i={url:t};return(n=i=r.maskNetworkRequestFn(i))===null||n===void 0?void 0:n.url}return t}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var t=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var r=this._minimumDuration,n=this.sessionDuration,i=sr(r)&&sr(n)&&n<r;return this.status==="buffering"||i?(this.flushBufferTimer=setTimeout(function(){t._flushBuffer()},2e3),this.buffer||this.clearBuffer()):this.buffer&&this.buffer.data.length!==0?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(t){var r,n=this,i=2+(((r=this.buffer)===null||r===void 0?void 0:r.data.length)||0);(!this.buffer||this.buffer.size+t.$snapshot_bytes+i>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=t.$snapshot_bytes,this.buffer.data.push(t.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){n._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(t){this.instance.capture("$snapshot",t,{transport:"XHR",method:"POST",endpoint:this._endpoint,_noTruncate:!0,_batchKey:"recordings",_metrics:{rrweb_full_snapshot:t.$snapshot_data.type===vd}})}}]),e}(),Rt={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},Sb=["first-input","navigation","paint","resource"],Eb=["/s/","/e/"],kb=function(){function e(t){Me(this,e),H(this,"_forceAllowLocalhost",!1),this.instance=t}return Ie(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var t,r,n=this;if(!this.observer)if(se((t=window)===null||t===void 0||(r=t.PerformanceObserver)===null||r===void 0?void 0:r.supportedEntryTypes))j.info("[PerformanceObserver] not started because PerformanceObserver is not supported by this browser.");else if(!fb.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver(function(s){s.getEntries().forEach(function(o){n._capturePerformanceEvent(o)})});var i=PerformanceObserver.supportedEntryTypes.filter(function(s){return Sb.includes(s)});i.forEach(function(s){var o;(o=n.observer)===null||o===void 0||o.observe({type:s,buffered:!0})})}catch(s){j.error("PostHog failed to start performance observer",s),this.stopObserving()}else j.info("[PerformanceObserver] not started because we are on localhost.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var t,r;return(t=(r=this.instance.config.capture_performance)!==null&&r!==void 0?r:this.remoteEnabled)!==null&&t!==void 0&&t}},{key:"afterDecideResponse",value:function(t){this.remoteEnabled=t.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(t){if(t.name.indexOf(this.instance.config.api_host)===0){var r=t.name.replace(this.instance.config.api_host,"");if(Eb.find(function(f){return r.indexOf(f)===0}))return}var n={url:t.name},i=this.instance.config.session_recording;if(i.maskNetworkRequestFn&&(n=i.maskNetworkRequestFn(n)),n){var s=t.toJSON();s.name=n.url;var o={},a=Math.floor(Date.now()-performance.now());for(var l in o[Rt.timeOrigin]=a,o[Rt.timestamp]=Math.floor(a+t.startTime),Rt)se(s[l])||(o[Rt[l]]=s[l]);if(this.capturePerformanceEvent(o),Tb(t)){var u,c=dn(t.serverTiming||[]);try{for(c.s();!(u=c.n()).done;){var h,m=u.value;this.capturePerformanceEvent((H(h={},Rt.timeOrigin,a),H(h,Rt.timestamp,Math.floor(a+t.startTime)),H(h,Rt.name,m.name),H(h,Rt.duration,m.duration),H(h,Rt.entryType,"serverTiming"),h))}}catch(f){c.e(f)}finally{c.f()}}}}},{key:"capturePerformanceEvent",value:function(t){var r,n=t[Rt.timestamp];(r=this.instance.sessionRecording)===null||r===void 0||r.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:t},timestamp:n})}}]),e}(),Tb=function(e){return e.entryType==="navigation"||e.entryType==="resource"},Cb=function(){function e(t){Me(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return Ie(e,[{key:"call",value:function(){var t=this,r=qc(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Rn),group_properties:this.instance.get_property(wr),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0}));this.instance._send_request("".concat(this.instance.config.api_host,"/decide/?v=3"),{data:r,verbose:!0},{method:"POST"},function(n){return t.parseDecideResponse(n)})}},{key:"parseDecideResponse",value:function(t){var r,n,i,s,o=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),(t==null?void 0:t.status)!==0){if(!document||!document.body)return j.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){o.parseDecideResponse(t)},500);this.instance.toolbar.afterDecideResponse(t),(r=this.instance.sessionRecording)===null||r===void 0||r.afterDecideResponse(t),xr.afterDecideResponse(t,this.instance),(n=this.instance.webPerformance)===null||n===void 0||n.afterDecideResponse(t),this.instance._afterDecideResponse(t),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.featureFlags.receivedFeatureFlags(t);var a=(i=window)===null||i===void 0?void 0:i.extendPostHogWithSurveys;t.surveys&&!a&&Hi(this.instance.config.api_host+"/static/surveys.js",function(f){if(f)return j.error("Could not load surveys script",f);window.extendPostHogWithSurveys(o.instance)});var l=(s=window)===null||s===void 0?void 0:s.extendPostHogWithExceptionAutoCapture;if(t.autocaptureExceptions&&t.autocaptureExceptions&&se(l)&&Hi(this.instance.config.api_host+"/static/exception-autocapture.js",function(f){if(f)return j.error("Could not load exception autocapture script",f);window.extendPostHogWithExceptionAutocapture(o.instance,t)}),t.siteApps)if(this.instance.config.opt_in_site_apps){var u,c=this.instance.config.api_host,h=dn(t.siteApps);try{var m=function(){var f=u.value,p=f.id,v=f.url,x=[c,c[c.length-1]==="/"&&v[0]==="/"?v.substring(1):v].join("");window["__$$ph_site_app_".concat(p)]=o.instance,Hi(x,function(S){S&&j.error("Error while initializing PostHog app with config id ".concat(p),S)})};for(h.s();!(u=h.n()).done;)m()}catch(f){h.e(f)}finally{h.f()}}else t.siteApps.length>0&&j.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else j.error("Failed to fetch feature flags from PostHog.")}}]),e}(),Pb=["https://app.posthog.com","https://eu.posthog.com"],Ab=["source"],Ob=U.location?$o(U.location.hash,"__posthog")||$o(location.hash,"state"):null,Mb=function(){function e(t){Me(this,e),this.instance=t}return Ie(e,[{key:"afterDecideResponse",value:function(t){var r=t.toolbarParams||t.editorParams||(t.toolbarVersion?{toolbarVersion:t.toolbarVersion}:{});t.isAuthenticated&&r.toolbarVersion&&r.toolbarVersion.indexOf("toolbar")===0&&this.loadToolbar(J({},r))}},{key:"maybeLoadToolbar",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U.location,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:U.history;try{if(!r){try{U.localStorage.setItem("test","test"),U.localStorage.removeItem("test")}catch{return!1}r=U.localStorage}var i,s=Ob||$o(t.hash,"__posthog")||$o(t.hash,"state"),o=s?od(function(){return JSON.parse(atob(decodeURIComponent(s)))})||od(function(){return JSON.parse(decodeURIComponent(s))}):null;return o&&o.action==="ph_authorize"?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:n?n.replaceState("",document.title,t.pathname+t.search):t.hash="")):((i=JSON.parse(r.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}},{key:"loadToolbar",value:function(t){var r=this;if(U._postHogToolbarLoaded)return!1;U._postHogToolbarLoaded=!0;var n=this.instance.config.api_host,i=3e5,s=Math.floor(Date.now()/i)*i,o="".concat(n).concat(n.endsWith("/")?"":"/","static/toolbar.js?t=").concat(s),a=!Pb.includes(this.instance.config.api_host)&&this.instance.config.advanced_disable_toolbar_metrics,l=J(J({token:this.instance.config.token},t),{},{apiURL:n},a?{instrument:!1}:{});l.source;var u=Y0(l,Ab);return U.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),Hi(o,function(c){c?j.error("Failed to load toolbar",c):(U.ph_load_toolbar||U.ph_load_editor)(l,r.instance)}),Bi(U,"turbolinks:load",function(){U._postHogToolbarLoaded=!1,r.loadToolbar(l)}),!0}},{key:"_loadEditor",value:function(t){return this.loadToolbar(t)}},{key:"maybeLoadEditor",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U.location,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:U.history;return this.maybeLoadToolbar(t,r,n)}}]),e}(),Ib="__ph_opt_in_out_";function $b(e,t){pp(!0,e,t)}function Fb(e,t){pp(!1,e,t)}function Rb(e,t){return hp(e,t)==="1"}function _d(e,t){return!!function(r){if(r&&r.respectDnt){var n=r&&r.window||U,i=n.navigator||{},s=!1;return be([i.doNotTrack,i.msDoNotTrack,n.doNotTrack],function(o){de([!0,1,"1","yes"],o)&&(s=!0)}),s}return!1}(t)||hp(e,t)==="0"}function jb(e,t){Vc(t=t||{}).remove(Qc(e,t),!!t.crossSubdomainCookie)}function Vc(e){return(e=e||{}).persistenceType==="localStorage"?Ae:e.persistenceType==="localStorage+cookie"?mc:cr}function Qc(e,t){return((t=t||{}).persistencePrefix||Ib)+e}function hp(e,t){return Vc(t).get(Qc(e,t))}function pp(e,t,r){gt(t)&&t.length?(Vc(r=r||{}).set(Qc(t,r),e?1:0,sr(r.cookieExpiration)?r.cookieExpiration:null,r.crossSubdomainCookie,r.secureCookie),r.capture&&e&&r.capture(r.captureEventName||"$opt_in",r.captureProperties||{},{send_instantly:!0})):j.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}var mp=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3e3;Me(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return Ie(e,[{key:"setPollInterval",value:function(t){this._pollInterval=t,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return new Date().getTime()}}]),e}(),Nb=function(e){ep(r,mp);var t=tp(r);function r(n){var i,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e3;return Me(this,r),(i=t.call(this,s)).handlePollRequest=n,i}return Ie(r,[{key:"enqueue",value:function(n,i,s){this._event_queue.push({url:n,data:i,options:s}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var n=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(n._event_queue.length>0){var i=n.formatQueue(),s=function(a){var l=i[a],u=l.url,c=l.data,h=l.options;be(c,function(m,f){c[f].offset=Math.abs(c[f].timestamp-n.getTime()),delete c[f].timestamp}),n.handlePollRequest(u,c,h)};for(var o in i)s(o);n._event_queue.length=0,n._empty_queue_count=0}else n._empty_queue_count++;n._empty_queue_count>4&&(n.isPolling=!1,n._empty_queue_count=0),n.isPolling&&n.poll()},this._pollInterval)}},{key:"unload",value:function(){var n=this;clearTimeout(this._poller);var i=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var s=Object.values(i);[].concat(sc(s.filter(function(o){return o.url.indexOf("/e")===0})),sc(s.filter(function(o){return o.url.indexOf("/e")!==0}))).map(function(o){var a=o.url,l=o.data,u=o.options;n.handlePollRequest(a,l,J(J({},u),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var n={};return be(this._event_queue,function(i){var s=i.url,o=i.data,a=i.options,l=(a?a._batchKey:null)||s;se(n[l])&&(n[l]={data:[],url:s,options:a}),a&&n[l].options&&n[l].options._metrics&&!n[l].options._metrics.rrweb_full_snapshot&&(n[l].options._metrics.rrweb_full_snapshot=a._metrics.rrweb_full_snapshot),n[l].data.push(o)}),n}}]),r}(),vt=Uint8Array,ot=Uint16Array,di=Uint32Array,Wc=new vt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Xc=new vt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),yd=new vt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gp=function(e,t){for(var r=new ot(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new di(r[30]);for(n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)i[s]=s-r[n]<<5|n;return[r,i]},vp=gp(Wc,2),Lb=vp[0],gc=vp[1];Lb[28]=258,gc[258]=28;for(var bd=gp(Xc,0)[1],vc=new ot(32768),ke=0;ke<32768;++ke){var Qr=(43690&ke)>>>1|(21845&ke)<<1;Qr=(61680&(Qr=(52428&Qr)>>>2|(13107&Qr)<<2))>>>4|(3855&Qr)<<4,vc[ke]=((65280&Qr)>>>8|(255&Qr)<<8)>>>1}var Ui=function(e,t,r){for(var n=e.length,i=0,s=new ot(t);i<n;++i)++s[e[i]-1];var o,a=new ot(t);for(i=0;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;if(r){o=new ot(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],h=a[e[i]-1]++<<c,m=h|(1<<c)-1;h<=m;++h)o[vc[h]>>>l]=u}else for(o=new ot(n),i=0;i<n;++i)o[i]=vc[a[e[i]-1]++]>>>15-e[i];return o},pn=new vt(288);for(ke=0;ke<144;++ke)pn[ke]=8;for(ke=144;ke<256;++ke)pn[ke]=9;for(ke=256;ke<280;++ke)pn[ke]=7;for(ke=280;ke<288;++ke)pn[ke]=8;var Fo=new vt(32);for(ke=0;ke<32;++ke)Fo[ke]=5;var Xr,Db=Ui(pn,9,0),Bb=Ui(Fo,5,0),_p=function(e){return(e/8>>0)+(7&e&&1)},yp=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof ot?ot:e instanceof di?di:vt)(r-t);return n.set(e.subarray(t,r)),n},tr=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Ri=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},al=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,s=r.slice();if(!i)return[new vt(0),0];if(i==1){var o=new vt(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort(function(y,O){return y.f-O.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,h=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=r[r[u].f<r[h].f?u++:h++],l=r[u!=c&&r[u].f<r[h].f?u++:h++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var m=s[0].s;for(n=1;n<i;++n)s[n].s>m&&(m=s[n].s);var f=new ot(m+1),p=Hb(r[c-1],f,0);if(p>t){n=0;var v=0,x=p-t,S=1<<x;for(s.sort(function(y,O){return f[O.s]-f[y.s]||y.f-O.f});n<i;++n){var k=s[n].s;if(!(f[k]>t))break;v+=S-(1<<p-f[k]),f[k]=t}for(v>>>=x;v>0;){var T=s[n].s;f[T]<t?v-=1<<t-f[T]++-1:++n}for(;n>=0&&v;--n){var P=s[n].s;f[P]==t&&(--f[P],++v)}p=t}return[new vt(f),p]},Hb=function e(t,r,n){return t.s==-1?Math.max(e(t.l,r,n+1),e(t.r,r,n+1)):r[t.s]=n},wd=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ot(++t),n=0,i=e[0],s=1,o=function(l){r[n++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[r.subarray(0,n),t]},ji=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},uo=function(e,t,r){var n=r.length,i=_p(t+2);e[i]=255&n,e[i+1]=n>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;s<n;++s)e[i+s+4]=r[s];return 8*(i+4+n)},xd=function(e,t,r,n,i,s,o,a,l,u,c){tr(t,c++,r),++i[256];for(var h=al(i,15),m=h[0],f=h[1],p=al(s,15),v=p[0],x=p[1],S=wd(m),k=S[0],T=S[1],P=wd(v),y=P[0],O=P[1],M=new ot(19),E=0;E<k.length;++E)M[31&k[E]]++;for(E=0;E<y.length;++E)M[31&y[E]]++;for(var I=al(M,7),R=I[0],N=I[1],z=19;z>4&&!R[yd[z-1]];--z);var Y,q,ae,ge,Se=u+5<<3,ve=ji(i,pn)+ji(s,Fo)+o,ye=ji(i,m)+ji(s,v)+o+14+3*z+ji(M,R)+(2*M[16]+3*M[17]+7*M[18]);if(Se<=ve&&Se<=ye)return uo(t,c,e.subarray(l,l+u));if(tr(t,c,1+(ye<ve)),c+=2,ye<ve){Y=Ui(m,f,0),q=m,ae=Ui(v,x,0),ge=v;var V=Ui(R,N,0);for(tr(t,c,T-257),tr(t,c+5,O-1),tr(t,c+10,z-4),c+=14,E=0;E<z;++E)tr(t,c+3*E,R[yd[E]]);c+=3*z;for(var Z=[k,y],ce=0;ce<2;++ce){var ue=Z[ce];for(E=0;E<ue.length;++E){var Te=31&ue[E];tr(t,c,V[Te]),c+=R[Te],Te>15&&(tr(t,c,ue[E]>>>5&127),c+=ue[E]>>>12)}}}else Y=Db,q=pn,ae=Bb,ge=Fo;for(E=0;E<a;++E)if(n[E]>255){Te=n[E]>>>18&31,Ri(t,c,Y[Te+257]),c+=q[Te+257],Te>7&&(tr(t,c,n[E]>>>23&31),c+=Wc[Te]);var ee=31&n[E];Ri(t,c,ae[ee]),c+=ge[ee],ee>3&&(Ri(t,c,n[E]>>>5&8191),c+=Xc[ee])}else Ri(t,c,Y[n[E]]),c+=q[n[E]];return Ri(t,c,Y[256]),c+q[256]},Ub=new di([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Gb=new vt(0),zb=function(){for(var e=new di(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),qb=function(){var e=4294967295;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=zb[255&r^t[n]]^r>>>8;e=r},d:function(){return 4294967295^e}}},Vb=function(e,t,r,n,i){return function(s,o,a,l,u,c){var h=s.length,m=new vt(l+h+5*(1+Math.floor(h/7e3))+u),f=m.subarray(l,m.length-u),p=0;if(!o||h<8)for(var v=0;v<=h;v+=65535){var x=v+65535;x<h?p=uo(f,p,s.subarray(v,x)):(f[v]=c,p=uo(f,p,s.subarray(v,h)))}else{for(var S=Ub[o-1],k=S>>>13,T=8191&S,P=(1<<a)-1,y=new ot(32768),O=new ot(P+1),M=Math.ceil(a/3),E=2*M,I=function(pr){return(s[pr]^s[pr+1]<<M^s[pr+2]<<E)&P},R=new di(25e3),N=new ot(288),z=new ot(32),Y=0,q=0,ae=(v=0,0),ge=0,Se=0;v<h;++v){var ve=I(v),ye=32767&v,V=O[ve];if(y[ye]=V,O[ve]=ye,ge<=v){var Z=h-v;if((Y>7e3||ae>24576)&&Z>423){p=xd(s,f,0,R,N,z,q,ae,Se,v-Se,p),ae=Y=q=0,Se=v;for(var ce=0;ce<286;++ce)N[ce]=0;for(ce=0;ce<30;++ce)z[ce]=0}var ue=2,Te=0,ee=T,Ke=ye-V&32767;if(Z>2&&ve==I(v-Ke))for(var Nr=Math.min(k,Z)-1,Ze=Math.min(32767,v),fr=Math.min(258,Z);Ke<=Ze&&--ee&&ye!=V;){if(s[v+ue]==s[v+ue-Ke]){for(var et=0;et<fr&&s[v+et]==s[v+et-Ke];++et);if(et>ue){if(ue=et,Te=Ke,et>Nr)break;var Xt=Math.min(Ke,et-2),D=0;for(ce=0;ce<Xt;++ce){var _t=v-Ke+ce+32768&32767,pt=_t-y[_t]+32768&32767;pt>D&&(D=pt,V=_t)}}}Ke+=(ye=V)-(V=y[ye])+32768&32767}if(Te){R[ae++]=268435456|gc[ue]<<18|bd[Te];var Ot=31&gc[ue],hr=31&bd[Te];q+=Wc[Ot]+Xc[hr],++N[257+Ot],++z[hr],ge=v+ue,++Y}else R[ae++]=s[v],++N[s[v]]}}p=xd(s,f,c,R,N,z,q,ae,Se,v-Se,p),c||(p=uo(f,p,Gb))}return yp(m,0,l+_p(p)+u)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!i)},_c=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Qb=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&_c(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}},Wb=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Xb(e,t){t===void 0&&(t={});var r=qb(),n=e.length;r.p(e);var i=Vb(e,t,Wb(t),8),s=i.length;return Qb(i,t),_c(i,s-8,r.d()),_c(i,s-4,n),i}function Yb(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new vt(e.length+(e.length>>>1)),i=0,s=function(u){n[i++]=u},o=0;o<r;++o){if(i+5>n.length){var a=new vt(i+8+(r-o<<1));a.set(n),n=a}var l=e.charCodeAt(o);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return yp(n,0,i)}(function(e){e.GZipJS="gzip-js",e.Base64="base64"})(Xr||(Xr={}));var bp=function(e,t,r){var n=t||{};n.ip=r.ip?1:0,n._=new Date().getTime().toString(),n.ver=fn.LIB_VERSION;var i=e.split("?");if(i.length>1){var s,o=dn(i[1].split("&"));try{for(o.s();!(s=o.n()).done;){var a=s.value.split("=")[0];se(n[a])||delete n[a]}}catch(u){o.e(u)}finally{o.f()}}var l=e.indexOf("?")>-1?"&":"?";return e+l+function(u){var c,h,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",f=[];return be(u,function(p,v){se(p)||se(v)||v==="undefined"||(c=encodeURIComponent(p.toString()),h=encodeURIComponent(v),f[f.length]=h+"="+c)}),f.join(m)}(n)},Yc=function e(t,r){if(r.blob&&t.buffer)return new Blob([rd(t)?t:t.buffer],{type:"text/plain"});if(r.sendBeacon||r.blob){var n=e(t,{method:"POST"});return new Blob([n],{type:"application/x-www-form-urlencoded"})}return r.method!=="POST"?null:(i=Ge(t)||rd(t)?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i);var i},wp=function(e){var t=e.url,r=e.data,n=e.headers,i=e.options,s=e.callback,o=e.retriesPerformedSoFar,a=e.retryQueue,l=e.onXHRError,u=e.timeout,c=u===void 0?6e4:u,h=e.onResponse;sr(o)&&o>0&&(t=bp(t,{retry_count:o},{}));var m=new XMLHttpRequest;m.open(i.method||"GET",t,!0);var f=Yc(r,i);be(n,function(p,v){m.setRequestHeader(v,p)}),i.method!=="POST"||i.blob||m.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),m.timeout=c,m.withCredentials=!0,m.onreadystatechange=function(){if(m.readyState===4)if(h==null||h(m),m.status===200){if(s){var p;try{p=JSON.parse(m.responseText)}catch(v){return void j.error(v)}s(p)}}else hn(l)&&l(m),(m.status<400||m.status>500)&&a.enqueue({url:t,data:r,options:i,headers:n,retriesPerformedSoFar:(o||0)+1,callback:s}),s==null||s({status:0})},m.send(f)},Jb=18e5,Kb=function(e){ep(r,mp);var t=tp(r);function r(n,i){var s;return Me(this,r),(s=t.call(this)).isPolling=!1,s.queue=[],s.areWeOnline=!0,s.onXHRError=n,s.rateLimiter=i,!se(window)&&"onLine"in window.navigator&&(s.areWeOnline=window.navigator.onLine,window.addEventListener("online",function(){s._handleWeAreNowOnline()}),window.addEventListener("offline",function(){s.areWeOnline=!1})),s}return Ie(r,[{key:"enqueue",value:function(n){var i=n.retriesPerformedSoFar||0;if(!(i>=10)){var s=function(l){var u=3e3*Math.pow(2,l),c=u/2,h=Math.min(Jb,u),m=(Math.random()-.5)*(h-c);return Math.ceil(h+m)}(i),o=new Date(Date.now()+s);this.queue.push({retryAt:o,requestData:n});var a="Enqueued failed request for retry in ".concat(s);navigator.onLine||(a+=" (Browser is offline)"),j.warn(a),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var n=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){n.areWeOnline&&n.queue.length>0&&n.flush(),n.poll()},this._pollInterval)}},{key:"flush",value:function(){var n=new Date(Date.now()),i=this.queue.filter(function(l){return l.retryAt<n});if(i.length>0){this.queue=this.queue.filter(function(l){return l.retryAt>=n});var s,o=dn(i);try{for(o.s();!(s=o.n()).done;){var a=s.value.requestData;this._executeXhrRequest(a)}}catch(l){o.e(l)}finally{o.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var n,i=dn(this.queue);try{for(i.s();!(n=i.n()).done;){var s=n.value.requestData,o=s.url,a=s.data,l=s.options;if(this.rateLimiter.isRateLimited(l._batchKey))j.warn("[RetryQueue] is quota limited. Dropping request.");else try{window.navigator.sendBeacon(o,Yc(a,J(J({},l),{},{sendBeacon:!0})))}catch(u){j.error(u)}}}catch(u){i.e(u)}finally{i.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(n){var i=n.url,s=n.data,o=n.options,a=n.headers,l=n.callback,u=n.retriesPerformedSoFar;this.rateLimiter.isRateLimited(o._batchKey)||wp({url:i,data:s||{},options:o||{},headers:a||{},retriesPerformedSoFar:u||0,callback:l,retryQueue:this,onXHRError:this.onXHRError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),r}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return sr(e)&&isFinite(e)&&Math.floor(e)===e});var Sd="0123456789abcdef",Zb=function(){function e(t){if(Me(this,e),this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}return Ie(e,[{key:"toString",value:function(){for(var t="",r=0;r<this.bytes.length;r++)t=t+Sd.charAt(this.bytes[r]>>>4)+Sd.charAt(15&this.bytes[r]),r!==3&&r!==5&&r!==7&&r!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(t){return this.compareTo(t)===0}},{key:"compareTo",value:function(t){for(var r=0;r<16;r++){var n=this.bytes[r]-t.bytes[r];if(n!==0)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,r,n,i){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(i)||t<0||r<0||n<0||i<0||t>0xffffffffffff||r>4095||n>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|r>>>8,s[7]=r,s[8]=128|n>>>24,s[9]=n>>>16,s[10]=n>>>8,s[11]=n,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new e(s)}}]),e}(),ew=function(){function e(){Me(this,e),H(this,"timestamp",0),H(this,"counter",0),H(this,"random",new tw)}return Ie(e,[{key:"generate",value:function(){var t=this.generateOrAbort();if(se(t)){this.timestamp=0;var r=this.generateOrAbort();if(se(r))throw new Error("Could not generate UUID after timestamp reset");return r}return t}},{key:"generateOrAbort",value:function(){var t=Date.now();if(t>this.timestamp)this.timestamp=t,this.resetCounter();else{if(!(t+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Zb.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),xp=function(e){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};!se(U.crypto)&&crypto.getRandomValues&&(xp=function(e){return crypto.getRandomValues(e)});var Ed,tw=function(){function e(){Me(this,e),H(this,"buffer",new Uint32Array(8)),H(this,"cursor",1/0)}return Ie(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(xp(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),jn=function(){return rw().toString()},rw=function(){return(Ed||(Ed=new ew)).generate()},Ws=1800,kd=60,nw=864e5,iw=function(){function e(t,r,n,i){Me(this,e),H(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=r,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||jn,this._windowIdGenerator=i||jn;var s=t.persistence_name||t.token,o=t.session_idle_timeout_seconds||Ws;if(sr(o)?o>Ws?j.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):o<kd&&j.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(j.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),o=Ws),this._sessionTimeoutMs=1e3*Math.min(Math.max(o,kd),Ws),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var a=Ue.parse(this._window_id_storage_key),l=Ue.parse(this._primary_window_exists_storage_key);a&&!l?this._windowId=a:Ue.remove(this._window_id_storage_key),Ue.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return Ie(e,[{key:"onSessionId",value:function(t){var r=this;return se(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(t),this._sessionId&&t(this._sessionId,this._windowId),function(){r._sessionIdChangedHandlers=r._sessionIdChangedHandlers.filter(function(n){return n!==t})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Ue.is_supported()}},{key:"_setWindowId",value:function(t){t!==this._windowId&&(this._windowId=t,this._canUseSessionStorage()&&Ue.set(this._window_id_storage_key,t))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ue.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(t,r,n){t===this._sessionId&&r===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=r,this._sessionId=t,this.persistence.register(H({},Mo,[r,t,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var t=this.persistence.props[Mo];return Ge(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var t=this;U.addEventListener("beforeunload",function(){t._canUseSessionStorage()&&Ue.remove(t._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),n=ws(this._getSessionId(),3),i=n[0],s=n[1],o=n[2],a=this._getWindowId(),l=o&&o>0&&Math.abs(r-o)>nw,u=!1,c=!s,h=!t&&Math.abs(r-i)>this._sessionTimeoutMs;c||h||l?(s=this._sessionIdGenerator(),a=this._windowIdGenerator(),o=r,u=!0):a||(a=this._windowIdGenerator(),u=!0);var m=i===0||!t||l?r:i,f=o===0?new Date().getTime():o;return this._setWindowId(a),this._setSessionId(s,m,f),u&&this._sessionIdChangedHandlers.forEach(function(p){return p(s,a)}),{sessionId:s,windowId:a,sessionStartTimestamp:f}}}]),e}(),sw=Ie(function e(t,r,n,i){Me(this,e),this.name="posthog-js",this.setupOnce=function(s){s(function(o){var a,l,u,c,h;if(o.level!=="error"||!t.__loaded)return o;o.tags||(o.tags={});var m=t.config.ui_host||t.config.api_host;o.tags["PostHog Person URL"]=m+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=((a=o.exception)===null||a===void 0?void 0:a.values)||[],p={$exception_message:(l=f[0])===null||l===void 0?void 0:l.value,$exception_type:(u=f[0])===null||u===void 0?void 0:u.type,$exception_personURL:m+"/person/"+t.get_distinct_id(),$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(c=f[0])===null||c===void 0?void 0:c.value,$sentry_exception_type:(h=f[0])===null||h===void 0?void 0:h.type,$sentry_tags:o.tags};return r&&n&&(p.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+o.event_id),t.capture("$exception",p),o})}}),ow=function(e){Promise&&Promise.resolve||j.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(r,n){r.event.userId||r.event.anonymousId===e.get_distinct_id()||e.reset(),r.event.userId&&r.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:r.event.userId}),e.reloadFeatureFlags());var i=e._calculate_event_properties(n,r.event.properties);return r.event.properties=Object.assign({},i,r.event.properties),r};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(r){return t(r,r.event.event)},page:function(r){return t(r,"$pageview")},identify:function(r){return t(r,"$identify")},screen:function(r){return t(r,"$screen")}}},aw=function(){function e(){var t=this;Me(this,e),H(this,"_hasSeenPageView",!1),H(this,"_updateScrollData",function(){var r,n,i,s;t._pageViewData||(t._pageViewData=t._createPageViewData());var o=t._pageViewData,a=t._scrollY(),l=t._scrollHeight(),u=t._contentY(),c=t._contentHeight();o.lastScrollY=a,o.maxScrollY=Math.max(a,(r=o.maxScrollY)!==null&&r!==void 0?r:0),o.maxScrollHeight=Math.max(l,(n=o.maxScrollHeight)!==null&&n!==void 0?n:0),o.lastContentY=u,o.maxContentY=Math.max(u,(i=o.maxContentY)!==null&&i!==void 0?i:0),o.maxContentHeight=Math.max(c,(s=o.maxContentHeight)!==null&&s!==void 0?s:0)})}return Ie(e,[{key:"_createPageViewData",value:function(){return{pathname:U.location.pathname}}},{key:"doPageView",value:function(){var t,r;return this._hasSeenPageView?(r=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,r=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),J({$prev_pageview_pathname:(t=r)===null||t===void 0?void 0:t.pathname},this._calculatePrevPageScrollProperties(r))}},{key:"doPageLeave",value:function(){var t=this._pageViewData;return J({$prev_pageview_pathname:t==null?void 0:t.pathname},this._calculatePrevPageScrollProperties(t))}},{key:"_calculatePrevPageScrollProperties",value:function(t){if(!t||t.maxScrollHeight==null||t.lastScrollY==null||t.maxScrollY==null||t.maxContentHeight==null||t.lastContentY==null||t.maxContentY==null)return{};var r=t.maxScrollHeight,n=t.lastScrollY,i=t.maxScrollY,s=t.maxContentHeight,o=t.lastContentY,a=t.maxContentY;return r=Math.ceil(r),n=Math.ceil(n),i=Math.ceil(i),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),{$prev_pageview_last_scroll:n,$prev_pageview_last_scroll_percentage:r<=1?1:Xs(n/r,0,1),$prev_pageview_max_scroll:i,$prev_pageview_max_scroll_percentage:r<=1?1:Xs(i/r,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:s<=1?1:Xs(o/s,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:s<=1?1:Xs(a/s,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){U.addEventListener("scroll",this._updateScrollData),U.addEventListener("scrollend",this._updateScrollData),U.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){U.removeEventListener("scroll",this._updateScrollData),U.removeEventListener("scrollend",this._updateScrollData),U.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollHeight",value:function(){return Math.max(0,U.document.documentElement.scrollHeight-U.document.documentElement.clientHeight)}},{key:"_scrollY",value:function(){return U.scrollY||U.pageYOffset||U.document.documentElement.scrollTop||0}},{key:"_contentHeight",value:function(){return U.document.documentElement.scrollHeight||0}},{key:"_contentY",value:function(){var t=U.document.documentElement.clientHeight||0;return this._scrollY()+t}}]),e}();function Xs(e,t,r){return Math.max(t,Math.min(e,r))}var Yi,Jc,He,lw={icontains:function(e){return window.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},regex:function(e){return hb(window.location.href,e)},exact:function(e){return window.location.href===e}},cw=function(){function e(t){Me(this,e),this.instance=t}return Ie(e,[{key:"getSurveys",value:function(t){var r=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(fc);if(i&&!n)return t(i);this.instance._send_request("".concat(this.instance.config.api_host,"/api/surveys/?token=").concat(this.instance.config.token),{},{method:"GET"},function(s){var o,a=s.surveys||[];return(o=r.instance.persistence)===null||o===void 0||o.register(H({},fc,a)),t(a)})}},{key:"getActiveMatchingSurveys",value:function(t){var r=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(i){var s=i.filter(function(o){return!(!o.start_date||o.end_date)}).filter(function(o){var a,l,u,c;if(!o.conditions)return!0;var h=(a=o.conditions)===null||a===void 0||!a.url||lw[(l=(u=o.conditions)===null||u===void 0?void 0:u.urlMatchType)!==null&&l!==void 0?l:"icontains"](o.conditions.url),m=(c=o.conditions)===null||c===void 0||!c.selector||document.querySelector(o.conditions.selector);return h&&m}).filter(function(o){if(!o.linked_flag_key&&!o.targeting_flag_key)return!0;var a=!o.linked_flag_key||r.instance.featureFlags.isFeatureEnabled(o.linked_flag_key),l=!o.targeting_flag_key||r.instance.featureFlags.isFeatureEnabled(o.targeting_flag_key);return a&&l});return t(s)},n)}}]),e}(),uw=6e4,dw=function(){function e(){var t=this;Me(this,e),H(this,"limits",{}),H(this,"checkForLimiting",function(r){try{var n=r.responseText;if(!n||!n.length)return;(JSON.parse(n).quota_limited||[]).forEach(function(i){j.info("[RateLimiter] ".concat(i||"events"," is quota limited.")),t.limits[i]=new Date().getTime()+uw})}catch(i){return void j.error(i)}})}return Ie(e,[{key:"isRateLimited",value:function(t){var r=this.limits[t||"events"]||!1;return r!==!1&&new Date().getTime()<r}}]),e}();(function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"})(Yi||(Yi={}));var yc=function(){},Ys={},ht="posthog",fo=U.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Sp=!fo&&dt.indexOf("MSIE")===-1&&dt.indexOf("Mozilla")===-1,Td=function(){var e,t,r;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=Ce==null?void 0:Ce.location,r=t==null?void 0:t.hostname,!!gt(r)&&r.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:yc,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:(U==null||(e=U.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(n){var i="Bad HTTP status: "+n.status+" "+n.statusText;j.error(i)},get_device_id:function(n){return n},_onCapture:yc,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},bc=function(e,t,r,n){var i,s=r!==ht&&He?r?He[r]:void 0:He,o={initComplete:!1,syncCode:!1},a=function(l){return function(u){o[l]||(o[l]=!0,o.initComplete&&o.syncCode&&(n==null||n(u)))}};if(s&&Jc===Yi.INIT_MODULE)i=s;else{if(s&&!Ge(s))return void j.error("You have already initialized "+r);i=new Kc}return i._init(e,t,r,a("initComplete")),i.toolbar.maybeLoadToolbar(),i.sessionRecording=new xb(i),i.sessionRecording.startRecordingIfEnabled(),i.webPerformance=new kb(i),i.webPerformance.startObservingIfEnabled(),i.config.__preview_measure_pageview_stats&&i.pageViewManager.startMeasuringScrollPosition(),i.__autocapture=i.config.autocapture,xr._setIsAutocaptureEnabled(i),xr._isAutocaptureEnabled&&(i.__autocapture=i.config.autocapture,xr.enabledForProject(i.config.token,100,100)?xr.isBrowserSupported()?xr.init(i):(i.__autocapture=!1,j.info("Disabling Automatic Event Collection because this browser is not supported")):(i.__autocapture=!1,j.info("Not in active bucket: disabling Automatic Event Collection."))),fn.DEBUG=fn.DEBUG||i.config.debug,!se(s)&&Ge(s)&&(i._execute_array.call(i.people,s.people),i._execute_array(s)),a("syncCode")(i),i},Kc=function(){function e(){var t=this;Me(this,e),this.config=Td(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=sw,this.segmentIntegration=function(){return ow(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.analyticsDefaultEndpoint="/e/",this.featureFlags=new lb(this),this.toolbar=new Mb(this),this.pageViewManager=new aw,this.surveys=new cw(this),this.rateLimiter=new dw,this.people={set:function(r,n,i){var s=gt(r)?H({},r,n):r;t.setPersonProperties(s),i==null||i({})},set_once:function(r,n,i){var s=gt(r)?H({},r,n):r;t.setPersonProperties(void 0,s),i==null||i({})}}}return Ie(e,[{key:"init",value:function(t,r,n){if(se(n))j.critical("You must name your new library: init(token, config, name)");else{if(n!==ht){var i=bc(t,r,n,function(s){He[n]=s,s._loaded()});return He[n]=i,i}j.critical("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(t){var r,n,i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var l,u={segmentRegister:!1,syncCode:!1},c=function(P){return function(){u[P]||(u[P]=!0,u.segmentRegister&&u.syncCode&&(a==null||a(i)))}};if(this.set_config(Xe({},Td(),s,{name:o,token:t,callback_fn:(o===ht?o:ht+"."+o)+"._jsc"})),this._jsc=function(){},(U!=null&&(r=U.rrweb)!==null&&r!==void 0&&r.record||U!=null&&U.rrwebRecord)&&(this.__loaded_recorder_version=U==null||(l=U.rrweb)===null||l===void 0?void 0:l.version),this.persistence=new gd(this.config),this._requestQueue=new Nb(this._handle_queued_event.bind(this)),this._retryQueue=new Kb(this.config.on_xhr_error,this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new iw(this.config,this.persistence),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new gd(J(J({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),s.segment?(this.config.get_device_id=function(){return s.segment.user().anonymousId()},s.segment.user().id()&&(this.register({distinct_id:s.segment.user().id()}),this.persistence.set_user_state("identified")),s.segment.register(this.segmentIntegration()).then(c("segmentRegister"))):c("segmentRegister")(),((n=s.bootstrap)===null||n===void 0?void 0:n.distinctID)!==void 0){var h,m,f=this.config.get_device_id(jn()),p=(h=s.bootstrap)!==null&&h!==void 0&&h.isIdentifiedID?f:s.bootstrap.distinctID;this.persistence.set_user_state((m=s.bootstrap)!==null&&m!==void 0&&m.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:p})}if(this._hasBootstrappedFeatureFlags()){var v,x,S=Object.keys(((v=s.bootstrap)===null||v===void 0?void 0:v.featureFlags)||{}).filter(function(P){var y,O;return!((y=s.bootstrap)===null||y===void 0||(O=y.featureFlags)===null||O===void 0||!O[P])}).reduce(function(P,y){var O,M;return P[y]=((O=s.bootstrap)===null||O===void 0||(M=O.featureFlags)===null||M===void 0?void 0:M[y])||!1,P},{}),k=Object.keys(((x=s.bootstrap)===null||x===void 0?void 0:x.featureFlagPayloads)||{}).filter(function(P){return S[P]}).reduce(function(P,y){var O,M,E,I;return(O=s.bootstrap)!==null&&O!==void 0&&(M=O.featureFlagPayloads)!==null&&M!==void 0&&M[y]&&(P[y]=(E=s.bootstrap)===null||E===void 0||(I=E.featureFlagPayloads)===null||I===void 0?void 0:I[y]),P},{});this.featureFlags.receivedFeatureFlags({featureFlags:S,featureFlagPayloads:k})}if(!this.get_distinct_id()){var T=this.config.get_device_id(jn());this.register_once({distinct_id:T,$device_id:T},""),this.persistence.set_user_state("anonymous")}U.addEventListener&&U.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),c("syncCode")()}},{key:"_afterDecideResponse",value:function(t){var r;if(this.compression={},t.supportedCompression&&!this.config.disable_compression){var n,i={},s=dn(t.supportedCompression);try{for(s.s();!(n=s.n()).done;)i[n.value]=!0}catch(o){s.e(o)}finally{s.f()}this.compression=i}(r=t.analytics)!==null&&r!==void 0&&r.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint)}},{key:"_loaded",value:function(){var t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(r){j.critical("`loaded` function failed",r)}this._start_queue_if_opted_in(),this.config.capture_pageview&&this.capture("$pageview",{title:Ce.title},{send_instantly:!0}),t||(new Cb(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var t;this.has_opted_out_capturing()||this.config.request_batching&&((t=this._requestQueue)===null||t===void 0||t.poll())}},{key:"_dom_loaded",value:function(){var t=this;this.has_opted_out_capturing()||Ln(this.__request_queue,function(r){t._send_request.apply(t,sc(r))}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(t,r){if(se(t))return null;if(fo)return function(o){t(o,r)};var n=this._jsc,i=""+Math.floor(1e8*Math.random()),s=this.config.callback_fn+"["+i+"]";return n[i]=function(o){delete n[i],t(o,r)},s}},{key:"_handle_unload",value:function(){var t,r;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),(t=this._requestQueue)===null||t===void 0||t.unload(),(r=this._retryQueue)===null||r===void 0||r.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(t,r,n){var i=JSON.stringify(r);this.__compress_and_send_json_request(t,i,n||Ys,yc)}},{key:"__compress_and_send_json_request",value:function(t,r,n,i){var s=function(u,c,h){return u===Xr.GZipJS?[Xb(Yb(c),{mtime:0}),J(J({},h),{},{blob:!0,urlQueryArgs:{compression:Xr.GZipJS}})]:[{data:qc(c)},h]}(this.compression[Xr.GZipJS]?Xr.GZipJS:Xr.Base64,r,n),o=ws(s,2),a=o[0],l=o[1];this._send_request(t,a,l,i)}},{key:"_send_request",value:function(t,r,n,i){if(this.__loaded&&this._retryQueue&&!this.rateLimiter.isRateLimited(n._batchKey))if(Sp)this.__request_queue.push([t,r,n,i]);else{var s={method:this.config.api_method,transport:this.config.api_transport,verbose:this.config.verbose};n=Xe(s,n||{}),fo||(n.method="GET");var o="sendBeacon"in U.navigator&&n.transport==="sendBeacon";if(t=bp(t,n.urlQueryArgs||{},{ip:this.config.ip}),o)try{U.navigator.sendBeacon(t,Yc(r,J(J({},n),{},{sendBeacon:!0})))}catch{}else if(fo)try{wp({url:t,data:r,headers:this.config.xhr_headers,options:n,callback:i,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.config.on_xhr_error,onResponse:this.rateLimiter.checkForLimiting})}catch(c){j.error(c)}else{var a,l=Ce.createElement("script");l.type="text/javascript",l.async=!0,l.defer=!0,l.src=t;var u=Ce.getElementsByTagName("script")[0];(a=u.parentNode)===null||a===void 0||a.insertBefore(l,u)}}}},{key:"_execute_array",value:function(t){var r,n=this,i=[],s=[],o=[];Ln(t,function(l){l&&(r=l[0],Ge(r)?o.push(l):hn(l)?l.call(n):Ge(l)&&r==="alias"?i.push(l):Ge(l)&&r.indexOf("capture")!==-1&&hn(n[r])?o.push(l):s.push(l))});var a=function(l,u){Ln(l,function(c){if(Ge(c[0])){var h=u;be(c,function(m){h=h[m[0]].apply(h,m.slice(1))})}else this[c[0]].apply(this,c.slice(1))},u)};a(i,this),a(s,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var t,r;return((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags)&&Object.keys((r=this.config.bootstrap)===null||r===void 0?void 0:r.featureFlags).length>0||!1}},{key:"push",value:function(t){this._execute_array([t])}},{key:"capture",value:function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ys;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return j.uninitializedWarning("posthog.capture");if(!function(c){var h=!1;try{var m=c.config.token,f=c.config.respect_dnt,p=c.config.opt_out_capturing_persistence_type,v=c.config.opt_out_capturing_cookie_prefix||void 0,x=c.config.window;m&&(h=_d(m,{respectDnt:f,persistenceType:p,persistencePrefix:v,window:x}))}catch(S){j.error("Unexpected error when checking capturing opt-out status: "+S)}return h}(this)){var i=(n=n||Ys).transport;if(i&&(n.transport=i),!se(t)&>(t)){if(!sb(dt,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var s={uuid:jn(),event:t,properties:this._calculate_event_properties(t,r||{})};t==="$identify"&&(s.$set=n.$set,s.$set_once=n.$set_once),(s=rb(s,n._noTruncate?null:this.config.properties_string_max_length)).timestamp=n.timestamp||new Date;var o=J(J({},s.properties.$set),s.$set);Z0(o)||this.setPersonPropertiesForFlags(o),j.info("send",s);var a=JSON.stringify(s),l=this.config.api_host+(n.endpoint||this.analyticsDefaultEndpoint),u=n!==Ys;return!this.config.request_batching||u&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(l,a,n):this._requestQueue.enqueue(l,s,n),this._invokeCaptureHooks(t,s),s}}else j.error("No event name provided to posthog.capture")}}},{key:"_addCaptureHook",value:function(t){this.__captureHooks.push(t)}},{key:"_invokeCaptureHooks",value:function(t,r){this.config._onCapture(t,r),be(this.__captureHooks,function(n){return n(t)})}},{key:"_calculate_event_properties",value:function(t,r){if(!this.persistence||!this.sessionPersistence)return r;var n=this.persistence.remove_event_timer(t),i=J({},r);if(i.token=this.config.token,t==="$snapshot"){var s=J(J({},this.persistence.properties()),this.sessionPersistence.properties());return i.distinct_id=s.distinct_id,i}var o=Be.properties();if(this.sessionManager){var a=this.sessionManager.checkAndGetSessionAndWindowId(),l=a.sessionId,u=a.windowId;i.$session_id=l,i.$window_id=u}if(this.config.__preview_measure_pageview_stats){var c={};t==="$pageview"?c=this.pageViewManager.doPageView():t==="$pageleave"&&(c=this.pageViewManager.doPageLeave()),i=Xe(i,c)}if(t==="$pageview"&&(i.title=Ce.title),t==="$performance_event"){var h=this.persistence.properties();return i.distinct_id=h.distinct_id,i.$current_url=o.$current_url,i}if(!se(n)){var m=new Date().getTime()-n;i.$duration=parseFloat((m/1e3).toFixed(3))}i=Xe({},Be.properties(),this.persistence.properties(),this.sessionPersistence.properties(),i);var f=this.config.property_blacklist;Ge(f)?be(f,function(v){delete i[v]}):j.error("Invalid value for property_blacklist config: "+f);var p=this.config.sanitize_properties;return p&&(i=p(i,t)),i}},{key:"register",value:function(t,r){var n;(n=this.persistence)===null||n===void 0||n.register(t,r)}},{key:"register_once",value:function(t,r,n){var i;(i=this.persistence)===null||i===void 0||i.register_once(t,r,n)}},{key:"register_for_session",value:function(t){var r;(r=this.sessionPersistence)===null||r===void 0||r.register(t)}},{key:"unregister",value:function(t){var r;(r=this.persistence)===null||r===void 0||r.unregister(t)}},{key:"unregister_for_session",value:function(t){var r;(r=this.sessionPersistence)===null||r===void 0||r.unregister(t)}},{key:"_register_single",value:function(t,r){this.register(H({},t,r))}},{key:"getFeatureFlag",value:function(t,r){return this.featureFlags.getFeatureFlag(t,r)}},{key:"getFeatureFlagPayload",value:function(t){var r=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(r)}catch{return r}}},{key:"isFeatureEnabled",value:function(t,r){return this.featureFlags.isFeatureEnabled(t,r)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(t,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,r)}},{key:"getEarlyAccessFeatures",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(t,r)}},{key:"onFeatureFlags",value:function(t){return this.featureFlags.onFeatureFlags(t)}},{key:"onSessionId",value:function(t){var r,n;return(r=(n=this.sessionManager)===null||n===void 0?void 0:n.onSessionId(t))!==null&&r!==void 0?r:function(){}}},{key:"getSurveys",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(t,r)}},{key:"getActiveMatchingSurveys",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(t,r)}},{key:"identify",value:function(t,r,n){if(!this.__loaded||!this.persistence)return j.uninitializedWarning("posthog.identify");if(t){var i=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==i&&t!==this.get_property(lo)&&(this.unregister(lo),this.register({distinct_id:t}));var o=this.persistence.get_user_state()==="anonymous";t!==i&&o?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(r||{},!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:i},{$set:r||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(i)):(r||n)&&this.setPersonProperties(r,n),t!==i&&(this.reloadFeatureFlags(),this.unregister(Io))}else j.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(t,r){(t||r)&&(this.setPersonPropertiesForFlags(t||{}),this.capture("$set",{$set:t||{},$set_once:r||{}}))}},{key:"group",value:function(t,r,n){if(t&&r){var i=this.getGroups();i[t]!==r&&this.resetGroupPropertiesForFlags(t),this.register({$groups:J(J({},i),{},H({},t,r))}),n&&(this.capture("$groupidentify",{$group_type:t,$group_key:r,$group_set:n}),this.setGroupPropertiesForFlags(H({},t,n))),i[t]===r||n||this.reloadFeatureFlags()}else j.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(t){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(t,r)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(t){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setGroupPropertiesForFlags(t,r)}},{key:"resetGroupPropertiesForFlags",value:function(t){this.featureFlags.resetGroupPropertiesForFlags(t)}},{key:"reset",value:function(t){var r,n,i,s;if(!this.__loaded)return j.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");(r=this.persistence)===null||r===void 0||r.clear(),(n=this.sessionPersistence)===null||n===void 0||n.clear(),(i=this.persistence)===null||i===void 0||i.set_user_state("anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var a=this.config.get_device_id(jn());this.register_once({distinct_id:a,$device_id:t?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var t,r;return(t=(r=this.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}},{key:"get_session_replay_url",value:function(t){if(!this.sessionManager)return"";var r=this.config.ui_host||this.config.api_host,n=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=n.sessionId,s=n.sessionStartTimestamp,o=r+"/replay/"+i;if(t!=null&&t.withTimestamp&&s){var a,l=(a=t.timestampLookBack)!==null&&a!==void 0?a:10;if(!s)return o;var u=Math.max(Math.floor((new Date().getTime()-s)/1e3)-l,0);o+="?t=".concat(u)}return o}},{key:"alias",value:function(t,r){return t===this.get_property(up)?(j.critical("Attempting to create alias for existing People user - aborting."),-2):(se(r)&&(r=this.get_distinct_id()),t!==r?(this._register_single(lo,t),this.capture("$create_alias",{alias:t,distinct_id:r})):(j.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1))}},{key:"set_config",value:function(t){var r,n,i=J({},this.config);Rr(t)&&(Xe(this.config,t),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),(r=this.persistence)===null||r===void 0||r.update_config(this.config),(n=this.sessionPersistence)===null||n===void 0||n.update_config(this.config),Ae.is_supported()&&Ae.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(fn.DEBUG=!0),this.sessionRecording&&!se(t.disable_session_recording)&&i.disable_session_recording!==t.disable_session_recording&&(t.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var t;return!((t=this.sessionRecording)===null||t===void 0||!t.started)}},{key:"loadToolbar",value:function(t){return this.toolbar.loadToolbar(t)}},{key:"get_property",value:function(t){var r;return(r=this.persistence)===null||r===void 0?void 0:r.props[t]}},{key:"getSessionProperty",value:function(t){var r;return(r=this.sessionPersistence)===null||r===void 0?void 0:r.props[t]}},{key:"toString",value:function(){var t,r=(t=this.config.name)!==null&&t!==void 0?t:ht;return r!==ht&&(r=ht+"."+r),r}},{key:"_gdpr_init",value:function(){this.config.opt_out_capturing_persistence_type==="localStorage"&&Ae.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.config.opt_out_capturing_by_default&&!cr.get("ph_optout")||(cr.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(t){var r,n,i,s,o;if(t&&t.clear_persistence)i=!0;else{if(!t||!t.enable_persistence)return;i=!1}this.config.disable_persistence||((r=this.persistence)===null||r===void 0?void 0:r.disabled)===i||(s=this.persistence)===null||s===void 0||s.set_disabled(i),this.config.disable_persistence||((n=this.sessionPersistence)===null||n===void 0?void 0:n.disabled)===i||(o=this.sessionPersistence)===null||o===void 0||o.set_disabled(i)}},{key:"_gdpr_call_func",value:function(t,r){return r=Xe({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},r||{}),Ae.is_supported()||r.persistence_type!=="localStorage"||(r.persistence_type="cookie"),t(this.config.token,{capture:r.capture,captureEventName:r.capture_event_name,captureProperties:r.capture_properties,persistenceType:r.persistence_type,persistencePrefix:r.cookie_prefix,cookieExpiration:r.cookie_expiration,crossSubdomainCookie:r.cross_subdomain_cookie,secureCookie:r.secure_cookie})}},{key:"opt_in_capturing",value:function(t){t=Xe({enable_persistence:!0},t||{}),this._gdpr_call_func($b,t),this._gdpr_update_persistence(t)}},{key:"opt_out_capturing",value:function(t){var r=Xe({clear_persistence:!0},t||{});this._gdpr_call_func(Fb,r),this._gdpr_update_persistence(r)}},{key:"has_opted_in_capturing",value:function(t){return this._gdpr_call_func(Rb,t)}},{key:"has_opted_out_capturing",value:function(t){return this._gdpr_call_func(_d,t)}},{key:"clear_opt_in_out_capturing",value:function(t){var r=Xe({enable_persistence:!0},t??{});this._gdpr_call_func(jb,r),this._gdpr_update_persistence(r)}},{key:"debug",value:function(t){t===!1?(U.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(U.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),e}();(function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=op(e.prototype[t[r]])})(Kc,["identify"]);var Cd,Pd,br={},fw=function(){He.init=function(e,t,r){if(r)return He[r]||(He[r]=br[r]=bc(e||"",t||{},r,function(i){He[r]=br[r]=i,i._loaded()})),He[r];var n=He;return br[ht]?n=br[ht]:e&&(n=bc(e,t||{},ht,function(i){br[ht]=i,i._loaded()}),br[ht]=n),He=n,Jc===Yi.INIT_SNIPPET&&(U[ht]=He),be(br,function(i,s){s!==ht&&(He[s]=i)}),n}},hw=function(){function e(){e.done||(e.done=!0,Sp=!1,be(br,function(t){t._dom_loaded()}))}Ce.addEventListener&&(Ce.readyState==="complete"?e():Ce.addEventListener("DOMContentLoaded",e,!1)),Bi(U,"load",e,!0)};(function(e){e.Popover="popover",e.API="api"})(Cd||(Cd={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Pd||(Pd={}));var ho=(Jc=Yi.INIT_MODULE,He=new Kc,fw(),He.init(),hw(),He),pw=C.createContext({client:ho});function mw(e){var t=e.children,r=e.client,n=e.apiKey,i=e.options,s=C.useMemo(function(){return r&&n&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),r&&i&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),r||(n&&(ho.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),ho.init(n,i)),ho)},[r,n]);return C.createElement(pw.Provider,{value:{client:s}},t)}const Ep=({children:e,user:t})=>g.jsx(mw,{apiKey:process.env.REACT_APP_PUBLIC_POSTHOG_KEY,options:{api_host:process.env.REACT_APP_PUBLIC_POSTHOG_HOST,autocapture:!1,secure_cookie:!0,bootstrap:{distinctID:(t==null?void 0:t.id)||"00000000-0000-0000-0000-000000000000",isIdentifiedID:!!(t!=null&&t.id)}},children:e}),kp=({children:e,locale:t,messages:r})=>{const n=t||"en",i={...pg[n],...r||{}};return g.jsx(Gv,{locale:n,messages:i,children:e})},dr=C.createContext(null),Tp=({children:e,user:t})=>g.jsx(dr.Provider,{value:t,children:e}),gw=({children:e,intl:t,user:r})=>g.jsx(kp,{locale:t==null?void 0:t.locale,messages:t==null?void 0:t.messages,children:g.jsx(Tp,{user:r,children:g.jsx(Zh,{children:g.jsx(Ep,{user:r,children:e})})})});const ll="joinCommunityButton",Zc=({isMember:e=!1,isShort:t=!1,functions:{join:r,leave:n}={join:()=>{},leave:()=>{}}})=>{const i=te(),s=C.useContext(dr),o=s&&typeof s.id=="string",[a,l]=C.useState(e),[u,c]=C.useState(e?"joined":"notJoined");C.useEffect(()=>{u==="joining"?c("joined"):u==="leaving"&&c("notJoined")},[a]);const h={},m={};return a&&u!=="leaving"&&(h["data-hover-text"]=i.formatMessage({id:`${ll}_leave`}),h["aria-label"]=i.formatMessage({id:`${ll}_member_aria`}),m["aria-hidden"]="true"),g.jsx(Oe,{variant:a?"secondary":"primary",size:"medium",styling:{fullWidth:!0},icon:a&&u!=="leaving"?{icon:"tick",position:"left"}:!1,onClick:async f=>{o&&(f.currentTarget.blur(),a?(c("leaving"),typeof n=="function"&&await n()):(c("joining"),typeof r=="function"&&await r()),l(!a))},className:L("join-community-button",u,{active:u==="joining"}),disabled:!o,...h,children:g.jsx("span",{className:"text",...m,children:i.formatMessage({id:`${ll}${["joining","leaving"].includes(u)?`_${u}`:a?"_member":t?"_short":""}`})})})};const cl="communityDetails_",vw=({isMember:e=!1,slug:t,members:{number:r,data:n}={number:void 0,data:[]},className:i="",...s})=>{const o=te(),a=r||(n==null?void 0:n.length)||0;return g.jsxs("div",{className:L("community-details",i),children:[g.jsx(go,{}),g.jsxs("div",{className:"member-details",children:[g.jsxs("div",{className:"top",children:[g.jsxs("h3",{children:[o.formatMessage({id:`${cl}members`}),g.jsx("span",{className:"count",children:a})]}),g.jsx("p",{className:"text-small",children:g.jsx("a",{href:`/communities/${t}/members`,children:o.formatMessage({id:`${cl}viewAll`})})})]}),g.jsx(Sh,{contributors:{total:r,data:n!=null&&n.length?n:[{},{},{},{},{}]},styling:{size:"medium",showGap:!0,showPlaceholders:a===0},cutoff:5})]}),g.jsx(Zc,{isMember:e,...s}),e&&g.jsx(Oe,{variant:"primary",icon:{icon:"plus"},styling:{fullWidth:!0},children:o.formatMessage({id:`${cl}invite`})})]})};const _w=({breadcrumbs:e,cutoff:t=20,className:r=""})=>{const n=te();return g.jsxs(g.Fragment,{children:[g.jsx(ze,{element:"p",children:n.formatMessage({id:"breadcrumbs_label"})}),g.jsx("ul",{className:L("breadcrumbs text-small",r),children:e.map(({text:i,href:s,current:o=!1},a)=>g.jsxs("li",{children:[o&&g.jsx(ze,{element:"span",children:n.formatMessage({id:"breadcrumbs_currentPage"})}),g.jsx(vs,{href:o?void 0:s,children:Ic(i,t)})]},`${window.btoa(i)}_${a}`))})]})};const yw=({options:e,allOption:t=!1,allowMultiple:r=!0,onChange:n=()=>{},className:i=""})=>{const s=te(),o=t?[{id:"all",text:typeof t!="boolean"&&t.text||s.formatMessage({id:"filters_all"})},...e]:e,[a,l]=C.useState(t?["all"]:[]),u=(c,h)=>{let m=[];a.includes(c)?m=a.filter(f=>f!==c):c==="all"?m=["all"]:r?m=[...a.filter(f=>f!=="all"),c]:m=[c],l(f=>(n&&typeof n=="function"&&n({current:m,previous:f}),m)),h&&typeof h=="function"&&h()};return g.jsx("ul",{className:L("filters",i),children:o.map(({id:c,text:h,disabled:m=!1,callback:f=()=>{}})=>{let p={};return m&&(p={disabled:!0,"aria-label":s.formatMessage({id:"filters_disabled"},{name:h})}),g.jsx("li",{children:g.jsx("button",{className:L(c,{selected:a.includes(c)}),onClick:v=>{v.preventDefault(),v.stopPropagation(),u(c,f)},...p,children:h})},c)})})},bw=(e,t)=>{const r=String(e);if(!t||!t.length)return`/${r}`;let n="";return t.forEach(({url:i,position:s})=>{s==="before-lang"?n+=`/${i}`:(n.includes(`/${r}/`)||(n+=`/${r}`),n+=`/${i}`)}),n.includes(`/${r}/`)||(n+=`/${r}`),n};const ul={en:"English",es:"Español",fr:"Français",pt:"Português"},Js="languageSwitcher_",ww=({currentLanguage:e,isOriginalLanguage:t=!1,isHumanTranslation:r=!1,translations:n,onChange:i=()=>{},urlParts:s,variant:o="default",label:a,className:l=""})=>{const u=te(),[c,h]=C.useState(e);if(C.useEffect(()=>{e!==c&&h(e)},[e]),!n||!Object.values(n).some(v=>v&&v.post_name))return null;const f=Object.keys(n),p=c!==e;return g.jsxs("div",{className:L("language-switcher text-small",o,l),children:[g.jsxs("nav",{children:[o!=="short"&&g.jsx("p",{children:a||u.formatMessage({id:`${Js}label`})}),g.jsx("ul",{children:f.map(v=>{if(!ul[v])return null;let x={className:v};return c===v?x["aria-label"]=u.formatMessage({id:`${Js}selected`},{language:ul[v]}):x={...x,href:bw(v,s),onClick:S=>{S.preventDefault(),S.stopPropagation(),h(v),i(v)}},g.jsx("li",{children:g.jsx(vs,{...x,fallbackElement:"span",children:ul[v]})},v)})}),o!=="short"&&!p&&g.jsx("p",{children:u.formatMessage({id:`${Js}translation_${t?"original":r?"human":"machine"}`})})]}),o!=="short"&&!p&&!t&&!r&&g.jsx("small",{children:u.formatMessage({id:`${Js}disclaimer`},{email:In.support,link:v=>{const x=`mailto:${v}`;return g.jsx("a",{href:x,children:v})}})})]})};const dl=Fl({locale:"en",messages:Tc}),Cp=({page:e=1,length:t=0,limit:r=10,loadNextPage:n=()=>{},icon:i=!1,messages:s={button:dl.formatMessage({id:"loadMore_button"}),endOfFeed:dl.formatMessage({id:"loadMore_endOfFeed"}),error:dl.formatMessage({id:"loadMore_error"})},className:o="",gtmContext:a="LoadMore"})=>{const[l,u]=C.useState(!1),[c,h]=C.useState(!1);if(t<=0||t<r*e)return null;const m=async f=>{try{await n(f)}catch(p){p instanceof Error&&p.message&&p.message.includes("Cannot read items")?h(!0):u(!0)}};return g.jsxs("footer",{className:L("load-more",o),children:[l&&g.jsx("p",{className:"error",children:s.error}),c?g.jsx("p",{children:s.endOfFeed}):g.jsx(Oe,{variant:"secondary",icon:i,onClick:m,"data-gtm-event-context":a,"data-gtm-event-type":"load-more-click",className:"gtm-trackable","data-testid":"load-more-button",children:s.button})]})};let Ks=!1;const Pp=({element:e="div",id:t="more-menu",options:r,className:n=""})=>{const i=te(),s=C.useRef(null),[o,a]=C.useState(!1),l=u=>{s.current&&u.target instanceof HTMLElement&&!s.current.contains(u.target)&&a(!1)};return C.useEffect(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)})),C.createElement(e,{ref:s,className:L("more-menu text-medium",n),children:g.jsxs(g.Fragment,{children:[g.jsx(Oe,{variant:"tertiary",size:"medium",icon:{icon:"ellipsis"},onClick:()=>a(!o),"aria-haspopup":"true","aria-expanded":o,"aria-controls":t,screenreaderText:i.formatMessage({id:"moreMenu"})}),g.jsx("ul",{id:t,hidden:!o,children:r.map(({href:u,onClick:c,text:h,icon:m,...f},p)=>{const v={...f,onClick:x=>{a(!1),typeof c=="function"&&c(x)},onFocus:()=>{Ks&&(clearTimeout(Ks),Ks=!1)},onBlur:()=>{Ks=setTimeout(()=>{a(!1)},100)}};return u&&(v.href=u),g.jsx("li",{children:g.jsx(Oe,{variant:"tertiary",size:"medium",icon:m?{icon:m,position:"left"}:!1,...v,children:h})},`${window.btoa(h)}_${p}`)})})]})})};const eu=({variant:e="default",version:t="default",className:r="",...n})=>g.jsx("p",{className:"logo-wrapper",children:g.jsx("a",{href:"/home/",className:L("logo",e,t,r),...n,children:g.jsx(ze,{children:g.jsx(Mr,{id:"apolitical"})})})});const xw={"2-1":901},Sw=({layout:e="2-1",hideOnMobile:t=!1,className:r="",children:n})=>{const i=ms(!0);let s=n;return C.Children.count(n)===1&&(s=C.Children.toArray(n)[0],s.props&&(s=s.props.children)),g.jsx("section",{className:L("columns",`layout-${e}`,r),children:C.Children.map(s,(o,a)=>t!==!1&&a===t&&i&&i<xw[e]?null:o)})};/*!
|
|
65
65
|
* cookie
|
|
66
66
|
* Copyright(c) 2012-2014 Roman Shtylman
|
|
67
67
|
* Copyright(c) 2015 Douglas Christopher Wilson
|