PageSourceSearch

https://adonisjs.com/assets/app-DAXQQnSt.js

js adonisjs.com collected 2026-09-25 03:53:46 UTC 355,600 bytes, 7 lines download raw bytes

1var e=!1,t=!1,n=[],r=-1,i=!1;function a(e){c(e)}function o(){i=!0}function s(){i=!1,u()}function c(e){n.includes(e)||n.push(e),u()}function l(e){let t=n.indexOf(e);t!==-1&&t>r&&n.splice(t,1)}function u(){if(!t&&!e){if(i)return;e=!0,queueMicrotask(d)}}function d(){e=!1,t=!0;for(let e=0;e<n.length;e++)n[e](),r=e;n.length=0,r=-1,t=!1}var f,p,m,h,g=!0;function _(e){g=!1,e(),g=!0}function v(e){f=e.reactive,m=e.release,p=t=>e.effect(t,{scheduler:e=>{g?a(e):e()}}),h=e.raw}function y(e){p=e}function b(e){let t=()=>{};return[n=>{let r=p(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(e=>e())}),e._x_effects.add(r),t=()=>{r!==void 0&&(e._x_effects.delete(r),m(r))},r},()=>{t()}]}function x(e,t){let n=!0,r,i,a=p(()=>{let a=e(),o=JSON.stringify(a);if(!n&&(typeof a==`object`||a!==r)){let e=typeof r==`object`?JSON.parse(i):r;queueMicrotask(()=>{t(a,e)})}r=a,i=o,n=!1});return()=>m(a)}async function S(e){o();try{await e(),await Promise.resolve()}finally{s()}}var C=[],w=[],T=[];function E(e){T.push(e)}function D(e,t){typeof t==`function`?(e._x_cleanups||=[],e._x_cleanups.push(t)):(t=e,w.push(t))}function O(e){C.push(e)}function k(e,t,n){e._x_attributeCleanups||={},e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(n)}function ee(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([n,r])=>{(t===void 0||t.includes(n))&&(r.forEach(e=>e()),delete e._x_attributeCleanups[n])})}function te(e){for(e._x_effects?.forEach(l);e._x_cleanups?.length;)e._x_cleanups.pop()()}var ne=new MutationObserver(de),A=!1;function re(){ne.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),A=!0}function ie(){oe(),ne.disconnect(),A=!1}var ae=[];function oe(){let e=ne.takeRecords();ae.push(()=>e.length>0&&de(e));let t=ae.length;queueMicrotask(()=>{if(ae.length===t)for(;ae.length>0;)ae.shift()()})}function j(e){if(!A)return e();ie();let t=e();return re(),t}var se=!1,ce=[];function le(){se=!0}function ue(){se=!1,de(ce),ce=[]}function de(e){if(se){ce=ce.concat(e);return}let t=[],n=new Set,r=new Map,i=new Map;for(let a=0;a<e.length;a++)if(!e[a].target._x_ignoreMutationObserver&&(e[a].type===`childList`&&(e[a].removedNodes.forEach(e=>{e.nodeType===1&&e._x_marker&&n.add(e)}),e[a].addedNodes.forEach(e=>{if(e.nodeType===1){if(n.has(e)){n.delete(e);return}e._x_marker||t.push(e)}})),e[a].type===`attributes`)){let t=e[a].target,n=e[a].attributeName,o=e[a].oldValue,s=()=>{r.has(t)||r.set(t,[]),r.get(t).push({name:n,value:t.getAttribute(n)})},c=()=>{i.has(t)||i.set(t,[]),i.get(t).push(n)};t.hasAttribute(n)&&o===null?s():t.hasAttribute(n)?(c(),s()):c()}i.forEach((e,t)=>{ee(t,e)}),r.forEach((e,t)=>{C.forEach(n=>n(t,e))});for(let e of n)t.some(t=>t.contains(e))||w.forEach(t=>t(e));for(let e of t)e.isConnected&&T.forEach(t=>t(e));t=null,n=null,r=null,i=null}function fe(e){return he(me(e))}function pe(e,t,n){return e._x_dataStack=[t,...me(n||e)],()=>{e._x_dataStack=e._x_dataStack.filter(e=>e!==t)}}function me(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot==`function`&&e instanceof ShadowRoot?me(e.host):e.parentNode?me(e.parentNode):[]}function he(e){return new Proxy({objects:e},_e)}function ge(e,t){return e===null||e===Object.prototype?null:Object.prototype.hasOwnProperty.call(e,t)?e:ge(Object.getPrototypeOf(e),t)}var _e={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(e=>Object.keys(e))))},has({objects:e},t){return t!=Symbol.unscopables&&e.some(e=>Object.prototype.hasOwnProperty.call(e,t)||Reflect.has(e,t))},get({objects:e},t,n){return t==`toJSON`?ve:Reflect.get(e.find(e=>Reflect.has(e,t))||{},t,n)},set({objects:e},t,n,r){let i;for(let n of e)if(i=ge(n,t),i)break;i||=e[e.length-1];let a=Object.getOwnPropertyDescriptor(i,t);return a?.set&&a?.get?a.set.call(r,n)||!0:Reflect.set(i,t,n)}};function ve(){return Reflect.ownKeys(this).reduce((e,t)=>(e[t]=Reflect.get(this,t),e),{})}function ye(e){let t=e=>typeof e==`object`&&!Array.isArray(e)&&e!==null,n=(r,i=``)=>{Object.entries(Object.getOwnPropertyDescriptors(r)).forEach(([a,{value:o,enumerable:s}])=>{if(s===!1||o===void 0||typeof o==`object`&&o&&o.__v_skip)return;let c=i===``?a:`${i}.${a}`;typeof o==`object`&&o&&o._x_interceptor?r[a]=o.initialize(e,c,a):t(o)&&o!==r&&!(o instanceof Element)&&n(o,c)})};return n(e)}
1function be(e,t=()=>{}){let n={initialValue:void 0,_x_interceptor:!0,initialize(t,n,r){return e(this.initialValue,()=>xe(t,n),e=>Se(t,n,e),n,r)}};return t(n),e=>{if(typeof e==`object`&&e&&e._x_interceptor){let t=n.initialize.bind(n);n.initialize=(r,i,a)=>{let o=e.initialize(r,i,a);return n.initialValue=o,t(r,i,a)}}else n.initialValue=e;return n}}function xe(e,t){return t.split(`.`).reduce((e,t)=>e[t],e)}function Se(e,t,n){if(typeof t==`string`&&(t=t.split(`.`)),t.length===1)e[t[0]]=n;else if(t.length===0)throw error;else if(e[t[0]])return Se(e[t[0]],t.slice(1),n);else return e[t[0]]={},Se(e[t[0]],t.slice(1),n)}var Ce={};function we(e,t){Ce[e]=t}function Te(e,t){let n=Ee(t);return Object.entries(Ce).forEach(([r,i])=>{Object.defineProperty(e,`$${r}`,{get(){return i(t,n)},enumerable:!1})}),e}function Ee(e){let[t,n]=ot(e),r={interceptor:be,...t};return D(e,n),r}function De(e,t,n,...r){try{return n(...r)}catch(n){Oe(n,e,t)}}function Oe(...e){return ke(...e)}var ke=je;function Ae(e){ke=e}function je(e,t,n=void 0){e=Object.assign(e??{message:`No error message given.`},{el:t,expression:n}),console.warn(`Alpine Expression Error: ${e.message}
2
3${n?`Expression: "`+n+`"
4
5`:``}`,t),setTimeout(()=>{throw e},0)}var Me=!0;function Ne(e){let t=Me;Me=!1;let n=e();return Me=t,n}function Pe(e,t,n={}){let r;return Fe(e,t)(e=>r=e,n),r}function Fe(...e){return Ie(...e)}var Ie=()=>{};function Le(e){Ie=e}var Re;function ze(e){Re=e}function Be(e,t){let n={};Te(n,e);let r=[n,...me(e)],i=typeof t==`function`?Ve(r,t):We(r,t,e);return De.bind(null,e,t,i)}function Ve(e,t){return(n=()=>{},{scope:r={},params:i=[],context:a}={})=>{if(!Me){Ge(n,t,he([r,...e]),i);return}Ge(n,t.apply(he([r,...e]),i))}}var He={};function Ue(e,t){if(He[e])return He[e];let n=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,i=(()=>{try{let t=new n([`__self`,`scope`],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return Object.defineProperty(t,"name",{value:`[Alpine] ${e}`}),t}catch(n){return Oe(n,t,e),Promise.resolve()}})();return He[e]=i,i}function We(e,t,n){let r=Ue(t,n);return(i=()=>{},{scope:a={},params:o=[],context:s}={})=>{r.result=void 0,r.finished=!1;let c=he([a,...e]);if(typeof r==`function`){let e=r.call(s,r,c).catch(e=>Oe(e,n,t));r.finished?(Ge(i,r.result,c,o,n),r.result=void 0):e.then(e=>{Ge(i,e,c,o,n)}).catch(e=>Oe(e,n,t)).finally(()=>r.result=void 0)}}}function Ge(e,t,n,r,i){if(Me&&typeof t==`function`){let a=t.apply(n,r);a instanceof Promise?a.then(t=>Ge(e,t,n,r)).catch(e=>Oe(e,i,t)):e(a)}else typeof t==`object`&&t instanceof Promise?t.then(t=>e(t)):e(t)}function Ke(...e){return Re(...e)}function qe(e,t,n={}){let r={};Te(r,e);let i=[r,...me(e)],a=he([n.scope??{},...i]),o=n.params??[];if(t.includes(`await`)){let e=Object.getPrototypeOf(async function(){}).constructor;return new e([`scope`],`with (scope) { let __result = ${/^[\n\s]*if.*\(.*\)/.test(t.trim())||/^(let|const)\s/.test(t.trim())?`(async()=>{ ${t} })()`:t}; return __result }`).call(n.context,a)}{let e=/^[\n\s]*if.*\(.*\)/.test(t.trim())||/^(let|const)\s/.test(t.trim())?`(()=>{ ${t} })()`:t,r=Function([`scope`],`with (scope) { let __result = ${e}; return __result }`).call(n.context,a);return typeof r==`function`&&Me?r.apply(a,o):r}}var Je=`x-`;function Ye(e=``){return Je+e}function Xe(e){Je=e}var Ze={};function Qe(e,t){return Ze[e]=t,{before(t){if(!Ze[t]){console.warn(String.raw`Cannot find directive \`${t}\`. \`${e}\` will use the default order of execution`);return}let n=_t.indexOf(t);_t.splice(n>=0?n:_t.indexOf(`DEFAULT`),0,e)}}}function $e(e){return Object.keys(Ze).includes(e)}function et(e,t,n){if(t=Array.from(t),e._x_virtualDirectives){let n=Object.entries(e._x_virtualDirectives).map(([e,t])=>({name:e,value:t})),r=tt(n);n=n.map(e=>r.find(t=>t.name===e.name)?{name:`x-bind:${e.name}`,value:`"${e.value}"`}:e),t=t.concat(n)}let r={};return t.map(ut((e,t)=>r[e]=t)).filter(pt).map(ht(r,n)).sort(vt).map(t=>st(e,t))}function tt(e){return Array.from(e).map(ut()).filter(e=>!pt(e))}var nt=!1,rt=new Map,it=Symbol();function at(e){nt=!0;let t=Symbol();it=t,rt.set(t,[]);let n=()=>{for(;rt.get(t).length;)rt.get(t).shift()();rt.delete(t)};e(n),nt=!1,n()}function ot(e){let t=[],n=e=>t.push(e),[r,i]=b(e);return t.push(i),[{Alpine:$n,effect:r,cleanup:n,evaluateLater:Fe.bind(Fe,e),evaluate:Pe.bind(Pe,e)},()=>
5t.forEach(e=>e())]}function st(e,t){let n=Ze[t.type]||(()=>{}),[r,i]=ot(e);k(e,t.original,i);let a=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,r),n=n.bind(n,e,t,r),nt?rt.get(it).push(n):n())};return a.runCleanups=i,a}var ct=(e,t)=>({name:n,value:r})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:r}),lt=e=>e;function ut(e=()=>{}){return({name:t,value:n})=>{let{name:r,value:i}=dt.reduce((e,t)=>t(e),{name:t,value:n});return r!==t&&e(r,t),{name:r,value:i}}}var dt=[];function ft(e){dt.push(e)}function pt({name:e}){return mt().test(e)}var mt=()=>RegExp(`^${Je}([^:^.]+)\\b`);function ht(e,t){return({name:n,value:r})=>{n===r&&(r=``);let i=n.match(mt()),a=n.match(/:([a-zA-Z0-9\-_:]+)/),o=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=t||e[n]||n;return{type:i?i[1]:null,value:a?a[1]:null,modifiers:o.map(e=>e.replace(`.`,``)),expression:r,original:s}}}var gt=`DEFAULT`,_t=[`ignore`,`ref`,`id`,`data`,`anchor`,`bind`,`init`,`for`,`model`,`modelable`,`transition`,`show`,`if`,gt,`teleport`];function vt(e,t){let n=_t.indexOf(e.type)===-1?gt:e.type,r=_t.indexOf(t.type)===-1?gt:t.type;return _t.indexOf(n)-_t.indexOf(r)}function yt(e,t,n={},r={}){return e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0,...r}))}function bt(e,t){if(typeof ShadowRoot==`function`&&e instanceof ShadowRoot){Array.from(e.children).forEach(e=>bt(e,t));return}let n=!1;if(t(e,()=>n=!0),n)return;let r=e.firstElementChild;for(;r;)bt(r,t,!1),r=r.nextElementSibling}function xt(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var St=!1;function Ct(){St&&xt(`Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.`),St=!0,document.body||xt("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),yt(document,`alpine:init`),yt(document,`alpine:initializing`),re(),E(e=>It(e,bt)),D(e=>Lt(e)),O((e,t)=>{et(e,t).forEach(e=>e())}),Array.from(document.querySelectorAll(Dt().join(`,`))).filter(e=>!At(e.parentElement,!0)).forEach(e=>{It(e)}),yt(document,`alpine:initialized`),setTimeout(()=>{Rt()})}var wt=[],Tt=[];function Et(){return wt.map(e=>e())}function Dt(){return wt.concat(Tt).map(e=>e())}function Ot(e){wt.push(e)}function kt(e){Tt.push(e)}function At(e,t=!1){return jt(e,e=>{if((t?Dt():Et()).some(t=>e.matches(t)))return!0})}function jt(e,t){if(e){if(t(e))return e;if(e._x_teleportBack)return jt(e._x_teleportBack,t);if(e.parentNode instanceof ShadowRoot)return jt(e.parentNode.host,t);if(e.parentElement)return jt(e.parentElement,t)}}function Mt(e){return Et().some(t=>e.matches(t))}var Nt=[];function Pt(e){Nt.push(e)}var Ft=1;function It(e,t=bt,n=()=>{}){jt(e,e=>e._x_ignore)||at(()=>{t(e,(e,t)=>{e._x_marker||(n(e,t),Nt.forEach(n=>n(e,t)),et(e,e.attributes).forEach(e=>e()),e._x_ignore||(e._x_marker=Ft++),e._x_ignore&&t())})})}function Lt(e,t=bt){t(e,e=>{te(e),ee(e),delete e._x_marker})}function Rt(){[[`ui`,`dialog`,[`[x-dialog], [x-popover]`]],[`anchor`,`anchor`,[`[x-anchor]`]],[`sort`,`sort`,[`[x-sort]`]]].forEach(([e,t,n])=>{$e(t)||n.some(t=>{if(document.querySelector(t))return xt(`found "${t}", but missing ${e} plugin`),!0})})}var zt=[],Bt=!1;function Vt(e=()=>{}){return queueMicrotask(()=>{Bt||setTimeout(()=>{Ht()})}),new Promise(t=>{zt.push(()=>{e(),t()})})}function Ht(){for(Bt=!1;zt.length;)zt.shift()()}function Ut(){Bt=!0}function Wt(e,t){return Array.isArray(t)?Kt(e,t.join(` `)):typeof t==`object`&&t?qt(e,t):typeof t==`function`?Wt(e,t()):Kt(e,t)}function Gt(e){return e.split(/\s/).filter(Boolean)}function Kt(e,t){return t=t===!0?t=``:t||``,(t=>(e.classList.add(...t),()=>{e.classList.remove(...t)}))((t=>Gt(t).filter(t=>!e.classList.contains(t)).filter(Boolean))(t))}function qt(e,t){let n=Object.entries(t).flatMap(([e,t])=>t?Gt(e):!1).filter(Boolean),r=Object.entries(t).flatMap(([e,t])=>!t&&Gt(e)).filter(Boolean),i=[],a=[];return r.forEach(t=>{e.classList.contains(t)&&(e.classList.remove(t),a.push(t))}),n.forEach(t=>{e.classList.contains(t)||(e.classList.add(t),i.push(t))}),()=>{a.forEach(t=>
vendor: 5,196 bytes, line 5
5e.classList.add(t)),i.forEach(t=>e.classList.remove(t))}}function Jt(e,t){return typeof t==`object`&&t?Yt(e,t):Xt(e,t)}function Yt(e,t){let n={};return Object.entries(t).forEach(([t,r])=>{n[t]=e.style[t],t.startsWith(`--`)||(t=Zt(t)),e.style.setProperty(t,r)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute(`style`)}),()=>{Jt(e,n)}}function Xt(e,t){let n=e.getAttribute(`style`,t);return e.setAttribute(`style`,t),()=>{e.setAttribute(`style`,n||``)}}function Zt(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function Qt(e,t=()=>{}){let n=!1;return function(){n?t.apply(this,arguments):(n=!0,e.apply(this,arguments))}}Qe(`transition`,(e,{value:t,modifiers:n,expression:r},{evaluate:i})=>{typeof r==`function`&&(r=i(r)),r!==!1&&(!r||typeof r==`boolean`?en(e,n,t):$t(e,r,t))});function $t(e,t,n){tn(e,Wt,``),{enter:t=>{e._x_transition.enter.during=t},"enter-start":t=>{e._x_transition.enter.start=t},"enter-end":t=>{e._x_transition.enter.end=t},leave:t=>{e._x_transition.leave.during=t},"leave-start":t=>{e._x_transition.leave.start=t},"leave-end":t=>{e._x_transition.leave.end=t}}[n](t)}function en(e,t,n){tn(e,Jt);let r=!t.includes(`in`)&&!t.includes(`out`)&&!n,i=r||t.includes(`in`)||[`enter`].includes(n),a=r||t.includes(`out`)||[`leave`].includes(n);t.includes(`in`)&&!r&&(t=t.filter((e,n)=>n<t.indexOf(`out`))),t.includes(`out`)&&!r&&(t=t.filter((e,n)=>n>t.indexOf(`out`)));let o=!t.includes(`opacity`)&&!t.includes(`scale`),s=o||t.includes(`opacity`),c=o||t.includes(`scale`),l=+!s,u=c?on(t,`scale`,95)/100:1,d=on(t,`delay`,0)/1e3,f=on(t,`origin`,`center`),p=`opacity, transform`,m=on(t,`duration`,150)/1e3,h=on(t,`duration`,75)/1e3,g=`cubic-bezier(0.4, 0.0, 0.2, 1)`;i&&(e._x_transition.enter.during={transformOrigin:f,transitionDelay:`${d}s`,transitionProperty:p,transitionDuration:`${m}s`,transitionTimingFunction:g},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:`scale(1)`}),a&&(e._x_transition.leave.during={transformOrigin:f,transitionDelay:`${d}s`,transitionProperty:p,transitionDuration:`${h}s`,transitionTimingFunction:g},e._x_transition.leave.start={opacity:1,transform:`scale(1)`},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function tn(e,t,n={}){e._x_transition||={enter:{during:n,start:n,end:n},leave:{during:n,start:n,end:n},in(n=()=>{},r=()=>{}){rn(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,r)},out(n=()=>{},r=()=>{}){rn(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,r)}}}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,n,r){let i=document.visibilityState===`visible`?requestAnimationFrame:setTimeout,a=()=>i(n);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(n):a():e._x_transition?e._x_transition.in(n):a();return}e._x_hidePromise=e._x_transition?new Promise((t,n)=>{e._x_transition.out(()=>{},()=>t(r)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>n({isFromCancelledTransition:!0}))}):Promise.resolve(r),queueMicrotask(()=>{let t=nn(e);t?(t._x_hideChildren||=[],t._x_hideChildren.push(e)):i(()=>{let t=e=>{let n=Promise.all([e._x_hidePromise,...(e._x_hideChildren||[]).map(t)]).then(([e])=>e?.());return delete e._x_hidePromise,delete e._x_hideChildren,n};t(e).catch(e=>{if(!e.isFromCancelledTransition)throw e})})})};function nn(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:nn(t)}function rn(e,t,{during:n,start:r,end:i}={},a=()=>{},o=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(n).length===0&&Object.keys(r).length===0&&Object.keys(i).length===0){a(),o();return}let s,c,l;an(e,{start(){s=t(e,r)},during(){c=t(e,n)},before:a,end(){s(),l=t(e,i)},after:o,cleanup(){c(),l()}})}function an(e,t){let n,r,i,a=Qt(()=>{j(()=>{n=!0,r||t.before(),i||(t.end(),Ht()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(e){this.beforeCancels.push(e)},cancel:Qt(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();a()}),finish:a},j(()=>{t.start(),t.during()}),Ut(),requestAnimationFrame(()=>{if(n)return;let a=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,``).replace(`s`,``))*1e3,o=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,``).replace(`s`,``))*1e3;a===0&&(a=Number(getComputedStyle(e).animationDuration.replace(`s`,``))*1e3),j(()=>{t.before()}),r=!0,requestAnimationFrame(()=>{n||(j(()=>{t.end()}),Ht(),setTimeout(e._x_transitioning.finish,a+o),i=!0)})})}function on(e,t,n){if(e.indexOf(t)===-1)return n;let r=e[e.indexOf(t)+1];if(!r||t===`scale`&&isNaN(r))return n;if(t===`duration`||t===`delay`){let e=r.match(/([0-9]+)ms/);if(e)return e[1]}return t===`origin`&&[`top`,`right`,`left`,`center`,`bottom`].includes(e[e.indexOf(t)+2])?[r,e[e.indexOf(t)+2]].join(` `):r}var sn=!1;function cn(e,t=()=>{}){return(...n)=>sn?t(...n):e(...n)}function ln(e){return(...t)=>sn&&e(...t)}var un=[];function dn(e){un.push(e)}
5function fn(e,t){un.forEach(n=>n(e,t)),sn=!0,gn(()=>{It(t,(e,t)=>{t(e,()=>{})})}),sn=!1}var pn=!1;function mn(e,t){t._x_dataStack||=e._x_dataStack,sn=!0,pn=!0,gn(()=>{hn(t)}),sn=!1,pn=!1}function hn(e){let t=!1;It(e,(e,n)=>{bt(e,(e,r)=>{if(t&&Mt(e))return r();t=!0,n(e,r)})})}function gn(e){let t=p;y((e,n)=>{let r=t(e);return m(r),()=>{}}),e(),y(t)}function _n(e,t,n,r=[]){switch(e._x_bindings||=f({}),e._x_bindings[t]=n,t=r.includes(`camel`)?En(t):t,t){case`value`:vn(e,n);break;case`style`:bn(e,n);break;case`class`:yn(e,n);break;case`selected`:case`checked`:xn(e,t,n);break;default:Sn(e,t,n)}}function vn(e,t){if(In(e))e.attributes.value===void 0&&(e.value=t);else if(Fn(e))Number.isInteger(t)?e.value=t:!Array.isArray(t)&&typeof t!=`boolean`&&![null,void 0].includes(t)?e.value=String(t):e.checked=Array.isArray(t)?t.some(t=>Dn(t,e.value)):!!t;else if(e.tagName===`SELECT`)Tn(e,t);else{if(e.value===t)return;e.value=t===void 0?``:t}}function yn(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=Wt(e,t)}function bn(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=Jt(e,t)}function xn(e,t,n){Sn(e,t,n),wn(e,t,n)}function Sn(e,t,n){[null,void 0,!1].includes(n)&&jn(t)?e.removeAttribute(t):(An(t)&&(n=t),Cn(e,t,n))}function Cn(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}function wn(e,t,n){e[t]!==n&&(e[t]=n)}function Tn(e,t){let n=[].concat(t).map(e=>e+``);Array.from(e.options).forEach(e=>{e.selected=n.includes(e.value)})}function En(e){return e.toLowerCase().replace(/-(\w)/g,(e,t)=>t.toUpperCase())}function Dn(e,t){return e==t}function On(e){return[1,`1`,`true`,`on`,`yes`,!0].includes(e)?!0:[0,`0`,`false`,`off`,`no`,!1].includes(e)?!1:e?!!e:null}var kn=new Set(`allowfullscreen.async.autofocus.autoplay.checked.controls.default.defer.disabled.formnovalidate.inert.ismap.itemscope.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.selected.shadowrootclonable.shadowrootdelegatesfocus.shadowrootserializable`.split(`.`));function An(e){return kn.has(e)}function jn(e){return![`aria-pressed`,`aria-checked`,`aria-expanded`,`aria-selected`].includes(e)}function Mn(e,t,n){return e._x_bindings&&e._x_bindings[t]!==void 0?e._x_bindings[t]:Pn(e,t,n)}function Nn(e,t,n,r=!0){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];if(e._x_inlineBindings&&e._x_inlineBindings[t]!==void 0){let n=e._x_inlineBindings[t];return n.extract=r,Ne(()=>Pe(e,n.expression))}return Pn(e,t,n)}function Pn(e,t,n){let r=e.getAttribute(t);return r===null?typeof n==`function`?n():n:r===``?!0:An(t)?!![t,`true`].includes(r):r}function Fn(e){return e.type===`checkbox`||e.localName===`ui-checkbox`||e.localName===`ui-switch`}function In(e){return e.type===`radio`||e.localName===`ui-radio`}function Ln(e,t){let n;return function(){let r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){n=null,e.apply(r,i)},t)}}function Rn(e,t){let n;return function(){let r=this,i=arguments;n||(e.apply(r,i),n=!0,setTimeout(()=>n=!1,t))}}function zn({get:e,set:t},{get:n,set:r}){let i=!0,a,o=p(()=>{let o=e(),s=n();if(i)r(Bn(o)),i=!1;else{let e=JSON.stringify(o),n=JSON.stringify(s);e===a?e!==n&&t(Bn(s)):r(Bn(o))}a=JSON.stringify(e()),JSON.stringify(n())});return()=>{m(o)}}function Bn(e){return typeof e==`object`?JSON.parse(JSON.stringify(e)):e}function Vn(e){(Array.isArray(e)?e:[e]).forEach(e=>e($n))}var Hn={},Un=!1;function Wn(e,t){if(Un||=(Hn=f(Hn),!0),t===void 0)return Hn[e];Hn[e]=t,ye(Hn[e]),typeof t==`object`&&t&&t.hasOwnProperty(`init`)&&typeof t.init==`function`&&Hn[e].init()}function Gn(){return Hn}var Kn={};function qn(e,t){let n=typeof t==`function`?t:()=>t;return e instanceof Element?Yn(e,n()):(Kn[e]=n,()=>{})}function Jn(e){return Object.entries(Kn).forEach(([t,n])=>{Object.defineProperty(e,t,{get(){return(...e)=>n(...e)}})}),e}function Yn(e,t,n){let r=[];for(;r.length;)r.pop()();let i=Object.entries(t).map(([e,t])=>({name:e,value:t})),a=tt(i);return i=i.map(e=>a.find(t=>t.name===e.name)?{name:`x-bind:${e.name}`,value:`"${e.value}"`}:e),et(e,i,n).map(e=>{r.push(e.runCleanups),e()}),()=>{for(;r.length;)r.pop()()}}var Xn={};function Zn(e,t){Xn[e]=t}
5function Qn(e,t){return Object.entries(Xn).forEach(([n,r])=>{Object.defineProperty(e,n,{get(){return(...e)=>r.bind(t)(...e)},enumerable:!1})}),e}var $n={get reactive(){return f},get release(){return m},get effect(){return p},get raw(){return h},get transaction(){return S},version:`3.15.12`,flushAndStopDeferringMutations:ue,dontAutoEvaluateFunctions:Ne,disableEffectScheduling:_,startObservingMutations:re,stopObservingMutations:ie,setReactivityEngine:v,onAttributeRemoved:k,onAttributesAdded:O,closestDataStack:me,skipDuringClone:cn,onlyDuringClone:ln,addRootSelector:Ot,addInitSelector:kt,setErrorHandler:Ae,interceptClone:dn,addScopeToNode:pe,deferMutations:le,mapAttributes:ft,evaluateLater:Fe,interceptInit:Pt,initInterceptors:ye,injectMagics:Te,setEvaluator:Le,setRawEvaluator:ze,mergeProxies:he,extractProp:Nn,findClosest:jt,onElRemoved:D,closestRoot:At,destroyTree:Lt,interceptor:be,transition:rn,setStyles:Jt,mutateDom:j,directive:Qe,entangle:zn,throttle:Rn,debounce:Ln,evaluate:Pe,evaluateRaw:Ke,initTree:It,nextTick:Vt,prefixed:Ye,prefix:Xe,plugin:Vn,magic:we,store:Wn,start:Ct,clone:mn,cloneNode:fn,bound:Mn,$data:fe,watch:x,walk:bt,data:Zn,bind:qn};function er(e,t){let n=Object.create(null),r=e.split(`,`);for(let e=0;e<r.length;e++)n[r[e]]=!0;return t?e=>!!n[e.toLowerCase()]:e=>!!n[e]}var tr=Object.freeze({});Object.freeze([]);var nr=Object.prototype.hasOwnProperty,rr=(e,t)=>nr.call(e,t),ir=Array.isArray,ar=e=>ur(e)===`[object Map]`,or=e=>typeof e==`string`,sr=e=>typeof e==`symbol`,cr=e=>typeof e==`object`&&!!e,lr=Object.prototype.toString,ur=e=>lr.call(e),dr=e=>ur(e).slice(8,-1),fr=e=>or(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,pr=(e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),mr=(e,t)=>e!==t&&(e===e||t===t),hr=new WeakMap,gr=[],_r,vr=Symbol(`iterate`),yr=Symbol(`Map key iterate`);function br(e){return e&&e._isEffect===!0}function xr(e,t=tr){br(e)&&(e=e.raw);let n=wr(e,t);return t.lazy||n(),n}function Sr(e){e.active&&=(Tr(e),e.options.onStop&&e.options.onStop(),!1)}var Cr=0;function wr(e,t){let n=function(){if(!n.active)return e();if(!gr.includes(n)){Tr(n);try{return kr(),gr.push(n),_r=n,e()}finally{gr.pop(),Ar(),_r=gr[gr.length-1]}}};return n.id=Cr++,n.allowRecurse=!!t.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}function Tr(e){let{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}var Er=!0,Dr=[];function Or(){Dr.push(Er),Er=!1}function kr(){Dr.push(Er),Er=!0}function Ar(){let e=Dr.pop();Er=e===void 0||e}function jr(e,t,n){if(!Er||_r===void 0)return;let r=hr.get(e);r||hr.set(e,r=new Map);let i=r.get(n);i||r.set(n,i=new Set),i.has(_r)||(i.add(_r),_r.deps.push(i),_r.options.onTrack&&_r.options.onTrack({effect:_r,target:e,type:t,key:n}))}function Mr(e,t,n,r,i,a){let o=hr.get(e);if(!o)return;let s=new Set,c=e=>{e&&e.forEach(e=>{(e!==_r||e.allowRecurse)&&s.add(e)})};if(t===`clear`)o.forEach(c);else if(n===`length`&&ir(e))o.forEach((e,t)=>{(t===`length`||t>=r)&&c(e)});else switch(n!==void 0&&c(o.get(n)),t){case`add`:ir(e)?fr(n)&&c(o.get(`length`)):(c(o.get(vr)),ar(e)&&c(o.get(yr)));break;case`delete`:ir(e)||(c(o.get(vr)),ar(e)&&c(o.get(yr)));break;case`set`:ar(e)&&c(o.get(vr))}s.forEach(o=>{o.options.onTrigger&&o.options.onTrigger({effect:o,target:e,key:n,type:t,newValue:r,oldValue:i,oldTarget:a}),o.options.scheduler?o.options.scheduler(o):o()})}var Nr=er(`__proto__,__v_isRef,__isVue`),Pr=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(sr)),Fr=zr(),Ir=zr(!0),Lr=Rr();function Rr(){let e={};return[`includes`,`indexOf`,`lastIndexOf`].forEach(t=>{e[t]=function(...e){let n=M(this);for(let e=0,t=this.length;e<t;e++)jr(n,`get`,e+``);let r=n[t](...e);return r===-1||r===!1?n[t](...e.map(M)):r}}),[`push`,`pop`,`shift`,`unshift`,`splice`].forEach(t=>{e[t]=function(...e){Or();let n=M(this)[t].apply(this,e);return Ar(),n}}),e}function zr(e=!1,t=!1){return function(n,r,i){if(r===`__v_isReactive`)return!e;if(r===`__v_isReadonly`)return e;if(r===`__v_raw`&&i===(e?t?yi:vi:t?_i:gi).get(n))return n;let a=ir(n);if(!e&&a&&rr(Lr,r))return Reflect.get(Lr,r,i);let o=Reflect.get(n,r,i);return(sr(r)?Pr.has(r):Nr(r))||(e||jr(n,`get`,r),t)?o:Ti(o)?!a||!fr(r)?o.value:o:cr(o)?e?Ci(o):Si(o):o}}var Br=Vr();function Vr(e=!1){return function(t,n,r,i){let a=t[n];
5if(!e&&(r=M(r),a=M(a),!ir(t)&&Ti(a)&&!Ti(r)))return a.value=r,!0;let o=ir(t)&&fr(n)?Number(n)<t.length:rr(t,n),s=Reflect.set(t,n,r,i);return t===M(i)&&(o?mr(r,a)&&Mr(t,`set`,n,r,a):Mr(t,`add`,n,r)),s}}function Hr(e,t){let n=rr(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&Mr(e,`delete`,t,void 0,r),i}function Ur(e,t){let n=Reflect.has(e,t);return(!sr(t)||!Pr.has(t))&&jr(e,`has`,t),n}function Wr(e){return jr(e,`iterate`,ir(e)?`length`:vr),Reflect.ownKeys(e)}var Gr={get:Fr,set:Br,deleteProperty:Hr,has:Ur,ownKeys:Wr},Kr={get:Ir,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},qr=e=>cr(e)?Si(e):e,Jr=e=>cr(e)?Ci(e):e,Yr=e=>e,Xr=e=>Reflect.getPrototypeOf(e);function Zr(e,t,n=!1,r=!1){e=e.__v_raw;let i=M(e),a=M(t);t!==a&&!n&&jr(i,`get`,t),!n&&jr(i,`get`,a);let{has:o}=Xr(i),s=r?Yr:n?Jr:qr;if(o.call(i,t))return s(e.get(t));if(o.call(i,a))return s(e.get(a));e!==i&&e.get(t)}function Qr(e,t=!1){let n=this.__v_raw,r=M(n),i=M(e);return e!==i&&!t&&jr(r,`has`,e),!t&&jr(r,`has`,i),e===i?n.has(e):n.has(e)||n.has(i)}function $r(e,t=!1){return e=e.__v_raw,!t&&jr(M(e),`iterate`,vr),Reflect.get(e,`size`,e)}function ei(e){e=M(e);let t=M(this);return Xr(t).has.call(t,e)||(t.add(e),Mr(t,`add`,e,e)),this}function ti(e,t){t=M(t);let n=M(this),{has:r,get:i}=Xr(n),a=r.call(n,e);a?hi(n,r,e):(e=M(e),a=r.call(n,e));let o=i.call(n,e);return n.set(e,t),a?mr(t,o)&&Mr(n,`set`,e,t,o):Mr(n,`add`,e,t),this}function ni(e){let t=M(this),{has:n,get:r}=Xr(t),i=n.call(t,e);i?hi(t,n,e):(e=M(e),i=n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Mr(t,`delete`,e,void 0,a),o}function ri(){let e=M(this),t=e.size!==0,n=ar(e)?new Map(e):new Set(e),r=e.clear();return t&&Mr(e,`clear`,void 0,void 0,n),r}function ii(e,t){return function(n,r){let i=this,a=i.__v_raw,o=M(a),s=t?Yr:e?Jr:qr;return!e&&jr(o,`iterate`,vr),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}}function ai(e,t,n){return function(...r){let i=this.__v_raw,a=M(i),o=ar(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Yr:t?Jr:qr;return!t&&jr(a,`iterate`,c?yr:vr),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function oi(e){return function(...t){{let n=t[0]?`on key "${t[0]}" `:``;console.warn(`${pr(e)} operation ${n}failed: target is readonly.`,M(this))}return e!==`delete`&&this}}function si(){let e={get(e){return Zr(this,e)},get size(){return $r(this)},has:Qr,add:ei,set:ti,delete:ni,clear:ri,forEach:ii(!1,!1)},t={get(e){return Zr(this,e,!1,!0)},get size(){return $r(this)},has:Qr,add:ei,set:ti,delete:ni,clear:ri,forEach:ii(!1,!0)},n={get(e){return Zr(this,e,!0)},get size(){return $r(this,!0)},has(e){return Qr.call(this,e,!0)},add:oi(`add`),set:oi(`set`),delete:oi(`delete`),clear:oi(`clear`),forEach:ii(!0,!1)},r={get(e){return Zr(this,e,!0,!0)},get size(){return $r(this,!0)},has(e){return Qr.call(this,e,!0)},add:oi(`add`),set:oi(`set`),delete:oi(`delete`),clear:oi(`clear`),forEach:ii(!0,!0)};return[`keys`,`values`,`entries`,Symbol.iterator].forEach(i=>{e[i]=ai(i,!1,!1),n[i]=ai(i,!0,!1),t[i]=ai(i,!1,!0),r[i]=ai(i,!0,!0)}),[e,n,t,r]}var[ci,li,ui,di]=si();function fi(e,t){let n=t?e?di:ui:e?li:ci;return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(rr(n,r)&&r in t?n:t,r,i)}var pi={get:fi(!1,!1)},mi={get:fi(!0,!1)};function hi(e,t,n){let r=M(n);if(r!==n&&t.call(e,r)){let t=dr(e);console.warn(`Reactive ${t} contains both the raw and reactive versions of the same object${t===`Map`?` as keys`:``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var gi=new WeakMap,_i=new WeakMap,vi=new WeakMap,yi=new WeakMap;function bi(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function xi(e){return e.__v_skip||!Object.isExtensible(e)?0:bi(dr(e))}function Si(e){return e&&e.__v_isReadonly?e:wi(e,!1,Gr,pi,gi)}function Ci(e){return wi(e,!0,Kr,mi,vi)}function wi(e,t,n,r,i){if(!cr(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let a=i.get(e);if(a)return a;let o=xi(e);if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function M(e){return e&&M(e.__v_raw)||e}function Ti(e){return!!(e&&e.__v_isRef===!0)}we(`nextTick`,()=>Vt),we(`dispatch`,e=>yt.bind(yt,e)),we(`watch`,(e,{evaluateLater:t,cleanup:n})=>(e,r)=>{let i=t(e);n(x(()=>{let e;return i(t=>e=t),e},r))}),we(`store`,Gn),we(`data`,e=>fe(e)),we(`root`,e=>At(e)),we(`refs`,e=>(e._x_refs_proxy||=he(Ei(e)),e._x_refs_proxy));function Ei(e){let t=[];return jt(e,e=>
5{e._x_refs&&t.push(e._x_refs)}),t}var Di={};function Oi(e){return Di[e]||(Di[e]=0),++Di[e]}function ki(e,t){return jt(e,e=>{if(e._x_ids&&e._x_ids[t])return!0})}function Ai(e,t){e._x_ids||={},e._x_ids[t]||(e._x_ids[t]=Oi(t))}we(`id`,(e,{cleanup:t})=>(n,r=null)=>ji(e,`${n}${r?`-${r}`:``}`,t,()=>{let t=ki(e,n),i=t?t._x_ids[n]:Oi(n);return r?`${n}-${i}-${r}`:`${n}-${i}`})),dn((e,t)=>{e._x_id&&(t._x_id=e._x_id)});function ji(e,t,n,r){if(e._x_id||={},e._x_id[t])return e._x_id[t];let i=r();return e._x_id[t]=i,n(()=>{delete e._x_id[t]}),i}we(`el`,e=>e),Mi(`Focus`,`focus`,`focus`),Mi(`Persist`,`persist`,`persist`);function Mi(e,t,n){we(t,r=>xt(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,r))}Qe(`modelable`,(e,{expression:t},{effect:n,evaluateLater:r,cleanup:i})=>{let a=r(t),o=()=>{let e;return a(t=>e=t),e},s=r(`${t} = __placeholder`),c=e=>s(()=>{},{scope:{__placeholder:e}});c(o()),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let t=e._x_model.get,n=e._x_model.setWithModifiers;i(zn({get(){return t()},set(e){n(e)}},{get(){return o()},set(e){c(e)}}))})}),Qe(`teleport`,(e,{modifiers:t,expression:n},{cleanup:r})=>{e.tagName.toLowerCase()!==`template`&&xt(`x-teleport can only be used on a <template> tag`,e);let i=Pi(n),a=e.content.cloneNode(!0).firstElementChild;e._x_teleport=a,a._x_teleportBack=e,e.setAttribute(`data-teleport-template`,!0),a.setAttribute(`data-teleport-target`,!0),e._x_forwardEvents&&e._x_forwardEvents.forEach(t=>{a.addEventListener(t,t=>{t.stopPropagation(),e.dispatchEvent(new t.constructor(t.type,t))})}),pe(a,{},e);let o=(e,t,n)=>{n.includes(`prepend`)?t.parentNode.insertBefore(e,t):n.includes(`append`)?t.parentNode.insertBefore(e,t.nextSibling):t.appendChild(e)};j(()=>{cn(()=>{o(a,i,t),It(a)})()}),e._x_teleportPutBack=()=>{let r=Pi(n);j(()=>{o(e._x_teleport,r,t)})},r(()=>j(()=>{a.remove(),Lt(a)}))});var Ni=document.createElement(`div`);function Pi(e){let t=cn(()=>document.querySelector(e),()=>Ni)();return t||xt(`Cannot find x-teleport element for selector: "${e}"`),t}var Fi=()=>{};Fi.inline=(e,{modifiers:t},{cleanup:n})=>{t.includes(`self`)?e._x_ignoreSelf=!0:e._x_ignore=!0,n(()=>{t.includes(`self`)?delete e._x_ignoreSelf:delete e._x_ignore})},Qe(`ignore`,Fi),Qe(`effect`,cn((e,{expression:t},{effect:n})=>{n(Fe(e,t))}));function Ii(e,t,n,r){let i=e,a=e=>r(e),o={},s=(e,t)=>n=>t(e,n);return n.includes(`dot`)&&(t=Ri(t)),n.includes(`camel`)&&(t=zi(t)),n.includes(`capture`)&&(o.capture=!0),n.includes(`window`)&&(i=window),n.includes(`document`)&&(i=document),n.includes(`passive`)&&(o.passive=n[n.indexOf(`passive`)+1]!==`false`),a=Li(n,a),n.includes(`prevent`)&&(a=s(a,(e,t)=>{t.preventDefault(),e(t)})),n.includes(`stop`)&&(a=s(a,(e,t)=>{t.stopPropagation(),e(t)})),n.includes(`once`)&&(a=s(a,(e,n)=>{e(n),i.removeEventListener(t,a,o)})),(n.includes(`away`)||n.includes(`outside`))&&(i=document,a=s(a,(t,n)=>{e.contains(n.target)||n.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&t(n))})),n.includes(`self`)&&(a=s(a,(t,n)=>{n.target===e&&t(n)})),t===`submit`&&(a=s(a,(e,t)=>{t.target._x_pendingModelUpdates&&t.target._x_pendingModelUpdates.forEach(e=>e()),e(t)})),(Hi(t)||Ui(t))&&(a=s(a,(e,t)=>{Wi(t,n)||e(t)})),i.addEventListener(t,a,o),()=>{i.removeEventListener(t,a,o)}}function Li(e,t){if(e.includes(`debounce`)){let n=e[e.indexOf(`debounce`)+1]||`invalid-wait`,r=Bi(n.split(`ms`)[0])?Number(n.split(`ms`)[0]):250;t=Ln(t,r)}if(e.includes(`throttle`)){let n=e[e.indexOf(`throttle`)+1]||`invalid-wait`,r=Bi(n.split(`ms`)[0])?Number(n.split(`ms`)[0]):250;t=Rn(t,r)}return t}function Ri(e){return e.replace(/-/g,`.`)}function zi(e){return e.toLowerCase().replace(/-(\w)/g,(e,t)=>t.toUpperCase())}function Bi(e){return!Array.isArray(e)&&!isNaN(e)}function Vi(e){return[` `,`_`].includes(e)?e:e.replace(/([a-z])([A-Z])/g,`$1-$2`).replace(/[_\s]/,`-`).toLowerCase()}function Hi(e){return[`keydown`,`keyup`].includes(e)}function Ui(e){return[`contextmenu`,`click`,`mouse`].some(t=>e.includes(t))}function Wi(e,t){let n=t.filter(e=>![`window`,`document`,`prevent`,`stop`,`once`,`capture`,`self`,`away`,`outside`,`passive`,`preserve-scroll`,`blur`,`change`,`lazy`].includes(e));if(n.includes(`debounce`)){let e=n.indexOf(`debounce`);
5n.splice(e,Bi((n[e+1]||`invalid-wait`).split(`ms`)[0])?2:1)}if(n.includes(`throttle`)){let e=n.indexOf(`throttle`);n.splice(e,Bi((n[e+1]||`invalid-wait`).split(`ms`)[0])?2:1)}if(n.length===0||n.length===1&&Gi(e.key).includes(n[0]))return!1;let r=[`ctrl`,`shift`,`alt`,`meta`,`cmd`,`super`].filter(e=>n.includes(e));return n=n.filter(e=>!r.includes(e)),!(r.length>0&&r.filter(t=>((t===`cmd`||t===`super`)&&(t=`meta`),e[`${t}Key`])).length===r.length&&(Ui(e.type)||Gi(e.key).includes(n[0])))}function Gi(e){if(!e)return[];e=Vi(e);let t={ctrl:`control`,slash:`/`,space:` `,spacebar:` `,cmd:`meta`,esc:`escape`,up:`arrow-up`,down:`arrow-down`,left:`arrow-left`,right:`arrow-right`,period:`.`,comma:`,`,equal:`=`,minus:`-`,underscore:`_`};return t[e]=e,Object.keys(t).map(n=>{if(t[n]===e)return n}).filter(e=>e)}Qe(`model`,(e,{modifiers:t,expression:n},{effect:r,cleanup:i})=>{let a=e;t.includes(`parent`)&&(a=jt(e,t=>t!==e));let o=Fe(a,n),s;s=typeof n==`string`?Fe(a,`${n} = __placeholder`):typeof n==`function`&&typeof n()==`string`?Fe(a,`${n()} = __placeholder`):()=>{};let c=()=>{let e;return o(t=>e=t),Xi(e)?e.get():e},l=e=>{let t;o(e=>t=e),Xi(t)?t.set(e):s(()=>{},{scope:{__placeholder:e}})};typeof n==`string`&&e.type===`radio`&&j(()=>{e.hasAttribute(`name`)||e.setAttribute(`name`,n)});let u=t.includes(`change`)||t.includes(`lazy`),d=t.includes(`blur`),f=t.includes(`enter`),p=u||d||f,m;if(sn)m=()=>{};else if(p){let n=[],r=n=>l(Ki(e,t,n,c()));if(u&&n.push(Ii(e,`change`,t,r)),d&&(n.push(Ii(e,`blur`,t,r)),e.form)){let t=e.form,n=()=>r({target:e});t._x_pendingModelUpdates||=[],t._x_pendingModelUpdates.push(n),i(()=>{t._x_pendingModelUpdates&&t._x_pendingModelUpdates.splice(t._x_pendingModelUpdates.indexOf(n),1)})}f&&n.push(Ii(e,`keydown`,t,e=>{e.key===`Enter`&&r(e)})),m=()=>n.forEach(e=>e())}else m=Ii(e,e.tagName.toLowerCase()===`select`||[`checkbox`,`radio`].includes(e.type)?`change`:`input`,t,n=>{l(Ki(e,t,n,c()))});if(t.includes(`fill`)&&([void 0,null,``].includes(c())||Fn(e)&&Array.isArray(c())||e.tagName.toLowerCase()===`select`&&e.multiple)&&l(Ki(e,t,{target:e},c())),e._x_removeModelListeners||={},e._x_removeModelListeners.default=m,i(()=>e._x_removeModelListeners.default()),e.form){let n=Ii(e.form,`reset`,[],n=>{Vt(()=>e._x_model&&e._x_model.set(Ki(e,t,{target:e},c())))});i(()=>n())}e._x_model={get(){return c()},set(e){l(e)},setWithModifiers:Li(t,l)},e._x_forceModelUpdate=t=>{t===void 0&&typeof n==`string`&&n.match(/\./)&&(t=``),j(()=>{Fn(e)?e.checked=Array.isArray(t)?t.some(t=>t==e.value):!!t:In(e)?e.checked=typeof t==`boolean`?On(e.value)===t:e.value==t:_n(e,`value`,t)})},r(()=>{let n=c();t.includes(`unintrusive`)&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate(n)})});function Ki(e,t,n,r){return j(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail!==null&&n.detail!==void 0?n.detail:n.target.value;if(Fn(e)){if(Array.isArray(r)){let e=null;return e=t.includes(`number`)?qi(n.target.value):t.includes(`boolean`)?On(n.target.value):n.target.value,n.target.checked?r.includes(e)?r:r.concat([e]):r.filter(t=>!Ji(t,e))}return n.target.checked}if(e.tagName.toLowerCase()===`select`&&e.multiple)return t.includes(`number`)?Array.from(n.target.selectedOptions).map(e=>qi(e.value||e.text)):t.includes(`boolean`)?Array.from(n.target.selectedOptions).map(e=>On(e.value||e.text)):Array.from(n.target.selectedOptions).map(e=>e.value||e.text);{let i;return i=In(e)?n.target.checked?n.target.value:r:n.target.value,t.includes(`number`)?qi(i):t.includes(`boolean`)?On(i):t.includes(`trim`)?i.trim():i}})}function qi(e){let t=e?parseFloat(e):null;return Yi(t)?t:e}function Ji(e,t){return e==t}function Yi(e){return!Array.isArray(e)&&!isNaN(e)}function Xi(e){return typeof e==`object`&&!!e&&typeof e.get==`function`&&typeof e.set==`function`}Qe(`cloak`,e=>queueMicrotask(()=>j(()=>e.removeAttribute(Ye(`cloak`))))),kt(()=>`[${Ye(`init`)}]`),Qe(`init`,cn((e,{expression:t},{evaluate:n})=>typeof t==`string`?!!t.trim()&&n(t,{},!1):n(t,{},!1))),Qe(`text`,(e,{expression:t},{effect:n,evaluateLater:r})=>{let i=r(t);n(()=>{i(t=>{j(()=>{e.textContent=t})})})}),Qe(`html`,(e,{expression:t},{effect:n,evaluateLater:r})=>{let i=r(t);n(()=>{i(t=>{j(()=>{e.innerHTML=t??``,e._x_ignoreSelf=!0,It(e),delete e._x_ignoreSelf})})})}
5),ft(ct(`:`,lt(Ye(`bind:`))));var Zi=(e,{value:t,modifiers:n,expression:r,original:i},{effect:a,cleanup:o})=>{if(!t){let t={};Jn(t),Fe(e,r)(t=>{Yn(e,t,i)},{scope:t});return}if(t===`key`)return Qi(e,r);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let s=Fe(e,r);a(()=>s(i=>{i===void 0&&typeof r==`string`&&r.match(/\./)&&(i=``),j(()=>_n(e,t,i,n))})),o(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})};Zi.inline=(e,{value:t,modifiers:n,expression:r})=>{t&&(e._x_inlineBindings||={},e._x_inlineBindings[t]={expression:r,extract:!1})},Qe(`bind`,Zi);function Qi(e,t){e._x_keyExpression=t}Ot(()=>`[${Ye(`data`)}]`),Qe(`data`,(e,{expression:t},{cleanup:n})=>{if($i(e))return;t=t===``?`{}`:t;let r={};Te(r,e);let i={};Qn(i,r);let a=Pe(e,t,{scope:i});(a===void 0||a===!0)&&(a={}),Te(a,e);let o=f(a);ye(o);let s=pe(e,o);o.init&&Pe(e,o.init),n(()=>{o.destroy&&Pe(e,o.destroy),s()})}),dn((e,t)=>{e._x_dataStack&&(t._x_dataStack=e._x_dataStack,t.setAttribute(`data-has-alpine-state`,!0))});function $i(e){return sn?pn?!0:e.hasAttribute(`data-has-alpine-state`):!1}Qe(`show`,(e,{modifiers:t,expression:n},{effect:r})=>{let i=Fe(e,n);e._x_doHide||=()=>{j(()=>{e.style.setProperty(`display`,`none`,t.includes(`important`)?`important`:void 0)})},e._x_doShow||=()=>{j(()=>{e.style.length===1&&e.style.display===`none`?e.removeAttribute(`style`):e.style.removeProperty(`display`)})};let a=()=>{e._x_doHide(),e._x_isShown=!1},o=()=>{e._x_doShow(),e._x_isShown=!0},s=()=>setTimeout(o),c=Qt(e=>e?o():a(),t=>{typeof e._x_toggleAndCascadeWithTransitions==`function`?e._x_toggleAndCascadeWithTransitions(e,t,o,a):t?s():a()}),l,u=!0;r(()=>i(e=>{!u&&e===l||(t.includes(`immediate`)&&(e?s():a()),c(e),l=e,u=!1)}))}),Qe(`for`,(e,{expression:t},{effect:n,cleanup:r})=>{let i=na(t),a=Fe(e,i.items),o=Fe(e,e._x_keyExpression||`index`);e._x_lookup=new Map,n(()=>ta(e,i,a,o)),r(()=>{e._x_lookup.forEach(e=>j(()=>{Lt(e),e.remove()})),delete e._x_lookup})});function ea(e){return t=>{Object.entries(t).forEach(([t,n])=>{e[t]=n})}}function ta(e,t,n,r){n(n=>{ia(n)&&(n=Array.from({length:n},(e,t)=>t+1)),n??=[],n instanceof Set&&(n=Array.from(n)),n instanceof Map&&(n=Array.from(n));let i=e._x_lookup,a=new Map;e._x_lookup=a;let o=aa(n),s=Object.entries(n).map(([s,c])=>{o||(s=parseInt(s));let l=ra(t,c,s,n),u;return r(t=>{typeof t==`object`&&xt(`x-for key cannot be an object, it must be a string or an integer`,e),i.has(t)&&(a.set(t,i.get(t)),i.delete(t)),u=t},{scope:{index:s,...l}}),[u,l]});j(()=>{i.forEach(e=>{Lt(e),e.remove()});let t=new Set,n=e;s.forEach(([r,i])=>{if(a.has(r)){let e=a.get(r);e._x_refreshXForScope(i),n.nextElementSibling!==e&&(n.nextElementSibling&&e.replaceWith(n.nextElementSibling),n.after(e)),n=e,e._x_currentIfEl&&(e.nextElementSibling!==e._x_currentIfEl&&n.after(e._x_currentIfEl),n=e._x_currentIfEl);return}e.content.children.length>1&&xt(`x-for templates require a single root element, additional elements will be ignored.`,e);let o=document.importNode(e.content,!0).firstElementChild,s=f(i);pe(o,s,e),o._x_refreshXForScope=ea(s),a.set(r,o),t.add(o),n.after(o),n=o}),cn(()=>t.forEach(e=>It(e)))()})})}function na(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,n=/^\s*\(|\)\s*$/g,r=e.match(/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/);if(!r)return;let i={};i.items=r[2].trim();let a=r[1].replace(n,``).trim(),o=a.match(t);return o?(i.item=a.replace(t,``).trim(),i.index=o[1].trim(),o[2]&&(i.collection=o[2].trim())):i.item=a,i}function ra(e,t,n,r){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace(`[`,``).replace(`]`,``).split(`,`).map(e=>e.trim()).forEach((e,n)=>{i[e]=t[n]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t==`object`?e.item.replace(`{`,``).replace(`}`,``).split(`,`).map(e=>e.trim()).forEach(e=>{i[e]=t[e]}):i[e.item]=t,e.index&&(i[e.index]=n),e.collection&&(i[e.collection]=r),i}function ia(e){return typeof e!=`object`&&!isNaN(e)}function aa(e){return typeof e==`object`&&!Array.isArray(e)}function oa(){}oa.inline=(e,{expression:t},{cleanup:n})=>{let r=At(e);r&&(r._x_refs||={},r._x_refs[t]=e,n(()=>delete r._x_refs[t]))},Qe(`ref`,oa),Qe(`if`,(e,{expression:t},{effect:n,cleanup:r})=>{e.tagName.toLowerCase()!==`template`&&xt(`x-if can only be used on a <template> tag`,e);let i=Fe(e,t),a=()=>
5{if(e._x_currentIfEl)return e._x_currentIfEl;let t=e.content.cloneNode(!0).firstElementChild;return pe(t,{},e),j(()=>{e.after(t),cn(()=>It(t))()}),e._x_currentIfEl=t,e._x_undoIf=()=>{j(()=>{Lt(t),t.remove()}),delete e._x_currentIfEl},t},o=()=>{e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)};n(()=>i(e=>{e?a():o()})),r(()=>e._x_undoIf&&e._x_undoIf())}),Qe(`id`,(e,{expression:t},{evaluate:n})=>{n(t).forEach(t=>Ai(e,t))}),dn((e,t)=>{e._x_ids&&(t._x_ids=e._x_ids)}),ft(ct(`@`,lt(Ye(`on:`)))),Qe(`on`,cn((e,{value:t,modifiers:n,expression:r},{cleanup:i})=>{let a=r?Fe(e,r):()=>{};e.tagName.toLowerCase()===`template`&&(e._x_forwardEvents||=[],e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let o=Ii(e,t,n,e=>{a(()=>{},{scope:{$event:e},params:[e]})});i(()=>o())})),sa(`Collapse`,`collapse`,`collapse`),sa(`Intersect`,`intersect`,`intersect`),sa(`Focus`,`trap`,`focus`),sa(`Mask`,`mask`,`mask`);function sa(e,t,n){Qe(t,r=>xt(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,r))}$n.setEvaluator(Be),$n.setRawEvaluator(qe),$n.setReactivityEngine({reactive:Si,effect:xr,release:Sr,raw:M});var ca=$n;function la(e){return Array.isArray?Array.isArray(e):ya(e)===`[object Array]`}function ua(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function da(e){return e==null?``:ua(e)}function fa(e){return typeof e==`string`}function pa(e){return typeof e==`number`}function ma(e){return e===!0||e===!1||ga(e)&&ya(e)==`[object Boolean]`}function ha(e){return typeof e==`object`}function ga(e){return ha(e)&&e!==null}function _a(e){return e!=null}function va(e){return!e.trim().length}function ya(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var ba=`Incorrect 'index' type`,xa=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,Sa=e=>`Invalid value for key ${e}`,Ca=e=>`Pattern length exceeds max of ${e}.`,wa=e=>`Missing ${e} property in key`,Ta=e=>`Property 'weight' in key '${e}' must be a positive integer`,Ea=`Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.`,Da=Object.prototype.hasOwnProperty,Oa=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=ka(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function ka(e){let t=null,n=null,r=null,i=1,a=null;if(fa(e)||la(e))r=e,t=Aa(e),n=ja(e);else{if(!Da.call(e,`name`))throw Error(wa(`name`));let o=e.name;if(r=o,Da.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(Ta(ja(o)));t=Aa(o),n=ja(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function Aa(e){return la(e)?e:e.split(`.`)}function ja(e){return la(e)?e.join(`.`):e}function Ma(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(_a(e)){if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!_a(s))return;if(a===t.length-1&&(fa(s)||pa(s)||ma(s)||typeof s==`bigint`))n.push(o===void 0?da(s):{v:da(s),i:o});else if(la(s)){r=!0;for(let e=0,n=s.length;e<n;e+=1)i(s[e],t,a+1,e)}else t.length&&i(s,t,a+1,o)}}};return i(e,fa(t)?t.split(`.`):t,0),r?n:n[0]}var Na={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Pa={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Fa={location:0,threshold:.6,distance:100},Ia={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:`any`,getFn:Ma,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},N=Object.freeze({...Pa,...Na,...Fa,...Ia});function La(e){return e>=9&&e<=13||e===32||e===160}function Ra(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=0,a=!1;for(let e=0;e<t.length;e++)La(t.charCodeAt(e))?a=!1:a||=(i++,!0);if(i===0&&(i=1),n.has(i))return n.get(i);let o=Math.round(r/i**(.5*e))/r;return n.set(i,o),o},clear(){n.clear()}}}var za=class{constructor({getFn:e=N.getFn,fieldNormWeight:t=N.fieldNormWeight}={}){this.norm=Ra(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;let e=this.docs.length;this.records=Array(e);let t=0;if(fa(this.docs[0]))for(let n=0;n<e;n++){let e=this._createStringRecord(this.docs[n],n);e&&(this.records[t++]=e)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw Error(xa);if(fa(e)){let n=this._createStringRecord(e,t);return n&&this.records.push(n),n}let n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw Error(xa);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&--this.records[t].i}removeAll(e){let t=new Set;for(let n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(e=>!t.has(e.i));let n=Array.from(t).sort((e,t)=>
vendor: 4,778 bytes, line 5
5e-t);for(let e of this.records){let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e.i?t=i+1:r=i}e.i-=t}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!_a(e)||va(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){let n={i:t,$:{}};for(let t=0,r=this.keys.length;t<r;t++){let r=this.keys[t],i=r.getFn?r.getFn(e):this.getFn(e,r.path);if(_a(i)){if(la(i)){let e=[];for(let t=0,n=i.length;t<n;t+=1){let n=i[t];if(_a(n)){if(fa(n)){if(!va(n)){let r={v:n,i:t,n:this.norm.get(n)};e.push(r)}}else if(_a(n.v)){let t=fa(n.v)?n.v:da(n.v);if(!va(t)){let r={v:t,i:n.i,n:this.norm.get(t)};e.push(r)}}}}n.$[t]=e}else if(fa(i)&&!va(i)){let e={v:i,n:this.norm.get(i)};n.$[t]=e}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function Ba(e,t,{getFn:n=N.getFn,fieldNormWeight:r=N.fieldNormWeight}={}){let i=new za({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(ka)),i.setSources(t),i.create(),i}function Va(e,{getFn:t=N.getFn,fieldNormWeight:n=N.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new za({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function Ha(e=[],t=N.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&r===-1?r=a:!o&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}function Ua(e,t,n,{location:r=N.location,distance:i=N.distance,threshold:a=N.threshold,findAllMatches:o=N.findAllMatches,minMatchCharLength:s=N.minMatchCharLength,includeMatches:c=N.includeMatches,ignoreLocation:l=N.ignoreLocation}={}){if(t.length>32)throw Error(Ca(32));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=(e,t)=>{let n=e/u;if(l)return n;let r=Math.abs(f-t);return i?n+r/i:r?1:n},g=s>1||c,_=g?Array(d):[],v;for(;(v=e.indexOf(t,m))>-1;){let e=h(0,v);if(p=Math.min(e,p),m=v+u,g){let e=0;for(;e<u;)_[v+e]=1,e+=1}}m=-1;let y=[],b=1,x=0,S=u+d,C=1<<u-1;for(let t=0;t<u;t+=1){let r=0,i=S;for(;r<i;)h(t,f+i)<=p?r=i:S=i,i=Math.floor((S-r)/2+r);S=i;let a=Math.max(1,f-i+1),s=o?d:Math.min(f+i,d)+u,c=Array(s+2);c[s+1]=(1<<t)-1;for(let r=s;r>=a;--r){let i=r-1,o=n[e[i]];if(c[r]=(c[r+1]<<1|1)&o,t&&(c[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),c[r]&C&&(b=h(t,i),b<=p)){if(p=b,m=i,x=t,m<=f)break;a=Math.max(1,2*f-m)}}if(h(t+1,f)>p)break;y=c}if(g&&m>=0){let t=Math.min(d-1,m+u-1+x);for(let r=m;r<=t;r+=1)n[e[r]]&&(_[r]=1)}let w={isMatch:m>=0,score:Math.max(.001,b)};if(g){let e=Ha(_,s);e.length?c&&(w.indices=e):w.isMatch=!1}return w}function Wa(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}function Ga(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){let r=t[t.length-1],i=e[n];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}var Ka={ł:`l`,Ł:`L`,đ:`d`,Đ:`D`,ø:`o`,Ø:`O`,ħ:`h`,Ħ:`H`,ŧ:`t`,Ŧ:`T`,ı:`i`,ß:`ss`},qa=RegExp(`[`+Object.keys(Ka).join(``)+`]`,`g`),Ja=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFD`).replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D
vendor: 17,363 bytes, line 5
57F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,``).replace(qa,e=>Ka[e]):e=>e,Ya=class{constructor(e,{location:t=N.location,threshold:n=N.threshold,distance:r=N.distance,includeMatches:i=N.includeMatches,findAllMatches:a=N.findAllMatches,minMatchCharLength:o=N.minMatchCharLength,isCaseSensitive:s=N.isCaseSensitive,ignoreDiacritics:c=N.ignoreDiacritics,ignoreLocation:l=N.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?Ja(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:Wa(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0,t=d%32,n=d-t;for(;e<n;)u(this.pattern.substr(e,32),e),e+=32;if(t){let e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?Ja(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,f=!1;this.chunks.forEach(({pattern:t,alphabet:n,startIndex:p})=>{let{isMatch:m,score:h,indices:g}=Ua(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&u.push(...g)});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=Ga(u)),p}},Xa=new Set([`fuzzy`,`include`]);function Za(e){return e.startsWith(`inverse`)}var Qa=[{type:`exact`,multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:`exact`,search(t){let n=t===e;return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`include`,multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:`include`,search(t){let n=0,r,i=[],a=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+a,i.push([r,n-1]);let o=!!i.length;return{isMatch:o,score:+!o,indices:i}}})},{type:`prefix-exact`,multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:`prefix-exact`,search(t){let n=t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`inverse-prefix-exact`,multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:`inverse-prefix-exact`,search(t){let n=!t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`inverse-suffix-exact`,multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:`inverse-suffix-exact`,search(t){let n=!t.endsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`suffix-exact`,multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:`suffix-exact`,search(t){let n=t.endsWith(e);return{isMatch:n,score:+!n,indices:[t.length-e.length,t.length-1]}}})},{type:`inverse-exact`,multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:`inverse-exact`,search(t){let n=t.indexOf(e)===-1;return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`fuzzy`,multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{let n=new Ya(e,{location:t.location??N.location,threshold:t.threshold??N.threshold,distance:t.distance??N.distance,includeMatches:t.includeMatches??N.includeMatches,findAllMatches:t.findAllMatches??N.findAllMatches,minMatchCharLength:t.minMatchCharLength??N.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??N.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??N.ignoreDiacritics,ignoreLocation:t.ignoreLocation??N.ignoreLocation});return{type:`fuzzy`,search(e){return n.searchIn(e)}}}}],$a=Qa.length,eo=`\0`,to=`|`;function no(e){let t=[],n=e.length,r=0;for(;r<n;){for(;r<n&&e[r]===` `;)r++;if(r>=n)break;let i=r;for(;i<n&&e[i]!==` `&&e[i]!==`"`;)i++;if(i<n&&e[i]===`"`){for(i++;i<n;){if(e[i]===`"`){let t=i+1;if(t>=n||e[t]===` `){i++;break}if(e[t]===`$`&&(t+1>=n||e[t+1]===` `)){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<n&&e[i]!==` `;)i++;t.push(e.substring(r,i)),r=i}}return t}function ro(e,t){let n=e.match(t);return n?n[1]:null}function io(e,t={}){return e.replace(/\\\|/g,eo).split(to).map(e=>{let n=no(e.replace(/\u0000/g,`|`).trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<$a;){let e=Qa[o],n=ro(i,e.multiRegex);n&&(r.push(e.create(n,t)),a=!0)}if(!a)for(o=-1;++o<$a;){let e=Qa[o],n=ro(i,e.singleRegex);if(n){r.push(e.create(n,t));break}}}return r})}var ao=class{constructor(e,{isCaseSensitive:t=N.isCaseSensitive,ignoreDiacritics:n=N.ignoreDiacritics,includeMatches:r=N.includeMatches,minMatchCharLength:i=N.minMatchCharLength,ignoreLocation:a=N.ignoreLocation,findAllMatches:o=N.findAllMatches,location:s=N.location,threshold:c=N.threshold,distance:l=N.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=n?Ja(e):e,this.pattern=e,this.query=io(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?Ja(e):e;let a=0,o=[],s=0,c=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];o.length=0,a=0,c=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:l,indices:u,score:d}=r.search(e);if(l)a+=1,s+=d,Za(r.type)&&(c=!0),n&&(Xa.has(r.type)?o.push(...u):o.push(u));else{s=0,a=0,o.length=0,c=!1;break}}if(a){let e={isMatch:!0,score:s/a};return c&&(e.hasInverse=!0),n&&(e.indices=Ga(o)),e}}return{isMatch:!1,score:1}}},oo=[];function so(...e){oo.push(...e)}function co(e,t){for(let n=0,r=oo.length;n<r;n+=1){let r=oo[n];if(r.condition(e,t))return new r(e,t)}return new Ya(e,t)}var lo={AND:`$and`,OR:`$or`},uo={PATH:`$path`,PATTERN:`$val`},fo=e=>!!(e[lo.AND]||e[lo.OR]),po=e=>!!e[uo.PATH],mo=e=>!la(e)&&ha(e)&&!fo(e),ho=e=>({[lo.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function go(e,t,{auto:n=!0}={}){let r=e=>{if(fa(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=co(e,t)),r}let i=Object.keys(e),a=po(e);if(!a&&i.length>1&&!fo(e))return r(ho(e));if(mo(e)){let r=a?e[uo.PATH]:i[0],o=a?e[uo.PATTERN]:e[r];if(!fa(o))throw Error(Sa(r));let s={keyId:ja(r),pattern:o};return n&&(s.searcher=co(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];la(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return fo(e)||(e=ho(e)),r(e)}function _o(e,{ignoreFieldNorm:t=N.ignoreFieldNorm}){let n=1;return e.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),n}function vo(e,{ignoreFieldNorm:t=N.ignoreFieldNorm}){e.forEach(e=>{e.score=_o(e.matches,{ignoreFieldNorm:t})})}var yo=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){let t=this.heap;for(;e>0;){let n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;let r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){let t=this.heap,n=t.length,r=e;do{e=r;let i=2*e+1,a=2*e+2;if(i<n&&this.comparator(t[i],t[r])>0&&(r=i),a<n&&this.comparator(t[a],t[r])>0&&(r=a),r!==e){let n=t[e];t[e]=t[r],t[r]=n}}while(r!==e)}};function bo(e){let t=[];return e.matches.forEach(e=>{if(!_a(e.indices)||!e.indices.length)return;let n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.id),e.idx>-1&&(n.refIndex=e.idx),t.push(n)}),t}function xo(e,t,{includeMatches:n=N.includeMatches,includeScore:r=N.includeScore}={}){return e.map(e=>{let{idx:i}=e,a={item:t[i],refIndex:i};return n&&(a.matches=bo(e)),r&&(a.score=e.score),a})}var So=/[\p{L}\p{M}\p{N}_]+/gu,Co=new WeakSet;function wo(e){Co.has(e)||(Co.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function To(e){if(typeof e==`function`){let t=!1;return n=>{let r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(e=>typeof e!=`string`)))throw Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?`array containing non-strings`:typeof r}.`);return r}}return e instanceof RegExp?(e.global||wo(e),t=>t.match(e)||[]):e=>e.match(So)||[]}function Eo({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=To(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=Ja(n)),r(n)}}}var Do=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Eo({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});let n=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(let e of n){this.termSearchers.push(new Ya(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));let n=r.get(e)||0,a=Math.log(1+(i-n+.5)/(n+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch===`all`,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],n=0,r=0,i=0,a=0,o=this.combineAll&&!this.useMask?new Set:null;for(let s=0;s<this.termSearchers.length;s++){let c=this.termSearchers[s].searchIn(e),l=this.idfWeights[s];r+=l,c.isMatch&&(i++,n+=l*(1-c.score),c.indices&&t.push(...c.indices),this.combineAll&&(this.useMask?a|=1<<s:o.add(s)))}if(i===0)return{isMatch:!1,score:1};let s=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,s)};return this.options.includeMatches&&t.length&&(c.indices=Ga(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}};function Oo(e,t,n,r){let i=r.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);let a=new Set(i),o=e.docTermFieldHits.get(n);o||(o=new Map,e.docTermFieldHits.set(n,o));for(let t of a)o.set(t,(o.get(t)||0)+1),e.df.set(t,(e.df.get(t)||0)+1)}function ko(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0){Oo(e,a,i,r);return}if(o)for(let t=0;t<n;t++){let n=o[t];if(n){if(Array.isArray(n))for(let t of n)Oo(e,t.v,i,r);else Oo(e,n.v,i,r)}}}function Ao(e,t,n){let r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(let i of e)ko(r,i,t,n);return r}function jo(e,t,n,r){ko(e,t,n,r)}function Mo(e,t){let n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);let r=e.docTermFieldHits.get(t);if(r){for(let[t,n]of r){let r=(e.df.get(t)||0)-n;r<=0?e.df.delete(t):e.df.set(t,r)}e.docTermFieldHits.delete(t)}}function No(e,t){if(t.length===0)return;let n=Array.from(new Set(t)).sort((e,t)=>e-t);for(let t of n)Mo(e,t);let r=e=>{let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e?t=i+1:r=i}return e-t},i=n[0],a=new Map;for(let[t,n]of e.docFieldCount)a.set(t>i?r(t):t,n);e.docFieldCount=a;let o=new Map;for(let[t,n]of e.docTermFieldHits)o.set(t>i?r(t):t,n);e.docTermFieldHits=o}var Po=class{constructor(e,t,n){this.options={...N,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Oa(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=co(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof za))throw Error(ba);if(this._myIndex=t||Ba(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=Eo({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Ao(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!_a(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=Eo({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});jo(this._invertedIndex,t,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}remove(e=()=>!1){let t=[],n=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&No(this._invertedIndex,n);let e=new Set(n);this._docs=this._docs.filter((t,n)=>!e.has(n)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw Error(xa);this._invertedIndex&&No(this._invertedIndex,[e]);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){let{limit:n=-1}=t||{},{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;if(fa(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return pa(n)&&n>-1&&(e=e.slice(0,n)),e}let c=a&&pa(n)&&n>0&&fa(e),l=o,u=(e,t)=>l(e,t)||e.idx-t.idx,d;if(c){let t=new yo(n,u);fa(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),d=t.extractSorted()}else d=fa(e)?fa(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),vo(d,{ignoreFieldNorm:s}),a&&d.sort(fa(e)?u:l),pa(n)&&n>-1&&(d=d.slice(0,n));return xo(d,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=t?null:[];return a.forEach(({v:e,i:a,n:s})=>{if(!_a(e))return;let c=r.searchIn(e);if(c.isMatch){let r={score:c.score,value:e,norm:s,indices:c.indices};i&&(r.matchedMask=c.matchedMask,r.matchedTerms=c.matchedTerms,r.termCount=c.termCount);let l=[r];if(!i||this._coversAllTokens(l)){let r={item:e,idx:a,matches:l};t?(r.score=_o(r.matches,{ignoreFieldNorm:n}),t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=go(e,this.options),n=this._normalizedKeys(),r=(e,t,i)=>{if(!(`children`in e)){let{keyId:r,searcher:a}=e,o;return r===null?(o=[],n.forEach((e,n)=>{o.push(...this._findMatches({key:e,value:t[n],searcher:a}))})):o=this._findMatches({key:this._keyStore.get(r),value:this._myIndex.getValueForItemAtKeyId(t,r),searcher:a}),o&&o.length?[{idx:i,item:t,matches:o}]:[]}let{children:a,operator:o}=e,s=[];for(let e=0,n=a.length;e<n;e+=1){let n=a[e],c=r(n,t,i);if(c.length)s.push(...c);else if(o===lo.AND)return[]}return s},i=this._myIndex.records,a=new Map,o=[];return i.forEach(({$:e,i:n})=>{if(_a(e)){let i=r(t,e,n);i.length&&(a.has(n)||(a.set(n,{idx:n,item:e,matches:[]}),o.push(a.get(n))),i.forEach(({matches:e})=>{a.get(n).matches.push(...e)}))}}),o}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=this._normalizedKeys(),s=t?null:[];return a.forEach(({$:e,i:a})=>{if(!_a(e))return;let c=[],l=!1,u=!1;if(o.forEach((t,n)=>{let i=this._findMatches({key:t,value:e[n],searcher:r});i.length?(c.push(...i),i[0].hasInverse&&(u=!0)):l=!0}),!(u&&l)&&c.length&&(!i||this._coversAllTokens(c))){let r={idx:a,item:e,matches:c};t?(r.score=_o(r.matches,{ignoreFieldNorm:n}),t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!_a(t))return[];let r=[];if(la(t))t.forEach(({v:t,i,n:a})=>{if(!_a(t))return;let o=n.searchIn(t);if(o.isMatch){let n={score:o.score,key:e,value:t,idx:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(n.matchedMask=o.matchedMask,n.matchedTerms=o.matchedTerms,n.termCount=o.termCount),r.push(n)}});else{let{v:i,n:a}=t,o=n.searchIn(i);if(o.isMatch){let t={score:o.score,key:e,value:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(t.matchedMask=o.matchedMask,t.matchedTerms=o.matchedTerms,t.termCount=o.termCount),r.push(t)}}return r}_coversAllTokens(e){let t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let t=0;t<e.length;t++)n|=e[t].matchedMask||0;return n===2**t-1}let n=new Set;for(let t=0;t<e.length;t++){let r=e[t].matchedTerms;if(r)for(let e of r)n.add(e)}return n.size===t}};Po.version=`7.5.0`,Po.createIndex=Ba,Po.parseIndex=Va,Po.config=N,Po.match=function(e,t,n){if(n&&n.useTokenSearch)throw Error(Ea);return co(e,{...N,...n}).searchIn(t)},Po.parseQuery=go,so(ao),so(Do),Po.use=function(...e){e.forEach(e
5=>so(e))};var Fo=Po,P=typeof window<`u`?window:void 0,Io=typeof globalThis<`u`?globalThis:P,Lo=Io?.navigator,F=Io?.document,Ro=Io?.location,zo=Io?.fetch,Bo=Io!=null&&Io.XMLHttpRequest&&`withCredentials`in new Io.XMLHttpRequest?Io.XMLHttpRequest:void 0,Vo=Io?.AbortController,Ho=Io?.CompressionStream,Uo=Lo?.userAgent;function Wo(){return!(!P||!1===P.navigator.onLine)}var Go=typeof globalThis<`u`?globalThis:P;Go&&typeof self>`u`&&(Go.self=Go),Go&&typeof File>`u`&&(Go.File=function(){});var I=P??{},L={DEBUG:!1,LIB_VERSION:`0.4.0`,LIB_NAME:`browser-common`};function Ko(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function R(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){Ko(a,r,i,o,s,`next`,e)}function s(e){Ko(a,r,i,o,s,`throw`,e)}o(void 0)}))}}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z.apply(null,arguments)}function qo(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Jo=e=>{if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}};function Yo(e){return typeof e==`string`||e}function Xo(e){return typeof e==`string`?e:void 0}var Zo,Qo=`$feature_flag.$feature_flag_response.$feature_flag_has_experiment.$feature_flag_id.$feature_flag_version.$feature_flag_reason.$feature_flag_request_id.$feature_flag_evaluated_at.$feature_flag_error.locally_evaluated.$groups.$process_person_profile.$geoip_disable.$current_url.$pathname.$referring_domain.utm_source.utm_medium.utm_campaign.utm_content.utm_term.gad_source.mc_cid.gclid.gclsrc.dclid.gbraid.wbraid.fbclid.msclkid.twclid.li_fat_id.igshid.ttclid.rdt_cid.epik.qclid.sccid.irclid._kx.$session_id.$window_id.$lib.$lib_version.$device_id.$is_server`.split(`.`),$o=function(e){return e.AnonymousId=`anonymous_id`,e.DistinctId=`distinct_id`,e.Props=`props`,e.EnablePersonProcessing=`enable_person_processing`,e.PersonMode=`person_mode`,e.FeatureFlagDetails=`feature_flag_details`,e.FeatureFlags=`feature_flags`,e.FeatureFlagPayloads=`feature_flag_payloads`,e.BootstrapFeatureFlagDetails=`bootstrap_feature_flag_details`,e.BootstrapFeatureFlags=`bootstrap_feature_flags`,e.BootstrapFeatureFlagPayloads=`bootstrap_feature_flag_payloads`,e.OverrideFeatureFlags=`override_feature_flags`,e.Queue=`queue`,e.AiQueue=`ai_queue`,e.LogsQueue=`logs_queue`,e.OptedOut=`opted_out`,e.SessionId=`session_id`,e.SessionStartTimestamp=`session_start_timestamp`,e.SessionLastTimestamp=`session_timestamp`,e.PersonProperties=`person_properties`,e.GroupProperties=`group_properties`,e.InstalledAppBuild=`installed_app_build`,e.InstalledAppVersion=`installed_app_version`,e.SessionReplay=`session_replay`,e.PushRegistered=`push_registered`,e.SessionReplayEventTriggerActivatedSession=`session_replay_event_trigger_activated_session`,e.SurveyLastSeenDate=`survey_last_seen_date`,e.SurveysSeen=`surveys_seen`,e.Surveys=`surveys`,e.RemoteConfig=`remote_config`,e.FlagsEndpointWasHit=`flags_endpoint_was_hit`,e.DeviceId=`device_id`,e}({}),es=function(e){return e.GZipJS=`gzip-js`,e.Base64=`base64`,e}({}),ts=[`$snapshot`,`$pageview`,`$pageleave`,`$set`,`survey dismissed`,`survey sent`,`survey shown`,`$identify`,`$groupidentify`,`$create_alias`,`$$client_ingestion_warning`,`$web_experiment_applied`,`$feature_enrollment_update`,`$feature_flag_called`],ns=[`token`],rs=`NativeGzipValidationError`,is=e=>e.length>=2&&e[0]===31&&e[1]===139,as=(e,t)=>e===es.GZipJS||t===es.GZipJS||t===`gzip`,os=e=>!(!e||typeof e!=`object`)&&(`name`in e?String(e.name):``)===`NotReadableError`,ss=e=>{var t=Error(`Native gzip produced invalid output: `+e);throw t.name=rs,t},cs=function(){var e=R((function*(e,t){18>e.size&&ss(`too-short`);var n=new Uint8Array(yield e.slice(0,10).arrayBuffer());is(n)&&n[2]===8||ss(`invalid-header`);var r=new DataView(yield e.slice(e.size-8).arrayBuffer());r.getUint32(0,!0)!==(e=>{for(var t=(()=>
5{if(Zo)return Zo;Zo=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;Zo[e]=t>>>0}return Zo})(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0})(t)&&ss(`invalid-crc`);var i=t.length>>>0;r.getUint32(4,!0)!==i&&ss(`invalid-size`)}));return function(t,n){return e.apply(this,arguments)}}();function ls(){return ls=R((function*(e,t,n){t===void 0&&(t=!0);try{var r=new TextEncoder().encode(e),i=new globalThis.CompressionStream(`gzip`),a=i.writable.getWriter(),o=a.write(r).then((()=>a.close())).catch(function(){var e=R((function*(e){try{yield a.abort(e)}catch{}throw e}));return function(t){return e.apply(this,arguments)}}()),s=new Response(i.readable).blob(),c=(yield Promise.all([s,o]))[0];return yield cs(c,r),c}catch(e){if(n!=null&&n.rethrow)throw e;return t&&console.error(`Failed to gzip compress data`,e),null}})),ls.apply(this,arguments)}var us=`amazonbot,amazonproductbot,app.hypefactors.com,applebot,archive.org_bot,awariobot,backlinksextendedbot,baiduspider,bingbot,bingpreview,chrome-lighthouse,dataforseobot,deepscan,duckduckbot,facebookexternal,facebookcatalog,http://yandex.com/bots,hubspot,ia_archiver,leikibot,linkedinbot,meta-externalagent,mj12bot,msnbot,nessus,petalbot,pinterest,prerender,rogerbot,screaming frog,sebot-wa,sitebulb,slackbot,slurp,trendictionbot,turnitin,twitterbot,vercel-screenshot,vercelbot,yahoo! slurp,yandexbot,zoombot,bot.htm,bot.php,(bot;,bot/,crawler,ahrefsbot,ahrefssiteaudit,semrushbot,siteauditbot,splitsignalbot,gptbot,oai-searchbot,chatgpt-user,perplexitybot,better uptime bot,sentryuptimebot,uptimerobot,headlesschrome,cypress,google-hoteladsverifier,adsbot-google,apis-google,duplexweb-google,feedfetcher-google,google favicon,google web preview,google-read-aloud,googlebot,googleother,google-cloudvertexbot,googleweblight,mediapartners-google,storebot-google,google-inspectiontool,bytespider`.split(`,`),ds=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return us.concat(t).some((e=>{var t=e.toLowerCase();return n.indexOf(t)!==-1}))};function B(e,t){return e.indexOf(t)!==-1}var fs=function(e){return e.trim()},ps=function(e){return e.replace(/^\$/,``)};function ms(e){var t=[];return JSON.stringify(e,(function(e,n){if(typeof n==`bigint`)return n.toString();if(typeof n!=`function`&&typeof n!=`symbol`){if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n==`object`){for(;t.length>0&&t[t.length-1]!==this;)t.pop();if(t.includes(n))return`[Circular]`;t.push(n)}return n}}))??`null`}var hs=Object.prototype,gs=hs.hasOwnProperty,_s=hs.toString,V=Array.isArray||function(e){return _s.call(e)===`[object Array]`},vs=e=>typeof e==`function`,H=e=>e===Object(e)&&!V(e),ys=e=>{if(H(e)){for(var t in e)if(gs.call(e,t))return!1;return!0}return!1},U=e=>e===void 0,W=e=>_s.call(e)==`[object String]`,bs=e=>W(e)&&e.trim().length===0,xs=e=>e===null,G=e=>U(e)||xs(e),Ss=e=>_s.call(e)==`[object Number]`&&e==e,Cs=e=>Ss(e)&&e>0,ws=e=>_s.call(e)===`[object Boolean]`,Ts=e=>e instanceof FormData,Es=e=>B(ts,e),Ds=e=>B(ns,e);function Os(e){return typeof e!=`object`||!e}function ks(e,t){return{}.toString.call(e)===`[object `+t+`]`}function As(e){return typeof Event<`u`&&js(e,Event)}function js(e,t){try{return e instanceof t}catch{return!1}}var Ms=[!0,`true`,1,`1`,`yes`],Ns=e=>B(Ms,e),Ps=[!1,`false`,0,`0`,`no`];function Fs(e,t,n,r,i){return t>n&&(r.warn(`min cannot be greater than max.`),t=n),Ss(e)?e>n?(r.warn(` cannot be  greater than max: `+n+`. Using max value instead.`),n):t>e?(r.warn(` cannot be less than min: `+t+`. Using min value instead.`),t):e:(r.warn(` must be a number. using max or fallback. max: `+n+`, fallback: `+i),Fs(i||n,t,n,r))}var Is=class{constructor(e){this.tt={},this.et=e.et,this.it=Fs(e.bucketSize,0,100,e.rt),this.nt=Fs(e.refillRate,0,this.it,e.rt),this.st=Fs(e.refillInterval,0,864e5,e.rt)}ot(e,t){var n=Math.floor((t-e.lastAccess)/this.st);n>0&&(e.tokens=Math.min(e.tokens+n*this.nt,this.it),e.lastAccess+=n*this.st)}consumeRateLimit(e){var t,n=Date.now(),r=String(e),i=this.tt[r];return i?this.ot(i,n):this.tt[r]=i={tokens:this.it,lastAccess:n},i.tokens===0||(i.tokens--,i.tokens===0&&((t=this.et)==null||t.call(this,e)),i.tokens===0)}stop(){this.tt={}}},Ls=`Mobile`,Rs=`iOS`,zs=`Android`,Bs=`Tablet`,Vs=zs+` `+Bs,Hs=`iPad`,Us=`Apple`,Ws=Us+` Watch`,Gs=`Safari`,Ks=`BlackBerry`,qs=`Samsung`,Js=qs+`Browser`,Ys=qs+` Internet`,Xs=`Chrome`,Zs=Xs+` OS`,Qs=Xs+` `+Rs,$s=`Internet Explorer`,ec=$s+` `+Ls,tc=`Opera`,nc=tc+` Mini`,rc=`Edge`,ic=`Microsoft `+rc,ac=`Firefox`,oc=ac+` `+Rs,sc=`Nintendo`,cc=`PlayStation`,lc=`Xbox`,uc=zs+` `+Ls,dc=Ls+` `+Gs,fc=`Windows`,pc=fc+` Phone`,mc=`Nokia`,hc=`Ouya`,gc=`Generic`,_c=gc+` `+Ls.toLowerCase(),vc=gc+` `+Bs.toLowerCase(),yc=`Konqueror`,bc=`Oculus Browser`,xc=`Vivaldi`,Sc=`Yandex`,Cc=`Whale`,wc=`DuckDuckGo`,Tc=`Pale Moon`,Ec=`Waterfox`,Dc=`Brave`,Oc=`Google Search App`,kc=`(\\d+(\\.\\d+)?)`,Ac=RegExp(`Version/`+kc),jc=new RegExp(lc,`i`),Mc=RegExp(cc+` \\w+`,`i`),Nc=RegExp(sc+` \\w+`,`i`),Pc=RegExp(Ks+`|PlayBook|BB10`,`i`),Fc={"NT3.51":`NT 3.11`,"NT4.0":`NT 4.0`,"5.0":`2000`,5.1:`XP`,5.2:`XP`,"6.0":`Vista`,6.1:`7`,6.2:`8`,6.3:`8.1`,6.4:`10`,"10.0":`10`},Ic=function(e,t,n,r){return t||=``,function(e){return e!=null&&e.brave?Dc:null}(n)||(r!=null&&r.detectGoogleSearchApp&&B(e,`GSA/`)?Oc:B(e,` OPR/`)&&B(e,`Mini`)?nc:B(e,` OPR/`)?tc:Pc.test(e)?Ks:B(e,`IE`+Ls)||B(e,`WPDesktop`)?ec:B(e,`OculusBrowser`)?bc:B(e,Js)?Ys:B(e,rc)||B(e,`Edg/`)?ic:B(e,xc+`/`)?xc:B(e,`YaBrowser/`)?Sc:B(e,Cc+`/`)?Cc:B(e,wc+`/`)||B(e,`Ddg/`)?wc:B(e,`FBIOS`)?`Facebook `+Ls:B(e,`UCWEB`)||B(e,`UCBrowser`)?`UC Browser`:B(e,`CriOS`)?Qs:B(e,`CrMo`)||B(e,Xs)?Xs:B(e,zs)&&B(e,Gs)?uc:B(e,`FxiOS`)?oc:B(e.toLowerCase(),yc.toLowerCase())?yc:B(e,Dc+`/`)?Dc:((e,t)=>t&&B(t,Us)||function(e){return B(e,Gs)&&!B(e,Xs)&&!B(e,zs)}(e))(e,t)?B(e,Ls)?dc:Gs:B(e,`PaleMoon/`)?Tc:B(e,Ec+`/`)?Ec:B(e,ac)?ac:B(e,`MSIE`)||B(e,`Trident/`)?$s:B(e,`Gecko`)?ac:``)},Lc={[ec]:[RegExp(`rv:`+kc)],[ic]:[RegExp(rc+`?\\/`+kc)],[Xs]:[RegExp(`(`+Xs+`|CrMo)\\/`+kc)],[Qs]:[RegExp(`CriOS\\/`+kc)],"UC Browser":[RegExp(`(UCBrowser|UCWEB)\\/`+kc)],[Gs]:[Ac],[dc]:[Ac],[tc]:[RegExp(`(Opera|OPR)\\/`+kc)],[ac]:[RegExp(ac+`\\/`+kc)],[oc]:[RegExp(`FxiOS\\/`+kc)],[yc]:[RegExp(`Konqueror[:/]?`+kc,`i`)],[Ks]:[RegExp(Ks+` `+kc),Ac],[uc]:[RegExp(`android\\s`+kc,`i`)],[Ys]:[RegExp(Js+`\\/`+kc)],[bc]:[RegExp(`OculusBrowser\\/`+kc)],[xc]:[RegExp(xc+`\\/`+kc)],[Sc]:[RegExp(`YaBrowser\\/`+kc)],[Cc]:[RegExp(Cc+`\\/`+kc)],[Dc]:[RegExp(Dc+`\\/`+kc)],[wc]:[RegExp(`(DuckDuckGo|Ddg)\\/`+kc)],[Tc]:[RegExp(`PaleMoon\\/`+kc)],[Ec]:[RegExp(Ec+`\\/`+kc)],[Oc]:[RegExp(`GSA\\/`+kc)],[$s]:[RegExp(`(rv:|MSIE )`+kc)],Mozilla:[RegExp(`rv:`+kc)]},Rc=function(e,t,n,r){var i=Lc[Ic(e,t,n,r)];if(U(i))return null;for(var a=0;i.length>a;a++){var o=e.match(i[a]);if(o)return parseFloat(o[o.length-2])}return null},zc=[[RegExp(lc+`;
5 `+lc+` (.*?)[);]`,`i`),e=>[lc,e&&e[1]||``]],[new RegExp(sc,`i`),[sc,``]],[new RegExp(cc,`i`),[cc,``]],[Pc,[Ks,``]],[new RegExp(fc,`i`),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[pc,``];if(new RegExp(Ls).test(t)&&!/IEMobile\b/.test(t))return[fc+` `+Ls,``];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=Fc[n[1]]||``;return/arm/i.test(t)&&(r=`RT`),[fc,r]}return[fc,``]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[Rs,[e[3],e[4],e[5]||`0`].join(`.`)]:[Rs,``]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t=``;return e&&e.length>=3&&(t=U(e[2])?e[3]:e[2]),[`watchOS`,t]}],[RegExp(`(`+zs+` (\\d+)\\.(\\d+)\\.?(\\d+)?|`+zs+`)`,`i`),e=>e&&e[2]?[zs,[e[2],e[3],e[4]||`0`].join(`.`)]:[zs,``]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=[`Mac OS X`,``];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||`0`].join(`.`)),t}],[/Mac/i,[`Mac OS X`,``]],[/CrOS/,[Zs,``]],[/Linux|debian/i,[`Linux`,``]]],Bc=function(e){return Nc.test(e)?sc:Mc.test(e)?cc:jc.test(e)?lc:new RegExp(hc,`i`).test(e)?hc:RegExp(`(`+pc+`|WPDesktop)`,`i`).test(e)?pc:/iPad/.test(e)?Hs:/iPod/.test(e)?`iPod Touch`:/iPhone/.test(e)?`iPhone`:/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ws:Pc.test(e)?Ks:/(kobo)\s(ereader|touch)/i.test(e)?`Kobo`:new RegExp(mc,`i`).test(e)?mc:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?`Kindle Fire`:/(Android|ZTE)/i.test(e)?new RegExp(Ls).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?zs:Vs:RegExp(`(pda|`+Ls+`)`,`i`).test(e)?_c:new RegExp(Bs,`i`).test(e)&&!RegExp(Bs+` pc`,`i`).test(e)?vc:``},Vc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Hc(e,t){return typeof(n=e)==`string`&&Vc.test(n)?e:t();var n}function Uc(e){return e&&e.split(`#`)[0]}function Wc(e,t){var n=setTimeout(e,t);return n!=null&&n.unref&&n?.unref(),n}function Gc(e,t,n){return Kc.apply(this,arguments)}function Kc(){return(Kc=R((function*(e,t,n){var r;try{return yield Promise.race([e,new Promise(((e,i)=>{r=Wc((()=>{try{n?.(),e()}catch(e){i(e)}}),t)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var qc=e=>e instanceof Error,Jc={trace:{text:`TRACE`,number:1},debug:{text:`DEBUG`,number:5},info:{text:`INFO`,number:9},warn:{text:`WARN`,number:13},error:{text:`ERROR`,number:17},fatal:{text:`FATAL`,number:21}},Yc=Jc.info;function Xc(e){if(ws(e))return{boolValue:e};if(typeof e==`number`)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e==`string`)return{stringValue:e};if(V(e))return{arrayValue:{values:e.map((e=>Xc(e)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function Zc(e){var t=[];for(var n in e){var r=e[n];xs(r)||U(r)||t.push({key:n,value:Xc(r)})}return t}function Qc(e,t){var n=Jc[e.level||`info`]||Yc,r=n.text,i=n.number,a=String(Date.now())+`000000`,o={};t.distinctId&&(o.posthogDistinctId=t.distinctId),t.sessionId&&(o.sessionId=t.sessionId),t.windowId&&(o[`window.id`]=t.windowId),G(t.sessionStartTimestamp)||(o.sessionStartTimestamp=String(t.sessionStartTimestamp)),G(t.lastActivityTimestamp)||(o.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(o[`url.full`]=t.currentUrl),t.screenName&&(o[`screen.name`]=t.screenName),t.appState&&(o[`app.state`]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(o.feature_flags=t.activeFeatureFlags);var s=z({},o,e.attributes||{}),c={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:i,severityText:r,body:{stringValue:e.body},attributes:Zc(s)};return e.trace_id&&(c.traceId=e.trace_id),e.span_id&&(c.spanId=e.span_id),U(e.trace_flags)||(c.flags=e.trace_flags),c}function $c(e,t,n){return z({},e.resourceAttributes,{"service.name":e.serviceName||`unknown_service`},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}function el(e,t,n,r){return{resourceLogs:[{resource:{attributes:Zc(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var tl=class{constructor(e,t,n,r,i,a,o){a===void 0&&(a=()=>Promise.resolve()),this._instance=e,this.Ne=t,this.rt=n,this.ut=r,this.ht=i,this.dt=a,this.vt=o,this.ct=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.kt=t.maxBufferSize,this.xt=Math.max(t.maxQueueSize??t.maxBufferSize,t.maxBufferSize),this.St=t.flushIntervalMs,this.Ct=t.maxBatchRecordsPerPost,this.Mt=t.rateCapWindowMs,this.Tt=t.maxLogsPerInterval}reset(){this.Et(),this.ct=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Ne.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.It()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&e!=null&&e.body){var t=this.Pt(e);if(t!==null){if(t.body){if(this.Rt()){var n={record:Qc(t,this.ut())};this.ht((()=>this.At(n)))}}else this.rt.info(`Log was rejected in beforeSend function`)}}}Pt(e){var t=this.Ne.beforeSend;if(!t)return e;var n=V(t)?t:[t],r=e;for(var i of n)try{var a=i(r);if(!a)return this.rt.info(`Log was rejected in beforeSend function`),null;r=a}catch(e){return this.rt.error(`Error in beforeSend function for log:`,e),null}return r}Rt(){if(this.Tt===void 0)return!0;var e=Date.now(),t=e-this.bt;return this.Mt>t&&t>=0||(this.bt=e,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||=(this.rt.warn(`captureLog dropping logs: exceeded `+this.Tt+` logs per `+this.Mt+`ms`),!0),!1)}flush(){var e=this;return R((function*(){if(!e._instance.isDisabled)return e.ct||=e.Ft().finally((()=>{e.ct=null})),e.ct}))()}Ft(){var e=this;return R((function*(){e.Et();var t=e._instance.getPersistedProperty($o.LogsQueue)??[];
5if(t.length!==0)for(var n=t.length,r=0;t.length>0&&n>r;){e.ft=0;var i=Math.min(t.length,e.Ct),a=t.slice(0,i),o=el(a.map((e=>e.record)),e.Lt(),e.vt??e._instance.getLibraryId(),e._instance.getLibraryVersion()),s=yield e._instance.Ot(o);if(s.kind===`too-large`&&a.length>1)e.Ct=Math.max(1,Math.floor(a.length/2)),e.rt.warn(`Received 413 when sending logs batch of size `+a.length+`, reducing batch size to `+e.Ct);else if(s.kind===`retry-later`||(s.kind===`too-large`?e.rt.warn(`Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further.`):s.kind===`ok`&&e.Ne.maxBatchRecordsPerPost>e.Ct&&(e.Ct=Math.min(e.Ne.maxBatchRecordsPerPost,e.Ct+1)),yield e.Dt(a.length),t=e._instance.getPersistedProperty($o.LogsQueue)??[],r+=a.length,s.kind===`fatal`))throw s.error}}))()}Dt(e){var t=this;return R((function*(){var n=Math.max(0,e-t.ft),r=t._instance.getPersistedProperty($o.LogsQueue)??[];t._instance.setPersistedProperty($o.LogsQueue,r.slice(n)),yield t.dt()}))()}Lt(){return $c(this.Ne,this._instance.getLibraryId(),this._instance.getLibraryVersion())}At(e){if(!this._instance.optedOut){var t=this._instance.getPersistedProperty($o.LogsQueue)??[];this.xt>t.length||(t.shift(),this.ft++,this.rt.info(`Logs queue is full, dropping oldest record.`)),t.push(e),this._instance.setPersistedProperty($o.LogsQueue,t),this.kt>t.length?this.$t():this.It()}}$t(e){e===void 0&&(e=this.St),this.Nt||=Wc((()=>{this.Nt=void 0,this.It()}),e)}qt(){var e=Math.min(Math.max(0,this.yt-1),6);return this.St*2**e}jt(){var e=this._instance.getPersistedProperty($o.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return R((function*(){t.Et();var n=t.flush().catch((()=>{}));e===void 0?yield n:yield Gc(n,e)}))()}flushWithTimeout(e){var t=this;return R((function*(){var n=t.flush();yield Gc(n,e,(()=>{n.catch((()=>{}))}))}))()}It(){this.flush().then((()=>{this.yt=0}),(e=>{this.yt++,this.rt.error(`PostHog logs flush failed:`,e)})).finally((()=>{!this._instance.isDisabled&&this.jt()&&this.$t(this.qt())}))}Et(){this.Nt&&=(clearTimeout(this.Nt),void 0)}},nl=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function rl(e){return String(e)+`000000`}function il(e,t,n,r){var i=``;return r&&(i=Object.keys(r).sort().map((e=>JSON.stringify(e)+`:`+JSON.stringify(r[e]))).join(`,`)),e+`\0`+t+`\0`+(n??``)+`\0`+i}var al=class{constructor(e,t,n){this._instance=e,this.Ne=t,this.rt=n,this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Wt=0}count(e,t,n){t===void 0&&(t=1),this.Vt({name:e,type:`count`,value:t,unit:n?.unit,attributes:n?.attributes})}gauge(e,t,n){this.Vt({name:e,type:`gauge`,value:t,unit:n?.unit,attributes:n?.attributes})}histogram(e,t,n){this.Vt({name:e,type:`histogram`,value:t,unit:n?.unit,attributes:n?.attributes})}flush(){var e=this,t=this.ct,n=function(){var n=R((function*(){t&&(yield t.catch((()=>{}))),yield e.Zt()}));return function(){return n.apply(this,arguments)}}()().finally((()=>{this.ct===n&&(this.ct=null)}));return this.ct=n,n}drainWindow(){if(this.Bt.size===0)return null;var e=this.Bt;return this.Bt=new Map,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Gt(e)}reset(){this.Wt++,this.Et(),this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set}Vt(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.Pt(e);if(t!==null){if(t.name&&typeof t.name==`string`){if(typeof t.value==`number`&&Number.isFinite(t.value)){if(t.type===`count`&&0>t.value)this.rt.warn(`Dropping count '`+t.name+`': counters are monotonic, value must be >= 0`);else{var n,r;try{n=t.attributes?z({},t.attributes):void 0,r=il(t.type,t.name,t.unit,n)}catch(e){this.rt.warn(`Dropping metric '`+t.name+`': attributes could not be serialized`,e);return}var i=this.Bt.get(r);if(!i){if(!this.Qt())return;i={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now()},this.Bt.set(r,i)}var a=this.Ut.get(t.name);a===void 0?this.Ut.set(t.name,t.type):a===t.type||this.zt.has(t.name)||(this.zt.add(t.name),this.rt.warn(`Metric name '`+t.name+`' is already used as a `+a+`; recording it as a `+t.type+` too will blend both series in charts. Use a distinct name.`)),this.Kt(i,t.value),this.$t()}}else this.rt.warn(`Dropping metric '`+t.name+`': value must be a finite number`)}else this.rt.warn(`Dropping metric with empty name`)}}}Qt(){return this.Ne.maxSeriesPerFlush>this.Bt.size||(this.Ht||(this.Ht=!0,this.rt.warn(`Metric series cap reached (`+this.Ne.maxSeriesPerFlush+` per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Kt(e,t){switch(e.type){case`count`:e.total=(e.total??0)+t;break;case`gauge`:e.last=t;break;case`histogram`:e.hist||={count:0,sum:0,min:t,max:t,bucketCounts:Array(nl.length+1).fill(0)};var n=e.hist;n.count+=1,n.sum+=t,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.bucketCounts[function(e,t){for(var n=0;t.length>n;n++)if(t[n]>=e)return n;return t.length}(t,nl)]+=1}}Pt(e){var t=this.Ne.beforeSend;if(!t)return e;var n=V(t)?t:[t],r=e;for(var i of n)try{var a=i(r);if(!a)return this.rt.info(`Metric was rejected in beforeSend function`),null;r=a}catch(e){return this.rt.error(`Error in beforeSend function for metric:`,e),null}return r}$t(){this.Nt||=Wc((()=>{this.Nt=void 0,this.flush().catch((e=>{this.rt.error(`Metrics flush failed:`,e)}))}),this.Ne.flushIntervalMs)}Et(){this.Nt&&=(clearTimeout(this.Nt),void 0)}
5Zt(){var e=this;return R((function*(){if(e.Bt.size!==0){var t=e.Bt;e.Bt=new Map,e.Ht=!1,e.Ut=new Map,e.zt=new Set;var n=e.Wt,r=yield e._instance.Jt(e.Gt(t));if(n===e.Wt)switch(r.kind){case`ok`:return;case`retry-later`:e.Yt(t),e.$t();return;case`too-large`:e.rt.warn(`Metrics batch exceeded the server size limit and was dropped`);return;case`fatal`:e.rt.error(`Failed to send metrics batch:`,r.error);return}}}))()}Gt(e){return t=this.Xt(e),n=function(e,t,n){return z({},e.resourceAttributes,{"service.name":e.serviceName||`unknown_service`},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}(this.Ne,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Zc(n)},scopeMetrics:[{scope:{name:r,version:i},metrics:t}]}]};var t,n,r,i}Xt(e){var t=rl(Date.now()),n=new Map;for(var r of e.values()){var i=il(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=z({name:r.name},r.unit&&{unit:r.unit}),r.type===`count`?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type===`gauge`?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},n.set(i,a));var o=Zc(r.attributes??{}),s=rl(r.windowStartMs);if(r.type===`count`){var c={attributes:o,startTimeUnixNano:s,timeUnixNano:t,asDouble:r.total??0};a.sum.dataPoints.push(c)}else if(r.type===`gauge`){var l={attributes:o,timeUnixNano:t,asDouble:r.last??0};a.gauge.dataPoints.push(l)}else r.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:s,timeUnixNano:t,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:nl})}return Array.from(n.values())}Yt(e){for(var t of e){var n=t[0],r=t[1],i=this.Bt.get(n);if(i)switch(i.windowStartMs=Math.min(i.windowStartMs,r.windowStartMs),i.type){case`count`:i.total=(i.total??0)+(r.total??0);break;case`gauge`:break;case`histogram`:if(r.hist){if(i.hist){i.hist.count+=r.hist.count,i.hist.sum+=r.hist.sum,i.hist.min=Math.min(i.hist.min,r.hist.min),i.hist.max=Math.max(i.hist.max,r.hist.max);for(var a=0;i.hist.bucketCounts.length>a;a++)i.hist.bucketCounts[a]+=r.hist.bucketCounts[a]}else i.hist=r.hist}}else this.Qt()&&this.Bt.set(n,r)}}},ol,sl,cl;function ll(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return cl&&n.length===sl||(sl=n.length,cl=n.reduce(((n,r)=>{ol||={};var i=ol[r];if(i)n[i[0]]=i[1];else for(var a=e(r),o=a.length-1;o>=0;o--){var s=a[o]?.filename,c=t[r];if(s&&c){n[s]=c,ol[r]=[s,c];break}}return n}),{})),cl}}var ul=class{constructor(e,t,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}buildFromUnknown(e,t){t===void 0&&(t={});var n=t&&t.mechanism||{handled:!0,type:`generic`},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),a=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(a,n),$exception_level:`error`}}modifyFrames(e){var t=this;return R((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&V(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e}))()}coerceFallback(e){return{type:`Error`,value:`Unknown error`,stack:e.syntheticException?.stack,synthetic:!0}}parseStacktrace(e,t){var n,r;return e.cause!=null&&(n=this.parseStacktrace(e.cause,t)),e.stack!=``&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),z({},e,{cause:n,stack:r})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return R((function*(){var n=e;for(var r of t.modifiers)n=yield r(n);return n}))()}convertToExceptionList(e,t){var n,r,i={type:e.type,value:e.value,mechanism:{type:t.type??`generic`,handled:(n=t.handled)==null||n,synthetic:(r=e.synthetic)!=null&&r}};e.stack&&(i.stacktrace={type:`raw`,frames:e.stack});var a=[i];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,z({},t,{handled:!0}))),a}buildParsingContext(e){return{chunkIdMap:ll(this.stackParser),skipFirstLines:e.ski
5pFirstLines??1}}buildCoercingContext(e,t,n){n===void 0&&(n=0);var r=(n,r)=>{if(4>=r){var i=this.buildCoercingContext(e,t,r);return this.applyCoercers(n,i)}};return z({},t,{syntheticException:n==0?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,n),next:e=>r(e,n+1)})}},dl=`?`;function fl(e,t,n,r,i){var a={platform:e,filename:t,function:n===`<anonymous>`?dl:n,in_app:!0};return U(r)||(a.lineno=r),U(i)||(a.colno=i),a}var pl=(e,t)=>{var n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?dl:e.split(`@`)[0],n?`safari-extension:`+t:`safari-web-extension:`+t]:[e,t]},ml=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,hl=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,gl=/\((\S*)(?::(\d+))(?::(\d+))\)/,_l=(e,t)=>{var n=ml.exec(e);if(n)return fl(t,n[1],dl,+n[2],+n[3]);var r=hl.exec(e);if(r){if(r[2]&&r[2].indexOf(`eval`)===0){var i=gl.exec(r[2]);i&&(r[2]=i[1],r[3]=i[2],r[4]=i[3])}var a=pl(r[1]||dl,r[2]);return fl(t,a[1],a[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},vl=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,yl=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,bl=(e,t)=>{var n=vl.exec(e);if(n){if(n[3]&&n[3].indexOf(` > eval`)>-1){var r=yl.exec(n[3]);r&&(n[1]=n[1]||`eval`,n[3]=r[1],n[4]=r[2],n[5]=``)}var i=n[3],a=n[1]||dl,o=pl(a,i);return fl(t,i=o[1],a=o[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},xl=/\(error: (.*)\)/,Sl=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var n=W(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?`DOMError`:`DOMException`}getValue(e){var t=e.name||(this.isDOMError(e)?`DOMError`:`DOMException`);return e.message?t+`: `+e.message:t}isDOMException(e){return ks(e,`DOMException`)}isDOMError(e){return ks(e,`DOMError`)}},Cl=class{match(e){return function(e){switch({}.toString.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object DOMError]`:case`[object WebAssembly.Exception]`:return!0;default:return js(e,Error)}}(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var n=e.message;return String(n.error&&typeof n.error.message==`string`?n.error.message:n)}getStack(e){return e.stacktrace||e.stack||void 0}},wl=class{constructor(){}match(e){return!!ks(e,`ErrorEvent`)&&(e.error!=null||this.fe(e))}coerce(e,t){if(e.error!=null)return t.apply(e.error);var n=t.apply(e.message);return z({},n,{stack:this.pe(e)??n.stack,synthetic:!0})}fe(e){return W(e.message)&&e.message.length>0}pe(e){var t=e;if(W(t.filename)&&t.filename.length>0){var n=t.lineno??0,r=t.colno??0;return`Error
6    at `+t.filename+`:`+n+`:`+r}}},Tl=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,El=class{match(e){return typeof e==`string`}coerce(e,t){var n=this.getInfos(e),r=n[0],i=n[1];return{type:r??`Error`,value:i??e,stack:t.syntheticException?.stack,synthetic:!0}}getInfos(e){var t=`Error`,n=e,r=e.match(Tl);return r&&(t=r[1],n=r[2]),[t,n]}},Dl=[`fatal`,`error`,`warning`,`log`,`info`,`debug`];function Ol(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return`[object has no keys]`;for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(`, `);if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+`...`:i}return``}var kl=class{match(e){return typeof e==`object`&&!!e}coerce(e,t){var n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:this.getStack(e)??t.syntheticException?.stack,level:this.isSeverityLevel(e.level)?e.level:`error`,synthetic:!0}}getType(e){return As(e)?e.constructor.name:`Error`}getValue(e){if(`name`in e&&typeof e.name==`string`){var t=`'`+e.name+`' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message: '`+e.message+`'`),t}if(`message`in e&&typeof e.message==`string`)return e.message;var n=this.getObjectClassName(e);return(n&&n!==`Object`?`'`+n+`'`:`Object`)+` captured as exception with keys: `+Ol(e)}isSeverityLevel(e){return W(e)&&!bs(e)&&Dl.indexOf(e)>=0}getStack(e){try{return W(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:W(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(qc(n))return n}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},Al=class{match(e){return As(e)}coerce(e,t){var n=e.constructor.name;return{type:n,value:n+` captured as exception with keys: `+Ol(e),stack:t.syntheticException?.stack,synthetic:!0}}},jl=class{match(e){return Os(e)}coerce(e,t){return{type:`Error`,value:`Primitive value captured as exception: `+String(e),stack:t.syntheticException?.stack,synthetic:!0}}},Ml=class{match(e){return ks(e,`PromiseRejectionEvent`)||this.isCu
6stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!As(e))return!1;try{var t=e.detail;return typeof t==`object`&&!!t&&`reason`in t}catch{return!1}}coerce(e,t){var n=this.getUnhandledRejectionReason(e);return Os(n)?{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: `+String(n),stack:t.syntheticException?.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if(`reason`in e)return e.reason;if(`detail`in e&&e.detail!=null&&typeof e.detail==`object`&&`reason`in e.detail)return e.detail.reason}catch{}return e}},Nl=`$message`,Pl=`$timestamp`,Fl=new Set([Nl,Pl]),Il={enabled:!0,max_bytes:32768};function Ll(e){return e?{enabled:e.enabled??Il.enabled,max_bytes:zl(e.max_bytes,Il.max_bytes)}:z({},Il)}var Rl=class{constructor(e){this.Ke=[],this.Je=0,this.Ne=Ll(e)}setConfig(e){this.Ne=Ll(e),this.Xe()}add(e){var t=function(e){var t;try{t=ms(e)}catch{return}try{var n=JSON.parse(t);if(!H(n))return;var r=n,i=r[Nl],a=r[Pl];return!W(i)||i.trim().length===0||!W(a)&&!Ss(a)?void 0:{step:r,json:t}}catch{return}}(e);if(t){var n=function(e){if(typeof TextEncoder<`u`)return new TextEncoder().encode(e).length;for(var t=encodeURIComponent(e),n=0,r=0;t.length>r;r++)t[r]===`%`?(n+=1,r+=2):n+=1;return n}(t.json);n>this.Ne.max_bytes||(this.Ke.push({step:t.step,bytes:n}),this.Je+=n,this.Xe())}}getAttachable(){return this.Ke.map((e=>e.step))}clear(){this.Ke=[],this.Je=0}size(){return this.Ke.length}Xe(){for(;this.Je>this.Ne.max_bytes&&this.Ke.length>0;){var e=this.Ke.shift();e&&(this.Je-=e.bytes)}}};function zl(e,t){if(!Ss(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var Bl=function(e,t){var n=(t===void 0?{}:t).debugEnabled,r={k(t){if(P&&(L.DEBUG||P.POSTHOG_DEBUG||n)&&!U(P.console)&&P.console){for(var r=(`__rrweb_original__`in P.console[t])?P.console[t].__rrweb_original__:P.console[t],i=arguments.length,a=Array(i>1?i-1:0),o=1;i>o;o++)a[o-1]=arguments[o];r(e,...a)}},debug(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.k(`debug`,...t)},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.k(`log`,...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.k(`warn`,...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.k(`error`,...t)},critical(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];console.error(e,...n)},uninitializedWarning(e){r.error(`You must initialize PostHog before calling `+e)},createLogger:(t,n)=>Bl(e+` `+t,n)};return r},K=Bl(`[PostHog.js]`),q=K.createLogger,Vl=q(`[ExternalScriptsLoader]`),Hl=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Vl.warn(t+` was requested but loading of external scripts is disabled.`),n(`Loading of external scripts is disabled`);var r=F?.querySelectorAll(`script`);if(r){for(var i,a=function(){if(r[o].src===t){var e=r[o];return e.__posthog_loading_callback_fired?{v:n()}:(e.addEventListener(`load`,(t=>{e.__posthog_loading_callback_fired=!0,n(void 0,t)})),e.onerror=e=>n(e),{v:void 0})}},o=0;r.length>o;o++)if(i=a())return i.v}var s=()=>{if(!F)return n(`document not found`);var r=F.createElement(`script`);if(r.type=`text/javascript`,r.crossOrigin=`anonymous`,r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,n(void 0,e)},r.onerror=e=>n(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return n(`prepare_external_dependency_script returned null`);if(e.config.external_scripts_inject_target===`head`)F.head.appendChild(r);else{var i,a=F.querySelectorAll(`body > script`);a.length>0?(i=a[0].parentNode)==null||i.insertBefore(r,a[0]):F.body.appendChild(r)}};F!=null&&F.body?s():F?.addEventListener(`DOMContentLoaded`,s)};I.__PosthogExtensions__=I.__PosthogExtensions__||{},I.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!==`remote-config`){var r;if(e.config.strict_script_versioning)r=e.requestRouter.endpointFor(`assets`,`/static/`+e.version+`/`+t+`.js`);else{var i=`/static/`+t+`.js?v=`+e.version;if(t===`toolbar`){var a=3e5;i=i+`&t=`+Math.floor(Date.now()/a)*a}r=e.requestRouter.endpointFor(`assets`,i)}Hl(e,r,n)}else Hl(e,e.requestRouter.endpointFor(`assets`,`/array/`+e.config.token+`/config.js`),n)},I.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{Hl(e,e.requestRouter.endpointFor(`api`,t),n)},L.DEBUG=!1,L.LIB_VERSION=`1.414.0`,L.LIB_NAME=`web`;var Ul=`$people_distinct_id`,Wl=`$device_id`,Gl=`$device_model`,Kl=`__alias`,ql=`__timers`,Jl=`$autocapture_disabled_server_side`,Yl=`$heatmaps_enabled_server_side`,Xl=`$exception_capture_enabled_server_side`,Zl=`$error_tracking_suppression_rules`,Ql=`$error_tracking_capture_extension_exceptions`,$l=`$web_vitals_enabled_server_side`,eu=`$dead_clicks_enabled_server_side`,tu=`$product_tours_enabled_server_side`,nu=`$web_vitals_allowed_metrics`,ru=`$session_recording_remote_config`,iu=`$replay_sample_rate`,au=`$replay_override_sampling`,ou=`$replay_override_linked_flag`,su=`$replay_override_url_trigger`,cu=`$replay_override_event_trigger`,lu=`$sesid`,uu=`$session_is_sampled`,du=`$enabled_feature_flags`,fu=`$active_feature_flags`,pu=`$early_access_features`,mu=`$feature_flag_details`,hu=`$feature_flag_payloads`,gu=`$feature_flag_request_id`,_u=`$minimal_flag_called_events`,vu=`$override_feature_flags`,yu=`$override_feature_flag_payloads`,bu=`$stored_person_properties`,xu=`$stored_group_properties`,Su=`$surveys`,Cu=`$surveys_loaded_at`,wu=`$surveys_activated`,Tu=`$surveys_activated_session`,Eu=`$surveys_activated_timestamps`,Du=`ph_product_tours`,Ou=`$flag_call_reported`,ku=`$flag_call_reported_session_id`,Au=`$feature_flag_errors`,ju=`$feature_flag_evaluated_at`,Mu=`$user_state`,Nu=`$client_session_props`,Pu=`$capture_rate_limit`,Fu=`$initial_campaign_params`,Iu=`$initial_referrer_info`,Lu=`$initial_person_info`,Ru=`$epp`,zu=`$posthog_cookieless`,Bu=`$cookieless_mode`,Vu=`$sdk_debug_extensions_init_method`,Hu=`$sdk_debug_extensions_init_time_ms`,Uu=`$sdk_debug_recording_script_not_loaded`,Wu=`PostHog loadExternalDependency extension not found.`,Gu=`on_reject`,Ku=`always`,qu=`anonymous`,Ju=`identified`,Yu=`identified_only`,Xu=`visibilitychange`,Zu=`beforeunload`,Qu=`$pageview`,$u=`$pageleave`,ed=`$identify`,td=`$groupidentify`;
6function nd(e,t){V(e)&&e.forEach(t)}function J(e,t){if(!G(e)){if(V(e))e.forEach(t);else if(Ts(e))e.forEach(((e,n)=>t(e,n)));else for(var n in e)gs.call(e,n)&&t(e[n],n)}}var Y=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var a in i)i[a]!==void 0&&(e[a]=i[a]);return e};function rd(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var id=function(e){try{return e()}catch{return}},ad=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){K.critical(`Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A.`),K.critical(e)}}},od=function(e){var t={};return J(e,(function(e,n){(W(e)&&e.length>0||Ss(e))&&(t[n]=e)})),t},sd=[`herokuapp.com`,`vercel.app`,`netlify.app`];function cd(e){var t=e?.hostname;if(!W(t))return!1;var n=t.split(`.`).slice(-2).join(`.`);for(var r of sd)if(n===r)return!1;return!0}function ld(e,t,n,r){var i=r??{},a=i.capture,o=i.passive;e?.addEventListener(t,n,{capture:a!==void 0&&a,passive:o===void 0||o})}function ud(e){return e.name===`ph_toolbar_internal`}var dd=e=>{if(F){try{for(var t=e+`=`,n=F.cookie.split(`;`).filter((e=>e.length)),r=0;n.length>r;r++){for(var i=n[r];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}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Ss(e)&&isFinite(e)&&Math.floor(e)===e});var fd=class e{constructor(e){if(this.bytes=e,e.length!==16)throw TypeError(`not 128-bit length`)}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw RangeError(`invalid field value`);var a=new Uint8Array(16);return a[0]=t/2**40,a[1]=t/2**32,a[2]=t/2**24,a[3]=t/2**16,a[4]=t/256,a[5]=t,a[6]=112|n>>>8,a[7]=n,a[8]=128|r>>>24,a[9]=r>>>16,a[10]=r>>>8,a[11]=r,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,new e(a)}toString(){for(var e=``,t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),t!==3&&t!==5&&t!==7&&t!==9||(e+=`-`);if(e.length!==36)throw Error(`Invalid UUIDv7 was generated`);return e}clone(){return new e(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}},pd=class{generate(){var e=this.generateOrAbort();if(!U(e))return e;this.S=0;var t=this.generateOrAbort();if(U(t))throw Error(`Could not generate UUID after timestamp reset`);return t}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return fd.fromFieldsV7(this.S,Math.trunc(this.I/2**30),this.I&2**30-1,this.A.nextUint32())}C(){this.I=1024*this.A.nextUint32()+(1023&this.A.nextUint32())}constructor(){this.S=0,this.I=0,this.A=new gd}},md,hd=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<`u`&&UUIDV7_DENY_WEAK_RNG)throw Error(`no cryptographically strong RNG available`);for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};P&&!U(P.crypto)&&crypto.getRandomValues&&(hd=e=>crypto.getRandomValues(e));var gd=class{nextUint32(){return this.R.length>this.O||(hd(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}},_d=()=>vd().toString(),vd=()=>(md||=new pd).generate(),yd=``,bd=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,xd={N:()=>!!F,j(e){K.error(`cookieStore error: `+e)},P:dd,H(e){var t;try{t=JSON.parse(xd.P(e))||{}}catch{}return t},F(e,t,n,r,i){if(!F)return!1;try{var a=``,o=``,s=function(e,t){if(t){var n=function(e,t){if(t===void 0&&(t=F),yd)return yd;if(!t||[`localhost`,`127.0.0.1`].includes(e))return``;for(var n=e.split(`.`),r=Math.min(n.length,8),i=`dmn_chk_`+_d();!yd&&r--;){var a=n.slice(r).join(`.`),o=i+`=1;domain=.`+a+`;path=/`;
6t.cookie=o+`;max-age=3`,t.cookie.includes(i)&&(t.cookie=o+`;max-age=0`,yd=a)}return yd}(e);if(!n){var r=(e=>{var t=e.match(bd);return t?t[0]:``})(e);r!==n&&K.info(`Warning: cookie subdomain discovery mismatch`,r,n),n=r}return n?`; domain=.`+n:``}return``}(F.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+864e5*n),a=`; expires=`+c.toUTCString()}i&&(o=`; secure`);var l=e+`=`+encodeURIComponent(JSON.stringify(t))+a+`; SameSite=Lax; path=/`+s+o;return l.length>3686.4&&K.warn(`cookieStore warning: large cookie, len=`+l.length),F.cookie=l,!0}catch{return!1}},q(e,t){if(F!=null&&F.cookie)try{xd.F(e,``,-1,t)}catch{return}}},Sd=null,X={N(){if(!xs(Sd))return Sd;var e=!0;if(U(P))e=!1;else try{var t=`__mplssupport__`;X.F(t,`xyz`),X.P(t)!==`"xyz"`&&(e=!1),X.q(t)}catch{e=!1}return e||K.error(`localStorage unsupported; falling back to cookie store`),Sd=e,e},j(e){K.error(`localStorage error: `+e)},P(e){try{return P?.localStorage.getItem(e)}catch(e){X.j(e)}return null},H(e){try{return JSON.parse(X.P(e))||{}}catch{}return null},F(e,t){try{return P?.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){X.j(e)}return!1},q(e){try{P?.localStorage.removeItem(e)}catch(e){X.j(e)}}},Cd=[Wl,`distinct_id`,lu,uu,Ru,Lu,Mu],wd={},Td={N:()=>!0,j(e){K.error(`memoryStorage error: `+e)},P:e=>wd[e]||null,H:e=>wd[e]||null,F:(e,t)=>(wd[e]=t,!0),q(e){delete wd[e]}},Ed=null,Dd={N(){if(!xs(Ed))return Ed;if(Ed=!0,U(P))Ed=!1;else try{var e=`__support__`;Dd.F(e,`xyz`),Dd.P(e)!==`"xyz"`&&(Ed=!1),Dd.q(e)}catch{Ed=!1}return Ed},j(e){K.error(`sessionStorage error: `,e)},P(e){try{return P?.sessionStorage.getItem(e)}catch(e){Dd.j(e)}return null},H(e){try{return JSON.parse(Dd.P(e))||null}catch{}return null},F(e,t){try{return P?.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Dd.j(e)}return!1},q(e){try{P?.sessionStorage.removeItem(e)}catch(e){Dd.j(e)}}},Od=class{constructor(e){this._instance=e}get Ne(){return this._instance.config}get consent(){return this.ti()?0:this.ei}isOptedOut(){return this.Ne.cookieless_mode===Ku||this.isRejected()||this.consent===-1&&this.Ne.cookieless_mode===Gu}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Ne.opt_out_capturing_by_default}optInOut(e){this.ii.F(this.ri,+!!e,this.Ne.cookie_expiration,this.Ne.cross_subdomain_cookie,this.Ne.secure_cookie)}reset(){this.ii.q(this.ri,this.Ne.cross_subdomain_cookie)}get ri(){var e=this._instance.config,t=e.token,n=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(n?n+t:`__ph_opt_in_out_`+t)}get ei(){var e=this.ii.P(this.ri);return Ns(e)?1:B(Ps,e)?0:-1}get ii(){var e=this.Ne.opt_out_capturing_persistence_type,t=e===`localStorage`?X:xd;if(!this.ni||this.ni!==t){this.ni=t;var n=e===`localStorage`?xd:X;n.P(this.ri)&&(this.ni.P(this.ri)||this.optInOut(Ns(n.P(this.ri))),n.q(this.ri,this.Ne.cross_subdomain_cookie))}return this.ni}ti(){return!!this.Ne.respect_dnt&&[Lo?.doNotTrack,Lo?.msDoNotTrack,I.doNotTrack].some((e=>Ns(e)))}};function kd(e,t){var n,r=e==null||(n=e.config)==null?void 0:n.get_current_url;if(!vs(r))return t;try{var i=r(t);return W(i)&&i?i:t}catch(e){return K.error(`Error in get_current_url, falling back to window.location.href`,e),t}}var Ad=`__POSTHOG_TOOLBAR__`,jd=1,Md=3,Nd=11;function Pd(e){return e instanceof Element&&(e.id===Ad||!(e.closest==null||!e.closest(`.toolbar-global-fade-container`)))}function Fd(e){return!!e&&e.nodeType===jd}function Id(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Ld(e){return!!e&&e.nodeType===Md}function Rd(e){return!!e&&e.nodeType===Nd&&Fd(e.host)}var zd=1e3;function Bd(e){return e?fs(e).split(/\s+/):[]}function Vd(e,t){var n=function(e){var t,n=P==null||(t=P.location)==null?void 0:t.href;return U(n)?void 0:kd(e,n)}(t);return!!(n&&e&&e.some((e=>n.match(e))))}function Hd(e){var t=``;switch(typeof e.className){case`string`:t=e.className;break;case`object`:t=(e.className&&`baseVal`in e.className?e.className.baseVal:null)||e.getAttribute(`class`)||``;break;default:t=``}return Bd(t)}function Ud(e){return G(e)?null:fs(e).split(/(\s+)/).filter((e=>mf(e))).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255)}function Wd(e){var t=``;
6return af(e)&&!of(e)&&e.childNodes&&e.childNodes.length&&J(e.childNodes,(function(e){Ld(e)&&e.textContent&&(t+=Ud(e.textContent)??``)})),fs(t)}function Gd(e){var t;return U(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var Kd=[`a`,`button`,`form`,`input`,`select`,`textarea`,`label`];function qd(e,t){if(U(t))return!0;var n,r=function(e){if(t.some((t=>function(e,t){var n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch{return!1}}(e,t))))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function Jd(e){var t=e.parentNode;return!(!t||!Fd(t))&&t}var Yd=[`.ph-no-autocapture`,`[data-ph-no-autocapture]`],Xd=[`next`,`previous`,`prev`,`>`,`<`],Zd=[...Xd,`+`,`-`,`−`,`–`],Qd=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,$d=[`.ph-no-rageclick`,`.ph-no-capture`],ef=[``,`text`,`search`,`email`,`password`,`url`,`tel`,`number`];function tf(e,t){if(!P||nf(e))return!1;var n,r,i,a;if(ws(t)?(n=!!t&&$d,r=void 0,i=!1):(n=t?.css_selector_ignorelist??$d,r=t?.content_ignorelist,i=(a=t?.ignore_text_selection)!=null&&a),!1===n||i&&function(e){return!(!e||!Fd(e))&&(!!Id(e,`textarea`)||(Id(e,`input`)?B(ef,(e.getAttribute(`type`)||``).toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=e.getAttribute==null?void 0:e.getAttribute(`contenteditable`);return t===`true`||t===``}(e)))}(e))return!1;var o=rf(e,!1).targetElementList;return!function(e,t){if(!1===e||U(e))return!1;var n;if(!0===e)n=Xd;else{if(!V(e))return!1;if(e.length>10)return K.error(`[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching.`),!1;n=e.map((e=>e.toLowerCase()))}return t.some((e=>{var t=e.safeText,r=e.ariaLabel;return n.some((e=>Qd(t,e)||Qd(r,e)))}))}(r,o.map((e=>({safeText:Wd(e).toLowerCase(),ariaLabel:e.getAttribute(`aria-label`)?.toLowerCase().trim()||``}))))&&!qd(o,n)}var nf=e=>!e||Id(e,`html`)||!Fd(e),rf=(e,t)=>{if(!P||nf(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],i=e;i.parentNode&&!Id(i,`body`);)if(Rd(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var a=Jd(i);if(!a)break;if(t||Kd.indexOf(a.tagName.toLowerCase())>-1)n=!0;else try{var o=P.getComputedStyle(a);o&&o.getPropertyValue(`cursor`)===`pointer`&&(n=!0)}catch{}r.push(a),i=a}return{parentIsUsefulElement:n,targetElementList:r}};function af(e){for(var t=new Set,n=0,r=e;r.parentNode&&!Id(r,`body`);r=r.parentNode){if(n++>=zd||t.has(r))return!1;t.add(r);var i=Hd(r);if(B(i,`ph-sensitive`)||B(i,`ph-no-capture`))return!1}if(B(Hd(e),`ph-include`))return!0;var a=e.type||``;if(W(a))switch(a.toLowerCase()){case`hidden`:case`password`:return!1}var o=e.name||e.id||``;return!W(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,``))}function of(e){return!!(Id(e,`input`)&&![`button`,`checkbox`,`submit`,`reset`].includes(e.type)||Id(e,`select`)||Id(e,`textarea`)||e.getAttribute(`contenteditable`)===`true`)}var sf=RegExp(`^(?:(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}))$`),cf=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,lf=[16,15,14,13],uf=RegExp(`^(\\d{3}-?\\d{2}-?\\d{4})$`),df=RegExp(`(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))`,`g`),ff=/[0-9A-Za-z_]/;function pf(e){for(var t=0,n=!1,r=e.length-1;r>=0;r--){var i=e.charCodeAt(r)-48;n&&(i*=2)>9&&(i-=9),t+=i,n=!n}return t%10==0}function mf(e,t){return t===void 0&&(t=!0),!(G(e)||W(e)&&(e=fs(e),(t?sf.test((e||``).replace(/[- ]/g,``)):function(e){var t;for(cf.lastIndex=0;t=cf.exec(e);){var n=t[2];if(n)for(var r=n.replace(/[- ]/g,``),i=0;r.length>i;i++)for(var a of lf){var o=i+a;if(r.length>=o){var s=r.slice(i,o);if(sf.test(s)&&pf(s))return!0}}}return!1}(e))||(t?uf.test(e):function(e){var t;for(df.lastIndex=0;t=df.exec(e);){var n=t[1],r=t[3];if(!(n&&r&&ff.test(n)&&ff.test(r)))return!0}return!1}(e))))}function hf(e){var t=Wd(e);return mf(t=(t+` `+gf(e)).trim())?t:``}function gf(e){var t=``;return e&&e.childNodes&&e.childNodes.length&&J(e.childNodes,(function(e){if(e&&e.tagName?.toLowerCase()===`span`)try{var n=Wd(e);t=(t+` `+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+` `+gf(e)).trim())}catch(e){K.error(`[AutoCapture]`,e)}})),t}function _f(e){return e.replace(/"|\\"/g,`\\"`)}function vf(e){var t=e.attr__class;if(t)return V(t)?t:Bd(t)}var yf=q(`[Dead Clicks]`),bf=()=>!0,xf=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(eu)),r=e.instance.config.capture_dead_clicks;return ws(r)?r:!!H(r)||n},Sf=class{get lazyLoadedDeadClicksAutocapture(){return this.si}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;`captureDeadClicks`in t&&(this.instance.persistence&&this.instance.persistence.register({[eu]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.ai((()=>{this.oi()})):this.stop()}ai(e){var t,n;(t=I.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture?e():(n=I.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,`dead-clicks-autocapture`,(t=>{t?yf.error(`failed to load script`,t):e()}))}oi(){var e;if(F){if(!this.si&&(e=I.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=H(this.instance.config.capture_dead_clicks)?z({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.si=I.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.si.start(F),yf.info(`starting...`)}}else yf.error("`document` not found. Cannot start.")}stop(){this.si&&(this.si.stop(),this.si=void 0,yf.info(`stopping...`))}},Cf=q(`[SegmentIntegration]`),wf=`posthog-js`;function Tf(e,t){var n=t===void 0?{}:t,r=n.organization,i=n.projectId,a=n.prefix,o=n.severityAllowList,s=o===void 0?[`error`]:o,c=n.sendExceptionsToPostHog,l=c===void 0||c;return t=>{if(s!==`*`&&!s.includes(t.level)||!e.__loaded)return t;t.tags||={};var n=e.requestRouter.endpointFor(`ui`,`/project/`+e.config.token+`/person/`+e.get_distinct_id());t.tags[`PostHog Person URL`]=n,e.sessionRecordingStarted()&&(t.tags[`PostHog Recording URL`]=e.get_session_replay_url({withTimestamp:!0}));var o,c=t.exception?.values||[],u=c.map((e=>z({},e,{stacktrace:e.stacktrace?z({},e.stacktrace,{type:`raw`,frames:(e.stacktrace.frames||[]).map((e=>z({},e,{platform:`web:javascript`})))}):void 0}))),d={$exception_message:c[0]?.value||t.message,$exception_type:c[0]?.type,$exception_level:t.level,$exception_list:u,$
6sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:c[0]?.value||t.message,$sentry_exception_type:c[0]?.type,$sentry_tags:t.tags};return r&&i&&(d.$sentry_url=(a||`https://sentry.io/organizations/`)+r+`/issues/?project=`+i+`&query=`+t.event_id),l&&((o=e.exceptions)==null||o.sendExceptionEvent(d)),t}}var Ef=class{constructor(e,t,n,r,i,a){this.name=wf,this.setupOnce=function(o){o(Tf(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}},Df=class{constructor(e){this.li=(e,t,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength||n.crossTabAdoption)&&(K.info(`[PageViewManager] Session rotated, clearing pageview state`,{sessionId:e,changeReason:n}),this.ui=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.hi()}hi(){this.di=this._instance.sessionManager?.onSessionId(this.li)}destroy(){var e;(e=this.di)==null||e.call(this),this.di=void 0}doPageView(e,t){var n=this.vi(e,t);return this.ui={pathname:P?.location.pathname??``,pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){return this.vi(e,this.ui?.pageViewId)}doEvent(){return{$pageview_id:this.ui?.pageViewId}}vi(e,t){var n=this.ui;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var a=i.maxScrollHeight,o=i.lastScrollY,s=i.maxScrollY,c=i.maxContentHeight,l=i.lastContentY,u=i.maxContentY;if(!(U(a)||U(o)||U(s)||U(c)||U(l)||U(u))){a=Math.ceil(a),o=Math.ceil(o),s=Math.ceil(s),c=Math.ceil(c),l=Math.ceil(l),u=Math.ceil(u);var d=a>1?Fs(o/a,0,1,K):1,f=a>1?Fs(s/a,0,1,K):1,p=c>1?Fs(l/c,0,1,K):1,m=c>1?Fs(u/c,0,1,K):1;r=Y(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:m})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}},Of=[`flags`,`surveys`],kf={[Ul]:{exposure:`hidden`},[Kl]:{exposure:`hidden`},__cmpns:{exposure:`hidden`},[ql]:{exposure:`hidden`},[Jl]:{exposure:`event`},[Yl]:{exposure:`hidden`},[Xl]:{exposure:`event`},[Zl]:{exposure:`hidden`},[Ql]:{exposure:`event`},[$l]:{exposure:`event`},[eu]:{exposure:`event`},[tu]:{exposure:`hidden`},[nu]:{exposure:`event`},[ru]:{exposure:`hidden`},$session_recording_enabled_server_side:{exposure:`hidden`},[lu]:{exposure:`hidden`},[uu]:{exposure:`event`},[iu]:{exposure:`event`,shouldSkipFromEventProperties:e=>xs(e)},$session_past_minimum_duration:{exposure:`event`},$session_recording_url_trigger_activated_session:{exposure:`event`},$session_recording_event_trigger_activated_session:{exposure:`event`},$debug_first_full_snapshot_timestamp:{exposure:`event`},$sess_rec_flush_size:{exposure:`hidden`},[du]:{exposure:`derived`,storageGroup:`flags`,shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!H(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t[`$feature/`+n[r]]=e[n[r]];return t}},[fu]:{exposure:`event`,storageGroup:`flags`},[pu]:{exposure:`hidden`},[mu]:{exposure:`hidden`,storageGroup:`flags`},[hu]:{exposure:`event`,storageGroup:`flags`},[gu]:{exposure:`event`,storageGroup:`flags`,volatile:!0},[_u]:{exposure:`hidden`,storageGroup:`flags`},[vu]:{exposure:`event`},[yu]:{exposure:`hidden`},[bu]:{exposure:`hidden`},[xu]:{exposure:`hidden`},[Su]:{exposure:`hidden`,storageGroup:`surveys`},[Cu]:{exposure:`hidden`,storageGroup:`surveys`,volatile:!0},[wu]:{exposure:`event`},[Tu]:{exposure:`hidden`},[Eu]:{exposure:`hidden`},[Du]:{exposure:`hidden`},$product_tours_activated:{exposure:`hidden`},$product_tours_activated_session:{exposure:`hidden`},$conversations_widget_session_id:{exposure:`event`},$conversations_ticket_id:{exposure:`event`},$conversations_widget_state:{exposure:`event`},$conversations_user_traits:{exposure:`event`},[Ou]:{exposure:`hidden`},[ku]:{exposure:`hidden`},[Au]:{exposure:`hidden`},[ju]:{exposure:`hidden`,storageGroup:`flags`,volatile:!0},[Mu]:{exposure:`hidden`},[Nu]:{exposure:`hidden`},[Pu]:{exposure:`hidden`},[Fu]:{exposure:`hidden`},[Iu]:{exposure:`hidden`},[Lu]:{exposure:`hidden`},[Ru]:{exposure:`hidden`},[au]:{exposure:`event`},[ou]:{exposure:`event`},[su]:{exposure:`event`},[cu]:{exposure:`event`},[Vu]:{exposure:`event`},[Hu]:{exposure:`event`},[Uu]:{exposure:`event`}
6,$sdk_debug_replay_event_trigger_status:{exposure:`event`},$sdk_debug_replay_linked_flag_trigger_status:{exposure:`event`},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:`event`},$sdk_debug_replay_remote_trigger_matching_config:{exposure:`event`},$sdk_debug_replay_trigger_groups_count:{exposure:`event`},$sdk_debug_replay_url_trigger_status:{exposure:`event`},$session_recording_start_reason:{exposure:`event`}},Af=[[`$posthog_sr_group_event_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_url_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_sampling_`,{exposure:`hidden`}]],jf=e=>{var t=kf[e];if(t)return t;for(var n of Af){var r=n[1];if(e.indexOf(n[0])===0)return r}},Mf=(e,t)=>{try{return JSON.stringify(e,((e,t)=>typeof t==`bigint`?t.toString():t),t)}catch{return ms(e)}},Nf=e=>{var t=F?.createElement(`a`);return U(t)?null:(t.href=e,t)},Pf=function(e,t){for(var n,r=((e.split(`#`)[0]||``).split(/\?(.*)/)[1]||``).replace(/^\?+/g,``).split(`&`),i=0;r.length>i;i++){var a=r[i].split(`=`);if(a[0]===t){n=a;break}}if(!V(n)||2>n.length)return``;var o=n[1];try{o=decodeURIComponent(o)}catch{K.error(`Skipping decoding for malformed query param: `+o)}return o.replace(/\+/g,` `)},Ff=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(`#`),i=r[1],a=(r[0]||``).split(`?`),o=a[1],s=a[0],c=(o||``).split(`&`),l=[],u=0;c.length>u;u++){var d=c[u].split(`=`);V(d)&&(t.includes(d[0])?l.push(d[0]+`=`+n):l.push(c[u]))}var f=s;return o!=null&&(f+=`?`+l.join(`&`)),i!=null&&(f+=`#`+i),f},If=function(e,t){var n=e.match(RegExp(t+`=([^&]*)`));return n?n[1]:null},Lf=(e,t)=>e>=t&&Wo(),Rf=(e,t,n,r)=>{if(e===0){if(Wo()){var i=t+1;return i===n&&r(),i}return t}return 0},zf=`https?://(.*)`,Bf=[`gclid`,`gclsrc`,`dclid`,`gbraid`,`wbraid`,`fbclid`,`msclkid`,`twclid`,`li_fat_id`,`igshid`,`ttclid`,`rdt_cid`,`epik`,`qclid`,`sccid`,`irclid`,`_kx`],Vf=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gad_source`,`mc_cid`,...Bf],Hf=`<masked>`,Uf=[`li_fat_id`];function Wf(e,t,n){if(!F)return{};var r,i=t?[...Bf,...n||[]]:[],a=Gf(Ff(F.URL,i,Hf),e);return Y((r={},J(Uf,(function(e){var t=dd(e);r[e]=t||null})),r),a)}function Gf(e,t){var n=Vf.concat(t||[]),r={};return J(n,(function(t){r[t]=Pf(e,t)||null})),r}function Kf(e){var t=function(e){return e?e.search(zf+`google.([^/?]*)`)===0?`google`:e.search(zf+`bing.com`)===0?`bing`:e.search(zf+`yahoo.com`)===0?`yahoo`:e.search(zf+`duckduckgo.com`)===0?`duckduckgo`:null:null}(e),n=t==`yahoo`?`p`:`q`,r={};if(!xs(t)){r.$search_engine=t;var i=F?Pf(F.referrer,n):``;i.length&&(r.ph_keyword=i)}return r}function qf(){return navigator.language||navigator.userLanguage}var Jf=`$direct`;function Yf(){return F?.referrer||Jf}function Xf(e,t,n){n===void 0&&(n=!1);var r=e?[...Bf,...t||[]]:[],i=(n?Uc(Ro?.href):Ro?.href)?.substring(0,1e3);return{r:Yf().substring(0,1e3),u:i?Ff(i,r,Hf):void 0}}function Zf(e,t){t===void 0&&(t=!1);var n=e.r,r=e.u,i=t?Uc(r):r,a={$referrer:n,$referring_domain:n==null?void 0:n==Jf?Jf:Nf(n)?.host};if(i){a.$current_url=i;var o=Nf(i);a.$host=o?.host,a.$pathname=o?.pathname,Y(a,Gf(i))}return n&&Y(a,Kf(n)),a}function Qf(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function $f(){try{return new Date().getTimezoneOffset()}catch{return}}var ep={flags:ju,surveys:Cu},tp=[`cookie`,`localstorage`,`localstorage+cookie`,`sessionstorage`,`memory`],np=`main`,rp=class{constructor(e,t,n){if(n===void 0&&(n=!0),this.ci={},this.fi=!1,this.pi=!1,this.Ne=e,this.gi=n,this.props={},this.mi=void 0,this.yi=(e=>{var t=``;return e.token&&(t=e.token.replace(/\+/g,`PL`).replace(/\//g,`SL`).replace(/=/g,`EQ`)),e.persistence_name?`ph_`+e.persistence_name:`ph_`+t+`_posthog`})(e),this.ii=this.bi(e),this.pi=this.wi(e),this.load(),e.debug&&K.info(`Persistence loaded`,e.persistence,z({},this.props)),this.update_config(e,e,t),this.save(),P){var r=()=>this.flush();ld(P,`beforeunload`,r,{capture:!1}),ld(P,`pagehide`,r,{capture:!1})}}ki(){var e=this.Ne?.persistence_save_debounce_ms;return Ss(e)&&e>0?e:0}isDisabled(){return!!this.xi}bi(e){tp.indexOf(e.persistence.toLowerCase())===-1&&(K.critical(`Unknown persistence type `+e.persistence+`; falling back to localStorage+cookie`),e.persistence=`localStorage+cookie`);var t,n=function(e,t){e===void 0&&(e=[]),t===void 0&&(t=!1);var n=[...Cd,...e];return z({},X,{H(e){try{var n={};try{n=xd.H(e)||{}}catch{}var r,i=JSON.parse(X.P(e)||`{}`);if(t){var a={};for(var o in n){var s=n[o];xs(s)||s===``||(a[o]=s)}r=Y(i,a)}else r=Y(n,i);return X.F(e,r),r}catch{}return null},F(e,t,r,i,a,o){var s=X.F(e,t,void 0,void 0,o);try{var c={};
6n.forEach((e=>{t[e]&&(c[e]=t[e])})),Object.keys(c).length&&xd.F(e,c,r,i,a,o)}catch(e){X.j(e)}return s},q(e,t){try{P?.localStorage.removeItem(e),xd.q(e,t)}catch(e){X.j(e)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),r=!1,i=e.persistence.toLowerCase();return i===`localstorage`&&X.N()?(t=X,r=!0):i===`localstorage+cookie`&&n.N()?(t=n,r=!0):i===`sessionstorage`&&Dd.N()?t=Dd:i===`memory`?t=Td:i===`cookie`?t=xd:n.N()?(t=n,r=!0):t=xd,this.fi=r,t}Si(e){return this.yi+`__`+e}wi(e){return this.fi&&!!e.split_storage}Ci(e){var t=e??this.Ne.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var n=this.props[ju];return!n||typeof n!=`number`||Date.now()-n>t}properties(){var e={};return J(this.props,((t,n)=>{var r=jf(n);if(r?.exposure===`derived`){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,n===du?()=>this.Ci():()=>!1))return;r.transformToEventProperties&&Y(e,r.transformToEventProperties(t))}else if(!r||r.exposure===`event`){if(r!=null&&r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,(()=>!1)))return;e[n]=t}})),e}load(){if(!this.xi){var e=this.ii.H(this.yi);e&&(this.props=Y({},e)),this.pi&&this.Mi()}}Mi(){for(var e of Of){var t=X.H(this.Si(e));if(t&&!ys(t)){var n=this.Ti(e);n.persisted=!0,this.Ei(e)||(n.fingerprint=this.Ii(t,e)),this.Pi(e,t)||Y(this.props,t)}}}Ei(e){return Object.keys(this.props).some((t=>jf(t)?.storageGroup===e))}Pi(e,t){var n=ep[e];if(!n)return!1;var r=t[n],i=this.props[n];return Ss(r)&&Ss(i)&&i>r}refreshKey(e){if(!this.xi){var t=this.pi?jf(e)?.storageGroup:void 0,n=t?X.H(this.Si(t)):this.ii.H(this.yi);if(n&&e in n)this.Ri(e,n[e]);else{if(t){var r=this.ii.H(this.yi);if(r&&e in r)return void this.Ri(e,r[e])}this.Ai(e)}}}save(){if(!this.xi){var e=this.ki();e>0?U(this.Fi)&&(this.Fi=setTimeout((()=>{this.Fi=void 0,this.Li()}),e)):this.Li()}}flush(){U(this.Fi)||(clearTimeout(this.Fi),this.Fi=void 0,this.Li())}Li(){this.xi||(this.pi?this.Oi():this.Di(this.ii,this.yi,this.props,np))}Oi(){var e=this.$i(),t=e.main,n=e.groups;for(var r of(this.Di(this.ii,this.yi,t,np),Of)){var i,a=n[r];(!ys(a)||(i=this.ci[r])!=null&&i.persisted)&&this.Di(X,this.Si(r),a,r)}}$i(){var e={},t={flags:{},surveys:{}};return J(this.props,((n,r)=>{var i=jf(r)?.storageGroup;i?t[i][r]=n:e[r]=n})),{main:e,groups:t}}Ii(e,t){if(t===np)return JSON.stringify(e)+`|`+this.Ni+`|`+this.qi+`|`+this.ji;var n={};return J(e,((e,t)=>{var r;n[t]=(r=jf(t))!=null&&r.volatile?`__volatile__`:e})),JSON.stringify(n)}Di(e,t,n,r){var i=this.Ti(r);if(r===np||i.dirty||U(i.fingerprint)){var a;try{if((a=this.Ii(n,r))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.F(t,n,this.Ni,this.qi,this.ji,this.Ne.debug)?(i.dirty=!1,r!==np&&(i.persisted=!0),U(a)||(i.fingerprint=a)):this.Ne.debug&&K.warn(`failed to persist storage entry "`+t+`"; will retry on next save`)}}remove(e){var t=(e===void 0?{}:e).keepGroupEntries,n=t!==void 0&&t;if(U(this.Fi)||(clearTimeout(this.Fi),this.Fi=void 0),this.ii.q(this.yi,!1),this.ii.q(this.yi,!0),!n&&this.gi)for(var r of Of)X.q(this.Si(r));n?delete this.ci[np]:this.ci={}}clear(){this.remove(),this.props={}}register_once(e,t,n){if(H(e)){U(t)&&(t=`None`),this.Ni=U(n)?this.Bi:n;var r=!1;if(J(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.Ri(n,e),r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(H(e)){this.Ni=U(t)?this.Bi:t;var n=!1;if(J(e,((t,r)=>{e.hasOwnProperty(r)&&(this.props[r]!==t||H(t)||V(t))&&(this.Ri(r,t),n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Ai(e),this.save())}update_campaign_params(){var e=F?.URL;if(e!==this.mi){var t=Wf(this.Ne.custom_campaign_params,this.Ne.mask_personal_data_properties,this.Ne.custom_personal_data_properties);ys(od(t))||this.register(t),this.mi=e}}update_search_keyword(){var e;this.register((e=F?.referrer)?Kf(e):{})}update_referrer_info(){this.register_once({$referrer:Yf(),$referring_domain:F!=null&&F.referrer&&Nf(F.referrer)?.host||Jf},void 0)}set_initial_person_info(){this.props[Fu]||this.props[Iu]||this.register_once({[Lu]:Xf(this.Ne.mask_personal_data_properties,this.Ne.custom_personal_data_properties,this.Ne.disable_capture_url_hashes
6)},void 0)}get_initial_props(){var e={};J([Iu,Fu],(t=>{var n=this.props[t];n&&J(n,(function(t,n){e[`$initial_`+ps(n)]=t}))}));var t=this.props[Lu];return t&&Y(e,function(e,t){t===void 0&&(t=!1);var n=Zf(e,t),r={};return J(n,(function(e,t){r[`$initial_`+ps(t)]=e})),r}(t,this.Ne.disable_capture_url_hashes)),e}safe_merge(e){return J(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t,n){this.Bi=this.Ni=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var r=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var n=[...e].sort(),r=[...t].sort();return n.every(((e,t)=>e===r[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),i=r?this.bi(e):this.ii,a=this.wi(e);if(r||a!==this.pi){var o=this.props;this.clear(),this.ii=i,this.pi=a,this.props=o,this.save()}}set_disabled(e){this.xi=e,this.xi?this.remove():this.save()}set_cross_subdomain(e){e!==this.qi&&(this.qi=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ji&&(this.ji=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var n=this.props[ql]||{};n[e]=t,this.Ri(ql,n),this.save()}remove_event_timer(e){var t=this.props[ql]||{},n=t[e];return U(n)||(delete t[e],this.Ri(ql,t),this.save()),n}get_property(e){return this.props[e]}set_property(e,t){this.Ri(e,t),this.save()}Ri(e,t){var n;this.props[e]=t,(n=jf(e))!=null&&n.volatile||this.Hi(e)}Ai(e){delete this.props[e],this.Hi(e)}Hi(e){var t=jf(e)?.storageGroup;t&&(this.Ti(t).dirty=!0)}Ti(e){return this.ci[e]||(this.ci[e]={})}};function ip(e){var t=!0;return{dispose(){if(t){t=!1;var n=e();n&&vs(n.then)&&n.then(void 0,(()=>{}))}}}}var ap={GZipJS:`gzip-js`,Base64:`base64`},op={Activation:`events`,Cancellation:`cancelEvents`},sp={Popover:`popover`,API:`api`,Widget:`widget`,ExternalSurvey:`external_survey`},cp={SHOWN:`survey shown`,DISMISSED:`survey dismissed`,SENT:`survey sent`,ABANDONED:`survey abandoned`},lp={SURVEY_ID:`$survey_id`,SURVEY_NAME:`$survey_name`,SURVEY_RESPONSE:`$survey_response`,SURVEY_ITERATION:`$survey_iteration`,SURVEY_ITERATION_START_DATE:`$survey_iteration_start_date`,SURVEY_PARTIALLY_COMPLETED:`$survey_partially_completed`,SURVEY_SUBMISSION_ID:`$survey_submission_id`,SURVEY_QUESTIONS:`$survey_questions`,SURVEY_COMPLETED:`$survey_completed`,PRODUCT_TOUR_ID:`$product_tour_id`,SURVEY_LAST_SEEN_DATE:`$survey_last_seen_date`,SURVEY_LANGUAGE:`$survey_language`},up={Popover:`popover`,Inline:`inline`},dp={SHOWN:`product tour shown`,DISMISSED:`product tour dismissed`,COMPLETED:`product tour completed`,STEP_SHOWN:`product tour step shown`,STEP_COMPLETED:`product tour step completed`,BUTTON_CLICKED:`product tour button clicked`,STEP_SELECTOR_FAILED:`product tour step selector failed`,BANNER_CONTAINER_SELECTOR_FAILED:`product tour banner container selector failed`,BANNER_ACTION_CLICKED:`product tour banner action clicked`},fp={TOUR_ID:`$product_tour_id`,TOUR_NAME:`$product_tour_name`,TOUR_ITERATION:`$product_tour_iteration`,TOUR_RENDER_REASON:`$product_tour_render_reason`,TOUR_STEP_ID:`$product_tour_step_id`,TOUR_STEP_ORDER:`$product_tour_step_order`,TOUR_STEP_TYPE:`$product_tour_step_type`,TOUR_DISMISS_REASON:`$product_tour_dismiss_reason`,TOUR_BUTTON_TEXT:`$product_tour_button_text`,TOUR_BUTTON_ACTION:`$product_tour_button_action`,TOUR_BUTTON_LINK:`$product_tour_button_link`,TOUR_BUTTON_TOUR_ID:`$product_tour_button_tour_id`,TOUR_STEPS_COUNT:`$product_tour_steps_count`,TOUR_STEP_SELECTOR:`$product_tour_step_selector`,TOUR_STEP_SELECTOR_FOUND:`$product_tour_step_selector_found`,TOUR_STEP_ELEMENT_TAG:`$product_tour_step_element_tag`,TOUR_STEP_ELEMENT_ID:`$product_tour_step_element_id`,TOUR_STEP_ELEMENT_CLASSES:`$product_tour_step_element_classes`,TOUR_STEP_ELEMENT_TEXT:`$product_tour_step_element_text`,TOUR_ERROR:`$product_tour_error`,TOUR_MATCHES_COUNT:`$product_tour_matches_count`,TOUR_FAILURE_PHASE:`$product_tour_failure_phase`,TOUR_WAITED_FOR_ELEMENT:`$product_tour_waited_for_element`,TOUR_WAIT_DURATION_MS:`$product_tour_wait_duration_ms`,TOUR_BANNER_SELECTOR:`$product_tour_banner_selector`,TOUR_LINKED_SURVEY_ID:`$product_tour_linked_survey_id`,USE_MANUAL_SELECTOR:`$use_manual_selector`,INFERENCE_DATA_PRESENT:`$inference_data_present`,TOUR_LAST_SEEN_DATE:`$product_tour_last_seen_date`,TOUR_TYPE:`$product_tour_type`},pp=q(`[RateLimiter]`),mp=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;
6if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{pp.info((e||`events`)+` is quota limited.`),this.serverLimits[e]=new Date().getTime()+6e4}))}catch(e){pp.warn(`could not rate limit - continuing. Error: "`+e?.message+`"`,{text:t});return}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){return this.instance.config.rate_limiting?.events_per_second||10}get captureEventsBurstLimit(){return Math.max(this.instance.config.rate_limiting?.events_burst_limit||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t;e===void 0&&(e=!1);var n=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,i=new Date().getTime(),a=this.instance.persistence?.get_property(Pu)??{tokens:n,last:i};a.tokens+=(i-a.last)/1e3*r,a.last=i,a.tokens>n&&(a.tokens=n);var o=1>a.tokens;if(o||e||(a.tokens=Math.max(0,a.tokens-1)),o&&!e){var s=(Ss(a.dropped)?a.dropped:0)+1;a.dropped=s,!this.lastEventRateLimited&&this.Ui(s)&&(a.dropped=0)}return this.lastEventRateLimited=o,(t=this.instance.persistence)==null||t.set_property(Pu,a),{isRateLimited:o,remainingTokens:a.tokens}}zi(e){var t=this.instance.config.property_denylist;return!V(t)||!t.includes(e)}Wi(){if(this.zi(`$current_url`)&&this.zi(`$pathname`)&&Ro!=null&&Ro.pathname)return``+(Ro.origin??``)+Ro.pathname}Ui(e){var t,n=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,i=this.Wi(),a=this.zi(`$session_id`)?(t=this.instance).get_session_id?.call(t):void 0,o=[e+` event(s) dropped since the last warning`,i?`triggered on `+i:void 0,a?`session `+a:void 0].filter(Boolean).join(`, `);return!!this.instance.capture(`$$client_ingestion_warning`,{$$client_ingestion_warning_message:`posthog-js client rate limited: `+o+`. Config is set to `+r+` events per second and `+n+` events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||`events`]||!1;return!1!==t&&new Date().getTime()<t}},hp=q(`[RemoteConfig]`),gp=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=I._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Vi(e){var t,n;(t=I.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=I.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`remote-config`,(()=>e(this.remoteConfig))):e()}Zi(e){this._instance._send_request({method:`GET`,url:this._instance.requestRouter.endpointFor(`assets`,`/array/`+this._instance.config.token+`/config`),callback:e})}load(){try{if(this.remoteConfig)return hp.info(`Using preloaded remote config`,this.remoteConfig),this.Gi(this.remoteConfig),void this.Qi();if(this._instance.Ki())return void hp.warn(`Remote config is disabled. Falling back to local config.`);this.Vi((e=>{if(!e)return hp.info(`No config found after loading remote JS config. Falling back to JSON.`),void this.Zi((e=>{this.Gi(e.json,e),this.Qi()}));this.Gi(e),this.Qi()}))}catch(e){hp.error(`Error loading remote config`,e),this.Gi()}}stop(){this.Ji&&=(clearInterval(this.Ji),void 0)}refresh(){!this._instance.Ki()&&F&&F.visibilityState!==`hidden`&&this._instance.reloadFeatureFlags()}Qi(){if(!this.Ji){var e=this._instance.config.remote_config_refresh_interval_ms??3e5;e!==0&&(this.Ji=setInterval((()=>{this.refresh()}),e))}}Gi(e,t){!e&&t&&(t.statusCode===0?t.error||hp.warn(`Failed to fetch remote config from PostHog.`):hp.error(`Failed to fetch remote config from PostHog.`));try{this._instance.Gi(e?{ok:!0,config:e}:{ok:!1})}catch(e){hp.error(`Error applying remote config`,e)}if(!1!==e?.hasFeatureFlags&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded()}catch(e){hp.error(`Error loading feature flags`,e)}}},_p=Uint8Array,vp=Uint16Array,yp=Uint32Array,bp=new _p([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]),xp=new _p([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]),Sp=new _p([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Cp=function(e,t){for(var n=new vp(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new yp(n[30]);for(r=1;30>r;++r)for(var a=n[r];n[r+1]>a;++a)i[a]=a-n[r]<<5|r;return[n,i]},wp=Cp(bp,2),Tp=wp[1];wp[0][28]=258,Tp[258]=28;for(var Ep=Cp(xp,0)[1],Dp=new vp(32768),Op=0;32768>Op;++Op){var kp=(43690&Op)>>>1|(21845&Op)<<1;Dp[Op]=((65280&(kp=(61680&(kp=(52428&kp)>>>2|(13107&kp)<<2))>>>4|(3855&kp)<<4))>>>8|(255&kp)<<8)>>>1}var Ap=function(e,t,n){for(var r=e.length,i=0,a=new vp(t);r>i;++i)++a[e[i]-1];var o,s=new vp(t);for(i=0;t>i;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new vp(1<<t);var c=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;f>=d;++d)o[Dp[d]>>>c]=l}else for(o=new vp(r),i=0;r>i;++i)o[i]=Dp[s[e[i]-1]++]>>>15-e[i];return o},jp=new _p(288);for(Op=0;144>Op;++Op)jp[Op]=8;for(Op=144;256>Op;++Op)jp[Op]=9;for(Op=256;280>Op;++Op)jp[Op]=7;for(Op=280;288>Op;++Op)jp[Op]=8;var Mp=new _p(32);for(Op=0;32>Op;++Op)Mp[Op]=5;var Np=Ap(jp,9,0),Pp=Ap(Mp,5,0),Fp=function(e){return(e/8>>0)+(7&e&&1)},Ip=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof vp?vp:e instanceof yp?yp:_p)(n-t);return r.set(e.subarray(t,n)),r},Lp=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},Rp=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},zp=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[new _p(0),0];if(i==1){var o=new _p(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[d].f>n[l].f?l++:d++],c=n[l!=u&&n[d].f>n[l].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var f=a[0].s;for(r=1;i>r;++r)a[r].s>f&&(f=a[r].s);var p=new vp(f+1),m=Bp(n[u-1],p,0);if(m>t){r=0;var h=0,g=m-t,_=1<<g;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i>r;++r){var v=a[r].s;if(t>=p[v])break;h+=_-(1<<m-p[v]),p[v]=t}for(h>>>=g;h>0;){var y=a[r].s;t>p[y]?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new _p(p),m]},Bp=function(e,t,n){return e.s==-1?Math.max(Bp(e.l,t,n+1),Bp(e.r,t,n+1)):t[e.s]=n},Vp=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new vp(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;t>=s;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>
62&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},Hp=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},Up=function(e,t,n){var r=n.length,i=Fp(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;r>a;++a)e[i+a+4]=n[a];return 8*(i+4+r)},Wp=function(e,t,n,r,i,a,o,s,c,l,u){Lp(t,u++,n),++i[256];for(var d=zp(i,15),f=d[0],p=d[1],m=zp(a,15),h=m[0],g=m[1],_=Vp(f),v=_[0],y=_[1],b=Vp(h),x=b[0],S=b[1],C=new vp(19),w=0;v.length>w;++w)C[31&v[w]]++;for(w=0;x.length>w;++w)C[31&x[w]]++;for(var T=zp(C,7),E=T[0],D=T[1],O=19;O>4&&!E[Sp[O-1]];--O);var k,ee,te,ne,A=l+5<<3,re=Hp(i,jp)+Hp(a,Mp)+o,ie=Hp(i,f)+Hp(a,h)+o+14+3*O+Hp(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(re>=A&&ie>=A)return Up(t,u,e.subarray(c,c+l));if(Lp(t,u,1+(re>ie)),u+=2,re>ie){k=Ap(f,p,0),ee=f,te=Ap(h,g,0),ne=h;var ae=Ap(E,D,0);for(Lp(t,u,y-257),Lp(t,u+5,S-1),Lp(t,u+10,O-4),u+=14,w=0;O>w;++w)Lp(t,u+3*w,E[Sp[w]]);u+=3*O;for(var oe=[v,x],j=0;2>j;++j){var se=oe[j];for(w=0;se.length>w;++w)Lp(t,u,ae[ce=31&se[w]]),u+=E[ce],ce>15&&(Lp(t,u,se[w]>>>5&127),u+=se[w]>>>12)}}else k=Np,ee=jp,te=Pp,ne=Mp;for(w=0;s>w;++w)if(r[w]>255){var ce;Rp(t,u,k[257+(ce=r[w]>>>18&31)]),u+=ee[ce+257],ce>7&&(Lp(t,u,r[w]>>>23&31),u+=bp[ce]);var le=31&r[w];Rp(t,u,te[le]),u+=ne[le],le>3&&(Rp(t,u,r[w]>>>5&8191),u+=xp[le])}else Rp(t,u,k[r[w]]),u+=ee[r[w]];return Rp(t,u,k[256]),u+ee[256]},Gp=new yp([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Kp=function(){for(var e=new yp(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),qp=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Jp(e,t){t===void 0&&(t={});var n=function(){var e=4294967295;return{p(t){for(var n=e,r=0;t.length>r;++r)n=Kp[255&n^t[r]]^n>>>8;e=n},d(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,a,o,s,c,l=(s=10+((i=t).filename&&i.filename.length+1||0),c=8,function(e,t,n,r,i,a){var o=e.length,s=new _p(r+o+5*(1+Math.floor(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=Up(c,l,e.subarray(u,d)):(c[u]=!0,l=Up(c,l,e.subarray(u,o)))}else{for(var f=Gp[t-1],p=f>>>13,m=8191&f,h=(1<<n)-1,g=new vp(32768),_=new vp(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new yp(25e3),S=new vp(288),C=new vp(32),w=0,T=0,E=(u=0,0),D=0,O=0;o>u;++u){var k=b(u),ee=32767&u,te=_[k];if(g[ee]=te,_[k]=ee,u>=D){var ne=o-u;if((w>7e3||E>24576)&&ne>423){l=Wp(e,c,0,x,S,C,T,E,O,u-O,l),E=w=T=0,O=u;for(var A=0;286>A;++A)S[A]=0;for(A=0;30>A;++A)C[A]=0}var re=2,ie=0,ae=m,oe=ee-te&32767;if(ne>2&&k==b(u-oe))for(var j=Math.min(p,ne)-1,se=Math.min(32767,u),ce=Math.min(258,ne);se>=oe&&--ae&&ee!=te;){if(e[u+re]==e[u+re-oe]){for(var le=0;ce>le&&e[u+le]==e[u+le-oe];++le);if(le>re){if(re=le,ie=oe,le>j)break;var ue=Math.min(oe,le-2),de=0;for(A=0;ue>A;++A){var fe=u-oe+A+32768&32767,pe=fe-g[fe]+32768&32767;pe>de&&(de=pe,te=fe)}}}oe+=(ee=te)-(te=g[ee])+32768&32767}if(ie){x[E++]=268435456|Tp[re]<<18|Ep[ie];var me=31&Tp[re],he=31&Ep[ie];T+=bp[me]+xp[he],++S[257+me],++C[he],D=u+re,++w}else x[E++]=e[u],++S[e[u]]}}l=Wp(e,c,!0,x,S,C,T,E,O,u-O,l)}return Ip(s,0,r+Fp(l)+i)}(a=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+o.mem,s,c)),u=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&qp(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),qp(l,u-8,n.d()),qp(l,u-4,r),l}var Yp=!!Bo||!!zo,Xp=`text/plain`,Zp=!1,Qp=(e,t)=>{var n=e.split(`#`),r=n[1],i=n[0].split(`?`),a=i[0],o=i[1];if(!o)return e;var s=o.split(`&`).filter((e=>e.split(`=`)[0]!==t)).join(`&`);return a+(s?`?`+s:``)+(r?`#`+r:``)},$p=function(e,t,n){n===void 0&&(n=!0);var r=e.split(`?`),i=r[0],a=r[1],o=z({},t),s=a?.split(`&`).map((e=>{var t,r=e.split(`=`),i=r[0],a=n&&(t=o[i])!=null?t:r[1];return delete o[i],i+`=`+a}))??[],c=function(e,t){var n,r;t===void 0&&(t=`&`);var i=[];return J(e,(function(e,t){U(e)||U(t)||t===`undefined`||(n=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+`=`+n)})),i.join(t)}(o);return c&&s.push(c),s.length>0?i+`?`+s.join(`&`):i},em=e=>{if(e.Yi)return e.Yi;var t=e.data,n=e.compression;if(t){if(n===ap.GZipJS){var r=Jp(function(e,t){var n=e.length;if(typeof TextEncoder<`u`)return new TextEncoder().encode(e);for(var r=new _p(e.length+(e.length>>>1)),i=0,a=function(e){r[i++]=e},o=0;n>o;++o){if(i+5>r.length){var s=new _p(i+8+(n-o<<1));s.set(r),r=s}var c=e.charCodeAt(o);128>c?a(c):2048>c?(a(192|c>>>6),a(128|63&c)):c>55295&&57344>c?(a(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++o))>>>18),a(128|c>>>12&63),a(128|c>>>6&63),a(128|63&c)):(a(224|c>>>12),a(128|c>>>6&63),a(128|63&c))}return Ip(r,0,i)}(Mf(t)),{mtime:0});return{contentType:Xp,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===ap.Base64){var i=(e=>`data=`+encodeURIComponent(typeof e==`string`?e:Mf(e)))(function(e){return e&&btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>
6String.fromCharCode(parseInt(t,16)))))}(Mf(t)));return{contentType:`application/x-www-form-urlencoded`,body:i,estimatedSize:new Blob([i]).size}}var a=Mf(t);return{contentType:`application/json`,body:a,estimatedSize:new Blob([a]).size}}},tm=e=>{var t,n,r=()=>e.transport===`sendBeacon`?{url:$p(e.url,{compression:ap.Base64}),encodedBody:em(z({},e,{compression:ap.Base64,Yi:void 0}))}:{url:Qp(e.url,`compression`),encodedBody:em(z({},e,{compression:void 0,Yi:void 0}))};try{t=em(e)}catch(t){if(as(e.compression,Pf(e.url,`compression`)))return K.error(`Failed to gzip request body, sending uncompressed payload`,t),r();throw t}return t&&as(e.compression,Pf(e.url,`compression`))&&!((n=t.body)instanceof ArrayBuffer?is(new Uint8Array(n)):ArrayBuffer.isView(n)&&is(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Zp=!0,r()):{url:e.url,encodedBody:t}},nm=e=>{try{return tm(e)}catch(t){K.error(t),e.callback==null||e.callback({statusCode:0,error:t});return}},rm=function(){var e=R((function*(e){var t=yield function(e,t,n){return ls.apply(this,arguments)}(Mf(e.data),L.DEBUG,{rethrow:!0});if(!t)return e;var n=yield t.arrayBuffer();return z({},e,{Yi:{contentType:Xp,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),im=/Failed to fetch|NetworkError|Load failed/i,am=e=>e?.name===`TypeError`&&im.test(e?.message||``),om=e=>{var t=nm(e);if(t){var n=t.url,r=t.encodedBody??{},i=r.contentType,a=r.body,o=r.estimatedSize,s=new Headers;J(e.headers,(function(e,t){s.append(t,e)})),i&&s.append(`Content-Type`,i);var c=null,l=!1;if(Vo){var u=new Vo;c={signal:u.signal,timeout:setTimeout((()=>{var t,n;l=!0,u.abort((t=e.timeout,(n=Error(`PostHog request timed out`+(t?` after `+t+`ms`:``))).name=`AbortError`,n))}),e.timeout)}}var d=t=>{l&&t?.name===`AbortError`||am(t)?K.warn(t):K.error(t),e.callback==null||e.callback({statusCode:0,error:t})};try{zo(n,z({method:e?.method||`GET`,headers:s,keepalive:e.method===`POST`&&!e.Xi&&52428.8>(o||0),body:a,signal:c?.signal},e.fetchOptions)).then((t=>t.text().then((n=>{var r={statusCode:t.status,text:n};if(t.status===200)try{r.json=JSON.parse(n)}catch(e){K.error(e)}e.callback==null||e.callback(r)})))).catch(d).finally((()=>c?clearTimeout(c.timeout):null))}catch(e){c&&clearTimeout(c.timeout),d(e)}}},sm=e=>{try{var t=tm(e),n=t.url,r=t.encodedBody??{},i=r.body,a=r.estimatedSize;if(!i)return;var o=i instanceof Blob?i:new Blob([i],{type:r.contentType});if(Lo.sendBeacon(n,o))return;var s=V(e.data)?e.data:e.data?.batch;if(V(s)&&s.length>1&&(a??0)>16384){var c=Math.ceil(s.length/2),l=t=>V(e.data)?t:z({},e.data,{batch:t});sm(z({},e,{data:l(s.slice(0,c))})),sm(z({},e,{data:l(s.slice(c))}));return}K.warn(`Beacon of ~`+(a??0)+` bytes was rejected by the browser, falling back to fetch`),om(z({},e,{Xi:!0}))}catch(e){K.warn(`Beacon send failed`,e)}},cm=(e,t,n,r)=>{var i=r===`query`?t===`POST`?`sent_at`:`_`:void 0;return $p(n===ap.GZipJS?Qp(e,`compression`):e,z({},i?{[i]:Date.now().toString()}:{},n===ap.GZipJS?{}:{compression:n}))},lm=[];zo&&lm.push({transport:`fetch`,method:om}),Bo&&lm.push({transport:`XHR`,method(e){var t=nm(e);if(t){var n=new Bo,r=t.encodedBody;n.open(e.method||`GET`,t.url,!0);var i=r??{},a=i.contentType,o=i.body;J(e.headers,(function(e,t){n.setRequestHeader(t,e)})),a&&n.setRequestHeader(`Content-Type`,a),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var t={statusCode:n.status,text:n.responseText};if(n.status===200)try{t.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(t)}},n.send(o)}}}),Lo!=null&&Lo.sendBeacon&&lm.push({transport:`sendBeacon`,method:sm});var um=3e3,dm=class{constructor(e,t){this.tr=!0,this.er=[],this.ir=Fs(t?.flush_interval_ms||um,250,5e3,K.createLogger(`flush interval`),um),this.rr=e}enqueue(e){this.er.push(e),this.nr||this.sr()}unload(){this.ar();var e=this.er.length>0?this.lr():{},t=Object.values(e);[...t.filter((e=>e.url.indexOf(`/e`)===0)),...t.filter((e=>e.url.indexOf(`/e`)!==0))].map((e=>{this.ur(z({},e,{transport:`sendBeacon`}))}))}enable(){this.tr=!1,this.sr()}sr(){var e=this;this.tr||(this.nr=setTimeout((()=>
6{if(this.ar(),this.er.length>0){var t=this.lr(),n=function(){var n=t[r],i=new Date().getTime();n.data&&V(n.data)&&J(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.ur(n)};for(var r in t)n()}}),this.ir))}ur(e){try{this.rr(e)}catch(e){K.error(e)}}ar(){clearTimeout(this.nr),this.nr=void 0}lr(){var e={};return J(this.er,(t=>{var n,r=t,i=(r?r.batchKey:null)||r.url;U(e[i])&&(e[i]=z({},r,{data:[]})),(n=e[i].data)==null||n.push(r.data)})),this.er=[],e}},fm=[`retriesPerformedSoFar`],pm=class{constructor(e){this.hr=!1,this.dr=3e3,this.er=[],this._instance=e,this.er=[],this.vr=!0,!U(P)&&`onLine`in P.navigator&&(this.vr=P.navigator.onLine,this.cr=()=>{this.vr=!0,this.pr()},this.gr=()=>{this.vr=!1},ld(P,`online`,this.cr),ld(P,`offline`,this.gr))}get length(){return this.er.length}retriableRequest(e){var t=e.retriesPerformedSoFar,n=qo(e,fm);Cs(t)&&(n.url=$p(n.url,{retry_count:t})),this._instance._send_request(z({},n,{callback:e=>{if(e.statusCode!==200&&(400>e.statusCode||e.statusCode>=500)){if((e.statusCode===0?3:10)>(t??0))return void this.At(z({retriesPerformedSoFar:t},n));e.statusCode===0&&K.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after `+(t??0)+` retries.`)}n.callback==null||n.callback(e)}}))}At(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*2**e,n=t/2,r=Math.min(18e5,t),i=Math.random()-.5;return Math.ceil(r+i*(r-n))}(t),r=Date.now()+n;this.er.push({retryAt:r,requestOptions:e});var i=`Enqueued failed request for retry in `+n;navigator.onLine||(i+=` (Browser is offline)`),K.warn(i),this.hr||(this.hr=!0,this.mr())}mr(){if(this.yr&&clearTimeout(this.yr),this.er.length===0)return this.hr=!1,void(this.yr=void 0);this.yr=setTimeout((()=>{this.vr&&this.er.length>0&&this.pr(),this.mr()}),this.dr)}pr(){var e=Date.now(),t=[],n=this.er.filter((n=>e>n.retryAt||(t.push(n),!1)));if(this.er=t,n.length>0)for(var r of n)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.yr&&=(clearTimeout(this.yr),void 0),this.hr=!1,U(P)||(this.cr&&=(P.removeEventListener(`online`,this.cr),void 0),this.gr&&=(P.removeEventListener(`offline`,this.gr),void 0)),this.er)){var t=e.requestOptions;try{this._instance._send_request(z({},t,{transport:`sendBeacon`}))}catch(e){K.error(e)}}this.er=[]}},mm=class{constructor(e){this.br=()=>{this._r||={};var e=this.scrollElement(),t=this.scrollY(),n=e?Math.max(0,e.scrollHeight-e.clientHeight):0,r=t+(e?.clientHeight||0),i=e?.scrollHeight||0;this._r.lastScrollY=Math.ceil(t),this._r.maxScrollY=Math.max(t,this._r.maxScrollY??0),this._r.maxScrollHeight=Math.max(n,this._r.maxScrollHeight??0),this._r.lastContentY=r,this._r.maxContentY=Math.max(r,this._r.maxContentY??0),this._r.maxContentHeight=Math.max(i,this._r.maxContentHeight??0)},this._instance=e}get wr(){return this._instance.config.scroll_root_selector}getContext(){return this._r}resetContext(){var e=this._r;return setTimeout(this.br,0),e}startMeasuringScrollPosition(){ld(P,`scroll`,this.br,{capture:!0}),ld(P,`scrollend`,this.br,{capture:!0}),ld(P,`resize`,this.br)}scrollElement(){if(!this.wr)return P?.document.documentElement;for(var e of V(this.wr)?this.wr:[this.wr]){var t=P?.document.querySelector(e);if(t)return t}}kr(e){var t=e===`y`?`scrollTop`:`scrollLeft`;if(this.wr){var n=this.scrollElement();return n&&n[t]||0}return P?e===`y`?P.scrollY||P.pageYOffset||P.document.documentElement.scrollTop||0:P.scrollX||P.pageXOffset||P.document.documentElement.scrollLeft||0:0}scrollY(){return this.kr(`y`)}scrollX(){return this.kr(`x`)}},hm=e=>Xf(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties,e?.config.disable_capture_url_hashes),gm=class{constructor(e,t,n,r){this.Sr=e=>{var t=this.Cr();if(!t||t.sessionId!==e){var n={sessionId:e,props:this.Mr(this._instance)};this.Tr.register({[Nu]:n})}},this._instance=e,this.Er=t,this.Tr=n,this.Mr=r||hm,this.Er.onSessionId(this.Sr)}Cr(){return this.Tr.props[Nu]}getSetOnceProps(){var e=this.Cr()?.props;return e?`r`in e?Zf(e,this._instance.config.disable_capture_url_hashes
6):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var e={};return J(od(this.getSetOnceProps()),((t,n)=>{n===`$current_url`&&(n=`url`),e[`$session_entry_`+ps(n)]=t})),e}},_m=class{on(e,t){return this.Ir[e]||(this.Ir[e]=[]),this.Ir[e].push(t),()=>{this.Ir[e]=this.Ir[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.Ir[e]||[])n(t);for(var r of this.Ir[`*`]||[])r(e,t)}constructor(){this.Ir={}}},vm=q(`[SessionId]`),ym=class{on(e,t){return this.Pr.on(e,t)}constructor(e,t,n){var r;if(this.Rr=null,this.Ar=[],this.Fr=void 0,this.Lr=!1,this.Pr=new _m,this.Or=(e,t)=>!(!Cs(e)||!Cs(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error(`SessionIdManager requires a PostHogPersistence instance`);if(e.config.cookieless_mode===Ku)throw Error(`SessionIdManager cannot be used with cookieless_mode="always"`);this.Ne=e.config,this.Tr=e.persistence,this.Dr=void 0,this.$r=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Nr=t||_d,this.qr=n||_d;var i=this.Ne.persistence_name||this.Ne.token;if(this._sessionTimeoutMs=1e3*Fs(this.Ne.session_idle_timeout_seconds||1800,60,36e3,vm.createLogger(`session_idle_timeout_seconds`),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.jr(),this.Br=`ph_`+i+`_window_id`,this.Hr=`ph_`+i+`_primary_window_exists`,this.Ur()){var a=Dd.H(this.Br),o=Dd.H(this.Hr);a&&!o?this.Dr=a:Dd.q(this.Br),Dd.F(this.Hr,!0)}if((r=this.Ne.bootstrap)!=null&&r.sessionID)try{var s=(e=>{var t=this.Ne.bootstrap.sessionID.replace(/-/g,``);if(t.length!==32)throw Error(`Not a valid UUID`);if(t[12]!==`7`)throw Error(`Not a UUIDv7`);return parseInt(t.substring(0,12),16)})();this.zr(this.Ne.bootstrap.sessionID,new Date().getTime(),s)}catch(e){vm.error(`Invalid sessionID in bootstrap`,e)}this.Wr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return U(this.Ar)&&(this.Ar=[]),this.Ar.push(e),this.$r&&e(this.$r,this.Dr),()=>{this.Ar=this.Ar.filter((t=>t!==e))}}Ur(){return this.Ne.persistence!==`memory`&&!this.Tr.xi&&Dd.N()}Vr(e){e!==this.Dr&&(this.Dr=e,this.Ur()&&Dd.F(this.Br,e))}Zr(){return this.Dr?this.Dr:this.Ur()?Dd.H(this.Br):null}Gr(e){var t=this.Rr;return!xs(t)&&!xs(e)&&5e3>Math.abs(e-t)}zr(e,t,n){var r=t!==this._sessionActivityTimestamp,i=e===this.$r&&n===this._sessionStartTimestamp;this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.$r=e,i&&!r||i&&this.Gr(t)||(this.Rr=t,this.Tr.register({[lu]:[t,e,n]}))}Qr(){var e=this.Ne?.persistence_save_debounce_ms;return Cs(e)&&e>0}Kr(){this.Qr()?this.Tr.refreshKey(lu):(this.Tr.flush(),this.Tr.load())}Jr(){if(!xs(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Rr){this.Kr();var e=this.Yr();e[1]===this.$r&&e[2]===this._sessionStartTimestamp&&(this.Rr=this._sessionActivityTimestamp,this.Tr.register({[lu]:[this._sessionActivityTimestamp,this.$r??null,this._sessionStartTimestamp]}),this.Tr.flush())}}Xr(){var e=this.Yr()[0],t=Cs(e)?e:0,n=Cs(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)}tn(e){return this.Kr(),this.Or(e,this.Xr())}Yr(){var e=this.Tr.props[lu];return V(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Rr=null,clearTimeout(this.en),this.en=void 0,this.zr(null,null,null)}destroy(){this.Lr=!0,this.Jr(),clearTimeout(this.en),this.en=void 0,this.Fr&&P&&(P.removeEventListener(Zu,this.Fr,{capture:!1}),this.Fr=void 0),this.Ar=[]}Wr(){this.Fr=()=>{this.Jr(),this.Ur()&&Dd.q(this.Hr)},ld(P,Zu,this.Fr,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.Ne.cookieless_mode===Ku)throw Error(`checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"`);var n=t||new Date().getTime(),r=this.Yr(),i=r[1],a=r[2],o=this.Xr(),s=this.Zr(),c=Cs(a)&&Math.abs(n-a)>864e5,l=!1,u=!1,d=!i,f=i,p=!d&&!e&&this.Or(n,o);if(p){(p=this.tn(n))||vm.info(`cross-tab refresh kept the session alive`,{sessionId:i});var m=this.Yr();i=m[1],a=m[2]}d||p||c?(i=this.Nr(),s=this.qr(),vm.info(`new session ID generated`,{sessionId:i,windowId:s,changeReason:{noSessionId:d,activityTimeout:p,sessionPastMaximumLength:c}}),a=n,l=!0):(s||(s=this.qr(),l=!0),(u=i!==f)&&(vm.info(`adopted cross-tab session id`,{sessionId:i,windowId:s}),l=!0));var h=Cs(o)&&e&&!c?o:n,g=Cs(a)?a:new Date().getTime();this.Vr(s),this.zr(i,h,g),e||this.jr();var _={noSessionId:d,activityTimeout:p,sessionPastMaximumLength:c,crossTabAdoption:u};return l&&this.Ar.forEach((e=>e(i,s,_))),{sessionId:i,windowId:s,sessionStartTimestamp:g,changeReason:l?_:void 0,lastActivityTimestamp:o}}jr(){this.Lr||(clearTimeout(this.en),this.en=setTimeout((()=>
6{if(!this.Lr){if(this.tn(new Date().getTime())){var e=this.$r;this.resetSessionId(),this.Pr.emit(`forcedIdleReset`,{idleSessionId:e})}else this.jr()}}),1.1*this.sessionTimeoutMs))}},bm=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&ds(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((e=>ds(e?.brand,t))))return!0}catch{}return!!e.webdriver};function xm(){return(xm=R((function*(){var e=Lo?.userAgentData;if(e!=null&&e.getHighEntropyValues)try{var t=(yield e.getHighEntropyValues([`model`]))?.model;return W(t)&&t.length>0?t:void 0}catch(e){K.info(`Unable to resolve $device_model from userAgentData.getHighEntropyValues`,e);return}}))).apply(this,arguments)}var Sm=function(e,t){if(!function(e){try{new RegExp(e)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function Cm(e,t,n){return Mf({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var wm={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>Sm(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Sm(t,e))))),icontains:(e,t)=>t.map(Tm).some((t=>e.map(Tm).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(Tm).every((t=>e.map(Tm).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n<parseFloat(e)))}))},Tm=e=>e.toLowerCase();function Em(e,t){return!e||Object.entries(e).every((e=>{var n=e[1],r=t?.[e[0]];if(U(r)||xs(r))return!1;var i=[String(r)],a=wm[n.operator];return!!a&&a(n.values,i)}))}var Dm=`custom`,Om=`i.posthog.com`,km=/^\/static\//,Am=class{constructor(e){this.rn={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,``);return e===`https://app.posthog.com`?`https://us.i.posthog.com`:e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,``):this.apiHost}get uiHost(){var e=this.instance.config.ui_host?.replace(/\/$/,``);return e||=this.apiHost.replace(`.`+Om,`.posthog.com`),e===`https://app.posthog.com`?`https://us.posthog.com`:e}get region(){return this.rn[this.apiHost]||(this.rn[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`us`:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`eu`:Dm),this.rn[this.apiHost]}nn(e){if(km.test(e)){var t=this.instance.config.asset_host;if(typeof t==`string`)return t.trim().replace(/\/$/,``)||void 0}}endpointFor(e,t){if(t===void 0&&(t=``),t&&=t[0]===`/`?t:`/`+t,e===`ui`)return this.uiHost+t;if(e===`flags`)return this.flagsApiHost+t;if(e===`assets`){var n=this.nn(t);if(n)return``+n+t}if(this.region===Dm)return this.apiHost+t;var r=Om+t;switch(e){case`assets`:return`https://`+this.region+`-assets.`+r;case`api`:return`https://`+this.region+`.`+r}}};function jm(e){var t;return!((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null||!t.length)}var Z=q(`[Surveys]`),Mm=`seenSurvey_`,Nm=e=>{try{var t=(e=>((e,t)=>``+Mm+function(e){return e.current_iteration&&e.current_iteration>0?e.id+`_`+e.current_iteration:e.id}(t))(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,`true`)}catch(e){Z.error(`Failed to persist survey seen state`,e)}},Pm=[sp.Popover,sp.Widget,sp.API],Fm={ignoreConditions:!1,ignoreDelay:!1,displayType:up.Popover},Im=q(`[PostHog ExternalIntegrations]`),Lm={intercom:`intercom-integration`,crispChat:`crisp-chat-integration`},Rm=class{constructor(e){this._instance=e}ai(e,t){var n;(n=I.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(e=>{if(e)return Im.error(`failed to load script`,e);t()}))}startIfEnabledOrStop(){var e=this,t=function(){var t,r,i,a=n[0],o=n[1];!o||(t=I.__PosthogExtensions__)!=null&&(t=t.integrations)!=null&&t[a]||e.ai(Lm[a],(()=>{var t;(t=I.__PosthogExtensions__)==null||(t=t.integrations)==null||(t=t[a])==null||t.start(e._instance)})),!o&&(r=I.__PosthogExtensions__)!=null&&(r=r.integrations)!=null&&r[a]&&((i=I.__PosthogExtensions__)==null||(i=i.integrations)==null||(i=i[a])==null||i.stop())};for(var n of Object.entries((r=this._instance.config.integrations)??{})){var r;t()}}},zm=class{constructor(e,t){this.rt=e,this.sn=t,this.an=new Map,this.ln=!1}add(e){var t=this;return R((function*(){if(t.ln)throw Error(`Cannot add an extension to a disposed ExtensionRuntime`);if(t.an.has(e.name))throw Error(`Browser extension "`+e.name+`" is already registered`);t.an.set(e.name,e);try{var n=e.setup(t.sn);n&&(yield n)}catch(n){var r=t.an.get(e.name)===e;r&&t.an.delete(e.name),t.rt.error(`Failed to set up browser extension "`+e.name+`"`,n),r&&t.un(e)}}))()}dispose(){if(!this.ln){this.ln=!0;var e=Array.from(this.an.values()).reverse();
6for(var t of(this.an.clear(),e))this.un(t)}}un(e){try{var t=e.dispose==null?void 0:e.dispose();t&&vs(t.then)&&t.then(void 0,(t=>{this.rt.error(`Failed to dispose browser extension "`+e.name+`"`,t)}))}catch(t){this.rt.error(`Failed to dispose browser extension "`+e.name+`"`,t)}}},Bm=class{constructor(e){this._instance=e}get(e){return this._instance.persistence?.get_property(e)}set(e,t){var n;(n=this._instance.persistence)==null||n.set_property(e,t)}remove(e){var t;(t=this._instance.persistence)==null||t.unregister(e)}},Vm=`extensionsRemoteConfig`,Hm=class{constructor(e){this.ln=!1,this.instance=e,this.rt=K.createLogger(`[BrowserExtensions]`),this.hn=e.dn,this.kv=new Bm(e),this.onEvent=e=>ip(this.instance.on(`eventCaptured`,(t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.rt.error(`Browser extension event listener failed`,e)}}))),this.onRemoteConfig=e=>{if(this.ln)return ip((()=>{}));var t=t=>{try{e(t)}catch(e){this.rt.error(`Browser extension remote config listener failed`,e)}},n=this.instance.vn.on(Vm,t);return this.hn&&t(this.hn),ip(n)},this.cn=new zm(this.rt,this)}get logger(){return this.rt}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){return this.instance.get_property(Wl)??this.distinctId}get groups(){return this.instance.getGroups()}get session(){try{var e=this.instance.sessionManager?.checkAndGetSessionAndWindowId(!0);return{sessionId:e?.sessionId??``,windowId:e?.windowId??``,sessionStartTimestamp:e?.sessionStartTimestamp??0}}catch{return{sessionId:``,windowId:``,sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(e){return this.cn.add(e)}capture(e,t,n){var r=this;return R((function*(){n?r.instance.capture(e,t,{timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce}):r.instance.capture(e,t)}))()}registerDynamicEventProperties(e){return ip(this.instance.fn(e))}handleRemoteConfig(e){this.ln||(this.hn=e,this.instance.vn.emit(Vm,e))}sendRequest(e,t){var n=this;return R((function*(){t===void 0&&(t={});var r=n.instance.requestRouter.endpointFor(t.target??`api`,e),i={method:t.method,url:t.query?$p(r,t.query):r,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport};return t.transport===`sendBeacon`?(n.instance._send_request(i),{statusCode:202}):new Promise((e=>{i.callback=e,n.instance._send_request(i)}))}))()}dispose(){this.ln||(this.ln=!0,this.cn.dispose())}},Um={},Wm=0,Gm=()=>{},Km=`Consent opt in/out is not valid with cookieless_mode="always" and will be ignored`,qm=`Surveys module not available`,Jm=`sanitize_properties is deprecated. Use before_send instead`,Ym=`Invalid value for property_denylist config: `,Xm=[`token`,`distinct_id`,Bu],Zm=`posthog`,Qm=!Yp&&Uo?.indexOf(`MSIE`)===-1&&Uo?.indexOf(`Mozilla`)===-1,$m=e=>{var t;return z({api_host:`https://us.i.posthog.com`,flags_api_host:null,ui_host:null,asset_host:null,token:``,autocapture:!0,cross_subdomain_cookie:cd(F?.location),persistence:`localStorage+cookie`,persistence_name:``,cookie_persisted_properties:[],loaded:Gm,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:`if_capture_pageview`,defaults:e??`unset`,__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Ro&&W(Ro?.search)&&Ro.search.indexOf(`__posthog_debug=true`)!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(P==null||(t=P.location)==null?void 0:t.protocol)===`https:`,ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:`localStorage`,consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){K.error(`Bad HTTP status: `+e.statusCode+` `+e.text)},get_device_id:e=>e,capture_performance:void 0,name:`posthog`,bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Yu,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:um},error_tracking:{},_onCapture:Gm},(e=>({rageclick:e&&e>=`2026-05-30`?{content_ignorelist:Zd,ignore_text_selection:!0}
6:!e||`2025-11-30`>e||{content_ignorelist:!0},capture_pageview:!e||`2025-05-24`>e||`history_change`,session_recording:e&&e>=`2026-06-25`?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>=`2026-05-30`?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>=`2025-11-30`?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>=`2026-01-30`?`head`:`body`,internal_or_test_user_hostname:e&&e>=`2026-01-30`?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>=`2026-05-30`?250:0,split_storage:!(!e||`2026-05-30`>e),detect_google_search_app:!(!e||`2026-05-30`>e),disable_capture_url_hashes:!(!e||`2026-06-25`>e)}))(e))},eh=[[`process_person`,`person_profiles`],[`xhr_headers`,`request_headers`],[`cookie_name`,`persistence_name`],[`disable_cookie`,`disable_persistence`],[`__preview_disable_beacon`,`disable_beacon`],[`store_google`,`save_campaign_params`],[`verbose`,`debug`]],th=e=>{var t={};for(var n of eh){var r=n[0],i=n[1];U(e[r])||(t[i]=e[r])}var a=Y({},t,e),o=e.__preview_external_dependency_versioned_paths;return U(o)||(U(e.strict_script_versioning)&&(a.strict_script_versioning=!!o),W(o)&&U(e.asset_host)&&(a.asset_host=o)),V(e.property_blacklist)&&(U(e.property_denylist)?a.property_denylist=e.property_blacklist:V(e.property_denylist)?a.property_denylist=[...e.property_blacklist,...e.property_denylist]:K.error(Ym+e.property_denylist)),a},nh=class{constructor(){this.__forceAllowLocalhost=!1}get pn(){return this.__forceAllowLocalhost}set pn(e){K.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},rh=class e{gn(e,t){if(e){var n=this.an.indexOf(e);n!==-1&&this.an.splice(n,1)}return this.an.push(t),t.initialize==null||t.initialize(),t}mn(){return this.config.cookieless_mode===Ku||this.config.cookieless_mode===Gu&&this.consent.isRejected()}get decideEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}get flagsEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}constructor(){this.webPerformance=new nh,this.yn=!1,this.version=L.LIB_VERSION,this.bn=new Set,this._n=``,this.vn=new _m,this.an=[],this.wn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=$m(),this.SentryIntegration=Ef,this.sentryIntegration=e=>function(e,t){var n=Tf(e,t);return{name:wf,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint=`/e/`,this.kn=!1,this.xn=null,this.Sn=null,this.Cn=null,this.scrollManager=new mm(this),this.pageViewManager=new Df(this),this.rateLimiter=new mp(this),this.requestRouter=new Am(this),this.consent=new Od(this),this.externalIntegrations=new Rm(this);var t=e.__defaultExtensionClasses??{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,n)=>{var r=W(e)?{[e]:t}:e;this.setPersonProperties(r),n?.({})},set_once:(e,t,n)=>{var r=W(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on(`eventCaptured`,(e=>K.info(`send "`+e?.event+`"`,e)))}init(t,n,r){if(r&&r!==Zm){var i=Um[r]??new e;return i._init(t,n,r),Um[r]=i,Um[Zm][r]=i,i}return this._init(t,n,r)}_init(e,t,n){var r;t===void 0&&(t={});var i=W(e)?e.trim():``;if(!i)return K.critical(`PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()`),this;if(this.__loaded)return i===this.config?.token?console.warn(`[PostHog.js]`,`You have already initialized PostHog! Re-initializing is a no-op`):console.warn(`[PostHog.js]`,`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('`+i+`', { ... }, 'project2')`),this;this.__loaded=!0,this.config=$m(t.defaults),t.debug=this.Mn(t.debug),this.Tn=t,this.En=[],t.person_profiles?this.Sn=t.person_profiles:t.process_person&&(this.Sn=t.process_person);var a=$m(t.defaults),o=th(t),s=Y({},a,o,{name:n,token:i});H(a.rageclick)&&H(o.rageclick)&&(s.rageclick=Y({},a.rageclick,o.rageclick)),H(a.session_recording)&&H(o.session_recording)&&(s.session_recording=Y({},a.session_recording,o.session_recording)),this.set_config(s),this.config.on_xhr_error&&K.error(`on_xhr_error is deprecated. Use on_request_error instead`),this.compression=t.disable_compression?void 0:ap.GZipJS;var c=this.In();if(this.persistence=new rp(this.config,c),this.sessionPersistence=this.config.persistence===`
6sessionStorage`||this.config.persistence===`memory`?this.persistence:new rp(z({},this.config,{persistence:`sessionStorage`}),c,!1),this._n=`ph_`+(this.config.persistence_name||this.config.token)+`_session_registered_properties`,this.config.persistence!==`memory`&&!c&&Dd.N()){var l=Dd.H(this._n);V(l)&&l.forEach((e=>{W(e)&&this.bn.add(e)}))}else Dd.q(this._n);var u=z({},this.persistence.props),d=z({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Pn=new dm((e=>this.Rn(e)),this.config.request_queue_config),this.An=new pm(this),this.__request_queue=[];var f=this.mn();if(f||(this.sessionManager=new ym(this),this.sessionPropsManager=new gm(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((e,t,n)=>{(n!=null&&n.activityTimeout||n!=null&&n.sessionPastMaximumLength||n!=null&&n.crossTabAdoption)&&this.Fn()}))),this.config.__preview_deferred_init_extensions?(K.info(`Deferring extension initialization to improve startup performance`),setTimeout((()=>{this.Ln(f)}),0)):(K.info(`Initializing extensions synchronously`),this.Ln(f)),L.DEBUG=L.DEBUG||this.config.debug,L.DEBUG&&K.info(`Starting in debug mode`,{this:this,config:t,thisC:z({},this.config),p:u,s:d}),!this.config.identity_distinct_id||(r=t.bootstrap)!=null&&r.distinctID||(t.bootstrap=z({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),t.bootstrap?.distinctID!==void 0){var p=t.bootstrap.distinctID,m=this.get_distinct_id(),h=this.persistence.get_property(Mu);if(t.bootstrap.isIdentifiedID&&m!=null&&m!==p&&h===qu)this.identify(p);else if(t.bootstrap.isIdentifiedID&&m!=null&&m!==p&&h===Ju)K.warn(`Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.`);else{var g=this.config.get_device_id(_d()),_=t.bootstrap.isIdentifiedID?g:p;this.persistence.set_property(Mu,t.bootstrap.isIdentifiedID?Ju:qu),this.register({distinct_id:p,$device_id:_})}}if(f)this.register_once({distinct_id:zu,$device_id:null},``);else if(!this.get_distinct_id()){var v=this.config.get_device_id(_d());this.register_once({distinct_id:v,$device_id:v},``),this.persistence.set_property(Mu,qu)}return ld(P,`onpagehide`in self?`pagehide`:`unload`,this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var n=e.config.segment;if(!n)return t();(function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||_d();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(Mu,Ju)),t()},i=n.user();`then`in i&&vs(i.then)?i.then(r):r(i)})(e,(()=>{n.register((e=>{typeof Promise<`u`&&Promise.resolve||Cf.warn(`This browser does not have Promise support, and can not use the segment integration`);var t=(t,n)=>{if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Cf.info(`No userId set, resetting PostHog`),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Cf.info(`UserId set, identifying with PostHog`),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:`PostHog JS`,type:`enrichment`,version:`1.0.0`,isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,Qu),identify:e=>t(e,ed),screen:e=>t(e,`$screen`)}})(e)).then((()=>{t()}))}))}(this,(()=>this.On())):this.On(),vs(this.config._onCapture)&&this.config._onCapture!==Gm&&(K.warn("onCapture is deprecated. Please use `before_send` instead"),this.on(`eventCaptured`,(e=>this.config._onCapture(e.event,e)))),this.config.ip&&K.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return xm.apply(this,arguments)}().then((e=>{e&&this.register({[Gl]:e})})).catch(Gm),this}Ln(t){var n=performance.now(),r=z({},e.__defaultExtensionClasses,this.config.__extensionClasses),i=[];r.featureFlags&&this.an.push(this.featureFlags=this.featureFlags??new r.featureFlags(this)),r.exceptions&&this.an.push(this.exceptions=this.exceptions??new r.exceptions(this)),r.historyAutocapture&&this.an.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.an.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.an.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!t&&this.an.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.autocapture&&this.an.push(this.autocapture=new r.autocapture(this)),r.surveys&&this.an.push(this.surveys=this.surveys??new r.surveys(this)),r.logs&&this.an.push(this.logs=this.logs??new r.logs(this)),r.metrics&&this.an.push(this.metrics=this.metrics??new r.metrics(this)),r.conversations&&this.an.push(this.conversations=this.conversations??new r.conversations(this)),r.productTours&&this.an.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.an.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.an.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.an.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.an.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,xf)),r.toolbar&&this.an.push(this.toolbar=this.toolbar??new r.toolbar(this)),r.experiments&&this.an.push(this.experiments=this.experiments??new r.experiments(this)),this.an.forEach((e=>{e.initialize&&i.push((()=>{e.initialize==null||e.initialize()}))})),i.push((()=>
6{if(this.Dn){var e=this.Dn;this.Dn=void 0,this.an.forEach((t=>t.onRemoteConfig==null?void 0:t.onRemoteConfig(e)))}})),this.$n(i,n)}$n(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.$n(e,t)}),0);var n=e.shift();if(n)try{n()}catch(e){K.error(`Error initializing extension:`,e)}}var r=Math.round(performance.now()-t);this.register_for_session({[Vu]:this.config.__preview_deferred_init_extensions?`deferred`:`synchronous`,[Hu]:r}),this.config.__preview_deferred_init_extensions&&K.info(`PostHog extensions initialized (`+r+`ms)`)}Gi(e){var t;if(!F||!F.body)return K.info(`document not ready yet, trying again in 500 milliseconds...`),void setTimeout((()=>{this.Gi(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.Dn=e),this.dn=e,this.compression=void 0,e.ok){var n,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=B(r.supportedCompression,ap.GZipJS)?ap.GZipJS:B(r.supportedCompression,ap.Base64)?ap.Base64:void 0),(n=r.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.Sn?this.Sn:Yu}),(t=this.Nn)==null||t.handleRemoteConfig(e),this.an.forEach((t=>t.onRemoteConfig==null?void 0:t.onRemoteConfig(e)))}On(){try{this.config.loaded(this)}catch(e){K.critical("`loaded` function failed",e)}if(this.qn(),this.config.internal_or_test_user_hostname&&Ro!=null&&Ro.hostname){var e=Ro.hostname,t=this.config.internal_or_test_user_hostname;(typeof t==`string`?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.mn())&&this.jn()}),1),this.Bn=new gp(this),this.Bn.load()}qn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Pn)==null||e.enable())}_dom_loaded(){this.is_capturing()&&nd(this.__request_queue,(e=>this.Rn(e))),this.__request_queue=[],this.qn()}_handle_unload(){var e,t,n,r,i;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(t=this.metrics)==null||t.flush(`sendBeacon`),this.config.request_batching?(this.Hn()&&this.capture($u),(n=this.logs)==null||n.flushLogs(`sendBeacon`),(r=this.Pn)==null||r.unload(),(i=this.An)==null||i.unload()):this.Hn()&&this.capture($u,null,{transport:`sendBeacon`})}_send_request(e){this.__loaded?Qm?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=z({},this.config.request_headers,e.headers),e.compression=e.compression===`best-available`?this.compression:e.compression,(U(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=[`sendBeacon`]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t=z({},e);t.timeout=t.timeout||6e4;var n,r,i,a,o=t.transport??`fetch`;o===`sendBeacon`&&U(t.compression)&&t.data&&(t.compression=ap.Base64),t.method===`POST`&&t.data&&(t.timestampMode===`capture-body`?t.data={api_key:((a=(i=V(n=t.data)?n:[n])[0])==null||(r=a.properties)==null?void 0:r.token)??a?.token,batch:i,sent_at:new Date().toISOString()}:t.timestampMode===`body`&&(t.data=function(e,t){return t===void 0&&(t=new Date().toISOString()),V(e)?e.map((e=>z({},e,{sent_at:t}))):z({},e,{sent_at:t})}(t.data))),t.url=cm(t.url,t.method,t.compression,t.timestampMode);var s=lm.filter((e=>!t.disableTransport||!e.transport||!t.disableTransport.includes(e.transport))),c=function(e,t){for(var n=0;e.length>n;n++)if(e[n].transport===o)return e[n]}(s)?.method??s[0].method;if(!c)throw Error(`No available transport method`);var l=e=>{try{c(e)}catch(e){am(e)?K.warn(e):K.error(e),t.callback==null||t.callback({statusCode:0,error:e})}};o!==`sendBeacon`&&t.data&&t.compression===ap.GZipJS&&Ho&&typeof Promise<`u`&&!Zp?rm(t).then((e=>{l(e)})).catch((n=>{if(os(n))return Zp=!0,void l(z({},t,{compression:void 0,url:cm(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||typeof e!=`object`)return!1;var t=`name`in e?String(e.name):``;return os(e)||t===rs})(n)&&(Zp=!0),l(t)})):c(t)})(z({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(n=(r=this.config).on_request_error)==null||n.call(r,t),e.callback==null||e.callback(t)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}
6Rn(e){this.An?this.An.retriableRequest(e):this._send_request(e)}_execute_array(e){Wm++;try{var t,n=[],r=[],i=[];nd(e,(e=>{if(e){if(V(t=e[0]))i.push(e);else if(vs(e))try{e.call(this)}catch(t){K.error(`Error executing queued PostHog call`,e,t)}else V(e)&&t===`alias`?n.push(e):V(e)&&t.indexOf(`capture`)!==-1&&vs(this[t])?i.push(e):r.push(e)}}));var a=function(e,t){nd(e,(function(e){try{if(V(e[0])){var n=t;J(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){K.error(`Error executing queued PostHog call`,e,t)}}))};a(n,this),a(r,this),a(i,this)}finally{Wm--}}push(t){if(Wm>0&&V(t)&&W(t[0])){var n=e.prototype[t[0]];vs(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(e,t,n){var r,i,a,o,s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Pn){if(this.is_capturing()){if(!U(e)&&W(e)){var c=!this.config.opt_out_useragent_filter&&this._is_bot();if(!c||this.config.__preview_capture_bot_pageviews){var l=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(l==null||!l.isRateLimited){if(this.wn.length>0){var u={};for(var d of this.wn.slice())try{Y(u,d())}catch(e){K.error(`Failed to produce browser extension event properties`,e)}t=z({},u,t??{})}var f;(r=t)!=null&&r.$current_url&&!W(t?.$current_url)&&(K.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),(f=t)==null||delete f.$current_url),e!==`$exception`||n!=null&&n.Un||K.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var p=new Date,m=n?.timestamp||p,h=Hc(n?.uuid,_d),g={uuid:h,event:e,properties:this.calculateEventProperties(e,t||{},m,h)};e===Qu&&this.config.__preview_capture_bot_pageviews&&c&&(g.event=`$bot_pageview`,g.properties.$browser_type=`bot`),l&&(g.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens);var _=e===`$feature_flag_called`&&!1===g.properties.$feature_flag_has_experiment&&!0===this.get_property(_u);n!=null&&n.$set&&!_&&(g.$set=n?.$set);var v=n?.$unset;v&&(g.$unset=v);var y,b,x,S=_?void 0:this.zn(n?.$set_once,e!==td,e===ed);if(S&&(g.$set_once=S),n!=null&&n._noTruncate||(i=this.config.properties_string_max_length,a=g,o=e=>W(e)?e.slice(0,i):e,s=new Set,g=function e(t,n){if(t!==Object(t))return o?o(t):t;if(!s.has(t)){var r;if(s.add(t),V(t))r=[],nd(t,(t=>{r.push(e(t))}));else{var i={};J(t,((t,n)=>{s.has(t)||(i[n]=e(t,n))})),r=i}return r}}(a)),g.timestamp=m,U(n?.timestamp)||(g.properties.$event_time_override_provided=!0,g.properties.$event_time_override_system_time=p),_&&(g.properties=function(e,t){t===void 0&&(t=[]);var n={},r=t=>{e[t]!==void 0&&(n[t]=e[t])};return Qo.forEach(r),t.forEach(r),n}(g.properties,Xm)),e===cp.DISMISSED||e===cp.SENT){var C=t?.[lp.SURVEY_ID],w=t?.[lp.SURVEY_ITERATION];Nm({id:C,current_iteration:w}),g.$set=z({},g.$set,{[(y={id:C,current_iteration:w},b=e===cp.SENT?`responded`:`dismissed`,x=`$survey_`+b+`/`+y.id,y.current_iteration&&y.current_iteration>0&&(x=`$survey_`+b+`/`+y.id+`/`+y.current_iteration),x)]:!0})}else e===cp.SHOWN&&(g.$set=z({},g.$set,{[lp.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===dp.SHOWN){var T=t?.[fp.TOUR_TYPE];T&&(g.$set=z({},g.$set,{[fp.TOUR_LAST_SEEN_DATE+`/`+T]:new Date().toISOString()}))}var E=z({},g.properties.$set,g.$set);if(ys(E)||this.setPersonPropertiesForFlags(E),!G(this.config.before_send)){var D=this.Pt(g);if(!D)return;(g=D).uuid=Hc(g.uuid,_d)}this.vn.emit(`eventCaptured`,g);var O=n?._url??this.requestRouter.endpointFor(`api`,this.analyticsDefaultEndpoint),k={method:`POST`,url:O,data:g,compression:`best-available`,timestampMode:n?._batchKey===`recordings`||/\/s\/(?:\?|$)/.test(O)?`body`:`capture-body`,batchKey:n?._batchKey,transport:n?.transport};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Rn(k):this.Pn.enqueue(k),g}K.critical(`This capture call is ignored due to client rate limiting.`)}}else K.error(`No event name provided to posthog.capture`)}}else K.uninitializedWarning(`posthog.capture`)}_addCaptureHook(e){return this.on(`eventCaptured`,(t=>e(t.event,t)))}
6Wn(){return this.Nn??=new Hm(this)}fn(e){this.wn.push(e);var t=!0;return()=>{if(t){t=!1;var n=this.wn.indexOf(e);n!==-1&&this.wn.splice(n,1)}}}calculateEventProperties(e,t,n,r,i){if(n||=new Date,!this.persistence||!this.sessionPersistence)return t;var a=i?void 0:this.persistence.remove_event_timer(e),o=z({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.mn()&&(o[Bu]=!0),e===`$snapshot`){var s=z({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=s.distinct_id,(!W(o.distinct_id)&&!Ss(o.distinct_id)||bs(o.distinct_id))&&K.error(`Invalid distinct_id for replay event. This indicates a bug in your implementation`),o}var c,l=function(e,t,n,r){var i,a,o;if(r===void 0&&(r=!1),!Uo)return{};var s,c=e?[...Bf,...t||[]]:[],l=function(e){for(var t=0;zc.length>t;t++){var n=zc[t],r=n[1],i=n[0].exec(e),a=i&&(vs(r)?r(i,e):r);if(a)return a}return[``,``]}(Uo),u=l[0],d=l[1],f=(s=typeof navigator<`u`?navigator:void 0)!=null&&s.brave?{brave:!0}:{},p={};U(n)||(p.detectGoogleSearchApp=n);var m={},h=(i=navigator)==null||(i=i.userAgentData)==null?void 0:i.platform,g=navigator?.maxTouchPoints,_=P==null||(a=P.screen)==null?void 0:a.width,v=P==null||(o=P.screen)==null?void 0:o.height,y=P?.devicePixelRatio;U(h)||(m.userAgentDataPlatform=h),U(g)||(m.maxTouchPoints=g),U(_)||(m.screenWidth=_),U(v)||(m.screenHeight=v),U(y)||(m.devicePixelRatio=y);var b,x,S,C,w=Y(od({$os:u,$os_version:d,$browser:Ic(Uo,navigator.vendor,f,p),$device:Bc(Uo),$device_type:(x=Uo,S=m,C=Bc(x),C===Hs||C===Vs||C===`Kobo`||C===`Kindle Fire`||C===vc?Bs:C===sc||C===lc||C===cc||C===hc?`Console`:C===Ws?`Wearable`:C?Ls:S?.userAgentDataPlatform===`Android`&&(S?.maxTouchPoints??0)>0?600>Math.min(S?.screenWidth??0,S?.screenHeight??0)/(S?.devicePixelRatio??1)?Ls:Bs:`Desktop`),$timezone:Qf(),$timezone_offset:$f()}),{$current_url:Ff(r?Uc(Ro?.href):Ro?.href,c,Hf),$host:Ro?.host,$pathname:Ro?.pathname,$raw_user_agent:Uo.length>1e3?Uo.substring(0,997)+`...`:Uo,$browser_version:Rc(Uo,navigator.vendor,f,p),$browser_language:qf(),$browser_language_prefix:(b=qf(),typeof b==`string`?b.split(`-`)[0]:void 0),$screen_height:P?.screen.height,$screen_width:P?.screen.width,$viewport_height:P?.innerHeight,$viewport_width:P?.innerWidth,$lib:L.LIB_NAME,$lib_version:L.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return L.SDK_DIST_CHANNEL&&(w.$sdk_dist_channel=L.SDK_DIST_CHANNEL),w}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var u=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime()),d=u.windowId;o.$session_id=u.sessionId,o.$window_id=d}this.sessionPropsManager&&Y(o,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&Y(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=this.An?.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Dm&&(o.$lib_custom_api_host=this.config.api_host),c=e!==Qu||i?e!==$u||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),o=Y(o,c),e===Qu&&F&&(o.title=F.title),!U(a)){var f=n.getTime()-a;o.$duration=parseFloat((f/1e3).toFixed(3))}Uo&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?`bot`:`browser`);var p=this.persistence.properties(),m=this.sessionPersistence.properties();J([`$referrer`,`$referring_domain`],(e=>{e in p&&delete m[e]})),(o=Y({},l,p,m,o)).$is_identified=this._isIdentified(),V(this.config.property_denylist)?J(this.config.property_denylist,(function(e){delete o[e]})):K.error(Ym+this.config.property_denylist+` or property_blacklist config: `+this.config.property_blacklist);var h=this.config.sanitize_properties;h&&(K.error(Jm),o=h(o,e));var g=this.Vn();return o.$process_person_profile=g,g&&!i&&this.Zn(`_calculate_event_properties`),o}zn(e,t,n){if(t===void 0&&(t=!0),n===void 0&&(n=!1),!this.persistence||!this.Vn()||this.yn&&!n)return e;var r=Y({},this.persistence.get_initial_props(),this.sessionPropsManager?.getSetOnceProps()||{},e||{}),i=this.config.sanitize_properties;return i&&(K.error(Jm),r=i(r,`$set_once`)),t&&(this.yn=!0),ys(r)?void 0:r}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e),Object.keys(e).forEach((e=>this.bn.add(e))),this.Gn()}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e),this.bn.delete(e),this.Gn()}Qn(e,t){this.register({[e]:t})}
6Fn(){this.bn.forEach((e=>{var t;(t=this.sessionPersistence)==null||t.unregister(e)})),this.bn.clear(),this.Gn()}Gn(){var e;if(this._n){if(this.config.persistence===`memory`||(e=this.sessionPersistence)!=null&&e.xi||!Dd.N())Dd.q(this._n);else{var t=[];this.bn.forEach((e=>t.push(e))),t.length>0?Dd.F(this._n,t):Dd.q(this._n)}}}getFeatureFlag(e,t){return this.featureFlags?.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags?.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags?.getFeatureFlagResult(e,t)}getAllFeatureFlags(){return this.featureFlags?.getAllFeatureFlags()??[]}isFeatureEnabled(e,t){return this.featureFlags?.isFeatureEnabled(e,t)??t?.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,t,n){var r;(r=this.featureFlags)==null||r.updateFlags(e,t,n)}updateEarlyAccessFeatureEnrollment(e,t,n){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags?.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.vn.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:qm}),()=>{})}onSessionId(e){return this.sessionManager?.onSessionId(e)??(()=>{})}getSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:qm})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:qm})}renderSurvey(e,t){var n;(n=this.surveys)==null||n.renderSurvey(e,t)}displaySurvey(e,t){var n;t===void 0&&(t=Fm),(n=this.surveys)==null||n.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys?.canRenderSurvey(e)??{visible:!1,disabledReason:qm}}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys?.canRenderSurveyAsync(e,t)??Promise.resolve({visible:!1,disabledReason:qm})}Kn(e){return!e||bs(e)?(K.critical(`Unique user id has not been set in posthog.identify`),!1):e===zu?(K.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):![`distinct_id`,`distinctid`].includes(e.toLowerCase())&&![`undefined`,`null`].includes(e.toLowerCase())||(K.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,t,n){if(!this.__loaded||!this.persistence)return K.uninitializedWarning(`posthog.identify`);if(Ss(e)&&(e=e.toString(),K.warn(`The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.`)),this.Kn(e)&&this.Zn(`posthog.identify`)){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Wl)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},``),e!==r&&e!==this.get_property(Kl)&&(this.unregister(Kl),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(Mu)||qu)===qu,o=e!==r,s=!o&&a;if(o&&a)this.persistence.set_property(Mu,Ju),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.capture(ed,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Cn=Cm(e,t,n),(i=this.featureFlags)==null||i.setAnonymousDistinctId(r);else if(s){this.persistence.set_property(Mu,Ju);var c=t||{},l=n||{};this.setPersonPropertiesForFlags({$set:c,$set_once:l},!1),this.capture(`$set`,{$set:c,$set_once:l}),this.Cn=Cm(e,t,n)}else(t||n)&&this.setPersonProperties(t,n);o?(this.reloadFeatureFlags(),this.unregister(Ou)):s&&(t||n)&&this.reloadFeatureFlags()}}setPersonProperties(e,t){if((e||t)&&this.Zn(`posthog.setPersonProperties`)){var n=Cm(this.get_distinct_id(),e,t);this.Cn===n?K.info(`A duplicate setPersonProperties call was made with the same properties. It has been ignored.`):(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture(`$set`,{$set:e||{},$set_once:t||{}}),this.Cn=n)}}unsetPersonProperties(e){var t,n=(V(e)?e:[e]).filter((e=>W(e)&&e.length>0));n.length!==0&&this.Zn(`posthog.unsetPersonProperties`)&&((t=this.featureFlags)==null||t.unsetPersonPropertiesForFlags(n,!0),this.capture(`$set`,{$unset:n}),this.Cn=null)}group(e,t,n){if(e&&t){var r=this.getGroups(),i=r[e]!==t;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:z({},r,{[e]:t})}),i||n){var a={$group_type:e,$group_key:t};n&&(a.$group_set=n),this.capture(td,a)}n&&this.setGroupPropertiesForFlags({[e]:n}),i&&!n&&this.reloadFeatureFlags()}else K.error(`posthog.group requires a group type and group key`)}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),(n=this.featureFlags)==null||n.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;e===void 0&&(e=!0),(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),this.Zn(`posthog.setGroupPropertiesForFlags`)&&((n=this.featureFlags)==null||n.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){this.Jn(e)}Jn(e,t){var n,r,i,a,o,s,c,l,u,d;if(t===void 0&&(t=!1),K.info(`reset`),!this.__loaded)return K.uninitializedWarning(`posthog.reset`);var f,p=this.get_property(Wl),m=this.get_property(Gl),h=this.get_property(ru),g=this.is_capturing();if(this.consent.reset(),t||!g||this.is_capturing()||console.warn(`[PostHog.js]`,"reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after."),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.bn.clear(),this.Gn(),U(h)||(f=this.persistence)==null||f.register({[ru]:h}),(i=this.surveys)==null||i.reset(),(a=this.Bn)==null||a.stop(),(o=this.featureFlags)==null||o.reset(),(s=this.conversations)==null||s.reset(),(c=this.logs)==null||c.reset(),(l=this.metrics)==null||l.reset(),(u=this.persistence)==null||u.set_property(Mu,qu),(d=this.sessionManager)==null||d.resetSessionId(),this.Cn=null,this.config.cookieless_mode===Ku)this.register_once({distinct_id:zu,$device_id:null},``);else{var _=this.config.get_device_id(_d());this.register_once({distinct_id:_,$device_id:e?_:p},``),e||U(m)||this.register({[Gl]:m})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var t=this;return R((function*(){var e,n,r,i,a,o,s,c;t.__loaded?((e=t.Bn)==null||e.stop(),(n=t.Nn)==null||n.dispose(),(r=t.sessionRecording)==null||r.dispose(),(i=t.logs)==null||i.flushLogs(`sendBeacon`),(a=t.metrics)==null||a.flush(`sendBeacon`),(o=t.Pn)==null||o.unload(),(s=t.An)==null||s.unload(),(c=t.featureFlags)==null||c.destroy()):K.uninitializedWarning(`posthog.shutdown`)}))()}setIdentity(e,t){var n;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(n=this.conversations)==null||n.Yn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.Xn()}get_distinct_id(){return this.get_property(`distinct_id`)}getGroups(){return this.get_property(`$groups`)||{}}get_session_id(){return this.sessionManager?.checkAndGetSessionAndWindowId(!0).sessionId??``}get_session_replay_url(e){if(!this.sessionManager)return``;var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionStartTimestamp,r=this.requestRouter.endpointFor(`ui`,`/project/`+this.config.token+`/replay/`+t.sessionId);if(e!=null&&e.withTimestamp&&n){var i=e.timestampLookBack??10;if(!n)return r;r+=`?t=`+Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0)}return r}alias(e,t){return e===this.get_property(Ul)?(K.critical(`Attempting to create alias for existing People user - aborting.`),-2):this.Zn(`posthog.alias`)?(U(t)&&(t=this.get_distinct_id()),e===t?(K.warn(`alias matches current distinct_id - skipping api call.`),this.identify(e),-1):(this.Qn(Kl,e),this.capture(`$create_alias`,{alias:e,distinct_id:t}))):void 0}set_config(e){var t=z({},this.config);if(H(e)){var n,r,i,a,o,s,c,l,u,d,f;Y(this.config,th(e));var p=this.In();(n=this.persistence)==null||n.update_config(this.config,t,p),this.sessionPersistence=this.config.persistence===`
6sessionStorage`||this.config.persistence===`memory`?this.persistence:new rp(z({},this.config,{persistence:`sessionStorage`}),p,!1);var m=this.Mn(this.config.debug);ws(m)&&(this.config.debug=m),ws(this.config.debug)&&(this.config.debug?(L.DEBUG=!0,X.N()&&X.F(`ph_debug`,!0),K.info(`set_config`,{config:e,oldConfig:t,newConfig:z({},this.config)})):(L.DEBUG=!1,X.N()&&X.q(`ph_debug`))),(r=this.exceptionObserver)==null||r.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.tracingHeaders)==null||o.startIfEnabledOrStop(),(s=this.autocapture)==null||s.startIfEnabled(),(c=this.heatmaps)==null||c.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),(d=this.surveys)==null||d.loadIfEnabled(),this.ts(),(f=this.externalIntegrations)==null||f.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){L.LIB_NAME=e,L.LIB_VERSION=t}startSessionRecording(e){var t,n,r,i,a,o=!0===e,s={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(s).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),s.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),s.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),s.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger(`url`)),s.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger(`event`))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){if(this.exceptions){var n=Error(`PostHog syntheticException`),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(z({},r,t))}}addExceptionStep(e,t){var n;(n=this.exceptions)==null||n.addExceptionStep(e,t)}captureLog(e){var t;(t=this.logs)==null||t.captureLog(e)}get logger(){return this.logs?.logger??e.es}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t;return(t=this.toolbar?.loadToolbar(e))!=null&&t}get_property(e){return this.persistence?.props[e]}getSessionProperty(e){return this.sessionPersistence?.props[e]}toString(){var e=this.config.name??Zm;return e!==Zm&&(e=Zm+`.`+e),e}_isIdentified(){return this.persistence?.get_property(Mu)===Ju||this.sessionPersistence?.get_property(Mu)===Ju}Vn(){var e,t;return!(this.config.person_profiles===`never`||this.config.person_profiles===Yu&&!this._isIdentified()&&ys(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Kl])&&((t=this.persistence)==null||(t=t.props)==null||!t[Ru]))}Hn(){return!0===this.config.capture_pageleave||this.config.capture_pageleave===`if_capture_pageview`&&(!0===this.config.capture_pageview||this.config.capture_pageview===`history_change`)}createPersonProfile(){this.Vn()||this.Zn(`posthog.createPersonProfile`)&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Zn(`posthog.setInternalOrTestUser`)&&this.setPersonProperties({$internal_or_test_user:!0})}Zn(e){return this.config.person_profiles===`never`?(K.error(e+` was called, but process_person is set to "never". This call will be ignored.`),!1):(this.Qn(Ru,!0),!0)}In(){if(this.config.cookieless_mode===`always`)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Gu)}ts(){var e,t,n=this.In();return this.persistence?.xi!==n&&((e=this.persistence)==null||e.set_disabled(n)),this.sessionPersistence?.xi!==n&&((t=this.sessionPersistence)==null||t.set_disabled(n)),n&&(this.bn.clear(),this.Gn()),n}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==Ku){if(this.mn()){var r,i;this.Jn(!0,!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewM
6anager)==null||i.destroy(),this.sessionManager=new ym(this),this.pageViewManager=new Df(this),this.persistence&&(this.sessionPropsManager=new gm(this,this.sessionManager,this.persistence));var a,o=this.config.__extensionClasses?.sessionRecording??e.__defaultExtensionClasses?.sessionRecording;o&&(this.sessionRecording=this.gn(this.sessionRecording,new o(this)),this.dn&&((a=this.sessionRecording)==null||a.onRemoteConfig==null||a.onRemoteConfig(this.dn)))}var s;this.consent.optInOut(!0),this.ts(),this.qn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Gu&&((s=this.surveys)==null||s.loadIfEnabled()),(U(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture(t?.captureEventName??`$opt_in`,t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.jn()}else K.warn(Km)}opt_out_capturing(){var e,t,n;this.config.cookieless_mode===Ku?K.warn(Km):(this.config.cookieless_mode===Gu&&this.consent.isOptedIn()&&this.Jn(!0,!0),this.consent.optInOut(!1),this.ts(),this.config.cookieless_mode===Gu&&(this.register({distinct_id:zu,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.jn(),this.qn()))}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?`granted`:e===0?`denied`:`pending`}is_capturing(){return this.config.cookieless_mode===Ku||(this.config.cookieless_mode===Gu?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.ts()}_is_bot(){return Lo?bm(Lo,this.config.custom_blocked_useragents):void 0}jn(){F&&(F.visibilityState===`visible`?this.kn||(this.kn=!0,this.capture(Qu,{title:F.title},{send_instantly:!0}),this.xn&&=(F.removeEventListener(Xu,this.xn),null)):this.xn||(this.xn=this.jn.bind(this),ld(F,Xu,this.xn)))}debug(e){!1===e?(P?.console.log(`You've disabled debug mode.`),this.set_config({debug:!1})):(P?.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)`."),this.set_config({debug:!0}))}Ki(){var e=this.Tn||{};return`advanced_disable_flags`in e?!!e.advanced_disable_flags:!1===this.config.advanced_disable_flags?!0===this.config.advanced_disable_decide?(K.warn(`Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version.`),!0):function(e,t,n,r,i){var a=t in e&&!G(e[t]),o=n in e&&!G(e[n]);return a?e[t]:!!o&&(i&&i.warn(`Config field '`+n+`' is deprecated. Please use '`+t+`' instead. The old field will be removed in a future major version.`),e[n])}(e,`advanced_disable_flags`,`advanced_disable_decide`,0,K):!!this.config.advanced_disable_flags}Pt(e){if(G(this.config.before_send))return e;var t=Object.keys(e.properties??{}).filter(Ds),n=V(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),G(r)){var a=`Event '`+e.event+`' was rejected in beforeSend function`;return Es(e.event)?K.warn(a+`. This can cause unexpected behavior.`):K.info(a),null}r.properties&&!ys(r.properties)||K.warn(`Event '`+e.event+`' has no properties after beforeSend function, this is likely an error.`)}for(var o of t)if(r.properties&&G(r.properties[o]))return K.warn(`Event '`+e.event+`' had its '`+o+`' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return r}getPageViewId(){return this.pageViewManager.ui?.pageViewId}captureTraceFeedback(e,t){this.capture(`$ai_feedback`,{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture(`$ai_metric`,{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}Mn(e){var t=ws(e)&&!e,n=X.N()&&X.P(`ph_debug`)===`true`;return!t&&(!!n||e)}};rh.__defaultExtensionClasses={},rh.es=(()=>{var e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=ad(e.prototype[t[n]])}(rh,[`identify`]);var ih=class{constructor(e){this.disabled=!1===e;var t=H(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}},ah=`$copy_autocapture`,oh=q(`[AutoCapture]`);function sh(e,t){return t.length>e?t.slice(0,e)+`...`:t}function ch(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Fd(t));return t}function lh(e,t){var n,r=t.e,i=t.maskAllElementAttributes,a=t.maskAllText,o=t.elementAttributeIgnoreList,s=t.elementsC
6hainAsString,c=t.disableCaptureUrlHashes;if(!Fd(e))return{props:{}};for(var l=[e],u=new Set([e]),d=e;d.parentNode&&!Id(d,`body`)&&zd>l.length;)if(Rd(d.parentNode)){var f=d.parentNode.host;if(u.has(f))break;u.add(f),l.push(f),d=f}else{if(!Fd(d.parentNode)||u.has(d.parentNode))break;u.add(d.parentNode),l.push(d.parentNode),d=d.parentNode}var p,m,h=[],g={},_=!1,v=!1;if(J(l,(e=>{var t=af(e);if(Id(e,`a`)){var n=e.getAttribute(`href`);_=!!(t&&n&&mf(n))&&(c?Uc(n):n)}B(Hd(e),`ph-no-capture`)&&(v=!0),h.push(function(e,t,n,r,i){i===void 0&&(i=!1);var a=e.tagName.toLowerCase(),o={tag_name:a};Kd.indexOf(a)>-1&&!n&&(o.$el_text=a.toLowerCase()===`a`||a.toLowerCase()===`button`?sh(1024,hf(e)):sh(1024,Wd(e)));var s=Hd(e);s.length>0&&(o.classes=s.filter((function(e){return e!==``}))),J(e.attributes,(function(n){var a;if((!of(e)||[`name`,`id`,`class`,`aria-label`].indexOf(n.name)!==-1)&&(r==null||!r.includes(n.name))&&!t&&mf(n.value)&&(!W(a=n.name)||a.substring(0,10)!==`_ngcontent`&&a.substring(0,7)!==`_nghost`)){var s=n.value;n.name===`class`&&(s=Bd(s).join(` `)),o[`attr__`+n.name]=sh(1024,n.name===`href`&&i?Uc(s):s)}}));for(var c=1,l=1,u=e;u=ch(u);)c++,u.tagName===e.tagName&&l++;return o.nth_child=c,o.nth_of_type=l,o}(e,i,a,o,c)),Y(g,function(e){if(!af(e))return{};var t={};return J(e.attributes,(function(e){if(e.name&&e.name.indexOf(`data-ph-capture-attribute`)===0){var n=e.name.replace(`data-ph-capture-attribute-`,``),r=e.value;n&&r&&mf(r)&&(t[n]=r)}})),t}(e))})),v)return{props:{},explicitNoCapture:v};if(a||(h[0].$el_text=Id(e,`a`)||Id(e,`button`)?hf(e):Wd(e)),_){var y;h[0].attr__href=_;var b=Nf(_)?.host,x=P==null||(y=P.location)==null?void 0:y.host;b&&x&&b!==x&&(p=_)}return{props:Y({$event_type:r.type,$ce_version:1},s?{}:{$elements:h},{$elements_chain:(m=h,function(e){return e.map((e=>{var t=``;if(e.tag_name&&(t+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))t+=`.`+n.replace(/"/g,``);var r=z({},e.text?{text:e.text}:{},{"nth-child":e.nth_child??0,"nth-of-type":e.nth_of_type??0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),i={};return rd(r).sort(((e,t)=>e[0].localeCompare(t[0]))).forEach((e=>{var t=e[1];return i[_f(e[0].toString())]=_f(t.toString())})),(t+=`:`)+rd(i).map((e=>e[0]+`="`+e[1]+`"`)).join(``)})).join(`;`)}(function(e){return e.map((e=>{var t={text:e.$el_text?.slice(0,400),tag_name:e.tag_name,href:e.attr__href?.slice(0,2048),attr_class:vf(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return rd(e).filter((e=>e[0].indexOf(`attr__`)===0)).forEach((e=>t.attributes[e[0]]=e[1])),t}))}(m)))},(n=h[0])!=null&&n.$el_text?{$el_text:h[0]?.$el_text}:{},p&&r.type===`click`?{$external_click_url:p}:{},g)}}var uh=q(`[ExceptionAutocapture]`),dh=()=>{},fh=q(`[TracingHeaders]`),ph=q(`[Web Vitals]`),mh=9e5,hh=`disabled`,gh=`lazy_loading`,_h=`awaiting_config`,vh=`missing_config`;q(`[SessionRecording]`),q(`[SessionRecording]`);var yh=`[SessionRecording]`,bh=q(yh),xh=q(`[Heatmaps]`);function Sh(e){return H(e)&&`clientX`in e&&`clientY`in e&&Ss(e.clientX)&&Ss(e.clientY)}var Ch=q(`[Product Tours]`),wh=e=>{var t;return!e.config.disable_product_tours&&!((t=e.persistence)==null||!t.get_property(tu))},Th=[`$set_once`,`$set`],Eh=q(`[SiteApps]`),Dh=`Error while initializing PostHog app with config id `;function Oh(e,t,n){if(G(e))return!1;switch(n){case`exact`:return e===t;case`contains`:var r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/_/g,`.`).replace(/%/g,`.*`);return new RegExp(r,`i`).test(e);case`regex`:try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var kh=class{constructor(e){this.rs=new _m,this.ns=(e,t)=>this.ss(e,t)&&this.os(e,t)&&this.ls(e,t)&&this.us(e,t),this.ss=(e,t)=>t==null||!t.event||e?.event===t?.event,this._instance=e,this.hs=new Set,this.ds=new Set}init(){var e;U(this._instance?._addCaptureHook)||(e=this._instance)==null||e._addCaptureHook(((e,t)=>{this.on(e,t)}))}register(e){var t;if(!U(this._instance?._addCaptureHook)&&(e.forEach((e=>{var t,n;(t=this.ds)==null||t.add(e),(n=e.steps)==null||n.forEach((e=>{var t;(t=this.hs)==null||t.add(e?.event||``)}))})),(t=this._instance)!=null&&t.autocapture)){var n,r=new Set;e.forEach((e=>{var t;(t=e.steps)==null||t.forEach((e=>{e!=null&&e.selector&&r.add(e?.selector)}))}
6)),(n=this._instance)==null||n.autocapture.setElementSelectors(r)}}on(e,t){t!=null&&e.length!=0&&(this.hs.has(e)||this.hs.has(t.event))&&this.ds&&this.ds?.size>0&&this.ds.forEach((e=>{this.vs(t,e)&&this.rs.emit(`actionCaptured`,e.name)}))}cs(e){this.onAction(`actionCaptured`,(t=>e(t)))}vs(e,t){if(t?.steps==null)return!1;for(var n of t.steps)if(this.ns(e,n))return!0;return!1}onAction(e,t){return this.rs.on(e,t)}os(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!=`string`||!Oh(r,t.url,t.url_matching||`contains`))return!1}return!0}ls(e,t){return!!this.fs(e,t)&&!!this.ps(e,t)&&!!this.gs(e,t)}fs(e,t){var n;if(t==null||!t.href)return!0;var r=this.ys(e);if(r.length>0)return r.some((e=>Oh(e.href,t.href,t.href_matching||`exact`)));var i,a=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!a&&Oh((i=a.match(/(?::|")href="(.*?)"/))?i[1]:``,t.href,t.href_matching||`exact`)}ps(e,t){var n;if(t==null||!t.text)return!0;var r=this.ys(e);if(r.length>0)return r.some((e=>Oh(e.text,t.text,t.text_matching||`exact`)||Oh(e.$el_text,t.text,t.text_matching||`exact`)));var i,a,o,s=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!s&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!G(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(s),a=t.text,o=t.text_matching||`exact`,i.some((e=>Oh(e,a,o))))}gs(e,t){var n,r;if(t==null||!t.selector)return!0;var i=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(i!=null&&i.includes(t.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||``;if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}ys(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}us(e,t){return t==null||!t.properties||t.properties.length===0||Em(t.properties.reduce(((e,t)=>{var n=V(t.value)?t.value.map(String):t.value==null?[]:[String(t.value)];return e[t.key]={values:n,operator:t.operator||`exact`},e}),{}),e?.properties)}},Ah=class{constructor(e){var t;this.bs=[],this._instance=e,this._s=new Map,this.ws=new Map,this.ks=new Map,(t=this._instance)==null||t.onSessionId==null||t.onSessionId((e=>this.xs(e)))}Ss(e){return!1}Cs(){return null}Ms(e){}Ts(){}Es(e,t){return!!e&&Em(e.propertyFilters,t?.properties)}Is(e,t){var n=new Map;return e.forEach((e=>{var r;(r=e.conditions)==null||(r=r[t])==null||(r=r.values)==null||r.forEach((t=>{if(t!=null&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}}))})),n}Ps(e,t,n){var r=(n===op.Activation?this._s:this.ws).get(e),i=[];return this.Rs((e=>{i=e.filter((e=>r?.includes(e.id)))})),i.filter((r=>{var i,a=(i=r.conditions)==null||(i=i[n])==null||(i=i.values)==null?void 0:i.find((t=>t.name===e));return this.Es(a,t)}))}register(e){U(this._instance?._addCaptureHook)||(this.As(e),this.Fs(e))}Fs(e){var t=e.filter((e=>{var t;return e.conditions?.actions&&((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null?void 0:t.length)>0}));t.length!==0&&(this.Ls??(this.Ls=new kh(this._instance),this.Ls.init(),this.Ls.cs((e=>{this.onAction(e)}))),t.forEach((e=>{var t,n,r,i,a;e.conditions&&(t=e.conditions)!=null&&t.actions&&(n=e.conditions)!=null&&(n=n.actions)!=null&&n.values&&((r=e.conditions)==null||(r=r.actions)==null||(r=r.values)==null?void 0:r.length)>0&&((i=this.Ls)==null||i.register(e.conditions.actions.values),(a=e.conditions)==null||(a=a.actions)==null||(a=a.values)==null||a.forEach((t=>{if(t&&t.name){var n=this.ks.get(t.name);n&&n.push(e.id),this.ks.set(t.name,n||[e.id])}})))})))}As(e){var t,n=e.filter((e=>{var t;return e.conditions?.events&&((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null?void 0:t.length)>0})),r=e.filter((e=>{var t;return e.conditions?.cancelEvents&&((t=e.conditions)==null||(t=t.cancelEvents)==null||(t=t.values)==null?void 0:t.length)>0}));n.length===0&&r.length===0||((t=this._instance)==null||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this._s=this.Is(e,op.Activation),this.ws=this.Is(e,op.Cancellation))}onEvent(e,t){var n,r,i=this.Os(),a=(t==null||(n=t.properties)==null?void 0:n.$survey_id)||(t==null||(r=t.properties)==null?void 0:r.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var o=this.Ds(e,a);if(o===`consume`)return i.info(`event consumed activated item, remov
6ing it`,{event:e,itemId:a}),void this.$s([a]);if(o===`persist`)return i.info(`shown item promoted to persisted activation`,{event:e,itemId:a}),this.Ns(a),void this.qs([a])}if(this.ws.has(e)){var s=this.Ps(e,t,op.Cancellation);s.length>0&&(i.info(`cancel event matched, cancelling items`,{event:e,itemsToCancel:s.map((e=>e.id))}),this.$s(s.map((e=>e.id))),s.forEach((e=>this.js(e.id))))}if(this._s.has(e)){i.info(`event name matched`,{event:e,eventPayload:t,items:this._s.get(e)});var c=this.Ps(e,t,op.Activation);this.Bs(c.map((e=>e.id)))}}onAction(e){this.ks.has(e)&&this.Bs(this.ks.get(e)||[])}Bs(e){var t;if(e.length!==0){var n=!((t=this._instance)==null||t.get_session_id==null||!t.get_session_id()),r=[];for(var i of e)n&&this.Ss(i)?this.Ns(i)&&this.Hs(i):r.push(i);r.length>0&&(this.bs=[...new Set([...this.bs,...r])]),this.Os().info(`updating activated items`,{activatedItems:this.getActivatedIds()})}}Ns(e){this.bs=this.bs.filter((t=>t!==e));var t=this.Us();return!t.includes(e)&&(this.zs([...t,e]),this.Ws(),!0)}$s(e){var t=new Set(e);this.bs=this.bs.filter((e=>!t.has(e)));var n=this.Vs(),r=n.filter((e=>!t.has(e)));r.length!==n.length&&(this.zs(r),r.length===0&&this.Zs()),this.qs(e)}Gs(){var e,t=this.Cs();if(!t)return{};var n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t];return n&&typeof n==`object`?n:{}}Hs(e){if(this.Cs()){var t=this.Gs();this.Ms(z({},t,{[e]:Date.now()}))}}qs(e){if(this.Cs()){var t=this.Gs(),n={},r=!1;for(var i of Object.entries(t)){var a=i[0],o=i[1];e.includes(a)?r=!0:n[a]=o}r&&(ys(n)?this.Ts():this.Ms(n))}}Qs(){this.Cs()&&this.Ts()}getActivationTimestamp(e){if(this.Us().includes(e)){var t=this.Gs()[e];return Ss(t)?t:void 0}}Vs(){var e,t=this.Ks();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}Us(){var e,t,n=this.Vs();if(n.length===0)return[];var r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this.Js()],i=(t=this._instance)==null||t.get_session_id==null?void 0:t.get_session_id();return i&&r===i?n:[]}Ws(){var e,t=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();t&&this.Ys(t)}Zs(){this.Xs()}xs(e){var t,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[this.Js()];if(n&&n!==e){var r=this.Vs(),i=this.Gs();r.length>0&&(this.zs([]),r.filter((e=>Ss(i[e]))).forEach((e=>this.js(e)))),this.Zs(),this.Qs()}}getActivatedIds(){return[...new Set([...this.Us(),...this.bs])].filter((e=>!this.ta(e)))}reset(){this.bs=[],this.Vs().length>0&&this.zs([]),this.Zs(),this.Qs()}getEventToItemsMap(){return this._s}ea(){return this.Ls}},jh=class extends Ah{constructor(e){super(e)}Ks(){return wu}Js(){return Tu}Cs(){return Eu}Ms(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[Eu]:e})}Ts(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(Eu)}Ss(e){var t,n;this.Rs((t=>{n=t.find((t=>t.id===e))}));var r=(t=n)==null||(t=t.appearance)==null?void 0:t.surveyPopupDelaySeconds;return Ss(r)&&r>0}ia(){return cp.SHOWN}Rs(e){var t;(t=this._instance)==null||t.getSurveys(e)}js(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}Os(){return Z}zs(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[wu]:e})}Ys(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[Tu]:e})}Xs(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(Tu)}ta(){return!1}Ds(e,t){var n;return this.Rs((e=>{n=e.find((e=>e.id===t))})),!n||function(e){var t;return jm(e)&&!((t=e.conditions)==null||(t=t.events)==null||!t.repeatedActivation)||e.schedule===`always`}(n)?e===cp.SHOWN?`consume`:`ignore`:e===cp.SHOWN?`persist`:e===cp.DISMISSED||e===cp.SENT?`consume`:`ignore`}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Mh=`SDK is not enabled or survey functionality is not yet loaded`,Nh=`Disabled. Not loading surveys.`,Ph=P!=null&&P.location?If(P.location.hash,`__posthog`)||If(location.hash,`state`):null,Fh=`_postHogToolbarParams`,Ih=q(`[Toolbar]`),Lh=q(`[FeatureFlags]`),Rh=q(`[FeatureFlags]`,{debugEnabled:!0}),zh=`" failed. Feature flags didn't load in time.`,Bh=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},Vh=e=>{var t={};for(var n of rd(e||{})){var r=n[1];r&&(t[n[0]]=r)}return t},Hh=q(`[Error tracking]`),Uh=`Refusing to render web experiment since the viewer is a likely bot`,Wh={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>Sm(t,e),not_regex:(e,t)=>!Sm(t,e),exact:(e,t)=>
6t===e,is_not:(e,t)=>t!==e},Gh=class e{get Ne(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){t===void 0&&(t=!1),n.getWebExperiments((t=>{e.ra(`retrieved web experiments from the server`),n.na=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;n.na&&(e.ra(`setting flag key `,t.feature_flag_key,` to web experiment `,t),(r=n.na)==null||r.set(t.feature_flag_key,t));var i=n._instance.getFeatureFlag(t.feature_flag_key);W(i)&&t.variants[i]&&n.sa(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var a in t.variants){var o=t.variants[a];e.aa(o,n._instance)&&n.sa(t.name,a,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())e.ra(Uh);else if(!this.Ne.disable_web_experiments){if(G(this.na))return this.na=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.ra(`applying feature flags`,t),t.forEach((e=>{var t;if(this.na&&(t=this.na)!=null&&t.has(e)){var n=this._instance.getFeatureFlag(e),r=this.na?.get(e);n&&r!=null&&r.variants[n]&&this.sa(r.name,n,r.variants[n].transforms)}}))}}previewWebExperiment(){var t=e.getWindowLocation();if(t!=null&&t.search){var n=Pf(t?.search,`__experiment_id`),r=Pf(t?.search,`__experiment_variant`);n&&r&&(e.ra(`previewing web experiments `+n+` && `+r),this.getWebExperiments((e=>{this.oa(parseInt(n),r,e)}),!1,!0))}}loadIfEnabled(){this.Ne.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this.Ne.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property(`$web_experiments`);if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/web_experiments/?token=`+this.Ne.token),method:`GET`,timestampMode:`query`,callback:t=>e(t.statusCode===200&&t.json&&t.json.experiments||[])})}oa(t,n,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(e.ra(`Previewing web experiment [`+i[0].name+`] with variant [`+n+`]`),this.sa(i[0].name,n,i[0].variants[n].transforms))}static aa(t,n){return!G(t.conditions)&&e.la(t,n)&&e.ua(t)}static la(t,n){if(G(t.conditions)||G(t.conditions?.url))return!0;var r=e.getWindowLocation();if(r){var i,a=kd(n,r.href);return(i=t.conditions)==null||!i.url||Wh[t.conditions?.urlMatchType??`icontains`](t.conditions.url,a)}return!1}
6static getWindowLocation(){return P?.location}static ua(e){if(G(e.conditions)||G(e.conditions?.utm))return!0;var t=Wf();if(t.utm_source){var n,r,i,a,o,s,c,l,u=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((r=e.conditions)==null||(r=r.utm)==null?void 0:r.utm_campaign)==t.utm_campaign,d=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==t.utm_source,f=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_medium||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_medium)==t.utm_medium,p=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_term)==t.utm_term;return u&&f&&p&&d}return!1}static ra(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];K.info(`[WebExperiments] `+e,n)}sa(t,n,r){this._is_bot()?e.ra(Uh):n===`control`?e.ra(`Control variants leave the page unmodified.`):r.forEach((r=>{r.selector&&(e.ra(`applying transform of variant `+n+` for experiment `+t+` `,r),(document?.querySelectorAll(r.selector))?.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute(`style`,r.css)})))}))}_is_bot(){return Lo&&this._instance?bm(Lo,this.Ne.custom_blocked_useragents):void 0}},Kh=q(`[Conversations]`),qh=`Conversations not available yet.`,Jh=`console`,Yh=`__posthogHandledLogsRequestError`,Xh=(e,t)=>{var n=e instanceof Error?e:Error(t);return n[Yh]=!0,n},Zh=e=>!!e&&typeof e==`object`&&!0===e[Yh],Qh={featureFlags:class{constructor(e){this.ha=!1,this.da=!1,this.va=!1,this.ca=!1,this.fa=!1,this.pa=!1,this.ga=!1,this.ma=!1,this.ya=0,this.ba=()=>{var e=this._a();this.ya=0,e&&this.reloadFeatureFlags()},this._instance=e,this.featureFlagEventHandlers=[],P&&ld(P,`online`,this.ba)}destroy(){P?.removeEventListener(`online`,this.ba)}get Ne(){return this._instance.config}get Tr(){return this._instance.persistence}wa(e){return this._instance.get_property(e)}ka(){var e;return(e=this.Tr?.Ci(this.Ne.feature_flag_cache_ttl_ms))!=null&&e}xa(){return!!this.ka()&&(this.ma||this.va||(this.ma=!0,Lh.warn(`Feature flag cache is stale, triggering refresh...`),this.reloadFeatureFlags()),!0)}Sa(){var e=this.Ne.evaluation_contexts??this.Ne.evaluation_environments;return!this.Ne.evaluation_environments||this.Ne.evaluation_contexts||this.ga||(Lh.warn(`evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version.`),this.ga=!0),e!=null&&e.length?e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||Lh.error(`Invalid evaluation context found:`,e,`Expected non-empty string`),t})):[]}Ca(){return this.Sa().length>0}Ma(){var e=this.Ne.flag_keys;if(!U(e)){if(V(e))return e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||Lh.error(`Invalid flag key found:`,e,`Expected non-empty string`),t}));Lh.error(`Invalid flag_keys found:`,e,`Expected array of non-empty strings`)}}initialize(){var e=this._instance.config,t=e.bootstrap?.featureFlags??{};if(Object.keys(t).length){var n=e.bootstrap?.featureFlagPayloads??{},r=Object.keys(t).filter((e=>!!t[e])).reduce(((e,n)=>(e[n]=t[n]||!1,e)),{}),i=Object.keys(n).filter((e=>r[e])).reduce(((e,t)=>(n[t]&&(e[t]=n[t]),e)),{});this.receivedFeatureFlags({featureFlags:r,featureFlagPayloads:i})}}updateFlags(e,t,n){var r,i,a=n!=null&&n.merge&&(r=this.wa(du))!=null?r:{},o=n!=null&&n.merge&&(i=this.wa(hu))!=null?i:{},s=z({},a,e),c=z({},o,t),l={};for(var u of Object.entries(s)){var d=u[0],f=u[1];l[d]={key:d,enabled:Yo(f),variant:Xo(f),reason:void 0,metadata:U(c?.[d])?void 0:{id:0,version:void 0,description:void 0,payload:c[d]}}}this.receivedFeatureFlags({flags:l})}get hasLoadedFlags(){return this.da}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.wa(mu),t=this.wa(vu),n=this.wa(yu);if(!n&&!t)return e||{};var r=Y({},e||{});for(var i of[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])]){var a,o,s=r[i],c=t?.[i],l=U(c)?(a=s?.enabled)!=null&&a:!!c,u=U(c)?s.variant:typeof c==`string`?c:void 0,d=n?.[i],f=z({},s,{enabled:l,variant:l?u??s?.variant:void 0});l!==s?.enabled&&(f.original_enabled=s?.enabled),u!==s?.variant&&(f.original_variant=s?.variant),d&&(f.metadata=z({},s?.metadata,{payload:d,original_payload:s==null||(o=s.metadata)==null?void 0:o.payload})),r[i]=f}return this.ha||=(Lh.warn(` Overriding feature flag details!`,{flagDetails:e,overriddenPayloads:n,finalDetails:r}),!0),r}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map((n=>{var r=e[n];return{key:n,enabled:Yo(r),variant:Xo(r),payload:Jo(t[n])}}))}getFlagVariants(){var e=this.wa(du),t=this.wa(vu);if(!t)return e||{};for(var n=Y({},e),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.ha||=(Lh.warn(` Overriding feature flags!`,{enabledFlags:e,overriddenFlags:t,finalFlags:n}),!0),n}getFlagPayloads(){var e=this.wa(hu),t=this.wa(yu);if(!t)return e||{};for(var n=Y({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.ha||=(Lh.warn(` Overriding feature flag payloads!`,{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),!0),n}reloadFeatureFlags(){this.ca||this.Ne.advanced_disable_feature_flags||this._a()||this.Ta||(this._instance.vn.emit(`featureFlagsReloading`,!0),this.Ta=setTimeout((()=>{this.Ea()}),5))}Ia(){clearTimeout(this.Ta),this.Ta=void 0}ensureFlagsLoaded(){this.da||this.va||this.Ta||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ca=e}
6Ea(e){if(this.Ia(),!this._instance.Ki()&&!this._a()){if(this.va)this.fa=!0;else{var t=this.Ne.token,n=this.wa(Wl),r={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:z({},this.Tr?.get_initial_props()||{},this.wa(bu)||{},{$lib:L.LIB_NAME,$lib_version:L.LIB_VERSION}),group_properties:this.wa(xu),timezone:Qf()};xs(n)||U(n)||(r.$device_id=n),(e!=null&&e.disableFlags||this.Ne.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.Ca()&&(r.evaluation_contexts=this.Sa());var i=this.Ma();U(i)||(r.flag_keys=i);var a=!!this.Ne.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`+(this.Ne.advanced_only_evaluate_survey_feature_flags?`&only_evaluate_survey_feature_flags=true`:``));this.va=!0,this._instance._send_request({method:`POST`,url:o,data:r,compression:this.Ne.disable_compression?void 0:ap.Base64,timestampMode:`body`,timeout:this.Ne.feature_flag_request_timeout_ms,callback:e=>{var t,n,i,o=!0;if(this.Pa(e.statusCode),e.statusCode===200&&(this.fa||(this.$anon_distinct_id=void 0),o=!1),this.va=!1,!r.disable_flags||this.fa){this.pa=!o;var s=[];e.error?e.error instanceof Error?s.push(e.error.name===`AbortError`?`timeout`:`connection_error`):s.push(`unknown_error`):e.statusCode!==200&&s.push(`api_error_`+e.statusCode),(t=e.json)!=null&&t.errorsWhileComputingFlags&&s.push(`errors_while_computing_flags`);var c=!((n=e.json)==null||(n=n.quotaLimited)==null||!n.includes(`feature_flags`));c&&s.push(`quota_limited`),(i=this.Tr)==null||i.register({[Au]:s}),c?Lh.warn(`You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more.`):(r.disable_flags||this.receivedFeatureFlags(e.json??{},o,{partialResponse:a}),this.fa&&(this.fa=!1,this.Ea()))}}})}}}_a(){return Lf(this.ya,3)}Pa(e){this.ya=Rf(e,this.ya,3,(()=>Lh.warn(`Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.`)))}getFeatureFlag(e,t){if(t===void 0&&(t={}),!t.fresh||this.pa){if(this.da||this.getFlags()&&this.getFlags().length>0){if(!this.xa()){var n=this.getFeatureFlagResult(e,t);return n?.variant??n?.enabled}}else Lh.warn(`getFeatureFlag for key "`+e+zh)}}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFeatureFlagResult(e,{send_event:!1})?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.pa){if(this.da||this.getFlags()&&this.getFlags().length>0){if(!this.xa()){var n=this.getFlagVariants(),r=e in n,i=n[e],a=this.getFlagPayloads()[e],o=String(i),s=this.wa(gu)||void 0,c=this.wa(ju)||void 0,l=this.wa(Ou)||{};if(this.Ne.advanced_feature_flags_dedup_per_session){var u,d=this._instance.get_session_id(),f=this.wa(ku);d&&d!==f&&(l={},(u=this.Tr)==null||u.register({[Ou]:l,[ku]:d}))}if((t.send_event||!(`send_event`in t))&&(!(e in l)||!l[e].includes(o))){var p,m,h,g,_,v,y,b,x;V(l[e])?l[e].push(o):l[e]=[o],(p=this.Tr)==null||p.register({[Ou]:l});var S=this.getFeatureFlagDetails(e),C=[...this.wa(Au)??[]];U(i)&&C.push(`flag_missing`);var w={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:a||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((m=this.Ne.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[e])||null,$feature_flag_bootstrapped_payload:((h=this.Ne.bootstrap)==null||(h=h.featureFlagPayloads)==null?void 0:h[e])||null,$used_bootstrap_value:!this.pa};U(S==null||(g=S.metadata)==null?void 0:g.has_experiment)||(w.$feature_flag_has_experiment=S.metadata.has_experiment),U(S==null||(_=S.metadata)==null?void 0:_.version)||(w.$feature_flag_version=S.metadata.version);var T,E=(S==null||(v=S.reason)==null?void 0:v.description)??(S==null||(y=S.reason)==null?void 0:y.code);E&&(w.$feature_flag_reason=E),S!=null&&(b=S.metadata)!=null&&b.id&&(w.$feature_flag_id=S.metadata.id),U(S?.original_variant)&&U(S?.original_enabled)||(w.$feature_flag_original_response=U(S.original_variant)?S.original_enabled:S.original_variant),S!=null&&(x=S.metadata)!=null&&x.original_payload&&(w.$feature_flag_original_payload=S==null||(T=S.metadata)==null?void 0:T.original_payload),C.length&&(w.$feature_flag_error=C.join(`,`)),this._instance.capture(`$feature_flag_called`,w)}if(r)return{key:e,enabled:!!i,variant:typeof i==`string`?i:void 0,payload:Jo(a)}}}else Lh.warn(`getFeatureFlagResult for key "`+e+zh)}}getRemoteConfigPayload(e,t){var n=this.Ne.token,r={distinct_id:this._instance.get_distinct_id(),token:n,person_properties:{$lib:L.LIB_NAME,$lib_version:L.LIB_VERSION}};this.Ca()&&(r.evaluation_contexts=this.Sa());var i=this.Ma();U(i)||(r.flag_keys=i),this._instance._send_request({method:`POST`,url:this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`),data:r,compression:this.Ne.disable_compression?void 0:ap.Base64,timestampMode:`body`,timeout:this.Ne.feature_flag_request_timeout_ms,callback(n){var r=n.json?.featureFlagPayloads;t(r?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),t.fresh&&!this.pa)return t.defaultValue;if(!(this.da||this.getFlags()&&this.getFlags().length>
60))return Lh.warn(`isFeatureEnabled for key "`+e+zh),t.defaultValue;var n=this.getFeatureFlag(e,t);return U(n)?t.defaultValue:!!n}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.Tr){this.da=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(e,t,n,r,i,a){n===void 0&&(n={}),r===void 0&&(r={}),i===void 0&&(i={});var o=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>[e,t[e].variant??t[e].enabled]))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>t[e].metadata?.payload)).map((e=>[e,t[e].metadata?.payload])))):e.featureFlags&&Lh.warn(`Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version`),e})(e),s=o.flags,c=o.featureFlags,l=o.featureFlagPayloads;if(c){var u=e.requestId,d=e.evaluatedAt;if(V(c)){Lh.warn(`v1 of the feature flags endpoint is deprecated. Please use the latest version.`);var f={};if(c)for(var p=0;c.length>p;p++)f[c[p]]=!0;t&&t.register({[fu]:c,[du]:f,[_u]:!1})}else{var m=c,h=l,g=s;if(a!=null&&a.partialResponse)m=z({},n,m),h=z({},r,h),g=z({},i,g);else if(e.errorsWhileComputingFlags){if(s){var _=new Set(Object.keys(s).filter((e=>{var t;return!((t=s[e])!=null&&t.failed)})));m=z({},n,Object.fromEntries(Object.entries(m).filter((e=>_.has(e[0]))))),h=z({},r,Object.fromEntries(Object.entries(h||{}).filter((e=>_.has(e[0]))))),g=z({},i,Object.fromEntries(Object.entries(g||{}).filter((e=>_.has(e[0])))))}else m=z({},n,m),h=z({},r,h),g=z({},i,g)}t&&t.register(z({[fu]:Object.keys(Vh(m)),[du]:m||{},[hu]:h||{},[mu]:g||{},[_u]:!0===e.minimalFlagCalledEvents},u?{[gu]:u}:{},d?{[ju]:d}:{}))}}})(e,this.Tr,r,i,a,n),t||(this.ma=!1),this.Ra(t)}}override(e,t){t===void 0&&(t=!1),Lh.warn(`override is deprecated. Please use overrideFeatureFlags instead.`),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.Tr)return Lh.uninitializedWarning(`posthog.featureFlags.overrideFeatureFlags`);if(!1===e)return this.Tr.unregister(vu),this.Tr.unregister(yu),this.Ra(),Rh.info(`All overrides cleared`);if(V(e)){var t=Bh(e);return this.Tr.register({[vu]:t}),this.Ra(),Rh.info(`Flag overrides set`,{flags:e})}if(e&&typeof e==`object`&&(`flags`in e||`payloads`in e)){var n,r=e;if(this.ha=!!((n=r.suppressWarning)!=null&&n),`flags`in r){if(!1===r.flags)this.Tr.unregister(vu),Rh.info(`Flag overrides cleared`);else if(r.flags){if(V(r.flags)){var i=Bh(r.flags);this.Tr.register({[vu]:i})}else this.Tr.register({[vu]:r.flags});Rh.info(`Flag overrides set`,{flags:r.flags})}}`payloads`in r&&(!1===r.payloads?(this.Tr.unregister(yu),Rh.info(`Payload overrides cleared`)):r.payloads&&(this.Tr.register({[yu]:r.payloads}),Rh.info(`Payload overrides set`,{payloads:r.payloads}))),this.Ra();return}if(e&&typeof e==`object`)return this.Tr.register({[vu]:e}),this.Ra(),Rh.info(`Flag overrides set`,{flags:e});Lh.warn(`Invalid overrideOptions provided to overrideFeatureFlags`,{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.da){var t=this.Aa(),n=t.flags,r=t.flagVariants;try{e(n,r)}catch(e){Lh.error(`Error while running feature flags callback`,e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,i=(this.wa(pu)||[]).find((t=>t.flagKey===e)),a={[`$feature_enrollment/`+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};i&&(o.$early_access_feature_name=i.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture(`$feature_enrollment_update`,o),this.setPersonPropertiesForFlags(a,!1);var s=z({},this.getFlagVariants(),{[e]:t});(r=this.Tr)==null||r.register({[fu]:Object.keys(Vh(s)),[du]:s}),this.Ra()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.wa(pu),i=n?`&`+n.map((e=>`stage=`+e)).join(`&`):``;if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/early_access_features/?token=`+this.Ne.token+i),method:`GET`,timestampMode:`query`,callback:t=>{var n,r;if(t.json){var i=t.json.earlyAccessFeatures;return(n=this.Tr)==null||n.unregister(pu),(r=this.Tr)==null||r.register({[pu]:i}),e(i)}}})}Aa(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}Ra(e){var t=this.Aa(),n=t.flags,r=t.flagVariants;
6this.featureFlagEventHandlers.forEach((t=>{try{t(n,r,{errorsLoading:e})}catch(e){Lh.error(`Error while running feature flags callback`,e)}}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.wa(bu)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),i=e?.$set_once,a={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(a[o]=i[o]));this._instance.register({[bu]:z({},n,a,r)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=z({},this.wa(bu)||{});e.forEach((e=>{delete n[e]})),this._instance.register({[bu]:n}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){e===void 0&&(e=!0),this._instance.unregister(bu),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.wa(xu)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((t=>{n[t]=z({},n[t],e[t]),delete e[t]})),this._instance.register({[xu]:z({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.wa(xu)||{};this._instance.register({[xu]:z({},t,{[e]:{}})})}else this._instance.unregister(xu)}reset(){this.da=!1,this.va=!1,this.ca=!1,this.fa=!1,this.pa=!1,this.$anon_distinct_id=void 0,this.Ia(),this.ha=!1,this.ya=0}}},$h={sessionRecording:class{get Ne(){return this._instance.config}get Tr(){return this._instance.persistence}get started(){var e;return!((e=this.Fa)==null||!e.isStarted)}get status(){return this.La===_h||this.La===vh?this.La:this.Fa?.status??this.La}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.La=hh,this.Oa=void 0,this.Da=!1,this.$a=(()=>{var e;if(F==null||!F.visibilityState||F.visibilityState===`visible`)return!0;var t=P==null||(e=P.performance)==null||e.getEntriesByType==null?void 0:e.getEntriesByType(`visibility-state`);return!(t!=null&&t.length)||t.some((e=>e.name===`visible`))})(),this.Ie=()=>{var e;F?.visibilityState===`visible`&&(this.$a=!0,(e=this.Fa)==null||e.setDocumentWasEverVisible==null||e.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw bh.error(`started without valid sessionManager`),Error(yh+` started without valid sessionManager. This is a bug.`);if(this.Ne.cookieless_mode===Ku)throw Error(yh+` cannot be used with cookieless_mode="always"`);F!=null&&F.addEventListener&&ld(F,`visibilitychange`,this.Ie)}initialize(){this.startIfEnabledOrStop()}dispose(){this.Da=!0,F==null||F.removeEventListener==null||F.removeEventListener(`visibilitychange`,this.Ie),this.stopRecording()}get Na(){var e,t=!((e=this._instance.get_property(ru))==null||!e.enabled),n=!this.Ne.disable_session_recording,r=this.Ne.disable_session_recording||this._instance.consent.isOptedOut();return P&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!(this.Da||this.Na&&(t=this.Fa)!=null&&t.isStarted)){var n=!U(Object.assign)&&!U(Array.from);this.Na&&n?(this.qa(e),bh.info(`starting`)):(this.La=hh,this.stopRecording())}}qa(e){var t,n,r;this.Na&&(this.La!==_h&&this.La!==vh&&(this.La=gh),I!=null&&(t=I.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=I.__PosthogExtensions__)!=null&&n.initSessionRecording?this.ja(e):(r=I.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ba,(t=>{if(t)return bh.error(`could not load recorder`,t);this.ja(e)})))}stopRecording(){var e,t;(e=this.Oa)==null||e.call(this),this.Oa=void 0,(t=this.Fa)==null||t.stop()}Ha(){var e,t;(e=this.Oa)==null||e.call(this),this.Oa=void 0,(t=this.Fa)==null||t.discard()}Ua(){var e,t;(e=this.Tr)==null||e.unregister(uu),(t=this.Tr)==null||t.unregister(iu)}za(e,t){if(G(e))return null;var n,r=Ss(e)?e:parseFloat(e);return typeof(n=r)!=`number`||!Number.isFinite(n)||0>n||n>1?(bh.warn(t+` must be between 0 and 1. Ignoring invalid value:`,e),null):r}Wa(e){if(this.Tr){var t,n=this.Tr,r=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.za(this.Ne.session_recording?.sampleRate,`session_recording.sampleRate`),i=this.za(t?.sampleRate,`remote config sampleRate`),a=r??i;G(a)&&this.Ua();var o=t?.minimumDurationMilliseconds;n.register({[ru]:z({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:z({capturePerformance:e.capturePerformance},t?.networkPayloadCapture),canvasRecording:{enabled:t?.recordCanvas,fps:t?.canvasFps,quality:t?.canvasQuality},sampleRate:a,minimumDurationMilliseconds:U(o)?null:o,endpoint:t?.endpoint,triggerMatchType:t?.triggerMatchType,masking:t?.masking,urlTriggers:t?.urlTriggers,version:t?.version,triggerGroups:t?.triggerGroups})})};r(),(t=this.Oa)==null||t.call(this),this.Oa=this._instance.sessionManager?.onSessionId(r)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;t&&`sessionRecording`in t?!1===t.sessionRecording?(this.Wa(t),this.Ha()):(this.Wa(t),this.startIfEnabledOrStop()):(this.La===_h&&(this.La=vh,bh.warn(`config refresh failed, recording will not start until page reload`)),this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t=`log`),(n=this.Fa)!=null&&n.log?this.Fa.log(e,t):bh.warn(`log called before recorder was ready`)}get Ba(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(ru);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||`lazy-recorder`}Va(){var e,t=this._instance.get_property(ru);
6if(!t)return!1;try{e=typeof t==`object`?t:JSON.parse(t)}catch(e){return bh.warn(`persisted remote config for session recording is invalid and will be ignored`,e),!1}var n=e.cache_timestamp??Date.now();return 36e5>=Date.now()-n}ja(e){var t,n,r;if(!this.Da){if((t=I.__PosthogExtensions__)==null||!t.initSessionRecording)return bh.warn(`Called on script loaded before session recording is available. This can be caused by adblockers.`),void this._instance.register_for_session({[Uu]:!0});if(this.Fa||(this.Fa=I.__PosthogExtensions__?.initSessionRecording(this._instance,this.$a),this.Fa._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Va()){if(this.La===vh||this.La===_h)return;this.La=_h,bh.info(`persisted remote config is stale, requesting fresh config before starting`),new gp(this._instance).load();return}this.La=gh,(n=(r=this.Fa).setDocumentWasEverVisible)==null||n.call(r,this.$a),this.Fa.start(e)}}onRRwebEmit(e){var t;(t=this.Fa)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Fa||(t=this.Tr)==null||t.register({[ou]:!0}),(e=this.Fa)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Fa||(t=this.Tr)==null||t.register({[au]:!0}),(e=this.Fa)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.Fa||(n=this.Tr)==null||n.register({[e===`url`?su:cu]:!0}),(t=this.Fa)==null||t.overrideTrigger(e)}get sdkDebugProperties(){return this.Fa?.sdkDebugProperties||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.Fa)==null||!n.tryAddCustomEvent(e,t))}}},eg={autocapture:class{constructor(e){this.Za=!1,this.Ga=null,this.Qa=!1,this.Ka=!1,this.instance=e,this.rageclicks=new ih(e.config.rageclick),this.Ja=null}initialize(){this.startIfEnabled()}get Ne(){var e=H(this.instance.config.autocapture)?this.instance.config.autocapture:{};return e.url_allowlist=e.url_allowlist?.map((e=>new RegExp(e))),e.url_ignorelist=e.url_ignorelist?.map((e=>new RegExp(e))),e}Ya(){if(this.isBrowserSupported()){if(P&&F){var e=e=>{e||=P?.event;try{this.Xa(e)}catch(e){oh.error(`Failed to capture event`,e)}};if(ld(F,`submit`,e,{capture:!0}),ld(F,`change`,e,{capture:!0}),ld(F,`click`,e,{capture:!0}),this.Ne.capture_copied_text){var t=e=>{e||=P?.event;try{this.Xa(e,ah)}catch(e){oh.error(`Failed to capture copy/cut event`,e)}};ld(F,`copy`,t,{capture:!0}),ld(F,`cut`,t,{capture:!0})}}}else oh.info(`Disabling Automatic Event Collection because this browser is not supported`)}startIfEnabled(){this.isEnabled&&!this.Za&&(this.Ya(),this.Za=!0)}onRemoteConfig(e){if(this.Qa=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.Ka=t.elementsChainAsString);var n=t.autocapture_opt_out;ws(n)&&(this.instance.persistence&&this.instance.persistence.register({[Jl]:n}),this.Ga=n),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.Ja=e}getElementSelectors(e){var t,n=[];return(t=this.Ja)==null||t.forEach((t=>{(F?.querySelectorAll(t))?.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e=this.instance.persistence?.props[Jl],t=this.Ga,n=this.instance.Ki()&&!this.Qa;if(xs(t)&&!ws(e)&&!n)return!1;var r=this.Ga??!!e;return!!this.instance.config.autocapture&&!r}Xa(e,t){if(t===void 0&&(t=`$autocapture`),this.isEnabled){var n,r=Gd(e);Ld(r)&&(r=r.parentNode||null),t===`$autocapture`&&e.type===`click`&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&tf(r,this.instance.config.rageclick)&&this.Xa(e,`$rageclick`);var i=t===ah;if(r&&function(e,t,n,r,i,a){if(!P||nf(e)||n!=null&&n.url_allowlist&&!Vd(n.url_allowlist,a)||n!=null&&n.url_ignorelist&&Vd(n.url_ignorelist,a))return!1;if(n!=null&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((e=>t.type===e)))return!1}var s=rf(e,r),c=s.parentIsUsefulElement,l=s.targetElementList;if(!function(e,t){var n=t?.element_allowlist;if(U(n))return!0;var r,i=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var a of e)if(r=i(a))return r.v;return!1}(l,n)||!qd(l,n?.css_selector_allowlist)||qd(l,n?.css_selector_ignorelist??Yd))return!1;try{var u=P.getComputedStyle(e);
6if(u&&u.getPropertyValue(`cursor`)===`pointer`&&t.type===`click`)return!0}catch{}var d=e.tagName.toLowerCase();switch(d){case`html`:return!1;case`form`:return(i||[`submit`]).indexOf(t.type)>=0;case`input`:case`select`:case`textarea`:return(i||[`change`,`click`]).indexOf(t.type)>=0;default:return c?(i||[`click`]).indexOf(t.type)>=0:(i||[`click`]).indexOf(t.type)>=0&&(Kd.indexOf(d)>-1||e.getAttribute(`contenteditable`)===`true`)}}(r,e,this.Ne,i,i?[`copy`,`cut`]:void 0,this.instance)){var a=lh(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Ne.element_attribute_ignorelist,elementsChainAsString:this.Ka,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=a.props;if(a.explicitNoCapture)return!1;var s=this.getElementSelectors(r);if(s&&s.length>0&&(o.$element_selectors=s),t===ah){var c,l=Ud(P==null||(c=P.getSelection())==null?void 0:c.toString()),u=e.type||`clipboard`;if(!l)return!1;o.$selected_content=l,o.$copy_type=u}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return vs(F?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.eo=(P==null||(t=P.location)==null?void 0:t.pathname)||``}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview===`history_change`}startIfEnabled(){this.isEnabled&&(K.info(`History API monitoring enabled, starting...`),this.monitorHistoryChanges())}stop(){this.io&&this.io(),this.io=void 0,K.info(`History API monitoring stopped`)}monitorHistoryChanges(){P&&P.history&&(this.ro(`pushState`),this.ro(`replaceState`),this.no())}ro(e){var t;if(P&&((t=P.history[e])==null||!t.__posthog_wrapped__)){var n=this;(function(e,t,n){try{if(!(t in e))return dh;var r={next:e[t]},i=n((function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return r.next.apply(this,t)}));return vs(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=i,()=>{if(e[t]!==i)for(var n=e[t];vs(n)&&n.__posthog_layer__;){var a=n.__posthog_layer__;if(a.next===i)return void(a.next=r.next);n=a.next}else e[t]=r.next}}catch{return dh}})(P.history,e,(t=>function(r,i,a){t.call(this,r,i,a),n.so(e)}))}}so(e){try{var t,n=P==null||(t=P.location)==null?void 0:t.pathname;if(!n)return;n!==this.eo&&this.isEnabled&&this._instance.capture(Qu,{navigation_type:e}),this.eo=n}catch(t){K.error(`Error capturing `+e+` pageview`,t)}}no(){if(!this.io){var e=()=>{this.so(`popstate`)};ld(P,`popstate`,e),this.io=()=>{P&&P.removeEventListener(`popstate`,e)}}}},heatmaps:class{get Ne(){return this.instance.config}constructor(e){var t;this.ao=!1,this.Za=!1,this.oo=null,this.instance=e,this.ao=!((t=this.instance.persistence)==null||!t.props[Yl]),this.rageclicks=new ih(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return H(this.Ne.capture_heatmaps)&&this.Ne.capture_heatmaps.flush_interval_milliseconds&&(e=this.Ne.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return G(this.Ne.capture_heatmaps)?G(this.Ne.enable_heatmaps)?this.ao:this.Ne.enable_heatmaps:!1!==this.Ne.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Za)return;xh.info(`starting...`),this.lo(),this.Ie()}else clearInterval(this.oo??void 0),this.uo(),this.getAndClearBuffer()}onRemoteConfig(e){if(e.ok){var t=e.config;if(`heatmaps`in t){var n=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Yl]:n}),this.ao=n,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}ho(e){Sh(e.originalEvent)&&this.ke(e.originalEvent,`deadclick`)}Ie(){this.oo&&clearInterval(this.oo),this.oo=F?.visibilityState===`visible`?setInterval(this.pr.bind(this),this.flushIntervalMilliseconds):null}lo(){P&&F&&(this.do=this.pr.bind(this),ld(P,Zu,this.do),this.vo=e=>this.ke(e||P?.event),ld(F,`click`,this.vo,{capture:!0}),this.co=e=>this.fo(e||P?.event),ld(F,`mousemove`,this.co,{capture:!0}),this.po=new Sf(this.instance,bf,this.ho.bind(this)),this.po.startIfEnabledOrStop(),this.mo=this.Ie.bind(this),ld(F,Xu,this.mo),this.Za=!0)}uo(){var e;P&&F&&(this.do&&P.removeEventListener(Zu,this.do),this.vo&&F.removeEventListener(`click`,this.vo,{capture:!0}),this.co&&F.removeEventListener(`mousemove`,this.co,{capture:!0}),this.mo&&F.removeEventListener(Xu,this.mo),clearTimeout(this.yo),(e=this.po)==null||e.stop(),this.Za=!1)}bo(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),a=function(e,t,n){for(var r=e;r&&Fd(r)&&!Id(r,`body`);){if(r===n)return!1;var i=void 0;try{i=(r.ownerDocument?.defaultView??P)?.getComputedStyle(r).position}catch{return!1}if(B(t,i))return!0;r=Jd(r)}return!1}(Gd(e),[`fixed`,`sticky`],i);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:n),target_fixed:a,type:t}}ke(e,t){var n;if(t===void 0&&(t=`click`),!Pd(e.target)&&Sh(e)){var r=this.bo(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&tf(Gd(e),this.instance.config.rageclick)&&this.Vt(z({},r,{type:`rageclick`})),this.Vt(r)}}fo(e){!Pd(e.target)&&Sh(e)&&(clearTimeout(this.yo),this.yo=setTimeout((()=>{this.Vt(this.bo(e,`mousemove`))}),500))}Vt(e){if(P){var t=this.Ne.disable_capture_url_hashes?Uc(P.location.href):P.location.href,n=this.Ne.custom_personal_data_properties,r=Ff(t,this.Ne.mask_personal_data_properties?[...Bf,...n||[]]:[],Hf);this.R=this.R||{},this.R[r]||(this.R[r]=[]),this.R[r].push(e)}}pr(){this.R&&!ys(this.R)&&this.instance.capture(`$$heatmap`,{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Sf,webVitalsAutocapture:class{constructor(e){var t;this.ao=!1,this.Za=!1,this.R={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this._o=()=>{clearTimeout(this.wo),this.wo=void 0,this.R.metrics.length!==0&&(this._instance.capture(`$web_vitals`,z({$current_url:this.R.url},this.R.metrics.reduce(((e,t)=>z({},e,{[`$web_vitals_`+t.name+`_event`]:z({},t),[`$web_vitals_`+t.name+`_value`]:t.value})),{}))),this.R={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ko=e=>{if(this.R=this.R||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},G(e?.name)||G(e?.value))ph.error(`Invalid metric received`,e);else{var t=typeof e.navigationURL==`string`?e.navigationURL:void 0,n=this.xo(t);if(!U(n)){var r=Ss(e.navigationId)||typeof e.navigationId==`string`?`navigation:`+e.navigationId:`url:`+n;if(!this.So||this.So>e.value){this.R.navigationKey!==r&&(this._o(),this.wo=setTimeout(this._o,this.flushToCaptureTimeoutMs)),U(this.R.navigationKey)&&(this.R.navigationKey=r,this.R.url=n),this.R.firstMetricTimestamp=U(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var i=this._instance.sessionManager?.checkAndGetSessionAndWindowId(!0),a=z({},e,t?{navigationURL:n}:{},{$current_url:n,timestamp:Date.now()});U(i)||(a.$session_id=i.sessionId,a.$window_id=i.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this._o()}else ph.error(`Ignoring metric with value >= `+this.So,e)}}},this.Co=()=>
6{if(!this.Za){var e,t,n,r,i=I.__PosthogExtensions__,a=i?.postHogWebVitalsCallbacksByFlavor,o=a?.[this.Mo]||(this.Mo===`web-vitals`&&U(a)?i?.postHogWebVitalsCallbacks:void 0);if(U(o)||(e=o.onLCP,t=o.onCLS,n=o.onFCP,r=o.onINP),e&&t&&n&&r){var s={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf(`LCP`)>-1&&e(this.ko.bind(this),s),this.allowedMetrics.indexOf(`CLS`)>-1&&t(this.ko.bind(this),s),this.allowedMetrics.indexOf(`FCP`)>-1&&n(this.ko.bind(this),s),this.allowedMetrics.indexOf(`INP`)>-1&&r(this.ko.bind(this),s),this.Za=!0}else ph.error(`web vitals callbacks not loaded - not starting`)}},this._instance=e,this.ao=!((t=this._instance.persistence)==null||!t.props[$l]),this.startIfEnabled()}get To(){return this._instance.config.capture_performance}get allowedMetrics(){var e=H(this.To)?this.To?.web_vitals_allowed_metrics:void 0;return G(e)?this._instance.persistence?.props[nu]||[`CLS`,`FCP`,`INP`,`LCP`]:e}get flushToCaptureTimeoutMs(){return(H(this.To)?this.To.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=H(this.To)?this.To.web_vitals_attribution:void 0;return e!=null&&e}get useSoftNavs(){var e=H(this.To)?this.To.__preview_web_vitals_soft_navs:void 0;return e!=null&&e}get So(){var e=H(this.To)&&Ss(this.To.__web_vitals_max_value)?this.To.__web_vitals_max_value:mh;return e>0&&6e4>=e?mh:e}get isEnabled(){var e=Ro?.protocol;if(e!==`http:`&&e!==`https:`)return ph.info(`Web Vitals are disabled on non-http/https protocols`),!1;var t=H(this.To)?this.To.web_vitals:ws(this.To)?this.To:void 0;return ws(t)?t:this.ao}startIfEnabled(){this.isEnabled&&!this.Za&&(ph.info(`enabled, starting...`),this.ai(this.Co))}onRemoteConfig(e){if(e.ok){var t=e.config;if(`capturePerformance`in t){var n=H(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=H(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[$l]:n}),this._instance.persistence.register({[nu]:r})),this.ao=n,this.startIfEnabled()}}}get Mo(){return this.useSoftNavs?this.useAttribution?`web-vitals-with-attribution-soft-navs`:`web-vitals-soft-navs`:this.useAttribution?`web-vitals-with-attribution`:`web-vitals`}ai(e){var t=I.__PosthogExtensions__,n=this.Mo,r=t?.postHogWebVitalsCallbacksByFlavor;r!=null&&r[n]||n===`web-vitals`&&U(r)&&t!=null&&t.postHogWebVitalsCallbacks?e():t==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,n,(t=>{t?ph.error(`failed to load script`,t):e()}))}xo(e){var t=e||P?.location.href;if(t){var n=this._instance.config.disable_capture_url_hashes?Uc(t):t,r=this._instance.config.custom_personal_data_properties;return Ff(n,this._instance.config.mask_personal_data_properties?[...Bf,...r||[]]:[],Hf)}ph.error(`Could not determine current URL`)}}},tg={exceptionObserver:class{constructor(e){var t;this.Co=()=>{var e;if(P&&this.isEnabled&&(e=I.__PosthogExtensions__)!=null&&e.errorWrappingFunctions){var t=I.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=I.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=I.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Eo&&this.Ne.capture_unhandled_errors&&(this.Eo=t(this.captureException.bind(this))),!this.Io&&this.Ne.capture_unhandled_rejections&&(this.Io=n(this.captureException.bind(this))),!this.Po&&this.Ne.capture_console_errors&&(this.Po=r(this.captureException.bind(this)))}catch(e){uh.error(`failed to start`,e),this.Ro()}}},this._instance=e,this.Ao=!((t=this._instance.persistence)==null||!t.props[Xl]),this.Fo=new Is(z({},function(e){return e===void 0&&(e={}),{refillRate:e.exceptionRateLimiterRefillRate??e.__exceptionRateLimiterRefillRate??1,bucketSize:e.exceptionRateLimiterBucketSize??e.__exceptionRateLimiterBucketSize??10}}(this._instance.config.error_tracking),{refillInterval:1e4,rt:uh})),this.Ne=this.Lo(),this.startIfEnabledOrStop()}Lo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return H(e)?t=z({},t,e):(U(e)?this.Ao:e)&&(t=z({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Ne.capture_console_errors||this.Ne.capture_unhandled_errors||this.Ne.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(uh.info(`enabled`),this.Ro(),this.ai(this.Co)):this.Ro()}ai(e){var t,n;(t=I.__PosthogExtensions__)!=null&&t.errorWrappingFunctions?e():(n=I.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`exception-autocapture`,(t=>{if(t)return uh.error(`failed to load script`,t);
6e()}))}Ro(){var e,t,n;(e=this.Eo)==null||e.call(this),this.Eo=void 0,(t=this.Io)==null||t.call(this),this.Io=void 0,(n=this.Po)==null||n.call(this),this.Po=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;`autocaptureExceptions`in t&&(this.Ao=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Xl]:this.Ao}),this.Ne=this.Lo(),this.startIfEnabledOrStop())}}onConfigChange(){this.Ne=this.Lo()}captureException(e){var t,n,r=(e==null||(t=e.$exception_list)==null||(t=t[0])==null?void 0:t.type)??`Exception`;this.Fo.consumeRateLimit(r)?uh.info(`Skipping exception capture because of client rate limiting.`,{exception:r}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(e)}},exceptions:class{constructor(e){this.Oo=[],this.Do=new ul([new Sl,new Ml,new wl,new Cl,new Al,new kl,new El,new jl],function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){r===void 0&&(r=0);for(var i=[],a=t.split(`
7`),o=r;a.length>o;o++){var s=a[o];if(1024>=s.length){var c=xl.test(s)?s.replace(xl,`$1`):s;if(!c.match(/\S*Error: /)){for(var l of n){var u=l(c,e);if(u){i.push(u);break}}if(i.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return z({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||dl});var n}))}(i)}}(`web:javascript`,_l,bl)),this._instance=e,this.Oo=this._instance.persistence?.get_property(Zl)??[],this.$o=Ll(this.No()),this.qo=new Rl(this.$o)}onConfigChange(){this.$o=Ll(this.No()),this.qo.setConfig(this.$o)}onRemoteConfig(e){if(e.ok){var t=e.config;if(`errorTracking`in t){var n=t.errorTracking?.suppressionRules??[],r=t.errorTracking?.captureExtensionExceptions;this.Oo=n,this._instance.persistence&&this._instance.persistence.register({[Zl]:this.Oo,[Ql]:r})}}}get jo(){var e,t=!!this._instance.get_property(Ql);return(e=this._instance.config.error_tracking.captureExtensionExceptions??t)!=null&&e}buildProperties(e,t){return this.Do.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.$o.enabled)try{if(!W(e)||e.trim().length===0)return void Hh.warn(`Ignoring exception step because message must be a non-empty string`);var n=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((n,r)=>Fl.has(r)?(t.push(r),n):(n[r]=e[r],n)),{}),droppedKeys:t}}(this.Bo(t)),r=n.sanitizedProperties,i=n.droppedKeys;i.length>0&&Hh.warn(`Ignoring reserved exception step fields`,{droppedKeys:i}),this.qo.add(z({[Nl]:e,[Pl]:new Date().toISOString()},r))}catch(e){Hh.error(`Failed to add exception step. Ignoring breadcrumb.`,e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Ho(t)){if(this.Uo(t))return this.zo(`Exception dropped: matched a suppression rule`),void Hh.info(`Skipping exception capture because a suppression rule matched`);if(!this.jo&&this.Wo(t))return this.zo(`Exception dropped: thrown by a browser extension`),void Hh.info(`Skipping exception capture because it was thrown by an extension`);if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Vo(t))return this.zo(`Exception dropped: thrown by the PostHog SDK`),void Hh.info(`Skipping exception capture because it was thrown by the PostHog SDK`)}var n=this.$o.enabled&&G(e.$exception_steps)?this.Zo(e):e,r=typeof(a=globalThis._posthogReleaseId)==`string`&&a.length>0?a:void 0;r&&(n.$release_id=r);try{var i=this._instance.capture(`$exception`,n,{_noTruncate:!0,_batchKey:`exceptionEvent`,Un:!0});return i&&this.qo.clear(),i}catch(e){Hh.error(`Failed to capture exception event. Dropping this exception.`,e),this.qo.clear();return}}catch(e){Hh.error(`Failed to process exception event. Ignoring this exception.`,e);return}var a}Zo(e){try{var t=this.qo.getAttachable();return t.length===0?e:z({},e,{$exception_steps:t})}catch(t){return Hh.error(`Failed to read buffered exception steps. Capturing exception without steps.`,t),e}}zo(e){this.$o.enabled&&this.qo.add({[Nl]:e,[Pl]:new Date().toISOString()})}Bo(e){return H(e)?z({},e):{}}No(){return this._instance.config.error_tracking?.exception_steps??{}}Uo(e){if(e.length===0)return!1;try{var t=e.reduce(((e,t)=>{var n=t.type,r=t.value;return W(n)&&n.length>0&&e.$exception_types.push(n),W(r)&&r.length>0&&e.$exception_values.push(r),e}),{$exception_types:[],$exception_values:[]});return this.Oo.some((e=>{var n=e.values.map((e=>{var n=wm[e.operator],r=t[e.key];if(!n||!r)return!1;var i=V(e.value)?e.value:[e.value];return i.length>0&&n(i,r)}));return e.type===`OR`?n.some(Boolean):n.every(Boolean)}))}catch(e){return Hh.warn(`Failed to evaluate suppression rules. Capturing the exception.`,e),!1}}Wo(e){return e.flatMap((e=>e.stacktrace?.frames??[])).some((e=>e.filename&&e.filename.startsWith(`chrome-extension://`)))}Vo(e){if(e.length>0){var t,n,r=e[0].stacktrace?.frames??[],i=r[r.length-1];return(t=i==null||(n=i.filename)==null?void 0:n.includes(`posthog.com/static`))!=null&&t}return!1}Ho(e){return!G(e)&&V(e)}}},ng=z({productTours:class{get Tr(){return this._instance.persistence}constructor(e){this.Go=null,this.Qo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t=e.config;if(`productTours`in t){var n;if(this.Tr&&this.Tr.register({[tu]:!!t.productTours}),!wh(this._instance))return!this.Go&&G(this.Tr?.props[Du])||Ch.info(`product tours disabled; stopping and clearing cached tours`),(n=this.Go)==null||n.stop(),this.Go=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Go&&wh(this._instance)&&this.ai((()=>this.Ko()))}ai(e){var t,n;(t=I.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=I.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`product-tours`,(t=>{t?Ch.error(`Could not load product tours script`,t):e()}))}Ko(){var e;!this.Go&&(e=I.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Go=I.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!V(this.Qo)||t){var n=this.Tr;if(n){var r=n.props[Du];if(V(r)&&!t)return this.Qo=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/product_tours/?token=`+this._instance.config.token),method:`GET`,timestampMode:`query`,callback:t=>{if(wh(this._instance)){var r=t.statusCode;if(r!==200||!t.json){var i=`Product Tours API could not be loaded, status: `+r;r===0?t.error||Ch.warn(i):Ch.error(i),e([],{isLoaded:!1,error:i});return}var a=V(t.json.product_tours)?t.json.product_tours:[];this.Qo=a,n&&n.register({[Du]:a}),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Qo,{isLoaded:!0})}getActiveProductTours(e){G(this.Go)?e([],{isLoaded:!1,error:`Product tours not loaded`}):this.Go.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Go)==null||t.showTourById(e)}previewTour(e){this.Go?this.Go.previewTour(e):this.ai((()=>{var t;this.Ko(),(t=this.Go)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Go)==null||e.dismissTour(`user_clicked_skip`)}nextStep(){var e;(e=this.Go)==null||e.nextStep()}previousStep(){var e;(e=this.Go)==null||e.previousStep()}clearCache(){var e;this.Qo=null,(e=this.Tr)==null||e.unregister(Du)}resetTour(e){var t;(t=this.Go)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Go)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Go)==null||t.cancelPendingTour(e)}}},Qh),rg={siteApps:class{constructor(e){this.Jo=0,this._instance=e,this.Yo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Xo(e,t){if(t){var n=this.globalsForEvent(t);this.Yo.push(n),this.Yo.length>1e3&&(this.Yo=this.Yo.slice(10))}}get siteAppLoaders(){var e;return(e=I._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Xo.bind(this));this.tl=()=>{e(),this.Yo=[],this.tl=void 0}}}globalsForEvent(e){if(!e)throw Error(`Event payload is required`);var t={},n=this._instance.get_property(`$groups`)||[],r=this._instance.get_property(`$stored_group_properties`)||{};for(var i of Object.entries(r)){var a=i[0];t[a]={id:n[a],type:a,properties:i[1]}}var o=e.$set_once,s=e.$set;return{event:z({},qo(e,Th),{properties:z({},e.properties,s?{$set:z({},e.properties?.$set??{},s)}:{},o?{$set_once:z({},e.properties?.$set_once??{},o)}:{}),elements_chain:e.properties?.$elements_chain??``,distinct_id:e.properties?.distinct_id}),person:{properties:this._instance.get_property(`$stored_person_properties`)},groups:t}}el(e){var t=e.tagName?.toLowerCase();
7return t===`style`&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(Eh.error(`prepare_external_dependency_stylesheet returned null`),null):t===`script`&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(Eh.error(`prepare_external_dependency_script returned null`),null):e}il(){var e;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var t=F?.defaultView,n=t==null||(e=t.Node)==null?void 0:e.prototype;if(!t||!n)return()=>{};if(this.Jo++,this.rl)return this.nl();var r=[],i=this,a=new WeakSet,o=(e,t,n)=>{if(e!=null&&e[t]){var i=e[t];e[t]=n(i),r.push((()=>{e[t]=i}))}},s=e=>{if(a.has(e))return e;var t=i.el(e);return t&&a.add(t),t},c=e=>e.map((e=>typeof e==`string`?e:s(e))).filter((e=>!xs(e)));return o(n,`appendChild`,(e=>function(t){var n=s(t);return n?e.call(this,n):t})),o(n,`insertBefore`,(e=>function(t,n){var r=s(t);return r?e.call(this,r,n):t})),o(n,`replaceChild`,(e=>function(t,n){var r=s(t);return r?e.call(this,r,n):n})),[t.Element?.prototype,t.Document?.prototype,t.DocumentFragment?.prototype].forEach((e=>{o(e,`append`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,c(n))})),o(e,`prepend`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,c(n))}))})),[t.Element?.prototype,t.CharacterData?.prototype,t.DocumentType?.prototype].forEach((e=>{o(e,`before`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,c(n))})),o(e,`after`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,c(n))})),o(e,`replaceWith`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=c(n);return n.length&&!i.length?void 0:e.apply(this,i)}))})),o(t.Element?.prototype,`insertAdjacentElement`,(e=>function(t,n){var r=s(n);return r?e.call(this,t,r):null})),this.rl=()=>{r.forEach((e=>e())),this.rl=void 0},this.nl()}nl(){var e=!1;return()=>{var t;e||(e=!0,this.Jo--,this.Jo===0&&((t=this.rl)==null||t.call(this)))}}sl(e,t){t===void 0&&(t=!0);var n=this.il();try{var r=e(n);return t&&n(),r}catch(e){throw n(),e}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var n;!t.errored&&this.Yo.length&&(Eh.info(`Processing `+this.Yo.length+` events for site app with id `+e.id),this.Yo.forEach((e=>this.sl((()=>t.processEvent==null?void 0:t.processEvent(e))))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&((n=this.tl)==null||n.call(this))},r=!1,i=i=>{t.errored=!i,t.loaded=!0,Eh.info(`Site app with id `+e.id+` `+(i?`loaded`:`errored`)),r&&n()};try{var a=this.sl((t=>e.init({posthog:this._instance,callback(e){t(),i(e)}})),!1).processEvent;a&&(t.processEvent=a),r=!0}catch(t){Eh.error(Dh+e.id,t),i(!1)}if(r&&t.loaded)try{n()}catch(n){Eh.error(`Error while processing buffered events PostHog app with config id `+e.id,n),t.errored=!0}}al(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}ol(e){var t=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e),r=function(r){try{t.sl((()=>r.processEvent==null?void 0:r.processEvent(n)))}catch(t){Eh.error(`Error while processing event `+e.event+` for site app `+r.id,t)}};for(var i of Object.values(this.apps))r(i)}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.al(),void this._instance.on(`eventCaptured`,(e=>this.ol(e)))):void Eh.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`);if((n=this.tl)==null||n.call(this),e.ok){var a=e.config;if((r=a.siteApps)!=null&&r.length){if(this.isEnabled){var o=function(){var e,t=s.id,n=s.url;I[`__$$ph_site_app_`+t]=i._instance,(e=I.__PosthogExtensions__)==null||e.loadSiteApp==null||e.loadSiteApp(i._instance,n,(e=>{if(e)return Eh.error(Dh+t,e)}))};for(var s of a.siteApps)o()}else Eh.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`)}}}}},ig={tracingHeaders:class{constructor(e){this.ll=void 0,this.ul=void 0,this.hl=void 0,this.Co=()=>{var e,t,n=this.dl();n?(U(this.ll)&&(this.ll=(e=I.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),U(this.ul)&&(this.ul=(t=I.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null?void 0:t._patchFetch(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ro()},this._instance=e}initialize(){this.startIfEnabledOrStop()}ai(e){var t,n;(t=I.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns?e():(n=I.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`tracing-headers`,(t=>{if(t)return fh.error(`failed to load script`,t);
7e()}))}vl(){return this._instance.config.tracing_headers??this._instance.config.addTracingHeaders??this._instance.config.__add_tracing_headers}dl(){var e=this.vl();return V(e)?(V(this.hl)?this.hl.splice(0,this.hl.length,...e):this.hl=[...e],e.length>0?this.hl:void 0):(V(this.hl)&&this.hl.splice(0),this.hl=e||void 0,this.hl)}Ro(){var e,t;(e=this.ll)==null||e.call(this),(t=this.ul)==null||t.call(this),this.ll=void 0,this.ul=void 0}startIfEnabledOrStop(){this.dl()?this.ai(this.Co):this.Ro()}}},ag=z({surveys:class{get Ne(){return this._instance.config}constructor(e){this.cl=void 0,this._surveyManager=null,this.fl=!1,this.pl=[],this.gl=null,this.ml=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Ne.disable_surveys){if(!e.ok)return Z.warn(`Remote config unavailable. Not loading surveys.`);var t=e.config.surveys;if(G(t))return Z.warn(`Flags not loaded yet. Not loading surveys.`);var n=V(t);this.cl=n?t.length>0:t,Z.info(`flags response received, isSurveysEnabled: `+this.cl),this.loadIfEnabled()}}reset(){try{var e;(e=this._surveyEventReceiver)==null||e.reset(),localStorage.removeItem(`lastSeenSurveyDate`);for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(Mm)||r!=null&&r.startsWith(`inProgressSurvey_`))&&t.push(r)}t.forEach((e=>localStorage.removeItem(e)))}catch{}}loadIfEnabled(){if(!this._surveyManager){if(this.fl)Z.info(`Already initializing surveys, skipping...`);else if(this.Ne.disable_surveys)Z.info(Nh);else if(this.Ne.cookieless_mode&&this._instance.consent.isOptedOut())Z.info(`Not loading surveys in cookieless mode without consent.`);else{var e=I?.__PosthogExtensions__;if(e){if(!U(this.cl)||this.Ne.advanced_enable_surveys){var t=this.cl||this.Ne.advanced_enable_surveys;this.fl=!0;try{var n=e.generateSurveys;if(n)return void this.yl(n,t);var r=e.loadExternalDependency;if(!r)return void this.bl(Wu);r(this._instance,`surveys`,(n=>{n||!e.generateSurveys?this.bl(`Could not load surveys script`,n):this.yl(e.generateSurveys,t)}))}catch(e){throw this.bl(`Error initializing surveys`,e),e}finally{this.fl=!1}}}else Z.error(`PostHog Extensions not found.`)}}}yl(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new jh(this._instance),Z.info(`Surveys loaded successfully`),this._l({isLoaded:!0})}bl(e,t){Z.error(e,t),this._l({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.pl.push(e),this._surveyManager&&this._l({isLoaded:!0}),()=>{this.pl=this.pl.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.Ne.disable_surveys)return Z.info(Nh),e([]);var n,r=this._instance.get_property(Su);if(r&&!t)return e(r,{isLoaded:!0}),void(this.wl()&&this.getSurveys((()=>{}),!0));typeof Promise<`u`&&this.gl?this.gl.then((t=>e(t.surveys,t.context))):(typeof Promise<`u`&&(this.gl=new Promise((e=>{n=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/surveys/?token=`+this.Ne.token),method:`GET`,timestampMode:`query`,timeout:this.Ne.surveys_request_timeout_ms,callback:t=>{var r;this.gl=null;var i=t.statusCode;if(i!==200||!t.json){var a=`Surveys API could not be loaded, status: `+i;i===0?t.error||Z.warn(a):Z.error(a),this.ml=Date.now();var o={isLoaded:!1,error:a};e([],o),n?.({surveys:[],context:o});return}this.ml=null;var s,c=t.json.surveys||[],l=c.filter((e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(jm(e)||function(e){var t;return!((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null||!t.length)}(e))));l.length>0&&((s=this._surveyEventReceiver)==null||s.register(l)),(r=this._instance.persistence)==null||r.register({[Su]:c,[Cu]:Date.now()});var u={isLoaded:!0};e(c,u),n?.({surveys:c,context:u})}}))}wl(){return this.kl()&&!this.gl&&!this.xl()}kl(){var e=this._instance.get_property(Cu);return Ss(e)&&Date.now()-e>3e5}xl(){return Ss(this.ml)&&3e5>Date.now()-this.ml}markSurveyAsSeen(e,t){Nm({id:e,current_iteration:t?.iteration??null});try{localStorage.setItem(`lastSeenSurveyDate`,new Date().toISOString())}catch{}}_l(e){for(var t of this.pl)try{if(!e.isLoaded)return t([],e);
7this.getSurveys(t)}catch(e){Z.error(`Error in survey callback`,e)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!G(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Z.warn(`init was not called`)}Sl(e){var t=null;return this.getSurveys((n=>{t=n.find((t=>t.id===e))??null})),t}Cl(e){if(G(this._surveyManager))return{eligible:!1,reason:Mh};var t=typeof e==`string`?this.Sl(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:`Survey not found`}}Ml(e){if(G(this._surveyManager))return{eligible:!1,reason:Mh};var t=typeof e==`string`?this.Sl(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:`Survey not found`}}canRenderSurvey(e){if(G(this._surveyManager))return Z.warn(`init was not called`),{visible:!1,disabledReason:Mh};var t=this.Ml(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return G(this._surveyManager)?(Z.warn(`init was not called`),Promise.resolve({visible:!1,disabledReason:Mh})):new Promise((n=>{this.getSurveys((t=>{var r=t.find((t=>t.id===e))??null;if(r){var i=this.Ml(r);n({visible:i.eligible,disabledReason:i.reason})}else n({visible:!1,disabledReason:`Survey not found`})}),t)}))}renderSurvey(e,t,n){var r;if(G(this._surveyManager))Z.warn(`init was not called`);else{var i=typeof e==`string`?this.Sl(e):e;if(i!=null&&i.id){if(Pm.includes(i.type)){var a=F?.querySelector(t);if(a)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(Z.info(`Rendering survey `+i.id+` with delay of `+i.appearance.surveyPopupDelaySeconds+` seconds`),void setTimeout((()=>{var e;Z.info(`Rendering survey `+i.id+` with delay of `+i.appearance?.surveyPopupDelaySeconds+` seconds`),(e=this._surveyManager)==null||e.renderSurvey(i,a,n),Z.info(`Survey `+i.id+` rendered`)}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,a,n);Z.warn(`Survey element not found`)}else Z.warn(`Surveys of type `+i.type+` cannot be rendered in the app`)}else Z.warn(`Survey not found`)}}displaySurvey(e,t){var n;if(G(this._surveyManager))Z.warn(`init was not called`);else{var r=this.Sl(e);if(r){var i=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=z({},r,{appearance:z({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==up.Popover&&t.initialResponses&&Z.warn(`initialResponses is only supported for popover surveys. prefill will not be applied.`),!1===t.ignoreConditions){var a=this.Cl(r);if(!a.eligible)return void Z.warn(`Survey is not eligible to be displayed: `,a.reason)}t.displayType===up.Inline?this.renderSurvey(i,t.selector,t.properties):this._surveyManager.handlePopoverSurvey(i,t)}else Z.warn(`Survey not found`)}}cancelPendingSurvey(e){G(this._surveyManager)?Z.warn(`init was not called`):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload==null||e.handlePageUnload()}}},Qh),og={toolbar:class{constructor(e){this.instance=e}Tl(e){I.ph_toolbar_state=e}El(){return I.ph_toolbar_state??0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),ud(this.instance.config)||!P||!F)return!1;e??=P.location,n??=P.history;try{if(!t){try{P.localStorage.setItem(`test`,`test`),P.localStorage.removeItem(`test`)}catch{return!1}t=P?.localStorage}var r,i=Ph||If(e.hash,`__posthog`)||If(e.hash,`state`),a=i?id((()=>JSON.parse(atob(decodeURIComponent(i)))))||id((()=>JSON.parse(decodeURIComponent(i)))):null;return a&&a.action===`ph_authorize`?((r=a).source=`url`,r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:n?n.replaceState(n.state,``,e.pathname+e.search):e.hash=``)):((r=JSON.parse(t.getItem(Fh)||`{}`)).source=`localstorage`,delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Il(e){var t=I.ph_load_toolbar||I.ph_load_editor;!G(t)&&vs(t)?t(e,this.instance):Ih.warn(`No toolbar load function found`)}loadToolbar(e){var t=!(F==null||!F.getElementById(Ad));if(!P||t)return!1;var n=this.instance.requestRouter.region===`custom`&&this.instance.config.advanced_disable_toolbar_metrics,r=z({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor(`ui`)},n?{instrument:!1}:{});if(P.localStorage.setItem(Fh,JSON.stringify(z({},r,{source:void 0}))),this.El()===2)this.Il(r);else if(this.El()===0){var i;this.Tl(1),(i=I.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,`toolbar`,(e=>{if(e)return Ih.error(`[Toolbar] Failed to load`,e),void this.Tl(0);this.Tl(2),this.Il(r)})),ld(P,`turbolinks:load`,(()=>{this.Tl(0),this.loadToolbar(r)}))}return!0}Pl(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},sg=z({experiments:Gh},Qh),cg=z({},Qh,$h,eg,tg,ng,rg,ag,ig,og,sg,{conversations:class{constructor(e){this.Rl=void 0,this._conversationsManager=null,this.Al=!1,this.Fl=null,this.Ll=!1,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.Ol=e.ok,e.ok)){var t=e.config.conversations;G(t)||(ws(t)?this.Rl=t:(this.Rl=t.enabled,this.Fl=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Rl=void 0,this.Fl=null,this.Ol=void 0,this.Ll=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Al||this._instance.config.disable_conversations||ud(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=I?.__PosthogExtensions__;if(e&&!U(this.Rl)&&this.Rl){if(this.Fl&&this.Fl.token){this.Al=!0;try{var t=e.initConversations;if(t)return this.Dl(t),void(this.Al=!1);var n=e.loadExternalDependency;if(!n)return void this.$l(Wu);n(this._instance,`conversations`,(t=>{t||!e.initConversations?this.$l(`Could not load conversations script`,t):this.Dl(e.initConversations),this.Al=!1}))}catch(e){this.$l(`Error initializing conversations`,e),this.Al=!1}}else Kh.error(`Conversations enabled but missing token in remote config.`)}}}Dl(e){if(this.Fl)try{this._conversationsManager=e(this.Fl,this._instance),this.Ll=!1,Kh.info(`Conversations loaded successfully`)}
7catch(e){this.$l(`Error completing conversations initialization`,e)}else Kh.error(`Cannot complete initialization: remote config is null`)}$l(e,t){Kh.error(e,t),this._conversationsManager=null,this.Al=!1,this.Ll=!0}show(){this._conversationsManager?this._conversationsManager.show():Kh.warn(`Conversations not loaded yet.`)}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Rl&&!xs(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?`disabled_by_config`:ud(this._instance.config)?`disabled_for_toolbar`:this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?`consent_opted_out`:!1===this.Ol?`remote_config_failed`:U(this.Rl)?this.Ol?`disabled_in_project`:`remote_config_pending`:this.Rl?G(this.Fl)||!this.Fl.token?`missing_token`:I!=null&&I.__PosthogExtensions__?this.Al?`initializing`:this.Ll?`load_failed`:`not_loaded`:`extensions_unavailable`:`disabled_in_project`}isVisible(){var e;return(e=this._conversationsManager?.isVisible())!=null&&e}sendMessage(e,t,n){var r=this;return R((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(Kh.warn(qh),null)}))()}getMessages(e,t){var n=this;return R((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(Kh.warn(qh),null)}))()}markAsRead(e){var t=this;return R((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(Kh.warn(qh),null)}))()}getTickets(e){var t=this;return R((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(Kh.warn(qh),null)}))()}requestRestoreLink(e){var t=this;return R((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(Kh.warn(qh),null)}))()}restoreFromToken(e){var t=this;return R((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(Kh.warn(qh),null)}))()}restoreFromUrlToken(){var e=this;return R((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Kh.warn(qh),null)}))()}getCurrentTicketId(){return this._conversationsManager?.getCurrentTicketId()??null}getWidgetSessionId(){return this._conversationsManager?.getWidgetSessionId()??null}Yn(){var e;(e=this._conversationsManager)==null||e.setIdentity()}Xn(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},{logs:class{constructor(e){var t,n=this;this.Nl=!1,this.ql=!1,this.rt=q(`[logs]`),this.jl=z({},this.rt,{error(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];t.some(Zh)||n.rt.error(...t)}}),this.er=[],this.Bl=[],this.ya=0,this.Hl=()=>{var e,t;this.ya=0,(e=this.Ul)==null||e.onReconnect(),(t=this.zl)==null||t.onReconnect()},this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.Nl=!0),P&&ld(P,`online`,this.Hl)}Wl(e,t,n,r){var i,a=function(e,t){var n=e?.flushIntervalMs??3e3,r=e?.maxBufferSize??100,i=t!=null&&t.consoleCapture?void 0:e?.maxLogsPerInterval??1e3,a=U(i)?Math.max(r,2048):Math.max(r,i),o=e?.resourceAttributes;return{serviceName:o?.[`service.name`]??e?.serviceName??t?.serviceNameDefault,serviceVersion:o?.[`service.version`]??e?.serviceVersion,environment:o?.[`deployment.environment`]??e?.environment,resourceAttributes:o,beforeSend:e?.beforeSend,flushIntervalMs:n,maxBufferSize:r,maxQueueSize:a,maxBatchRecordsPerPost:100,rateCapWindowMs:n,maxLogsPerInterval:i,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((i=this._instance)==null||(i=i.config)==null?void 0:i.logs,n);return[new tl(this.Vl(e,t),a,this.jl,(()=>this.Zl()),(e=>e()),void 0,r),a]}Gl(){var e,t=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;if(!this.Ul||this.Ql!==t){var n;(n=this.Ul)==null||n.reset(),this.Ql=t;var r=this.Wl((()=>this.er),(e=>{this.er=e}));this.Ul=r[0],this.Kl=r[1]}return this.Ul}Jl(){var e,t=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;if(!this.zl||this.Yl!==t){var n;(n=this.zl)==null||n.reset(),this.Yl=t;var r=this.Wl((()=>this.Bl),(e=>{this.Bl=e}),{serviceNameDefault:`posthog-browser-logs`,consoleCapture:!0},Jh);this.zl=r[0],this.Xl=r[1]}return this.zl}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t=e.config.logs?.captureConsoleLogs;!G(t)&&t&&(this.Nl=!0,this.loadIfEnabled())}}reset(){var e,t;this.er=[],(e=this.Ul)==null||e.reset(),this.Bl=[],(t=this.zl)==null||t.reset(),this.ya=0}
7captureLog(e){this.Gl().captureLog(e)}he(e){this.Jl().captureLog(e)}get logger(){return this.tu||={trace:(e,t)=>this.captureLog({body:e,level:`trace`,attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:`debug`,attributes:t}),info:(e,t)=>this.captureLog({body:e,level:`info`,attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:`warn`,attributes:t}),error:(e,t)=>this.captureLog({body:e,level:`error`,attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:`fatal`,attributes:t})},this.tu}flushLogs(e){e?this.eu(e):(this.Ul&&this.Ul.flush().catch((e=>this.iu(e))),this.zl&&this.zl.flush().catch((e=>this.iu(e))))}iu(e){Zh(e)||this.rt.error(`PostHog logs flush failed:`,e)}loadIfEnabled(){if(this.Nl&&!this.ql){var e=I?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,`logs`,(t=>{var n;t||(n=e.logs)==null||!n.initializeLogs?this.rt.error(`Could not load logs script`,t):(e.logs.initializeLogs(this._instance),this.ql=!0)})):this.rt.error(Wu)}else this.rt.error(`PostHog Extensions not found.`)}}Vl(e,t){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:t=>t===$o.LogsQueue?e():void 0,setPersistedProperty(e,n){e===$o.LogsQueue&&t(n??[])},Ot:e=>this.Ot(e),getLibraryId:()=>L.LIB_NAME,getLibraryVersion:()=>L.LIB_VERSION}}Ot(e){return new Promise((t=>{if(Lf(this.ya,3))t({kind:`fatal`,error:Xh(void 0,`logs endpoint is unreachable, dropping batch`)});else{var n=!1,r=e=>{n||(n=!0,clearTimeout(i),t(e))},i=setTimeout((()=>{this.rt.warn(`Logs request timed out before receiving a response`),r({kind:`retry-later`,error:Xh(void 0,`logs request timed out`)})}),9e4);this._instance._send_request({method:`POST`,url:this.ru(),data:e,compression:`best-available`,batchKey:`logs`,fireCallbackOnDrop:!0,callback:e=>{var t=e.statusCode;this.nu(t),t>=200&&300>t?r({kind:`ok`}):t===413?r({kind:`too-large`}):t!==0&&t!==429&&500>t?r({kind:`fatal`,error:Error(`logs request failed with status `+t)}):t===0?(e.error||this.rt.warn(`Logs request failed before receiving an HTTP response`),r({kind:`retry-later`,error:Xh(e.error,`logs request failed before receiving an HTTP response`)})):r({kind:`retry-later`,error:e.error??Error(`logs request failed with status `+t)})}})}}))}nu(e){(e!==0||this._instance.__loaded)&&(this.ya=Rf(e,this.ya,3,(()=>this.rt.warn(`Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.`))))}eu(e){this.er.length>0&&this.su(e,this.er,this.Kl,L.LIB_NAME,(e=>{this.er=e})),this.Bl.length>0&&this.su(e,this.Bl,this.Xl,Jh,(e=>{this.Bl=e}))}su(e,t,n,r,i){if(t.length!==0){var a=t.map((e=>e.record));i([]);var o=el(a,$c(n,L.LIB_NAME,L.LIB_VERSION),r,L.LIB_VERSION);this._instance._send_request({method:`POST`,url:this.ru(),data:o,compression:`best-available`,batchKey:`logs`,transport:e})}}ru(){return this._instance.requestRouter.endpointFor(`api`,`/i/v1/logs`)+`?token=`+encodeURIComponent(this._instance.config.token)}Zl(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,i=n.sessionStartTimestamp,a=n.lastActivityTimestamp;t.sessionId=n.sessionId,t.windowId=r,G(i)||(t.sessionStartTimestamp=i),G(a)||(t.lastActivityTimestamp=a)}if(I!=null&&(e=I.location)!=null&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?Uc(I.location.href):I.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}},{metrics:class{constructor(e){this.rt=q(`[metrics]`),this._instance=e}initialize(){}Gl(){var e,t,n=(e=this._instance)==null||(e=e.config)==null?void 0:e.metrics;return this.Ul&&this.Ql===n||((t=this.Ul)==null||t.reset(),this.Ql=n,this.Ul=new al(this.Vl(),function(e){var t=e?.resourceAttributes;return{serviceName:t?.[`service.name`]??e?.serviceName,serviceVersion:t?.[`service.version`]??e?.serviceVersion,environment:t?.[`deployment.environment`]??e?.environment,resourceAttributes:t,beforeSend:e?.beforeSend,flushIntervalMs:e?.flushIntervalMs??1e4,maxSeriesPerFlush:e?.maxSeriesPerFlush??1e3}}(n),this.rt)),this.Ul}count(e,t,n){t===void 0&&(t=1),this.Gl().count(e,t,n)}
7gauge(e,t,n){this.Gl().gauge(e,t,n)}histogram(e,t,n){this.Gl().histogram(e,t,n)}flush(e){if(!this.Ul)return Promise.resolve();if(e){var t=this.Ul.drainWindow();return t&&this.Jt(t,e),Promise.resolve()}return this.Ul.flush().catch((e=>this.rt.error(`PostHog metrics flush failed:`,e)))}reset(){var e;(e=this.Ul)==null||e.reset()}Vl(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Jt:e=>t.Jt(e),getLibraryId:()=>L.LIB_NAME,getLibraryVersion:()=>L.LIB_VERSION}}Jt(e,t){return new Promise((n=>{var r=!1,i=e=>{r||(r=!0,clearTimeout(a),n(e))},a=setTimeout((()=>i({kind:`retry-later`,error:Error(`metrics request timed out`)})),9e4);this._instance._send_request(z({method:`POST`,url:this.au(),data:e,compression:`best-available`,batchKey:`metrics`},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t=e.statusCode;i(t>=200&&300>t?{kind:`ok`}:t===413?{kind:`too-large`}:t!==0&&t!==429&&500>t?{kind:`fatal`,error:Error(`metrics request failed with status `+t)}:{kind:`retry-later`,error:e.error??Error(`metrics request failed with status `+t)})}}))}))}au(){return this._instance.requestRouter.endpointFor(`api`,`/i/v1/metrics`)+`?token=`+encodeURIComponent(this._instance.config.token)}}});rh.__defaultExtensionClasses=z({},cg);var lg=function(){L.SDK_DIST_CHANNEL=`npm`;var e=Um[Zm]=new rh;return function(){function e(){e.done||(e.done=!0,Qm=!1,J(Um,(function(e){e._dom_loaded()})))}F!=null&&F.addEventListener?F.readyState===`complete`?e():ld(F,`DOMContentLoaded`,e,{capture:!1}):P&&K.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}(),ug=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},Q=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},dg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},fg,pg,mg,$,hg,gg,_g,vg,yg,bg,xg,Sg,Cg,wg,Tg,Eg,Dg,Og,kg,Ag,jg=globalThis.HTMLElement||null,Mg=`assign`in(globalThis.HTMLSlotElement?.prototype||{})?(e,...t)=>{e.assign(...t)}:(e,...t)=>{let n=e.getRootNode().host;for(let t of n.querySelectorAll(`[slot="${e.name}"]`))t.removeAttribute(`slot`);for(let n of t)n.setAttribute(`slot`,e.name)},Ng=class extends Event{constructor(e,t){var{tabIndex:n,tab:r,panel:i}=t,a=dg(t,[`tabIndex`,`tab`,`panel`]);super(e,a),fg.set(this,null),pg.set(this,null),mg.set(this,null),ug(this,mg,r||null,`f`),ug(this,fg,n||null,`f`),ug(this,pg,i||null,`f`)}get detail(){return console.warn(`TabContainerElement.detail is deprecated, please use .panel instead`),{relatedTarget:Q(this,pg,`f`)}}get tabIndex(){return Q(this,fg,`f`)}get panel(){return Q(this,pg,`f`)}get tab(){return Q(this,mg,`f`)}};fg=new WeakMap,pg=new WeakMap,mg=new WeakMap;var Pg=class extends jg{constructor(){super(...arguments),$.add(this),hg.set(this,null),gg.set(this,null),Eg.set(this,!1),Dg.set(this,void 0)}static define(e=`tab-container`,t=customElements){return t.define(e,this),this}get onChange(){return this.onTabContainerChange}set onChange(e){this.onTabContainerChange=e}get onTabContainerChange(){return Q(this,hg,`f`)}set onTabContainerChange(e){Q(this,hg,`f`)&&this.removeEventListener(`tab-container-change`,Q(this,hg,`f`)),ug(this,hg,typeof e==`object`||typeof e==`function`?e:null,`f`),typeof e==`function`&&this.addEventListener(`tab-container-change`,e)}get onTabContainerChanged(){return Q(this,gg,`f`)}set onTabContainerChanged(e){Q(this,gg,`f`)&&this.removeEventListener(`tab-container-changed`,Q(this,gg,`f`)),ug(this,gg,typeof e==`object`||typeof e==`function`?e:null,`f`),typeof e==`function`&&this.addEventListener(`tab-container-changed`,e)}get onChanged(){return this.onTabContainerChanged}set onChanged(e){this.onTabContainerChanged=e}get activeTab(){return Q(this,$,`a`,Tg)[this.selectedTabIndex]}get activePanel(){return Q(this,$,`a`,wg).assignedNodes()[0]}get vertical(){return Q(this,$,`a`,_g)?.getAttribute(`aria-orientation`)===`vertical`}set vertical(e){let t=Q(this,$,`a`,_g);t&&e?t.setAttribute(`aria-orientation`,`vertical`):t.setAttribute(`aria-orientation`,`horizontal`)}connectedCallback(){ug(this,Dg,Q(this,Dg,`f`)||(this.attachInternals?this.attachInternals():null),`f`);let e=this.shadowRoot||this.attachShadow({mode:`open`,slotAssignment:`manual`}),t=document.createElement(`slot`);t.style.display=`flex`,t.setAttribute(`part`,`tablist-wrapper`),t.setAttribute(`name`,`tablist-wrapper`);let n=document.createElement(`div`);n.setAttribute(`part`,`tablist-tab-wrapper`),n.setAttribute(`name`,`tablist-tab-wrapper`);let r=document.createElement(`slot`);r.setAttribute(`part`,`tablist`),r.setAttribute(`name`,`tablist`),n.append(r);let i=document.createElement(`slot`);i.setAttribute(`part`,`panel`),i.setAttribute(`name`,`panel`);let a=document.createElement(`slot`);a.setAttribute(`part`,`before-tabs`),a.setAttribute(`name`,`before-tabs`);let o=document.createElement(`slot`);o.setAttribute(`part`,`after-tabs`),o.setAttribute(`name`,`after-tabs`),t.append(a,n,o);let s=document.createElement(`slot`);if(s.setAttribute(`part`,`after-panels`),s.setAttribute(`name`,`after-panels`),e.replaceChildren(t,i,s),Q(this,Dg,`f`)&&`role`in Q(this,Dg,`f`)?Q(this,Dg,`f`).role=`presentation`:this.setAttribute(`role`,`presentation`),this.addEventListener(`ke
7ydown`,this),this.addEventListener(`click`,this),this.selectTab(-1),!Q(this,Eg,`f`)){let e=new MutationObserver(()=>{this.selectTab(-1),Q(this,Eg,`f`)&&e.disconnect()});e.observe(this,{childList:!0,subtree:!0})}}attributeChangedCallback(e){!this.isConnected||!this.shadowRoot||e===`vertical`&&(this.vertical=this.hasAttribute(`vertical`))}handleEvent(e){if(e.type===`click`)return Q(this,$,`m`,kg).call(this,e);if(e.type===`keydown`)return Q(this,$,`m`,Og).call(this,e)}get selectedTabIndex(){return Q(this,$,`a`,Tg).findIndex(e=>e.matches(`[aria-selected=true]`))}set selectedTabIndex(e){this.selectTab(e)}get defaultTabIndex(){return Number(this.getAttribute(`default-tab`)||-1)}set defaultTabIndex(e){this.setAttribute(`default-tab`,String(e))}selectTab(e,t={}){let{focus:n=!0}=t;if(!Q(this,Eg,`f`)){let t=Q(this,$,`a`,Cg),n=Q(this,$,`a`,vg),r=this.querySelector(`[role=tablist]`),i=this.querySelector(`[slot=tablist-wrapper]`);i&&i.closest(this.tagName)===this?Mg(n,i):r&&r.closest(this.tagName)===this?Mg(t,r):(Q(this,$,`a`,yg).role=`tablist`,Mg(t,...[...this.children].filter(e=>e.matches(`[role=tab]`))));let a=Q(this,$,`a`,_g);if(Q(this,$,`m`,Ag).call(this,`aria-description`,a),Q(this,$,`m`,Ag).call(this,`aria-label`,a),this.vertical&&Q(this,$,`a`,_g).setAttribute(`aria-orientation`,`vertical`),this.querySelector(`[slot=tablist-wrapper]`)?.closest(this.tagName)!==this){let e=[],t=[],n=[],r=e;for(let i of this.children){if(i.getAttribute(`role`)===`tab`||i.getAttribute(`role`)===`tablist`){r=t;continue}if(i.getAttribute(`role`)===`tabpanel`){r=n;continue}i.getAttribute(`slot`)===`before-tabs`?e.push(i):i.getAttribute(`slot`)===`after-tabs`?t.push(i):r.push(i)}Mg(Q(this,$,`a`,bg),...e),Mg(Q(this,$,`a`,xg),...t),Mg(Q(this,$,`a`,Sg),...n)}let o=this.defaultTabIndex,s=o>=0?o:this.selectedTabIndex;e=e>=0?e:Math.max(0,s)}let r=Q(this,$,`a`,Tg),i=Array.from(this.querySelectorAll(`[role="tabpanel"]`)).filter(e=>e.closest(this.tagName)===this);if(e>r.length-1)return;let a=r[e],o=i[e];if(a&&o&&!(Q(this,Eg,`f`)&&!this.dispatchEvent(new Ng(`tab-container-change`,{tabIndex:e,bubbles:!0,cancelable:!0,tab:a,panel:o})))){for(let e of r)e.setAttribute(`aria-selected`,`false`),e.setAttribute(`tabindex`,`-1`);for(let e of i)!e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tab-container-no-tabstop`)&&e.setAttribute(`tabindex`,`0`);a.setAttribute(`aria-selected`,`true`),a.setAttribute(`tabindex`,`0`),Mg(Q(this,$,`a`,wg),o),o.hidden=!1,Q(this,Eg,`f`)&&(n&&a.focus(),this.dispatchEvent(new Ng(`tab-container-changed`,{tabIndex:e,bubbles:!0,tab:a,panel:o}))),ug(this,Eg,!0,`f`)}}};hg=new WeakMap,gg=new WeakMap,Eg=new WeakMap,Dg=new WeakMap,$=new WeakSet,_g=function(){let e=this.querySelector(`[slot=tablist-wrapper]`);if(e?.closest(this.tagName)===this)return e.querySelector(`[role=tablist]`);let t=Q(this,$,`a`,Cg);return Q(this,$,`a`,yg).hasAttribute(`role`)?Q(this,$,`a`,yg):t.assignedNodes()[0]},vg=function(){return this.shadowRoot.querySelector(`slot[part="tablist-wrapper"]`)},yg=function(){return this.shadowRoot.querySelector(`div[part="tablist-tab-wrapper"]`)},bg=function(){return this.shadowRoot.querySelector(`slot[part="before-tabs"]`)},xg=function(){return this.shadowRoot.querySelector(`slot[part="after-tabs"]`)},Sg=function(){return this.shadowRoot.querySelector(`slot[part="after-panels"]`)},Cg=function(){return this.shadowRoot.querySelector(`slot[part="tablist"]`)},wg=function(){return this.shadowRoot.querySelector(`slot[part="panel"]`)},Tg=function(){return Q(this,$,`a`,yg).matches(`[role=tablist]`)?Q(this,$,`a`,Cg).assignedNodes():Array.from(Q(this,$,`a`,_g)?.querySelectorAll(`[role="tab"]`)||[]).filter(e=>e instanceof jg&&e.closest(this.tagName)===this)},Og=function(e){var t;let n=((t=e.target)?.closest)?.call(t,`[role="tab"]`);if(!n)return;let r=Q(this,$,`a`,Tg);if(!r.includes(n))return;let i=this.selectedTabIndex,a=n.closest(`[role="tablist"]`)?.getAttribute(`aria-orientation`)===`vertical`,o=e.code===`ArrowLeft`||a&&e.code===`ArrowUp`;if(e.code===`ArrowRight`||a&&e.code===`ArrowDown`){let e=i+1;e>=r.length&&(e=0),this.selectTab(e)}else if(o){let e=i-1;e<0&&(e=r.length-1),this.selectTab(e)}else e.code===`Home`?(this.selectTab(0),e.preventDefault()):e.code===`End`&&(this.selectTab(r.length-1),e.preventDefault())},kg=function(e){var t;let n=((t=e.target)?.closest)?.call(t,`[role=tab]`);if(!n)return;let r=Q(this,$,`a`,Tg).indexOf(n);r>=0&&this.selectTab(r)},Ag=function(e,t){this.hasAttribute(e)&&(t.setAttribute(e,this.getAttribute(e)),this.removeAttribute(e))},Pg.observedAttributes=[`vertical`];var Fg=typeof globalThis<`u`?globalThis:window;try{Fg.TabContainerElement=Pg.define()}catch(e){if(!(Fg.DOMException&&e instanceof DOMException&&e.name===`NotSupportedError`)&&!(e instanceof ReferenceError))throw e}var Ig=`bottom`,Lg=`right`,Rg=`left`,zg=`auto`,Bg=[`top`,Ig,Lg,Rg],Vg=`start`,Hg=`clippingParents`,Ug=`viewport`,Wg=`popper`,Gg=`reference`,Kg=Bg.reduce(function(e,t){return e.concat([t+`-`+Vg,t+`-end`])},[]),qg=[].concat(Bg,[zg]).reduce(function(e,t){return e.concat([t,t+`-`+Vg,t+`-end`])},[]),Jg=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function Yg(e){return e?(e.nodeName||``).toLowerCase():null}function Xg(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Zg(e){return e instanceof Xg(e).Element||e instanceof Element}function Qg(e){return e instanceof Xg(e).HTMLElement||e instanceof HTMLElement}function $g(e){return typeof ShadowRoot>`u`?!1:e instanceof Xg(e).ShadowRoot||e instanceof ShadowRoot}function e_(e){var t=e.state;
vendor: 4,501 bytes, line 7
7Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!Qg(i)||!Yg(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function t_(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});!Qg(r)||!Yg(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var n_={name:`applyStyles`,enabled:!0,phase:`write`,fn:e_,effect:t_,requires:[`computeStyles`]};function r_(e){return e.split(`-`)[0]}var i_=Math.max,a_=Math.min,o_=Math.round;function s_(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}function c_(){return!/^((?!chrome|android).)*safari/i.test(s_())}function l_(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&Qg(e)&&(i=e.offsetWidth>0&&o_(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&o_(r.height)/e.offsetHeight||1);var o=(Zg(e)?Xg(e):window).visualViewport,s=!c_()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function u_(e){var t=l_(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function d_(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&$g(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function f_(e){return Xg(e).getComputedStyle(e)}function p_(e){return[`table`,`td`,`th`].indexOf(Yg(e))>=0}function m_(e){return((Zg(e)?e.ownerDocument:e.document)||window.document).documentElement}function h_(e){return Yg(e)===`html`?e:e.assignedSlot||e.parentNode||($g(e)?e.host:null)||m_(e)}function g_(e){return!Qg(e)||f_(e).position===`fixed`?null:e.offsetParent}function __(e){var t=/firefox/i.test(s_());if(/Trident/i.test(s_())&&Qg(e)&&f_(e).position===`fixed`)return null;var n=h_(e);for($g(n)&&(n=n.host);Qg(n)&&[`html`,`body`].indexOf(Yg(n))<0;){var r=f_(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function v_(e){for(var t=Xg(e),n=g_(e);n&&p_(n)&&f_(n).position===`static`;)n=g_(n);return n&&(Yg(n)===`html`||Yg(n)===`body`&&f_(n).position===`static`)?t:n||__(e)||t}function y_(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function b_(e,t,n){return i_(e,a_(t,n))}function x_(e,t,n){var r=b_(e,t,n);return r>n?n:r}function S_(){return{top:0,right:0,bottom:0,left:0}}function C_(e){return Object.assign({},S_(),e)}function w_(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var T_=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,C_(typeof e==`number`?w_(e,Bg):e)};function E_(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=r_(n.placement),c=y_(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=T_(i.padding,n),d=u_(a),f=c===`y`?`top`:Rg,p=c===`y`?Ig:Lg,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=v_(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=b_(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function D_(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||d_(t.elements.popper,r)&&(t.elements.arrow=r))}var O_={name:`arrow`,enabled:!0,phase:`main`,fn:E_,effect:D_,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function k_(e){return e.split(`-`)[1]}var A_={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function j_(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:o_(n*i)/i||0,y:o_(r*i)/i||0}}
vendor: 5,515 bytes, line 7
7function M_(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=Rg,b=`top`,x=window;if(l){var S=v_(n),C=`clientHeight`,w=`clientWidth`;if(S===Xg(n)&&(S=m_(n),f_(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=Ig;var T=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=T-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=Lg;var E=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=E-r.width,p*=c?1:-1}}var D=Object.assign({position:s},l&&A_),O=u===!0?j_({x:p,y:h},Xg(n)):{x:p,y:h};if(p=O.x,h=O.y,c){var k;return Object.assign({},D,(k={},k[b]=v?`0`:``,k[y]=_?`0`:``,k.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,k))}return Object.assign({},D,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function N_(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0||r,a=n.adaptive,o=a===void 0||a,s=n.roundOffsets,c=s===void 0||s,l={placement:r_(t.placement),variation:k_(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy===`fixed`};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,M_(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,M_(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var P_={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:N_,data:{}},F_={passive:!0};function I_(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0||i,o=r.resize,s=o===void 0||o,c=Xg(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,F_)}),s&&c.addEventListener(`resize`,n.update,F_),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,F_)}),s&&c.removeEventListener(`resize`,n.update,F_)}}var L_={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:I_,data:{}},R_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function z_(e){return e.replace(/left|right|bottom|top/g,function(e){return R_[e]})}var B_={start:`end`,end:`start`};function V_(e){return e.replace(/start|end/g,function(e){return B_[e]})}function H_(e){var t=Xg(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function U_(e){return l_(m_(e)).left+H_(e).scrollLeft}function W_(e,t){var n=Xg(e),r=m_(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=c_();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+U_(e),y:c}}function G_(e){var t=m_(e),n=H_(e),r=e.ownerDocument?.body,i=i_(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=i_(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+U_(e),s=-n.scrollTop;return f_(r||t).direction===`rtl`&&(o+=i_(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function K_(e){var t=f_(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function q_(e){return[`html`,`body`,`#document`].indexOf(Yg(e))>=0?e.ownerDocument.body:Qg(e)&&K_(e)?e:q_(h_(e))}function J_(e,t){t===void 0&&(t=[]);var n=q_(e),r=n===e.ownerDocument?.body,i=Xg(n),a=r?[i].concat(i.visualViewport||[],K_(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(J_(h_(a)))}function Y_(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function X_(e,t){var n=l_(e,!1,t===`fixed`);return n.top+=e.clientTop,n.left+=e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Z_(e,t,n){return t===`viewport`?Y_(W_(e,n)):Zg(t)?X_(t,n):Y_(G_(m_(e)))}function Q_(e){var t=J_(h_(e)),n=[`absolute`,`fixed`].indexOf(f_(e).position)>=0&&Qg(e)?v_(e):e;return Zg(n)?t.filter(function(e){return Zg(e)&&d_(e,n)&&Yg(e)!==`body`}):[]}function $_(e,t,n,r){var i=t===`clippingParents`?Q_(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=Z_(e,n,r);return t.top=i_(i.top,t.top),t.right=a_(i.right,t.right),t.bottom=a_(i.bottom,t.bottom),t.left=i_(i.left,t.left),t},Z_(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function ev(e){var t=e.reference,n=e.element,r=e.placement,i=r?r_(r):null,a=r?k_(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case Ig:c={x:o,y:t.y+t.height};break;case Lg:c={x:t.x+t.width,y:s};break;case Rg:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?y_(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case Vg:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2)}}return c}function tv(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?Hg:s,l=n.rootBoundary,u=l===void 0?Ug:l,d=n.elementContext,f
vendor: 4,134 bytes, line 7
7=d===void 0?Wg:d,p=n.altBoundary,m=p!==void 0&&p,h=n.padding,g=h===void 0?0:h,_=C_(typeof g==`number`?w_(g,Bg):g),v=f===`popper`?Gg:Wg,y=e.rects.popper,b=e.elements[m?v:f],x=$_(Zg(b)?b:b.contextElement||m_(e.elements.popper),c,u,o),S=l_(e.elements.reference),C=ev({reference:S,element:y,strategy:`absolute`,placement:i}),w=Y_(Object.assign({},y,C)),T=f===`popper`?w:S,E={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},D=e.modifiersData.offset;if(f===`popper`&&D){var O=D[i];Object.keys(E).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;E[e]+=O[n]*t})}return E}function nv(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?qg:c,u=k_(r),d=u?s?Kg:Kg.filter(function(e){return k_(e)===u}):Bg,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=tv(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[r_(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function rv(e){if(r_(e)===`auto`)return[];var t=z_(e);return[V_(e),t,V_(t)]}function iv(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o===void 0||o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0||p,h=n.allowedAutoPlacements,g=t.options.placement,_=r_(g)===g,v=c||(_||!m?[z_(g)]:rv(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(r_(n)===`auto`?nv(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=new Map,C=!0,w=y[0],T=0;T<y.length;T++){var E=y[T],D=r_(E),O=k_(E)===Vg,k=[`top`,Ig].indexOf(D)>=0,ee=k?`width`:`height`,te=tv(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),ne=k?O?Lg:Rg:O?Ig:`top`;b[ee]>x[ee]&&(ne=z_(ne));var A=z_(ne),re=[];if(a&&re.push(te[D]<=0),s&&re.push(te[ne]<=0,te[A]<=0),re.every(function(e){return e})){w=E,C=!1;break}S.set(E,re)}if(C)for(var ie=m?3:1,ae=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},oe=ie;oe>0&&ae(oe)!==`break`;oe--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var av={name:`flip`,enabled:!0,phase:`main`,fn:iv,requiresIfExists:[`offset`],data:{_skip:!1}};function ov(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function sv(e){return[`top`,Lg,Ig,Rg].some(function(t){return e[t]>=0})}function cv(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=tv(t,{elementContext:`reference`}),s=tv(t,{altBoundary:!0}),c=ov(o,r),l=ov(s,i,a),u=sv(c),d=sv(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var lv={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:cv};function uv(e,t,n){var r=r_(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function dv(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=qg.reduce(function(e,n){return e[n]=uv(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var fv={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:dv};function pv(e){var t=e.state,n=e.name;t.modifiersData[n]=ev({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var mv={name:`popperOffsets`,enabled:!0,phase:`read`,fn:pv,data:{}};function hv(e){return e===`x`?`y`:`x`}
vendor: 4,141 bytes, line 7
7function gv(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o!==void 0&&o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0||f,m=n.tetherOffset,h=m===void 0?0:m,g=tv(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=r_(t.placement),v=k_(t.placement),y=!v,b=y_(_),x=hv(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,T=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,E=typeof T==`number`?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(S){if(a){var k=b===`y`?`top`:Rg,ee=b===`y`?Ig:Lg,te=b===`y`?`height`:`width`,ne=S[b],A=ne+g[k],re=ne-g[ee],ie=p?-w[te]/2:0,ae=v===`start`?C[te]:w[te],oe=v===`start`?-w[te]:-C[te],j=t.elements.arrow,se=p&&j?u_(j):{width:0,height:0},ce=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:S_(),le=ce[k],ue=ce[ee],de=b_(0,C[te],se[te]),fe=y?C[te]/2-ie-de-le-E.mainAxis:ae-de-le-E.mainAxis,pe=y?-C[te]/2+ie+de+ue+E.mainAxis:oe+de+ue+E.mainAxis,me=t.elements.arrow&&v_(t.elements.arrow),he=me?b===`y`?me.clientTop||0:me.clientLeft||0:0,ge=D?.[b]??0,_e=ne+fe-ge-he,ve=ne+pe-ge,ye=b_(p?a_(A,_e):A,ne,p?i_(re,ve):re);S[b]=ye,O[b]=ye-ne}if(s){var be=b===`x`?`top`:Rg,xe=b===`x`?Ig:Lg,Se=S[x],Ce=x===`y`?`height`:`width`,we=Se+g[be],Te=Se-g[xe],Ee=[`top`,Rg].indexOf(_)!==-1,De=D?.[x]??0,Oe=Ee?we:Se-C[Ce]-w[Ce]-De+E.altAxis,ke=Ee?Se+C[Ce]+w[Ce]-De-E.altAxis:Te,Ae=p&&Ee?x_(Oe,Se,ke):b_(p?Oe:we,Se,p?ke:Te);S[x]=Ae,O[x]=Ae-Se}t.modifiersData[r]=O}}var _v={name:`preventOverflow`,enabled:!0,phase:`main`,fn:gv,requiresIfExists:[`offset`]};function vv(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function yv(e){return e===Xg(e)||!Qg(e)?H_(e):vv(e)}function bv(e){var t=e.getBoundingClientRect(),n=o_(t.width)/e.offsetWidth||1,r=o_(t.height)/e.offsetHeight||1;return n!==1||r!==1}function xv(e,t,n){n===void 0&&(n=!1);var r=Qg(t),i=Qg(t)&&bv(t),a=m_(t),o=l_(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((Yg(t)!==`body`||K_(a))&&(s=yv(t)),Qg(t)?(c=l_(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=U_(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function Sv(e){var t=new Map,n=new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function Cv(e){var t=Sv(e);return Jg.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function wv(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function Tv(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var Ev={placement:`bottom`,modifiers:[],strategy:`absolute`};function Dv(){return![...arguments].some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function Ov(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?Ev:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},Ev,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:Zg(e)?J_(e):e.contextElement?J_(e.contextElement):[],popper:J_(t)};var s=Cv(Tv([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(Dv(t,n)){i.rects={reference:xv(t,v_(n),i.options.strategy===`fixed`),popper:u_(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEac
7h(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++){if(i.reset===!0){i.reset=!1,r=-1;continue}var a=i.orderedModifiers[r],o=a.fn,l=a.options,u=l===void 0?{}:l,d=a.name;typeof o==`function`&&(i=o({state:i,options:u,name:d,instance:c})||i)}}}},update:wv(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!Dv(e,t))return c;c.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)});function l(){i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=n===void 0?{}:n,a=e.effect;if(typeof a==`function`){var s=a({state:i,name:t,instance:c,options:r});o.push(s||function(){})}})}function u(){o.forEach(function(e){return e()}),o=[]}return c}}var kv=Ov({defaultModifiers:[L_,mv,P_,n_,fv,av,_v,O_,lv]}),Av=`tippy-box`,jv=`tippy-content`,Mv=`tippy-backdrop`,Nv=`tippy-arrow`,Pv=`tippy-svg-arrow`,Fv={passive:!0,capture:!0},Iv=function(){return document.body};function Lv(e,t,n){return Array.isArray(e)?e[t]??(Array.isArray(n)?n[t]:n):e}function Rv(e,t){var n={}.toString.call(e);return n.indexOf(`[object`)===0&&n.indexOf(t+`]`)>-1}function zv(e,t){return typeof e==`function`?e.apply(void 0,t):e}function Bv(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function Vv(e){return e.split(/\s+/).filter(Boolean)}function Hv(e){return[].concat(e)}function Uv(e,t){e.indexOf(t)===-1&&e.push(t)}function Wv(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function Gv(e){return e.split(`-`)[0]}function Kv(e){return[].slice.call(e)}function qv(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Jv(){return document.createElement(`div`)}function Yv(e){return[`Element`,`Fragment`].some(function(t){return Rv(e,t)})}function Xv(e){return Rv(e,`NodeList`)}function Zv(e){return Rv(e,`MouseEvent`)}function Qv(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function $v(e){return Yv(e)?[e]:Xv(e)?Kv(e):Array.isArray(e)?e:Kv(document.querySelectorAll(e))}function ey(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+`ms`)})}function ty(e,t){e.forEach(function(e){e&&e.setAttribute(`data-state`,t)})}function ny(e){var t,n=Hv(e)[0];return n!=null&&(t=n.ownerDocument)!=null&&t.body?n.ownerDocument:document}function ry(e,t){var n=t.clientX,r=t.clientY;return e.every(function(e){var t=e.popperRect,i=e.popperState,a=e.props.interactiveBorder,o=Gv(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c=o===`bottom`?s.top.y:0,l=o===`top`?s.bottom.y:0,u=o===`right`?s.left.x:0,d=o===`left`?s.right.x:0,f=t.top-r+c>a,p=r-t.bottom-l>a,m=t.left-n+u>a,h=n-t.right-d>a;return f||p||m||h})}function iy(e,t,n){var r=t+`EventListener`;[`transitionend`,`webkitTransitionEnd`].forEach(function(t){e[r](t,n)})}function ay(e,t){for(var n=t;n;){if(e.contains(n))return!0;n=n.getRootNode==null?void 0:n.getRootNode()?.host}return!1}var oy={isTouch:!1},sy=0;function cy(){oy.isTouch||(oy.isTouch=!0,window.performance&&document.addEventListener(`mousemove`,ly))}function ly(){var e=performance.now();e-sy<20&&(oy.isTouch=!1,document.removeEventListener(`mousemove`,ly)),sy=e}function uy(){var e=document.activeElement;if(Qv(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function dy(){document.addEventListener(`touchstart`,cy,Fv),window.addEventListener(`blur`,uy)}var fy=typeof window<`u`&&typeof document<`u`&&!!window.msCrypto,py=Object.assign({appendTo:Iv,aria:{content:`auto`,expanded:`auto`},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:``,offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:`top`,plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:`mouseenter focus`,triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:`fade`,arrow:!0,content:``,inertia:!1,maxWidth:350,role:`tooltip`,theme:``,zIndex:9999}),my=Object.keys(py),hy=function(e){Object.keys(e).forEach(function(t){py[t]=e[t]})};function gy(e){var t=(e.plugins||[]).reduce(function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=e[r]===void 0?py[r]??i:e[r]),t},{});return Object.assign({},e,t)}
vendor: 6,499 bytes, line 7
7function _y(e,t){return(t?Object.keys(gy(Object.assign({},py,{plugins:t}))):my).reduce(function(t,n){var r=(e.getAttribute(`data-tippy-`+n)||``).trim();if(!r)return t;if(n===`content`)t[n]=r;else try{t[n]=JSON.parse(r)}catch{t[n]=r}return t},{})}function vy(e,t){var n=Object.assign({},t,{content:zv(t.content,[e])},t.ignoreAttributes?{}:_y(e,t.plugins));return n.aria=Object.assign({},py.aria,n.aria),n.aria={expanded:n.aria.expanded===`auto`?t.interactive:n.aria.expanded,content:n.aria.content===`auto`?t.interactive?null:`describedby`:n.aria.content},n}var yy=function(){return`innerHTML`};function by(e,t){e[yy()]=t}function xy(e){var t=Jv();return e===!0?t.className=Nv:(t.className=Pv,Yv(e)?t.appendChild(e):by(t,e)),t}function Sy(e,t){Yv(t.content)?(by(e,``),e.appendChild(t.content)):typeof t.content!=`function`&&(t.allowHTML?by(e,t.content):e.textContent=t.content)}function Cy(e){var t=e.firstElementChild,n=Kv(t.children);return{box:t,content:n.find(function(e){return e.classList.contains(jv)}),arrow:n.find(function(e){return e.classList.contains(Nv)||e.classList.contains(Pv)}),backdrop:n.find(function(e){return e.classList.contains(Mv)})}}function wy(e){var t=Jv(),n=Jv();n.className=Av,n.setAttribute(`data-state`,`hidden`),n.setAttribute(`tabindex`,`-1`);var r=Jv();r.className=jv,r.setAttribute(`data-state`,`hidden`),Sy(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(n,r){var i=Cy(t),a=i.box,o=i.content,s=i.arrow;r.theme?a.setAttribute(`data-theme`,r.theme):a.removeAttribute(`data-theme`),typeof r.animation==`string`?a.setAttribute(`data-animation`,r.animation):a.removeAttribute(`data-animation`),r.inertia?a.setAttribute(`data-inertia`,``):a.removeAttribute(`data-inertia`),a.style.maxWidth=typeof r.maxWidth==`number`?r.maxWidth+`px`:r.maxWidth,r.role?a.setAttribute(`role`,r.role):a.removeAttribute(`role`),(n.content!==r.content||n.allowHTML!==r.allowHTML)&&Sy(o,e.props),r.arrow?s?n.arrow!==r.arrow&&(a.removeChild(s),a.appendChild(xy(r.arrow))):a.appendChild(xy(r.arrow)):s&&a.removeChild(s)}return{popper:t,onUpdate:i}}wy.$$tippy=!0;var Ty=1,Ey=[],Dy=[];function Oy(e,t){var n=vy(e,Object.assign({},py,gy(qv(t)))),r,i,a,o=!1,s=!1,c=!1,l=!1,u,d,f,p=[],m=Bv(_e,n.interactiveDebounce),h,g=Ty++,_=null,v=Wv(n.plugins),y={id:g,reference:e,popper:Jv(),popperInstance:_,props:n,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:v,clearDelayTimeouts:ke,setProps:Ae,setContent:je,show:Me,hide:Ne,hideWithInteractivity:Pe,enable:De,disable:Oe,unmount:Fe,destroy:Ie};if(!n.render)return y;var b=n.render(y),x=b.popper,S=b.onUpdate;x.setAttribute(`data-tippy-root`,``),x.id=`tippy-`+y.id,y.popper=x,e._tippy=y,x._tippy=y;var C=v.map(function(e){return e.fn(y)}),w=e.hasAttribute(`aria-expanded`);return me(),ie(),ne(),A(`onCreate`,[y]),n.showOnCreate&&Te(),x.addEventListener(`mouseenter`,function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),x.addEventListener(`mouseleave`,function(){y.props.interactive&&y.props.trigger.indexOf(`mouseenter`)>=0&&k().addEventListener(`mousemove`,m)}),y;function T(){var e=y.props.touch;return Array.isArray(e)?e:[e,0]}function E(){return T()[0]===`hold`}function D(){var e;return!!((e=y.props.render)!=null&&e.$$tippy)}function O(){return h||e}function k(){var e=O().parentNode;return e?ny(e):document}function ee(){return Cy(x)}function te(e){return y.state.isMounted&&!y.state.isVisible||oy.isTouch||u&&u.type===`focus`?0:Lv(y.props.delay,+!e,py.delay)}function ne(e){e===void 0&&(e=!1),x.style.pointerEvents=y.props.interactive&&!e?``:`none`,x.style.zIndex=``+y.props.zIndex}function A(e,t,n){if(n===void 0&&(n=!0),C.forEach(function(n){n[e]&&n[e].apply(n,t)}),n){var r;(r=y.props)[e].apply(r,t)}}function re(){var t=y.props.aria;if(t.content){var n=`aria-`+t.content,r=x.id;Hv(y.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(n);if(y.state.isVisible)e.setAttribute(n,t?t+` `+r:r);else{var i=t&&t.replace(r,``).trim();i?e.setAttribute(n,i):e.removeAttribute(n)}})}}function ie(){w||!y.props.aria.expanded||Hv(y.props.triggerTarget||e).forEach(function(e){y.props.interactive?e.setAttribute(`aria-expanded`,y.state.isVisible&&e===O()?`true`:`false`):e.removeAttribute(`aria-expanded`)})}function ae(){k().removeEventListener(`mousemove`,m),Ey=Ey.filter(function(e){return e!==m})}function oe(t){if(!(oy.isTouch&&(c||t.type===`mousedown`))){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!(y.props.interactive&&ay(x,n))){if(Hv(y.props.triggerTarget||e).some(function(e){return ay(e,n)})){if(oy.isTouch||y.state.isVisible&&y.props.trigger.indexOf(`click`)>=0)return}else A(`onClickOutside`,[y,t]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),s=!0,setTimeout(function(){s=!1}),y.state.isMounted||le())}}}function j(){c=!0}function se(){c=!1}function ce(){var e=k();e.addEventListener(`mousedown`,oe,!0),e.addEventListener(`touchend`,oe,Fv),e.addEventListener(`touchstart`,se,Fv),e.addEventListener(`touchmove`,j,Fv)}function le(){var e=k();e.removeEventListener(`mousedown`,oe,!0),e.removeEventListener(`touchend`,oe,Fv),e.removeEventListener(`touchstart`,se,Fv),e.removeEventListener(`touchmove`,j,Fv)}function ue(e,t){fe(e,function(){!y.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}function de(e,t){fe(e,t)}function fe(e,t){var n=ee().box;function r(e){e.target===n&&(iy(n,`remove`,r),t())}if(e===0)return t();iy(n,`remove`,d),iy(n,`add`,r),d=r}function pe(t,n,r){r===void 0&&(r=!1),Hv(y.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,n,r),p.push({node:e,eventType:t,handler:n,options:r})})}function me(){E()&&(pe(`touchstart`,ge,{passive:!0}),pe(`touchend`,ve,{passive:!0})),Vv(y.props.trigger).forEach(function(e){if(e!==`manual`)switch(pe(e,ge),e){case`mouseenter`:pe(`mouseleave`,ve);break;case`focus`:pe(fy?`focusout`:`blur`,ye);break;case`focusin`:pe(`focusout`,ye)}})}function he(){p.forEach(function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)}),p=[]}function ge(e){var t=!1;if(!(!y.state.isEnabled||be(e)||s)){var n=u?.type===`focus`;u=e,h=e.currentTarget,ie(),!y.state.isVisible&&Zv(e)&&Ey.forEach(function(t){return t(e)}),e.type===`click`&&(y.props.trigger.indexOf(`mouseenter`)<0||o)&&y.props.hideOnClick!==!1&&y.state.isVisible?t=!0:Te(e),e.type===`click`&&(o=!t),t&&!n&&Ee(e)}}function _e(e){var t=e.target,r=O().contains(t)||x.contains(t);e.type===`mousemove`&&r||ry(we().concat(x).map(function(e){var t=e._tippy.popperInstance?.
7state;return t?{popperRect:e.getBoundingClientRect(),popperState:t,props:n}:null}).filter(Boolean),e)&&(ae(),Ee(e))}function ve(e){if(!(be(e)||y.props.trigger.indexOf(`click`)>=0&&o)){if(y.props.interactive){y.hideWithInteractivity(e);return}Ee(e)}}function ye(e){y.props.trigger.indexOf(`focusin`)<0&&e.target!==O()||y.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||Ee(e)}function be(e){return oy.isTouch?E()!==e.type.indexOf(`touch`)>=0:!1}function xe(){Se();var t=y.props,n=t.popperOptions,r=t.placement,i=t.offset,a=t.getReferenceClientRect,o=t.moveTransition,s=D()?Cy(x).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||O()}:e,l=[{name:`offset`,options:{offset:i}},{name:`preventOverflow`,options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:`flip`,options:{padding:5}},{name:`computeStyles`,options:{adaptive:!o}},{name:`$$tippy`,enabled:!0,phase:`beforeWrite`,requires:[`computeStyles`],fn:function(e){var t=e.state;if(D()){var n=ee().box;[`placement`,`reference-hidden`,`escaped`].forEach(function(e){e===`placement`?n.setAttribute(`data-placement`,t.placement):t.attributes.popper[`data-popper-`+e]?n.setAttribute(`data-`+e,``):n.removeAttribute(`data-`+e)}),t.attributes.popper={}}}}];D()&&s&&l.push({name:`arrow`,options:{element:s,padding:3}}),l.push.apply(l,n?.modifiers||[]),y.popperInstance=kv(c,x,Object.assign({},n,{placement:r,onFirstUpdate:f,modifiers:l}))}function Se(){y.popperInstance&&=(y.popperInstance.destroy(),null)}function Ce(){var e=y.props.appendTo,t,n=O();t=y.props.interactive&&e===Iv||e===`parent`?n.parentNode:zv(e,[n]),t.contains(x)||t.appendChild(x),y.state.isMounted=!0,xe()}function we(){return Kv(x.querySelectorAll(`[data-tippy-root]`))}function Te(e){y.clearDelayTimeouts(),e&&A(`onTrigger`,[y,e]),ce();var t=te(!0),n=T(),i=n[0],a=n[1];oy.isTouch&&i===`hold`&&a&&(t=a),t?r=setTimeout(function(){y.show()},t):y.show()}function Ee(e){if(y.clearDelayTimeouts(),A(`onUntrigger`,[y,e]),!y.state.isVisible){le();return}if(!(y.props.trigger.indexOf(`mouseenter`)>=0&&y.props.trigger.indexOf(`click`)>=0&&[`mouseleave`,`mousemove`].indexOf(e.type)>=0&&o)){var t=te(!1);t?i=setTimeout(function(){y.state.isVisible&&y.hide()},t):a=requestAnimationFrame(function(){y.hide()})}}function De(){y.state.isEnabled=!0}function Oe(){y.hide(),y.state.isEnabled=!1}function ke(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(a)}function Ae(t){if(!y.state.isDestroyed){A(`onBeforeUpdate`,[y,t]),he();var n=y.props,r=vy(e,Object.assign({},n,qv(t),{ignoreAttributes:!0}));y.props=r,me(),n.interactiveDebounce!==r.interactiveDebounce&&(ae(),m=Bv(_e,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?Hv(n.triggerTarget).forEach(function(e){e.removeAttribute(`aria-expanded`)}):r.triggerTarget&&e.removeAttribute(`aria-expanded`),ie(),ne(),S&&S(n,r),y.popperInstance&&(xe(),we().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})),A(`onAfterUpdate`,[y,t])}}function je(e){y.setProps({content:e})}function Me(){var e=y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,r=oy.isTouch&&!y.props.touch,i=Lv(y.props.duration,0,py.duration);if(!(e||t||n||r)&&!O().hasAttribute(`disabled`)&&(A(`onShow`,[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,D()&&(x.style.visibility=`visible`),ne(),ce(),y.state.isMounted||(x.style.transition=`none`),D()){var a=ee(),o=a.box,s=a.content;ey([o,s],0)}f=function(){var e;if(!(!y.state.isVisible||l)){if(l=!0,x.offsetHeight,x.style.transition=y.props.moveTransition,D()&&y.props.animation){var t=ee(),n=t.box,r=t.content;ey([n,r],i),ty([n,r],`visible`)}re(),ie(),Uv(Dy,y),(e=y.popperInstance)==null||e.forceUpdate(),A(`onMount`,[y]),y.props.animation&&D()&&de(i,function(){y.state.isShown=!0,A(`onShown`,[y])})}},Ce()}}function Ne(){var e=!y.state.isVisible,t=y.state.isDestroyed,n=!y.state.isEnabled,r=Lv(y.props.duration,1,py.duration);if(!(e||t||n)&&(A(`onHide`,[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,l=!1,o=!1,D()&&(x.style.visibility=`hidden`),ae(),le(),ne(!0),D()){var i=ee(),a=i.box,s=i.content;y.props.animation&&(ey([a,s],r),ty([a,s],`hidden`))}re(),ie(),y.props.animation?D()&&ue(r,y.unmount):y.unmount()}}function Pe(e){k().addEventListener(`mousemove`,m),Uv(Ey,m),m(e)}function Fe(){y.state.isVisible&&y.hide(),y.state.isMounted&&(Se(),we().forEac
7h(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),Dy=Dy.filter(function(e){return e!==y}),y.state.isMounted=!1,A(`onHidden`,[y]))}function Ie(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),he(),delete e._tippy,y.state.isDestroyed=!0,A(`onDestroy`,[y]))}}function ky(e,t){t===void 0&&(t={});var n=py.plugins.concat(t.plugins||[]);dy();var r=Object.assign({},t,{plugins:n}),i=$v(e).reduce(function(e,t){var n=t&&Oy(t,r);return n&&e.push(n),e},[]);return Yv(e)?i[0]:i}ky.defaultProps=py,ky.setDefaultProps=hy,ky.currentInput=oy,Object.assign({},n_,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),ky.setDefaultProps({render:wy});function Ay(e){e.directive(`intersect`,e.skipDuringClone((e,{value:t,expression:n,modifiers:r},{evaluateLater:i,cleanup:a})=>{let o=i(n),s={rootMargin:Ny(r),threshold:jy(r)},c=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting!==(t===`leave`)&&(o(),r.includes(`once`)&&c.disconnect())})},s);c.observe(e),a(()=>{c.disconnect()})}))}function jy(e){if(e.includes(`full`))return .99;if(e.includes(`half`))return .5;if(!e.includes(`threshold`))return 0;let t=e[e.indexOf(`threshold`)+1];return t===`100`?1:t===`0`?0:Number(`.${t}`)}function My(e){let t=e.match(/^(-?[0-9]+)(px|%)?$/);return t?t[1]+(t[2]||`px`):void 0}function Ny(e){let t=`0px 0px 0px 0px`,n=e.indexOf(`margin`);if(n===-1)return t;let r=[];for(let t=1;t<5;t++)r.push(My(e[n+t]||``));return r=r.filter(e=>e!==void 0),r.length?r.join(` `).trim():t}var Py=Ay;lg.init(`phc_zvQ4mNS4qoLR5j33cq4awj9DWNbw66K4PAnxdxjbcdUa`,{api_host:`https://z.adonisjs.com`,person_profiles:`always`,capture_pageview:!0,capture_pageleave:!0,capture_exceptions:!0}),ky(`[data-tippy-content]`),ca.plugin(Py),ca.data(`mvcDemo`,()=>({activeTabIndex:0,init(){this.$root.querySelector(`tab-container`).addEventListener(`tab-container-changed`,e=>{this.activeTabIndex=e.tabIndex?e.tabIndex:0})}})),ca.data(`copyToClipboard`,()=>({copy(e){let t=this.$refs.svgWrapper.innerHTML.trim(),n=e.target.innerText;navigator.clipboard.writeText(t).then(()=>{e.target.innerText=`Copied!`,e.target.classList.add(`text-green-400`),setTimeout(()=>{e.target.classList.remove(`text-green-400`),e.target.innerText=n},1500)})}})),ca.data(`prompt`,function(){return{focused:!1,state:`idle`,copy(){this.state=`copied`,navigator.clipboard.writeText(this.$root.querySelector(`textarea`).value),setTimeout(()=>{this.state=`idle`},1500)}}}),ca.data(`ctc`,function(){return{state:`idle`,copy(){this.state=`copied`;let e=this.$root.querySelector(`pre code`).textContent;navigator.clipboard.writeText(e),setTimeout(()=>{this.state=`idle`},1500)}}}),ca.data(`packagesFilter`,e=>({packages:e,search:``,officialOnly:!1,get filteredPackages(){let e=this.packages;return this.officialOnly&&(e=e.filter(e=>e.type===`official`)),this.search&&this.search.trim()&&(e=new Fo(e,{keys:[`name`,`description`],threshold:.4}).search(this.search).map(e=>e.item)),e},get hasActiveFilters(){return this.search||this.officialOnly},clearFilters(){this.search=``,this.officialOnly=!1}})),ca.data(`trackScroll`,function(){return{scrollListener:null,setActiveTableOfContents(e){let t=Array.from(this.$el.querySelectorAll(`a`)),n=t.slice().reverse().find(e=>{e.hash||console.log(e);let t=document.querySelector(decodeURIComponent(e.hash));if(t)return t.getBoundingClientRect().top<=200})??t[0];t.forEach(t=>{t===n?(t.classList.add(`up-current`),e&&t.scrollIntoView({block:`center`,behavior:`smooth`})):t.classList.remove(`up-current`)})},init(){this.scrollListener=function(){this.setActiveTableOfContents(!1)}.bind(this),this.$nextTick(()=>{this.setActiveTableOfContents(!0),window.addEventListener(`scroll`,this.scrollListener,{passive:!0})})},destroy(){window.removeEventListener(`scroll`,this.scrollListener)}}}),ca.data(`storiesTabs`,function(){return{activeTab:``,init(){let e=Array.from(this.$el.querySelectorAll(`[data-tab-id]`)).map(e=>e.dataset.tabId),t=window.location.hash.replace(`#`,``);this.activeTab=e.includes(t)?t:e[0]??``,e.includes(t)&&this.$nextTick(()=>{this.$el.querySelector(`[data-tab-id="${t}"]`)?.scrollIntoView({block:`nearest`,behavior:`smooth`})}),window.addEventListener(`hashchange`,()=>{let t=window.location.hash.replace(`#`,``);e.includes(t)&&(this.activeTab=t,this.$nextTick(()=>{this.$el.querySelector(`[data-tab-id="${t}"]`)?.scrollIntoView({block:`nearest`,behavior:`smooth`})}))})},setActive(e){this.activeTab=e,history.pushState(null,``,`#`+e)},isActive(e){return this.activeTab===e}}}),ca.start();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.