@pipelab/ui 2.0.0-beta.2 → 2.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{Layout-9RqnMh4C.js → Layout-Bkk2ovhH.js} +2 -2
- package/assets/{accordion-z_8KufSF.js → accordion-oTVLndox.js} +1 -1
- package/assets/{column-Dk1dPG9O.js → column-YbiJ4APz.js} +1 -1
- package/assets/{editor-B63zWhKy.js → editor-DdEIFHUq.js} +1 -1
- package/assets/{index-BgQHAtD4.js → index-D1usxhW_.js} +3 -3
- package/assets/{pages-kD1s6Ego.js → pages-D5QqDhlx.js} +1 -1
- package/assets/{purify-DmEON9A5.js → purify-CDsm8VXD.js} +1 -1
- package/assets/{radiobutton-D6u-BPbv.js → radiobutton-9HgRYe4i.js} +1 -1
- package/assets/{simple-editor-CjV92Vh-.js → simple-editor-DZlLMPLF.js} +1 -1
- package/assets/src-FykJawTA.js +117 -0
- package/assets/{useTour-vykRi2hP.js → useTour-BF3Lwe45.js} +1 -1
- package/assets/{useconfirm-DEZNB38v.js → useconfirm-Dj_QYUTj.js} +1 -1
- package/assets/{usetoast-VMmH7HEi.js → usetoast-Bco-1Xt_.js} +3 -3
- package/index.html +7 -7
- package/package.json +1 -1
- package/assets/src-CTyDq6SD.js +0 -117
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/src-
|
|
2
|
-
import{$ as e,B as t,C as n,E as r,I as i,J as a,K as o,L as s,R as c,S as l,T as u,U as d,W as f,X as p,Y as m,_ as h,a as g,at as _,c as v,d as y,et as b,f as x,g as S,h as C,i as w,it as T,j as E,l as ee,lt as D,o as te,q as ne,rt as O,st as k,tt as re,y as ie}from"./reactivity.esm-bundler-yhMxlGFU.js";import{A as ae,B as oe,C as se,E as ce,F as le,G as ue,H as de,I as A,J as fe,K as pe,L as me,M as j,N as he,O as ge,P as _e,R as ve,S as ye,T as M,U as be,V as xe,W as Se,_ as Ce,a as we,b as Te,c as Ee,d as N,f as De,h as Oe,i as ke,j as Ae,k as je,l as Me,m as Ne,n as Pe,o as Fe,p as P,q as Ie,r as Le,s as Re,t as ze,u as F,v as Be,w as Ve,x as He,y as Ue,z as We}from"./_plugin-vue_export-helper-DnUyRaRw.js";import{D as Ge,_ as Ke,a as qe,i as Je,l as Ye,o as Xe,r as Ze,s as Qe,u as $e,v as et}from"./src-CTyDq6SD.js";import{t as tt}from"./preload-helper-Dd-HcVz_.js";var nt=void 0,rt=typeof window<`u`&&window.trustedTypes;if(rt)try{nt=rt.createPolicy(`vue`,{createHTML:e=>e})}catch{}var it=nt?e=>nt.createHTML(e):e=>e,at=`http://www.w3.org/2000/svg`,ot=`http://www.w3.org/1998/Math/MathML`,st=typeof document<`u`?document:null,ct=st&&st.createElement(`template`),lt={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?st.createElementNS(at,e):t===`mathml`?st.createElementNS(ot,e):n?st.createElement(e,{is:n}):st.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>st.createTextNode(e),createComment:e=>st.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>st.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{ct.innerHTML=it(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=ct.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ut=`transition`,dt=`animation`,ft=Symbol(`_vtc`),pt={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},mt=t({},Le,pt),ht=(e=>(e.displayName=`Transition`,e.props=mt,e))((e,{slots:t})=>ye(Pe,vt(e),t)),gt=(e,t=[])=>{o(e)?e.forEach(e=>e(...t)):e&&e(...t)},_t=e=>e?o(e)?e.some(e=>e.length>1):e.length>1:!1;function vt(e){let n={};for(let t in e)t in pt||(n[t]=e[t]);if(e.css===!1)return n;let{name:r=`v`,type:i,duration:a,enterFromClass:o=`${r}-enter-from`,enterActiveClass:s=`${r}-enter-active`,enterToClass:c=`${r}-enter-to`,appearFromClass:l=o,appearActiveClass:u=s,appearToClass:d=c,leaveFromClass:f=`${r}-leave-from`,leaveActiveClass:p=`${r}-leave-active`,leaveToClass:m=`${r}-leave-to`}=e,h=yt(a),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:T=b}=n,E=(e,t,n,r)=>{e._enterCancelled=r,St(e,t?d:c),St(e,t?u:s),n&&n()},ee=(e,t)=>{e._isLeaving=!1,St(e,f),St(e,m),St(e,p),t&&t()},D=e=>(t,n)=>{let r=e?w:y,a=()=>E(t,e,n);gt(r,[t,a]),Ct(()=>{St(t,e?l:o),xt(t,e?d:c),_t(r)||Tt(t,i,g,a)})};return t(n,{onBeforeEnter(e){gt(v,[e]),xt(e,o),xt(e,s)},onBeforeAppear(e){gt(C,[e]),xt(e,l),xt(e,u)},onEnter:D(!1),onAppear:D(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>ee(e,t);xt(e,f),e._enterCancelled?(xt(e,p),kt()):(kt(),xt(e,p)),Ct(()=>{e._isLeaving&&(St(e,f),xt(e,m),_t(x)||Tt(e,i,_,n))}),gt(x,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),gt(b,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),gt(T,[e])},onLeaveCancelled(e){ee(e),gt(S,[e])}})}function yt(e){if(e==null)return null;if(m(e))return[bt(e.enter),bt(e.leave)];{let t=bt(e);return[t,t]}}function bt(e){return D(e)}function xt(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[ft]||(e[ft]=new Set)).add(t)}function St(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[ft];n&&(n.delete(t),n.size||(e[ft]=void 0))}function Ct(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var wt=0;function Tt(e,t,n,r){let i=e._endId=++wt,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Et(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function Et(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${ut}Delay`),a=r(`${ut}Duration`),o=Dt(i,a),s=r(`${dt}Delay`),c=r(`${dt}Duration`),l=Dt(s,c),u=null,d=0,f=0;t===ut?o>0&&(u=ut,d=o,f=a.length):t===dt?l>0&&(u=dt,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?ut:dt:null,f=u?u===ut?a.length:c.length:0);let p=u===ut&&/\b(transform|all)(,|$)/.test(r(`${ut}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Dt(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>Ot(t)+Ot(e[n])))}function Ot(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function kt(){return document.body.offsetHeight}function At(e,t,n){let r=e[ft];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var jt=Symbol(`_vod`),Mt=Symbol(`_vsh`),Nt={beforeMount(e,{value:t},{transition:n}){e[jt]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Pt(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Pt(e,!0),r.enter(e)):r.leave(e,()=>{Pt(e,!1)}):Pt(e,t))},beforeUnmount(e,{value:t}){Pt(e,t)}};function Pt(e,t){e.style.display=t?e[jt]:`none`,e[Mt]=!t}var Ft=Symbol(``);function It(e){let t=Te();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>Rt(e,n))},r=()=>{let r=e(t.proxy);t.ce?Rt(t.ce,r):Lt(t.subTree,r),n(r)};ge(()=>{_e(r)}),je(()=>{ue(r,i,{flush:`post`});let e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),ae(()=>e.disconnect())})}function Lt(e,t){if(e.shapeFlag&128){let n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Lt(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Rt(e.el,t);else if(e.type===ke)e.children.forEach(e=>Lt(e,t));else if(e.type===we){let{el:n,anchor:r}=e;for(;n&&(Rt(n,t),n!==r);)n=n.nextSibling}}function Rt(e,t){if(e.nodeType===1){let n=e.style,r=``;for(let e in t)n.setProperty(`--${e}`,t[e]),r+=`--${e}: ${t[e]};`;n[Ft]=r}}var zt=/(^|;)\s*display\s*:/;function Bt(e,t,n){let r=e.style,i=b(n),a=!1;if(n&&!i){if(t)if(b(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Ht(r,t,``)}else for(let e in t)n[e]??Ht(r,e,``);for(let e in n)e===`display`&&(a=!0),Ht(r,e,n[e])}else if(i){if(t!==n){let e=r[Ft];e&&(n+=`;`+e),r.cssText=n,a=zt.test(n)}}else t&&e.removeAttribute(`style`);jt in e&&(e[jt]=a?r.display:``,e[Mt]&&(r.display=`none`))}var Vt=/\s*!important$/;function Ht(e,t,n){if(o(n))n.forEach(n=>Ht(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=Gt(e,t);Vt.test(n)?e.setProperty(d(r),n.replace(Vt,``),`important`):e[r]=n}}var Ut=[`Webkit`,`Moz`,`ms`],Wt={};function Gt(e,t){let n=Wt[t];if(n)return n;let r=s(t);if(r!==`filter`&&r in e)return Wt[t]=r;r=c(r);for(let n=0;n<Ut.length;n++){let i=Ut[n]+r;if(i in e)return Wt[t]=i}return t}var Kt=`http://www.w3.org/1999/xlink`;function qt(t,n,r,i,a,o=e(n)){i&&n.startsWith(`xlink:`)?r==null?t.removeAttributeNS(Kt,n.slice(6,n.length)):t.setAttributeNS(Kt,n,r):r==null||o&&!f(r)?t.removeAttribute(n):t.setAttribute(n,o?``:re(r)?String(r):r)}function Jt(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?it(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=f(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Yt(e,t,n,r){e.addEventListener(t,n,r)}function Xt(e,t,n,r){e.removeEventListener(t,n,r)}var Zt=Symbol(`_vei`);function Qt(e,t,n,r,i=null){let a=e[Zt]||(e[Zt]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=en(t);r?Yt(e,n,a[t]=an(r,i),s):o&&(Xt(e,n,o,s),a[t]=void 0)}}var $t=/(?:Once|Passive|Capture)$/;function en(e){let t;if($t.test(e)){t={};let n;for(;n=e.match($t);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===`:`?e.slice(3):d(e.slice(2)),t]}var tn=0,nn=Promise.resolve(),rn=()=>tn||=(nn.then(()=>tn=0),Date.now());function an(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;Ee(on(e,n.value),t,5,[e])};return n.value=e,n.attached=rn(),n}function on(e,t){if(o(t)){let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}else return t}var sn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,cn=(e,t,n,r,i,o)=>{let c=i===`svg`;t===`class`?At(e,r,c):t===`style`?Bt(e,n,r):p(t)?a(t)||Qt(e,t,n,r,o):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):ln(e,t,r,c))?(Jt(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&qt(e,t,r,c,o,t!==`value`)):e._isVueCE&&(/[A-Z]/.test(t)||!b(r))?Jt(e,s(t),r,o,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),qt(e,t,r,c))};function ln(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&sn(t)&&ne(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return sn(t)&&b(n)?!1:t in e}var un=new WeakMap,dn=new WeakMap,fn=Symbol(`_moveCb`),pn=Symbol(`_enterCb`),mn=(e=>(delete e.props.mode,e))({name:`TransitionGroup`,props:t({},mt,{tag:String,moveClass:String}),setup(e,{slots:t}){let r=Te(),i=Se(),a,o;return Ae(()=>{if(!a.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!vn(a[0].el,r.vnode.el,t))return;a.forEach(hn),a.forEach(gn);let n=a.filter(_n);kt(),n.forEach(e=>{let n=e.el,r=n.style;xt(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[fn]=e=>{e&&e.target!==n||(!e||/transform$/.test(e.propertyName))&&(n.removeEventListener(`transitionend`,i),n[fn]=null,St(n,t))};n.addEventListener(`transitionend`,i)})}),()=>{let s=n(e),c=vt(s),l=s.tag||ke;if(a=[],o)for(let e=0;e<o.length;e++){let t=o[e];t.el&&t.el instanceof Element&&(a.push(t),xe(t,oe(t,c,i,r)),un.set(t,t.el.getBoundingClientRect()))}o=t.default?He(t.default()):[];for(let e=0;e<o.length;e++){let t=o[e];t.key!=null&&xe(t,oe(t,c,i,r))}return Be(l,null,o)}}});function hn(e){let t=e.el;t[fn]&&t[fn](),t[pn]&&t[pn]()}function gn(e){dn.set(e,e.el.getBoundingClientRect())}function _n(e){let t=un.get(e),n=dn.get(e),r=t.left-n.left,i=t.top-n.top;if(r||i){let t=e.el.style;return t.transform=t.webkitTransform=`translate(${r}px,${i}px)`,t.transitionDuration=`0s`,e}}function vn(e,t,n){let r=e.cloneNode(),i=e[ft];i&&i.forEach(e=>{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=Et(r);return a.removeChild(r),o}var yn=[`ctrl`,`shift`,`alt`,`meta`],bn={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>yn.some(n=>e[`${n}Key`]&&!t.includes(n))},xn=(e,t)=>{let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=(n,...r)=>{for(let e=0;e<t.length;e++){let r=bn[t[e]];if(r&&r(n,t))return}return e(n,...r)})},Sn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Cn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=n=>{if(!(`key`in n))return;let r=d(n.key);if(t.some(e=>e===r||Sn[e]===r))return e(n)})},wn=t({patchProp:cn},lt),Tn;function En(){return Tn||=Ne(wn)}var Dn=(...e)=>{let t=En().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=kn(e);if(!r)return;let i=t._component;!ne(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,On(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t};function On(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function kn(e){return b(e)?document.querySelector(e):e}function An(...e){if(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(!r)continue;let i=typeof r;if(i===`string`||i===`number`)t.push(r);else if(i===`object`){let e=Array.isArray(r)?[An(...r)]:Object.entries(r).map(([e,t])=>t?e:void 0);t=e.length?t.concat(e.filter(e=>!!e)):t}}return t.join(` `).trim()}}function jn(e,t){return e?e.classList?e.classList.contains(t):RegExp(`(^| )`+t+`( |$)`,`gi`).test(e.className):!1}function Mn(e,t){if(e&&t){let n=t=>{jn(e,t)||(e.classList?e.classList.add(t):e.className+=` `+t)};[t].flat().filter(Boolean).forEach(e=>e.split(` `).forEach(n))}}function Nn(){return window.innerWidth-document.documentElement.offsetWidth}function Pn(e){typeof e==`string`?Mn(document.body,e||`p-overflow-hidden`):(e!=null&&e.variableName&&document.body.style.setProperty(e.variableName,Nn()+`px`),Mn(document.body,e?.className||`p-overflow-hidden`))}function Fn(e){if(e){let t=document.createElement(`a`);if(t.download!==void 0){let{name:n,src:r}=e;return t.setAttribute(`href`,r),t.setAttribute(`download`,n),t.style.display=`none`,document.body.appendChild(t),t.click(),document.body.removeChild(t),!0}}return!1}function In(e,t){let n=new Blob([e],{type:`application/csv;charset=utf-8;`});window.navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(n,t+`.csv`):Fn({name:t+`.csv`,src:URL.createObjectURL(n)})||(e=`data:text/csv;charset=utf-8,`+e,window.open(encodeURI(e)))}function Ln(e,t){if(e&&t){let n=t=>{e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(^|\\b)`+t.split(` `).join(`|`)+`(\\b|$)`,`gi`),` `)};[t].flat().filter(Boolean).forEach(e=>e.split(` `).forEach(n))}}function Rn(e){typeof e==`string`?Ln(document.body,e||`p-overflow-hidden`):(e!=null&&e.variableName&&document.body.style.removeProperty(e.variableName),Ln(document.body,e?.className||`p-overflow-hidden`))}function zn(e){for(let t of document==null?void 0:document.styleSheets)try{for(let n of t?.cssRules)for(let t of n?.style)if(e.test(t))return{name:t,value:n.style.getPropertyValue(t).trim()}}catch{}return null}function Bn(e){let t={width:0,height:0};if(e){let[n,r]=[e.style.visibility,e.style.display],i=e.getBoundingClientRect();e.style.visibility=`hidden`,e.style.display=`block`,t.width=i.width||e.offsetWidth,t.height=i.height||e.offsetHeight,e.style.display=r,e.style.visibility=n}return t}function Vn(){let e=window,t=document,n=t.documentElement,r=t.getElementsByTagName(`body`)[0];return{width:e.innerWidth||n.clientWidth||r.clientWidth,height:e.innerHeight||n.clientHeight||r.clientHeight}}function Hn(e){return e?Math.abs(e.scrollLeft):0}function Un(){let e=document.documentElement;return(window.pageXOffset||Hn(e))-(e.clientLeft||0)}function Wn(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}function Gn(e){return e?getComputedStyle(e).direction===`rtl`:!1}function Kn(e,t,n=!0){if(e){let r=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:Bn(e),i=r.height,a=r.width,o=t.offsetHeight,s=t.offsetWidth,c=t.getBoundingClientRect(),l=Wn(),u=Un(),d=Vn(),f,p,m=`top`;c.top+o+i>d.height?(f=c.top+l-i,m=`bottom`,f<0&&(f=l)):f=o+c.top+l,p=c.left+a>d.width?Math.max(0,c.left+u+s-a):c.left+u,Gn(e)?e.style.insetInlineEnd=p+`px`:e.style.insetInlineStart=p+`px`,e.style.top=f+`px`,e.style.transformOrigin=m,n&&(e.style.marginTop=m===`bottom`?`calc(${zn(/-anchor-gutter$/)?.value??`2px`} * -1)`:zn(/-anchor-gutter$/)?.value??``)}}function qn(e,t){e&&(typeof t==`string`?e.style.cssText=t:Object.entries(t||{}).forEach(([t,n])=>e.style[t]=n))}function Jn(e,t){if(e instanceof HTMLElement){let n=e.offsetWidth;if(t){let t=getComputedStyle(e);n+=parseFloat(t.marginLeft)+parseFloat(t.marginRight)}return n}return 0}function Yn(e,t,n=!0,r=void 0){if(e){let i=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:Bn(e),a=t.offsetHeight,o=t.getBoundingClientRect(),s=Vn(),c,l,u=r??`top`;if(!r&&o.top+a+i.height>s.height?(c=-1*i.height,u=`bottom`,o.top+c<0&&(c=-1*o.top)):c=a,l=i.width>s.width?o.left*-1:o.left+i.width>s.width?(o.left+i.width-s.width)*-1:0,e.style.top=c+`px`,e.style.insetInlineStart=l+`px`,e.style.transformOrigin=u,n){let t=zn(/-anchor-gutter$/)?.value;e.style.marginTop=u===`bottom`?`calc(${t??`2px`} * -1)`:t??``}}}function Xn(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function Zn(e){return!!(e!=null&&e.nodeName&&Xn(e))}function Qn(e){return typeof Element<`u`?e instanceof Element:typeof e==`object`&&!!e&&e.nodeType===1&&typeof e.nodeName==`string`}function $n(){if(window.getSelection){let e=window.getSelection()||{};e.empty?e.empty():e.removeAllRanges&&e.rangeCount>0&&e.getRangeAt(0).getClientRects().length>0&&e.removeAllRanges()}}function er(e,t={}){if(Qn(e)){let n=(t,r)=>{var i;let a=(i=e?.$attrs)!=null&&i[t]?[e?.$attrs?.[t]]:[];return[r].flat().reduce((e,r)=>{if(r!=null){let i=typeof r;if(i===`string`||i===`number`)e.push(r);else if(i===`object`){let i=Array.isArray(r)?n(t,r):Object.entries(r).map(([e,n])=>t===`style`&&(n||n===0)?`${e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}:${n}`:n?e:void 0);e=i.length?e.concat(i.filter(e=>!!e)):e}}return e},a)};Object.entries(t).forEach(([t,r])=>{if(r!=null){let i=t.match(/^on(.+)/);i?e.addEventListener(i[1].toLowerCase(),r):t===`p-bind`||t===`pBind`?er(e,r):(r=t===`class`?[...new Set(n(`class`,r))].join(` `).trim():t===`style`?n(`style`,r).join(`;`).trim():r,(e.$attrs=e.$attrs||{})&&(e.$attrs[t]=r),e.setAttribute(t,r))}})}}function tr(e,t={},...n){if(e){let r=document.createElement(e);return er(r,t),r.append(...n),r}}function nr(e,t){if(e){e.style.opacity=`0`;let n=+new Date,r=`0`,i=function(){r=`${+e.style.opacity+(new Date().getTime()-n)/t}`,e.style.opacity=r,n=+new Date,+r<1&&(`requestAnimationFrame`in window?requestAnimationFrame(i):setTimeout(i,16))};i()}}function rr(e,t){return Qn(e)?Array.from(e.querySelectorAll(t)):[]}function ir(e,t){return Qn(e)?e.matches(t)?e:e.querySelector(t):null}function ar(e,t){e&&document.activeElement!==e&&e.focus(t)}function or(e,t){if(Qn(e)){let n=e.getAttribute(t);return isNaN(n)?n===`true`||n===`false`?n===`true`:n:+n}}function sr(e,t=``){let n=rr(e,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/src-FykJawTA.js","assets/chunk-DECur_0Z.js","assets/preload-helper-Dd-HcVz_.js","assets/chunk-JTKJZQYV-BARLZAHU.js","assets/reactivity.esm-bundler-yhMxlGFU.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,B as t,C as n,E as r,I as i,J as a,K as o,L as s,R as c,S as l,T as u,U as d,W as f,X as p,Y as m,_ as h,a as g,at as _,c as v,d as y,et as b,f as x,g as S,h as C,i as w,it as T,j as E,l as ee,lt as D,o as te,q as ne,rt as O,st as k,tt as re,y as ie}from"./reactivity.esm-bundler-yhMxlGFU.js";import{A as ae,B as oe,C as se,E as ce,F as le,G as ue,H as de,I as A,J as fe,K as pe,L as me,M as j,N as he,O as ge,P as _e,R as ve,S as ye,T as M,U as be,V as xe,W as Se,_ as Ce,a as we,b as Te,c as Ee,d as N,f as De,h as Oe,i as ke,j as Ae,k as je,l as Me,m as Ne,n as Pe,o as Fe,p as P,q as Ie,r as Le,s as Re,t as ze,u as F,v as Be,w as Ve,x as He,y as Ue,z as We}from"./_plugin-vue_export-helper-DnUyRaRw.js";import{D as Ge,_ as Ke,a as qe,i as Je,l as Ye,o as Xe,r as Ze,s as Qe,u as $e,v as et}from"./src-FykJawTA.js";import{t as tt}from"./preload-helper-Dd-HcVz_.js";var nt=void 0,rt=typeof window<`u`&&window.trustedTypes;if(rt)try{nt=rt.createPolicy(`vue`,{createHTML:e=>e})}catch{}var it=nt?e=>nt.createHTML(e):e=>e,at=`http://www.w3.org/2000/svg`,ot=`http://www.w3.org/1998/Math/MathML`,st=typeof document<`u`?document:null,ct=st&&st.createElement(`template`),lt={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?st.createElementNS(at,e):t===`mathml`?st.createElementNS(ot,e):n?st.createElement(e,{is:n}):st.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>st.createTextNode(e),createComment:e=>st.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>st.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{ct.innerHTML=it(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=ct.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ut=`transition`,dt=`animation`,ft=Symbol(`_vtc`),pt={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},mt=t({},Le,pt),ht=(e=>(e.displayName=`Transition`,e.props=mt,e))((e,{slots:t})=>ye(Pe,vt(e),t)),gt=(e,t=[])=>{o(e)?e.forEach(e=>e(...t)):e&&e(...t)},_t=e=>e?o(e)?e.some(e=>e.length>1):e.length>1:!1;function vt(e){let n={};for(let t in e)t in pt||(n[t]=e[t]);if(e.css===!1)return n;let{name:r=`v`,type:i,duration:a,enterFromClass:o=`${r}-enter-from`,enterActiveClass:s=`${r}-enter-active`,enterToClass:c=`${r}-enter-to`,appearFromClass:l=o,appearActiveClass:u=s,appearToClass:d=c,leaveFromClass:f=`${r}-leave-from`,leaveActiveClass:p=`${r}-leave-active`,leaveToClass:m=`${r}-leave-to`}=e,h=yt(a),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:T=b}=n,E=(e,t,n,r)=>{e._enterCancelled=r,St(e,t?d:c),St(e,t?u:s),n&&n()},ee=(e,t)=>{e._isLeaving=!1,St(e,f),St(e,m),St(e,p),t&&t()},D=e=>(t,n)=>{let r=e?w:y,a=()=>E(t,e,n);gt(r,[t,a]),Ct(()=>{St(t,e?l:o),xt(t,e?d:c),_t(r)||Tt(t,i,g,a)})};return t(n,{onBeforeEnter(e){gt(v,[e]),xt(e,o),xt(e,s)},onBeforeAppear(e){gt(C,[e]),xt(e,l),xt(e,u)},onEnter:D(!1),onAppear:D(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>ee(e,t);xt(e,f),e._enterCancelled?(xt(e,p),kt()):(kt(),xt(e,p)),Ct(()=>{e._isLeaving&&(St(e,f),xt(e,m),_t(x)||Tt(e,i,_,n))}),gt(x,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),gt(b,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),gt(T,[e])},onLeaveCancelled(e){ee(e),gt(S,[e])}})}function yt(e){if(e==null)return null;if(m(e))return[bt(e.enter),bt(e.leave)];{let t=bt(e);return[t,t]}}function bt(e){return D(e)}function xt(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[ft]||(e[ft]=new Set)).add(t)}function St(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[ft];n&&(n.delete(t),n.size||(e[ft]=void 0))}function Ct(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var wt=0;function Tt(e,t,n,r){let i=e._endId=++wt,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Et(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function Et(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${ut}Delay`),a=r(`${ut}Duration`),o=Dt(i,a),s=r(`${dt}Delay`),c=r(`${dt}Duration`),l=Dt(s,c),u=null,d=0,f=0;t===ut?o>0&&(u=ut,d=o,f=a.length):t===dt?l>0&&(u=dt,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?ut:dt:null,f=u?u===ut?a.length:c.length:0);let p=u===ut&&/\b(transform|all)(,|$)/.test(r(`${ut}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Dt(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>Ot(t)+Ot(e[n])))}function Ot(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function kt(){return document.body.offsetHeight}function At(e,t,n){let r=e[ft];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var jt=Symbol(`_vod`),Mt=Symbol(`_vsh`),Nt={beforeMount(e,{value:t},{transition:n}){e[jt]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Pt(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Pt(e,!0),r.enter(e)):r.leave(e,()=>{Pt(e,!1)}):Pt(e,t))},beforeUnmount(e,{value:t}){Pt(e,t)}};function Pt(e,t){e.style.display=t?e[jt]:`none`,e[Mt]=!t}var Ft=Symbol(``);function It(e){let t=Te();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>Rt(e,n))},r=()=>{let r=e(t.proxy);t.ce?Rt(t.ce,r):Lt(t.subTree,r),n(r)};ge(()=>{_e(r)}),je(()=>{ue(r,i,{flush:`post`});let e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),ae(()=>e.disconnect())})}function Lt(e,t){if(e.shapeFlag&128){let n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Lt(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Rt(e.el,t);else if(e.type===ke)e.children.forEach(e=>Lt(e,t));else if(e.type===we){let{el:n,anchor:r}=e;for(;n&&(Rt(n,t),n!==r);)n=n.nextSibling}}function Rt(e,t){if(e.nodeType===1){let n=e.style,r=``;for(let e in t)n.setProperty(`--${e}`,t[e]),r+=`--${e}: ${t[e]};`;n[Ft]=r}}var zt=/(^|;)\s*display\s*:/;function Bt(e,t,n){let r=e.style,i=b(n),a=!1;if(n&&!i){if(t)if(b(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Ht(r,t,``)}else for(let e in t)n[e]??Ht(r,e,``);for(let e in n)e===`display`&&(a=!0),Ht(r,e,n[e])}else if(i){if(t!==n){let e=r[Ft];e&&(n+=`;`+e),r.cssText=n,a=zt.test(n)}}else t&&e.removeAttribute(`style`);jt in e&&(e[jt]=a?r.display:``,e[Mt]&&(r.display=`none`))}var Vt=/\s*!important$/;function Ht(e,t,n){if(o(n))n.forEach(n=>Ht(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=Gt(e,t);Vt.test(n)?e.setProperty(d(r),n.replace(Vt,``),`important`):e[r]=n}}var Ut=[`Webkit`,`Moz`,`ms`],Wt={};function Gt(e,t){let n=Wt[t];if(n)return n;let r=s(t);if(r!==`filter`&&r in e)return Wt[t]=r;r=c(r);for(let n=0;n<Ut.length;n++){let i=Ut[n]+r;if(i in e)return Wt[t]=i}return t}var Kt=`http://www.w3.org/1999/xlink`;function qt(t,n,r,i,a,o=e(n)){i&&n.startsWith(`xlink:`)?r==null?t.removeAttributeNS(Kt,n.slice(6,n.length)):t.setAttributeNS(Kt,n,r):r==null||o&&!f(r)?t.removeAttribute(n):t.setAttribute(n,o?``:re(r)?String(r):r)}function Jt(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?it(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=f(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Yt(e,t,n,r){e.addEventListener(t,n,r)}function Xt(e,t,n,r){e.removeEventListener(t,n,r)}var Zt=Symbol(`_vei`);function Qt(e,t,n,r,i=null){let a=e[Zt]||(e[Zt]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=en(t);r?Yt(e,n,a[t]=an(r,i),s):o&&(Xt(e,n,o,s),a[t]=void 0)}}var $t=/(?:Once|Passive|Capture)$/;function en(e){let t;if($t.test(e)){t={};let n;for(;n=e.match($t);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===`:`?e.slice(3):d(e.slice(2)),t]}var tn=0,nn=Promise.resolve(),rn=()=>tn||=(nn.then(()=>tn=0),Date.now());function an(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;Ee(on(e,n.value),t,5,[e])};return n.value=e,n.attached=rn(),n}function on(e,t){if(o(t)){let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}else return t}var sn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,cn=(e,t,n,r,i,o)=>{let c=i===`svg`;t===`class`?At(e,r,c):t===`style`?Bt(e,n,r):p(t)?a(t)||Qt(e,t,n,r,o):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):ln(e,t,r,c))?(Jt(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&qt(e,t,r,c,o,t!==`value`)):e._isVueCE&&(/[A-Z]/.test(t)||!b(r))?Jt(e,s(t),r,o,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),qt(e,t,r,c))};function ln(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&sn(t)&&ne(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return sn(t)&&b(n)?!1:t in e}var un=new WeakMap,dn=new WeakMap,fn=Symbol(`_moveCb`),pn=Symbol(`_enterCb`),mn=(e=>(delete e.props.mode,e))({name:`TransitionGroup`,props:t({},mt,{tag:String,moveClass:String}),setup(e,{slots:t}){let r=Te(),i=Se(),a,o;return Ae(()=>{if(!a.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!vn(a[0].el,r.vnode.el,t))return;a.forEach(hn),a.forEach(gn);let n=a.filter(_n);kt(),n.forEach(e=>{let n=e.el,r=n.style;xt(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[fn]=e=>{e&&e.target!==n||(!e||/transform$/.test(e.propertyName))&&(n.removeEventListener(`transitionend`,i),n[fn]=null,St(n,t))};n.addEventListener(`transitionend`,i)})}),()=>{let s=n(e),c=vt(s),l=s.tag||ke;if(a=[],o)for(let e=0;e<o.length;e++){let t=o[e];t.el&&t.el instanceof Element&&(a.push(t),xe(t,oe(t,c,i,r)),un.set(t,t.el.getBoundingClientRect()))}o=t.default?He(t.default()):[];for(let e=0;e<o.length;e++){let t=o[e];t.key!=null&&xe(t,oe(t,c,i,r))}return Be(l,null,o)}}});function hn(e){let t=e.el;t[fn]&&t[fn](),t[pn]&&t[pn]()}function gn(e){dn.set(e,e.el.getBoundingClientRect())}function _n(e){let t=un.get(e),n=dn.get(e),r=t.left-n.left,i=t.top-n.top;if(r||i){let t=e.el.style;return t.transform=t.webkitTransform=`translate(${r}px,${i}px)`,t.transitionDuration=`0s`,e}}function vn(e,t,n){let r=e.cloneNode(),i=e[ft];i&&i.forEach(e=>{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=Et(r);return a.removeChild(r),o}var yn=[`ctrl`,`shift`,`alt`,`meta`],bn={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>yn.some(n=>e[`${n}Key`]&&!t.includes(n))},xn=(e,t)=>{let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=(n,...r)=>{for(let e=0;e<t.length;e++){let r=bn[t[e]];if(r&&r(n,t))return}return e(n,...r)})},Sn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Cn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=n=>{if(!(`key`in n))return;let r=d(n.key);if(t.some(e=>e===r||Sn[e]===r))return e(n)})},wn=t({patchProp:cn},lt),Tn;function En(){return Tn||=Ne(wn)}var Dn=(...e)=>{let t=En().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=kn(e);if(!r)return;let i=t._component;!ne(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,On(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t};function On(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function kn(e){return b(e)?document.querySelector(e):e}function An(...e){if(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(!r)continue;let i=typeof r;if(i===`string`||i===`number`)t.push(r);else if(i===`object`){let e=Array.isArray(r)?[An(...r)]:Object.entries(r).map(([e,t])=>t?e:void 0);t=e.length?t.concat(e.filter(e=>!!e)):t}}return t.join(` `).trim()}}function jn(e,t){return e?e.classList?e.classList.contains(t):RegExp(`(^| )`+t+`( |$)`,`gi`).test(e.className):!1}function Mn(e,t){if(e&&t){let n=t=>{jn(e,t)||(e.classList?e.classList.add(t):e.className+=` `+t)};[t].flat().filter(Boolean).forEach(e=>e.split(` `).forEach(n))}}function Nn(){return window.innerWidth-document.documentElement.offsetWidth}function Pn(e){typeof e==`string`?Mn(document.body,e||`p-overflow-hidden`):(e!=null&&e.variableName&&document.body.style.setProperty(e.variableName,Nn()+`px`),Mn(document.body,e?.className||`p-overflow-hidden`))}function Fn(e){if(e){let t=document.createElement(`a`);if(t.download!==void 0){let{name:n,src:r}=e;return t.setAttribute(`href`,r),t.setAttribute(`download`,n),t.style.display=`none`,document.body.appendChild(t),t.click(),document.body.removeChild(t),!0}}return!1}function In(e,t){let n=new Blob([e],{type:`application/csv;charset=utf-8;`});window.navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(n,t+`.csv`):Fn({name:t+`.csv`,src:URL.createObjectURL(n)})||(e=`data:text/csv;charset=utf-8,`+e,window.open(encodeURI(e)))}function Ln(e,t){if(e&&t){let n=t=>{e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(^|\\b)`+t.split(` `).join(`|`)+`(\\b|$)`,`gi`),` `)};[t].flat().filter(Boolean).forEach(e=>e.split(` `).forEach(n))}}function Rn(e){typeof e==`string`?Ln(document.body,e||`p-overflow-hidden`):(e!=null&&e.variableName&&document.body.style.removeProperty(e.variableName),Ln(document.body,e?.className||`p-overflow-hidden`))}function zn(e){for(let t of document==null?void 0:document.styleSheets)try{for(let n of t?.cssRules)for(let t of n?.style)if(e.test(t))return{name:t,value:n.style.getPropertyValue(t).trim()}}catch{}return null}function Bn(e){let t={width:0,height:0};if(e){let[n,r]=[e.style.visibility,e.style.display],i=e.getBoundingClientRect();e.style.visibility=`hidden`,e.style.display=`block`,t.width=i.width||e.offsetWidth,t.height=i.height||e.offsetHeight,e.style.display=r,e.style.visibility=n}return t}function Vn(){let e=window,t=document,n=t.documentElement,r=t.getElementsByTagName(`body`)[0];return{width:e.innerWidth||n.clientWidth||r.clientWidth,height:e.innerHeight||n.clientHeight||r.clientHeight}}function Hn(e){return e?Math.abs(e.scrollLeft):0}function Un(){let e=document.documentElement;return(window.pageXOffset||Hn(e))-(e.clientLeft||0)}function Wn(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}function Gn(e){return e?getComputedStyle(e).direction===`rtl`:!1}function Kn(e,t,n=!0){if(e){let r=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:Bn(e),i=r.height,a=r.width,o=t.offsetHeight,s=t.offsetWidth,c=t.getBoundingClientRect(),l=Wn(),u=Un(),d=Vn(),f,p,m=`top`;c.top+o+i>d.height?(f=c.top+l-i,m=`bottom`,f<0&&(f=l)):f=o+c.top+l,p=c.left+a>d.width?Math.max(0,c.left+u+s-a):c.left+u,Gn(e)?e.style.insetInlineEnd=p+`px`:e.style.insetInlineStart=p+`px`,e.style.top=f+`px`,e.style.transformOrigin=m,n&&(e.style.marginTop=m===`bottom`?`calc(${zn(/-anchor-gutter$/)?.value??`2px`} * -1)`:zn(/-anchor-gutter$/)?.value??``)}}function qn(e,t){e&&(typeof t==`string`?e.style.cssText=t:Object.entries(t||{}).forEach(([t,n])=>e.style[t]=n))}function Jn(e,t){if(e instanceof HTMLElement){let n=e.offsetWidth;if(t){let t=getComputedStyle(e);n+=parseFloat(t.marginLeft)+parseFloat(t.marginRight)}return n}return 0}function Yn(e,t,n=!0,r=void 0){if(e){let i=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:Bn(e),a=t.offsetHeight,o=t.getBoundingClientRect(),s=Vn(),c,l,u=r??`top`;if(!r&&o.top+a+i.height>s.height?(c=-1*i.height,u=`bottom`,o.top+c<0&&(c=-1*o.top)):c=a,l=i.width>s.width?o.left*-1:o.left+i.width>s.width?(o.left+i.width-s.width)*-1:0,e.style.top=c+`px`,e.style.insetInlineStart=l+`px`,e.style.transformOrigin=u,n){let t=zn(/-anchor-gutter$/)?.value;e.style.marginTop=u===`bottom`?`calc(${t??`2px`} * -1)`:t??``}}}function Xn(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function Zn(e){return!!(e!=null&&e.nodeName&&Xn(e))}function Qn(e){return typeof Element<`u`?e instanceof Element:typeof e==`object`&&!!e&&e.nodeType===1&&typeof e.nodeName==`string`}function $n(){if(window.getSelection){let e=window.getSelection()||{};e.empty?e.empty():e.removeAllRanges&&e.rangeCount>0&&e.getRangeAt(0).getClientRects().length>0&&e.removeAllRanges()}}function er(e,t={}){if(Qn(e)){let n=(t,r)=>{var i;let a=(i=e?.$attrs)!=null&&i[t]?[e?.$attrs?.[t]]:[];return[r].flat().reduce((e,r)=>{if(r!=null){let i=typeof r;if(i===`string`||i===`number`)e.push(r);else if(i===`object`){let i=Array.isArray(r)?n(t,r):Object.entries(r).map(([e,n])=>t===`style`&&(n||n===0)?`${e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}:${n}`:n?e:void 0);e=i.length?e.concat(i.filter(e=>!!e)):e}}return e},a)};Object.entries(t).forEach(([t,r])=>{if(r!=null){let i=t.match(/^on(.+)/);i?e.addEventListener(i[1].toLowerCase(),r):t===`p-bind`||t===`pBind`?er(e,r):(r=t===`class`?[...new Set(n(`class`,r))].join(` `).trim():t===`style`?n(`style`,r).join(`;`).trim():r,(e.$attrs=e.$attrs||{})&&(e.$attrs[t]=r),e.setAttribute(t,r))}})}}function tr(e,t={},...n){if(e){let r=document.createElement(e);return er(r,t),r.append(...n),r}}function nr(e,t){if(e){e.style.opacity=`0`;let n=+new Date,r=`0`,i=function(){r=`${+e.style.opacity+(new Date().getTime()-n)/t}`,e.style.opacity=r,n=+new Date,+r<1&&(`requestAnimationFrame`in window?requestAnimationFrame(i):setTimeout(i,16))};i()}}function rr(e,t){return Qn(e)?Array.from(e.querySelectorAll(t)):[]}function ir(e,t){return Qn(e)?e.matches(t)?e:e.querySelector(t):null}function ar(e,t){e&&document.activeElement!==e&&e.focus(t)}function or(e,t){if(Qn(e)){let n=e.getAttribute(t);return isNaN(n)?n===`true`||n===`false`?n===`true`:n:+n}}function sr(e,t=``){let n=rr(e,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
3
3
|
[href]:not([tabindex = "-1"]):not([style*="display:none"]):not([hidden])${t},
|
|
4
4
|
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
5
5
|
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
@@ -144,7 +144,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
144
144
|
padding-right: ${t(`scrollbar.width`)};
|
|
145
145
|
}
|
|
146
146
|
`},style:Ji,classes:{},inlineStyles:{},load:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(e){return e})(Ui(aa||=ba([``,``]),e));return I(n)?ra(oi(n),ga({name:this.name},t)):{}},loadCSS:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.load(this.css,e)},loadStyle:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``;return this.load(this.style,t,function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``;return Ki.transformCSS(t.name||e.name,`${r}${Ui(oa||=ba([``,``]),n)}`)})},getCommonTheme:function(e){return Ki.getCommon(this.name,e)},getComponentTheme:function(e){return Ki.getComponent(this.name,e)},getDirectiveTheme:function(e){return Ki.getDirective(this.name,e)},getPresetTheme:function(e,t,n){return Ki.getCustomPreset(this.name,e,t,n)},getLayerOrderThemeCSS:function(){return Ki.getLayerOrderCSS(this.name)},getStyleSheet:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.css){var n=Xr(this.css,{dt:Vi})||``,r=oi(Ui(sa||=ba([``,``,``]),n,e)),i=Object.entries(t).reduce(function(e,t){var n=la(t,2),r=n[0],i=n[1];return e.push(`${r}="${i}"`)&&e},[]).join(` `);return I(r)?`<style type="text/css" data-primevue-style-id="${this.name}" ${i}>${r}</style>`:``}return``},getCommonThemeStyleSheet:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ki.getCommonStyleSheet(this.name,e,t)},getThemeStyleSheet:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[Ki.getStyleSheet(this.name,e,t)];if(this.style){var r=this.name===`base`?`global-style`:`${this.name}-style`,i=Ui(ca||=ba([``,``]),Xr(this.style,{dt:Vi})),a=oi(Ki.transformCSS(r,i)),o=Object.entries(t).reduce(function(e,t){var n=la(t,2),r=n[0],i=n[1];return e.push(`${r}="${i}"`)&&e},[]).join(` `);I(a)&&n.push(`<style type="text/css" data-primevue-style-id="${r}" ${o}>${a}</style>`)}return n.join(``)},extend:function(e){return ga(ga({},this),{},{css:void 0,style:void 0},e)}};function xa(){return`${arguments.length>0&&arguments[0]!==void 0?arguments[0]:`pc`}${be().replace(`v-`,``).replaceAll(`-`,`_`)}`}var Sa=L.extend({name:`common`});function Ca(e){"@babel/helpers - typeof";return Ca=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ca(e)}function wa(e){return ja(e)||Ta(e)||Oa(e)||Da()}function Ta(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Ea(e,t){return ja(e)||Aa(e,t)||Oa(e,t)||Da()}function Da(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
147
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oa(e,t){if(e){if(typeof e==`string`)return ka(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ka(e,t):void 0}}function ka(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Aa(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ja(e){if(Array.isArray(e))return e}function Ma(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ma(Object(n),!0).forEach(function(t){Na(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ma(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Na(e,t,n){return(t=Pa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pa(e){var t=Fa(e,`string`);return Ca(t)==`symbol`?t:t+``}function Fa(e,t){if(Ca(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ca(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Ia={name:`BaseComponent`,props:{pt:{type:Object,default:void 0},ptOptions:{type:Object,default:void 0},unstyled:{type:Boolean,default:void 0},dt:{type:Object,default:void 0}},inject:{$parentInstance:{default:void 0}},watch:{isUnstyled:{immediate:!0,handler:function(e){Ei.off(`theme:change`,this._loadCoreStyles),e||(this._loadCoreStyles(),this._themeChangeListener(this._loadCoreStyles))}},dt:{immediate:!0,handler:function(e,t){var n=this;Ei.off(`theme:change`,this._themeScopedListener),e?(this._loadScopedThemeStyles(e),this._themeScopedListener=function(){return n._loadScopedThemeStyles(e)},this._themeChangeListener(this._themeScopedListener)):this._unloadScopedThemeStyles()}}},scopedStyleEl:void 0,rootEl:void 0,uid:void 0,$attrSelector:void 0,beforeCreate:function(){var e,t,n,r,i,a,o,s,c,l,u=this.pt?._usept,d=u?(e=this.pt)==null||(e=e.originalValue)==null?void 0:e[this.$.type.name]:void 0;(n=(u?(t=this.pt)==null||(t=t.value)==null?void 0:t[this.$.type.name]:this.pt)||d)==null||(n=n.hooks)==null||(r=n.onBeforeCreate)==null||r.call(n);var f=(i=this.$primevueConfig)==null||(i=i.pt)==null?void 0:i._usept,p=f?(a=this.$primevue)==null||(a=a.config)==null||(a=a.pt)==null?void 0:a.originalValue:void 0;(c=(f?(o=this.$primevue)==null||(o=o.config)==null||(o=o.pt)==null?void 0:o.value:(s=this.$primevue)==null||(s=s.config)==null?void 0:s.pt)||p)==null||(c=c[this.$.type.name])==null||(c=c.hooks)==null||(l=c.onBeforeCreate)==null||l.call(c),this.$attrSelector=xa(),this.uid=this.$attrs.id||this.$attrSelector.replace(`pc`,`pv_id_`)},created:function(){this._hook(`onCreated`)},beforeMount:function(){this.rootEl=ir(Qn(this.$el)?this.$el:this.$el?.parentElement,`[${this.$attrSelector}]`),this.rootEl&&(this.rootEl.$pc=R({name:this.$.type.name,attrSelector:this.$attrSelector},this.$params)),this._loadStyles(),this._hook(`onBeforeMount`)},mounted:function(){this._hook(`onMounted`)},beforeUpdate:function(){this._hook(`onBeforeUpdate`)},updated:function(){this._hook(`onUpdated`)},beforeUnmount:function(){this._hook(`onBeforeUnmount`)},unmounted:function(){this._removeThemeListeners(),this._unloadScopedThemeStyles(),this._hook(`onUnmounted`)},methods:{_hook:function(e){if(!this.$options.hostName){var t=this._usePT(this._getPT(this.pt,this.$.type.name),this._getOptionValue,`hooks.${e}`),n=this._useDefaultPT(this._getOptionValue,`hooks.${e}`);t?.(),n?.()}},_mergeProps:function(e){var t=[...arguments].slice(1);return Vr(e)?e.apply(void 0,t):M.apply(void 0,t)},_load:function(){qi.isStyleNameLoaded(`base`)||(L.loadCSS(this.$styleOptions),this._loadGlobalStyles(),qi.setLoadedStyleName(`base`)),this._loadThemeStyles()},_loadStyles:function(){this._load(),this._themeChangeListener(this._load)},_loadCoreStyles:function(){var e;!qi.isStyleNameLoaded(this.$style?.name)&&(e=this.$style)!=null&&e.name&&(Sa.loadCSS(this.$styleOptions),this.$options.style&&this.$style.loadCSS(this.$styleOptions),qi.setLoadedStyleName(this.$style.name))},_loadGlobalStyles:function(){var e=this._useGlobalPT(this._getOptionValue,`global.css`,this.$params);I(e)&&L.load(e,R({name:`global`},this.$styleOptions))},_loadThemeStyles:function(){var e;if(!(this.isUnstyled||this.$theme===`none`)){if(!Ki.isStyleNameLoaded(`common`)){var t,n,r=((t=this.$style)==null||(n=t.getCommonTheme)==null?void 0:n.call(t))||{},i=r.primitive,a=r.semantic,o=r.global,s=r.style;L.load(i?.css,R({name:`primitive-variables`},this.$styleOptions)),L.load(a?.css,R({name:`semantic-variables`},this.$styleOptions)),L.load(o?.css,R({name:`global-variables`},this.$styleOptions)),L.loadStyle(R({name:`global-style`},this.$styleOptions),s),Ki.setLoadedStyleName(`common`)}if(!Ki.isStyleNameLoaded(this.$style?.name)&&(e=this.$style)!=null&&e.name){var c,l,u,d,f=((c=this.$style)==null||(l=c.getComponentTheme)==null?void 0:l.call(c))||{},p=f.css,m=f.style;(u=this.$style)==null||u.load(p,R({name:`${this.$style.name}-variables`},this.$styleOptions)),(d=this.$style)==null||d.loadStyle(R({name:`${this.$style.name}-style`},this.$styleOptions),m),Ki.setLoadedStyleName(this.$style.name)}if(!Ki.isStyleNameLoaded(`layer-order`)){var h,g,_=(h=this.$style)==null||(g=h.getLayerOrderThemeCSS)==null?void 0:g.call(h);L.load(_,R({name:`layer-order`,first:!0},this.$styleOptions)),Ki.setLoadedStyleName(`layer-order`)}}},_loadScopedThemeStyles:function(e){var t,n,r=(((t=this.$style)==null||(n=t.getPresetTheme)==null?void 0:n.call(t,e,`[${this.$attrSelector}]`))||{}).css;this.scopedStyleEl=(this.$style?.load(r,R({name:`${this.$attrSelector}-${this.$style.name}`},this.$styleOptions))).el},_unloadScopedThemeStyles:function(){var e;(e=this.scopedStyleEl)==null||(e=e.value)==null||e.remove()},_themeChangeListener:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};qi.clearLoadedStyleNames(),Ei.on(`theme:change`,e)},_removeThemeListeners:function(){Ei.off(`theme:change`,this._loadCoreStyles),Ei.off(`theme:change`,this._load),Ei.off(`theme:change`,this._themeScopedListener)},_getHostInstance:function(e){return e?this.$options.hostName?e.$.type.name===this.$options.hostName?e:this._getHostInstance(e.$parentInstance):e.$parentInstance:void 0},_getPropValue:function(e){return this[e]||this._getHostInstance(this)?.[e]},_getOptionValue:function(e){return $r(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{})},_getPTValue:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=/./g.test(t)&&!!n[t.split(`.`)[0]],a=this._getPropValue(`ptOptions`)||this.$primevueConfig?.ptOptions||{},o=a.mergeSections,s=o===void 0?!0:o,c=a.mergeProps,l=c===void 0?!1:c,u=r?i?this._useGlobalPT(this._getPTClassValue,t,n):this._useDefaultPT(this._getPTClassValue,t,n):void 0,d=i?void 0:this._getPTSelf(e,this._getPTClassValue,t,R(R({},n),{},{global:u||{}})),f=this._getPTDatasets(t);return s||!s&&d?l?this._mergeProps(l,u,d,f):R(R(R({},u),d),f):R(R({},d),f)},_getPTSelf:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=[...arguments].slice(1);return M(this._usePT.apply(this,[this._getPT(e,this.$name)].concat(t)),this._usePT.apply(this,[this.$_attrsPT].concat(t)))},_getPTDatasets:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=`data-pc-`,n=e===`root`&&I(this.pt?.[`data-pc-section`]);return e!==`transition`&&R(R({},e===`root`&&R(R(Na({},`${t}name`,Qr(n?this.pt?.[`data-pc-section`]:this.$.type.name)),n&&Na({},`${t}extend`,Qr(this.$.type.name))),{},Na({},`${this.$attrSelector}`,``))),{},Na({},`${t}section`,Qr(e)))},_getPTClassValue:function(){var e=this._getOptionValue.apply(this,arguments);return Zr(e)||ei(e)?{class:e}:e},_getPT:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,r=arguments.length>2?arguments[2]:void 0,i=function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=r?r(e):e,o=Qr(n),s=Qr(t.$name);return(i&&o===s?void 0:a?.[o])??a};return e!=null&&e.hasOwnProperty(`_usept`)?{_usept:e._usept,originalValue:i(e.originalValue),value:i(e.value)}:i(e,!0)},_usePT:function(e,t,n,r){var i=function(e){return t(e,n,r)};if(e!=null&&e.hasOwnProperty(`_usept`)){var a=e._usept||this.$primevueConfig?.ptOptions||{},o=a.mergeSections,s=o===void 0?!0:o,c=a.mergeProps,l=c===void 0?!1:c,u=i(e.originalValue),d=i(e.value);return u===void 0&&d===void 0?void 0:Zr(d)?d:Zr(u)?u:s||!s&&d?l?this._mergeProps(l,u,d):R(R({},u),d):d}return i(e)},_useGlobalPT:function(e,t,n){return this._usePT(this.globalPT,e,t,n)},_useDefaultPT:function(e,t,n){return this._usePT(this.defaultPT,e,t,n)},ptm:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._getPTValue(this.pt,e,R(R({},this.$params),t))},ptmi:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=M(this.$_attrsWithoutPT,this.ptm(e,t));return n!=null&&n.hasOwnProperty(`id`)&&(n.id??=this.$id),n},ptmo:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._getPTValue(e,t,R({instance:this},n),!1)},cx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,e,R(R({},this.$params),t))},sx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t){var r=this._getOptionValue(this.$style.inlineStyles,e,R(R({},this.$params),n));return[this._getOptionValue(Sa.inlineStyles,e,R(R({},this.$params),n)),r]}}},computed:{globalPT:function(){var e=this;return this._getPT(this.$primevueConfig?.pt,void 0,function(t){return Xr(t,{instance:e})})},defaultPT:function(){var e=this;return this._getPT(this.$primevueConfig?.pt,void 0,function(t){return e._getOptionValue(t,e.$name,R({},e.$params))||Xr(t,R({},e.$params))})},isUnstyled:function(){return this.unstyled===void 0?this.$primevueConfig?.unstyled:this.unstyled},$id:function(){return this.$attrs.id||this.uid},$inProps:function(){var e=Object.keys(this.$.vnode?.props||{});return Object.fromEntries(Object.entries(this.$props).filter(function(t){var n=Ea(t,1)[0];return e?.includes(n)}))},$theme:function(){return this.$primevueConfig?.theme},$style:function(){return R(R({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadStyle:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var e;return{nonce:(e=this.$primevueConfig)==null||(e=e.csp)==null?void 0:e.nonce}},$primevueConfig:function(){return this.$primevue?.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var e=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:e,props:e?.$props,state:e?.$data,attrs:e?.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){return Ea(e,1)[0]?.startsWith(`pt:`)}).reduce(function(e,t){var n=Ea(t,2),r=n[0],i=n[1];return ka(wa(r.split(`:`))).slice(1)?.reduce(function(e,t,n,r){return!e[t]&&(e[t]=n===r.length-1?i:{}),e[t]},e),e},{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){var t=Ea(e,1)[0];return!(t!=null&&t.startsWith(`pt:`))}).reduce(function(e,t){var n=Ea(t,2),r=n[0];return e[r]=n[1],e},{})}}},La,Ra=e=>La=e,za=Symbol();function Ba(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var Va;(function(e){e.direct=`direct`,e.patchObject=`patch object`,e.patchFunction=`patch function`})(Va||={});var Ha=typeof window<`u`,Ua=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function Wa(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function Ga(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){Xa(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function Ka(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function qa(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=document.createEvent(`MouseEvents`);t.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var Ja=typeof navigator==`object`?navigator:{userAgent:``},Ya=/Macintosh/.test(Ja.userAgent)&&/AppleWebKit/.test(Ja.userAgent)&&!/Safari/.test(Ja.userAgent),Xa=Ha?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Ya?Za:`msSaveOrOpenBlob`in Ja?Qa:$a:()=>{};function Za(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?qa(r):Ka(r.href)?Ga(e,t,n):(r.target=`_blank`,qa(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){qa(r)},0))}function Qa(e,t=`download`,n){if(typeof e==`string`)if(Ka(e))Ga(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){qa(t)})}else navigator.msSaveOrOpenBlob(Wa(e,n),t)}function $a(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return Ga(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Ua.HTMLElement))||`safari`in Ua,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Ya)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:eo}=Object;function to(){let e=g(!0),t=e.run(()=>h({})),n=[],r=[],i=y({install(e){Ra(i),i._a=e,e.provide(za,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var no=()=>{};function ro(e,t,n,r=no){e.push(t);let i=()=>{let n=e.indexOf(t);n>-1&&(e.splice(n,1),r())};return!n&&te()&&x(i),i}function io(e,...t){e.slice().forEach(e=>{e(...t)})}var ao=e=>e(),oo=Symbol(),so=Symbol();function co(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!t.hasOwnProperty(n))continue;let r=t[n],i=e[n];Ba(i)&&Ba(r)&&e.hasOwnProperty(n)&&!ee(r)&&!v(r)?e[n]=co(i,r):e[n]=r}return e}var lo=Symbol();function uo(e){return!Ba(e)||!e.hasOwnProperty(lo)}var{assign:fo}=Object;function po(e){return!!(ee(e)&&e.effect)}function mo(e,t,n,i){let{state:a,actions:o,getters:s}=t,c=n.state.value[e],l;function u(){return c||(n.state.value[e]=a?a():{}),fo(r(n.state.value[e]),o,Object.keys(s||{}).reduce((t,r)=>(t[r]=y(Me(()=>{Ra(n);let t=n._s.get(e);return s[r].call(t,t)})),t),{}))}return l=ho(e,u,t,n,i,!0),l}function ho(e,t,r={},i,a,o){let s,c=fo({actions:{}},r),l={deep:!0},u,d,f=[],p=[],m=i.state.value[e];!o&&!m&&(i.state.value[e]={}),h({});let _;function y(t){let n;u=d=!1,typeof t==`function`?(t(i.state.value[e]),n={type:Va.patchFunction,storeId:e,events:void 0}):(co(i.state.value[e],t),n={type:Va.patchObject,payload:t,storeId:e,events:void 0});let r=_=Symbol();ce().then(()=>{_===r&&(u=!0)}),d=!0,io(f,n,i.state.value[e])}let b=o?function(){let{state:e}=r,t=e?e():{};this.$patch(e=>{fo(e,t)})}:no;function x(){s.stop(),f=[],p=[],i._s.delete(e)}let S=(t,n=``)=>{if(oo in t)return t[so]=n,t;let r=function(){Ra(i);let n=Array.from(arguments),a=[],o=[];function s(e){a.push(e)}function c(e){o.push(e)}io(p,{args:n,name:r[so],store:w,after:s,onError:c});let l;try{l=t.apply(this&&this.$id===e?this:w,n)}catch(e){throw io(o,e),e}return l instanceof Promise?l.then(e=>(io(a,e),e)).catch(e=>(io(o,e),Promise.reject(e))):(io(a,l),l)};return r[oo]=!0,r[so]=n,r},w=C({_p:i,$id:e,$onAction:ro.bind(null,p),$patch:y,$reset:b,$subscribe(t,n={}){let r=ro(f,t,n.detached,()=>a()),a=s.run(()=>ue(()=>i.state.value[e],r=>{(n.flush===`sync`?d:u)&&t({storeId:e,type:Va.direct,events:void 0},r)},fo({},l,n)));return r},$dispose:x});i._s.set(e,w);let T=(i._a&&i._a.runWithContext||ao)(()=>i._e.run(()=>(s=g()).run(()=>t({action:S}))));for(let t in T){let n=T[t];ee(n)&&!po(n)||v(n)?o||(m&&uo(n)&&(ee(n)?n.value=m[t]:co(n,m[t])),i.state.value[e][t]=n):typeof n==`function`&&(T[t]=S(n,t),c.actions[t]=n)}return fo(w,T),fo(n(w),T),Object.defineProperty(w,`$state`,{get:()=>i.state.value[e],set:e=>{y(t=>{fo(t,e)})}}),i._p.forEach(e=>{fo(w,s.run(()=>e({store:w,app:i._a,pinia:i,options:c})))}),m&&o&&r.hydrate&&r.hydrate(w.$state,m),u=!0,d=!0,w}function go(e,t,n){let r,i,a=typeof t==`function`;typeof e==`string`?(r=e,i=a?n:t):(i=e,r=e.id);function o(e,n){let o=se();return e||=o?Ve(za,null):null,e&&Ra(e),e=La,e._s.has(r)||(a?ho(r,t,i,e):mo(r,i,e)),e._s.get(r)}return o.$id=r,o}function _o(e){{e=n(e);let t={};for(let n in e){let r=e[n];(ee(r)||v(r))&&(t[n]=u(e,n))}return t}}function vo(e){return te()?(x(e),!0):!1}function yo(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return vo(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t)))}}function bo(e){return typeof e==`function`?e():E(e)}var xo={mounted:`mounted`,updated:`updated`,unmounted:`unmounted`},So=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var Co=e=>e!=null,wo=Object.prototype.toString,To=e=>wo.call(e)===`[object Object]`,Eo=()=>{},Do=Oo();function Oo(){return So&&(window==null?void 0:window.navigator)?.userAgent&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(window==null?void 0:window.navigator)?.maxTouchPoints>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function ko(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}var Ao=e=>e();function jo(e,t={}){let n,r,i=Eo,a=e=>{clearTimeout(e),i(),i=Eo};return o=>{let s=bo(e),c=bo(t.maxWait);return n&&a(n),s<=0||c!==void 0&&c<=0?(r&&=(a(r),null),Promise.resolve(o())):new Promise((e,l)=>{i=t.rejectOnCancel?l:e,c&&!r&&(r=setTimeout(()=>{n&&a(n),r=null,e(o())},c)),n=setTimeout(()=>{r&&a(r),r=null,e(o())},s)})}}function Mo(...e){let t=0,n,r=!0,i=Eo,a,o,s,c,l;!ee(e[0])&&typeof e[0]==`object`?{delay:o,trailing:s=!0,leading:c=!0,rejectOnCancel:l=!1}=e[0]:[o,s=!0,c=!0,l=!1]=e;let u=()=>{n&&(clearTimeout(n),n=void 0,i(),i=Eo)};return e=>{let d=bo(o),f=Date.now()-t,p=()=>a=e();return u(),d<=0?(t=Date.now(),p()):(f>d&&(c||!r)?(t=Date.now(),p()):s&&(a=new Promise((e,a)=>{i=l?a:e,n=setTimeout(()=>{t=Date.now(),r=!0,e(p()),u()},Math.max(0,d-f))})),!c&&!n&&(n=setTimeout(()=>r=!0,d)),r=!1,a)}}function No(e){return e||Te()}function Po(...e){if(e.length!==1)return u(...e);let t=e[0];return typeof t==`function`?S(w(()=>({get:t,set:Eo}))):h(t)}function Fo(e,t=200,n={}){return ko(jo(t,n),e)}function Io(e,t=200,n=!1,r=!0,i=!1){return ko(Mo(t,n,r,i),e)}function Lo(e,t,n={}){let{eventFilter:r=Ao,...i}=n;return ue(e,ko(r,t),i)}function Ro(e,t=!0,n){No()?je(e,n):t?e():ce(e)}function zo(e,t){No(t)&&ae(e,t)}function Bo(e,t,n={}){let{throttle:r=0,trailing:i=!0,leading:a=!0,...o}=n;return Lo(e,t,{...o,eventFilter:Mo(r,i,a)})}function Vo(e,t,n){let r;r=ee(n)?{evaluating:n}:n||{};let{lazy:i=!1,evaluating:a=void 0,shallow:o=!0,onError:s=Eo}=r,c=h(!i),u=o?l(t):h(t),d=0;return pe(async t=>{if(!c.value)return;d++;let n=d,r=!1;a&&Promise.resolve().then(()=>{a.value=!0});try{let i=await e(e=>{t(()=>{a&&(a.value=!1),r||e()})});n===d&&(u.value=i)}catch(e){s(e)}finally{a&&n===d&&(a.value=!1),r=!0}}),i?Me(()=>(c.value=!0,u.value)):u}So&&window.document,So&&window.navigator,So&&window.location;var Ho=33753,Uo=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,Wo=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=Uo[n[e]&63];return t},Go=class{ws=null;listeners=new Map;eventListeners=new Map;reconnectAttempts=0;maxReconnectAttempts=1/0;reconnectDelay=1e3;maxReconnectDelay=3e4;isConnecting=!1;connectionState=`disconnected`;stateChangeListeners=new Set;messageQueue=[];reconnectTimeout=null;currentUrl;constructor(e={}){this.config=e;let t=`ws://localhost:${Ho}`;typeof window<`u`&&window.location.port!==`5173`&&(t=`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}`);let{url:n=t,maxReconnectAttempts:r=1/0,reconnectDelay:i=1e3}=e;this.maxReconnectAttempts=r,this.reconnectDelay=i,this.currentUrl=n,this.isRenderer=typeof window<`u`}connect(e){let t=e||this.currentUrl;if(this.currentUrl=t,this.reconnectTimeout&&=(clearTimeout(this.reconnectTimeout),null),!(this.isConnecting||this.ws?.readyState===WebSocket.OPEN)){this.isConnecting=!0,this.connectionState=`connecting`,this.notifyStateChange();try{this.ws=new WebSocket(t),this.ws.onopen=()=>{console.log(`WebSocket connected to`,t),this.isConnecting=!1,this.reconnectAttempts=0,this.connectionState=`connected`,this.reconnectTimeout&&=(clearTimeout(this.reconnectTimeout),null),this.notifyStateChange();let{logger:e}=Ke();e().debug(`WebSocket client connected successfully`),this.flushQueue()},this.ws.onmessage=e=>{this.handleMessage(e)},this.ws.onclose=e=>{console.log(`WebSocket disconnected`,{code:e.code,reason:e.reason}),this.isConnecting=!1,this.connectionState=`disconnected`,this.notifyStateChange(),this.scheduleReconnect()},this.ws.onerror=e=>{console.error(`WebSocket error:`,e),this.isConnecting=!1,this.connectionState=`error`,this.notifyStateChange()}}catch(e){console.error(`Failed to create WebSocket connection:`,e),this.isConnecting=!1,this.connectionState=`error`,this.notifyStateChange(),this.scheduleReconnect()}}}notifyStateChange(){this.stateChangeListeners.forEach(e=>{try{e(this.connectionState)}catch(e){console.error(`Error in state change listener:`,e)}})}scheduleReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts){console.error(`Max reconnection attempts reached`),this.clearQueue();return}this.reconnectAttempts++;let e=Math.min(this.reconnectDelay*2**(this.reconnectAttempts-1),this.maxReconnectDelay),t=this.maxReconnectAttempts===1/0?`∞`:this.maxReconnectAttempts;this.reconnectTimeout=setTimeout(()=>{this.reconnectTimeout=null,console.log(`Attempting to reconnect (${this.reconnectAttempts}/${t}) in ${e}ms`),this.connect()},e)}handleMessage(e){try{let t=JSON.parse(e.data);if(Qe(t)||qe(t))this.listeners.has(t.requestId)&&this.listeners.get(t.requestId)(t);else if(t.type===`event`&&`channel`in t){let e=t.channel,n=this.eventListeners.get(e);n&&n.forEach(n=>{try{n(t.data)}catch(t){console.error(`Error in event listener for channel ${e}:`,t)}})}else Xe(t)&&console.log(`Received request message:`,t)}catch(e){console.error(`Failed to parse WebSocket message:`,e)}}send(e,t,r){return new Promise(async(i,a)=>{let{logger:o}=Ke();if(!this.ws||this.ws.readyState!==WebSocket.OPEN){o().debug(`WebSocket not ready, queuing message:`,{channel:e,hasData:!!t});let s=Wo();this.messageQueue.push({channel:e,data:n(Ge(t)),resolve:i,reject:a,requestId:s,listener:r});return}this.sendMessage(e,t,i,a,Wo,r)})}sendMessage(e,t,r,i,a,o){let{logger:s}=Ke();if(!this.ws||this.ws.readyState!==WebSocket.OPEN){s().error(`WebSocket send failed: connection not open`),i(new Ze(`WebSocket is not connected`));return}let c=a(),l={channel:e,requestId:c,data:n(Ge(t))};s().debug(`Sending WebSocket message:`,{channel:e,requestId:c,hasData:!!t}),this.listeners.set(c,e=>{if(qe(e))this.listeners.delete(c),i(new Je(e.error,e.code,e.requestId));else if(Qe(e)){let t=e.events;t.type===`end`?(this.listeners.delete(c),r(t.data)):o?o(t):s().info(`Received intermediate event:`,{requestId:c,eventType:t.type,hasData:!!t.data})}});try{this.ws.send(JSON.stringify(l))}catch(e){this.listeners.delete(c),i(new Je(`Failed to send message: ${e instanceof Error?e.message:`Unknown error`}`))}}async flushQueue(){let{logger:e}=Ke();if(this.messageQueue.length===0)return;e().debug(`Flushing ${this.messageQueue.length} queued messages`);let t=[...this.messageQueue];this.messageQueue=[];for(let e of t)this.sendMessage(e.channel,e.data,e.resolve,e.reject,Wo,e.listener)}clearQueue(){let{logger:e}=Ke();if(this.messageQueue.length!==0){e().debug(`Clearing ${this.messageQueue.length} queued messages due to connection error/disconnect`);for(let e of this.messageQueue)e.reject(new Ze(`WebSocket connection lost`));this.messageQueue=[]}}isConnected(){return this.ws?.readyState===WebSocket.OPEN}disconnect(e={clearQueue:!0}){this.connectionState=`disconnected`,this.notifyStateChange(),this.reconnectTimeout&&=(clearTimeout(this.reconnectTimeout),null),e.clearQueue&&this.clearQueue(),this.ws&&=(this.ws.close(),null),this.listeners.clear(),this.reconnectAttempts=0}getConnectionState(){return this.connectionState}onStateChange(e){return this.stateChangeListeners.add(e),()=>{this.stateChangeListeners.delete(e)}}reconnect(e){this.disconnect({clearQueue:!1}),this.connect(e)}on(e,t){return this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t),()=>{this.eventListeners.get(e)?.delete(t)}}},Ko=null,qo=()=>(Ko||=new Go,Ko),Jo=()=>{let{logger:e}=Ke(),t=qo();return{execute:async(n,r,i)=>{try{return await t.send(n,r,i)}catch(t){throw e().error(`WebSocket API error:`,t),t}},isConnected:t.isConnected.bind(t),disconnect:t.disconnect.bind(t),on:t.on.bind(t)}},Yo=go(`ui`,()=>{let e=h(!1),t=h(null),n=h(null);return{isFilePickerVisible:e,filePickerOptions:t,showFilePicker:r=>(e.value=!0,t.value=r,new Promise(e=>{n.value=e})),resolveFilePicker:t=>{e.value=!1,n.value&&=(n.value(t),null)}}}),Xo=()=>{let{logger:e}=Ke(),{execute:t,isConnected:n,on:r}=Jo(),i=Yo(),a=async(r,a,s)=>{if(et.includes(r)){if(window.electron){e().debug(`Routing to Electron IPC:`,r);let t=Math.random().toString(36).substring(7);return new Promise((e,n)=>{let i=window.electron.ipcRenderer.on(r,(t,n)=>{n.type===`end`?(i(),e(n.data)):s?.(n)});window.electron.ipcRenderer.send(r,{requestId:t,data:a})})}else if(r===`dialog:showOpenDialog`)return e().debug(`Falling back to web file picker (open):`,a),{type:`success`,result:await i.showFilePicker({...a,mode:`open`})};else if(r===`dialog:showSaveDialog`)return e().debug(`Falling back to web file picker (save):`,a),{type:`success`,result:await i.showFilePicker({...a,mode:`save`})}}try{return r===`graph:execute`&&!window.electron&&!n()?(e().info(`Routing graph:execute to Cloud Orchestrator`),await o(a,s)):await t(r,a,s)}catch(t){throw e().error(`API execution error:`,t),t}},o=async(e,t)=>{let{supabase:n}=await tt(async()=>{let{supabase:e}=await import(`./src-CTyDq6SD.js`).then(e=>e.n);return{supabase:e}},__vite__mapDeps([0,1,2,3,4])),r=n();if(!r)throw Error(`Supabase is not available for cloud execution`);let{data:i,error:a}=await r.functions.invoke(`cloud-run`,{body:{pipeline:e.graph,options:{os:`windows`}}});if(a)throw a;let{runId:o}=i;return new Promise((e,n)=>{let i=r.channel(`cloud-logs-${o}`).on(`postgres_changes`,{event:`INSERT`,schema:`public`,table:`cloud_run_logs`,filter:`run_id=eq.${o}`},e=>{let n=e.new;n.type===`node-enter`?t?.({type:`node-enter`,data:{nodeUid:n.node_uid}}):n.type===`node-exit`?t?.({type:`node-exit`,data:{nodeUid:n.node_uid}}):n.type===`log`&&t?.({type:`node-log`,data:{nodeUid:n.node_uid,logData:{message:[n.message],timestamp:new Date(n.created_at).getTime()}}})}).subscribe(),a=r.channel(`cloud-status-${o}`).on(`postgres_changes`,{event:`UPDATE`,schema:`public`,table:`cloud_runs`,filter:`id=eq.${o}`},t=>{let n=t.new;n.status===`success`?(a.unsubscribe(),i.unsubscribe(),e({type:`success`,result:{}})):n.status===`failed`&&(a.unsubscribe(),i.unsubscribe(),e({type:`error`,code:`error`,ipcError:`Cloud execution failed`}))}).subscribe()})};return{send:(t,n)=>(e().warn(`useAPI.send() is deprecated. Use useAPI.execute() instead.`),a(t,n)),on:(e,t)=>r(e,t),execute:a,isConnected:n}},Zo=(e,t)=>window.electron?window.electron.ipcRenderer.on(e,(e,n)=>{let{data:r,requestId:i}=n;return t(e,{send:e=>window.electron.ipcRenderer.send(i,e),value:r})}):(console.warn(`[Handlers] Electron not available, skipping handler for channel: ${e}`),()=>{}),Qo,z=typeof window<`u`?window:void 0,$o=typeof globalThis<`u`?globalThis:z,es=Array.prototype,ts=es.forEach,ns=es.indexOf,rs=$o?.navigator,B=$o?.document,is=$o?.location,as=$o?.fetch,os=$o!=null&&$o.XMLHttpRequest&&`withCredentials`in new $o.XMLHttpRequest?$o.XMLHttpRequest:void 0,ss=$o?.AbortController,cs=rs?.userAgent,V=z??{},ls={DEBUG:!1,LIB_VERSION:`1.215.0`},us=`$copy_autocapture`,ds=[`$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`];(function(e){e.GZipJS=`gzip-js`,e.Base64=`base64`})(Qo||={});var fs={};function ps(e,t,n){if(Ns(e)){if(ts&&e.forEach===ts)e.forEach(t,n);else if(`length`in e&&e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===fs)return}}}function ms(e,t,n){if(!Bs(e)){if(Ns(e))return ps(e,t,n);if(Us(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===fs)return}else for(var i in e)if(js.call(e,i)&&t.call(n,e[i],i)===fs)return}}var hs=function(e){return ps([...arguments].slice(1),(function(t){for(var n in t)t[n]!==void 0&&(e[n]=t[n])})),e},gs=function(e){return ps([...arguments].slice(1),(function(t){ps(t,(function(t){e.push(t)}))})),e};function _s(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var vs=function(e){try{return e()}catch{return}},ys=function(e){return function(){try{var t=[...arguments];return e.apply(this,t)}catch(e){W.critical(`Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A.`),W.critical(e)}}},bs=function(e){var t={};return ms(e,(function(e,n){Ls(e)&&e.length>0&&(t[n]=e)})),t};function xs(e,t){return n=e,r=e=>Ls(e)&&!zs(t)?e.slice(0,t):e,i=new Set,function e(t,n){return t===Object(t)?i.has(t)?void 0:(i.add(t),Ns(t)?(a=[],ps(t,(t=>{a.push(e(t))}))):(a={},ms(t,((t,n)=>{i.has(t)||(a[n]=e(t,n))}))),a):r?r(t,n):t;var a}(n);var n,r,i}var Ss=[`herokuapp.com`,`vercel.app`,`netlify.app`];function Cs(e){var t=e?.hostname;if(!Ls(t))return!1;var n=t.split(`.`).slice(-2).join(`.`);for(var r of Ss)if(n===r)return!1;return!0}function ws(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Ts(e,t,n,r){var{capture:i=!1,passive:a=!0}=r??{};e?.addEventListener(t,n,{capture:i,passive:a})}function H(e,t){return e.indexOf(t)!==-1}var Es=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``)},Ds=function(e){return e.replace(/^\$/,``)},Os=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}},ks=Array.isArray,As=Object.prototype,js=As.hasOwnProperty,Ms=As.toString,Ns=ks||function(e){return Ms.call(e)===`[object Array]`},Ps=e=>typeof e==`function`,Fs=e=>e===Object(e)&&!Ns(e),Is=e=>{if(Fs(e)){for(var t in e)if(js.call(e,t))return!1;return!0}return!1},U=e=>e===void 0,Ls=e=>Ms.call(e)==`[object String]`,Rs=e=>Ls(e)&&e.trim().length===0,zs=e=>e===null,Bs=e=>U(e)||zs(e),Vs=e=>Ms.call(e)==`[object Number]`,Hs=e=>Ms.call(e)===`[object Boolean]`,Us=e=>e instanceof FormData,Ws=e=>H(ds,e),Gs=e=>{var t={_log:function(t){if(z&&(ls.DEBUG||V.POSTHOG_DEBUG)&&!U(z.console)&&z.console){for(var n=(`__rrweb_original__`in z.console[t])?z.console[t].__rrweb_original__:z.console[t],r=arguments.length,i=Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];n(e,...i)}},info:function(){var e=[...arguments];t._log(`log`,...e)},warn:function(){var e=[...arguments];t._log(`warn`,...e)},error:function(){var e=[...arguments];t._log(`error`,...e)},critical:function(){console.error(e,...arguments)},uninitializedWarning:e=>{t.error(`You must initialize PostHog before calling ${e}`)},createLogger:t=>Gs(`${e} ${t}`)};return t},W=Gs(`[PostHog.js]`),Ks=W.createLogger,qs=Ks(`[ExternalScriptsLoader]`),Js=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return qs.warn(`${t} was requested but loading of external scripts is disabled.`),n(`Loading of external scripts is disabled`);var r=()=>{if(!B)return n(`document not found`);var r=B.createElement(`script`);if(r.type=`text/javascript`,r.crossOrigin=`anonymous`,r.src=t,r.onload=e=>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`);var i,a=B.querySelectorAll(`body > script`);a.length>0?(i=a[0].parentNode)==null||i.insertBefore(r,a[0]):B.body.appendChild(r)};B!=null&&B.body?r():B?.addEventListener(`DOMContentLoaded`,r)};function Ys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function G(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ys(Object(n),!0).forEach((function(t){K(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xs(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}V.__PosthogExtensions__=V.__PosthogExtensions__||{},V.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r=`/static/${t}.js?v=${e.version}`;if(t===`remote-config`&&(r=`/array/${e.config.token}/config.js`),t===`toolbar`){var i=3e5,a=Math.floor(Date.now()/i)*i;r=`${r}&t=${a}`}Js(e,e.requestRouter.endpointFor(`assets`,r),n)},V.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{Js(e,e.requestRouter.endpointFor(`api`,t),n)};var Zs=`$people_distinct_id`,Qs=`__alias`,$s=`__timers`,ec=`$autocapture_disabled_server_side`,tc=`$heatmaps_enabled_server_side`,nc=`$exception_capture_enabled_server_side`,rc=`$web_vitals_enabled_server_side`,ic=`$dead_clicks_enabled_server_side`,ac=`$web_vitals_allowed_metrics`,oc=`$session_recording_enabled_server_side`,sc=`$console_log_recording_enabled_server_side`,cc=`$session_recording_network_payload_capture`,lc=`$session_recording_canvas_recording`,uc=`$replay_sample_rate`,dc=`$replay_minimum_duration`,fc=`$replay_script_config`,pc=`$sesid`,mc=`$session_is_sampled`,hc=`$session_recording_url_trigger_activated_session`,gc=`$session_recording_event_trigger_activated_session`,_c=`$enabled_feature_flags`,vc=`$early_access_features`,yc=`$stored_person_properties`,bc=`$stored_group_properties`,xc=`$surveys`,Sc=`$surveys_activated`,Cc=`$flag_call_reported`,wc=`$user_state`,Tc=`$client_session_props`,Ec=`$capture_rate_limit`,Dc=`$initial_campaign_params`,Oc=`$initial_referrer_info`,kc=`$initial_person_info`,Ac=`$epp`,jc=`__POSTHOG_TOOLBAR__`,Mc=`$posthog_cookieless`,Nc=[Zs,Qs,`__cmpns`,$s,oc,tc,pc,_c,wc,vc,bc,yc,xc,Cc,Tc,Ec,Dc,Oc,Ac],Pc=Ks(`[FeatureFlags]`),Fc=`$active_feature_flags`,Ic=`$override_feature_flags`,Lc=`$feature_flag_payloads`,Rc=`$override_feature_flag_payloads`,zc=e=>{var t={};for(var[n,r]of _s(e||{}))r&&(t[n]=r);return t},Bc=class{constructor(e){K(this,`_override_warning`,!1),K(this,`_hasLoadedFlags`,!1),K(this,`_requestInFlight`,!1),K(this,`_reloadingDisabled`,!1),K(this,`_additionalReloadRequested`,!1),K(this,`_decideCalled`,!1),K(this,`_flagsLoadedFromRemote`,!1),this.instance=e,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(_c),t=this.instance.get_property(Ic);if(!t)return e||{};for(var n=hs({},e),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||=(Pc.warn(` Overriding feature flags!`,{enabledFlags:e,overriddenFlags:t,finalFlags:n}),!0),n}getFlagPayloads(){var e=this.instance.get_property(Lc),t=this.instance.get_property(Rc);if(!t)return e||{};for(var n=hs({},e||{}),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||=(Pc.warn(` Overriding feature flag payloads!`,{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),!0),n}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((()=>{this._callDecideEndpoint()}),5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callDecideEndpoint(e){if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:this.instance.get_property(yc),group_properties:this.instance.get_property(bc)};(e!=null&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(t.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:`POST`,url:this.instance.requestRouter.endpointFor(`api`,`/decide/?v=3`),data:t,compression:this.instance.config.disable_compression?void 0:Qo.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var n=!0;(e.statusCode===200&&(this.$anon_distinct_id=void 0,n=!1),this._requestInFlight=!1,this._decideCalled)||(this._decideCalled=!0,this.instance._onRemoteConfig(e.json??{})),t.disable_flags||(this._flagsLoadedFromRemote=!n,this.receivedFeatureFlags(e.json??{},n),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint()))}})}}getFeatureFlag(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var n,r,i,a,o,s=this.getFlagVariants()[e],c=`${s}`,l=this.instance.get_property(Cc)||{};return(t.send_event||!(`send_event`in t))&&(!(e in l)||!l[e].includes(c))&&(Ns(l[e])?l[e].push(c):l[e]=[c],(n=this.instance.persistence)==null||n.register({[Cc]:l}),this.instance.capture(`$feature_flag_called`,{$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_bootstrapped_response:((r=this.instance.config.bootstrap)==null||(i=r.featureFlags)==null?void 0:i[e])||null,$feature_flag_bootstrapped_payload:((a=this.instance.config.bootstrap)==null||(o=a.featureFlagPayloads)==null?void 0:o[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote})),s}Pc.warn(`getFeatureFlag for key "`+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Pc.warn(`isFeatureEnabled for key "`+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(this.instance.persistence){this._hasLoadedFlags=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads();(function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=e.featureFlags,a=e.featureFlagPayloads;if(i)if(Ns(i)){var o={};if(i)for(var s=0;s<i.length;s++)o[i[s]]=!0;t&&t.register({[Fc]:i,[_c]:o})}else{var c=i,l=a;e.errorsWhileComputingFlags&&(c=G(G({},n),c),l=G(G({},r),l)),t&&t.register({[Fc]:Object.keys(zc(c)),[_c]:c||{},[Lc]:l||{}})}})(e,this.instance.persistence,n,r),this._fireFeatureFlagsCallbacks(t)}}override(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];Pc.warn(`override is deprecated. Please use overrideFeatureFlags instead.`),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this.instance.__loaded||!this.instance.persistence)return Pc.uninitializedWarning(`posthog.feature_flags.overrideFeatureFlags`);if(!1===e)return this.instance.persistence.unregister(Ic),this.instance.persistence.unregister(Rc),void this._fireFeatureFlagsCallbacks();if(e&&typeof e==`object`&&(`flags`in e||`payloads`in e)){var t,n=e;if(this._override_warning=!!((t=n.suppressWarning)!=null&&t),`flags`in n){if(!1===n.flags)this.instance.persistence.unregister(Ic);else if(n.flags)if(Ns(n.flags)){for(var r={},i=0;i<n.flags.length;i++)r[n.flags[i]]=!0;this.instance.persistence.register({[Ic]:r})}else this.instance.persistence.register({[Ic]:n.flags})}`payloads`in n&&(!1===n.payloads?this.instance.persistence.unregister(Rc):n.payloads&&this.instance.persistence.register({[Rc]:n.payloads})),this._fireFeatureFlagsCallbacks();return}this._fireFeatureFlagsCallbacks()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n,r=(this.instance.get_property(vc)||[]).find((t=>t.flagKey===e)),i={[`\$feature_enrollment/${e}`]:t},a={$feature_flag:e,$feature_enrollment:t,$set:i};r&&(a.$early_access_feature_name=r.name),this.instance.capture(`$feature_enrollment_update`,a),this.setPersonPropertiesForFlags(i,!1);var o=G(G({},this.getFlagVariants()),{},{[e]:t});(n=this.instance.persistence)==null||n.register({[Fc]:Object.keys(zc(o)),[_c]:o}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.instance.get_property(vc);if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor(`api`,`/api/early_access_features/?token=${this.instance.config.token}`),method:`GET`,callback:t=>{var n;if(t.json){var r=t.json.earlyAccessFeatures;return(n=this.instance.persistence)==null||n.register({[vc]:r}),e(r)}}})}_prepareFeatureFlagsForCallbacks(){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)),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.instance.get_property(yc)||{};this.instance.register({[yc]:G(G({},n),e)}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(yc)}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.instance.get_property(bc)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((t=>{n[t]=G(G({},n[t]),e[t]),delete e[t]})),this.instance.register({[bc]:G(G({},n),e)}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.instance.get_property(bc)||{};this.instance.register({[bc]:G(G({},t),{},{[e]:{}})})}else this.instance.unregister(bc)}};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Vs(e)&&isFinite(e)&&Math.floor(e)===e});var Vc=`0123456789abcdef`,Hc=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)||t<0||n<0||r<0||i<0||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/2**8,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;t<this.bytes.length;t++)e=e+Vc.charAt(this.bytes[t]>>>4)+Vc.charAt(15&this.bytes[t]),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;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}},Uc=class{constructor(){K(this,`timestamp`,0),K(this,`counter`,0),K(this,`random`,new Kc)}generate(){var e=this.generateOrAbort();if(U(e)){this.timestamp=0;var t=this.generateOrAbort();if(U(t))throw Error(`Could not generate UUID after timestamp reset`);return t}return e}generateOrAbort(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Hc.fromFieldsV7(this.timestamp,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}},Wc,Gc=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<`u`&&UUIDV7_DENY_WEAK_RNG)throw Error(`no cryptographically strong RNG available`);for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};z&&!U(z.crypto)&&crypto.getRandomValues&&(Gc=e=>crypto.getRandomValues(e));var Kc=class{constructor(){K(this,`buffer`,new Uint32Array(8)),K(this,`cursor`,1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(Gc(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},qc=()=>Jc().toString(),Jc=()=>(Wc||=new Uc).generate(),Yc=`Thu, 01 Jan 1970 00:00:00 GMT`,Xc=``,Zc=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Qc(e,t){if(t){var n=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B;if(Xc)return Xc;if(!t||[`localhost`,`127.0.0.1`].includes(e))return``;for(var n=e.split(`.`),r=Math.min(n.length,8),i=`dmn_chk_`+qc(),a=RegExp(`(^|;)\\s*`+i+`=1`);!Xc&&r--;){var o=n.slice(r).join(`.`),s=i+`=1;domain=.`+o;t.cookie=s,a.test(t.cookie)&&(t.cookie=s+`;expires=`+Yc,Xc=o)}return Xc}(e);if(!n){var r=(e=>{var t=e.match(Zc);return t?t[0]:``})(e);r!==n&&W.info(`Warning: cookie subdomain discovery mismatch`,r,n),n=r}return n?`; domain=.`+n:``}return``}var $c={is_supported:()=>!!B,error:function(e){W.error(`cookieStore error: `+e)},get:function(e){if(B){try{for(var t=e+`=`,n=B.cookie.split(`;`).filter((e=>e.length)),r=0;r<n.length;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}},parse:function(e){var t;try{t=JSON.parse($c.get(e))||{}}catch{}return t},set:function(e,t,n,r,i){if(B)try{var a=``,o=``,s=Qc(B.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+24*n*60*60*1e3),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&&W.warn(`cookieStore warning: large cookie, len=`+l.length),B.cookie=l,l}catch{return}},remove:function(e,t){try{$c.set(e,``,-1,t)}catch{return}}},el=null,tl={is_supported:function(){if(!zs(el))return el;var e=!0;if(U(z))e=!1;else try{var t=`__mplssupport__`;tl.set(t,`xyz`),tl.get(t)!==`"xyz"`&&(e=!1),tl.remove(t)}catch{e=!1}return e||W.error(`localStorage unsupported; falling back to cookie store`),el=e,e},error:function(e){W.error(`localStorage error: `+e)},get:function(e){try{return z?.localStorage.getItem(e)}catch(e){tl.error(e)}return null},parse:function(e){try{return JSON.parse(tl.get(e))||{}}catch{}return null},set:function(e,t){try{z?.localStorage.setItem(e,JSON.stringify(t))}catch(e){tl.error(e)}},remove:function(e){try{z?.localStorage.removeItem(e)}catch(e){tl.error(e)}}},nl=[`distinct_id`,pc,mc,Ac,kc],rl=G(G({},tl),{},{parse:function(e){try{var t={};try{t=$c.parse(e)||{}}catch{}var n=hs(t,JSON.parse(tl.get(e)||`{}`));return tl.set(e,n),n}catch{}return null},set:function(e,t,n,r,i,a){try{tl.set(e,t,void 0,void 0,a);var o={};nl.forEach((e=>{t[e]&&(o[e]=t[e])})),Object.keys(o).length&&$c.set(e,o,n,r,i,a)}catch(e){tl.error(e)}},remove:function(e,t){try{z?.localStorage.removeItem(e),$c.remove(e,t)}catch(e){tl.error(e)}}}),il={},al={is_supported:function(){return!0},error:function(e){W.error(`memoryStorage error: `+e)},get:function(e){return il[e]||null},parse:function(e){return il[e]||null},set:function(e,t){il[e]=t},remove:function(e){delete il[e]}},ol=null,sl={is_supported:function(){if(!zs(ol))return ol;if(ol=!0,U(z))ol=!1;else try{var e=`__support__`;sl.set(e,`xyz`),sl.get(e)!==`"xyz"`&&(ol=!1),sl.remove(e)}catch{ol=!1}return ol},error:function(e){W.error(`sessionStorage error: `,e)},get:function(e){try{return z?.sessionStorage.getItem(e)}catch(e){sl.error(e)}return null},parse:function(e){try{return JSON.parse(sl.get(e))||null}catch{}return null},set:function(e,t){try{z?.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){sl.error(e)}},remove:function(e){try{z?.sessionStorage.removeItem(e)}catch(e){sl.error(e)}}},cl=[`localhost`,`127.0.0.1`],ll=e=>{var t=B?.createElement(`a`);return U(t)?null:(t.href=e,t)},ul=function(e){var t,n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`&`,i=[];return ms(e,(function(e,r){U(e)||U(r)||r===`undefined`||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+`=`+t)})),i.join(r)},dl=function(e,t){for(var n,r=((e.split(`#`)[0]||``).split(`?`)[1]||``).split(`&`),i=0;i<r.length;i++){var a=r[i].split(`=`);if(a[0]===t){n=a;break}}if(!Ns(n)||n.length<2)return``;var o=n[1];try{o=decodeURIComponent(o)}catch{W.error(`Skipping decoding for malformed query param: `+o)}return o.replace(/\+/g,` `)},fl=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(`#`),i=r[0]||``,a=r[1],o=i.split(`?`),s=o[1],c=o[0],l=(s||``).split(`&`),u=[],d=0;d<l.length;d++){var f=l[d].split(`=`);Ns(f)&&(t.includes(f[0])?u.push(f[0]+`=`+n):u.push(l[d]))}var p=c;return s!=null&&(p+=`?`+u.join(`&`)),a!=null&&(p+=`#`+a),p},pl=function(e,t){var n=e.match(RegExp(t+`=([^&]*)`));return n?n[1]:null},ml=`Mobile`,hl=`iOS`,gl=`Android`,_l=`Tablet`,vl=gl+` `+_l,yl=`iPad`,bl=`Apple`,xl=bl+` Watch`,Sl=`Safari`,Cl=`BlackBerry`,wl=`Samsung`,Tl=wl+`Browser`,El=wl+` Internet`,Dl=`Chrome`,Ol=Dl+` OS`,kl=Dl+` `+hl,Al=`Internet Explorer`,jl=Al+` `+ml,Ml=`Opera`,Nl=Ml+` Mini`,Pl=`Edge`,Fl=`Microsoft `+Pl,Il=`Firefox`,Ll=Il+` `+hl,Rl=`Nintendo`,zl=`PlayStation`,Bl=`Xbox`,Vl=gl+` `+ml,Hl=ml+` `+Sl,Ul=`Windows`,Wl=Ul+` Phone`,Gl=`Nokia`,Kl=`Ouya`,ql=`Generic`,Jl=ql+` `+ml.toLowerCase(),Yl=ql+` `+_l.toLowerCase(),Xl=`Konqueror`,Zl=`(\\d+(\\.\\d+)?)`,Ql=RegExp(`Version/`+Zl),$l=new RegExp(Bl,`i`),eu=RegExp(zl+` \\w+`,`i`),tu=RegExp(Rl+` \\w+`,`i`),nu=RegExp(Cl+`|PlayBook|BB10`,`i`),ru={"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`},iu=(e,t)=>t&&H(t,bl)||function(e){return H(e,Sl)&&!H(e,Dl)&&!H(e,gl)}(e),au=function(e,t){return t||=``,H(e,` OPR/`)&&H(e,`Mini`)?Nl:H(e,` OPR/`)?Ml:nu.test(e)?Cl:H(e,`IE`+ml)||H(e,`WPDesktop`)?jl:H(e,Tl)?El:H(e,Pl)||H(e,`Edg/`)?Fl:H(e,`FBIOS`)?`Facebook `+ml:H(e,`UCWEB`)||H(e,`UCBrowser`)?`UC Browser`:H(e,`CriOS`)?kl:H(e,`CrMo`)||H(e,Dl)?Dl:H(e,gl)&&H(e,Sl)?Vl:H(e,`FxiOS`)?Ll:H(e.toLowerCase(),Xl.toLowerCase())?Xl:iu(e,t)?H(e,ml)?Hl:Sl:H(e,Il)?Il:H(e,`MSIE`)||H(e,`Trident/`)?Al:H(e,`Gecko`)?Il:``},ou={[jl]:[RegExp(`rv:`+Zl)],[Fl]:[RegExp(Pl+`?\\/`+Zl)],[Dl]:[RegExp(`(`+Dl+`|CrMo)\\/`+Zl)],[kl]:[RegExp(`CriOS\\/`+Zl)],"UC Browser":[RegExp(`(UCBrowser|UCWEB)\\/`+Zl)],[Sl]:[Ql],[Hl]:[Ql],[Ml]:[RegExp(`(Opera|OPR)\\/`+Zl)],[Il]:[RegExp(Il+`\\/`+Zl)],[Ll]:[RegExp(`FxiOS\\/`+Zl)],[Xl]:[RegExp(`Konqueror[:/]?`+Zl,`i`)],[Cl]:[RegExp(Cl+` `+Zl),Ql],[Vl]:[RegExp(`android\\s`+Zl,`i`)],[El]:[RegExp(Tl+`\\/`+Zl)],[Al]:[RegExp(`(rv:|MSIE )`+Zl)],Mozilla:[RegExp(`rv:`+Zl)]},su=[[RegExp(Bl+`; `+Bl+` (.*?)[);]`,`i`),e=>[Bl,e&&e[1]||``]],[new RegExp(Rl,`i`),[Rl,``]],[new RegExp(zl,`i`),[zl,``]],[nu,[Cl,``]],[new RegExp(Ul,`i`),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Wl,``];if(new RegExp(ml).test(t)&&!/IEMobile\b/.test(t))return[Ul+` `+ml,``];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=ru[n[1]]||``;return/arm/i.test(t)&&(r=`RT`),[Ul,r]}return[Ul,``]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[hl,[e[3],e[4],e[5]||`0`].join(`.`)]:[hl,``]],[/(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(`(`+gl+` (\\d+)\\.(\\d+)\\.?(\\d+)?|`+gl+`)`,`i`),e=>e&&e[2]?[gl,[e[2],e[3],e[4]||`0`].join(`.`)]:[gl,``]],[/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/,[Ol,``]],[/Linux|debian/i,[`Linux`,``]]],cu=function(e){return tu.test(e)?Rl:eu.test(e)?zl:$l.test(e)?Bl:new RegExp(Kl,`i`).test(e)?Kl:RegExp(`(`+Wl+`|WPDesktop)`,`i`).test(e)?Wl:/iPad/.test(e)?yl:/iPod/.test(e)?`iPod Touch`:/iPhone/.test(e)?`iPhone`:/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?xl:nu.test(e)?Cl:/(kobo)\s(ereader|touch)/i.test(e)?`Kobo`:new RegExp(Gl,`i`).test(e)?Gl:/(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(ml).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)?gl:vl:gl:RegExp(`(pda|`+ml+`)`,`i`).test(e)?Jl:new RegExp(_l,`i`).test(e)&&!RegExp(_l+` pc`,`i`).test(e)?Yl:``},lu=`https?://(.*)`,uu=[`gclid`,`gclsrc`,`dclid`,`gbraid`,`wbraid`,`fbclid`,`msclkid`,`twclid`,`li_fat_id`,`igshid`,`ttclid`,`rdt_cid`,`irclid`,`_kx`],du=gs([`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gad_source`,`mc_cid`],uu),fu=`<masked>`,pu={campaignParams:function(){var{customTrackedParams:e,maskPersonalDataProperties:t,customPersonalDataProperties:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!B)return{};var r=t?gs([],uu,n||[]):[];return this._campaignParamsFromUrl(fl(B.URL,r,fu),e)},_campaignParamsFromUrl:function(e,t){var n=du.concat(t||[]),r={};return ms(n,(function(t){r[t]=dl(e,t)||null})),r},_searchEngine:function(e){return e?e.search(lu+`google.([^/?]*)`)===0?`google`:e.search(lu+`bing.com`)===0?`bing`:e.search(lu+`yahoo.com`)===0?`yahoo`:e.search(lu+`duckduckgo.com`)===0?`duckduckgo`:null:null},_searchInfoFromReferrer:function(e){var t=pu._searchEngine(e),n=t==`yahoo`?`p`:`q`,r={};if(!zs(t)){r.$search_engine=t;var i=B?dl(B.referrer,n):``;i.length&&(r.ph_keyword=i)}return r},searchInfo:function(){var e=B?.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:au,browserVersion:function(e,t){var n=ou[au(e,t)];if(U(n))return null;for(var r=0;r<n.length;r++){var i=n[r],a=e.match(i);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return typeof e==`string`?e.split(`-`)[0]:void 0},os:function(e){for(var t=0;t<su.length;t++){var[n,r]=su[t],i=n.exec(e),a=i&&(Ps(r)?r(i,e):r);if(a)return a}return[``,``]},device:cu,deviceType:function(e){var t=cu(e);return t===yl||t===vl||t===`Kobo`||t===`Kindle Fire`||t===Yl?_l:t===Rl||t===Bl||t===zl||t===Kl?`Console`:t===xl?`Wearable`:t?ml:`Desktop`},referrer:function(){return B?.referrer||`$direct`},referringDomain:function(){return B!=null&&B.referrer&&ll(B.referrer)?.host||`$direct`},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer().substring(0,1e3),u:is?.href.substring(0,1e3)}},initialPersonPropsFromInfo:function(e){var{r:t,u:n}=e,r={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t==`$direct`?`$direct`:ll(t)?.host};if(n){r.$initial_current_url=n;var i=ll(n);r.$initial_host=i?.host,r.$initial_pathname=i?.pathname,ms(this._campaignParamsFromUrl(n),(function(e,t){r[`$initial_`+Ds(t)]=e}))}return t&&ms(this._searchInfoFromReferrer(t),(function(e,t){r[`$initial_`+Ds(t)]=e})),r},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},timezoneOffset:function(){try{return new Date().getTimezoneOffset()}catch{return}},properties:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!cs)return{};var n=e?gs([],uu,t||[]):[],[r,i]=pu.os(cs);return hs(bs({$os:r,$os_version:i,$browser:pu.browser(cs,navigator.vendor),$device:pu.device(cs),$device_type:pu.deviceType(cs),$timezone:pu.timezone(),$timezone_offset:pu.timezoneOffset()}),{$current_url:fl(is?.href,n,fu),$host:is?.host,$pathname:is?.pathname,$raw_user_agent:cs.length>1e3?cs.substring(0,997)+`...`:cs,$browser_version:pu.browserVersion(cs,navigator.vendor),$browser_language:pu.browserLanguage(),$browser_language_prefix:pu.browserLanguagePrefix(),$screen_height:z?.screen.height,$screen_width:z?.screen.width,$viewport_height:z?.innerHeight,$viewport_width:z?.innerWidth,$lib:`web`,$lib_version:ls.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!cs)return{};var[e,t]=pu.os(cs);return hs(bs({$os:e,$os_version:t,$browser:pu.browser(cs,navigator.vendor)}),{$browser_version:pu.browserVersion(cs,navigator.vendor)})}},mu=[`cookie`,`localstorage`,`localstorage+cookie`,`sessionstorage`,`memory`],hu=class{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(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.storage=this.buildStorage(e),this.load(),e.debug&&W.info(`Persistence loaded`,e.persistence,G({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){mu.indexOf(e.persistence.toLowerCase())===-1&&(W.critical(`Unknown persistence type `+e.persistence+`; falling back to localStorage+cookie`),e.persistence=`localStorage+cookie`);var t=e.persistence.toLowerCase();return t===`localstorage`&&tl.is_supported()?tl:t===`localstorage+cookie`&&rl.is_supported()?rl:t===`sessionstorage`&&sl.is_supported()?sl:t===`memory`?al:t===`cookie`?$c:rl.is_supported()?rl:$c}properties(){var e={};return ms(this.props,(function(t,n){if(n===_c&&Fs(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e[`\$feature/${r[i]}`]=t[r[i]];else o=n,s=!1,(zs(a=Nc)?s:ns&&a.indexOf===ns?a.indexOf(o)!=-1:(ms(a,(function(e){if(s||=e===o)return fs})),s))||(e[n]=t);var a,o,s})),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=hs({},e))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(Fs(e)){U(t)&&(t=`None`),this.expire_days=U(n)?this.default_expiry:n;var r=!1;if(ms(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e,r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(Fs(e)){this.expire_days=U(t)?this.default_expiry:t;var n=!1;if(ms(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=pu.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});Is(bs(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(pu.searchInfo())}update_referrer_info(){this.register_once(pu.referrerInfo(),void 0)}set_initial_person_info(){this.props[Dc]||this.props[Oc]||this.register_once({[kc]:pu.initialPersonInfo()},void 0)}get_referrer_info(){return bs({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};ms([Oc,Dc],(t=>{var n=this.props[t];n&&ms(n,(function(t,n){e[`$initial_`+Ds(n)]=t}))}));var t=this.props[kc];return t&&hs(e,pu.initialPersonPropsFromInfo(t)),e}safe_merge(e){return ms(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[$s]||{};n[e]=t,this.props[$s]=n,this.save()}remove_event_timer(e){var t=(this.props[$s]||{})[e];return U(t)||(delete this.props[$s][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}};function gu(e){var t;return JSON.stringify(e,(t=[],function(e,n){if(Fs(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?`[Circular]`:(t.push(n),n)}return n}))?.length||0}function _u(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),i=e.data.slice(n);return[_u({size:gu(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),_u({size:gu(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var vu=(e=>(e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`,e))(vu||{}),yu=(e=>(e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`,e[e.Selection=14]=`Selection`,e[e.AdoptedStyleSheet=15]=`AdoptedStyleSheet`,e[e.CustomElement=16]=`CustomElement`,e))(yu||{});function bu(e){var t;return e instanceof Element&&(e.id===jc||!((t=e.closest)==null||!t.call(e,`.toolbar-global-fade-container`)))}function xu(e){return!!e&&e.nodeType===1}function Su(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Cu(e){return!!e&&e.nodeType===3}function wu(e){return!!e&&e.nodeType===11}function Tu(e){return e?Es(e).split(/\s+/):[]}function Eu(e){var t=z?.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Du(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 Tu(t)}function Ou(e){return Bs(e)?null:Es(e).split(/(\s+)/).filter((e=>Hu(e))).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255)}function ku(e){var t=``;return Pu(e)&&!Fu(e)&&e.childNodes&&e.childNodes.length&&ms(e.childNodes,(function(e){Cu(e)&&e.textContent&&(t+=Ou(e.textContent)??``)})),Es(t)}function Au(e){return U(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var ju=[`a`,`button`,`form`,`input`,`select`,`textarea`,`label`];function Mu(e){var t=e.parentNode;return!(!t||!xu(t))&&t}function Nu(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!z||!e||Su(e,`html`)||!xu(e)||n!=null&&n.url_allowlist&&!Eu(n.url_allowlist)||n!=null&&n.url_ignorelist&&Eu(n.url_ignorelist))return!1;if(n!=null&&n.dom_event_allowlist){var a=n.dom_event_allowlist;if(a&&!a.some((e=>t.type===e)))return!1}for(var o=!1,s=[e],c=!0,l=e;l.parentNode&&!Su(l,`body`);)if(wu(l.parentNode))s.push(l.parentNode.host),l=l.parentNode.host;else{if(!(c=Mu(l)))break;if(r||ju.indexOf(c.tagName.toLowerCase())>-1)o=!0;else{var u=z.getComputedStyle(c);u&&u.getPropertyValue(`cursor`)===`pointer`&&(o=!0)}s.push(c),l=c}if(!function(e,t){var n=t?.element_allowlist;if(U(n))return!0;var r=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var i of e){var a=r(i);if(typeof a==`object`)return a.v}return!1}(s,n)||!function(e,t){var n=t?.css_selector_allowlist;if(U(n))return!0;var r=function(e){if(n.some((t=>e.matches(t))))return{v:!0}};for(var i of e){var a=r(i);if(typeof a==`object`)return a.v}return!1}(s,n))return!1;var d=z.getComputedStyle(e);if(d&&d.getPropertyValue(`cursor`)===`pointer`&&t.type===`click`)return!0;var f=e.tagName.toLowerCase();switch(f){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 o?(i||[`click`]).indexOf(t.type)>=0:(i||[`click`]).indexOf(t.type)>=0&&(ju.indexOf(f)>-1||e.getAttribute(`contenteditable`)===`true`)}}function Pu(e){for(var t=e;t.parentNode&&!Su(t,`body`);t=t.parentNode){var n=Du(t);if(H(n,`ph-sensitive`)||H(n,`ph-no-capture`))return!1}if(H(Du(e),`ph-include`))return!0;var r=e.type||``;if(Ls(r))switch(r.toLowerCase()){case`hidden`:case`password`:return!1}var i=e.name||e.id||``;return!(Ls(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,``)))}function Fu(e){return!!(Su(e,`input`)&&![`button`,`checkbox`,`submit`,`reset`].includes(e.type)||Su(e,`select`)||Su(e,`textarea`)||e.getAttribute(`contenteditable`)===`true`)}var Iu=`(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})`,Lu=RegExp(`^(?:${Iu})\$`),Ru=new RegExp(Iu),zu=`\\d{3}-?\\d{2}-?\\d{4}`,Bu=RegExp(`^(${zu})\$`),Vu=RegExp(`(${zu})`);function Hu(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(Bs(e)||Ls(e)&&(e=Es(e),(t?Lu:Ru).test((e||``).replace(/[- ]/g,``))||(t?Bu:Vu).test(e)))}function Uu(e){var t=ku(e);return Hu(t=`${t} ${Wu(e)}`.trim())?t:``}function Wu(e){var t=``;return e&&e.childNodes&&e.childNodes.length&&ms(e.childNodes,(function(e){if(e&&e.tagName?.toLowerCase()===`span`)try{var n=ku(e);t=`${t} ${n}`.trim(),e.childNodes&&e.childNodes.length&&(t=`${t} ${Wu(e)}`.trim())}catch(e){W.error(`[AutoCapture]`,e)}})),t}function Gu(e){return 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=G(G(G(G({},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 _s(r).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return i[Ku(t.toString())]=Ku(n.toString())})),t+=`:`,t+=_s(r).map((e=>{var[t,n]=e;return`${t}="${n}"`})).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:qu(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return _s(e).filter((e=>{var[t]=e;return t.indexOf(`attr__`)===0})).forEach((e=>{var[n,r]=e;return t.attributes[n]=r})),t}))}(e))}function Ku(e){return e.replace(/"|\\"/g,`\\"`)}function qu(e){var t=e.attr__class;return t?Ns(t)?t:Tu(t):void 0}var Ju=`[SessionRecording]`,Yu=`redacted`,Xu={initiatorTypes:[`audio`,`beacon`,`body`,`css`,`early-hint`,`embed`,`fetch`,`frame`,`iframe`,`icon`,`image`,`img`,`input`,`link`,`navigation`,`object`,`ping`,`script`,`track`,`video`,`xmlhttprequest`],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:[`first-input`,`navigation`,`paint`,`resource`],payloadSizeLimitBytes:1e6,payloadHostDenyList:[`.lr-ingest.io`,`.ingest.sentry.io`,`.clarity.ms`,`analytics.google.com`]},Zu=[`authorization`,`x-forwarded-for`,`authorization`,`cookie`,`set-cookie`,`x-api-key`,`x-real-ip`,`remote-addr`,`forwarded`,`proxy-authorization`,`x-csrf-token`,`x-csrftoken`,`x-xsrf-token`],Qu=[`password`,`secret`,`passwd`,`api_key`,`apikey`,`auth`,`credentials`,`mysql_pwd`,`privatekey`,`private_key`,`token`],$u=[`/s/`,`/e/`,`/i/`];function ed(e,t,n,r){if(Bs(e))return e;var i=t?.[`content-length`]||function(e){return new Blob([e]).size}(e);return Ls(i)&&(i=parseInt(i)),i>n?Ju+` ${r} body too large to record (${i} bytes)`:e}function td(e,t){if(Bs(e))return e;var n=e;return Hu(n,!1)||(n=Ju+` `+t+` body `+Yu),ms(Qu,(e=>{var r;(r=n)!=null&&r.length&&n?.indexOf(e)!==-1&&(n=Ju+` `+t+` body `+Yu+` as might contain: `+e)})),n}var nd=(e,t)=>{var n,r,i={payloadSizeLimitBytes:Xu.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Xu.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Xu.payloadHostDenyList]},a=!1!==e.session_recording.recordHeaders&&t.recordHeaders,o=!1!==e.session_recording.recordBody&&t.recordBody,s=!1!==e.capture_performance&&t.recordPerformance,c=(n=i,r=Math.min(1e6,n.payloadSizeLimitBytes??1e6),e=>(e!=null&&e.requestBody&&(e.requestBody=ed(e.requestBody,e.requestHeaders,r,`Request`)),e!=null&&e.responseBody&&(e.responseBody=ed(e.responseBody,e.responseHeaders,r,`Response`)),e)),l=t=>{return c(((e,t)=>{var n=ll(e.name),r=t.indexOf(`http`)===0?ll(t)?.pathname:t;r===`/`&&(r=``);var i=n?.pathname.replace(r||``,``);if(!(n&&i&&$u.some((e=>i.indexOf(e)===0))))return e})((r=(n=t).requestHeaders,Bs(r)||ms(Object.keys(r??{}),(e=>{Zu.includes(e.toLowerCase())&&(r[e]=Yu)})),n),e.api_host));var n,r},u=Ps(e.session_recording.maskNetworkRequestFn);return u&&Ps(e.session_recording.maskCapturedNetworkRequestFn)&&W.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var n=e.session_recording.maskNetworkRequestFn({url:t.name});return G(G({},t),{},{name:n?.url})}),i.maskRequestFn=Ps(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var n,r,i=l(t);return i&&(n=(r=e.session_recording).maskCapturedNetworkRequestFn?.call(r,i))!=null?n:void 0}:e=>function(e){if(!U(e))return e.requestBody=td(e.requestBody,`Request`),e.responseBody=td(e.responseBody,`Response`),e}(l(e)),G(G(G({},Xu),i),{},{recordHeaders:a,recordBody:o,recordPerformance:s,recordInitialRequests:s})};function rd(e,t,n,r,i){return t>n&&(W.warn(`min cannot be greater than max.`),t=n),Vs(e)?e>n?(r&&W.warn(r+` cannot be greater than max: `+n+`. Using max value instead.`),n):e<t?(r&&W.warn(r+` cannot be less than min: `+t+`. Using min value instead.`),t):e:(r&&W.warn(r+` must be a number. using max or fallback. max: `+n+`, fallback: `+i),rd(i||n,t,n,r))}var id=class{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};K(this,`bucketSize`,100),K(this,`refillRate`,10),K(this,`mutationBuckets`,{}),K(this,`loggedTracker`,{}),K(this,`refillBuckets`,(()=>{Object.keys(this.mutationBuckets).forEach((e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]}))})),K(this,`getNodeOrRelevantParent`,(e=>{var t=this.rrweb.mirror.getNode(e);if(t?.nodeName!==`svg`&&t instanceof Element){var n=t.closest(`svg`);if(n)return[this.rrweb.mirror.getId(n),n]}return[e,t]})),K(this,`numberOfChanges`,(e=>(e.removes?.length??0)+(e.attributes?.length??0)+(e.texts?.length??0)+(e.adds?.length??0))),K(this,`throttleMutations`,(e=>{if(e.type!==3||e.data.source!==0)return e;var t=e.data,n=this.numberOfChanges(t);t.attributes&&=t.attributes.filter((e=>{var t,n,[r,i]=this.getNodeOrRelevantParent(e.id);return this.mutationBuckets[r]===0?!1:((this.mutationBuckets[r]=this.mutationBuckets[r]??this.bucketSize,this.mutationBuckets[r]=Math.max(this.mutationBuckets[r]-1,0),this.mutationBuckets[r]===0)&&(this.loggedTracker[r]||(this.loggedTracker[r]=!0,(t=(n=this.options).onBlockedNode)==null||t.call(n,r,i))),e)}));var r=this.numberOfChanges(t);return r!==0||n===r?e:void 0})),this.rrweb=e,this.options=t,this.refillRate=rd(this.options.refillRate??this.refillRate,0,100,`mutation throttling refill rate`),this.bucketSize=rd(this.options.bucketSize??this.bucketSize,0,100,`mutation throttling bucket size`),setInterval((()=>{this.refillBuckets()}),1e3)}},ad=Uint8Array,od=Uint16Array,sd=Uint32Array,cd=new ad([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]),ld=new ad([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]),ud=new ad([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),dd=function(e,t){for(var n=new od(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new sd(n[30]);for(r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return[n,i]},fd=dd(cd,2),pd=fd[0],md=fd[1];pd[28]=258,md[258]=28;for(var hd=dd(ld,0)[1],gd=new od(32768),_d=0;_d<32768;++_d){var vd=(43690&_d)>>>1|(21845&_d)<<1;vd=(61680&(vd=(52428&vd)>>>2|(13107&vd)<<2))>>>4|(3855&vd)<<4,gd[_d]=((65280&vd)>>>8|(255&vd)<<8)>>>1}var yd=function(e,t,n){for(var r=e.length,i=0,a=new od(t);i<r;++i)++a[e[i]-1];var o,s=new od(t);for(i=0;i<t;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new od(1<<t);var c=15-t;for(i=0;i<r;++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;d<=f;++d)o[gd[d]>>>c]=l}else for(o=new od(r),i=0;i<r;++i)o[i]=gd[s[e[i]-1]++]>>>15-e[i];return o},bd=new ad(288);for(_d=0;_d<144;++_d)bd[_d]=8;for(_d=144;_d<256;++_d)bd[_d]=9;for(_d=256;_d<280;++_d)bd[_d]=7;for(_d=280;_d<288;++_d)bd[_d]=8;var xd=new ad(32);for(_d=0;_d<32;++_d)xd[_d]=5;var Sd=yd(bd,9,0),Cd=yd(xd,5,0),wd=function(e){return(e/8>>0)+(7&e&&1)},Td=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof od?od:e instanceof sd?sd:ad)(n-t);return r.set(e.subarray(t,n)),r},Ed=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Dd=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Od=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[new ad(0),0];if(i==1){var o=new ad(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[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var f=a[0].s;for(r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var p=new od(f+1),m=kd(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}));r<i;++r){var v=a[r].s;if(!(p[v]>t))break;h+=_-(1<<m-p[v]),p[v]=t}for(h>>>=g;h>0;){var y=a[r].s;p[y]<t?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 ad(p),m]},kd=function(e,t,n){return e.s==-1?Math.max(kd(e.l,t,n+1),kd(e.r,t,n+1)):t[e.s]=n},Ad=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new od(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(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]},jd=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Md=function(e,t,n){var r=n.length,i=wd(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;a<r;++a)e[i+a+4]=n[a];return 8*(i+4+r)},Nd=function(e,t,n,r,i,a,o,s,c,l,u){Ed(t,u++,n),++i[256];for(var d=Od(i,15),f=d[0],p=d[1],m=Od(a,15),h=m[0],g=m[1],_=Ad(f),v=_[0],y=_[1],b=Ad(h),x=b[0],S=b[1],C=new od(19),w=0;w<v.length;++w)C[31&v[w]]++;for(w=0;w<x.length;++w)C[31&x[w]]++;for(var T=Od(C,7),E=T[0],ee=T[1],D=19;D>4&&!E[ud[D-1]];--D);var te,ne,O,k,re=l+5<<3,ie=jd(i,bd)+jd(a,xd)+o,ae=jd(i,f)+jd(a,h)+o+14+3*D+jd(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(re<=ie&&re<=ae)return Md(t,u,e.subarray(c,c+l));if(Ed(t,u,1+(ae<ie)),u+=2,ae<ie){te=yd(f,p,0),ne=f,O=yd(h,g,0),k=h;var oe=yd(E,ee,0);for(Ed(t,u,y-257),Ed(t,u+5,S-1),Ed(t,u+10,D-4),u+=14,w=0;w<D;++w)Ed(t,u+3*w,E[ud[w]]);u+=3*D;for(var se=[v,x],ce=0;ce<2;++ce){var le=se[ce];for(w=0;w<le.length;++w){var ue=31&le[w];Ed(t,u,oe[ue]),u+=E[ue],ue>15&&(Ed(t,u,le[w]>>>5&127),u+=le[w]>>>12)}}}else te=Sd,ne=bd,O=Cd,k=xd;for(w=0;w<s;++w)if(r[w]>255){ue=r[w]>>>18&31,Dd(t,u,te[ue+257]),u+=ne[ue+257],ue>7&&(Ed(t,u,r[w]>>>23&31),u+=cd[ue]);var de=31&r[w];Dd(t,u,O[de]),u+=k[de],de>3&&(Dd(t,u,r[w]>>>5&8191),u+=ld[de])}else Dd(t,u,te[r[w]]),u+=ne[r[w]];return Dd(t,u,te[256]),u+ne[256]},Pd=new sd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fd=function(){for(var e=new sd(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Id=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Fd[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Ld=function(e,t,n,r,i){return function(e,t,n,r,i,a){var o=e.length,s=new ad(r+o+5*(1+Math.floor(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var d=u+65535;d<o?l=Md(c,l,e.subarray(u,d)):(c[u]=a,l=Md(c,l,e.subarray(u,o)))}else{for(var f=Pd[t-1],p=f>>>13,m=8191&f,h=(1<<n)-1,g=new od(32768),_=new od(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 sd(25e3),S=new od(288),C=new od(32),w=0,T=0,E=(u=0,0),ee=0,D=0;u<o;++u){var te=b(u),ne=32767&u,O=_[te];if(g[ne]=O,_[te]=ne,ee<=u){var k=o-u;if((w>7e3||E>24576)&&k>423){l=Nd(e,c,0,x,S,C,T,E,D,u-D,l),E=w=T=0,D=u;for(var re=0;re<286;++re)S[re]=0;for(re=0;re<30;++re)C[re]=0}var ie=2,ae=0,oe=m,se=ne-O&32767;if(k>2&&te==b(u-se))for(var ce=Math.min(p,k)-1,le=Math.min(32767,u),ue=Math.min(258,k);se<=le&&--oe&&ne!=O;){if(e[u+ie]==e[u+ie-se]){for(var de=0;de<ue&&e[u+de]==e[u+de-se];++de);if(de>ie){if(ie=de,ae=se,de>ce)break;var A=Math.min(se,de-2),fe=0;for(re=0;re<A;++re){var pe=u-se+re+32768&32767,me=pe-g[pe]+32768&32767;me>fe&&(fe=me,O=pe)}}}se+=(ne=O)-(O=g[ne])+32768&32767}if(ae){x[E++]=268435456|md[ie]<<18|hd[ae];var j=31&md[ie],he=31&hd[ae];T+=cd[j]+ld[he],++S[257+j],++C[he],ee=u+ie,++w}else x[E++]=e[u],++S[e[u]]}}l=Nd(e,c,a,x,S,C,T,E,D,u-D,l)}return Td(s,0,r+wd(l)+i)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Rd=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},zd=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Rd(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},Bd=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Vd(e,t){t===void 0&&(t={});var n=Id(),r=e.length;n.p(e);var i=Ld(e,t,Bd(t),8),a=i.length;return zd(i,t),Rd(i,a-8,n.d()),Rd(i,a-4,r),i}function Hd(e,t){var n=e.length;if(typeof TextEncoder<`u`)return new TextEncoder().encode(e);for(var r=new ad(e.length+(e.length>>>1)),i=0,a=function(e){r[i++]=e},o=0;o<n;++o){if(i+5>r.length){var s=new ad(i+8+(n-o<<1));s.set(r),r=s}var c=e.charCodeAt(o);c<128||t?a(c):c<2048?(a(192|c>>>6),a(128|63&c)):c>55295&&c<57344?(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 Td(r,0,i)}function Ud(e,t){return function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(e)%100<rd(100*t,0,100)}var Wd=`[SessionRecording]`,Gd=Ks(Wd),Kd=3e5,qd=[yu.MouseMove,yu.MouseInteraction,yu.Scroll,yu.ViewportResize,yu.Input,yu.TouchMove,yu.MediaInteraction,yu.Drag],Jd=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function Yd(e){return function(e,t){for(var n=``,r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}return n}(Vd(Hd(JSON.stringify(e))),!0)}function Xd(e){return e.type===vu.Custom&&e.data.tag===`sessionIdle`}function Zd(e,t){return t.some((t=>t.matching===`regex`&&new RegExp(t.url).test(e)))}var Qd=class{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return V==null||(e=V.__PosthogExtensions__)==null||(t=e.rrweb)==null?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw Error(Wd+` must be started with a valid sessionManager.`);return this.instance.sessionManager}get fullSnapshotIntervalMillis(){return this.triggerStatus===`trigger_pending`?6e4:this.instance.config.session_recording?.full_snapshot_interval_millis??Kd}get isSampled(){var e=this.instance.get_property(mc);return Hs(e)?e:null}get sessionDuration(){var e=this.buffer?.data[this.buffer?.data.length-1],{sessionStartTimestamp:t}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return e?e.timestamp-t:null}get isRecordingEnabled(){var e=!!this.instance.get_property(oc),t=!this.instance.config.disable_session_recording;return z&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(sc);return this.instance.config.enable_recording_console_log??e}get canvasRecording(){var e,t=this.instance.config.session_recording.captureCanvas,n=this.instance.get_property(lc),r=(e=t?.recordCanvas??n?.enabled)!=null&&e,i=t?.canvasFps??n?.fps??0,a=t?.canvasQuality??n?.quality??0;return{enabled:r,fps:rd(i,0,12,`canvas recording fps`),quality:rd(a,0,1,`canvas recording quality`)}}get networkPayloadCapture(){var e=this.instance.get_property(cc),t={recordHeaders:this.instance.config.session_recording?.recordHeaders,recordBody:this.instance.config.session_recording?.recordBody},n=t?.recordHeaders||e?.recordHeaders,r=t?.recordBody||e?.recordBody,i=Fs(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Hs(i)?i:e?.capturePerformance);return n||r||a?{recordHeaders:n,recordBody:r,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(uc);return Vs(e)?e:null}get minimumDuration(){var e=this.instance.get_property(dc);return Vs(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?!1===this.isSampled?`disabled`:this._urlBlocked?`paused`:Bs(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus===`trigger_pending`?`buffering`:Hs(this.isSampled)?this.isSampled?`sampled`:`disabled`:`active`:`buffering`:`disabled`:`buffering`}get urlTriggerStatus(){return this._urlTriggers.length===0?`trigger_disabled`:this.instance?.get_property(hc)===this.sessionId?`trigger_activated`:`trigger_pending`}get eventTriggerStatus(){return this._eventTriggers.length===0?`trigger_disabled`:this.instance?.get_property(gc)===this.sessionId?`trigger_activated`:`trigger_pending`}get triggerStatus(){var e=this.eventTriggerStatus===`trigger_activated`||this.urlTriggerStatus===`trigger_activated`,t=this.eventTriggerStatus===`trigger_pending`||this.urlTriggerStatus===`trigger_pending`;return e?`trigger_activated`:t?`trigger_pending`:`trigger_disabled`}constructor(e){if(K(this,`queuedRRWebEvents`,[]),K(this,`isIdle`,!1),K(this,`_linkedFlagSeen`,!1),K(this,`_lastActivityTimestamp`,Date.now()),K(this,`_linkedFlag`,null),K(this,`_removePageViewCaptureHook`,void 0),K(this,`_onSessionIdListener`,void 0),K(this,`_persistDecideOnSessionListener`,void 0),K(this,`_samplingSessionListener`,void 0),K(this,`_urlTriggers`,[]),K(this,`_urlBlocklist`,[]),K(this,`_urlBlocked`,!1),K(this,`_eventTriggers`,[]),K(this,`_removeEventTriggerCaptureHook`,void 0),K(this,`_forceAllowLocalhostNetworkCapture`,!1),K(this,`_onBeforeUnload`,(()=>{this._flushBuffer()})),K(this,`_onOffline`,(()=>{this._tryAddCustomEvent(`browser offline`,{})})),K(this,`_onOnline`,(()=>{this._tryAddCustomEvent(`browser online`,{})})),K(this,`_onVisibilityChange`,(()=>{if(B!=null&&B.visibilityState){var e=`window `+B.visibilityState;this._tryAddCustomEvent(e,{})}})),this.instance=e,this._captureStarted=!1,this._endpoint=`/s/`,this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Gd.error(`started without valid sessionManager`),Error(Wd+` started without valid sessionManager. This is a bug.`);if(this.instance.config.__preview_experimental_cookieless_mode)throw Error(Wd+` cannot be used with __preview_experimental_cookieless_mode.`);var{sessionId:t,windowId:n}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=n,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Gd.warn(`session_idle_threshold_ms (${this.sessionIdleThresholdMilliseconds}) is greater than the session timeout (${this.sessionManager.sessionTimeoutMs}). Session will never be detected as idle`)}startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),Ts(z,`beforeunload`,this._onBeforeUnload),Ts(z,`offline`,this._onOffline),Ts(z,`online`,this._onOnline),Ts(z,`visibilitychange`,this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),Bs(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on(`eventCaptured`,(e=>{try{if(e.event===`$pageview`){var t=e!=null&&e.properties.$current_url?this._maskUrl(e?.properties.$current_url):``;if(!t)return;this._tryAddCustomEvent(`$pageview`,{href:t})}}catch(e){Gd.error(`Could not add $pageview to rrweb session`,e)}}))),this._onSessionIdListener||=this.sessionManager.onSessionId(((e,t,n)=>{var r,i,a,o;n&&(this._tryAddCustomEvent(`$session_id_change`,{sessionId:e,windowId:t,changeReason:n}),(r=this.instance)==null||(i=r.persistence)==null||i.unregister(gc),(a=this.instance)==null||(o=a.persistence)==null||o.unregister(hc))}))):this.stopRecording()}stopRecording(){var e,t,n,r;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,z?.removeEventListener(`beforeunload`,this._onBeforeUnload),z?.removeEventListener(`offline`,this._onOffline),z?.removeEventListener(`online`,this._onOnline),z?.removeEventListener(`visibilitychange`,this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),(e=this._removePageViewCaptureHook)==null||e.call(this),this._removePageViewCaptureHook=void 0,(t=this._removeEventTriggerCaptureHook)==null||t.call(this),this._removeEventTriggerCaptureHook=void 0,(n=this._onSessionIdListener)==null||n.call(this),this._onSessionIdListener=void 0,(r=this._samplingSessionListener)==null||r.call(this),this._samplingSessionListener=void 0,Gd.info(`stopped`))}makeSamplingDecision(e){var t,n=this.sessionId!==e,r=this.sampleRate;if(Vs(r)){var i=this.isSampled,a=n||!Hs(i),o=a?Ud(e,r):i;a&&(o?this._reportStarted(`sampled`):Gd.warn(`Sample rate (${r}) has determined that this sessionId (${e}) will not be sent to the server.`),this._tryAddCustomEvent(`samplingDecisionMade`,{sampleRate:r,isSampled:o})),(t=this.instance.persistence)==null||t.register({[mc]:o})}else{var s;(s=this.instance.persistence)==null||s.register({[mc]:null})}}onRemoteConfig(e){var t,n,r,i;if((this._tryAddCustomEvent(`$remote_config_received`,e),this._persistRemoteConfig(e),this._linkedFlag=e.sessionRecording?.linkedFlag||null,(t=e.sessionRecording)!=null&&t.endpoint)&&(this._endpoint=e.sessionRecording?.endpoint),this._setupSampling(),!Bs(this._linkedFlag)&&!this._linkedFlagSeen){var a=Ls(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,o=Ls(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((e,t)=>{var n=Fs(t)&&a in t,r=o?t[a]===o:n;r&&this._reportStarted(`linked_flag_matched`,{linkedFlag:a,linkedVariant:o}),this._linkedFlagSeen=r}))}(n=e.sessionRecording)!=null&&n.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),(r=e.sessionRecording)!=null&&r.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),(i=e.sessionRecording)!=null&&i.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){Vs(this.sampleRate)&&Bs(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((e=>{this.makeSamplingDecision(e)})))}_persistRemoteConfig(e){if(this.instance.persistence){var t,n=this.instance.persistence,r=()=>{var t=e.sessionRecording?.sampleRate,r=Bs(t)?null:parseFloat(t),i=e.sessionRecording?.minimumDurationMilliseconds;n.register({[oc]:!!e.sessionRecording,[sc]:e.sessionRecording?.consoleLogRecordingEnabled,[cc]:G({capturePerformance:e.capturePerformance},e.sessionRecording?.networkPayloadCapture),[lc]:{enabled:e.sessionRecording?.recordCanvas,fps:e.sessionRecording?.canvasFps,quality:e.sessionRecording?.canvasQuality},[uc]:r,[dc]:U(i)?null:i,[fc]:e.sessionRecording?.scriptConfig})};r(),(t=this._persistDecideOnSessionListener)==null||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(r)}}log(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`log`;(t=this.instance.sessionRecording)==null||t.onRRwebEmit({type:6,data:{plugin:`rrweb/console@1`,payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!U(Object.assign)&&!U(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,n;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():(t=V.__PosthogExtensions__)==null||(n=t.loadExternalDependency)==null||n.call(t,this.instance,this.scriptName,(e=>{if(e)return Gd.error(`could not load recorder`,e);this._onScriptLoaded()})),Gd.info(`starting`),this.status===`active`&&this._reportStarted(e||`recording_initialized`)}}get scriptName(){var e,t,n;return((e=this.instance)==null||(t=e.persistence)==null||(n=t.get_property(fc))==null?void 0:n.script)||`recorder`}isInteractiveEvent(e){return e.type===3&&qd.indexOf(e.data?.source)!==-1}_updateWindowAndSessionIds(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent(`sessionIdle`,{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent(`sessionNoLongerIdle`,{reason:`user activity`,type:e.type}),n=!0)),!this.isIdle){var{windowId:r,sessionId:i}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),a=this.sessionId!==i,o=this.windowId!==r;this.windowId=r,this.sessionId=i,a||o?(this.stopRecording(),this.startIfEnabledOrStop(`session_id_changed`)):n&&this._scheduleFullSnapshot()}}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Gd.warn(`could not emit queued rrweb event.`,t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(Jd((()=>this.rrwebRecord.addCustomEvent(e,t))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(Jd((()=>this.rrwebRecord.takeFullSnapshot())))}_onScriptLoaded(){var e={blockClass:`ph-no-capture`,blockSelector:void 0,ignoreClass:`ph-ignore-input`,maskTextClass:`ph-mask`,maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},t=this.instance.config.session_recording;for(var[n,r]of Object.entries(t||{}))n in e&&(n===`maskInputOptions`?e.maskInputOptions=G({password:!0},r):e[n]=r);if(this.canvasRecording&&this.canvasRecording.enabled&&(e.recordCanvas=!0,e.sampling={canvas:this.canvasRecording.fps},e.dataURLOptions={type:`image/webp`,quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=this.mutationRateLimiter??new id(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(e,t)=>{var n=`Too many mutations on node '${e}'. Rate limiting. This could be due to SVG animations or something similar`;Gd.info(n,{node:t}),this.log(Wd+` `+n,`warn`)}});var i=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(G({emit:e=>{this.onRRwebEmit(e)},plugins:i},e)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent(`$session_options`,{sessionRecordingOptions:e,activePlugins:i.map((e=>e?.name))}),this._tryAddCustomEvent(`$posthog_config`,{config:this.instance.config})}else Gd.error(`onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.`)}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval((()=>{this._tryTakeFullSnapshot()}),e))}}_gatherRRWebPlugins(){var e,t,n,r,i=[],a=(e=V.__PosthogExtensions__)==null||(t=e.rrwebPlugins)==null?void 0:t.getRecordConsolePlugin;a&&this.isConsoleLogCaptureEnabled&&i.push(a());var o=(n=V.__PosthogExtensions__)==null||(r=n.rrwebPlugins)==null?void 0:r.getRecordNetworkPlugin;return this.networkPayloadCapture&&Ps(o)&&(!cl.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(o(nd(this.instance.config,this.networkPayloadCapture))):Gd.info(`NetworkCapture not started because we are on localhost.`)),i}onRRwebEmit(e){var t;if(this._processQueuedEvents(),e&&Fs(e)){if(e.type===vu.Meta){var n=this._maskUrl(e.data.href);if(this._lastHref=n,!n)return;e.data.href=n}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),this.status!==`paused`||function(e){return e.type===vu.Custom&&e.data.tag===`recording paused`}(e)){e.type===vu.FullSnapshot&&this._scheduleFullSnapshot(),e.type===vu.FullSnapshot&&this.triggerStatus===`trigger_pending`&&this.clearBuffer();var r=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(r){var i=function(e){var t=e;if(t&&Fs(t)&&t.type===6&&Fs(t.data)&&t.data.plugin===`rrweb/console@1`){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push(`...[truncated]`));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+`...[truncated]`):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(r);if(this._updateWindowAndSessionIds(i),!this.isIdle||Xd(i)){if(Xd(i)){var a=i.data.payload;a&&(i.timestamp=a.lastActivityTimestamp+a.threshold)}var o=(t=this.instance.config.session_recording.compress_events)==null||t?function(e){if(gu(e)<1024)return e;try{if(e.type===vu.FullSnapshot)return G(G({},e),{},{data:Yd(e.data),cv:`2024-10`});if(e.type===vu.IncrementalSnapshot&&e.data.source===yu.Mutation)return G(G({},e),{},{cv:`2024-10`,data:G(G({},e.data),{},{texts:Yd(e.data.texts),attributes:Yd(e.data.attributes),removes:Yd(e.data.removes),adds:Yd(e.data.adds)})});if(e.type===vu.IncrementalSnapshot&&e.data.source===yu.StyleSheetRule)return G(G({},e),{},{cv:`2024-10`,data:G(G({},e.data),{},{adds:Yd(e.data.adds),removes:Yd(e.data.removes)})})}catch(e){Gd.error(`could not compress event - will use uncompressed event`,e)}return e}(i):i,s={$snapshot_bytes:gu(o),$snapshot_data:o,$session_id:this.sessionId,$window_id:this.windowId};this.status===`disabled`?this.clearBuffer():this._captureSnapshotBuffered(s)}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&z){var e=this._maskUrl(z.location.href);this._lastHref!==e&&(this._tryAddCustomEvent(`$url_changed`,{href:e}),this._lastHref=e)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach((e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)}))}}_maskUrl(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n={url:e};return(n=t.maskNetworkRequestFn(n))?.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&=(clearTimeout(this.flushBufferTimer),void 0);var e=this.minimumDuration,t=this.sessionDuration,n=Vs(t)&&t>=0,r=Vs(e)&&n&&t<e;return this.status===`buffering`||this.status===`paused`||r?(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3),this.buffer):(this.buffer.data.length>0&&_u(this.buffer).forEach((e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:`web`,$lib_version:ls.LIB_VERSION})})),this.clearBuffer())}_captureSnapshotBuffered(e){var t=2+(this.buffer?.data.length||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+t>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3))}_captureSnapshot(e){this.instance.capture(`$snapshot`,e,{_url:this.instance.requestRouter.endpointFor(`api`,this._endpoint),_noTruncate:!0,_batchKey:`recordings`,skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(z!==void 0&&z.location.href){var e=z.location.href,t=this.status===`paused`,n=Zd(e,this._urlBlocklist);n&&!t?this._pauseRecording():!n&&t&&this._resumeRecording(),Zd(e,this._urlTriggers)&&this._activateTrigger(`url`)}}_activateTrigger(e){var t,n;this.triggerStatus===`trigger_pending`&&((t=this.instance)==null||(n=t.persistence)==null||n.register({[e===`url`?hc:gc]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+`_trigger_matched`))}_pauseRecording(){this.status!==`paused`&&(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Gd.info(`recording paused due to URL blocker`),this._tryAddCustomEvent(`recording paused`,{reason:`url blocker`}))}_resumeRecording(){this.status===`paused`&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent(`recording resumed`,{reason:`left blocked url`}),Gd.info(`recording resumed`))}_addEventTriggerListener(){this._eventTriggers.length!==0&&Bs(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on(`eventCaptured`,(e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger(`event`)}catch(e){Gd.error(`Could not activate event trigger`,e)}})))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted(`linked_flag_overridden`)}overrideSampling(){var e;(e=this.instance.persistence)==null||e.register({[mc]:!0}),this._tryTakeFullSnapshot(),this._reportStarted(`sampling_overridden`)}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),Gd.info(e.replace(`_`,` `),t),H([`recording_initialized`,`session_id_changed`],e)||this._tryAddCustomEvent(e,t)}},$d=Ks(`[RemoteConfig]`),ef=class{constructor(e){this.instance=e}get remoteConfig(){var e,t;return(e=V._POSTHOG_REMOTE_CONFIG)==null||(t=e[this.instance.config.token])==null?void 0:t.config}_loadRemoteConfigJs(e){var t,n,r;(t=V.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=V.__PosthogExtensions__)==null||(r=n.loadExternalDependency)==null||r.call(n,this.instance,`remote-config`,(()=>e(this.remoteConfig))):($d.error(`PostHog Extensions not found. Cannot load remote config.`),e())}_loadRemoteConfigJSON(e){this.instance._send_request({method:`GET`,url:this.instance.requestRouter.endpointFor(`assets`,`/array/${this.instance.config.token}/config`),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return $d.info(`Using preloaded remote config`,this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void $d.warn(`Remote config is disabled. Falling back to local config.`);this._loadRemoteConfigJs((e=>{if(!e)return $d.info(`No config found after loading remote JS config. Falling back to JSON.`),void this._loadRemoteConfigJSON((e=>{this.onRemoteConfig(e)}));this.onRemoteConfig(e)}))}catch(e){$d.error(`Error loading remote config`,e)}}onRemoteConfig(e){e?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this.instance.featureFlags.ensureFlagsLoaded()):$d.info(`__preview_remote_config is disabled. Logging config instead`,e):$d.error(`Failed to fetch remote config from PostHog.`)}},tf,nf=z!=null&&z.location?pl(z.location.hash,`__posthog`)||pl(location.hash,`state`):null,rf=`_postHogToolbarParams`,af=Ks(`[Toolbar]`);(function(e){e[e.UNINITIALIZED=0]=`UNINITIALIZED`,e[e.LOADING=1]=`LOADING`,e[e.LOADED=2]=`LOADED`})(tf||={});var of=class{constructor(e){this.instance=e}setToolbarState(e){V.ph_toolbar_state=e}getToolbarState(){return V.ph_toolbar_state??tf.UNINITIALIZED}maybeLoadToolbar(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!z||!B)return!1;e??=z.location,n??=z.history;try{if(!t){try{z.localStorage.setItem(`test`,`test`),z.localStorage.removeItem(`test`)}catch{return!1}t=z?.localStorage}var r,i=nf||pl(e.hash,`__posthog`)||pl(e.hash,`state`),a=i?vs((()=>JSON.parse(atob(decodeURIComponent(i)))))||vs((()=>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(rf)||`{}`)).source=`localstorage`,delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}_callLoadToolbar(e){var t=V.ph_load_toolbar||V.ph_load_editor;!Bs(t)&&Ps(t)?t(e,this.instance):af.warn(`No toolbar load function found`)}loadToolbar(e){var t=!(B==null||!B.getElementById(jc));if(!z||t)return!1;var n=this.instance.requestRouter.region===`custom`&&this.instance.config.advanced_disable_toolbar_metrics,r=G(G({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor(`ui`)},n?{instrument:!1}:{});if(z.localStorage.setItem(rf,JSON.stringify(G(G({},r),{},{source:void 0}))),this.getToolbarState()===tf.LOADED)this._callLoadToolbar(r);else if(this.getToolbarState()===tf.UNINITIALIZED){var i,a;this.setToolbarState(tf.LOADING),(i=V.__PosthogExtensions__)==null||(a=i.loadExternalDependency)==null||a.call(i,this.instance,`toolbar`,(e=>{if(e)return af.error(`[Toolbar] Failed to load`,e),void this.setToolbarState(tf.UNINITIALIZED);this.setToolbarState(tf.LOADED),this._callLoadToolbar(r)})),Ts(z,`turbolinks:load`,(()=>{this.setToolbarState(tf.UNINITIALIZED),this.loadToolbar(r)}))}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}},sf=3e3,cf=class{constructor(e,t){K(this,`isPaused`,!0),K(this,`queue`,[]),this.flushTimeoutMs=rd(t?.flush_interval_ms||sf,250,5e3,`flush interval`,sf),this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var e=this.queue.length>0?this.formatQueue():{},t=Object.values(e);[...t.filter((e=>e.url.indexOf(`/e`)===0)),...t.filter((e=>e.url.indexOf(`/e`)!==0))].map((e=>{this.sendRequest(G(G({},e),{},{transport:`sendBeacon`}))}))}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((()=>{if(this.clearFlushTimeout(),this.queue.length>0){var t=this.formatQueue(),n=function(n){var r=t[n],i=new Date().getTime();r.data&&Ns(r.data)&&ms(r.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return ms(this.queue,(t=>{var n,r=t,i=(r?r.batchKey:null)||r.url;U(e[i])&&(e[i]=G(G({},r),{},{data:[]})),(n=e[i].data)==null||n.push(r.data)})),this.queue=[],e}},lf=function(e){var t,n,r,i,a=``;for(t=n=0,r=(e=(e+``).replace(/\r\n/g,`
|
|
147
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oa(e,t){if(e){if(typeof e==`string`)return ka(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ka(e,t):void 0}}function ka(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Aa(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ja(e){if(Array.isArray(e))return e}function Ma(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ma(Object(n),!0).forEach(function(t){Na(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ma(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Na(e,t,n){return(t=Pa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pa(e){var t=Fa(e,`string`);return Ca(t)==`symbol`?t:t+``}function Fa(e,t){if(Ca(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ca(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Ia={name:`BaseComponent`,props:{pt:{type:Object,default:void 0},ptOptions:{type:Object,default:void 0},unstyled:{type:Boolean,default:void 0},dt:{type:Object,default:void 0}},inject:{$parentInstance:{default:void 0}},watch:{isUnstyled:{immediate:!0,handler:function(e){Ei.off(`theme:change`,this._loadCoreStyles),e||(this._loadCoreStyles(),this._themeChangeListener(this._loadCoreStyles))}},dt:{immediate:!0,handler:function(e,t){var n=this;Ei.off(`theme:change`,this._themeScopedListener),e?(this._loadScopedThemeStyles(e),this._themeScopedListener=function(){return n._loadScopedThemeStyles(e)},this._themeChangeListener(this._themeScopedListener)):this._unloadScopedThemeStyles()}}},scopedStyleEl:void 0,rootEl:void 0,uid:void 0,$attrSelector:void 0,beforeCreate:function(){var e,t,n,r,i,a,o,s,c,l,u=this.pt?._usept,d=u?(e=this.pt)==null||(e=e.originalValue)==null?void 0:e[this.$.type.name]:void 0;(n=(u?(t=this.pt)==null||(t=t.value)==null?void 0:t[this.$.type.name]:this.pt)||d)==null||(n=n.hooks)==null||(r=n.onBeforeCreate)==null||r.call(n);var f=(i=this.$primevueConfig)==null||(i=i.pt)==null?void 0:i._usept,p=f?(a=this.$primevue)==null||(a=a.config)==null||(a=a.pt)==null?void 0:a.originalValue:void 0;(c=(f?(o=this.$primevue)==null||(o=o.config)==null||(o=o.pt)==null?void 0:o.value:(s=this.$primevue)==null||(s=s.config)==null?void 0:s.pt)||p)==null||(c=c[this.$.type.name])==null||(c=c.hooks)==null||(l=c.onBeforeCreate)==null||l.call(c),this.$attrSelector=xa(),this.uid=this.$attrs.id||this.$attrSelector.replace(`pc`,`pv_id_`)},created:function(){this._hook(`onCreated`)},beforeMount:function(){this.rootEl=ir(Qn(this.$el)?this.$el:this.$el?.parentElement,`[${this.$attrSelector}]`),this.rootEl&&(this.rootEl.$pc=R({name:this.$.type.name,attrSelector:this.$attrSelector},this.$params)),this._loadStyles(),this._hook(`onBeforeMount`)},mounted:function(){this._hook(`onMounted`)},beforeUpdate:function(){this._hook(`onBeforeUpdate`)},updated:function(){this._hook(`onUpdated`)},beforeUnmount:function(){this._hook(`onBeforeUnmount`)},unmounted:function(){this._removeThemeListeners(),this._unloadScopedThemeStyles(),this._hook(`onUnmounted`)},methods:{_hook:function(e){if(!this.$options.hostName){var t=this._usePT(this._getPT(this.pt,this.$.type.name),this._getOptionValue,`hooks.${e}`),n=this._useDefaultPT(this._getOptionValue,`hooks.${e}`);t?.(),n?.()}},_mergeProps:function(e){var t=[...arguments].slice(1);return Vr(e)?e.apply(void 0,t):M.apply(void 0,t)},_load:function(){qi.isStyleNameLoaded(`base`)||(L.loadCSS(this.$styleOptions),this._loadGlobalStyles(),qi.setLoadedStyleName(`base`)),this._loadThemeStyles()},_loadStyles:function(){this._load(),this._themeChangeListener(this._load)},_loadCoreStyles:function(){var e;!qi.isStyleNameLoaded(this.$style?.name)&&(e=this.$style)!=null&&e.name&&(Sa.loadCSS(this.$styleOptions),this.$options.style&&this.$style.loadCSS(this.$styleOptions),qi.setLoadedStyleName(this.$style.name))},_loadGlobalStyles:function(){var e=this._useGlobalPT(this._getOptionValue,`global.css`,this.$params);I(e)&&L.load(e,R({name:`global`},this.$styleOptions))},_loadThemeStyles:function(){var e;if(!(this.isUnstyled||this.$theme===`none`)){if(!Ki.isStyleNameLoaded(`common`)){var t,n,r=((t=this.$style)==null||(n=t.getCommonTheme)==null?void 0:n.call(t))||{},i=r.primitive,a=r.semantic,o=r.global,s=r.style;L.load(i?.css,R({name:`primitive-variables`},this.$styleOptions)),L.load(a?.css,R({name:`semantic-variables`},this.$styleOptions)),L.load(o?.css,R({name:`global-variables`},this.$styleOptions)),L.loadStyle(R({name:`global-style`},this.$styleOptions),s),Ki.setLoadedStyleName(`common`)}if(!Ki.isStyleNameLoaded(this.$style?.name)&&(e=this.$style)!=null&&e.name){var c,l,u,d,f=((c=this.$style)==null||(l=c.getComponentTheme)==null?void 0:l.call(c))||{},p=f.css,m=f.style;(u=this.$style)==null||u.load(p,R({name:`${this.$style.name}-variables`},this.$styleOptions)),(d=this.$style)==null||d.loadStyle(R({name:`${this.$style.name}-style`},this.$styleOptions),m),Ki.setLoadedStyleName(this.$style.name)}if(!Ki.isStyleNameLoaded(`layer-order`)){var h,g,_=(h=this.$style)==null||(g=h.getLayerOrderThemeCSS)==null?void 0:g.call(h);L.load(_,R({name:`layer-order`,first:!0},this.$styleOptions)),Ki.setLoadedStyleName(`layer-order`)}}},_loadScopedThemeStyles:function(e){var t,n,r=(((t=this.$style)==null||(n=t.getPresetTheme)==null?void 0:n.call(t,e,`[${this.$attrSelector}]`))||{}).css;this.scopedStyleEl=(this.$style?.load(r,R({name:`${this.$attrSelector}-${this.$style.name}`},this.$styleOptions))).el},_unloadScopedThemeStyles:function(){var e;(e=this.scopedStyleEl)==null||(e=e.value)==null||e.remove()},_themeChangeListener:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};qi.clearLoadedStyleNames(),Ei.on(`theme:change`,e)},_removeThemeListeners:function(){Ei.off(`theme:change`,this._loadCoreStyles),Ei.off(`theme:change`,this._load),Ei.off(`theme:change`,this._themeScopedListener)},_getHostInstance:function(e){return e?this.$options.hostName?e.$.type.name===this.$options.hostName?e:this._getHostInstance(e.$parentInstance):e.$parentInstance:void 0},_getPropValue:function(e){return this[e]||this._getHostInstance(this)?.[e]},_getOptionValue:function(e){return $r(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{})},_getPTValue:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=/./g.test(t)&&!!n[t.split(`.`)[0]],a=this._getPropValue(`ptOptions`)||this.$primevueConfig?.ptOptions||{},o=a.mergeSections,s=o===void 0?!0:o,c=a.mergeProps,l=c===void 0?!1:c,u=r?i?this._useGlobalPT(this._getPTClassValue,t,n):this._useDefaultPT(this._getPTClassValue,t,n):void 0,d=i?void 0:this._getPTSelf(e,this._getPTClassValue,t,R(R({},n),{},{global:u||{}})),f=this._getPTDatasets(t);return s||!s&&d?l?this._mergeProps(l,u,d,f):R(R(R({},u),d),f):R(R({},d),f)},_getPTSelf:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=[...arguments].slice(1);return M(this._usePT.apply(this,[this._getPT(e,this.$name)].concat(t)),this._usePT.apply(this,[this.$_attrsPT].concat(t)))},_getPTDatasets:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=`data-pc-`,n=e===`root`&&I(this.pt?.[`data-pc-section`]);return e!==`transition`&&R(R({},e===`root`&&R(R(Na({},`${t}name`,Qr(n?this.pt?.[`data-pc-section`]:this.$.type.name)),n&&Na({},`${t}extend`,Qr(this.$.type.name))),{},Na({},`${this.$attrSelector}`,``))),{},Na({},`${t}section`,Qr(e)))},_getPTClassValue:function(){var e=this._getOptionValue.apply(this,arguments);return Zr(e)||ei(e)?{class:e}:e},_getPT:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,r=arguments.length>2?arguments[2]:void 0,i=function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=r?r(e):e,o=Qr(n),s=Qr(t.$name);return(i&&o===s?void 0:a?.[o])??a};return e!=null&&e.hasOwnProperty(`_usept`)?{_usept:e._usept,originalValue:i(e.originalValue),value:i(e.value)}:i(e,!0)},_usePT:function(e,t,n,r){var i=function(e){return t(e,n,r)};if(e!=null&&e.hasOwnProperty(`_usept`)){var a=e._usept||this.$primevueConfig?.ptOptions||{},o=a.mergeSections,s=o===void 0?!0:o,c=a.mergeProps,l=c===void 0?!1:c,u=i(e.originalValue),d=i(e.value);return u===void 0&&d===void 0?void 0:Zr(d)?d:Zr(u)?u:s||!s&&d?l?this._mergeProps(l,u,d):R(R({},u),d):d}return i(e)},_useGlobalPT:function(e,t,n){return this._usePT(this.globalPT,e,t,n)},_useDefaultPT:function(e,t,n){return this._usePT(this.defaultPT,e,t,n)},ptm:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._getPTValue(this.pt,e,R(R({},this.$params),t))},ptmi:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=M(this.$_attrsWithoutPT,this.ptm(e,t));return n!=null&&n.hasOwnProperty(`id`)&&(n.id??=this.$id),n},ptmo:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._getPTValue(e,t,R({instance:this},n),!1)},cx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.isUnstyled?void 0:this._getOptionValue(this.$style.classes,e,R(R({},this.$params),t))},sx:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(t){var r=this._getOptionValue(this.$style.inlineStyles,e,R(R({},this.$params),n));return[this._getOptionValue(Sa.inlineStyles,e,R(R({},this.$params),n)),r]}}},computed:{globalPT:function(){var e=this;return this._getPT(this.$primevueConfig?.pt,void 0,function(t){return Xr(t,{instance:e})})},defaultPT:function(){var e=this;return this._getPT(this.$primevueConfig?.pt,void 0,function(t){return e._getOptionValue(t,e.$name,R({},e.$params))||Xr(t,R({},e.$params))})},isUnstyled:function(){return this.unstyled===void 0?this.$primevueConfig?.unstyled:this.unstyled},$id:function(){return this.$attrs.id||this.uid},$inProps:function(){var e=Object.keys(this.$.vnode?.props||{});return Object.fromEntries(Object.entries(this.$props).filter(function(t){var n=Ea(t,1)[0];return e?.includes(n)}))},$theme:function(){return this.$primevueConfig?.theme},$style:function(){return R(R({classes:void 0,inlineStyles:void 0,load:function(){},loadCSS:function(){},loadStyle:function(){}},(this._getHostInstance(this)||{}).$style),this.$options.style)},$styleOptions:function(){var e;return{nonce:(e=this.$primevueConfig)==null||(e=e.csp)==null?void 0:e.nonce}},$primevueConfig:function(){return this.$primevue?.config},$name:function(){return this.$options.hostName||this.$.type.name},$params:function(){var e=this._getHostInstance(this)||this.$parent;return{instance:this,props:this.$props,state:this.$data,attrs:this.$attrs,parent:{instance:e,props:e?.$props,state:e?.$data,attrs:e?.$attrs}}},$_attrsPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){return Ea(e,1)[0]?.startsWith(`pt:`)}).reduce(function(e,t){var n=Ea(t,2),r=n[0],i=n[1];return ka(wa(r.split(`:`))).slice(1)?.reduce(function(e,t,n,r){return!e[t]&&(e[t]=n===r.length-1?i:{}),e[t]},e),e},{})},$_attrsWithoutPT:function(){return Object.entries(this.$attrs||{}).filter(function(e){var t=Ea(e,1)[0];return!(t!=null&&t.startsWith(`pt:`))}).reduce(function(e,t){var n=Ea(t,2),r=n[0];return e[r]=n[1],e},{})}}},La,Ra=e=>La=e,za=Symbol();function Ba(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var Va;(function(e){e.direct=`direct`,e.patchObject=`patch object`,e.patchFunction=`patch function`})(Va||={});var Ha=typeof window<`u`,Ua=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function Wa(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function Ga(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){Xa(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function Ka(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function qa(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=document.createEvent(`MouseEvents`);t.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var Ja=typeof navigator==`object`?navigator:{userAgent:``},Ya=/Macintosh/.test(Ja.userAgent)&&/AppleWebKit/.test(Ja.userAgent)&&!/Safari/.test(Ja.userAgent),Xa=Ha?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Ya?Za:`msSaveOrOpenBlob`in Ja?Qa:$a:()=>{};function Za(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?qa(r):Ka(r.href)?Ga(e,t,n):(r.target=`_blank`,qa(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){qa(r)},0))}function Qa(e,t=`download`,n){if(typeof e==`string`)if(Ka(e))Ga(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){qa(t)})}else navigator.msSaveOrOpenBlob(Wa(e,n),t)}function $a(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return Ga(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Ua.HTMLElement))||`safari`in Ua,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Ya)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:eo}=Object;function to(){let e=g(!0),t=e.run(()=>h({})),n=[],r=[],i=y({install(e){Ra(i),i._a=e,e.provide(za,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var no=()=>{};function ro(e,t,n,r=no){e.push(t);let i=()=>{let n=e.indexOf(t);n>-1&&(e.splice(n,1),r())};return!n&&te()&&x(i),i}function io(e,...t){e.slice().forEach(e=>{e(...t)})}var ao=e=>e(),oo=Symbol(),so=Symbol();function co(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!t.hasOwnProperty(n))continue;let r=t[n],i=e[n];Ba(i)&&Ba(r)&&e.hasOwnProperty(n)&&!ee(r)&&!v(r)?e[n]=co(i,r):e[n]=r}return e}var lo=Symbol();function uo(e){return!Ba(e)||!e.hasOwnProperty(lo)}var{assign:fo}=Object;function po(e){return!!(ee(e)&&e.effect)}function mo(e,t,n,i){let{state:a,actions:o,getters:s}=t,c=n.state.value[e],l;function u(){return c||(n.state.value[e]=a?a():{}),fo(r(n.state.value[e]),o,Object.keys(s||{}).reduce((t,r)=>(t[r]=y(Me(()=>{Ra(n);let t=n._s.get(e);return s[r].call(t,t)})),t),{}))}return l=ho(e,u,t,n,i,!0),l}function ho(e,t,r={},i,a,o){let s,c=fo({actions:{}},r),l={deep:!0},u,d,f=[],p=[],m=i.state.value[e];!o&&!m&&(i.state.value[e]={}),h({});let _;function y(t){let n;u=d=!1,typeof t==`function`?(t(i.state.value[e]),n={type:Va.patchFunction,storeId:e,events:void 0}):(co(i.state.value[e],t),n={type:Va.patchObject,payload:t,storeId:e,events:void 0});let r=_=Symbol();ce().then(()=>{_===r&&(u=!0)}),d=!0,io(f,n,i.state.value[e])}let b=o?function(){let{state:e}=r,t=e?e():{};this.$patch(e=>{fo(e,t)})}:no;function x(){s.stop(),f=[],p=[],i._s.delete(e)}let S=(t,n=``)=>{if(oo in t)return t[so]=n,t;let r=function(){Ra(i);let n=Array.from(arguments),a=[],o=[];function s(e){a.push(e)}function c(e){o.push(e)}io(p,{args:n,name:r[so],store:w,after:s,onError:c});let l;try{l=t.apply(this&&this.$id===e?this:w,n)}catch(e){throw io(o,e),e}return l instanceof Promise?l.then(e=>(io(a,e),e)).catch(e=>(io(o,e),Promise.reject(e))):(io(a,l),l)};return r[oo]=!0,r[so]=n,r},w=C({_p:i,$id:e,$onAction:ro.bind(null,p),$patch:y,$reset:b,$subscribe(t,n={}){let r=ro(f,t,n.detached,()=>a()),a=s.run(()=>ue(()=>i.state.value[e],r=>{(n.flush===`sync`?d:u)&&t({storeId:e,type:Va.direct,events:void 0},r)},fo({},l,n)));return r},$dispose:x});i._s.set(e,w);let T=(i._a&&i._a.runWithContext||ao)(()=>i._e.run(()=>(s=g()).run(()=>t({action:S}))));for(let t in T){let n=T[t];ee(n)&&!po(n)||v(n)?o||(m&&uo(n)&&(ee(n)?n.value=m[t]:co(n,m[t])),i.state.value[e][t]=n):typeof n==`function`&&(T[t]=S(n,t),c.actions[t]=n)}return fo(w,T),fo(n(w),T),Object.defineProperty(w,`$state`,{get:()=>i.state.value[e],set:e=>{y(t=>{fo(t,e)})}}),i._p.forEach(e=>{fo(w,s.run(()=>e({store:w,app:i._a,pinia:i,options:c})))}),m&&o&&r.hydrate&&r.hydrate(w.$state,m),u=!0,d=!0,w}function go(e,t,n){let r,i,a=typeof t==`function`;typeof e==`string`?(r=e,i=a?n:t):(i=e,r=e.id);function o(e,n){let o=se();return e||=o?Ve(za,null):null,e&&Ra(e),e=La,e._s.has(r)||(a?ho(r,t,i,e):mo(r,i,e)),e._s.get(r)}return o.$id=r,o}function _o(e){{e=n(e);let t={};for(let n in e){let r=e[n];(ee(r)||v(r))&&(t[n]=u(e,n))}return t}}function vo(e){return te()?(x(e),!0):!1}function yo(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return vo(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t)))}}function bo(e){return typeof e==`function`?e():E(e)}var xo={mounted:`mounted`,updated:`updated`,unmounted:`unmounted`},So=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var Co=e=>e!=null,wo=Object.prototype.toString,To=e=>wo.call(e)===`[object Object]`,Eo=()=>{},Do=Oo();function Oo(){return So&&(window==null?void 0:window.navigator)?.userAgent&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(window==null?void 0:window.navigator)?.maxTouchPoints>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function ko(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}var Ao=e=>e();function jo(e,t={}){let n,r,i=Eo,a=e=>{clearTimeout(e),i(),i=Eo};return o=>{let s=bo(e),c=bo(t.maxWait);return n&&a(n),s<=0||c!==void 0&&c<=0?(r&&=(a(r),null),Promise.resolve(o())):new Promise((e,l)=>{i=t.rejectOnCancel?l:e,c&&!r&&(r=setTimeout(()=>{n&&a(n),r=null,e(o())},c)),n=setTimeout(()=>{r&&a(r),r=null,e(o())},s)})}}function Mo(...e){let t=0,n,r=!0,i=Eo,a,o,s,c,l;!ee(e[0])&&typeof e[0]==`object`?{delay:o,trailing:s=!0,leading:c=!0,rejectOnCancel:l=!1}=e[0]:[o,s=!0,c=!0,l=!1]=e;let u=()=>{n&&(clearTimeout(n),n=void 0,i(),i=Eo)};return e=>{let d=bo(o),f=Date.now()-t,p=()=>a=e();return u(),d<=0?(t=Date.now(),p()):(f>d&&(c||!r)?(t=Date.now(),p()):s&&(a=new Promise((e,a)=>{i=l?a:e,n=setTimeout(()=>{t=Date.now(),r=!0,e(p()),u()},Math.max(0,d-f))})),!c&&!n&&(n=setTimeout(()=>r=!0,d)),r=!1,a)}}function No(e){return e||Te()}function Po(...e){if(e.length!==1)return u(...e);let t=e[0];return typeof t==`function`?S(w(()=>({get:t,set:Eo}))):h(t)}function Fo(e,t=200,n={}){return ko(jo(t,n),e)}function Io(e,t=200,n=!1,r=!0,i=!1){return ko(Mo(t,n,r,i),e)}function Lo(e,t,n={}){let{eventFilter:r=Ao,...i}=n;return ue(e,ko(r,t),i)}function Ro(e,t=!0,n){No()?je(e,n):t?e():ce(e)}function zo(e,t){No(t)&&ae(e,t)}function Bo(e,t,n={}){let{throttle:r=0,trailing:i=!0,leading:a=!0,...o}=n;return Lo(e,t,{...o,eventFilter:Mo(r,i,a)})}function Vo(e,t,n){let r;r=ee(n)?{evaluating:n}:n||{};let{lazy:i=!1,evaluating:a=void 0,shallow:o=!0,onError:s=Eo}=r,c=h(!i),u=o?l(t):h(t),d=0;return pe(async t=>{if(!c.value)return;d++;let n=d,r=!1;a&&Promise.resolve().then(()=>{a.value=!0});try{let i=await e(e=>{t(()=>{a&&(a.value=!1),r||e()})});n===d&&(u.value=i)}catch(e){s(e)}finally{a&&n===d&&(a.value=!1),r=!0}}),i?Me(()=>(c.value=!0,u.value)):u}So&&window.document,So&&window.navigator,So&&window.location;var Ho=33753,Uo=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,Wo=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=Uo[n[e]&63];return t},Go=class{ws=null;listeners=new Map;eventListeners=new Map;reconnectAttempts=0;maxReconnectAttempts=1/0;reconnectDelay=1e3;maxReconnectDelay=3e4;isConnecting=!1;connectionState=`disconnected`;stateChangeListeners=new Set;messageQueue=[];reconnectTimeout=null;currentUrl;constructor(e={}){this.config=e;let t=`ws://localhost:${Ho}`;typeof window<`u`&&window.location.port!==`5173`&&(t=`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}`);let{url:n=t,maxReconnectAttempts:r=1/0,reconnectDelay:i=1e3}=e;this.maxReconnectAttempts=r,this.reconnectDelay=i,this.currentUrl=n,this.isRenderer=typeof window<`u`}connect(e){let t=e||this.currentUrl;if(this.currentUrl=t,this.reconnectTimeout&&=(clearTimeout(this.reconnectTimeout),null),!(this.isConnecting||this.ws?.readyState===WebSocket.OPEN)){this.isConnecting=!0,this.connectionState=`connecting`,this.notifyStateChange();try{this.ws=new WebSocket(t),this.ws.onopen=()=>{console.log(`WebSocket connected to`,t),this.isConnecting=!1,this.reconnectAttempts=0,this.connectionState=`connected`,this.reconnectTimeout&&=(clearTimeout(this.reconnectTimeout),null),this.notifyStateChange();let{logger:e}=Ke();e().debug(`WebSocket client connected successfully`),this.flushQueue()},this.ws.onmessage=e=>{this.handleMessage(e)},this.ws.onclose=e=>{console.log(`WebSocket disconnected`,{code:e.code,reason:e.reason}),this.isConnecting=!1,this.connectionState=`disconnected`,this.notifyStateChange(),this.scheduleReconnect()},this.ws.onerror=e=>{console.error(`WebSocket error:`,e),this.isConnecting=!1,this.connectionState=`error`,this.notifyStateChange()}}catch(e){console.error(`Failed to create WebSocket connection:`,e),this.isConnecting=!1,this.connectionState=`error`,this.notifyStateChange(),this.scheduleReconnect()}}}notifyStateChange(){this.stateChangeListeners.forEach(e=>{try{e(this.connectionState)}catch(e){console.error(`Error in state change listener:`,e)}})}scheduleReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts){console.error(`Max reconnection attempts reached`),this.clearQueue();return}this.reconnectAttempts++;let e=Math.min(this.reconnectDelay*2**(this.reconnectAttempts-1),this.maxReconnectDelay),t=this.maxReconnectAttempts===1/0?`∞`:this.maxReconnectAttempts;this.reconnectTimeout=setTimeout(()=>{this.reconnectTimeout=null,console.log(`Attempting to reconnect (${this.reconnectAttempts}/${t}) in ${e}ms`),this.connect()},e)}handleMessage(e){try{let t=JSON.parse(e.data);if(Qe(t)||qe(t))this.listeners.has(t.requestId)&&this.listeners.get(t.requestId)(t);else if(t.type===`event`&&`channel`in t){let e=t.channel,n=this.eventListeners.get(e);n&&n.forEach(n=>{try{n(t.data)}catch(t){console.error(`Error in event listener for channel ${e}:`,t)}})}else Xe(t)&&console.log(`Received request message:`,t)}catch(e){console.error(`Failed to parse WebSocket message:`,e)}}send(e,t,r){return new Promise(async(i,a)=>{let{logger:o}=Ke();if(!this.ws||this.ws.readyState!==WebSocket.OPEN){o().debug(`WebSocket not ready, queuing message:`,{channel:e,hasData:!!t});let s=Wo();this.messageQueue.push({channel:e,data:n(Ge(t)),resolve:i,reject:a,requestId:s,listener:r});return}this.sendMessage(e,t,i,a,Wo,r)})}sendMessage(e,t,r,i,a,o){let{logger:s}=Ke();if(!this.ws||this.ws.readyState!==WebSocket.OPEN){s().error(`WebSocket send failed: connection not open`),i(new Ze(`WebSocket is not connected`));return}let c=a(),l={channel:e,requestId:c,data:n(Ge(t))};s().debug(`Sending WebSocket message:`,{channel:e,requestId:c,hasData:!!t}),this.listeners.set(c,e=>{if(qe(e))this.listeners.delete(c),i(new Je(e.error,e.code,e.requestId));else if(Qe(e)){let t=e.events;t.type===`end`?(this.listeners.delete(c),r(t.data)):o?o(t):s().info(`Received intermediate event:`,{requestId:c,eventType:t.type,hasData:!!t.data})}});try{this.ws.send(JSON.stringify(l))}catch(e){this.listeners.delete(c),i(new Je(`Failed to send message: ${e instanceof Error?e.message:`Unknown error`}`))}}async flushQueue(){let{logger:e}=Ke();if(this.messageQueue.length===0)return;e().debug(`Flushing ${this.messageQueue.length} queued messages`);let t=[...this.messageQueue];this.messageQueue=[];for(let e of t)this.sendMessage(e.channel,e.data,e.resolve,e.reject,Wo,e.listener)}clearQueue(){let{logger:e}=Ke();if(this.messageQueue.length!==0){e().debug(`Clearing ${this.messageQueue.length} queued messages due to connection error/disconnect`);for(let e of this.messageQueue)e.reject(new Ze(`WebSocket connection lost`));this.messageQueue=[]}}isConnected(){return this.ws?.readyState===WebSocket.OPEN}disconnect(e={clearQueue:!0}){this.connectionState=`disconnected`,this.notifyStateChange(),this.reconnectTimeout&&=(clearTimeout(this.reconnectTimeout),null),e.clearQueue&&this.clearQueue(),this.ws&&=(this.ws.close(),null),this.listeners.clear(),this.reconnectAttempts=0}getConnectionState(){return this.connectionState}onStateChange(e){return this.stateChangeListeners.add(e),()=>{this.stateChangeListeners.delete(e)}}reconnect(e){this.disconnect({clearQueue:!1}),this.connect(e)}on(e,t){return this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t),()=>{this.eventListeners.get(e)?.delete(t)}}},Ko=null,qo=()=>(Ko||=new Go,Ko),Jo=()=>{let{logger:e}=Ke(),t=qo();return{execute:async(n,r,i)=>{try{return await t.send(n,r,i)}catch(t){throw e().error(`WebSocket API error:`,t),t}},isConnected:t.isConnected.bind(t),disconnect:t.disconnect.bind(t),on:t.on.bind(t)}},Yo=go(`ui`,()=>{let e=h(!1),t=h(null),n=h(null);return{isFilePickerVisible:e,filePickerOptions:t,showFilePicker:r=>(e.value=!0,t.value=r,new Promise(e=>{n.value=e})),resolveFilePicker:t=>{e.value=!1,n.value&&=(n.value(t),null)}}}),Xo=()=>{let{logger:e}=Ke(),{execute:t,isConnected:n,on:r}=Jo(),i=Yo(),a=async(r,a,s)=>{if(et.includes(r)){if(window.electron){e().debug(`Routing to Electron IPC:`,r);let t=Math.random().toString(36).substring(7);return new Promise((e,n)=>{let i=window.electron.ipcRenderer.on(r,(t,n)=>{n.type===`end`?(i(),e(n.data)):s?.(n)});window.electron.ipcRenderer.send(r,{requestId:t,data:a})})}else if(r===`dialog:showOpenDialog`)return e().debug(`Falling back to web file picker (open):`,a),{type:`success`,result:await i.showFilePicker({...a,mode:`open`})};else if(r===`dialog:showSaveDialog`)return e().debug(`Falling back to web file picker (save):`,a),{type:`success`,result:await i.showFilePicker({...a,mode:`save`})}}try{return r===`graph:execute`&&!window.electron&&!n()?(e().info(`Routing graph:execute to Cloud Orchestrator`),await o(a,s)):await t(r,a,s)}catch(t){throw e().error(`API execution error:`,t),t}},o=async(e,t)=>{let{supabase:n}=await tt(async()=>{let{supabase:e}=await import(`./src-FykJawTA.js`).then(e=>e.n);return{supabase:e}},__vite__mapDeps([0,1,2,3,4])),r=n();if(!r)throw Error(`Supabase is not available for cloud execution`);let{data:i,error:a}=await r.functions.invoke(`cloud-run`,{body:{pipeline:e.graph,options:{os:`windows`}}});if(a)throw a;let{runId:o}=i;return new Promise((e,n)=>{let i=r.channel(`cloud-logs-${o}`).on(`postgres_changes`,{event:`INSERT`,schema:`public`,table:`cloud_run_logs`,filter:`run_id=eq.${o}`},e=>{let n=e.new;n.type===`node-enter`?t?.({type:`node-enter`,data:{nodeUid:n.node_uid}}):n.type===`node-exit`?t?.({type:`node-exit`,data:{nodeUid:n.node_uid}}):n.type===`log`&&t?.({type:`node-log`,data:{nodeUid:n.node_uid,logData:{message:[n.message],timestamp:new Date(n.created_at).getTime()}}})}).subscribe(),a=r.channel(`cloud-status-${o}`).on(`postgres_changes`,{event:`UPDATE`,schema:`public`,table:`cloud_runs`,filter:`id=eq.${o}`},t=>{let n=t.new;n.status===`success`?(a.unsubscribe(),i.unsubscribe(),e({type:`success`,result:{}})):n.status===`failed`&&(a.unsubscribe(),i.unsubscribe(),e({type:`error`,code:`error`,ipcError:`Cloud execution failed`}))}).subscribe()})};return{send:(t,n)=>(e().warn(`useAPI.send() is deprecated. Use useAPI.execute() instead.`),a(t,n)),on:(e,t)=>r(e,t),execute:a,isConnected:n}},Zo=(e,t)=>window.electron?window.electron.ipcRenderer.on(e,(e,n)=>{let{data:r,requestId:i}=n;return t(e,{send:e=>window.electron.ipcRenderer.send(i,e),value:r})}):(console.warn(`[Handlers] Electron not available, skipping handler for channel: ${e}`),()=>{}),Qo,z=typeof window<`u`?window:void 0,$o=typeof globalThis<`u`?globalThis:z,es=Array.prototype,ts=es.forEach,ns=es.indexOf,rs=$o?.navigator,B=$o?.document,is=$o?.location,as=$o?.fetch,os=$o!=null&&$o.XMLHttpRequest&&`withCredentials`in new $o.XMLHttpRequest?$o.XMLHttpRequest:void 0,ss=$o?.AbortController,cs=rs?.userAgent,V=z??{},ls={DEBUG:!1,LIB_VERSION:`1.215.0`},us=`$copy_autocapture`,ds=[`$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`];(function(e){e.GZipJS=`gzip-js`,e.Base64=`base64`})(Qo||={});var fs={};function ps(e,t,n){if(Ns(e)){if(ts&&e.forEach===ts)e.forEach(t,n);else if(`length`in e&&e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===fs)return}}}function ms(e,t,n){if(!Bs(e)){if(Ns(e))return ps(e,t,n);if(Us(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===fs)return}else for(var i in e)if(js.call(e,i)&&t.call(n,e[i],i)===fs)return}}var hs=function(e){return ps([...arguments].slice(1),(function(t){for(var n in t)t[n]!==void 0&&(e[n]=t[n])})),e},gs=function(e){return ps([...arguments].slice(1),(function(t){ps(t,(function(t){e.push(t)}))})),e};function _s(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var vs=function(e){try{return e()}catch{return}},ys=function(e){return function(){try{var t=[...arguments];return e.apply(this,t)}catch(e){W.critical(`Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A.`),W.critical(e)}}},bs=function(e){var t={};return ms(e,(function(e,n){Ls(e)&&e.length>0&&(t[n]=e)})),t};function xs(e,t){return n=e,r=e=>Ls(e)&&!zs(t)?e.slice(0,t):e,i=new Set,function e(t,n){return t===Object(t)?i.has(t)?void 0:(i.add(t),Ns(t)?(a=[],ps(t,(t=>{a.push(e(t))}))):(a={},ms(t,((t,n)=>{i.has(t)||(a[n]=e(t,n))}))),a):r?r(t,n):t;var a}(n);var n,r,i}var Ss=[`herokuapp.com`,`vercel.app`,`netlify.app`];function Cs(e){var t=e?.hostname;if(!Ls(t))return!1;var n=t.split(`.`).slice(-2).join(`.`);for(var r of Ss)if(n===r)return!1;return!0}function ws(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Ts(e,t,n,r){var{capture:i=!1,passive:a=!0}=r??{};e?.addEventListener(t,n,{capture:i,passive:a})}function H(e,t){return e.indexOf(t)!==-1}var Es=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``)},Ds=function(e){return e.replace(/^\$/,``)},Os=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}},ks=Array.isArray,As=Object.prototype,js=As.hasOwnProperty,Ms=As.toString,Ns=ks||function(e){return Ms.call(e)===`[object Array]`},Ps=e=>typeof e==`function`,Fs=e=>e===Object(e)&&!Ns(e),Is=e=>{if(Fs(e)){for(var t in e)if(js.call(e,t))return!1;return!0}return!1},U=e=>e===void 0,Ls=e=>Ms.call(e)==`[object String]`,Rs=e=>Ls(e)&&e.trim().length===0,zs=e=>e===null,Bs=e=>U(e)||zs(e),Vs=e=>Ms.call(e)==`[object Number]`,Hs=e=>Ms.call(e)===`[object Boolean]`,Us=e=>e instanceof FormData,Ws=e=>H(ds,e),Gs=e=>{var t={_log:function(t){if(z&&(ls.DEBUG||V.POSTHOG_DEBUG)&&!U(z.console)&&z.console){for(var n=(`__rrweb_original__`in z.console[t])?z.console[t].__rrweb_original__:z.console[t],r=arguments.length,i=Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];n(e,...i)}},info:function(){var e=[...arguments];t._log(`log`,...e)},warn:function(){var e=[...arguments];t._log(`warn`,...e)},error:function(){var e=[...arguments];t._log(`error`,...e)},critical:function(){console.error(e,...arguments)},uninitializedWarning:e=>{t.error(`You must initialize PostHog before calling ${e}`)},createLogger:t=>Gs(`${e} ${t}`)};return t},W=Gs(`[PostHog.js]`),Ks=W.createLogger,qs=Ks(`[ExternalScriptsLoader]`),Js=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return qs.warn(`${t} was requested but loading of external scripts is disabled.`),n(`Loading of external scripts is disabled`);var r=()=>{if(!B)return n(`document not found`);var r=B.createElement(`script`);if(r.type=`text/javascript`,r.crossOrigin=`anonymous`,r.src=t,r.onload=e=>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`);var i,a=B.querySelectorAll(`body > script`);a.length>0?(i=a[0].parentNode)==null||i.insertBefore(r,a[0]):B.body.appendChild(r)};B!=null&&B.body?r():B?.addEventListener(`DOMContentLoaded`,r)};function Ys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function G(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ys(Object(n),!0).forEach((function(t){K(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xs(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}V.__PosthogExtensions__=V.__PosthogExtensions__||{},V.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r=`/static/${t}.js?v=${e.version}`;if(t===`remote-config`&&(r=`/array/${e.config.token}/config.js`),t===`toolbar`){var i=3e5,a=Math.floor(Date.now()/i)*i;r=`${r}&t=${a}`}Js(e,e.requestRouter.endpointFor(`assets`,r),n)},V.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{Js(e,e.requestRouter.endpointFor(`api`,t),n)};var Zs=`$people_distinct_id`,Qs=`__alias`,$s=`__timers`,ec=`$autocapture_disabled_server_side`,tc=`$heatmaps_enabled_server_side`,nc=`$exception_capture_enabled_server_side`,rc=`$web_vitals_enabled_server_side`,ic=`$dead_clicks_enabled_server_side`,ac=`$web_vitals_allowed_metrics`,oc=`$session_recording_enabled_server_side`,sc=`$console_log_recording_enabled_server_side`,cc=`$session_recording_network_payload_capture`,lc=`$session_recording_canvas_recording`,uc=`$replay_sample_rate`,dc=`$replay_minimum_duration`,fc=`$replay_script_config`,pc=`$sesid`,mc=`$session_is_sampled`,hc=`$session_recording_url_trigger_activated_session`,gc=`$session_recording_event_trigger_activated_session`,_c=`$enabled_feature_flags`,vc=`$early_access_features`,yc=`$stored_person_properties`,bc=`$stored_group_properties`,xc=`$surveys`,Sc=`$surveys_activated`,Cc=`$flag_call_reported`,wc=`$user_state`,Tc=`$client_session_props`,Ec=`$capture_rate_limit`,Dc=`$initial_campaign_params`,Oc=`$initial_referrer_info`,kc=`$initial_person_info`,Ac=`$epp`,jc=`__POSTHOG_TOOLBAR__`,Mc=`$posthog_cookieless`,Nc=[Zs,Qs,`__cmpns`,$s,oc,tc,pc,_c,wc,vc,bc,yc,xc,Cc,Tc,Ec,Dc,Oc,Ac],Pc=Ks(`[FeatureFlags]`),Fc=`$active_feature_flags`,Ic=`$override_feature_flags`,Lc=`$feature_flag_payloads`,Rc=`$override_feature_flag_payloads`,zc=e=>{var t={};for(var[n,r]of _s(e||{}))r&&(t[n]=r);return t},Bc=class{constructor(e){K(this,`_override_warning`,!1),K(this,`_hasLoadedFlags`,!1),K(this,`_requestInFlight`,!1),K(this,`_reloadingDisabled`,!1),K(this,`_additionalReloadRequested`,!1),K(this,`_decideCalled`,!1),K(this,`_flagsLoadedFromRemote`,!1),this.instance=e,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(_c),t=this.instance.get_property(Ic);if(!t)return e||{};for(var n=hs({},e),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||=(Pc.warn(` Overriding feature flags!`,{enabledFlags:e,overriddenFlags:t,finalFlags:n}),!0),n}getFlagPayloads(){var e=this.instance.get_property(Lc),t=this.instance.get_property(Rc);if(!t)return e||{};for(var n=hs({},e||{}),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||=(Pc.warn(` Overriding feature flag payloads!`,{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),!0),n}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((()=>{this._callDecideEndpoint()}),5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callDecideEndpoint(e){if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:this.instance.get_property(yc),group_properties:this.instance.get_property(bc)};(e!=null&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(t.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:`POST`,url:this.instance.requestRouter.endpointFor(`api`,`/decide/?v=3`),data:t,compression:this.instance.config.disable_compression?void 0:Qo.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var n=!0;(e.statusCode===200&&(this.$anon_distinct_id=void 0,n=!1),this._requestInFlight=!1,this._decideCalled)||(this._decideCalled=!0,this.instance._onRemoteConfig(e.json??{})),t.disable_flags||(this._flagsLoadedFromRemote=!n,this.receivedFeatureFlags(e.json??{},n),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint()))}})}}getFeatureFlag(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var n,r,i,a,o,s=this.getFlagVariants()[e],c=`${s}`,l=this.instance.get_property(Cc)||{};return(t.send_event||!(`send_event`in t))&&(!(e in l)||!l[e].includes(c))&&(Ns(l[e])?l[e].push(c):l[e]=[c],(n=this.instance.persistence)==null||n.register({[Cc]:l}),this.instance.capture(`$feature_flag_called`,{$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_bootstrapped_response:((r=this.instance.config.bootstrap)==null||(i=r.featureFlags)==null?void 0:i[e])||null,$feature_flag_bootstrapped_payload:((a=this.instance.config.bootstrap)==null||(o=a.featureFlagPayloads)==null?void 0:o[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote})),s}Pc.warn(`getFeatureFlag for key "`+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Pc.warn(`isFeatureEnabled for key "`+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(this.instance.persistence){this._hasLoadedFlags=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads();(function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=e.featureFlags,a=e.featureFlagPayloads;if(i)if(Ns(i)){var o={};if(i)for(var s=0;s<i.length;s++)o[i[s]]=!0;t&&t.register({[Fc]:i,[_c]:o})}else{var c=i,l=a;e.errorsWhileComputingFlags&&(c=G(G({},n),c),l=G(G({},r),l)),t&&t.register({[Fc]:Object.keys(zc(c)),[_c]:c||{},[Lc]:l||{}})}})(e,this.instance.persistence,n,r),this._fireFeatureFlagsCallbacks(t)}}override(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];Pc.warn(`override is deprecated. Please use overrideFeatureFlags instead.`),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this.instance.__loaded||!this.instance.persistence)return Pc.uninitializedWarning(`posthog.feature_flags.overrideFeatureFlags`);if(!1===e)return this.instance.persistence.unregister(Ic),this.instance.persistence.unregister(Rc),void this._fireFeatureFlagsCallbacks();if(e&&typeof e==`object`&&(`flags`in e||`payloads`in e)){var t,n=e;if(this._override_warning=!!((t=n.suppressWarning)!=null&&t),`flags`in n){if(!1===n.flags)this.instance.persistence.unregister(Ic);else if(n.flags)if(Ns(n.flags)){for(var r={},i=0;i<n.flags.length;i++)r[n.flags[i]]=!0;this.instance.persistence.register({[Ic]:r})}else this.instance.persistence.register({[Ic]:n.flags})}`payloads`in n&&(!1===n.payloads?this.instance.persistence.unregister(Rc):n.payloads&&this.instance.persistence.register({[Rc]:n.payloads})),this._fireFeatureFlagsCallbacks();return}this._fireFeatureFlagsCallbacks()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var n,r=(this.instance.get_property(vc)||[]).find((t=>t.flagKey===e)),i={[`\$feature_enrollment/${e}`]:t},a={$feature_flag:e,$feature_enrollment:t,$set:i};r&&(a.$early_access_feature_name=r.name),this.instance.capture(`$feature_enrollment_update`,a),this.setPersonPropertiesForFlags(i,!1);var o=G(G({},this.getFlagVariants()),{},{[e]:t});(n=this.instance.persistence)==null||n.register({[Fc]:Object.keys(zc(o)),[_c]:o}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.instance.get_property(vc);if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor(`api`,`/api/early_access_features/?token=${this.instance.config.token}`),method:`GET`,callback:t=>{var n;if(t.json){var r=t.json.earlyAccessFeatures;return(n=this.instance.persistence)==null||n.register({[vc]:r}),e(r)}}})}_prepareFeatureFlagsForCallbacks(){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)),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:n}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.instance.get_property(yc)||{};this.instance.register({[yc]:G(G({},n),e)}),t&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(yc)}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.instance.get_property(bc)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((t=>{n[t]=G(G({},n[t]),e[t]),delete e[t]})),this.instance.register({[bc]:G(G({},n),e)}),t&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.instance.get_property(bc)||{};this.instance.register({[bc]:G(G({},t),{},{[e]:{}})})}else this.instance.unregister(bc)}};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Vs(e)&&isFinite(e)&&Math.floor(e)===e});var Vc=`0123456789abcdef`,Hc=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)||t<0||n<0||r<0||i<0||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/2**8,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;t<this.bytes.length;t++)e=e+Vc.charAt(this.bytes[t]>>>4)+Vc.charAt(15&this.bytes[t]),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;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}},Uc=class{constructor(){K(this,`timestamp`,0),K(this,`counter`,0),K(this,`random`,new Kc)}generate(){var e=this.generateOrAbort();if(U(e)){this.timestamp=0;var t=this.generateOrAbort();if(U(t))throw Error(`Could not generate UUID after timestamp reset`);return t}return e}generateOrAbort(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Hc.fromFieldsV7(this.timestamp,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}},Wc,Gc=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<`u`&&UUIDV7_DENY_WEAK_RNG)throw Error(`no cryptographically strong RNG available`);for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};z&&!U(z.crypto)&&crypto.getRandomValues&&(Gc=e=>crypto.getRandomValues(e));var Kc=class{constructor(){K(this,`buffer`,new Uint32Array(8)),K(this,`cursor`,1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(Gc(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},qc=()=>Jc().toString(),Jc=()=>(Wc||=new Uc).generate(),Yc=`Thu, 01 Jan 1970 00:00:00 GMT`,Xc=``,Zc=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Qc(e,t){if(t){var n=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B;if(Xc)return Xc;if(!t||[`localhost`,`127.0.0.1`].includes(e))return``;for(var n=e.split(`.`),r=Math.min(n.length,8),i=`dmn_chk_`+qc(),a=RegExp(`(^|;)\\s*`+i+`=1`);!Xc&&r--;){var o=n.slice(r).join(`.`),s=i+`=1;domain=.`+o;t.cookie=s,a.test(t.cookie)&&(t.cookie=s+`;expires=`+Yc,Xc=o)}return Xc}(e);if(!n){var r=(e=>{var t=e.match(Zc);return t?t[0]:``})(e);r!==n&&W.info(`Warning: cookie subdomain discovery mismatch`,r,n),n=r}return n?`; domain=.`+n:``}return``}var $c={is_supported:()=>!!B,error:function(e){W.error(`cookieStore error: `+e)},get:function(e){if(B){try{for(var t=e+`=`,n=B.cookie.split(`;`).filter((e=>e.length)),r=0;r<n.length;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}},parse:function(e){var t;try{t=JSON.parse($c.get(e))||{}}catch{}return t},set:function(e,t,n,r,i){if(B)try{var a=``,o=``,s=Qc(B.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+24*n*60*60*1e3),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&&W.warn(`cookieStore warning: large cookie, len=`+l.length),B.cookie=l,l}catch{return}},remove:function(e,t){try{$c.set(e,``,-1,t)}catch{return}}},el=null,tl={is_supported:function(){if(!zs(el))return el;var e=!0;if(U(z))e=!1;else try{var t=`__mplssupport__`;tl.set(t,`xyz`),tl.get(t)!==`"xyz"`&&(e=!1),tl.remove(t)}catch{e=!1}return e||W.error(`localStorage unsupported; falling back to cookie store`),el=e,e},error:function(e){W.error(`localStorage error: `+e)},get:function(e){try{return z?.localStorage.getItem(e)}catch(e){tl.error(e)}return null},parse:function(e){try{return JSON.parse(tl.get(e))||{}}catch{}return null},set:function(e,t){try{z?.localStorage.setItem(e,JSON.stringify(t))}catch(e){tl.error(e)}},remove:function(e){try{z?.localStorage.removeItem(e)}catch(e){tl.error(e)}}},nl=[`distinct_id`,pc,mc,Ac,kc],rl=G(G({},tl),{},{parse:function(e){try{var t={};try{t=$c.parse(e)||{}}catch{}var n=hs(t,JSON.parse(tl.get(e)||`{}`));return tl.set(e,n),n}catch{}return null},set:function(e,t,n,r,i,a){try{tl.set(e,t,void 0,void 0,a);var o={};nl.forEach((e=>{t[e]&&(o[e]=t[e])})),Object.keys(o).length&&$c.set(e,o,n,r,i,a)}catch(e){tl.error(e)}},remove:function(e,t){try{z?.localStorage.removeItem(e),$c.remove(e,t)}catch(e){tl.error(e)}}}),il={},al={is_supported:function(){return!0},error:function(e){W.error(`memoryStorage error: `+e)},get:function(e){return il[e]||null},parse:function(e){return il[e]||null},set:function(e,t){il[e]=t},remove:function(e){delete il[e]}},ol=null,sl={is_supported:function(){if(!zs(ol))return ol;if(ol=!0,U(z))ol=!1;else try{var e=`__support__`;sl.set(e,`xyz`),sl.get(e)!==`"xyz"`&&(ol=!1),sl.remove(e)}catch{ol=!1}return ol},error:function(e){W.error(`sessionStorage error: `,e)},get:function(e){try{return z?.sessionStorage.getItem(e)}catch(e){sl.error(e)}return null},parse:function(e){try{return JSON.parse(sl.get(e))||null}catch{}return null},set:function(e,t){try{z?.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){sl.error(e)}},remove:function(e){try{z?.sessionStorage.removeItem(e)}catch(e){sl.error(e)}}},cl=[`localhost`,`127.0.0.1`],ll=e=>{var t=B?.createElement(`a`);return U(t)?null:(t.href=e,t)},ul=function(e){var t,n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`&`,i=[];return ms(e,(function(e,r){U(e)||U(r)||r===`undefined`||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+`=`+t)})),i.join(r)},dl=function(e,t){for(var n,r=((e.split(`#`)[0]||``).split(`?`)[1]||``).split(`&`),i=0;i<r.length;i++){var a=r[i].split(`=`);if(a[0]===t){n=a;break}}if(!Ns(n)||n.length<2)return``;var o=n[1];try{o=decodeURIComponent(o)}catch{W.error(`Skipping decoding for malformed query param: `+o)}return o.replace(/\+/g,` `)},fl=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(`#`),i=r[0]||``,a=r[1],o=i.split(`?`),s=o[1],c=o[0],l=(s||``).split(`&`),u=[],d=0;d<l.length;d++){var f=l[d].split(`=`);Ns(f)&&(t.includes(f[0])?u.push(f[0]+`=`+n):u.push(l[d]))}var p=c;return s!=null&&(p+=`?`+u.join(`&`)),a!=null&&(p+=`#`+a),p},pl=function(e,t){var n=e.match(RegExp(t+`=([^&]*)`));return n?n[1]:null},ml=`Mobile`,hl=`iOS`,gl=`Android`,_l=`Tablet`,vl=gl+` `+_l,yl=`iPad`,bl=`Apple`,xl=bl+` Watch`,Sl=`Safari`,Cl=`BlackBerry`,wl=`Samsung`,Tl=wl+`Browser`,El=wl+` Internet`,Dl=`Chrome`,Ol=Dl+` OS`,kl=Dl+` `+hl,Al=`Internet Explorer`,jl=Al+` `+ml,Ml=`Opera`,Nl=Ml+` Mini`,Pl=`Edge`,Fl=`Microsoft `+Pl,Il=`Firefox`,Ll=Il+` `+hl,Rl=`Nintendo`,zl=`PlayStation`,Bl=`Xbox`,Vl=gl+` `+ml,Hl=ml+` `+Sl,Ul=`Windows`,Wl=Ul+` Phone`,Gl=`Nokia`,Kl=`Ouya`,ql=`Generic`,Jl=ql+` `+ml.toLowerCase(),Yl=ql+` `+_l.toLowerCase(),Xl=`Konqueror`,Zl=`(\\d+(\\.\\d+)?)`,Ql=RegExp(`Version/`+Zl),$l=new RegExp(Bl,`i`),eu=RegExp(zl+` \\w+`,`i`),tu=RegExp(Rl+` \\w+`,`i`),nu=RegExp(Cl+`|PlayBook|BB10`,`i`),ru={"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`},iu=(e,t)=>t&&H(t,bl)||function(e){return H(e,Sl)&&!H(e,Dl)&&!H(e,gl)}(e),au=function(e,t){return t||=``,H(e,` OPR/`)&&H(e,`Mini`)?Nl:H(e,` OPR/`)?Ml:nu.test(e)?Cl:H(e,`IE`+ml)||H(e,`WPDesktop`)?jl:H(e,Tl)?El:H(e,Pl)||H(e,`Edg/`)?Fl:H(e,`FBIOS`)?`Facebook `+ml:H(e,`UCWEB`)||H(e,`UCBrowser`)?`UC Browser`:H(e,`CriOS`)?kl:H(e,`CrMo`)||H(e,Dl)?Dl:H(e,gl)&&H(e,Sl)?Vl:H(e,`FxiOS`)?Ll:H(e.toLowerCase(),Xl.toLowerCase())?Xl:iu(e,t)?H(e,ml)?Hl:Sl:H(e,Il)?Il:H(e,`MSIE`)||H(e,`Trident/`)?Al:H(e,`Gecko`)?Il:``},ou={[jl]:[RegExp(`rv:`+Zl)],[Fl]:[RegExp(Pl+`?\\/`+Zl)],[Dl]:[RegExp(`(`+Dl+`|CrMo)\\/`+Zl)],[kl]:[RegExp(`CriOS\\/`+Zl)],"UC Browser":[RegExp(`(UCBrowser|UCWEB)\\/`+Zl)],[Sl]:[Ql],[Hl]:[Ql],[Ml]:[RegExp(`(Opera|OPR)\\/`+Zl)],[Il]:[RegExp(Il+`\\/`+Zl)],[Ll]:[RegExp(`FxiOS\\/`+Zl)],[Xl]:[RegExp(`Konqueror[:/]?`+Zl,`i`)],[Cl]:[RegExp(Cl+` `+Zl),Ql],[Vl]:[RegExp(`android\\s`+Zl,`i`)],[El]:[RegExp(Tl+`\\/`+Zl)],[Al]:[RegExp(`(rv:|MSIE )`+Zl)],Mozilla:[RegExp(`rv:`+Zl)]},su=[[RegExp(Bl+`; `+Bl+` (.*?)[);]`,`i`),e=>[Bl,e&&e[1]||``]],[new RegExp(Rl,`i`),[Rl,``]],[new RegExp(zl,`i`),[zl,``]],[nu,[Cl,``]],[new RegExp(Ul,`i`),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Wl,``];if(new RegExp(ml).test(t)&&!/IEMobile\b/.test(t))return[Ul+` `+ml,``];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=ru[n[1]]||``;return/arm/i.test(t)&&(r=`RT`),[Ul,r]}return[Ul,``]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[hl,[e[3],e[4],e[5]||`0`].join(`.`)]:[hl,``]],[/(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(`(`+gl+` (\\d+)\\.(\\d+)\\.?(\\d+)?|`+gl+`)`,`i`),e=>e&&e[2]?[gl,[e[2],e[3],e[4]||`0`].join(`.`)]:[gl,``]],[/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/,[Ol,``]],[/Linux|debian/i,[`Linux`,``]]],cu=function(e){return tu.test(e)?Rl:eu.test(e)?zl:$l.test(e)?Bl:new RegExp(Kl,`i`).test(e)?Kl:RegExp(`(`+Wl+`|WPDesktop)`,`i`).test(e)?Wl:/iPad/.test(e)?yl:/iPod/.test(e)?`iPod Touch`:/iPhone/.test(e)?`iPhone`:/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?xl:nu.test(e)?Cl:/(kobo)\s(ereader|touch)/i.test(e)?`Kobo`:new RegExp(Gl,`i`).test(e)?Gl:/(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(ml).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)?gl:vl:gl:RegExp(`(pda|`+ml+`)`,`i`).test(e)?Jl:new RegExp(_l,`i`).test(e)&&!RegExp(_l+` pc`,`i`).test(e)?Yl:``},lu=`https?://(.*)`,uu=[`gclid`,`gclsrc`,`dclid`,`gbraid`,`wbraid`,`fbclid`,`msclkid`,`twclid`,`li_fat_id`,`igshid`,`ttclid`,`rdt_cid`,`irclid`,`_kx`],du=gs([`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gad_source`,`mc_cid`],uu),fu=`<masked>`,pu={campaignParams:function(){var{customTrackedParams:e,maskPersonalDataProperties:t,customPersonalDataProperties:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!B)return{};var r=t?gs([],uu,n||[]):[];return this._campaignParamsFromUrl(fl(B.URL,r,fu),e)},_campaignParamsFromUrl:function(e,t){var n=du.concat(t||[]),r={};return ms(n,(function(t){r[t]=dl(e,t)||null})),r},_searchEngine:function(e){return e?e.search(lu+`google.([^/?]*)`)===0?`google`:e.search(lu+`bing.com`)===0?`bing`:e.search(lu+`yahoo.com`)===0?`yahoo`:e.search(lu+`duckduckgo.com`)===0?`duckduckgo`:null:null},_searchInfoFromReferrer:function(e){var t=pu._searchEngine(e),n=t==`yahoo`?`p`:`q`,r={};if(!zs(t)){r.$search_engine=t;var i=B?dl(B.referrer,n):``;i.length&&(r.ph_keyword=i)}return r},searchInfo:function(){var e=B?.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:au,browserVersion:function(e,t){var n=ou[au(e,t)];if(U(n))return null;for(var r=0;r<n.length;r++){var i=n[r],a=e.match(i);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return typeof e==`string`?e.split(`-`)[0]:void 0},os:function(e){for(var t=0;t<su.length;t++){var[n,r]=su[t],i=n.exec(e),a=i&&(Ps(r)?r(i,e):r);if(a)return a}return[``,``]},device:cu,deviceType:function(e){var t=cu(e);return t===yl||t===vl||t===`Kobo`||t===`Kindle Fire`||t===Yl?_l:t===Rl||t===Bl||t===zl||t===Kl?`Console`:t===xl?`Wearable`:t?ml:`Desktop`},referrer:function(){return B?.referrer||`$direct`},referringDomain:function(){return B!=null&&B.referrer&&ll(B.referrer)?.host||`$direct`},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer().substring(0,1e3),u:is?.href.substring(0,1e3)}},initialPersonPropsFromInfo:function(e){var{r:t,u:n}=e,r={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t==`$direct`?`$direct`:ll(t)?.host};if(n){r.$initial_current_url=n;var i=ll(n);r.$initial_host=i?.host,r.$initial_pathname=i?.pathname,ms(this._campaignParamsFromUrl(n),(function(e,t){r[`$initial_`+Ds(t)]=e}))}return t&&ms(this._searchInfoFromReferrer(t),(function(e,t){r[`$initial_`+Ds(t)]=e})),r},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},timezoneOffset:function(){try{return new Date().getTimezoneOffset()}catch{return}},properties:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!cs)return{};var n=e?gs([],uu,t||[]):[],[r,i]=pu.os(cs);return hs(bs({$os:r,$os_version:i,$browser:pu.browser(cs,navigator.vendor),$device:pu.device(cs),$device_type:pu.deviceType(cs),$timezone:pu.timezone(),$timezone_offset:pu.timezoneOffset()}),{$current_url:fl(is?.href,n,fu),$host:is?.host,$pathname:is?.pathname,$raw_user_agent:cs.length>1e3?cs.substring(0,997)+`...`:cs,$browser_version:pu.browserVersion(cs,navigator.vendor),$browser_language:pu.browserLanguage(),$browser_language_prefix:pu.browserLanguagePrefix(),$screen_height:z?.screen.height,$screen_width:z?.screen.width,$viewport_height:z?.innerHeight,$viewport_width:z?.innerWidth,$lib:`web`,$lib_version:ls.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!cs)return{};var[e,t]=pu.os(cs);return hs(bs({$os:e,$os_version:t,$browser:pu.browser(cs,navigator.vendor)}),{$browser_version:pu.browserVersion(cs,navigator.vendor)})}},mu=[`cookie`,`localstorage`,`localstorage+cookie`,`sessionstorage`,`memory`],hu=class{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(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.storage=this.buildStorage(e),this.load(),e.debug&&W.info(`Persistence loaded`,e.persistence,G({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){mu.indexOf(e.persistence.toLowerCase())===-1&&(W.critical(`Unknown persistence type `+e.persistence+`; falling back to localStorage+cookie`),e.persistence=`localStorage+cookie`);var t=e.persistence.toLowerCase();return t===`localstorage`&&tl.is_supported()?tl:t===`localstorage+cookie`&&rl.is_supported()?rl:t===`sessionstorage`&&sl.is_supported()?sl:t===`memory`?al:t===`cookie`?$c:rl.is_supported()?rl:$c}properties(){var e={};return ms(this.props,(function(t,n){if(n===_c&&Fs(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e[`\$feature/${r[i]}`]=t[r[i]];else o=n,s=!1,(zs(a=Nc)?s:ns&&a.indexOf===ns?a.indexOf(o)!=-1:(ms(a,(function(e){if(s||=e===o)return fs})),s))||(e[n]=t);var a,o,s})),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=hs({},e))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(Fs(e)){U(t)&&(t=`None`),this.expire_days=U(n)?this.default_expiry:n;var r=!1;if(ms(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e,r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(Fs(e)){this.expire_days=U(t)?this.default_expiry:t;var n=!1;if(ms(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=pu.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});Is(bs(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(pu.searchInfo())}update_referrer_info(){this.register_once(pu.referrerInfo(),void 0)}set_initial_person_info(){this.props[Dc]||this.props[Oc]||this.register_once({[kc]:pu.initialPersonInfo()},void 0)}get_referrer_info(){return bs({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};ms([Oc,Dc],(t=>{var n=this.props[t];n&&ms(n,(function(t,n){e[`$initial_`+Ds(n)]=t}))}));var t=this.props[kc];return t&&hs(e,pu.initialPersonPropsFromInfo(t)),e}safe_merge(e){return ms(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[$s]||{};n[e]=t,this.props[$s]=n,this.save()}remove_event_timer(e){var t=(this.props[$s]||{})[e];return U(t)||(delete this.props[$s][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}};function gu(e){var t;return JSON.stringify(e,(t=[],function(e,n){if(Fs(n)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?`[Circular]`:(t.push(n),n)}return n}))?.length||0}function _u(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),i=e.data.slice(n);return[_u({size:gu(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),_u({size:gu(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var vu=(e=>(e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`,e))(vu||{}),yu=(e=>(e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`,e[e.Selection=14]=`Selection`,e[e.AdoptedStyleSheet=15]=`AdoptedStyleSheet`,e[e.CustomElement=16]=`CustomElement`,e))(yu||{});function bu(e){var t;return e instanceof Element&&(e.id===jc||!((t=e.closest)==null||!t.call(e,`.toolbar-global-fade-container`)))}function xu(e){return!!e&&e.nodeType===1}function Su(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Cu(e){return!!e&&e.nodeType===3}function wu(e){return!!e&&e.nodeType===11}function Tu(e){return e?Es(e).split(/\s+/):[]}function Eu(e){var t=z?.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Du(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 Tu(t)}function Ou(e){return Bs(e)?null:Es(e).split(/(\s+)/).filter((e=>Hu(e))).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255)}function ku(e){var t=``;return Pu(e)&&!Fu(e)&&e.childNodes&&e.childNodes.length&&ms(e.childNodes,(function(e){Cu(e)&&e.textContent&&(t+=Ou(e.textContent)??``)})),Es(t)}function Au(e){return U(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var ju=[`a`,`button`,`form`,`input`,`select`,`textarea`,`label`];function Mu(e){var t=e.parentNode;return!(!t||!xu(t))&&t}function Nu(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!z||!e||Su(e,`html`)||!xu(e)||n!=null&&n.url_allowlist&&!Eu(n.url_allowlist)||n!=null&&n.url_ignorelist&&Eu(n.url_ignorelist))return!1;if(n!=null&&n.dom_event_allowlist){var a=n.dom_event_allowlist;if(a&&!a.some((e=>t.type===e)))return!1}for(var o=!1,s=[e],c=!0,l=e;l.parentNode&&!Su(l,`body`);)if(wu(l.parentNode))s.push(l.parentNode.host),l=l.parentNode.host;else{if(!(c=Mu(l)))break;if(r||ju.indexOf(c.tagName.toLowerCase())>-1)o=!0;else{var u=z.getComputedStyle(c);u&&u.getPropertyValue(`cursor`)===`pointer`&&(o=!0)}s.push(c),l=c}if(!function(e,t){var n=t?.element_allowlist;if(U(n))return!0;var r=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var i of e){var a=r(i);if(typeof a==`object`)return a.v}return!1}(s,n)||!function(e,t){var n=t?.css_selector_allowlist;if(U(n))return!0;var r=function(e){if(n.some((t=>e.matches(t))))return{v:!0}};for(var i of e){var a=r(i);if(typeof a==`object`)return a.v}return!1}(s,n))return!1;var d=z.getComputedStyle(e);if(d&&d.getPropertyValue(`cursor`)===`pointer`&&t.type===`click`)return!0;var f=e.tagName.toLowerCase();switch(f){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 o?(i||[`click`]).indexOf(t.type)>=0:(i||[`click`]).indexOf(t.type)>=0&&(ju.indexOf(f)>-1||e.getAttribute(`contenteditable`)===`true`)}}function Pu(e){for(var t=e;t.parentNode&&!Su(t,`body`);t=t.parentNode){var n=Du(t);if(H(n,`ph-sensitive`)||H(n,`ph-no-capture`))return!1}if(H(Du(e),`ph-include`))return!0;var r=e.type||``;if(Ls(r))switch(r.toLowerCase()){case`hidden`:case`password`:return!1}var i=e.name||e.id||``;return!(Ls(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,``)))}function Fu(e){return!!(Su(e,`input`)&&![`button`,`checkbox`,`submit`,`reset`].includes(e.type)||Su(e,`select`)||Su(e,`textarea`)||e.getAttribute(`contenteditable`)===`true`)}var Iu=`(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})`,Lu=RegExp(`^(?:${Iu})\$`),Ru=new RegExp(Iu),zu=`\\d{3}-?\\d{2}-?\\d{4}`,Bu=RegExp(`^(${zu})\$`),Vu=RegExp(`(${zu})`);function Hu(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(Bs(e)||Ls(e)&&(e=Es(e),(t?Lu:Ru).test((e||``).replace(/[- ]/g,``))||(t?Bu:Vu).test(e)))}function Uu(e){var t=ku(e);return Hu(t=`${t} ${Wu(e)}`.trim())?t:``}function Wu(e){var t=``;return e&&e.childNodes&&e.childNodes.length&&ms(e.childNodes,(function(e){if(e&&e.tagName?.toLowerCase()===`span`)try{var n=ku(e);t=`${t} ${n}`.trim(),e.childNodes&&e.childNodes.length&&(t=`${t} ${Wu(e)}`.trim())}catch(e){W.error(`[AutoCapture]`,e)}})),t}function Gu(e){return 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=G(G(G(G({},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 _s(r).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return i[Ku(t.toString())]=Ku(n.toString())})),t+=`:`,t+=_s(r).map((e=>{var[t,n]=e;return`${t}="${n}"`})).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:qu(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return _s(e).filter((e=>{var[t]=e;return t.indexOf(`attr__`)===0})).forEach((e=>{var[n,r]=e;return t.attributes[n]=r})),t}))}(e))}function Ku(e){return e.replace(/"|\\"/g,`\\"`)}function qu(e){var t=e.attr__class;return t?Ns(t)?t:Tu(t):void 0}var Ju=`[SessionRecording]`,Yu=`redacted`,Xu={initiatorTypes:[`audio`,`beacon`,`body`,`css`,`early-hint`,`embed`,`fetch`,`frame`,`iframe`,`icon`,`image`,`img`,`input`,`link`,`navigation`,`object`,`ping`,`script`,`track`,`video`,`xmlhttprequest`],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:[`first-input`,`navigation`,`paint`,`resource`],payloadSizeLimitBytes:1e6,payloadHostDenyList:[`.lr-ingest.io`,`.ingest.sentry.io`,`.clarity.ms`,`analytics.google.com`]},Zu=[`authorization`,`x-forwarded-for`,`authorization`,`cookie`,`set-cookie`,`x-api-key`,`x-real-ip`,`remote-addr`,`forwarded`,`proxy-authorization`,`x-csrf-token`,`x-csrftoken`,`x-xsrf-token`],Qu=[`password`,`secret`,`passwd`,`api_key`,`apikey`,`auth`,`credentials`,`mysql_pwd`,`privatekey`,`private_key`,`token`],$u=[`/s/`,`/e/`,`/i/`];function ed(e,t,n,r){if(Bs(e))return e;var i=t?.[`content-length`]||function(e){return new Blob([e]).size}(e);return Ls(i)&&(i=parseInt(i)),i>n?Ju+` ${r} body too large to record (${i} bytes)`:e}function td(e,t){if(Bs(e))return e;var n=e;return Hu(n,!1)||(n=Ju+` `+t+` body `+Yu),ms(Qu,(e=>{var r;(r=n)!=null&&r.length&&n?.indexOf(e)!==-1&&(n=Ju+` `+t+` body `+Yu+` as might contain: `+e)})),n}var nd=(e,t)=>{var n,r,i={payloadSizeLimitBytes:Xu.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Xu.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Xu.payloadHostDenyList]},a=!1!==e.session_recording.recordHeaders&&t.recordHeaders,o=!1!==e.session_recording.recordBody&&t.recordBody,s=!1!==e.capture_performance&&t.recordPerformance,c=(n=i,r=Math.min(1e6,n.payloadSizeLimitBytes??1e6),e=>(e!=null&&e.requestBody&&(e.requestBody=ed(e.requestBody,e.requestHeaders,r,`Request`)),e!=null&&e.responseBody&&(e.responseBody=ed(e.responseBody,e.responseHeaders,r,`Response`)),e)),l=t=>{return c(((e,t)=>{var n=ll(e.name),r=t.indexOf(`http`)===0?ll(t)?.pathname:t;r===`/`&&(r=``);var i=n?.pathname.replace(r||``,``);if(!(n&&i&&$u.some((e=>i.indexOf(e)===0))))return e})((r=(n=t).requestHeaders,Bs(r)||ms(Object.keys(r??{}),(e=>{Zu.includes(e.toLowerCase())&&(r[e]=Yu)})),n),e.api_host));var n,r},u=Ps(e.session_recording.maskNetworkRequestFn);return u&&Ps(e.session_recording.maskCapturedNetworkRequestFn)&&W.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var n=e.session_recording.maskNetworkRequestFn({url:t.name});return G(G({},t),{},{name:n?.url})}),i.maskRequestFn=Ps(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var n,r,i=l(t);return i&&(n=(r=e.session_recording).maskCapturedNetworkRequestFn?.call(r,i))!=null?n:void 0}:e=>function(e){if(!U(e))return e.requestBody=td(e.requestBody,`Request`),e.responseBody=td(e.responseBody,`Response`),e}(l(e)),G(G(G({},Xu),i),{},{recordHeaders:a,recordBody:o,recordPerformance:s,recordInitialRequests:s})};function rd(e,t,n,r,i){return t>n&&(W.warn(`min cannot be greater than max.`),t=n),Vs(e)?e>n?(r&&W.warn(r+` cannot be greater than max: `+n+`. Using max value instead.`),n):e<t?(r&&W.warn(r+` cannot be less than min: `+t+`. Using min value instead.`),t):e:(r&&W.warn(r+` must be a number. using max or fallback. max: `+n+`, fallback: `+i),rd(i||n,t,n,r))}var id=class{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};K(this,`bucketSize`,100),K(this,`refillRate`,10),K(this,`mutationBuckets`,{}),K(this,`loggedTracker`,{}),K(this,`refillBuckets`,(()=>{Object.keys(this.mutationBuckets).forEach((e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]}))})),K(this,`getNodeOrRelevantParent`,(e=>{var t=this.rrweb.mirror.getNode(e);if(t?.nodeName!==`svg`&&t instanceof Element){var n=t.closest(`svg`);if(n)return[this.rrweb.mirror.getId(n),n]}return[e,t]})),K(this,`numberOfChanges`,(e=>(e.removes?.length??0)+(e.attributes?.length??0)+(e.texts?.length??0)+(e.adds?.length??0))),K(this,`throttleMutations`,(e=>{if(e.type!==3||e.data.source!==0)return e;var t=e.data,n=this.numberOfChanges(t);t.attributes&&=t.attributes.filter((e=>{var t,n,[r,i]=this.getNodeOrRelevantParent(e.id);return this.mutationBuckets[r]===0?!1:((this.mutationBuckets[r]=this.mutationBuckets[r]??this.bucketSize,this.mutationBuckets[r]=Math.max(this.mutationBuckets[r]-1,0),this.mutationBuckets[r]===0)&&(this.loggedTracker[r]||(this.loggedTracker[r]=!0,(t=(n=this.options).onBlockedNode)==null||t.call(n,r,i))),e)}));var r=this.numberOfChanges(t);return r!==0||n===r?e:void 0})),this.rrweb=e,this.options=t,this.refillRate=rd(this.options.refillRate??this.refillRate,0,100,`mutation throttling refill rate`),this.bucketSize=rd(this.options.bucketSize??this.bucketSize,0,100,`mutation throttling bucket size`),setInterval((()=>{this.refillBuckets()}),1e3)}},ad=Uint8Array,od=Uint16Array,sd=Uint32Array,cd=new ad([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]),ld=new ad([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]),ud=new ad([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),dd=function(e,t){for(var n=new od(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new sd(n[30]);for(r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return[n,i]},fd=dd(cd,2),pd=fd[0],md=fd[1];pd[28]=258,md[258]=28;for(var hd=dd(ld,0)[1],gd=new od(32768),_d=0;_d<32768;++_d){var vd=(43690&_d)>>>1|(21845&_d)<<1;vd=(61680&(vd=(52428&vd)>>>2|(13107&vd)<<2))>>>4|(3855&vd)<<4,gd[_d]=((65280&vd)>>>8|(255&vd)<<8)>>>1}var yd=function(e,t,n){for(var r=e.length,i=0,a=new od(t);i<r;++i)++a[e[i]-1];var o,s=new od(t);for(i=0;i<t;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new od(1<<t);var c=15-t;for(i=0;i<r;++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;d<=f;++d)o[gd[d]>>>c]=l}else for(o=new od(r),i=0;i<r;++i)o[i]=gd[s[e[i]-1]++]>>>15-e[i];return o},bd=new ad(288);for(_d=0;_d<144;++_d)bd[_d]=8;for(_d=144;_d<256;++_d)bd[_d]=9;for(_d=256;_d<280;++_d)bd[_d]=7;for(_d=280;_d<288;++_d)bd[_d]=8;var xd=new ad(32);for(_d=0;_d<32;++_d)xd[_d]=5;var Sd=yd(bd,9,0),Cd=yd(xd,5,0),wd=function(e){return(e/8>>0)+(7&e&&1)},Td=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof od?od:e instanceof sd?sd:ad)(n-t);return r.set(e.subarray(t,n)),r},Ed=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Dd=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Od=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[new ad(0),0];if(i==1){var o=new ad(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[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var f=a[0].s;for(r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var p=new od(f+1),m=kd(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}));r<i;++r){var v=a[r].s;if(!(p[v]>t))break;h+=_-(1<<m-p[v]),p[v]=t}for(h>>>=g;h>0;){var y=a[r].s;p[y]<t?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 ad(p),m]},kd=function(e,t,n){return e.s==-1?Math.max(kd(e.l,t,n+1),kd(e.r,t,n+1)):t[e.s]=n},Ad=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new od(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(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]},jd=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Md=function(e,t,n){var r=n.length,i=wd(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;a<r;++a)e[i+a+4]=n[a];return 8*(i+4+r)},Nd=function(e,t,n,r,i,a,o,s,c,l,u){Ed(t,u++,n),++i[256];for(var d=Od(i,15),f=d[0],p=d[1],m=Od(a,15),h=m[0],g=m[1],_=Ad(f),v=_[0],y=_[1],b=Ad(h),x=b[0],S=b[1],C=new od(19),w=0;w<v.length;++w)C[31&v[w]]++;for(w=0;w<x.length;++w)C[31&x[w]]++;for(var T=Od(C,7),E=T[0],ee=T[1],D=19;D>4&&!E[ud[D-1]];--D);var te,ne,O,k,re=l+5<<3,ie=jd(i,bd)+jd(a,xd)+o,ae=jd(i,f)+jd(a,h)+o+14+3*D+jd(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(re<=ie&&re<=ae)return Md(t,u,e.subarray(c,c+l));if(Ed(t,u,1+(ae<ie)),u+=2,ae<ie){te=yd(f,p,0),ne=f,O=yd(h,g,0),k=h;var oe=yd(E,ee,0);for(Ed(t,u,y-257),Ed(t,u+5,S-1),Ed(t,u+10,D-4),u+=14,w=0;w<D;++w)Ed(t,u+3*w,E[ud[w]]);u+=3*D;for(var se=[v,x],ce=0;ce<2;++ce){var le=se[ce];for(w=0;w<le.length;++w){var ue=31&le[w];Ed(t,u,oe[ue]),u+=E[ue],ue>15&&(Ed(t,u,le[w]>>>5&127),u+=le[w]>>>12)}}}else te=Sd,ne=bd,O=Cd,k=xd;for(w=0;w<s;++w)if(r[w]>255){ue=r[w]>>>18&31,Dd(t,u,te[ue+257]),u+=ne[ue+257],ue>7&&(Ed(t,u,r[w]>>>23&31),u+=cd[ue]);var de=31&r[w];Dd(t,u,O[de]),u+=k[de],de>3&&(Dd(t,u,r[w]>>>5&8191),u+=ld[de])}else Dd(t,u,te[r[w]]),u+=ne[r[w]];return Dd(t,u,te[256]),u+ne[256]},Pd=new sd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fd=function(){for(var e=new sd(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Id=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Fd[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Ld=function(e,t,n,r,i){return function(e,t,n,r,i,a){var o=e.length,s=new ad(r+o+5*(1+Math.floor(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var d=u+65535;d<o?l=Md(c,l,e.subarray(u,d)):(c[u]=a,l=Md(c,l,e.subarray(u,o)))}else{for(var f=Pd[t-1],p=f>>>13,m=8191&f,h=(1<<n)-1,g=new od(32768),_=new od(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 sd(25e3),S=new od(288),C=new od(32),w=0,T=0,E=(u=0,0),ee=0,D=0;u<o;++u){var te=b(u),ne=32767&u,O=_[te];if(g[ne]=O,_[te]=ne,ee<=u){var k=o-u;if((w>7e3||E>24576)&&k>423){l=Nd(e,c,0,x,S,C,T,E,D,u-D,l),E=w=T=0,D=u;for(var re=0;re<286;++re)S[re]=0;for(re=0;re<30;++re)C[re]=0}var ie=2,ae=0,oe=m,se=ne-O&32767;if(k>2&&te==b(u-se))for(var ce=Math.min(p,k)-1,le=Math.min(32767,u),ue=Math.min(258,k);se<=le&&--oe&&ne!=O;){if(e[u+ie]==e[u+ie-se]){for(var de=0;de<ue&&e[u+de]==e[u+de-se];++de);if(de>ie){if(ie=de,ae=se,de>ce)break;var A=Math.min(se,de-2),fe=0;for(re=0;re<A;++re){var pe=u-se+re+32768&32767,me=pe-g[pe]+32768&32767;me>fe&&(fe=me,O=pe)}}}se+=(ne=O)-(O=g[ne])+32768&32767}if(ae){x[E++]=268435456|md[ie]<<18|hd[ae];var j=31&md[ie],he=31&hd[ae];T+=cd[j]+ld[he],++S[257+j],++C[he],ee=u+ie,++w}else x[E++]=e[u],++S[e[u]]}}l=Nd(e,c,a,x,S,C,T,E,D,u-D,l)}return Td(s,0,r+wd(l)+i)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Rd=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},zd=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Rd(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},Bd=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Vd(e,t){t===void 0&&(t={});var n=Id(),r=e.length;n.p(e);var i=Ld(e,t,Bd(t),8),a=i.length;return zd(i,t),Rd(i,a-8,n.d()),Rd(i,a-4,r),i}function Hd(e,t){var n=e.length;if(typeof TextEncoder<`u`)return new TextEncoder().encode(e);for(var r=new ad(e.length+(e.length>>>1)),i=0,a=function(e){r[i++]=e},o=0;o<n;++o){if(i+5>r.length){var s=new ad(i+8+(n-o<<1));s.set(r),r=s}var c=e.charCodeAt(o);c<128||t?a(c):c<2048?(a(192|c>>>6),a(128|63&c)):c>55295&&c<57344?(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 Td(r,0,i)}function Ud(e,t){return function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(e)%100<rd(100*t,0,100)}var Wd=`[SessionRecording]`,Gd=Ks(Wd),Kd=3e5,qd=[yu.MouseMove,yu.MouseInteraction,yu.Scroll,yu.ViewportResize,yu.Input,yu.TouchMove,yu.MediaInteraction,yu.Drag],Jd=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function Yd(e){return function(e,t){for(var n=``,r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}return n}(Vd(Hd(JSON.stringify(e))),!0)}function Xd(e){return e.type===vu.Custom&&e.data.tag===`sessionIdle`}function Zd(e,t){return t.some((t=>t.matching===`regex`&&new RegExp(t.url).test(e)))}var Qd=class{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return V==null||(e=V.__PosthogExtensions__)==null||(t=e.rrweb)==null?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw Error(Wd+` must be started with a valid sessionManager.`);return this.instance.sessionManager}get fullSnapshotIntervalMillis(){return this.triggerStatus===`trigger_pending`?6e4:this.instance.config.session_recording?.full_snapshot_interval_millis??Kd}get isSampled(){var e=this.instance.get_property(mc);return Hs(e)?e:null}get sessionDuration(){var e=this.buffer?.data[this.buffer?.data.length-1],{sessionStartTimestamp:t}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return e?e.timestamp-t:null}get isRecordingEnabled(){var e=!!this.instance.get_property(oc),t=!this.instance.config.disable_session_recording;return z&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(sc);return this.instance.config.enable_recording_console_log??e}get canvasRecording(){var e,t=this.instance.config.session_recording.captureCanvas,n=this.instance.get_property(lc),r=(e=t?.recordCanvas??n?.enabled)!=null&&e,i=t?.canvasFps??n?.fps??0,a=t?.canvasQuality??n?.quality??0;return{enabled:r,fps:rd(i,0,12,`canvas recording fps`),quality:rd(a,0,1,`canvas recording quality`)}}get networkPayloadCapture(){var e=this.instance.get_property(cc),t={recordHeaders:this.instance.config.session_recording?.recordHeaders,recordBody:this.instance.config.session_recording?.recordBody},n=t?.recordHeaders||e?.recordHeaders,r=t?.recordBody||e?.recordBody,i=Fs(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Hs(i)?i:e?.capturePerformance);return n||r||a?{recordHeaders:n,recordBody:r,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(uc);return Vs(e)?e:null}get minimumDuration(){var e=this.instance.get_property(dc);return Vs(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?!1===this.isSampled?`disabled`:this._urlBlocked?`paused`:Bs(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus===`trigger_pending`?`buffering`:Hs(this.isSampled)?this.isSampled?`sampled`:`disabled`:`active`:`buffering`:`disabled`:`buffering`}get urlTriggerStatus(){return this._urlTriggers.length===0?`trigger_disabled`:this.instance?.get_property(hc)===this.sessionId?`trigger_activated`:`trigger_pending`}get eventTriggerStatus(){return this._eventTriggers.length===0?`trigger_disabled`:this.instance?.get_property(gc)===this.sessionId?`trigger_activated`:`trigger_pending`}get triggerStatus(){var e=this.eventTriggerStatus===`trigger_activated`||this.urlTriggerStatus===`trigger_activated`,t=this.eventTriggerStatus===`trigger_pending`||this.urlTriggerStatus===`trigger_pending`;return e?`trigger_activated`:t?`trigger_pending`:`trigger_disabled`}constructor(e){if(K(this,`queuedRRWebEvents`,[]),K(this,`isIdle`,!1),K(this,`_linkedFlagSeen`,!1),K(this,`_lastActivityTimestamp`,Date.now()),K(this,`_linkedFlag`,null),K(this,`_removePageViewCaptureHook`,void 0),K(this,`_onSessionIdListener`,void 0),K(this,`_persistDecideOnSessionListener`,void 0),K(this,`_samplingSessionListener`,void 0),K(this,`_urlTriggers`,[]),K(this,`_urlBlocklist`,[]),K(this,`_urlBlocked`,!1),K(this,`_eventTriggers`,[]),K(this,`_removeEventTriggerCaptureHook`,void 0),K(this,`_forceAllowLocalhostNetworkCapture`,!1),K(this,`_onBeforeUnload`,(()=>{this._flushBuffer()})),K(this,`_onOffline`,(()=>{this._tryAddCustomEvent(`browser offline`,{})})),K(this,`_onOnline`,(()=>{this._tryAddCustomEvent(`browser online`,{})})),K(this,`_onVisibilityChange`,(()=>{if(B!=null&&B.visibilityState){var e=`window `+B.visibilityState;this._tryAddCustomEvent(e,{})}})),this.instance=e,this._captureStarted=!1,this._endpoint=`/s/`,this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Gd.error(`started without valid sessionManager`),Error(Wd+` started without valid sessionManager. This is a bug.`);if(this.instance.config.__preview_experimental_cookieless_mode)throw Error(Wd+` cannot be used with __preview_experimental_cookieless_mode.`);var{sessionId:t,windowId:n}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=n,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Gd.warn(`session_idle_threshold_ms (${this.sessionIdleThresholdMilliseconds}) is greater than the session timeout (${this.sessionManager.sessionTimeoutMs}). Session will never be detected as idle`)}startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),Ts(z,`beforeunload`,this._onBeforeUnload),Ts(z,`offline`,this._onOffline),Ts(z,`online`,this._onOnline),Ts(z,`visibilitychange`,this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),Bs(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on(`eventCaptured`,(e=>{try{if(e.event===`$pageview`){var t=e!=null&&e.properties.$current_url?this._maskUrl(e?.properties.$current_url):``;if(!t)return;this._tryAddCustomEvent(`$pageview`,{href:t})}}catch(e){Gd.error(`Could not add $pageview to rrweb session`,e)}}))),this._onSessionIdListener||=this.sessionManager.onSessionId(((e,t,n)=>{var r,i,a,o;n&&(this._tryAddCustomEvent(`$session_id_change`,{sessionId:e,windowId:t,changeReason:n}),(r=this.instance)==null||(i=r.persistence)==null||i.unregister(gc),(a=this.instance)==null||(o=a.persistence)==null||o.unregister(hc))}))):this.stopRecording()}stopRecording(){var e,t,n,r;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,z?.removeEventListener(`beforeunload`,this._onBeforeUnload),z?.removeEventListener(`offline`,this._onOffline),z?.removeEventListener(`online`,this._onOnline),z?.removeEventListener(`visibilitychange`,this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),(e=this._removePageViewCaptureHook)==null||e.call(this),this._removePageViewCaptureHook=void 0,(t=this._removeEventTriggerCaptureHook)==null||t.call(this),this._removeEventTriggerCaptureHook=void 0,(n=this._onSessionIdListener)==null||n.call(this),this._onSessionIdListener=void 0,(r=this._samplingSessionListener)==null||r.call(this),this._samplingSessionListener=void 0,Gd.info(`stopped`))}makeSamplingDecision(e){var t,n=this.sessionId!==e,r=this.sampleRate;if(Vs(r)){var i=this.isSampled,a=n||!Hs(i),o=a?Ud(e,r):i;a&&(o?this._reportStarted(`sampled`):Gd.warn(`Sample rate (${r}) has determined that this sessionId (${e}) will not be sent to the server.`),this._tryAddCustomEvent(`samplingDecisionMade`,{sampleRate:r,isSampled:o})),(t=this.instance.persistence)==null||t.register({[mc]:o})}else{var s;(s=this.instance.persistence)==null||s.register({[mc]:null})}}onRemoteConfig(e){var t,n,r,i;if((this._tryAddCustomEvent(`$remote_config_received`,e),this._persistRemoteConfig(e),this._linkedFlag=e.sessionRecording?.linkedFlag||null,(t=e.sessionRecording)!=null&&t.endpoint)&&(this._endpoint=e.sessionRecording?.endpoint),this._setupSampling(),!Bs(this._linkedFlag)&&!this._linkedFlagSeen){var a=Ls(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,o=Ls(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((e,t)=>{var n=Fs(t)&&a in t,r=o?t[a]===o:n;r&&this._reportStarted(`linked_flag_matched`,{linkedFlag:a,linkedVariant:o}),this._linkedFlagSeen=r}))}(n=e.sessionRecording)!=null&&n.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),(r=e.sessionRecording)!=null&&r.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),(i=e.sessionRecording)!=null&&i.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){Vs(this.sampleRate)&&Bs(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((e=>{this.makeSamplingDecision(e)})))}_persistRemoteConfig(e){if(this.instance.persistence){var t,n=this.instance.persistence,r=()=>{var t=e.sessionRecording?.sampleRate,r=Bs(t)?null:parseFloat(t),i=e.sessionRecording?.minimumDurationMilliseconds;n.register({[oc]:!!e.sessionRecording,[sc]:e.sessionRecording?.consoleLogRecordingEnabled,[cc]:G({capturePerformance:e.capturePerformance},e.sessionRecording?.networkPayloadCapture),[lc]:{enabled:e.sessionRecording?.recordCanvas,fps:e.sessionRecording?.canvasFps,quality:e.sessionRecording?.canvasQuality},[uc]:r,[dc]:U(i)?null:i,[fc]:e.sessionRecording?.scriptConfig})};r(),(t=this._persistDecideOnSessionListener)==null||t.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(r)}}log(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`log`;(t=this.instance.sessionRecording)==null||t.onRRwebEmit({type:6,data:{plugin:`rrweb/console@1`,payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!U(Object.assign)&&!U(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,n;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():(t=V.__PosthogExtensions__)==null||(n=t.loadExternalDependency)==null||n.call(t,this.instance,this.scriptName,(e=>{if(e)return Gd.error(`could not load recorder`,e);this._onScriptLoaded()})),Gd.info(`starting`),this.status===`active`&&this._reportStarted(e||`recording_initialized`)}}get scriptName(){var e,t,n;return((e=this.instance)==null||(t=e.persistence)==null||(n=t.get_property(fc))==null?void 0:n.script)||`recorder`}isInteractiveEvent(e){return e.type===3&&qd.indexOf(e.data?.source)!==-1}_updateWindowAndSessionIds(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent(`sessionIdle`,{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent(`sessionNoLongerIdle`,{reason:`user activity`,type:e.type}),n=!0)),!this.isIdle){var{windowId:r,sessionId:i}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),a=this.sessionId!==i,o=this.windowId!==r;this.windowId=r,this.sessionId=i,a||o?(this.stopRecording(),this.startIfEnabledOrStop(`session_id_changed`)):n&&this._scheduleFullSnapshot()}}_tryRRWebMethod(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Gd.warn(`could not emit queued rrweb event.`,t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(Jd((()=>this.rrwebRecord.addCustomEvent(e,t))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(Jd((()=>this.rrwebRecord.takeFullSnapshot())))}_onScriptLoaded(){var e={blockClass:`ph-no-capture`,blockSelector:void 0,ignoreClass:`ph-ignore-input`,maskTextClass:`ph-mask`,maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},t=this.instance.config.session_recording;for(var[n,r]of Object.entries(t||{}))n in e&&(n===`maskInputOptions`?e.maskInputOptions=G({password:!0},r):e[n]=r);if(this.canvasRecording&&this.canvasRecording.enabled&&(e.recordCanvas=!0,e.sampling={canvas:this.canvasRecording.fps},e.dataURLOptions={type:`image/webp`,quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=this.mutationRateLimiter??new id(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(e,t)=>{var n=`Too many mutations on node '${e}'. Rate limiting. This could be due to SVG animations or something similar`;Gd.info(n,{node:t}),this.log(Wd+` `+n,`warn`)}});var i=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(G({emit:e=>{this.onRRwebEmit(e)},plugins:i},e)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent(`$session_options`,{sessionRecordingOptions:e,activePlugins:i.map((e=>e?.name))}),this._tryAddCustomEvent(`$posthog_config`,{config:this.instance.config})}else Gd.error(`onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.`)}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval((()=>{this._tryTakeFullSnapshot()}),e))}}_gatherRRWebPlugins(){var e,t,n,r,i=[],a=(e=V.__PosthogExtensions__)==null||(t=e.rrwebPlugins)==null?void 0:t.getRecordConsolePlugin;a&&this.isConsoleLogCaptureEnabled&&i.push(a());var o=(n=V.__PosthogExtensions__)==null||(r=n.rrwebPlugins)==null?void 0:r.getRecordNetworkPlugin;return this.networkPayloadCapture&&Ps(o)&&(!cl.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(o(nd(this.instance.config,this.networkPayloadCapture))):Gd.info(`NetworkCapture not started because we are on localhost.`)),i}onRRwebEmit(e){var t;if(this._processQueuedEvents(),e&&Fs(e)){if(e.type===vu.Meta){var n=this._maskUrl(e.data.href);if(this._lastHref=n,!n)return;e.data.href=n}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),this.status!==`paused`||function(e){return e.type===vu.Custom&&e.data.tag===`recording paused`}(e)){e.type===vu.FullSnapshot&&this._scheduleFullSnapshot(),e.type===vu.FullSnapshot&&this.triggerStatus===`trigger_pending`&&this.clearBuffer();var r=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(r){var i=function(e){var t=e;if(t&&Fs(t)&&t.type===6&&Fs(t.data)&&t.data.plugin===`rrweb/console@1`){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push(`...[truncated]`));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+`...[truncated]`):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(r);if(this._updateWindowAndSessionIds(i),!this.isIdle||Xd(i)){if(Xd(i)){var a=i.data.payload;a&&(i.timestamp=a.lastActivityTimestamp+a.threshold)}var o=(t=this.instance.config.session_recording.compress_events)==null||t?function(e){if(gu(e)<1024)return e;try{if(e.type===vu.FullSnapshot)return G(G({},e),{},{data:Yd(e.data),cv:`2024-10`});if(e.type===vu.IncrementalSnapshot&&e.data.source===yu.Mutation)return G(G({},e),{},{cv:`2024-10`,data:G(G({},e.data),{},{texts:Yd(e.data.texts),attributes:Yd(e.data.attributes),removes:Yd(e.data.removes),adds:Yd(e.data.adds)})});if(e.type===vu.IncrementalSnapshot&&e.data.source===yu.StyleSheetRule)return G(G({},e),{},{cv:`2024-10`,data:G(G({},e.data),{},{adds:Yd(e.data.adds),removes:Yd(e.data.removes)})})}catch(e){Gd.error(`could not compress event - will use uncompressed event`,e)}return e}(i):i,s={$snapshot_bytes:gu(o),$snapshot_data:o,$session_id:this.sessionId,$window_id:this.windowId};this.status===`disabled`?this.clearBuffer():this._captureSnapshotBuffered(s)}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&z){var e=this._maskUrl(z.location.href);this._lastHref!==e&&(this._tryAddCustomEvent(`$url_changed`,{href:e}),this._lastHref=e)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach((e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)}))}}_maskUrl(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n={url:e};return(n=t.maskNetworkRequestFn(n))?.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&=(clearTimeout(this.flushBufferTimer),void 0);var e=this.minimumDuration,t=this.sessionDuration,n=Vs(t)&&t>=0,r=Vs(e)&&n&&t<e;return this.status===`buffering`||this.status===`paused`||r?(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3),this.buffer):(this.buffer.data.length>0&&_u(this.buffer).forEach((e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:`web`,$lib_version:ls.LIB_VERSION})})),this.clearBuffer())}_captureSnapshotBuffered(e){var t=2+(this.buffer?.data.length||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+t>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3))}_captureSnapshot(e){this.instance.capture(`$snapshot`,e,{_url:this.instance.requestRouter.endpointFor(`api`,this._endpoint),_noTruncate:!0,_batchKey:`recordings`,skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(z!==void 0&&z.location.href){var e=z.location.href,t=this.status===`paused`,n=Zd(e,this._urlBlocklist);n&&!t?this._pauseRecording():!n&&t&&this._resumeRecording(),Zd(e,this._urlTriggers)&&this._activateTrigger(`url`)}}_activateTrigger(e){var t,n;this.triggerStatus===`trigger_pending`&&((t=this.instance)==null||(n=t.persistence)==null||n.register({[e===`url`?hc:gc]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+`_trigger_matched`))}_pauseRecording(){this.status!==`paused`&&(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Gd.info(`recording paused due to URL blocker`),this._tryAddCustomEvent(`recording paused`,{reason:`url blocker`}))}_resumeRecording(){this.status===`paused`&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent(`recording resumed`,{reason:`left blocked url`}),Gd.info(`recording resumed`))}_addEventTriggerListener(){this._eventTriggers.length!==0&&Bs(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on(`eventCaptured`,(e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger(`event`)}catch(e){Gd.error(`Could not activate event trigger`,e)}})))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted(`linked_flag_overridden`)}overrideSampling(){var e;(e=this.instance.persistence)==null||e.register({[mc]:!0}),this._tryTakeFullSnapshot(),this._reportStarted(`sampling_overridden`)}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),Gd.info(e.replace(`_`,` `),t),H([`recording_initialized`,`session_id_changed`],e)||this._tryAddCustomEvent(e,t)}},$d=Ks(`[RemoteConfig]`),ef=class{constructor(e){this.instance=e}get remoteConfig(){var e,t;return(e=V._POSTHOG_REMOTE_CONFIG)==null||(t=e[this.instance.config.token])==null?void 0:t.config}_loadRemoteConfigJs(e){var t,n,r;(t=V.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=V.__PosthogExtensions__)==null||(r=n.loadExternalDependency)==null||r.call(n,this.instance,`remote-config`,(()=>e(this.remoteConfig))):($d.error(`PostHog Extensions not found. Cannot load remote config.`),e())}_loadRemoteConfigJSON(e){this.instance._send_request({method:`GET`,url:this.instance.requestRouter.endpointFor(`assets`,`/array/${this.instance.config.token}/config`),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return $d.info(`Using preloaded remote config`,this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void $d.warn(`Remote config is disabled. Falling back to local config.`);this._loadRemoteConfigJs((e=>{if(!e)return $d.info(`No config found after loading remote JS config. Falling back to JSON.`),void this._loadRemoteConfigJSON((e=>{this.onRemoteConfig(e)}));this.onRemoteConfig(e)}))}catch(e){$d.error(`Error loading remote config`,e)}}onRemoteConfig(e){e?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this.instance.featureFlags.ensureFlagsLoaded()):$d.info(`__preview_remote_config is disabled. Logging config instead`,e):$d.error(`Failed to fetch remote config from PostHog.`)}},tf,nf=z!=null&&z.location?pl(z.location.hash,`__posthog`)||pl(location.hash,`state`):null,rf=`_postHogToolbarParams`,af=Ks(`[Toolbar]`);(function(e){e[e.UNINITIALIZED=0]=`UNINITIALIZED`,e[e.LOADING=1]=`LOADING`,e[e.LOADED=2]=`LOADED`})(tf||={});var of=class{constructor(e){this.instance=e}setToolbarState(e){V.ph_toolbar_state=e}getToolbarState(){return V.ph_toolbar_state??tf.UNINITIALIZED}maybeLoadToolbar(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!z||!B)return!1;e??=z.location,n??=z.history;try{if(!t){try{z.localStorage.setItem(`test`,`test`),z.localStorage.removeItem(`test`)}catch{return!1}t=z?.localStorage}var r,i=nf||pl(e.hash,`__posthog`)||pl(e.hash,`state`),a=i?vs((()=>JSON.parse(atob(decodeURIComponent(i)))))||vs((()=>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(rf)||`{}`)).source=`localstorage`,delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}_callLoadToolbar(e){var t=V.ph_load_toolbar||V.ph_load_editor;!Bs(t)&&Ps(t)?t(e,this.instance):af.warn(`No toolbar load function found`)}loadToolbar(e){var t=!(B==null||!B.getElementById(jc));if(!z||t)return!1;var n=this.instance.requestRouter.region===`custom`&&this.instance.config.advanced_disable_toolbar_metrics,r=G(G({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor(`ui`)},n?{instrument:!1}:{});if(z.localStorage.setItem(rf,JSON.stringify(G(G({},r),{},{source:void 0}))),this.getToolbarState()===tf.LOADED)this._callLoadToolbar(r);else if(this.getToolbarState()===tf.UNINITIALIZED){var i,a;this.setToolbarState(tf.LOADING),(i=V.__PosthogExtensions__)==null||(a=i.loadExternalDependency)==null||a.call(i,this.instance,`toolbar`,(e=>{if(e)return af.error(`[Toolbar] Failed to load`,e),void this.setToolbarState(tf.UNINITIALIZED);this.setToolbarState(tf.LOADED),this._callLoadToolbar(r)})),Ts(z,`turbolinks:load`,(()=>{this.setToolbarState(tf.UNINITIALIZED),this.loadToolbar(r)}))}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}},sf=3e3,cf=class{constructor(e,t){K(this,`isPaused`,!0),K(this,`queue`,[]),this.flushTimeoutMs=rd(t?.flush_interval_ms||sf,250,5e3,`flush interval`,sf),this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var e=this.queue.length>0?this.formatQueue():{},t=Object.values(e);[...t.filter((e=>e.url.indexOf(`/e`)===0)),...t.filter((e=>e.url.indexOf(`/e`)!==0))].map((e=>{this.sendRequest(G(G({},e),{},{transport:`sendBeacon`}))}))}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((()=>{if(this.clearFlushTimeout(),this.queue.length>0){var t=this.formatQueue(),n=function(n){var r=t[n],i=new Date().getTime();r.data&&Ns(r.data)&&ms(r.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return ms(this.queue,(t=>{var n,r=t,i=(r?r.batchKey:null)||r.url;U(e[i])&&(e[i]=G(G({},r),{},{data:[]})),(n=e[i].data)==null||n.push(r.data)})),this.queue=[],e}},lf=function(e){var t,n,r,i,a=``;for(t=n=0,r=(e=(e+``).replace(/\r\n/g,`
|
|
148
148
|
`).replace(/\r/g,`
|
|
149
149
|
`)).length,i=0;i<r;i++){var o=e.charCodeAt(i),s=null;o<128?n++:s=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),zs(s)||(n>t&&(a+=e.substring(t,n)),a+=s,t=n=i+1)}return n>t&&(a+=e.substring(t,e.length)),a},uf=!!os||!!as,df=`text/plain`,ff=(e,t)=>{var[n,r]=e.split(`?`),i=G({},t);r?.split(`&`).forEach((e=>{var[t]=e.split(`=`);delete i[t]}));var a=ul(i);return a=a?(r?r+`&`:``)+a:r,`${n}?${a}`},pf=(e,t)=>JSON.stringify(e,((e,t)=>typeof t==`bigint`?t.toString():t),t),mf=e=>{var{data:t,compression:n}=e;if(t){if(n===Qo.GZipJS){var r=Vd(Hd(pf(t)),{mtime:0}),i=new Blob([r],{type:df});return{contentType:df,body:i,estimatedSize:i.size}}if(n===Qo.Base64){var a=(e=>`data=`+encodeURIComponent(typeof e==`string`?e:pf(e)))(function(e){var t,n,r,i,a,o=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,s=0,c=0,l=``,u=[];if(!e)return e;e=lf(e);do t=(a=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=a>>12&63,r=a>>6&63,i=63&a,u[c++]=o.charAt(t)+o.charAt(n)+o.charAt(r)+o.charAt(i);while(s<e.length);switch(l=u.join(``),e.length%3){case 1:l=l.slice(0,-2)+`==`;break;case 2:l=l.slice(0,-1)+`=`}return l}(pf(t)));return{contentType:`application/x-www-form-urlencoded`,body:a,estimatedSize:new Blob([a]).size}}var o=pf(t);return{contentType:`application/json`,body:o,estimatedSize:new Blob([o]).size}}},hf=[];as&&hf.push({transport:`fetch`,method:e=>{var{contentType:t,body:n,estimatedSize:r}=mf(e)??{},i=new Headers;ms(e.headers,(function(e,t){i.append(t,e)})),t&&i.append(`Content-Type`,t);var a=e.url,o=null;if(ss){var s=new ss;o={signal:s.signal,timeout:setTimeout((()=>s.abort()),e.timeout)}}as(a,G({method:e?.method||`GET`,headers:i,keepalive:e.method===`POST`&&(r||0)<52428.8,body:n,signal:o?.signal},e.fetchOptions)).then((t=>t.text().then((n=>{var r,i={statusCode:t.status,text:n};if(t.status===200)try{i.json=JSON.parse(n)}catch(e){W.error(e)}(r=e.callback)==null||r.call(e,i)})))).catch((t=>{var n;W.error(t),(n=e.callback)==null||n.call(e,{statusCode:0,text:t})})).finally((()=>o?clearTimeout(o.timeout):null))}}),os&&hf.push({transport:`XHR`,method:e=>{var t=new os;t.open(e.method||`GET`,e.url,!0);var{contentType:n,body:r}=mf(e)??{};ms(e.headers,(function(e,n){t.setRequestHeader(n,e)})),n&&t.setRequestHeader(`Content-Type`,n),e.timeout&&(t.timeout=e.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(t.readyState===4){var n,r={statusCode:t.status,text:t.responseText};if(t.status===200)try{r.json=JSON.parse(t.responseText)}catch{}(n=e.callback)==null||n.call(e,r)}},t.send(r)}}),rs!=null&&rs.sendBeacon&&hf.push({transport:`sendBeacon`,method:e=>{var t=ff(e.url,{beacon:`1`});try{var{contentType:n,body:r}=mf(e)??{},i=typeof r==`string`?new Blob([r],{type:n}):r;rs.sendBeacon(t,i)}catch{}}});var gf=[`retriesPerformedSoFar`],_f=class{constructor(e){K(this,`isPolling`,!1),K(this,`pollIntervalMs`,3e3),K(this,`queue`,[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!U(z)&&`onLine`in z.navigator&&(this.areWeOnline=z.navigator.onLine,Ts(z,`online`,(()=>{this.areWeOnline=!0,this.flush()})),Ts(z,`offline`,(()=>{this.areWeOnline=!1})))}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=Xs(e,gf);Vs(t)&&t>0&&(n.url=ff(n.url,{retry_count:t})),this.instance._send_request(G(G({},n),{},{callback:e=>{var r;e.statusCode!==200&&(e.statusCode<400||e.statusCode>=500)&&(t??0)<10?this.enqueue(G({retriesPerformedSoFar:t},n)):(r=n.callback)==null||r.call(n,e)}}))}enqueue(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)*(r-n);return Math.ceil(r+i)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});var i=`Enqueued failed request for retry in ${n}`;navigator.onLine||(i+=` (Browser is offline)`),W.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout((()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()}),this.pollIntervalMs)}flush(){var e=Date.now(),t=[],n=this.queue.filter((n=>n.retryAt<e||(t.push(n),!1)));if(this.queue=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.poller&&=(clearTimeout(this.poller),void 0),this.queue))try{this.instance._send_request(G(G({},e),{},{transport:`sendBeacon`}))}catch(e){W.error(e)}this.queue=[]}},vf,yf=Ks(`[SessionId]`),bf=class{constructor(e,t,n){var r;if(K(this,`_sessionIdChangedHandlers`,[]),!e.persistence)throw Error(`SessionIdManager requires a PostHogPersistence instance`);if(e.config.__preview_experimental_cookieless_mode)throw Error(`SessionIdManager cannot be used with __preview_experimental_cookieless_mode`);this.config=e.config,this.persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||qc,this._windowIdGenerator=n||qc;var i=this.config.persistence_name||this.config.token;if(this._sessionTimeoutMs=1e3*rd(this.config.session_idle_timeout_seconds||1800,60,36e3,`session_idle_timeout_seconds`,1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key=`ph_`+i+`_window_id`,this._primary_window_exists_storage_key=`ph_`+i+`_primary_window_exists`,this._canUseSessionStorage()){var a=sl.parse(this._window_id_storage_key),o=sl.parse(this._primary_window_exists_storage_key);a&&!o?this._windowId=a:sl.remove(this._window_id_storage_key),sl.set(this._primary_window_exists_storage_key,!0)}if((r=this.config.bootstrap)!=null&&r.sessionID)try{var s=(e=>{var t=e.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.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),s)}catch(e){yf.error(`Invalid sessionID in bootstrap`,e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return U(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return this.config.persistence!==`memory`&&!this.persistence.disabled&&sl.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&sl.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?sl.parse(this._window_id_storage_key):null}_setSessionId(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[pc]:[t,e,n]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[pc];return Ns(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){Ts(z,`beforeunload`,(()=>{this._canUseSessionStorage()&&sl.remove(this._primary_window_exists_storage_key)}),{capture:!1})}checkAndGetSessionAndWindowId(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw Error(`checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode`);var n=t||new Date().getTime(),[r,i,a]=this._getSessionId(),o=this._getWindowId(),s=Vs(a)&&a>0&&Math.abs(n-a)>864e5,c=!1,l=!i,u=!e&&Math.abs(n-r)>this.sessionTimeoutMs;l||u||s?(i=this._sessionIdGenerator(),o=this._windowIdGenerator(),yf.info(`new session ID generated`,{sessionId:i,windowId:o,changeReason:{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}}),a=n,c=!0):o||(o=this._windowIdGenerator(),c=!0);var d=r===0||!e||s?n:r,f=a===0?new Date().getTime():a;return this._setWindowId(o),this._setSessionId(i,d,f),e||this.resetIdleTimer(),c&&this._sessionIdChangedHandlers.forEach((e=>e(i,o,c?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}:void 0))),{sessionId:i,windowId:o,sessionStartTimestamp:f,changeReason:c?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}:void 0,lastActivityTimestamp:r}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{this.resetSessionId()}),1.1*this.sessionTimeoutMs)}};(function(e){e.US=`us`,e.EU=`eu`,e.CUSTOM=`custom`})(vf||={});var xf=`i.posthog.com`,Sf=class{constructor(e){K(this,`_regionCache`,{}),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 uiHost(){var e=this.instance.config.ui_host?.replace(/\/$/,``);return e||=this.apiHost.replace(`.${xf}`,`.posthog.com`),e===`https://app.posthog.com`?`https://us.posthog.com`:e}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=vf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=vf.EU:this._regionCache[this.apiHost]=vf.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``;if(t&&=t[0]===`/`?t:`/${t}`,e===`ui`)return this.uiHost+t;if(this.region===vf.CUSTOM)return this.apiHost+t;var n=xf+t;switch(e){case`assets`:return`https://${this.region}-assets.${n}`;case`api`:return`https://${this.region}.${n}`}}},Cf=`posthog-js`;function wf(e){var{organization:t,projectId:n,prefix:r,severityAllowList:i=[`error`]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a=>{if(!(i===`*`||i.includes(a.level))||!e.__loaded)return a;a.tags||={};var o=e.requestRouter.endpointFor(`ui`,`/project/${e.config.token}/person/${e.get_distinct_id()}`);a.tags[`PostHog Person URL`]=o,e.sessionRecordingStarted()&&(a.tags[`PostHog Recording URL`]=e.get_session_replay_url({withTimestamp:!0}));var s=a.exception?.values||[];s.forEach((e=>{e.stacktrace&&(e.stacktrace.type=`raw`,e.stacktrace.frames.forEach((e=>{e.platform=`web:javascript`})))}));var c={$exception_message:s[0]?.value||a.message,$exception_type:s[0]?.type,$exception_personURL:o,$exception_level:a.level,$exception_list:s,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:s[0]?.value||a.message,$sentry_exception_type:s[0]?.type,$sentry_tags:a.tags};return t&&n&&(c.$sentry_url=(r||`https://sentry.io/organizations/`)+t+`/issues/?project=`+n+`&query=`+a.event_id),e.exceptions.sendExceptionEvent(c),a}}var Tf=class{constructor(e,t,n,r,i){this.name=Cf,this.setupOnce=function(a){a(wf(e,{organization:t,projectId:n,prefix:r,severityAllowList:i}))}}},Ef=Ks(`[SegmentIntegration]`);function Df(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()||qc();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(wc,`identified`)),t()},i=n.user();`then`in i&&Ps(i.then)?i.then((e=>r(e))):r(i)})(e,(()=>{n.register((e=>{Promise&&Promise.resolve||Ef.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()||(Ef.info(`No userId set, resetting PostHog`),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Ef.info(`UserId set, identifying with PostHog`),e.identify(t.event.userId));var r=e._calculate_event_properties(n,t.event.properties??{},new Date);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,`$pageview`),identify:e=>t(e,`$identify`),screen:e=>t(e,`$screen`)}})(e)).then((()=>{t()}))}))}var Of=class{constructor(e){this._instance=e}doPageView(e,t){var n=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:z?.location.pathname??``,pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){return this._previousPageViewProperties(e,this._currentPageview?.pageViewId)}doEvent(){return{$pageview_id:this._currentPageview?.pageViewId}}_previousPageViewProperties(e,t){var n=this._currentPageview;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{maxScrollHeight:a,lastScrollY:o,maxScrollY:s,maxContentHeight:c,lastContentY:l,maxContentY:u}=i;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?1:rd(o/a,0,1),f=a<=1?1:rd(s/a,0,1),p=c<=1?1:rd(l/c,0,1),m=c<=1?1:rd(u/c,0,1);r=hs(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}},kf,Af,jf,Mf,Nf,Pf,Ff,If,Lf={},Rf=[],zf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Bf=Array.isArray;function Vf(e,t){for(var n in t)e[n]=t[n];return e}function Hf(e){var t=e.parentNode;t&&t.removeChild(e)}function Uf(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++jf,__i:-1,__u:0};return i==null&&Af.vnode!=null&&Af.vnode(a),a}function Wf(e){return e.children}function Gf(e,t){this.props=e,this.context=t}function Kf(e,t){if(t==null)return e.__?Kf(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?Kf(e):null}function qf(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return qf(e)}}function Jf(e){(!e.__d&&(e.__d=!0)&&Mf.push(e)&&!Yf.__r++||Nf!==Af.debounceRendering)&&((Nf=Af.debounceRendering)||Pf)(Yf)}function Yf(){var e,t,n,r,i,a,o,s,c;for(Mf.sort(Ff);e=Mf.shift();)e.__d&&(t=Mf.length,r=void 0,a=(i=(n=e).__v).__e,s=[],c=[],(o=n.__P)&&((r=Vf({},i)).__v=i.__v+1,Af.vnode&&Af.vnode(r),ip(o,r,i,n.__n,o.ownerSVGElement!==void 0,32&i.__u?[a]:null,s,a??Kf(i),!!(32&i.__u),c),r.__.__k[r.__i]=r,ap(s,r,c),r.__e!=a&&qf(r)),Mf.length>t&&Mf.sort(Ff));Yf.__r=0}function Xf(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g=r&&r.__k||Rf,_=t.length;for(n.__d=c,Zf(n,t,g),c=n.__d,d=0;d<_;d++)(p=n.__k[d])!=null&&typeof p!=`boolean`&&typeof p!=`function`&&(f=p.__i===-1?Lf:g[p.__i]||Lf,p.__i=d,ip(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&sp(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),65536&p.__u||f.__k===p.__k?c=Qf(p,c,e):typeof p.type==`function`&&p.__d!==void 0?c=p.__d:m&&(c=m.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=c,n.__e=h}function Zf(e,t,n){var r,i,a,o,s,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r<c;r++)(i=e.__k[r]=(i=t[r])==null||typeof i==`boolean`||typeof i==`function`?null:typeof i==`string`||typeof i==`number`||typeof i==`bigint`||i.constructor==String?Uf(null,i,null,null,i):Bf(i)?Uf(Wf,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?Uf(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)==null?(a=n[r])&&a.key==null&&a.__e&&(a.__e==e.__d&&(e.__d=Kf(a)),cp(a,a,!1),n[r]=null,u--):(i.__=e,i.__b=e.__b+1,s=$f(i,n,o=r+d,u),i.__i=s,a=null,s!==-1&&(u--,(a=n[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&d--,typeof i.type!=`function`&&(i.__u|=65536)):s!==o&&(s===o+1?d++:s>o?u>c-o?d+=s-o:d--:d=s<o&&s==o-1?s-o:0,s!==r+d&&(i.__u|=65536)));if(u)for(r=0;r<l;r++)(a=n[r])!=null&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=Kf(a)),cp(a,a))}function Qf(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=Qf(r[i],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function $f(e,t,n,r){var i=e.key,a=e.type,o=n-1,s=n+1,c=t[n];if(c===null||c&&i==c.key&&a===c.type)return n;if(r>+(c!=null&&!(131072&c.__u)))for(;o>=0||s<t.length;){if(o>=0){if((c=t[o])&&!(131072&c.__u)&&i==c.key&&a===c.type)return o;o--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&i==c.key&&a===c.type)return s;s++}}return-1}function ep(e,t,n){t[0]===`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||zf.test(t)?n:n+`px`}function tp(e,t,n,r,i){var a;e:if(t===`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ep(e.style,t,``);if(n)for(t in n)r&&n[t]===r[t]||ep(e.style,t,n[t])}else if(t[0]===`o`&&t[1]===`n`)a=t!==(t=t.replace(/(PointerCapture)$|Capture$/,`$1`)),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,a?rp:np,a)):e.removeEventListener(t,a?rp:np,a);else{if(i)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!==`width`&&t!==`height`&&t!==`href`&&t!==`list`&&t!==`form`&&t!==`tabIndex`&&t!==`download`&&t!==`rowSpan`&&t!==`colSpan`&&t!==`role`&&t in e)try{e[t]=n??``;break e}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!==`-`?e.removeAttribute(t):e.setAttribute(t,n))}}function np(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Af.event?Af.event(e):e)}function rp(e){return this.l[e.type+!0](Af.event?Af.event(e):e)}function ip(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=Af.__b)&&u(t);e:if(typeof T==`function`)try{if(_=t.props,v=(u=T.contextType)&&r[u.__c],y=u?v?v.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:(`prototype`in T&&T.prototype.render?t.__c=d=new T(_,y):(t.__c=d=new Gf(_,y),d.constructor=T,d.render=lp),v&&v.sub(d),d.props=_,d.state||={},d.context=y,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),d.__s??=d.state,T.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Vf({},d.__s)),Vf(d.__s,T.getDerivedStateFromProps(_,d.__s))),p=d.props,m=d.state,d.__v=t,f)T.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(T.getDerivedStateFromProps==null&&_!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(_,y),!d.__e&&(d.shouldComponentUpdate!=null&&!1===d.shouldComponentUpdate(_,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&o.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(_,d.__s,y),d.componentDidUpdate!=null&&d.__h.push((function(){d.componentDidUpdate(p,m,h)}))}if(d.context=y,d.props=_,d.__P=e,d.__e=!1,x=Af.__r,S=0,`prototype`in T&&T.prototype.render){for(d.state=d.__s,d.__d=!1,x&&x(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do d.__d=!1,x&&x(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=Vf(Vf({},r),d.getChildContext())),f||d.getSnapshotBeforeUpdate==null||(h=d.getSnapshotBeforeUpdate(p,m)),Xf(e,Bf(w=u!=null&&u.type===Wf&&u.key==null?u.props.children:u)?w:[w],t,n,r,i,a,o,s,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,c||a!=null?(t.__e=s,t.__u|=c?160:32,a[a.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),Af.__e(e,t,n)}else a==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=op(n.__e,t,n,r,i,a,o,c,l);(u=Af.diffed)&&u(t)}function ap(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)sp(n[r],n[++r],n[++r]);Af.__c&&Af.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Af.__e(e,t.__v)}}))}function op(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props,_=t.props,v=t.type;if(v===`svg`&&(i=!0),a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName===v:p.nodeType===3)){e=p,a[l]=null;break}}if(e==null){if(v===null)return document.createTextNode(_);e=i?document.createElementNS(`http://www.w3.org/2000/svg`,v):document.createElement(v,_.is&&_),a=null,s=!1}if(v===null)g===_||s&&e.data===_||(e.data=_);else{if(a&&=kf.call(e.childNodes),g=n.props||Lf,!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],l==`children`||(l==`dangerouslySetInnerHTML`?d=p:l===`key`||l in _||tp(e,l,null,p,i));for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:l===`key`||s&&typeof p!=`function`||g[l]===p||tp(e,l,p,g[l],i);if(u)s||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),Xf(e,Bf(f)?f:[f],t,n,r,i&&v!==`foreignObject`,a,o,a?a[0]:n.__k&&Kf(n,0),s,c),a!=null)for(l=a.length;l--;)a[l]!=null&&Hf(a[l]);s||(l=`value`,m!==void 0&&(m!==e[l]||v===`progress`&&!m||v===`option`&&m!==g[l])&&tp(e,l,m,g[l],!1),l=`checked`,h!==void 0&&h!==e[l]&&tp(e,l,h,g[l],!1))}return e}function sp(e,t,n){try{typeof e==`function`?e(t):e.current=t}catch(e){Af.__e(e,n)}}function cp(e,t,n){var r,i;if(Af.unmount&&Af.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||sp(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Af.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&cp(r[i],t,n||typeof e.type!=`function`);n||e.__e==null||Hf(e.__e),e.__=e.__e=e.__d=void 0}function lp(e,t,n){return this.constructor(e,n)}kf=Rf.slice,Af={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},jf=0,Gf.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Vf({},this.state);typeof e==`function`&&(e=e(Vf({},n),this.props)),e&&Vf(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Jf(this))},Gf.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Jf(this))},Gf.prototype.render=Wf,Mf=[],Pf=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ff=function(e,t){return e.__v.__b-t.__v.__b},Yf.__r=0,If=0;var up,dp,fp;(function(e,t){var n={__c:t=`__cC`+ If++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,Jf(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};n.Provider.__=n.Consumer.contextType=n})({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0,onPreviewSubmit:()=>{}}),function(e){e.Popover=`popover`,e.API=`api`,e.Widget=`widget`}(up||={}),function(e){e.Open=`open`,e.MultipleChoice=`multiple_choice`,e.SingleChoice=`single_choice`,e.Rating=`rating`,e.Link=`link`}(dp||={}),function(e){e.NextQuestion=`next_question`,e.End=`end`,e.ResponseBased=`response_based`,e.SpecificQuestion=`specific_question`}(fp||={});var pp=class{constructor(){K(this,`events`,{}),this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.events[e]||[])n(t);for(var r of this.events[`*`]||[])r(e,t)}},mp=class e{constructor(e){K(this,`_debugEventEmitter`,new pp),K(this,`checkStep`,((e,t)=>this.checkStepEvent(e,t)&&this.checkStepUrl(e,t)&&this.checkStepElement(e,t))),K(this,`checkStepEvent`,((e,t)=>t==null||!t.event||e?.event===t?.event)),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){if(!U(this.instance?._addCaptureHook)){var e;(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.actionRegistry)==null||t.add(e),(n=e.steps)==null||n.forEach((e=>{var t;(t=this.actionEvents)==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)}))})),(n=this.instance)==null||n.autocapture.setElementSelectors(r)}}on(e,t){t!=null&&e.length!=0&&(this.actionEvents.has(e)||this.actionEvents.has(t?.event))&&this.actionRegistry&&this.actionRegistry?.size>0&&this.actionRegistry.forEach((e=>{this.checkAction(t,e)&&this._debugEventEmitter.emit(`actionCaptured`,e.name)}))}_addActionHook(e){this.onAction(`actionCaptured`,(t=>e(t)))}checkAction(e,t){if(t?.steps==null)return!1;for(var n of t.steps)if(this.checkStep(e,n))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(t,n){if(n!=null&&n.url){var r,i=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!i||typeof i!=`string`||!e.matchString(i,n?.url,n?.url_matching||`contains`))return!1}return!0}static matchString(t,n,r){switch(r){case`regex`:return!!z&&Os(t,n);case`exact`:return n===t;case`contains`:return Os(t,e.escapeStringRegexp(n).replace(/_/g,`.`).replace(/%/g,`.*`));default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}checkStepElement(t,n){if((n!=null&&n.href||n!=null&&n.tag_name||n!=null&&n.text)&&!this.getElementsList(t).some((t=>!(n!=null&&n.href&&!e.matchString(t.href||``,n?.href,n?.href_matching||`exact`))&&(n==null||!n.tag_name||t.tag_name===n?.tag_name)&&!(n!=null&&n.text&&!e.matchString(t.text||``,n?.text,n?.text_matching||`exact`)&&!e.matchString(t.$el_text||``,n?.text,n?.text_matching||`exact`)))))return!1;if(n!=null&&n.selector){var r,i=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(!i||!i.includes(n?.selector))return!1}return!0}getElementsList(e){return e?.properties.$elements==null?[]:e?.properties.$elements}},hp=class e{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){U(this.instance?._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){var t=e.filter((e=>{var t,n,r;return e.conditions?.actions&&((t=e.conditions)==null||(n=t.actions)==null||(r=n.values)==null?void 0:r.length)>0}));t.length!==0&&(this.actionMatcher??(this.actionMatcher=new mp(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook((e=>{this.onAction(e)}))),t.forEach((e=>{var t,n,r,i,a,o,s,c,l,u;e.conditions&&(t=e.conditions)!=null&&t.actions&&(n=e.conditions)!=null&&(r=n.actions)!=null&&r.values&&((i=e.conditions)==null||(a=i.actions)==null||(o=a.values)==null?void 0:o.length)>0&&((s=this.actionMatcher)==null||s.register(e.conditions.actions.values),(c=e.conditions)==null||(l=c.actions)==null||(u=l.values)==null||u.forEach((t=>{if(t&&t.name){var n=this.actionToSurveys.get(t.name);n&&n.push(e.id),this.actionToSurveys.set(t.name,n||[e.id])}})))})))}setupEventBasedSurveys(e){var t;e.filter((e=>{var t,n,r;return e.conditions?.events&&((t=e.conditions)==null||(n=t.events)==null||(r=n.values)==null?void 0:r.length)>0})).length!==0&&((t=this.instance)==null||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),e.forEach((e=>{var t,n,r;(t=e.conditions)==null||(n=t.events)==null||(r=n.values)==null||r.forEach((t=>{if(t&&t.name){var n=this.eventToSurveys.get(t.name);n&&n.push(e.id),this.eventToSurveys.set(t.name,n||[e.id])}}))})))}onEvent(t,n){var r,i,a=((r=this.instance)==null||(i=r.persistence)==null?void 0:i.props[Sc])||[];if(e.SURVEY_SHOWN_EVENT_NAME==t&&n&&a.length>0){var o,s=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(s){var c=a.indexOf(s);c>=0&&(a.splice(c,1),this._updateActivatedSurveys(a))}}else this.eventToSurveys.has(t)&&this._updateActivatedSurveys(a.concat(this.eventToSurveys.get(t)||[]))}onAction(e){var t,n,r=((t=this.instance)==null||(n=t.persistence)==null?void 0:n.props[Sc])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,n;(t=this.instance)==null||(n=t.persistence)==null||n.register({[Sc]:[...new Set(e)]})}getSurveys(){var e,t;return((e=this.instance)==null||(t=e.persistence)==null?void 0:t.props[Sc])||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}};K(hp,`SURVEY_SHOWN_EVENT_NAME`,`survey shown`);var gp=Ks(`[Surveys]`),_p={icontains:(e,t)=>e.some((e=>t.toLowerCase().includes(e.toLowerCase()))),not_icontains:(e,t)=>e.every((e=>!t.toLowerCase().includes(e.toLowerCase()))),regex:(e,t)=>e.some((e=>Os(t,e))),not_regex:(e,t)=>e.every((e=>!Os(t,e))),exact:(e,t)=>e.some((e=>t===e)),is_not:(e,t)=>e.every((e=>t!==e))};function vp(e,t,n){var r,i=e.questions[t],a=t+1;if((r=i.branching)==null||!r.type)return t===e.questions.length-1?fp.End:a;if(i.branching.type===fp.End)return fp.End;if(i.branching.type===fp.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===fp.ResponseBased){if(i.type===dp.SingleChoice){var o,s,c=i.choices.indexOf(`${n}`);if((o=i.branching)!=null&&(s=o.responseValues)!=null&&s.hasOwnProperty(c)){var l=i.branching.responseValues[c];return Number.isInteger(l)?l:l===fp.End?fp.End:a}}else if(i.type===dp.Rating){var u,d;if(typeof n!=`number`||!Number.isInteger(n))throw Error(`The response type must be an integer`);var f=function(e,t){if(t===3){if(e<1||e>3)throw Error(`The response must be in range 1-3`);return e===1?`negative`:e===2?`neutral`:`positive`}if(t===5){if(e<1||e>5)throw Error(`The response must be in range 1-5`);return e<=2?`negative`:e===3?`neutral`:`positive`}if(t===7){if(e<1||e>7)throw Error(`The response must be in range 1-7`);return e<=3?`negative`:e===4?`neutral`:`positive`}if(t===10){if(e<0||e>10)throw Error(`The response must be in range 0-10`);return e<=6?`detractors`:e<=8?`passives`:`promoters`}throw Error(`The scale must be one of: 3, 5, 7, 10`)}(n,i.scale);if((u=i.branching)!=null&&(d=u.responseValues)!=null&&d.hasOwnProperty(f)){var p=i.branching.responseValues[f];return Number.isInteger(p)?p:p===fp.End?fp.End:a}}return a}return gp.warn(`Falling back to next question index due to unexpected branching type`),a}function yp(e){return e??`icontains`}var bp=class{constructor(e){K(this,`getNextSurveyStep`,vp),this.instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){this._decideServerResponse=!!e.surveys,gp.info(`decideServerResponse set to ${this._decideServerResponse}`),this.loadIfEnabled()}reset(){localStorage.removeItem(`lastSeenSurveyDate`),(()=>{for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);n!=null&&n.startsWith(`seenSurvey_`)&&e.push(n)}return e})().forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.instance.config.disable_surveys)gp.info(`Disabled. Not loading surveys.`);else{var e=V?.__PosthogExtensions__;if(e){var t=e.generateSurveys;if(this._decideServerResponse)if(this._surveyEventReceiver??=new hp(this.instance),t)this._surveyManager=t(this.instance);else{var n=e.loadExternalDependency;n?n(this.instance,`surveys`,(t=>{t?gp.error(`Could not load surveys script`,t):this._surveyManager=e.generateSurveys?.call(e,this.instance)})):gp.error(`PostHog loadExternalDependency extension not found. Cannot load remote config.`)}else gp.warn(`Decide not loaded yet. Not loading surveys.`)}else gp.error(`PostHog Extensions not found.`)}}getSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return gp.info(`Disabled. Not loading surveys.`),e([]);this._surveyEventReceiver??=new hp(this.instance);var n=this.instance.get_property(xc);if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor(`api`,`/api/surveys/?token=${this.instance.config.token}`),method:`GET`,callback:t=>{var n,r=t.statusCode;if(r!==200||!t.json)return gp.error(`Surveys API could not be loaded, status: ${r}`),e([]);var i,a=t.json.surveys||[],o=a.filter((e=>{var t,n,r,i,a,o,s,c,l,u;return e.conditions?.events&&((t=e.conditions)==null||(n=t.events)==null?void 0:n.values)&&((r=e.conditions)==null||(i=r.events)==null||(a=i.values)==null?void 0:a.length)>0||e.conditions?.actions&&((o=e.conditions)==null||(s=o.actions)==null?void 0:s.values)&&((c=e.conditions)==null||(l=c.actions)==null||(u=l.values)==null?void 0:u.length)>0}));return o.length>0&&((i=this._surveyEventReceiver)==null||i.register(o)),(n=this.instance.persistence)==null||n.register({[xc]:a}),e(a)}})}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys((t=>{var n=t.filter((e=>!(!e.start_date||e.end_date))).filter((e=>{var t;if(!e.conditions)return!0;var n=function(e){var t,n;if((t=e.conditions)==null||!t.url)return!0;var r=z==null||(n=z.location)==null?void 0:n.href;if(!r)return!1;var i=[e.conditions.url];return _p[yp(e.conditions?.urlMatchType)](i,r)}(e),r=(t=e.conditions)==null||!t.selector||B?.querySelector(e.conditions.selector),i=function(e){var t;if((t=e.conditions)==null||!t.deviceTypes)return!0;if(!cs)return!1;var n=pu.deviceType(cs);return _p[yp(e.conditions?.deviceTypesMatchType)](e.conditions.deviceTypes,n)}(e);return n&&r&&i})),r=this._surveyEventReceiver?.getSurveys();return e(n.filter((e=>{var t,n,i,a,o,s,c,l,u;if(!(e.linked_flag_key||e.targeting_flag_key||e.internal_targeting_flag_key||(t=e.feature_flag_keys)!=null&&t.length))return!0;var d=!e.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),f=!e.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),p=e.conditions?.events&&((n=e.conditions)==null||(i=n.events)==null?void 0:i.values)&&((a=e.conditions)==null||(o=a.events)==null?void 0:o.values.length)>0,m=e.conditions?.actions&&((s=e.conditions)==null||(c=s.actions)==null?void 0:c.values)&&((l=e.conditions)==null||(u=l.actions)==null?void 0:u.values.length)>0,h=!p&&!m||r?.includes(e.id),g=this._canActivateRepeatedly(e),_=!(e.internal_targeting_flag_key&&!g)||this.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key),v=this.checkFlags(e);return d&&f&&_&&h&&v})))}),t)}checkFlags(e){var t;return(t=e.feature_flag_keys)==null||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:n}=e;return!t||!n||this.instance.featureFlags.isFeatureEnabled(n)}))}_canActivateRepeatedly(e){return Bs(V.__PosthogExtensions__?.canActivateRepeatedly)?(gp.warn(`init was not called`),!1):V.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){Bs(this._surveyManager)?gp.warn(`init was not called`):this.getSurveys((t=>{var n=t.filter((t=>t.id===e))[0];this._surveyManager.canRenderSurvey(n)}))}renderSurvey(e,t){Bs(this._surveyManager)?gp.warn(`init was not called`):this.getSurveys((n=>{var r=n.filter((t=>t.id===e))[0];this._surveyManager.renderSurvey(r,B?.querySelector(t))}))}},xp=Ks(`[RateLimiter]`),Sp=class{constructor(e){K(this,`serverLimits`,{}),K(this,`lastEventRateLimited`,!1),K(this,`checkForLimiting`,(e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{xp.info(`${e||`events`} is quota limited.`),this.serverLimits[e]=new Date().getTime()+6e4}))}catch(e){xp.warn(`could not rate limit - continuing. Error: "${e?.message}"`,{text:t});return}})),this.instance=e,this.captureEventsPerSecond=e.config.rate_limiting?.events_per_second||10,this.captureEventsBurstLimit=Math.max(e.config.rate_limiting?.events_burst_limit||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],n=new Date().getTime(),r=this.instance.persistence?.get_property(Ec)??{tokens:this.captureEventsBurstLimit,last:n};r.tokens+=(n-r.last)/1e3*this.captureEventsPerSecond,r.last=n,r.tokens>this.captureEventsBurstLimit&&(r.tokens=this.captureEventsBurstLimit);var i=r.tokens<1;return i||t||(r.tokens=Math.max(0,r.tokens-1)),!i||this.lastEventRateLimited||t||this.instance.capture(`$$client_ingestion_warning`,{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to ${this.captureEventsPerSecond} events per second and ${this.captureEventsBurstLimit} events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=i,(e=this.instance.persistence)==null||e.set_property(Ec,r),{isRateLimited:i,remainingTokens:r.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||`events`]||!1;return!1!==t&&new Date().getTime()<t}},Cp=e=>{var t=e?.config;return G({initialPathName:is?.pathname||``,referringDomain:pu.referringDomain()},pu.campaignParams({customTrackedParams:t?.custom_campaign_params,maskPersonalDataProperties:t?.mask_personal_data_properties,customPersonalDataProperties:t?.custom_personal_data_properties}))},wp=class{constructor(e,t,n,r){K(this,`_onSessionIdCallback`,(e=>{var t=this._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[Tc]:n})}})),this.instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||Cp,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[Tc]}getSessionProps(){var e=this._getStoredProps()?.props;return e?{$client_session_initial_referring_host:e.referringDomain,$client_session_initial_pathname:e.initialPathName,$client_session_initial_utm_source:e.utm_source,$client_session_initial_utm_campaign:e.utm_campaign,$client_session_initial_utm_medium:e.utm_medium,$client_session_initial_utm_content:e.utm_content,$client_session_initial_utm_term:e.utm_term}:{}}},Tp=`ahrefsbot,ahrefssiteaudit,applebot,baiduspider,better uptime bot,bingbot,bingpreview,bot.htm,bot.php,crawler,deepscan,duckduckbot,facebookexternal,facebookcatalog,http://yandex.com/bots,hubspot,ia_archiver,linkedinbot,mj12bot,msnbot,nessus,petalbot,pinterest,prerender,rogerbot,screaming frog,semrushbot,sitebulb,slurp,turnitin,twitterbot,vercelbot,yahoo! slurp,yandexbot,gptbot,oai-searchbot,chatgpt-user,headlesschrome,cypress,Google-HotelAdsVerifier,adsbot-google,apis-google,duplexweb-google,feedfetcher-google,google favicon,google web preview,google-read-aloud,googlebot,googleweblight,mediapartners-google,storebot-google,Bytespider;`.split(`,`),Ep=function(e,t){if(!e)return!1;var n=e.toLowerCase();return Tp.concat(t||[]).some((e=>{var t=e.toLowerCase();return n.indexOf(t)!==-1}))},Dp=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&Ep(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((e=>Ep(e?.brand,t))))return!0}catch{}return!!e.webdriver},Op=class{constructor(){this.clicks=[]}isRageClick(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}},kp=Ks(`[Dead Clicks]`),Ap=()=>!0,jp=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(ic)),r=e.instance.config.capture_dead_clicks;return Hs(r)?r:n},Mp=class{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[ic]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript((()=>{this.start()}))}loadScript(e){var t,n,r;(t=V.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(n=V.__PosthogExtensions__)==null||(r=n.loadExternalDependency)==null||r.call(n,this.instance,`dead-clicks-autocapture`,(t=>{t?kp.error(`failed to load script`,t):e()}))}start(){var e;if(B){if(!this._lazyLoadedDeadClicksAutocapture&&(e=V.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=Fs(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=V.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(B),kp.info(`starting...`)}}else kp.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,kp.info(`stopping...`))}},Np=Ks(`[Heatmaps]`);function Pp(e){return Fs(e)&&`clientX`in e&&`clientY`in e&&Vs(e.clientX)&&Vs(e.clientY)}var Fp=class{constructor(e){var t;K(this,`rageclicks`,new Op),K(this,`_enabledServerSide`,!1),K(this,`_initialized`,!1),K(this,`_flushInterval`,null),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)==null||!t.props[tc]),Ts(z,`beforeunload`,this.flush)}get flushIntervalMilliseconds(){var e=5e3;return Fs(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return U(this.instance.config.capture_heatmaps)?U(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;Np.info(`starting...`),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e;clearInterval(this._flushInterval??void 0),(e=this.deadClicksCapture)==null||e.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tc]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.buffer;return this.buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,`deadclick`)}_setupListeners(){z&&B&&(Ts(B,`click`,(e=>this._onClick(e||z?.event)),{capture:!0}),Ts(B,`mousemove`,(e=>this._onMouseMove(e||z?.event)),{capture:!0}),this.deadClicksCapture=new Mp(this.instance,Ap,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(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&&xu(r)&&!Su(r,`body`);){if(r===n)return!1;if(H(t,z?.getComputedStyle(r).position))return!0;r=Mu(r)}return!1}(Au(e),[`fixed`,`sticky`],i);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:n),target_fixed:a,type:t}}_onClick(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`click`;if(!bu(e.target)&&Pp(e)){var r=this._getProperties(e,n);(t=this.rageclicks)!=null&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(G(G({},r),{},{type:`rageclick`})),this._capture(r)}}_onMouseMove(e){!bu(e.target)&&Pp(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,`mousemove`))}),500))}_capture(e){if(z){var t=z.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}flush(){this.buffer&&!Is(this.buffer)&&this.instance.capture(`$$heatmap`,{$heatmap_data:this.getAndClearBuffer()})}},Ip=class{constructor(e){K(this,`_updateScrollData`,(()=>{this.context||={};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.context.lastScrollY=Math.ceil(t),this.context.maxScrollY=Math.max(t,this.context.maxScrollY??0),this.context.maxScrollHeight=Math.max(n,this.context.maxScrollHeight??0),this.context.lastContentY=r,this.context.maxContentY=Math.max(r,this.context.maxContentY??0),this.context.maxContentHeight=Math.max(i,this.context.maxContentHeight??0)})),this.instance=e}getContext(){return this.context}resetContext(){var e=this.context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){Ts(z,`scroll`,this._updateScrollData,{capture:!0}),Ts(z,`scrollend`,this._updateScrollData,{capture:!0}),Ts(z,`resize`,this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return z?.document.documentElement;for(var e of Ns(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]){var t=z?.document.querySelector(e);if(t)return t}}scrollY(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return z&&(z.scrollY||z.pageYOffset||z.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return z&&(z.scrollX||z.pageXOffset||z.document.documentElement.scrollLeft)||0}},Lp=Ks(`[AutoCapture]`);function Rp(e,t){return t.length>e?t.slice(0,e)+`...`:t}function zp(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!xu(t));return t}function Bp(e,t,n,r){var i=e.tagName.toLowerCase(),a={tag_name:i};ju.indexOf(i)>-1&&!n&&(i.toLowerCase()===`a`||i.toLowerCase()===`button`?a.$el_text=Rp(1024,Uu(e)):a.$el_text=Rp(1024,ku(e)));var o=Du(e);o.length>0&&(a.classes=o.filter((function(e){return e!==``}))),ms(e.attributes,(function(n){var i;if((!Fu(e)||[`name`,`id`,`class`,`aria-label`].indexOf(n.name)!==-1)&&(r==null||!r.includes(n.name))&&!t&&Hu(n.value)&&(i=n.name,!Ls(i)||i.substring(0,10)!==`_ngcontent`&&i.substring(0,7)!==`_nghost`)){var o=n.value;n.name===`class`&&(o=Tu(o).join(` `)),a[`attr__`+n.name]=Rp(1024,o)}}));for(var s=1,c=1,l=e;l=zp(l);)s++,l.tagName===e.tagName&&c++;return a.nth_child=s,a.nth_of_type=c,a}function Vp(e,t){for(var n,{e:r,maskAllElementAttributes:i,maskAllText:a,elementAttributeIgnoreList:o,elementsChainAsString:s}=t,c=[e],l=e;l.parentNode&&!Su(l,`body`);)wu(l.parentNode)?(c.push(l.parentNode.host),l=l.parentNode.host):(c.push(l.parentNode),l=l.parentNode);var u,d=[],f={},p=!1,m=!1;if(ms(c,(e=>{var t=Pu(e);e.tagName.toLowerCase()===`a`&&(p=e.getAttribute(`href`),p=t&&p&&Hu(p)&&p),H(Du(e),`ph-no-capture`)&&(m=!0),d.push(Bp(e,i,a,o)),hs(f,function(e){if(!Pu(e))return{};var t={};return ms(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&&Hu(r)&&(t[n]=r)}})),t}(e))})),m)return{props:{},explicitNoCapture:m};if(a||(e.tagName.toLowerCase()===`a`||e.tagName.toLowerCase()===`button`?d[0].$el_text=Uu(e):d[0].$el_text=ku(e)),p){var h;d[0].attr__href=p;var g=ll(p)?.host,_=z==null||(h=z.location)==null?void 0:h.host;g&&_&&g!==_&&(u=p)}return{props:hs({$event_type:r.type,$ce_version:1},s?{}:{$elements:d},{$elements_chain:Gu(d)},(n=d[0])!=null&&n.$el_text?{$el_text:d[0]?.$el_text}:{},u&&r.type===`click`?{$external_click_url:u}:{},f)}}var Hp=class{constructor(e){K(this,`_initialized`,!1),K(this,`_isDisabledServerSide`,null),K(this,`rageclicks`,new Op),K(this,`_elementsChainAsString`,!1),this.instance=e,this._elementSelectors=null}get config(){var e=Fs(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}_addDomEventHandlers(){if(this.isBrowserSupported()){if(z&&B){var e=e=>{e||=z?.event;try{this._captureEvent(e)}catch(e){Lp.error(`Failed to capture event`,e)}};if(Ts(B,`submit`,e,{capture:!0}),Ts(B,`change`,e,{capture:!0}),Ts(B,`click`,e,{capture:!0}),this.config.capture_copied_text){var t=e=>{e||=z?.event,this._captureEvent(e,us)};Ts(B,`copy`,t,{capture:!0}),Ts(B,`cut`,t,{capture:!0})}}}else Lp.info(`Disabling Automatic Event Collection because this browser is not supported`)}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ec]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,n=[];return(t=this._elementSelectors)==null||t.forEach((t=>{(B?.querySelectorAll(t))?.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e=this.instance.persistence?.props[ec],t=this._isDisabledServerSide;if(zs(t)&&!Hs(e)&&!this.instance.config.advanced_disable_decide)return!1;var n=this._isDisabledServerSide??!!e;return!!this.instance.config.autocapture&&!n}_captureEvent(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`$autocapture`;if(this.isEnabled){var n,r=Au(e);Cu(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,new Date().getTime())&&this._captureEvent(e,`$rageclick`);var i=t===us;if(r&&Nu(r,e,this.config,i,i?[`copy`,`cut`]:void 0)){var{props:a,explicitNoCapture:o}=Vp(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(o)return!1;var s=this.getElementSelectors(r);if(s&&s.length>0&&(a.$element_selectors=s),t===`$copy_autocapture`){var c,l=Ou(z==null||(c=z.getSelection())==null?void 0:c.toString()),u=e.type||`clipboard`;if(!l)return!1;a.$selected_content=l,a.$copy_type=u}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return Ps(B?.querySelectorAll)}},Up=Ks(`[TracingHeaders]`),Wp=class{constructor(e){K(this,`_restoreXHRPatch`,void 0),K(this,`_restoreFetchPatch`,void 0),K(this,`_startCapturing`,(()=>{var e,t,n,r;U(this._restoreXHRPatch)&&((e=V.__PosthogExtensions__)==null||(t=e.tracingHeadersPatchFns)==null||t._patchXHR(this.instance.sessionManager)),U(this._restoreFetchPatch)&&((n=V.__PosthogExtensions__)==null||(r=n.tracingHeadersPatchFns)==null||r._patchFetch(this.instance.sessionManager))})),this.instance=e}_loadScript(e){var t,n,r;(t=V.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=V.__PosthogExtensions__)==null||(r=n.loadExternalDependency)==null||r.call(n,this.instance,`tracing-headers`,(t=>{if(t)return Up.error(`failed to load script`,t);e()}))}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((e=this._restoreXHRPatch)==null||e.call(this),(t=this._restoreFetchPatch)==null||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}},Gp;(function(e){e[e.PENDING=-1]=`PENDING`,e[e.DENIED=0]=`DENIED`,e[e.GRANTED=1]=`GRANTED`})(Gp||={});var Kp=class{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?Gp.DENIED:this.storedConsent}isOptedOut(){return this.consent===Gp.DENIED||this.consent===Gp.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,+!!e,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||`__ph_opt_in_out_`)+e}get storedConsent(){var e=this.storage.get(this.storageKey);return e===`1`?Gp.GRANTED:e===`0`?Gp.DENIED:Gp.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e===`localStorage`?tl:$c;var t=e===`localStorage`?$c:tl;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(t.get(this.storageKey)===`1`),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!ws([rs?.doNotTrack,rs?.msDoNotTrack,V.doNotTrack],(e=>H([!0,1,`1`,`yes`],e)))}},qp=Ks(`[ExceptionAutocapture]`),Jp=class{constructor(e){var t;K(this,`originalOnUnhandledRejectionHandler`,void 0),K(this,`startCapturing`,(()=>{var e,t,n,r;if(z&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var i=(e=V.__PosthogExtensions__)==null||(t=e.errorWrappingFunctions)==null?void 0:t.wrapOnError,a=(n=V.__PosthogExtensions__)==null||(r=n.errorWrappingFunctions)==null?void 0:r.wrapUnhandledRejection;if(i&&a)try{this.unwrapOnError=i(this.captureException.bind(this)),this.unwrapUnhandledRejection=a(this.captureException.bind(this))}catch(e){qp.error(`failed to start`,e),this.stopCapturing()}else qp.error(`failed to load error wrapping functions - cannot start`)}})),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)==null||!t.props[nc]),this.startIfEnabled()}get isEnabled(){var e;return(e=this.remoteEnabled)!=null&&e}get isCapturing(){var e;return!(z==null||(e=z.onerror)==null||!e.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(qp.info(`enabled, starting...`),this.loadScript(this.startCapturing))}loadScript(e){var t,n;this.hasHandlers&&e(),(t=V.__PosthogExtensions__)==null||(n=t.loadExternalDependency)==null||n.call(t,this.instance,`exception-autocapture`,(t=>{if(t)return qp.error(`failed to load script`,t);e()}))}stopCapturing(){var e,t;(e=this.unwrapOnError)==null||e.call(this),(t=this.unwrapUnhandledRejection)==null||t.call(this)}onRemoteConfig(e){this.remoteEnabled=!!e.autocaptureExceptions||!1,this.instance.persistence&&this.instance.persistence.register({[nc]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){e.$exception_personURL=`${this.instance.requestRouter.endpointFor(`ui`)}/project/${this.instance.config.token}/person/${this.instance.get_distinct_id()}`,this.instance.exceptions.sendExceptionEvent(e)}},Yp=Ks(`[Web Vitals]`),Xp=9e5,Zp=class{constructor(e){var t;K(this,`_enabledServerSide`,!1),K(this,`_initialized`,!1),K(this,`buffer`,{url:void 0,metrics:[],firstMetricTimestamp:void 0}),K(this,`_flushToCapture`,(()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture(`$web_vitals`,this.buffer.metrics.reduce(((e,t)=>G(G({},e),{},{[`\$web_vitals_${t.name}_event`]:G({},t),[`\$web_vitals_${t.name}_value`]:t.value})),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})})),K(this,`_addToBuffer`,(e=>{var t=this.instance.sessionManager?.checkAndGetSessionAndWindowId(!0);if(U(t))Yp.error(`Could not read session ID. Dropping metrics!`);else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this._currentURL();U(n)||(Bs(e?.name)||Bs(e?.value)?Yp.error(`Invalid metric received`,e):this._maxAllowedValue&&e.value>=this._maxAllowedValue?Yp.error(`Ignoring metric with value >= `+this._maxAllowedValue,e):(this.buffer.url!==n&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),U(this.buffer.url)&&(this.buffer.url=n),this.buffer.firstMetricTimestamp=U(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(G(G({},e),{},{$current_url:n,$session_id:t.sessionId,$window_id:t.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}})),K(this,`_startCapturing`,(()=>{var e,t,n,r,i=V.__PosthogExtensions__;U(i)||U(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf(`LCP`)>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf(`CLS`)>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf(`FCP`)>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf(`INP`)>-1&&r(this._addToBuffer.bind(this)),this._initialized=!0):Yp.error(`web vitals callbacks not loaded - not starting`)})),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)==null||!t.props[rc]),this.startIfEnabled()}get allowedMetrics(){var e=Fs(this.instance.config.capture_performance)?this.instance.config.capture_performance?.web_vitals_allowed_metrics:void 0;return U(e)?this.instance.persistence?.props[ac]||[`CLS`,`FCP`,`INP`,`LCP`]:e}get flushToCaptureTimeoutMs(){return(Fs(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=Fs(this.instance.config.capture_performance)&&Vs(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:Xp;return 0<e&&e<=6e4?Xp:e}get isEnabled(){var e=Fs(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Hs(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(Yp.info(`enabled, starting...`),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=Fs(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Fs(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[rc]:t}),this.instance.persistence.register({[ac]:n})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,n,r;(t=V.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks&&e(),(n=V.__PosthogExtensions__)==null||(r=n.loadExternalDependency)==null||r.call(n,this.instance,`web-vitals`,(t=>{t?Yp.error(`failed to load script`,t):e()}))}_currentURL(){var e=z?z.location.href:void 0;return e||Yp.error(`Could not determine current URL`),e}},Qp={icontains:(e,t)=>!!z&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!z&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!z&&Os(t.href,e),not_regex:(e,t)=>!!z&&!Os(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e},$p=class e{constructor(t){var n=this;K(this,`getWebExperimentsAndEvaluateDisplayLogic`,(function(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];n.getWebExperiments((t=>{e.logInfo(`retrieved web experiments from the server`),n._flagToExperiments=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;n._flagToExperiments&&(e.logInfo(`setting flag key `,t.feature_flag_key,` to web experiment `,t),(r=n._flagToExperiments)==null||r.set(t.feature_flag_key,t));var i=n.instance.getFeatureFlag(t.feature_flag_key);Ls(i)&&t.variants[i]&&n.applyTransforms(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var a in t.variants){var o=t.variants[a];e.matchesTestVariant(o)&&n.applyTransforms(t.name,a,o.transforms)}}))}),t)})),this.instance=t,this.instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}onFeatureFlags(t){if(this._is_bot())e.logInfo(`Refusing to render web experiment since the viewer is a likely bot`);else if(!this.instance.config.disable_web_experiments){if(Bs(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.logInfo(`applying feature flags`,t),t.forEach((e=>{var t;if(this._flagToExperiments&&(t=this._flagToExperiments)!=null&&t.has(e)){var n=this.instance.getFeatureFlag(e),r=this._flagToExperiments?.get(e);n&&r!=null&&r.variants[n]&&this.applyTransforms(r.name,n,r.variants[n].transforms)}}))}}previewWebExperiment(){var t=e.getWindowLocation();if(t!=null&&t.search){var n=dl(t?.search,`__experiment_id`),r=dl(t?.search,`__experiment_variant`);n&&r&&(e.logInfo(`previewing web experiments ${n} && ${r}`),this.getWebExperiments((e=>{this.showPreviewWebExperiment(parseInt(n),r,e)}),!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this.instance.config.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.instance.config.token}`),method:`GET`,callback:t=>t.statusCode!==200||!t.json?e([]):e(t.json.experiments||[])})}showPreviewWebExperiment(t,n,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(e.logInfo(`Previewing web experiment [${i[0].name}] with variant [${n}]`),this.applyTransforms(i[0].name,n,i[0].variants[n].transforms))}static matchesTestVariant(t){return!Bs(t.conditions)&&e.matchUrlConditions(t)&&e.matchUTMConditions(t)}static matchUrlConditions(t){if(Bs(t.conditions)||Bs(t.conditions?.url))return!0;var n,r=e.getWindowLocation();return!!r&&((n=t.conditions)==null||!n.url||Qp[t.conditions?.urlMatchType??`icontains`](t.conditions.url,r))}static getWindowLocation(){return z?.location}static matchUTMConditions(e){if(Bs(e.conditions)||Bs(e.conditions?.utm))return!0;var t=pu.campaignParams();if(t.utm_source){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v=(n=e.conditions)==null||(r=n.utm)==null||!r.utm_campaign||((i=e.conditions)==null||(a=i.utm)==null?void 0:a.utm_campaign)==t.utm_campaign,y=(o=e.conditions)==null||(s=o.utm)==null||!s.utm_source||((c=e.conditions)==null||(l=c.utm)==null?void 0:l.utm_source)==t.utm_source,b=(u=e.conditions)==null||(d=u.utm)==null||!d.utm_medium||((f=e.conditions)==null||(p=f.utm)==null?void 0:p.utm_medium)==t.utm_medium,x=(m=e.conditions)==null||(h=m.utm)==null||!h.utm_term||((g=e.conditions)==null||(_=g.utm)==null?void 0:_.utm_term)==t.utm_term;return v&&b&&x&&y}return!1}static logInfo(e){var t=[...arguments].slice(1);W.info(`[WebExperiments] ${e}`,t)}applyTransforms(t,n,r){this._is_bot()?e.logInfo(`Refusing to render web experiment since the viewer is a likely bot`):n===`control`?e.logInfo(`Control variants leave the page unmodified.`):r.forEach((r=>{r.selector&&(e.logInfo(`applying transform of variant ${n} for experiment ${t} `,r),(document?.querySelectorAll(r.selector))?.forEach((e=>{var t=e;r.attributes&&r.attributes.forEach((e=>{switch(e.name){case`text`:t.innerText=e.value;break;case`html`:t.innerHTML=e.value;break;case`cssClass`:t.className=e.value;break;default:t.setAttribute(e.name,e.value)}})),r.text&&(t.innerText=r.text),r.html&&(t.parentElement?t.parentElement.innerHTML=r.html:t.innerHTML=r.html),r.css&&t.setAttribute(`style`,r.css)})))}))}_is_bot(){return rs&&this.instance?Dp(rs,this.instance.config.custom_blocked_useragents):void 0}},em=class{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture(`$exception`,e,{_noTruncate:!0,_batchKey:`exceptionEvent`})}},tm=[`$set_once`,`$set`],nm=Ks(`[SiteApps]`),rm=class{constructor(e){this.instance=e,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(e,t){if(t){var n=this.globalsForEvent(t);this.bufferedInvocations.push(n),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var e,t;return(e=V._POSTHOG_REMOTE_CONFIG)==null||(t=e[this.instance.config.token])==null?void 0:t.siteApps}init(){if(this.isEnabled){var e=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{e(),this.bufferedInvocations=[],this.stopBuffering=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,a]of Object.entries(r))t[i]={id:n[i],type:i,properties:a};var{$set_once:o,$set:s}=e;return{event:G(G({},Xs(e,tm)),{},{properties:G(G(G({},e.properties),s?{$set:G(G({},e.properties?.$set??{}),s)}:{}),o?{$set_once:G(G({},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}}setupSiteApp(e){var t={id:e.id,loaded:!1,errored:!1};this.apps[e.id]=t;var n=n=>{var r;for(var i of(this.apps[e.id].errored=!n,this.apps[e.id].loaded=!0,nm.info(`Site app with id ${e.id} ${n?`loaded`:`errored`}`),n&&this.bufferedInvocations.length&&(nm.info(`Processing ${this.bufferedInvocations.length} events for site app with id ${e.id}`),this.bufferedInvocations.forEach((e=>t.processEvent?.call(t,e)))),Object.values(this.apps)))if(!i.loaded)return;(r=this.stopBuffering)==null||r.call(this)};try{var{processEvent:r}=e.init({posthog:this.instance,callback:e=>{n(e)}});r&&(t.processEvent=r)}catch(t){nm.error(`Error while initializing PostHog app with config id ${e.id}`,t),n(!1)}}onCapturedEvent(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{var r;(r=n.processEvent)==null||r.call(n,t)}catch(t){nm.error(`Error while processing event ${e.event} for site app ${n.id}`,t)}}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length){if(!this.isEnabled)return void nm.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`);for(var a of this.siteAppLoaders)this.setupSiteApp(a);this.instance.on(`eventCaptured`,(e=>this.onCapturedEvent(e)))}else if((n=this.stopBuffering)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var o=function(e,t){var n,r;V[`__\$\$ph_site_app_${e}`]=i.instance,(n=V.__PosthogExtensions__)==null||(r=n.loadSiteApp)==null||r.call(n,i.instance,t,(t=>{if(t)return nm.error(`Error while initializing PostHog app with config id ${e}`,t)}))};for(var{id:s,url:c}of e.siteApps)o(s,c)}else nm.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`)}};function im(e,t,n){return pf({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var am={},om=()=>{},sm=`posthog`,cm=!uf&&cs?.indexOf(`MSIE`)===-1&&cs?.indexOf(`Mozilla`)===-1,lm=()=>{var e;return{api_host:`https://us.i.posthog.com`,ui_host:null,token:``,autocapture:!0,rageclick:!0,cross_subdomain_cookie:Cs(B?.location),persistence:`localStorage+cookie`,persistence_name:``,loaded:om,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:`if_capture_pageview`,debug:is&&Ls(is?.search)&&is.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(z==null||(e=z.location)==null?void 0:e.protocol)===`https:`,ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:`localStorage`,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,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:e=>{var t=`Bad HTTP status: `+e.statusCode+` `+e.text;W.error(t)},get_device_id:e=>e,capture_performance:void 0,name:`posthog`,bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:`identified_only`,before_send:void 0,request_queue_config:{flush_interval_ms:sf},_onCapture:om}},um=e=>{var t={};U(e.process_person)||(t.person_profiles=e.process_person),U(e.xhr_headers)||(t.request_headers=e.xhr_headers),U(e.cookie_name)||(t.persistence_name=e.cookie_name),U(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),U(e.store_google)||(t.save_campaign_params=e.store_google),U(e.verbose)||(t.debug=e.verbose);var n=hs({},t,e);return Ns(e.property_blacklist)&&(U(e.property_denylist)?n.property_denylist=e.property_blacklist:Ns(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:W.error(`Invalid value for property_denylist config: `+e.property_denylist)),n},dm=class{constructor(){K(this,`__forceAllowLocalhost`,!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){W.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},fm=class e{get decideEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}constructor(){K(this,`webPerformance`,new dm),K(this,`version`,ls.LIB_VERSION),K(this,`_internalEventEmitter`,new pp),this.config=lm(),this.SentryIntegration=Tf,this.sentryIntegration=e=>function(e,t){var n=wf(e,t);return{name:Cf,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint=`/e/`,this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedIdentify=null,this.featureFlags=new Bc(this),this.toolbar=new of(this),this.scrollManager=new Ip(this),this.pageViewManager=new Of(this),this.surveys=new bp(this),this.experiments=new $p(this),this.exceptions=new em(this),this.rateLimiter=new Sp(this),this.requestRouter=new Sf(this),this.consent=new Kp(this),this.people={set:(e,t,n)=>{var r=Ls(e)?{[e]:t}:e;this.setPersonProperties(r),n?.({})},set_once:(e,t,n)=>{var r=Ls(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on(`eventCaptured`,(e=>W.info(`send "${e?.event}"`,e)))}init(t,n,r){if(r&&r!==sm){var i=am[r]??new e;return i._init(t,n,r),am[r]=i,am[sm][r]=i,i}return this._init(t,n,r)}_init(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(U(e)||Rs(e))return W.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 W.warn(`You have already initialized PostHog! Re-initializing is a no-op`),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],n.person_profiles&&(this._initialPersonProfilesConfig=n.person_profiles),this.set_config(hs({},lm(),um(n),{name:r,token:e})),this.config.on_xhr_error&&W.error(`on_xhr_error is deprecated. Use on_request_error instead`),this.compression=n.disable_compression?void 0:Qo.GZipJS,this.persistence=new hu(this.config),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new hu(G(G({},this.config),{},{persistence:`sessionStorage`}));var i=G({},this.persistence.props),a=G({},this.sessionPersistence.props);if(this._requestQueue=new cf((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new _f(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new bf(this),this.sessionPropsManager=new wp(this,this.sessionManager,this.persistence)),new Wp(this).startIfEnabledOrStop(),this.siteApps=new rm(this),(t=this.siteApps)==null||t.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Qd(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Hp(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Fp(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Zp(this),this.exceptionObserver=new Jp(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Mp(this,jp),this.deadClicksAutocapture.startIfEnabled(),ls.DEBUG=ls.DEBUG||this.config.debug,ls.DEBUG&&W.info(`Starting in debug mode`,{this:this,config:n,thisC:G({},this.config),p:i,s:a}),this._sync_opt_out_with_persistence(),n.bootstrap?.distinctID!==void 0){var o,s,c=this.config.get_device_id(qc()),l=(o=n.bootstrap)!=null&&o.isIdentifiedID?c:n.bootstrap.distinctID;this.persistence.set_property(wc,(s=n.bootstrap)!=null&&s.isIdentifiedID?`identified`:`anonymous`),this.register({distinct_id:n.bootstrap.distinctID,$device_id:l})}if(this._hasBootstrappedFeatureFlags()){var u=Object.keys(n.bootstrap?.featureFlags||{}).filter((e=>{var t,r;return!((t=n.bootstrap)==null||(r=t.featureFlags)==null||!r[e])})).reduce(((e,t)=>{var r,i;return e[t]=((r=n.bootstrap)==null||(i=r.featureFlags)==null?void 0:i[t])||!1,e}),{}),d=Object.keys(n.bootstrap?.featureFlagPayloads||{}).filter((e=>u[e])).reduce(((e,t)=>{var r,i,a,o;return(r=n.bootstrap)!=null&&(i=r.featureFlagPayloads)!=null&&i[t]&&(e[t]=(a=n.bootstrap)==null||(o=a.featureFlagPayloads)==null?void 0:o[t]),e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:u,featureFlagPayloads:d})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Mc,$device_id:null},``);else if(!this.get_distinct_id()){var f=this.config.get_device_id(qc());this.register_once({distinct_id:f,$device_id:f},``),this.persistence.set_property(wc,`anonymous`)}return Ts(z,`onpagehide`in self?`pagehide`:`unload`,this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?Df(this,(()=>this._loaded())):this._loaded(),Ps(this.config._onCapture)&&this.config._onCapture!==om&&(W.warn("onCapture is deprecated. Please use `before_send` instead"),this.on(`eventCaptured`,(e=>this.config._onCapture(e.event,e)))),this}_onRemoteConfig(e){var t,n,r,i,a,o,s,c;if(!B||!B.body)return W.info(`document not ready yet, trying again in 500 milliseconds...`),void setTimeout((()=>{this._onRemoteConfig(e)}),500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=H(e.supportedCompression,Qo.GZipJS)?Qo.GZipJS:H(e.supportedCompression,Qo.Base64)?Qo.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:`identified_only`}),(n=this.siteApps)==null||n.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(i=this.autocapture)==null||i.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(o=this.webVitalsAutocapture)==null||o.onRemoteConfig(e),(s=this.exceptionObserver)==null||s.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}_loaded(){try{this.config.loaded(this)}catch(e){W.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this._captureInitialPageview()}),1),new ef(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)==null||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||ps(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(`$pageleave`),(e=this._requestQueue)==null||e.unload(),(t=this._retryQueue)==null||t.unload()):this._shouldCapturePageleave()&&this.capture(`$pageleave`,null,{transport:`sendBeacon`})}_send_request(e){this.__loaded&&(cm?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=ff(e.url,{ip:+!!this.config.ip}),e.headers=G({},this.config.request_headers),e.compression=e.compression===`best-available`?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t=G({},e);t.timeout=t.timeout||6e4,t.url=ff(t.url,{_:new Date().getTime().toString(),ver:ls.LIB_VERSION,compression:t.compression});var n=t.transport??`fetch`,r=ws(hf,(e=>e.transport===n))?.method??hf[0].method;if(!r)throw Error(`No available transport method`);r(t)})(G(G({},e),{},{callback:t=>{var n,r,i;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&((r=(i=this.config).on_request_error)==null||r.call(i,t)),(n=e.callback)==null||n.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,n=[],r=[],i=[];ps(e,(e=>{e&&(t=e[0],Ns(t)?i.push(e):Ps(e)?e.call(this):Ns(e)&&t===`alias`?n.push(e):Ns(e)&&t.indexOf(`capture`)!==-1&&Ps(this[t])?i.push(e):r.push(e))}));var a=function(e,t){ps(e,(function(e){if(Ns(e[0])){var n=t;ms(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};a(n,this),a(r,this),a(i,this)}_hasBootstrappedFeatureFlags(){return this.config.bootstrap?.featureFlags&&Object.keys(this.config.bootstrap?.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,n){if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!U(e)&&Ls(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var r=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(r==null||!r.isRateLimited){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 i=new Date,a=n?.timestamp||i,o=qc(),s={uuid:o,event:e,properties:this._calculate_event_properties(e,t||{},a,o)};r&&(s.properties.$lib_rate_limit_remaining_tokens=r.remainingTokens),n!=null&&n.$set&&(s.$set=n?.$set);var c=this._calculate_set_once_properties(n?.$set_once);c&&(s.$set_once=c),(s=xs(s,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,U(n?.timestamp)||(s.properties.$event_time_override_provided=!0,s.properties.$event_time_override_system_time=i);var l=G(G({},s.properties.$set),s.$set);if(Is(l)||this.setPersonPropertiesForFlags(l),!Bs(this.config.before_send)){var u=this._runBeforeSend(s);if(!u)return;s=u}this._internalEventEmitter.emit(`eventCaptured`,s);var d={method:`POST`,url:n?._url??this.requestRouter.endpointFor(`api`,this.analyticsDefaultEndpoint),data:s,compression:`best-available`,batchKey:n?._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this._send_retriable_request(d):this._requestQueue.enqueue(d),s}W.critical(`This capture call is ignored due to client rate limiting.`)}}else W.error(`No event name provided to posthog.capture`)}else W.uninitializedWarning(`posthog.capture`)}_addCaptureHook(e){return this.on(`eventCaptured`,(t=>e(t.event,t)))}_calculate_event_properties(e,t,n,r){if(n||=new Date,!this.persistence||!this.sessionPersistence)return t;var i=this.persistence.remove_event_timer(e),a=G({},t);if(a.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(a.$cookieless_mode=!0),e===`$snapshot`){var o=G(G({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=o.distinct_id,(!Ls(a.distinct_id)&&!Vs(a.distinct_id)||Rs(a.distinct_id))&&W.error(`Invalid distinct_id for replay event. This indicates a bug in your implementation`),a}var s,c=pu.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var{sessionId:l,windowId:u}=this.sessionManager.checkAndGetSessionAndWindowId();a.$session_id=l,a.$window_id=u}if(this.sessionRecording&&(a.$recording_status=this.sessionRecording.status),this.requestRouter.region===vf.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),s=e===`$pageview`?this.pageViewManager.doPageView(n,r):e===`$pageleave`?this.pageViewManager.doPageLeave(n):this.pageViewManager.doEvent(),a=hs(a,s),e===`$pageview`&&B&&(a.title=B.title),!U(i)){var d=n.getTime()-i;a.$duration=parseFloat((d/1e3).toFixed(3))}cs&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?`bot`:`browser`),(a=hs({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Ns(this.config.property_denylist)?ms(this.config.property_denylist,(function(e){delete a[e]})):W.error(`Invalid value for property_denylist config: `+this.config.property_denylist+` or property_blacklist config: `+this.config.property_blacklist);var f=this.config.sanitize_properties;f&&(W.error(`sanitize_properties is deprecated. Use before_send instead`),a=f(a,e));var p=this._hasPersonProcessing();return a.$process_person_profile=p,p&&this._requirePersonProcessing(`_calculate_event_properties`),a}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=hs({},this.persistence.get_initial_props(),e||{}),n=this.config.sanitize_properties;return n&&(W.error(`sanitize_properties is deprecated. Use before_send instead`),t=n(t,`$set_once`)),Is(t)?void 0:t}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)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){return this.sessionManager?.onSessionId(e)??(()=>{})}getSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,n){return this.surveys.getNextSurveyStep(e,t,n)}identify(e,t,n){if(!this.__loaded||!this.persistence)return W.uninitializedWarning(`posthog.identify`);if(Vs(e)&&(e=e.toString(),W.warn(`The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.`)),e){if([`distinct_id`,`distinctid`].includes(e.toLowerCase()))W.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.`);else if(this._requirePersonProcessing(`posthog.identify`)){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property(`$device_id`)){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},``)}e!==r&&e!==this.get_property(Qs)&&(this.unregister(Qs),this.register({distinct_id:e}));var a=(this.persistence.get_property(wc)||`anonymous`)===`anonymous`;e!==r&&a?(this.persistence.set_property(wc,`identified`),this.setPersonPropertiesForFlags(t||{},!1),this.capture(`$identify`,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r),this._cachedIdentify=im(e,t,n)):(t||n)&&(this._cachedIdentify===im(e,t,n)?W.info(`A duplicate posthog.identify call was made with the same properties. It has been ignored.`):(this.setPersonProperties(t,n),this._cachedIdentify=im(e,t,n))),e!==r&&(this.reloadFeatureFlags(),this.unregister(Cc))}}else W.error(`Unique user id has not been set in posthog.identify`)}setPersonProperties(e,t){(e||t)&&this._requirePersonProcessing(`posthog.setPersonProperties`)&&(this.setPersonPropertiesForFlags(e||{}),this.capture(`$set`,{$set:e||{},$set_once:t||{}}))}group(e,t,n){if(e&&t){if(this._requirePersonProcessing(`posthog.group`)){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:G(G({},r),{},{[e]:t})}),n&&(this.capture(`$groupidentify`,{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),r[e]===t||n||this.reloadFeatureFlags()}}else W.error(`posthog.group requires a group type and group key`)}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing(`posthog.setGroupPropertiesForFlags`)&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,i;if(W.info(`reset`),!this.__loaded)return W.uninitializedWarning(`posthog.reset`);var a=this.get_property(`$device_id`);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),this.surveys.reset(),(r=this.persistence)==null||r.set_property(wc,`anonymous`),(i=this.sessionManager)==null||i.resetSessionId(),this._cachedIdentify=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Mc,$device_id:null},``);else{var o=this.config.get_device_id(qc());this.register_once({distinct_id:o,$device_id:e?o:a},``)}this.register({$last_posthog_reset:new Date().toISOString()},1)}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{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor(`ui`,`/project/${this.config.token}/replay/${t}`);if(e!=null&&e.withTimestamp&&n){var i=e.timestampLookBack??10;if(!n)return r;var a=Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0);r+=`?t=${a}`}return r}alias(e,t){return e===this.get_property(Zs)?(W.critical(`Attempting to create alias for existing People user - aborting.`),-2):this._requirePersonProcessing(`posthog.alias`)?(U(t)&&(t=this.get_distinct_id()),e===t?(W.warn(`alias matches current distinct_id - skipping api call.`),this.identify(e),-1):(this._register_single(Qs,e),this.capture(`$create_alias`,{alias:e,distinct_id:t}))):void 0}set_config(e){var t,n,r,i,a=G({},this.config);Fs(e)&&(hs(this.config,um(e)),(t=this.persistence)==null||t.update_config(this.config,a),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new hu(G(G({},this.config),{},{persistence:`sessionStorage`})),tl.is_supported()&&tl.get(`ph_debug`)===`true`&&(this.config.debug=!0),this.config.debug&&(ls.DEBUG=!0,W.info(`set_config`,{config:e,oldConfig:a,newConfig:G({},this.config)})),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),(r=this.autocapture)==null||r.startIfEnabled(),(i=this.heatmaps)==null||i.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){var t=!0===e,n={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(n).some(Boolean)){var r,i,a,o,s;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),n.sampling&&((i=this.sessionRecording)==null||i.overrideSampling()),n.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),n.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger(`url`)),n.event_trigger&&((s=this.sessionRecording)==null||s.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){var n=Error(`PostHog syntheticException`),r=Ps(V.__PosthogExtensions__?.parseErrorAsProperties)?G(G({},V.__PosthogExtensions__.parseErrorAsProperties([e.message,void 0,void 0,void 0,e],{syntheticException:n})),t):G({$exception_level:`error`,$exception_list:[{type:e.name,value:e.message,mechanism:{handled:!0,synthetic:!1}}]},t);this.exceptions.sendExceptionEvent(r)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){return this.persistence?.props[e]}getSessionProperty(e){return this.sessionPersistence?.props[e]}toString(){var e=this.config.name??sm;return e!==sm&&(e=sm+`.`+e),e}_isIdentified(){return this.persistence?.get_property(wc)===`identified`||this.sessionPersistence?.get_property(wc)===`identified`}_hasPersonProcessing(){var e,t,n,r;return!(this.config.person_profiles===`never`||this.config.person_profiles===`identified_only`&&!this._isIdentified()&&Is(this.getGroups())&&((e=this.persistence)==null||(t=e.props)==null||!t[Qs])&&((n=this.persistence)==null||(r=n.props)==null||!r[Ac]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||this.config.capture_pageleave===`if_capture_pageview`&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing(`posthog.createPersonProfile`)&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return this.config.person_profiles===`never`?(W.error(e+` was called, but process_person is set to "never". This call will be ignored.`),!1):(this._register_single(Ac,!0),!0)}_sync_opt_out_with_persistence(){var e,t,n=this.consent.isOptedOut(),r=this.config.opt_out_persistence_by_default,i=this.config.disable_persistence||n&&!!r;this.persistence?.disabled!==i&&((e=this.persistence)==null||e.set_disabled(i)),this.sessionPersistence?.disabled!==i&&((t=this.sessionPersistence)==null||t.set_disabled(i))}opt_in_capturing(e){(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),U(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture(e?.captureEventName??`$opt_in`,e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return rs?Dp(rs,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){B&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture(`$pageview`,{title:B.title},{send_instantly:!0}))}debug(e){!1===e?(z?.console.log(`You've disabled debug mode.`),localStorage&&localStorage.removeItem(`ph_debug`),this.set_config({debug:!1})):(z?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem(`ph_debug`,`true`),this.set_config({debug:!0}))}_runBeforeSend(e){if(Bs(this.config.before_send))return e;var t=Ns(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),Bs(n)){var i=`Event '${e.event}' was rejected in beforeSend function`;return Ws(e.event)?W.warn(`${i}. This can cause unexpected behavior.`):W.info(i),null}n.properties&&!Is(n.properties)||W.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}return n}getPageViewId(){return this.pageViewManager._currentPageview?.pageViewId}};(function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=ys(e.prototype[t[n]])})(fm,[`identify`]);var pm,mm=(pm=am[sm]=new fm,function(){function e(){e.done||(e.done=!0,cm=!1,ms(am,(function(e){e._dom_loaded()})))}B!=null&&B.addEventListener?B.readyState===`complete`?e():Ts(B,`DOMContentLoaded`,e,{capture:!1}):z&&W.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),pm),hm=go(`auth`,()=>{let e=Ke(),t=l(),n=h(`INITIALIZING`),r=h(!1),i=h(),a=h([]),o=h(),s=h(!1),c=h(),u=h(),d=yo(),f=yo(),p=Xo();p.on(`auth:getUser`,r=>{e.logger().info(`[Auth] Received auth state change from backend:`,r),r.user?(t.value=r.user,mm.identify(r.user.id,{email:r.user.email,is_anonymous:r.user.is_anonymous||!1}),n.value=`SIGNED_IN`,y()):(t.value=void 0,mm.reset(),n.value=`SIGNED_OUT`)});let m=(e,t)=>{s.value=!0,c.value=e,u.value=t},g=()=>{s.value=!1,c.value=void 0,u.value=void 0},_=t=>{n.value=t,e.logger().debug(`[Auth State] Changed to: ${t}`)},v=()=>{i.value=null},y=async()=>{if(console.log(`[Auth] fetchSubscription: Starting, setting isLoadingSubscriptions to true`),ae.value=!0,o.value=void 0,t.value)if(t.value.email)try{let e=await p.execute(`auth:invoke`,{name:`polar-user-plan`});if(e.type===`error`)throw Error(e.ipcError||`Network error`);let{data:t,error:n}=e.result;if(n)throw Error(n.message||`Network error`);if(!t)throw Error(`Invalid response: no data`);if(!Array.isArray(t.subscriptions))throw Error(`Invalid response: subscriptions is not an array`);console.log(`Subscription result`,e),a.value=t.subscriptions}catch(e){console.error(`Failed to fetch subscription:`,e),o.value=e instanceof Error?e.message:`Unknown error`,a.value=[]}else console.warn(`User email is not available, skipping subscription fetch.`),o.value=`User email not available`,a.value=[];else console.warn(`User is anonymous, skipping subscription fetch.`),o.value=`User is anonymous`,a.value=[];console.log(`[Auth] fetchSubscription: Completed, setting isLoadingSubscriptions to false`),ae.value=!1,f.trigger({subscriptions:a.value})},b=async()=>{if(Ye()){if(n.value!==`INITIALIZING`){e.logger().warn(`[Auth] Init called when not in INITIALIZING state. Ignoring.`);return}e.logger().info(`[Auth] Initializing authentication...`),_(`LOADING`);try{let r=await p.execute(`auth:getUser`);if(r.type===`success`&&r.result.user){let i=r.result.user;e.logger().info(`[Auth] Found existing user during init:`,i.id,`anonymous:`,i.is_anonymous,`email:`,i.email),mm.identify(i.id,{email:i.email,is_anonymous:i.is_anonymous||!1}),t.value=i,n.value=`SIGNED_IN`,await y()}else e.logger().info(`[Auth] No user found during init`),mm.identify(),n.value=`SIGNED_OUT`}catch(t){e.logger().error(`[Auth] Unexpected error during init:`,t),n.value=`ERROR`,i.value=`Failed to initialize authentication.`}}},x=async(n,a)=>{r.value=!0,_(`LOADING`),v();try{let r=await p.execute(`auth:signInWithPassword`,{email:n,password:a});if(r.type===`error`)return e.logger().error(`[Auth] Login error:`,r.ipcError),_(`ERROR`),i.value=r.ipcError||`Invalid login credentials.`,{data:{user:null,session:null},error:{message:r.ipcError}};let{data:o,error:s}=r.result;return s?(e.logger().error(`[Auth] Login error:`,s),_(`ERROR`),i.value=`Invalid login credentials.`,r.result):(e.logger().info(`[Auth] Logged in user:`,o.user.id),t.value=o.user,_(`SIGNED_IN`),await y(),r.result)}finally{r.value=!1}},C=async(t,n)=>{r.value=!0,_(`LOADING`),v();try{let r=await p.execute(`auth:signUp`,{email:t,password:n});if(r.type===`error`)return e.logger().error(`[Auth] Registration error:`,r.ipcError),_(`ERROR`),i.value=r.ipcError||`Failed to register. Please try again.`,{data:{user:null,session:null},error:{message:r.ipcError}};let{data:a,error:o}=r.result;return o?(e.logger().error(`[Auth] Registration error:`,o),_(`ERROR`),i.value=`Failed to register. Please try again.`,r.result):(e.logger().info(`[Auth] Registered new user:`,a.user.id),_(`AWAITING_VALIDATION`),r.result)}finally{r.value=!1}},w=async()=>{r.value=!0,_(`LOADING`),v();try{await p.execute(`auth:signOut`),e.logger().info(`[Auth] Signed out.`),t.value=void 0,mm.reset(),_(`SIGNED_OUT`),a.value=[]}catch(t){e.logger().error(`[Auth] Logout error:`,t),_(`ERROR`),i.value=`Failed to logout.`}finally{r.value=!1}},T=async t=>{r.value=!0,_(`LOADING`),v();try{let n=await p.execute(`auth:resetPasswordForEmail`,{email:t});if(n.type===`error`)return e.logger().error(`[Auth] Reset password error:`,n.ipcError),_(`ERROR`),i.value=`Failed to send reset email.`,{error:{message:n.ipcError}};let{error:r}=n.result;return r?(e.logger().error(`[Auth] Reset password error:`,r),_(`ERROR`),i.value=`Failed to send reset email.`,{error:r}):(e.logger().info(`[Auth] Reset password email sent to:`,t),_(`SIGNED_OUT`),{error:null})}finally{r.value=!1}};b();let E=Me(()=>n.value===`SIGNED_IN`),ee={"cloud-save":`16955d3e-3e0f-4574-9093-87a32edf237c`,"build-history":`b77e9800-8302-4581-8df3-6f1b979acef5`,"multiple-projects":`ad00648e-ba6f-461a-87d0-84cabd53e489`},D=h({}),te=(e,t)=>{D.value[e]=t},ne=e=>a.value.some(t=>t.product.benefits.map(e=>e.id).includes(ee[e])),O=e=>ne(e),k=Me(()=>O(`build-history`)),re=Me(()=>O(`cloud-save`)),ie=Me(()=>O(`multiple-projects`)),ae=h(!1);return{user:t,authState:n,isLoggedIn:E,isAuthenticating:r,hasLoginProvider:Ye(),errorMessage:i,subscriptions:S(a),subscriptionError:S(o),isLoadingSubscriptions:ae,hasBenefit:O,getActualBenefit:ne,devOverrides:S(D),setDevOverride:te,clearError:v,init:b,login:x,register:C,logout:w,resetPassword:T,fetchSubscription:y,displayAuthModal:m,hideAuthModal:g,isAuthModalVisible:s,authModalTitle:c,authModalSubTitle:u,hasBuildHistoryBenefit:k,hasCloudSaveBenefit:re,hasMultipleProjectsBenefit:ie,onAuthChanged:d.on,onSubscriptionChanged:f.on}}),gm=go(`settings`,()=>{let e=Xo(),t=hm(),n=h({theme:`light`,version:`7.0.0`,locale:`en-US`,tours:{dashboard:{step:0,completed:!1},editor:{step:0,completed:!1}},autosave:!0,agents:[],buildHistory:{retentionPolicy:{enabled:!1,maxEntries:50,maxAge:30}}}),r=!!window.electron,i=async()=>{await a()},a=async()=>{if(console.log(`[Settings] load: isElectron`,r),r){if(e.isConnected()){console.log(`[Settings] loading from local agent`);let t=await e.execute(`config:load`,{config:`settings`});t.type===`success`&&(n.value=t.result.result)}else console.log(`[Settings] local agent not connected yet`);return}};return ue(()=>t.user,()=>{a()}),{init:i,updateSettings:async t=>{n.value=t,r&&e.isConnected()&&await e.execute(`config:save`,{config:`settings`,data:t})},settings:S(n),reset:async t=>{r&&e.execute&&(await e.execute(`config:reset`,{config:`settings`,key:t}),await a())},load:a}}),_m=L.extend({name:`baseicon`,css:`
|
|
150
150
|
.p-icon {
|