1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`hq-rental-software-website@9ad5d13`},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:hq-rental-software-website":!0});var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`1fa4b8e0-3e86-4c4b-a1da-4e0987869b22`,e._sentryDebugIdIdentifier=`sentry-dbid-1fa4b8e0-3e86-4c4b-a1da-4e0987869b22`)}catch{}})();var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function ee(){}ee.prototype=v.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var b=y.prototype=new ee;b.constructor=y,g(b,v.prototype),b.isPureReactComponent=!0;var x=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function T(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function E(e,t){return T(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var O=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function re(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function k(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,k(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,x(o)?(i=``,c!=null&&(i=c.replace(O,`$&/`)+`/`),k(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(O,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(x(e))for(var u=0;u<e.length;
vendor: 4,643 bytes, line 1
1u++)a=e[u],s=l+ne(a,u),c+=k(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ne(a,u++),c+=k(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return k(re(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function A(e,t,n){if(e==null)return e;var r=[],i=0;return k(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var j=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ae={map:A,forEach:function(e,t,n){A(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return A(e,function(){t++}),t},toArray:function(e){return A(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ae,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return C.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!w.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return T(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)w.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return T(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=C.T,n={};C.T=n;try{var r=e(),i=C.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(S,j)}catch(e){j(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),C.T=t}},e.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},e.use=function(e){return C.H.use(e)},e.useActionState=function(e,t,n){return C.H.useActionState(e,t,n)},e.useCallback=function(e,t){return C.H.useCallback(e,t)},e.useContext=function(e){return C.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return C.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return C.H.useEffect(e,t)},e.useEffectEvent=function(e){return C.H.useEffectEvent(e)},e.useId=function(){return C.H.useId()},e.useImperativeHandle=function(e,t,n){return C.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return C.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return C.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return C.H.useMemo(e,t)},e.useOptimistic=function(e,t){return C.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return C.H.useReducer(e,t,n)},e.useRef=function(e){return C.H.useRef(e)},e.useState=function(e){return C.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return C.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return C.H.useTransition()}
1,e.version=`19.2.6`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),p=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=f()})),m=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,h={"&":`&`,"&":`&`,"<":`<`,"<":`<`,">":`>`,">":`>`,"'":`'`,"'":`'`,""":`"`,""":`"`," ":` `," ":` `,"©":`©`,"©":`©`,"®":`®`,"®":`®`,"…":`â¦`,"…":`â¦`,"/":`/`,"/":`/`},g=e=>h[e],_={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(m,g),transDefaultProps:void 0},v=(e={})=>{_={..._,...e}},ee=()=>_,y,b=e=>{y=e},x=()=>y,S={type:`3rdParty`,init(e){v(e.options.react),b(e)}},C=typeof window<`u`?window:void 0,w=typeof globalThis<`u`?globalThis:C;typeof self>`u`&&(w.self=w),typeof File>`u`&&(w.File=function(){});var T=w?.navigator,E=w?.document,D=w?.location,te=w?.fetch,O=w!=null&&w.XMLHttpRequest&&`withCredentials`in new w.XMLHttpRequest?w.XMLHttpRequest:void 0,ne=w?.AbortController,re=w?.CompressionStream,k=T?.userAgent,A=C??{},ie=`1.396.4`,j={DEBUG:!1,LIB_VERSION:ie,LIB_NAME:`web`,JS_SDK_VERSION:ie};function ae(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function M(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){ae(a,r,i,o,s,`next`,e)}function s(e){ae(a,r,i,o,s,`throw`,e)}o(void 0)}))}}function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},N.apply(null,arguments)}function oe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var se=e=>{if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}};function ce(e){return typeof e==`string`||e}function le(e){return typeof e==`string`?e:void 0}var ue,de=function(e){return e.AnonymousId=`anonymous_id`,e.DistinctId=`distinct_id`,e.Props=`props`,e.EnablePersonProcessing=`enable_person_processing`,e.PersonMode=`person_mode`,e.FeatureFlagDetails=`feature_flag_details`,e.FeatureFlags=`feature_flags`,e.FeatureFlagPayloads=`feature_flag_payloads`,e.BootstrapFeatureFlagDetails=`bootstrap_feature_flag_details`,e.BootstrapFeatureFlags=`bootstrap_feature_flags`,e.BootstrapFeatureFlagPayloads=`bootstrap_feature_flag_payloads`,e.OverrideFeatureFlags=`override_feature_flags`,e.Queue=`queue`,e.LogsQueue=`logs_queue`,e.OptedOut=`opted_out`,e.SessionId=`session_id`,e.SessionStartTimestamp=`session_start_timestamp`,e.SessionLastTimestamp=`session_timestamp`,e.PersonProperties=`person_properties`,e.GroupProperties=`group_properties`,e.InstalledAppBuild=`installed_app_build`,e.InstalledAppVersion=`installed_app_version`,e.SessionReplay=`session_replay`,e.SessionReplayEventTriggerActivatedSession=`session_replay_event_trigger_activated_session`,e.SurveyLastSeenDate=`survey_last_seen_date`,e.SurveysSeen=`surveys_seen`,e.Surveys=`surveys`,e.RemoteConfig=`remote_config`,e.FlagsEndpointWasHit=`flags_endpoint_was_hit`,e.DeviceId=`device_id`,e}({}),fe=function(e){return e.GZipJS=`gzip-js`,e.Base64=`base64`,e}({}),pe=[`$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`],me=[`token`],he=`NativeGzipValidationError`,ge=e=>e.length>=2&&e[0]===31&&e[1]===139,_e=(e,t)=>
1e===fe.GZipJS||t===fe.GZipJS||t===`gzip`,ve=e=>!(!e||typeof e!=`object`)&&(`name`in e?String(e.name):``)===`NotReadableError`,ye=e=>{var t=Error(`Native gzip produced invalid output: `+e);throw t.name=he,t},be=function(){var e=M((function*(e,t){18>e.size&&ye(`too-short`);var n=new Uint8Array(yield e.slice(0,10).arrayBuffer());ge(n)&&n[2]===8||ye(`invalid-header`);var r=new DataView(yield e.slice(e.size-8).arrayBuffer());r.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(ue)return ue;ue=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;ue[e]=t>>>0}return ue})(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0})(t)&&ye(`invalid-crc`);var i=t.length>>>0;r.getUint32(4,!0)!==i&&ye(`invalid-size`)}));return function(t,n){return e.apply(this,arguments)}}();function xe(){return xe=M((function*(e,t,n){t===void 0&&(t=!0);try{var r=new TextEncoder().encode(e),i=new CompressionStream(`gzip`),a=i.writable.getWriter(),o=a.write(r).then((()=>a.close())).catch(function(){var e=M((function*(e){try{yield a.abort(e)}catch{}throw e}));return function(t){return e.apply(this,arguments)}}()),s=new Response(i.readable).blob(),[c]=yield Promise.all([s,o]);return yield be(c,r),c}catch(e){if(n!=null&&n.rethrow)throw e;return t&&console.error(`Failed to gzip compress data`,e),null}})),xe.apply(this,arguments)}var Se=`amazonbot,amazonproductbot,app.hypefactors.com,applebot,archive.org_bot,awariobot,backlinksextendedbot,baiduspider,bingbot,bingpreview,chrome-lighthouse,dataforseobot,deepscan,duckduckbot,facebookexternal,facebookcatalog,http://yandex.com/bots,hubspot,ia_archiver,leikibot,linkedinbot,meta-externalagent,mj12bot,msnbot,nessus,petalbot,pinterest,prerender,rogerbot,screaming frog,sebot-wa,sitebulb,slackbot,slurp,trendictionbot,turnitin,twitterbot,vercel-screenshot,vercelbot,yahoo! slurp,yandexbot,zoombot,bot.htm,bot.php,(bot;,bot/,crawler,ahrefsbot,ahrefssiteaudit,semrushbot,siteauditbot,splitsignalbot,gptbot,oai-searchbot,chatgpt-user,perplexitybot,better uptime bot,sentryuptimebot,uptimerobot,headlesschrome,cypress,google-hoteladsverifier,adsbot-google,apis-google,duplexweb-google,feedfetcher-google,google favicon,google web preview,google-read-aloud,googlebot,googleother,google-cloudvertexbot,googleweblight,mediapartners-google,storebot-google,google-inspectiontool,bytespider`.split(`,`),Ce=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return Se.concat(t).some((e=>{var t=e.toLowerCase();return n.indexOf(t)!==-1}))};function P(e,t){return e.indexOf(t)!==-1}var we=function(e){return e.trim()},Te=function(e){return e.replace(/^\$/,``)},Ee=Object.prototype,De=Ee.hasOwnProperty,Oe=Ee.toString,F=Array.isArray||function(e){return Oe.call(e)===`[object Array]`},ke=e=>typeof e==`function`,I=e=>e===Object(e)&&!F(e),Ae=e=>{if(I(e)){for(var t in e)if(De.call(e,t))return!1;return!0}return!1},L=e=>e===void 0,R=e=>Oe.call(e)==`[object String]`,je=e=>R(e)&&e.trim().length===0,z=e=>e===null,B=e=>L(e)||z(e),V=e=>Oe.call(e)==`[object Number]`&&e==e,Me=e=>V(e)&&e>0,Ne=e=>Oe.call(e)===`[object Boolean]`,Pe=e=>e instanceof FormData,Fe=e=>P(pe,e),Ie=e=>P(me,e);function Le(e){return typeof e!=`object`||!e}function Re(e,t){return{}.toString.call(e)===`[object `+t+`]`}function ze(e){return typeof Event<`u`&&function(e,t){try{return e instanceof t}catch{return!1}}(e,Event)}var Be=[!0,`true`,1,`1`,`yes`],Ve=e=>P(Be,e),He=[!1,`false`,0,`0`,`no`];function Ue(e,t,n,r,i){return t>n&&(r.warn(`min cannot be greater than max.`),t=n),V(e)?e>n?(r.warn(` cannot be greater than max: `+n+`. Using max value instead.`),n):t>e?(r.warn(` cannot be less than min: `+t+`. Using min value instead.`),t):e:(r.warn(` must be a number. using max or fallback. max: `+n+`, fallback: `+i),Ue(i||n,t,n,r))}var We=class{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=Ue(e.bucketSize,0,100,e.Ae),this.$e=Ue(e.refillRate,0,this.Fe,e.Ae),this.De=Ue(e.refillInterval,0,864e5,e.Ae)}Ne(e,t){var n=Math.floor((t-e.lastAccess)/this.De);n>0&&(e.tokens=Math.min(e.tokens+n*this.$e,this.Fe),e.lastAccess+=n*this.De)}consumeRateLimit(e){var t,n=Date.now(),r=String(e),i=this.Ee[r];return i?this.Ne(i,n):this.Ee[r]=i={tokens:this.Fe,lastAccess:n},i.tokens===0||(i.tokens--,i.tokens===0&&((t=this.Pe)==null||t.call(this,e)),i.tokens===0)}stop(){this.Ee={}}},Ge=`Mobile`,Ke=`iOS`,qe=`Android`,Je=`Tablet`,Ye=qe+` `+Je,Xe=`iPad`,Ze=`Apple`,Qe=Ze+` Watch`,$e=`Safari`,et=`BlackBerry`,tt=`Samsung`,nt=tt+`Browser`,rt=tt+` Internet`,it=`Chrome`,at=it+` OS`,ot=it
1+` `+Ke,st=`Internet Explorer`,ct=st+` `+Ge,lt=`Opera`,ut=lt+` Mini`,dt=`Edge`,ft=`Microsoft `+dt,pt=`Firefox`,mt=pt+` `+Ke,ht=`Nintendo`,gt=`PlayStation`,_t=`Xbox`,vt=qe+` `+Ge,yt=Ge+` `+$e,bt=`Windows`,xt=bt+` Phone`,St=`Nokia`,Ct=`Ouya`,wt=`Generic`,Tt=wt+` `+Ge.toLowerCase(),Et=wt+` `+Je.toLowerCase(),Dt=`Konqueror`,Ot=`Oculus Browser`,kt=`Vivaldi`,At=`Yandex`,jt=`Whale`,Mt=`DuckDuckGo`,Nt=`Pale Moon`,Pt=`Waterfox`,Ft=`Brave`,It=`Google Search App`,H=`(\\d+(\\.\\d+)?)`,Lt=RegExp(`Version/`+H),Rt=new RegExp(_t,`i`),zt=RegExp(gt+` \\w+`,`i`),Bt=RegExp(ht+` \\w+`,`i`),Vt=RegExp(et+`|PlayBook|BB10`,`i`),Ht={"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`},Ut=function(e,t,n,r){return t||=``,function(e){return e!=null&&e.brave?Ft:null}(n)||(r!=null&&r.detectGoogleSearchApp&&P(e,`GSA/`)?It:P(e,` OPR/`)&&P(e,`Mini`)?ut:P(e,` OPR/`)?lt:Vt.test(e)?et:P(e,`IE`+Ge)||P(e,`WPDesktop`)?ct:P(e,`OculusBrowser`)?Ot:P(e,nt)?rt:P(e,dt)||P(e,`Edg/`)?ft:P(e,kt+`/`)?kt:P(e,`YaBrowser/`)?At:P(e,jt+`/`)?jt:P(e,Mt+`/`)||P(e,`Ddg/`)?Mt:P(e,`FBIOS`)?`Facebook `+Ge:P(e,`UCWEB`)||P(e,`UCBrowser`)?`UC Browser`:P(e,`CriOS`)?ot:P(e,`CrMo`)||P(e,it)?it:P(e,qe)&&P(e,$e)?vt:P(e,`FxiOS`)?mt:P(e.toLowerCase(),Dt.toLowerCase())?Dt:P(e,Ft+`/`)?Ft:((e,t)=>t&&P(t,Ze)||function(e){return P(e,$e)&&!P(e,it)&&!P(e,qe)}(e))(e,t)?P(e,Ge)?yt:$e:P(e,`PaleMoon/`)?Nt:P(e,Pt+`/`)?Pt:P(e,pt)?pt:P(e,`MSIE`)||P(e,`Trident/`)?st:P(e,`Gecko`)?pt:``)},Wt={[ct]:[RegExp(`rv:`+H)],[ft]:[RegExp(dt+`?\\/`+H)],[it]:[RegExp(`(`+it+`|CrMo)\\/`+H)],[ot]:[RegExp(`CriOS\\/`+H)],"UC Browser":[RegExp(`(UCBrowser|UCWEB)\\/`+H)],[$e]:[Lt],[yt]:[Lt],[lt]:[RegExp(`(Opera|OPR)\\/`+H)],[pt]:[RegExp(pt+`\\/`+H)],[mt]:[RegExp(`FxiOS\\/`+H)],[Dt]:[RegExp(`Konqueror[:/]?`+H,`i`)],[et]:[RegExp(et+` `+H),Lt],[vt]:[RegExp(`android\\s`+H,`i`)],[rt]:[RegExp(nt+`\\/`+H)],[Ot]:[RegExp(`OculusBrowser\\/`+H)],[kt]:[RegExp(kt+`\\/`+H)],[At]:[RegExp(`YaBrowser\\/`+H)],[jt]:[RegExp(jt+`\\/`+H)],[Ft]:[RegExp(Ft+`\\/`+H)],[Mt]:[RegExp(`(DuckDuckGo|Ddg)\\/`+H)],[Nt]:[RegExp(`PaleMoon\\/`+H)],[Pt]:[RegExp(Pt+`\\/`+H)],[It]:[RegExp(`GSA\\/`+H)],[st]:[RegExp(`(rv:|MSIE )`+H)],Mozilla:[RegExp(`rv:`+H)]},Gt=function(e,t,n,r){var i=Wt[Ut(e,t,n,r)];if(L(i))return null;for(var a=0;i.length>a;a++){var o=e.match(i[a]);if(o)return parseFloat(o[o.length-2])}return null},Kt=[[RegExp(_t+`; `+_t+` (.*?)[);]`,`i`),e=>[_t,e&&e[1]||``]],[new RegExp(ht,`i`),[ht,``]],[new RegExp(gt,`i`),[gt,``]],[Vt,[et,``]],[new RegExp(bt,`i`),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[xt,``];if(new RegExp(Ge).test(t)&&!/IEMobile\b/.test(t))return[bt+` `+Ge,``];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=Ht[n[1]]||``;return/arm/i.test(t)&&(r=`RT`),[bt,r]}return[bt,``]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[Ke,[e[3],e[4],e[5]||`0`].join(`.`)]:[Ke,``]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t=``;return e&&e.length>=3&&(t=L(e[2])?e[3]:e[2]),[`watchOS`,t]}],[RegExp(`(`+qe+` (\\d+)\\.(\\d+)\\.?(\\d+)?|`+qe+`)`,`i`),e=>e&&e[2]?[qe,[e[2],e[3],e[4]||`0`].join(`.`)]:[qe,``]],[/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/,[at,``]],[/Linux|debian/i,[`Linux`,``]]],qt=function(e){return Bt.test(e)?ht:zt.test(e)?gt:Rt.test(e)?_t:new RegExp(Ct,`i`).test(e)?Ct:RegExp(`(`+xt+`|WPDesktop)`,`i`).test(e)?xt:/iPad/.test(e)?Xe:/iPod/.test(e)?`iPod Touch`:/iPhone/.test(e)?`iPhone`:/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Qe:Vt.test(e)?et:/(kobo)\s(ereader|touch)/i.test(e)?`Kobo`:new RegExp(St,`i`).test(e)?St:/(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(Ge).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)?qe:Ye:RegExp(`(pda|`+Ge+`)`,`i`).test(e)?Tt:new RegExp(Je,`i`).test(e)&&!RegExp(Je+` pc`,`i`).test(e)?Et:``},Jt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Yt(e,t){return typeof(n=e)==`string`&&Jt.test(n)?e:t();var n}function Xt(e){return e&&e.split(`#`)[0]}function Zt(e,t){var n=setTimeout(e,t);return n!=null&&n.unref&&n?.unref(),n}var Qt=e=>e instanceof Error,$t={trace:{text:`TRACE`,number:1},debug:{text:`DEBUG`,number:5},info:{text:`INFO`,number:9},warn:{text:`WARN`,number:13},error:{text:`ERROR`,number:17},fatal:{text:`FATAL`,number:21}},en=$t.info;function tn(e){if(Ne(e))return{boolValue:e};if(typeof e==`number`)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e==`string`)return{stringValue:e};if(F(e))return{arrayValue:{values:e.map((e=>tn(e)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function nn(e){var t=[];for(var n in e){var r=e[n];z(r)||L(r)||t.push({key:n,value:tn(r)})}return t}function rn(e,t){var{text:n,number:r}=$t[e.level||`info`]||en,i=String(Date.now())+`000000`,a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a[`window.id`]=t.windowId),B(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),B(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a[`url.full`]=t.currentUrl),t.screenName&&(a[`screen.name`]=t.screenName),t.appState&&(a[`app.state`]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var o=N({},a,e.attributes||{}),s={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:r,severityText:n,body:{stringValue:e.body},attributes:nn(o)};return e.trace_id&&(s.traceId=e.trace_id),e.span_id&&(s.spanId=e.span_id),L(e.trace_flags)||(s.flags=e.trace_flags),s}function an(e,t,n){return N({},e.resourceAttributes,{"service.name":e.serviceName||`unknown_service`},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}function on(e,t,n,r){return{resourceLogs:[{resource:{attributes:nn(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var sn=class{constructor(e,t,n,r,i,a,o){a===void 0&&(a=()=>Promise.resolve()),this._instance=e,this.Se=t,this.Ae=n,this.qe=r,this.je=i,this.Be=a,this.He=o,this.Ue=null,this.ze=0,this.Ve=0,this.We=0,this.Ge=0,this.Ze=!1,this.Qe=t.maxBufferSize,this.Je=Math.max(t.maxQueueSize??t.maxBufferSize,t.maxBufferSize),this.Ye=t.flushIntervalMs,this.Ke=t.maxBatchRecordsPerPost,this.Xe=t.rateCapWindowMs,this.et=t.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.We=0,this.Ge=0,this.Ze=!1,this.ze=0,this.Ve=0,this.Ke=this.Se.maxBatchRecordsPerPost}onReconnect(){this.Ve=0,this.rt()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&e!=null&&e.body){var t=this.it(e);
1if(t!==null)if(t.body){if(this.nt()){var n={record:rn(t,this.qe())};this.je((()=>this.st(n)))}}else this.Ae.info(`Log was rejected in beforeSend function`)}}it(e){var t=this.Se.beforeSend;if(!t)return e;var n=F(t)?t:[t],r=e;for(var i of n)try{var a=i(r);if(!a)return this.Ae.info(`Log was rejected in beforeSend function`),null;r=a}catch(e){return this.Ae.error(`Error in beforeSend function for log:`,e),null}return r}nt(){if(this.et===void 0)return!0;var e=Date.now(),t=e-this.We;return this.Xe>t&&t>=0||(this.We=e,this.Ge=0,this.Ze=!1),this.et>this.Ge?(this.Ge++,!0):(this.Ze||=(this.Ae.warn(`captureLog dropping logs: exceeded `+this.et+` logs per `+this.Xe+`ms`),!0),!1)}flush(){var e=this;return M((function*(){if(!e._instance.isDisabled)return e.Ue||=e.ot().finally((()=>{e.Ue=null})),e.Ue}))()}ot(){var e=this;return M((function*(){e.tt();var t=e._instance.getPersistedProperty(de.LogsQueue)??[];if(t.length!==0)for(var n=t.length,r=0;t.length>0&&n>r;){e.ze=0;var i=Math.min(t.length,e.Ke),a=t.slice(0,i),o=on(a.map((e=>e.record)),e.ut(),e.He??e._instance.getLibraryId(),e._instance.getLibraryVersion()),s=yield e._instance.ht(o);if(s.kind===`too-large`&&a.length>1)e.Ke=Math.max(1,Math.floor(a.length/2)),e.Ae.warn(`Received 413 when sending logs batch of size `+a.length+`, reducing batch size to `+e.Ke);else if(s.kind===`retry-later`||(s.kind===`too-large`?e.Ae.warn(`Dropping a single log record after 413 with batch size 1 â the record is larger than the server cap and cannot be split further.`):s.kind===`ok`&&e.Se.maxBatchRecordsPerPost>e.Ke&&(e.Ke=Math.min(e.Se.maxBatchRecordsPerPost,e.Ke+1)),yield e.dt(a.length),t=e._instance.getPersistedProperty(de.LogsQueue)??[],r+=a.length,s.kind===`fatal`))throw s.error}}))()}dt(e){var t=this;return M((function*(){var n=Math.max(0,e-t.ze),r=t._instance.getPersistedProperty(de.LogsQueue)??[];t._instance.setPersistedProperty(de.LogsQueue,r.slice(n)),yield t.Be()}))()}ut(){return an(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(e){if(!this._instance.optedOut){var t=this._instance.getPersistedProperty(de.LogsQueue)??[];this.Je>t.length||(t.shift(),this.ze++,this.Ae.info(`Logs queue is full, dropping oldest record.`)),t.push(e),this._instance.setPersistedProperty(de.LogsQueue,t),this.Qe>t.length?this.ct():this.rt()}}ct(e){e===void 0&&(e=this.Ye),this.vt||=Zt((()=>{this.vt=void 0,this.rt()}),e)}ft(){var e=Math.min(Math.max(0,this.Ve-1),6);return this.Ye*2**e}yt(){var e=this._instance.getPersistedProperty(de.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return M((function*(){t.tt();var n=t.flush().catch((()=>{}));e===void 0?yield n:yield Promise.race([n,new Promise((t=>Zt(t,e)))])}))()}flushWithTimeout(e){var t=this;return M((function*(){var n=!1,r=t.flush(),i=new Promise((t=>Zt((()=>{n=!0,t()}),e)));try{yield Promise.race([r,i])}finally{n&&r.catch((()=>{}))}}))()}rt(){this.flush().then((()=>{this.Ve=0}),(e=>{this.Ve++,this.Ae.error(`PostHog logs flush failed:`,e)})).finally((()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())}))}tt(){this.vt&&=(clearTimeout(this.vt),void 0)}},cn,ln,un;function dn(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return un&&n.length===ln||(ln=n.length,un=n.reduce(((n,r)=>{cn||={};var i=cn[r];if(i)n[i[0]]=i[1];else for(var a=e(r),o=a.length-1;o>=0;o--){var s=a[o]?.filename,c=t[r];if(s&&c){n[s]=c,cn[r]=[s,c];break}}return n}),{})),un}}var fn=class{constructor(e,t,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}buildFromUnknown(e,t){t===void 0&&(t={});var n=t&&t.mechanism||{handled:!0,type:`generic`},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),a=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(a,n),$exception_level:`error`}}modifyFrames(e){var t=this;return M((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&F(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e}))()}coerceFallback(e){return{type:`Error`,value:`Unknown error`,stack:e.syntheticException?.stack,synthetic:!0}}parseStacktrace(e,t){var n,r;return e.cause!=null&&(n=this.parseStacktrace(e.cause,t)),e.stack!=``&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),N({},e,{cause:n,stack:r})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return M((function*(){var n=e;for(var r of t.modifiers)n=yield r(n);return n}))()}convertToExceptionList(e,t){var n,r,i={type:e.type,value:e.value,mechanism:{type:t.type??`generic`,handled:(n=t.handled)==null||n,synthetic:(r=e.synthetic)!=null&&r}};e.stack&&(i.stacktrace={type:`raw`,frames:e.stack});var a=[i];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,N({},t,{handled:!0}))),a}buildParsingContext(e){return{chunkIdMap:dn(this.stackParser),skipFirstLines:e.skipFirstLines??1}}buildCoercingContext(e,t,n){n===void 0&&(n=0);var r=(n,r)=>{if(4>=r){var i=this.buildCoercingContext(e,t,r);return this.applyCoercers(n,i)}};return N({},t,{syntheticException:n==0?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,n),next:e=>r(e,n+1)})}},pn=`?`;function mn(e,t,n,r,i){var a={platform:e,filename:t,function:n===`<anonymous>`?pn:n,in_app:!0};return L(r)||(a.lineno=r),L(i)||(a.colno=i),a}var hn=(e,t)=>{var n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?pn:e.split(`@`)[0],n?`safari-extension:`+t:`safari-web-extension:`+t]:[e,t]},gn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,_n=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,vn=/\((\S*)(?::(\d+))(?::(\d+))\)/,yn=(e,t)=>{var n=gn.exec(e);if(n){var[,r,i,a]=n;return mn(t,r,pn,+i,+a)}var o=_n.exec(e);if(o){if(o[2]&&o[2].indexOf(`eval`)===0){var s=vn.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[c,l]=hn(o[1]||pn,o[2]);return mn(t,l,c,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},bn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,xn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Sn=(e,t)=>{var n=bn.exec(e);if(n){if(n[3]&&n[3].indexOf(` > eval`)>-1){var r=xn.exec(n[3]);r&&(n[1]=n[1]||`eval`,n[3]=r[1],n[4]=r[2],n[5]=``)}var i=n[3],a=n[1]||pn;return[a,i]=hn(a,i),mn(t,i,a,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Cn=/\(error: (.*)\)/,wn=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var n=R(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?`DOMError`:`DOMException`}getValue(e){var t=e.name||(this.isDOMError(e)?`DOMError`:`DOMException`);return e.message?t+`: `+e.message:t}isDOMException(e){return Re(e,`DOMException`)}isDOMError(e){return Re(e,`DOMError`)}},Tn=class{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var n=e.message;return String(n.error&&typeof n.error.message==`string`?n.error.message:n)}getStack(e){return e.stacktrace||e.stack||void 0}},En=class{constructor(){}match(e){return Re(e,`ErrorEvent`)&&e.error!=null}coerce(e,t){return t.apply(e.error)||{type:`ErrorEvent`,value:e.message,stack:t.syntheticException?.stack,synthetic:!0}}},Dn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,On=class{match(e){return typeof e==`string`}coerce(e,t){var[n,r]=this.getInfos(e);return{type:n??`Error`,value:r??e,stack:t.syntheticException?.stack,synthetic:!0}}getInfos(e){var t=`Error`,n=e,r=e.match(Dn);return r&&(t=r[1],n=r[2]),[t,n]}},kn=[`fatal`,`error`,`warning`,`log`,`info`,`debug`];function An(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return`[object has no keys]`;for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(`, `);if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+`...`:i}return``}var jn=class{match(e){return typeof e==`object`&&!!e}coerce(e,t){var n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:t.syntheticException?.stack,level:this.isSeverityLevel(e.level)?e.level:`error`,synthetic:!0}}getType(e){return ze(e)?e.constructor.name:`Error`}getValue(e){if(`name`in e&&typeof e.name==`string`){var t=`'`+e.name+`' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message: '`+e.message+`'`),t}if(`message`in e&&typeof e.message==`string`)return e.message;var n=this.getObjectClassName(e);return(n&&n!==`Object`?`'`+n+`'`:`Object`)+` captured as exception with keys: `+An(e)}isSeverityLevel(e){return R(e)&&!je(e)&&kn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(Qt(n))return n}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},Mn=class{match(e){return ze(e)}coerce(e,t){var n=e.constructor.name;return{type:n,value:n+` captured as exception with keys: `+An(e),stack:t.syntheticException?.stack,synthetic:!0}}},Nn=class{match(e){return Le(e)}coerce(e,t){return{type:`Error`,value:`Primitive value captured as exception: `+String(e),stack:t.syntheticException?.stack,synthetic:!0}}},Pn=class{match(e){return Re(e,`PromiseRejectionEvent`)||this.isCu
1stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ze(e))return!1;try{var t=e.detail;return typeof t==`object`&&!!t&&`reason`in t}catch{return!1}}coerce(e,t){var n=this.getUnhandledRejectionReason(e);return Le(n)?{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: `+String(n),stack:t.syntheticException?.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if(`reason`in e)return e.reason;if(`detail`in e&&e.detail!=null&&typeof e.detail==`object`&&`reason`in e.detail)return e.detail.reason}catch{}return e}},Fn=`$message`,In=`$timestamp`,Ln=new Set([Fn,In]),Rn={enabled:!0,max_bytes:32768};function zn(e){return e?{enabled:e.enabled??Rn.enabled,max_bytes:Vn(e.max_bytes,Rn.max_bytes)}:N({},Rn)}var Bn=class{constructor(e){this.bt=[],this._t=0,this.Se=zn(e)}setConfig(e){this.Se=zn(e),this.wt()}add(e){var t=function(e){var t,n;try{n=[],t=JSON.stringify(e,(function(e,t){if(typeof t==`bigint`)return t.toString();if(typeof t!=`function`&&typeof t!=`symbol`){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&typeof t==`object`){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(t))return`[Circular]`;n.push(t)}return t}}))??`null`}catch{return}try{var r=JSON.parse(t);if(!I(r))return;var i=r,a=i[Fn],o=i[In];return!R(a)||a.trim().length===0||!R(o)&&!V(o)?void 0:{step:i,json:t}}catch{return}}(e);if(t){var n=function(e){if(typeof TextEncoder<`u`)return new TextEncoder().encode(e).length;for(var t=encodeURIComponent(e),n=0,r=0;t.length>r;r++)t[r]===`%`?(n+=1,r+=2):n+=1;return n}(t.json);n>this.Se.max_bytes||(this.bt.push({step:t.step,bytes:n}),this._t+=n,this.wt())}}getAttachable(){return this.bt.map((e=>e.step))}clear(){this.bt=[],this._t=0}size(){return this.bt.length}wt(){for(;this._t>this.Se.max_bytes&&this.bt.length>0;){var e=this.bt.shift();e&&(this._t-=e.bytes)}}};function Vn(e,t){if(!V(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var Hn=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={k(t){if(C&&(j.DEBUG||A.POSTHOG_DEBUG||n)&&!L(C.console)&&C.console){for(var r=(`__rrweb_original__`in C.console[t])?C.console[t].__rrweb_original__:C.console[t],i=arguments.length,a=Array(i>1?i-1:0),o=1;i>o;o++)a[o-1]=arguments[o];r(e,...a)}},debug(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.k(`debug`,...t)},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.k(`log`,...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.k(`warn`,...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r.k(`error`,...t)},critical(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];console.error(e,...n)},uninitializedWarning(e){r.error(`You must initialize PostHog before calling `+e)},createLogger:(t,n)=>Hn(e+` `+t,n)};return r},U=Hn(`[PostHog.js]`),W=U.createLogger,Un=W(`[ExternalScriptsLoader]`),Wn=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Un.warn(t+` was requested but loading of external scripts is disabled.`),n(`Loading of external scripts is disabled`);var r=E?.querySelectorAll(`script`);if(r){for(var i,a=function(){if(r[o].src===t){var e=r[o];return e.__posthog_loading_callback_fired?{v:n()}:(e.addEventListener(`load`,(t=>{e.__posthog_loading_callback_fired=!0,n(void 0,t)})),e.onerror=e=>n(e),{v:void 0})}},o=0;r.length>o;o++)if(i=a())return i.v}var s=()=>{if(!E)return n(`document not found`);var r=E.createElement(`script`);if(r.type=`text/javascript`,r.crossOrigin=`anonymous`,r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,n(void 0,e)},r.onerror=e=>n(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return n(`prepare_external_dependency_script returned null`);if(e.config.external_scripts_inject_target===`head`)E.head.appendChild(r);else{var i,a=E.querySelectorAll(`body > script`);a.length>0?(i=a[0].parentNode)==null||i.insertBefore(r,a[0]):E.body.appendChild(r)}};E!=null&&E.body?s():E?.addEventListener(`DOMContentLoaded`,s)};A.__PosthogExtensions__=A.__PosthogExtensions__||{},A.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!==`remote-config`){var r;if(e.config.strict_script_versioning)r=e.requestRouter.endpointFor(`assets`,`/static/`+e.version+`/`+t+`.js`);else{var i=`/static/`+t+`.js?v=`+e.version;if(t===`toolbar`){var a=3e5;i=i+`&t=`+Math.floor(Date.now()/a)*a}r=e.requestRouter.endpointFor(`assets`,i)}Wn(e,r,n)}else Wn(e,e.requestRouter.endpointFor(`assets`,`/array/`+e.config.token+`/config.js`),n)},A.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{Wn(e,e.requestRouter.endpointFor(`api`,t),n)};var Gn=`$people_distinct_id`,Kn=`$device_id`,qn=`$device_model`,Jn=`__alias`,Yn=`__timers`,Xn=`$autocapture_disabled_server_side`,Zn=`$heatmaps_enabled_server_side`,Qn=`$exception_capture_enabled_server_side`,$n=`$error_tracking_suppression_rules`,er=`$error_tracking_capture_extension_exceptions`,tr=`$web_vitals_enabled_server_side`,nr=`$dead_clicks_enabled_server_side`,rr=`$product_tours_enabled_server_side`,ir=`$web_vitals_allowed_metrics`,ar=`$session_recording_remote_config`,or=`$replay_sample_rate`,sr=`$replay_override_sampling`,cr=`$replay_override_linked_flag`,lr=`$replay_override_url_trigger`,ur=`$replay_override_event_trigger`,dr=`$sesid`,fr=`$session_is_sampled`,pr=`$enabled_feature_flags`,mr=`$active_feature_flags`,hr=`$early_access_features`,gr=`$feature_flag_details`,_r=`$feature_flag_payloads`,vr=`$feature_flag_request_id`,yr=`$override_feature_flags`,br=`$override_feature_flag_payloads`,xr=`$stored_person_properties`,Sr=`$stored_group_properties`,Cr=`$surveys`,wr=`$surveys_loaded_at`,Tr=`$surveys_activated`,Er=`ph_product_tours`,Dr=`$flag_call_reported`,Or=`$flag_call_reported_session_id`,kr=`$feature_flag_errors`,Ar=`$feature_flag_evaluated_at`,jr=`$user_state`,Mr=`$client_session_props`,Nr=`$capture_rate_limit`,Pr=`$initial_campaign_params`,Fr=`$initial_referrer_info`,Ir=`$initial_person_info`,Lr=`$epp`,Rr=`__POSTHOG_TOOLBAR__`,zr=`$posthog_cookieless`,Br=`$sdk_debug_extensions_init_method`,Vr=`$sdk_debug_extensions_init_time_ms`,Hr=`$sdk_debug_recording_script_not_loaded`,Ur=`PostHog loadExternalDependency extension not found.`,Wr=`on_reject`,Gr=`always`,Kr=`anonymous`,qr=`identified`,Jr=`identified_only`,Yr=`visibilitychange`,Xr=`beforeunload`,Zr=`$pageview`,Qr=`$pageleave`,$r=`$identify`,ei=`$groupidentify`;function ti(e,t){F(e)&&e.forEach(t)}function G(e,t){if(!B(e))if(F(e))e.forEach(t);else if(Pe(e))e.forEach(((e,n)=>t(e,n)));else for(var n in e)De.call(e,n)&&t(e[n],n)}var K=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var a in i)i[a]!==void 0&&(e[a]=i[a]);return e};function ni(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var ri=function(e){try{return e()}catch{return}},ii=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){U.critical(`Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A.`),U.critical(e)}}},ai=function(e){var t={};return G(e,(function(e,n){(R(e)&&e.length>0||V(e))&&(t[n]=e)})),t},oi=[`herokuapp.com`,`vercel.app`,`netlify.app`];function si(e){var t=e?.hostname;if(!R(t))return!1;var n=t.split(`.`).slice(-2).join(`.`);for(var r of oi)if(n===r)return!1;return!0}function q(e,t,n,r){var{capture:i=!1,passive:a=!0}=r??{};e?.addEventListener(t,n,{capture:i,passive:a})}function ci(e){return e.name===`ph_toolbar_internal`}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return V(e)&&isFinite(e)&&Math.floor(e)===e});var li=class e{constructor(e){if(this.bytes=e,e.length!==16)throw TypeError(`not 128-bit length`)}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw RangeError(`invalid field value`);var a=new Uint8Array(16);return a[0]=t/2**40,a[1]=t/2**32,a[2]=t/2**24,a[3]=t/2**16,a[4]=t/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;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),t!==3&&t!==5&&t!==7&&t!==9||(e+=`-`);
1if(e.length!==36)throw Error(`Invalid UUIDv7 was generated`);return e}clone(){return new e(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}},ui=class{constructor(){this.S=0,this.C=0,this.I=new pi}generate(){var e=this.generateOrAbort();if(L(e)){this.S=0;var t=this.generateOrAbort();if(L(t))throw Error(`Could not generate UUID after timestamp reset`);return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return li.fromFieldsV7(this.S,Math.trunc(this.C/2**30),this.C&2**30-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}},di,fi=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<`u`&&UUIDV7_DENY_WEAK_RNG)throw Error(`no cryptographically strong RNG available`);for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};C&&!L(C.crypto)&&crypto.getRandomValues&&(fi=e=>crypto.getRandomValues(e));var pi=class{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(fi(this.R),this.O=0),this.R[this.O++]}},mi=()=>hi().toString(),hi=()=>(di||=new ui).generate(),gi=``,_i=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,vi={N:()=>!!E,D(e){U.error(`cookieStore error: `+e)},A(e){if(E){try{for(var t=e+`=`,n=E.cookie.split(`;`).filter((e=>e.length)),r=0;n.length>r;r++){for(var i=n[r];i.charAt(0)==` `;)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}},F(e){var t;try{t=JSON.parse(vi.A(e))||{}}catch{}return t},q(e,t,n,r,i){if(!E)return!1;try{var a=``,o=``,s=function(e,t){if(t){var n=function(e,t){if(t===void 0&&(t=E),gi)return gi;if(!t||[`localhost`,`127.0.0.1`].includes(e))return``;for(var n=e.split(`.`),r=Math.min(n.length,8),i=`dmn_chk_`+mi();!gi&&r--;){var a=n.slice(r).join(`.`),o=i+`=1;domain=.`+a+`;path=/`;t.cookie=o+`;max-age=3`,t.cookie.includes(i)&&(t.cookie=o+`;max-age=0`,gi=a)}return gi}(e);if(!n){var r=(e=>{var t=e.match(_i);return t?t[0]:``})(e);r!==n&&U.info(`Warning: cookie subdomain discovery mismatch`,r,n),n=r}return n?`; domain=.`+n:``}return``}(E.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+864e5*n),a=`; expires=`+c.toUTCString()}i&&(o=`; secure`);var l=e+`=`+encodeURIComponent(JSON.stringify(t))+a+`; SameSite=Lax; path=/`+s+o;return l.length>3686.4&&U.warn(`cookieStore warning: large cookie, len=`+l.length),E.cookie=l,!0}catch{return!1}},P(e,t){if(E!=null&&E.cookie)try{vi.q(e,``,-1,t)}catch{return}}},yi=null,J={N(){if(!z(yi))return yi;var e=!0;if(L(C))e=!1;else try{var t=`__mplssupport__`;J.q(t,`xyz`),J.A(t)!==`"xyz"`&&(e=!1),J.P(t)}catch{e=!1}return e||U.error(`localStorage unsupported; falling back to cookie store`),yi=e,e},D(e){U.error(`localStorage error: `+e)},A(e){try{return C?.localStorage.getItem(e)}catch(e){J.D(e)}return null},F(e){try{return JSON.parse(J.A(e))||{}}catch{}return null},q(e,t){try{return C?.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){J.D(e)}return!1},P(e){try{C?.localStorage.removeItem(e)}catch(e){J.D(e)}}},bi=[Kn,`distinct_id`,dr,fr,Lr,Ir,jr],xi={},Si={N:()=>!0,D(e){U.error(`memoryStorage error: `+e)},A:e=>xi[e]||null,F:e=>xi[e]||null,q:(e,t)=>(xi[e]=t,!0),P(e){delete xi[e]}},Ci=null,Y={N(){if(!z(Ci))return Ci;if(Ci=!0,L(C))Ci=!1;else try{var e=`__support__`;Y.q(e,`xyz`),Y.A(e)!==`"xyz"`&&(Ci=!1),Y.P(e)}catch{Ci=!1}return Ci},D(e){U.error(`sessionStorage error: `,e)},A(e){try{return C?.sessionStorage.getItem(e)}catch(e){Y.D(e)}return null},F(e){try{return JSON.parse(Y.A(e))||null}catch{}return null},q(e,t){try{return C?.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Y.D(e)}return!1},P(e){try{C?.sessionStorage.removeItem(e)}catch(e){Y.D(e)}}},wi=class{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}
1isOptedOut(){return this.Se.cookieless_mode===Gr||this.isRejected()||this.consent===-1&&this.Se.cookieless_mode===Wr}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Ct.q(this.It,+!!e,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.P(this.It,this.Se.cross_subdomain_cookie)}get It(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:n}=this._instance.config;return n||(t?t+e:`__ph_opt_in_out_`+e)}get St(){var e=this.Ct.A(this.It);return Ve(e)?1:P(He,e)?0:-1}get Ct(){var e=this.Se.opt_out_capturing_persistence_type,t=e===`localStorage`?J:vi;if(!this.Tt||this.Tt!==t){this.Tt=t;var n=e===`localStorage`?vi:J;n.A(this.It)&&(this.Tt.A(this.It)||this.optInOut(Ve(n.A(this.It))),n.P(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[T?.doNotTrack,T?.msDoNotTrack,A.doNotTrack].some((e=>Ve(e)))}};function Ti(e,t){var n,r=e==null||(n=e.config)==null?void 0:n.get_current_url;if(!ke(r))return t;try{var i=r(t);return R(i)&&i?i:t}catch(e){return U.error(`Error in get_current_url, falling back to window.location.href`,e),t}}var Ei=1,Di=3,Oi=11;function ki(e){return e instanceof Element&&(e.id===Rr||!(e.closest==null||!e.closest(`.toolbar-global-fade-container`)))}function Ai(e){return!!e&&e.nodeType===Ei}function ji(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Mi(e){return!!e&&e.nodeType===Di}function Ni(e){return!!e&&e.nodeType===Oi&&Ai(e.host)}function Pi(e){return e?we(e).split(/\s+/):[]}function Fi(e,t){var n=function(e){var t,n=C==null||(t=C.location)==null?void 0:t.href;return L(n)?void 0:Ti(e,n)}(t);return!!(n&&e&&e.some((e=>n.match(e))))}function Ii(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 Pi(t)}function Li(e){return B(e)?null:we(e).split(/(\s+)/).filter((e=>oa(e))).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255)}function Ri(e){var t=``;return Qi(e)&&!$i(e)&&e.childNodes&&e.childNodes.length&&G(e.childNodes,(function(e){Mi(e)&&e.textContent&&(t+=Li(e.textContent)??``)})),we(t)}function zi(e){return L(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Bi=[`a`,`button`,`form`,`input`,`select`,`textarea`,`label`];function Vi(e,t){if(L(t))return!0;var n,r=function(e){if(t.some((t=>function(e,t){var n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch{return!1}}(e,t))))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function Hi(e){var t=e.parentNode;return!(!t||!Ai(t))&&t}var Ui=[`.ph-no-autocapture`,`[data-ph-no-autocapture]`],Wi=[`next`,`previous`,`prev`,`>`,`<`],Gi=[...Wi,`+`,`-`,`â`,`â`],Ki=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,qi=[`.ph-no-rageclick`,`.ph-no-capture`],Ji=[``,`text`,`search`,`email`,`password`,`url`,`tel`,`number`];function Yi(e,t){if(!C||Xi(e))return!1;var n,r,i,a;if(Ne(t)?(n=!!t&&qi,r=void 0,i=!1):(n=t?.css_selector_ignorelist??qi,r=t?.content_ignorelist,i=(a=t?.ignore_text_selection)!=null&&a),!1===n||i&&function(e){return!(!e||!Ai(e))&&(!!ji(e,`textarea`)||(ji(e,`input`)?P(Ji,(e.getAttribute(`type`)||``).toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=e.getAttribute==null?void 0:e.getAttribute(`contenteditable`);return t===`true`||t===``}(e)))}(e))return!1;var{targetElementList:o}=Zi(e,!1);return!function(e,t){if(!1===e||L(e))return!1;var n;if(!0===e)n=Wi;else{if(!F(e))return!1;if(e.length>10)return U.error(`[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching.`),!1;n=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:r}=e;return n.some((e=>Ki(t,e)||Ki(r,e)))}))}(r,o.map((e=>({safeText:Ri(e).toLowerCase(),ariaLabel:e.getAttribute(`aria-label`)?.toLowerCase().trim()||``}))))&&!Vi(o,n)}var Xi=e=>!e||ji(e,`html`)||!Ai(e),Zi=(e,t)=>{if(!C||Xi(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],i=e;i.parentNode&&!ji(i,`body`);)if(Ni(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var a=Hi(i);if(!a)break;if(t||Bi.indexOf(a.tagName.toLowerCase())>-1)n=!0;else{var o=C.getComputedStyle(a);o&&o.getPropertyValue(`cursor`)===`pointer`&&(n=!0)}r.push(a),i=a}return{parentIsUsefulElement:n,targetElementList:r}};function Qi(e){for(var t=e;t.parentNode&&!ji(t,`body`);t=t.parentNode){var n=Ii(t);if(P(n,`ph-sensitive`)||P(n,`ph-no-capture`))return!1}if(P(Ii(e),`ph-include`))return!0;var r=e.type||``;if(R(r))switch(r.toLowerCase()){case`hidden`:case`password`:return!1}
1var i=e.name||e.id||``;return!R(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 $i(e){return!!(ji(e,`input`)&&![`button`,`checkbox`,`submit`,`reset`].includes(e.type)||ji(e,`select`)||ji(e,`textarea`)||e.getAttribute(`contenteditable`)===`true`)}var ea=`(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})`,ta=RegExp(`^(?:`+ea+`)$`),na=new RegExp(ea),ra=`\\d{3}-?\\d{2}-?\\d{4}`,ia=RegExp(`^(`+ra+`)$`),aa=RegExp(`(`+ra+`)`);function oa(e,t){return t===void 0&&(t=!0),!(B(e)||R(e)&&(e=we(e),(t?ta:na).test((e||``).replace(/[- ]/g,``))||(t?ia:aa).test(e)))}function sa(e){var t=Ri(e);return oa(t=(t+` `+ca(e)).trim())?t:``}function ca(e){var t=``;return e&&e.childNodes&&e.childNodes.length&&G(e.childNodes,(function(e){if(e&&e.tagName?.toLowerCase()===`span`)try{var n=Ri(e);t=(t+` `+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+` `+ca(e)).trim())}catch(e){U.error(`[AutoCapture]`,e)}})),t}function la(e){return e.replace(/"|\\"/g,`\\"`)}function ua(e){var t=e.attr__class;return t?F(t)?t:Pi(t):void 0}var da=W(`[Dead Clicks]`),fa=()=>!0,pa=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(nr)),r=e.instance.config.capture_dead_clicks;return Ne(r)?r:!!I(r)||n},ma=class{get lazyLoadedDeadClicksAutocapture(){return this.Et}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){`captureDeadClicks`in e&&(this.instance.persistence&&this.instance.persistence.register({[nr]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Mt((()=>{this.Pt()})):this.stop()}Mt(e){var t,n;(t=A.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture?e():(n=A.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,`dead-clicks-autocapture`,(t=>{t?da.error(`failed to load script`,t):e()}))}Pt(){var e;if(E){if(!this.Et&&(e=A.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=I(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.Et=A.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Et.start(E),da.info(`starting...`)}}else da.error("`document` not found. Cannot start.")}stop(){this.Et&&(this.Et.stop(),this.Et=void 0,da.info(`stopping...`))}},ha=W(`[SegmentIntegration]`),ga=`posthog-js`;function _a(e,t){var{organization:n,projectId:r,prefix:i,severityAllowList:a=[`error`],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return t=>{if(a!==`*`&&!a.includes(t.level)||!e.__loaded)return t;t.tags||={};var s=e.requestRouter.endpointFor(`ui`,`/project/`+e.config.token+`/person/`+e.get_distinct_id());t.tags[`PostHog Person URL`]=s,e.sessionRecordingStarted()&&(t.tags[`PostHog Recording URL`]=e.get_session_replay_url({withTimestamp:!0}));var c,l=t.exception?.values||[],u=l.map((e=>N({},e,{stacktrace:e.stacktrace?N({},e.stacktrace,{type:`raw`,frames:(e.stacktrace.frames||[]).map((e=>N({},e,{platform:`web:javascript`})))}):void 0}))),d={$exception_message:l[0]?.value||t.message,$exception_type:l[0]?.type,$exception_level:t.level,$exception_list:u,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:l[0]?.value||t.message,$sentry_exception_type:l[0]?.type,$sentry_tags:t.tags};return n&&r&&(d.$sentry_url=(i||`https://sentry.io/organizations/`)+n+`/issues/?project=`+r+`&query=`+t.event_id),o&&((c=e.exceptions)==null||c.sendExceptionEvent(d)),t}}var va=class{constructor(e,t,n,r,i,a){this.name=ga,this.setupOnce=function(o){o(_a(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}},ya=class{constructor(e){this.Rt=(e,t,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength||n.crossTabAdoption)&&(U.info(`[PageViewManager] Session rotated, clearing pageview state`,{sessionId:e,changeReason:n}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Lt()}Lt(){this.Ft=this._instance.sessionManager?.onSessionId(this.Rt)}destroy(){var e;(e=this.Ft)==null||e.call(this),this.Ft=void 0}doPageView(e,t){var n=this.At(e,t);return this.Ot={pathname:C?.location.pathname??``,pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){return this.At(e,this.Ot?.pageViewId)}doEvent(){return{$pageview_id:this.Ot?.pageViewId}}At(e,t){var n=this.Ot;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(!(L(a)||L(o)||L(s)||L(c)||L(l)||L(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>
11?Ue(o/a,0,1,U):1,f=a>1?Ue(s/a,0,1,U):1,p=c>1?Ue(l/c,0,1,U):1,m=c>1?Ue(u/c,0,1,U):1;r=K(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}},ba=[`flags`,`surveys`],xa={[Gn]:{exposure:`hidden`},[Jn]:{exposure:`hidden`},__cmpns:{exposure:`hidden`},[Yn]:{exposure:`hidden`},[Xn]:{exposure:`event`},[Zn]:{exposure:`hidden`},[Qn]:{exposure:`event`},[$n]:{exposure:`hidden`},[er]:{exposure:`event`},[tr]:{exposure:`event`},[nr]:{exposure:`event`},[rr]:{exposure:`hidden`},[ir]:{exposure:`event`},[ar]:{exposure:`hidden`},$session_recording_enabled_server_side:{exposure:`hidden`},[dr]:{exposure:`hidden`},[fr]:{exposure:`event`},[or]:{exposure:`event`,shouldSkipFromEventProperties:e=>z(e)},$session_past_minimum_duration:{exposure:`event`},$session_recording_url_trigger_activated_session:{exposure:`event`},$session_recording_event_trigger_activated_session:{exposure:`event`},$debug_first_full_snapshot_timestamp:{exposure:`event`},$sess_rec_flush_size:{exposure:`hidden`},[pr]:{exposure:`derived`,storageGroup:`flags`,shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!I(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t[`$feature/`+n[r]]=e[n[r]];return t}},[mr]:{exposure:`event`,storageGroup:`flags`},[hr]:{exposure:`hidden`},[gr]:{exposure:`hidden`,storageGroup:`flags`},[_r]:{exposure:`event`,storageGroup:`flags`},[vr]:{exposure:`event`,storageGroup:`flags`,volatile:!0},[yr]:{exposure:`event`},[br]:{exposure:`hidden`},[xr]:{exposure:`hidden`},[Sr]:{exposure:`hidden`},[Cr]:{exposure:`hidden`,storageGroup:`surveys`},[wr]:{exposure:`hidden`,storageGroup:`surveys`,volatile:!0},[Tr]:{exposure:`event`},[Er]:{exposure:`hidden`},$product_tours_activated:{exposure:`hidden`},$conversations_widget_session_id:{exposure:`event`},$conversations_ticket_id:{exposure:`event`},$conversations_widget_state:{exposure:`event`},$conversations_user_traits:{exposure:`event`},[Dr]:{exposure:`hidden`},[Or]:{exposure:`hidden`},[kr]:{exposure:`hidden`},[Ar]:{exposure:`hidden`,storageGroup:`flags`,volatile:!0},[jr]:{exposure:`hidden`},[Mr]:{exposure:`hidden`},[Nr]:{exposure:`hidden`},[Pr]:{exposure:`hidden`},[Fr]:{exposure:`hidden`},[Ir]:{exposure:`hidden`},[Lr]:{exposure:`hidden`},[sr]:{exposure:`event`},[cr]:{exposure:`event`},[lr]:{exposure:`event`},[ur]:{exposure:`event`},[Br]:{exposure:`event`},[Vr]:{exposure:`event`},[Hr]:{exposure:`event`},$sdk_debug_replay_event_trigger_status:{exposure:`event`},$sdk_debug_replay_linked_flag_trigger_status:{exposure:`event`},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:`event`},$sdk_debug_replay_remote_trigger_matching_config:{exposure:`event`},$sdk_debug_replay_trigger_groups_count:{exposure:`event`},$sdk_debug_replay_url_trigger_status:{exposure:`event`},$session_recording_start_reason:{exposure:`event`}},Sa=[[`$posthog_sr_group_event_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_url_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_sampling_`,{exposure:`hidden`}]],Ca=e=>{var t=xa[e];if(t)return t;for(var[n,r]of Sa)if(e.indexOf(n)===0)return r},wa=e=>{var t=E?.createElement(`a`);return L(t)?null:(t.href=e,t)},Ta=function(e,t){for(var n,r=((e.split(`#`)[0]||``).split(/\?(.*)/)[1]||``).replace(/^\?+/g,``).split(`&`),i=0;r.length>i;i++){var a=r[i].split(`=`);
1if(a[0]===t){n=a;break}}if(!F(n)||2>n.length)return``;var o=n[1];try{o=decodeURIComponent(o)}catch{U.error(`Skipping decoding for malformed query param: `+o)}return o.replace(/\+/g,` `)},Ea=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(`#`),i=r[1],a=(r[0]||``).split(`?`),o=a[1],s=a[0],c=(o||``).split(`&`),l=[],u=0;c.length>u;u++){var d=c[u].split(`=`);F(d)&&(t.includes(d[0])?l.push(d[0]+`=`+n):l.push(c[u]))}var f=s;return o!=null&&(f+=`?`+l.join(`&`)),i!=null&&(f+=`#`+i),f},Da=function(e,t){var n=e.match(RegExp(t+`=([^&]*)`));return n?n[1]:null},Oa=`https?://(.*)`,ka=[`gclid`,`gclsrc`,`dclid`,`gbraid`,`wbraid`,`fbclid`,`msclkid`,`twclid`,`li_fat_id`,`igshid`,`ttclid`,`rdt_cid`,`epik`,`qclid`,`sccid`,`irclid`,`_kx`],Aa=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gad_source`,`mc_cid`,...ka],ja=`<masked>`,Ma=[`li_fat_id`];function Na(e,t,n){if(!E)return{};var r,i=t?[...ka,...n||[]]:[],a=Pa(Ea(E.URL,i,ja),e);return K((r={},G(Ma,(function(e){var t=vi.A(e);r[e]=t||null})),r),a)}function Pa(e,t){var n=Aa.concat(t||[]),r={};return G(n,(function(t){r[t]=Ta(e,t)||null})),r}function Fa(e){var t=function(e){return e?e.search(Oa+`google.([^/?]*)`)===0?`google`:e.search(Oa+`bing.com`)===0?`bing`:e.search(Oa+`yahoo.com`)===0?`yahoo`:e.search(Oa+`duckduckgo.com`)===0?`duckduckgo`:null:null}(e),n=t==`yahoo`?`p`:`q`,r={};if(!z(t)){r.$search_engine=t;var i=E?Ta(E.referrer,n):``;i.length&&(r.ph_keyword=i)}return r}function Ia(){return navigator.language||navigator.userLanguage}var La=`$direct`;function Ra(){return E?.referrer||La}function za(e,t,n){n===void 0&&(n=!1);var r=e?[...ka,...t||[]]:[],i=(n?Xt(D?.href):D?.href)?.substring(0,1e3);return{r:Ra().substring(0,1e3),u:i?Ea(i,r,ja):void 0}}function Ba(e,t){t===void 0&&(t=!1);var{r:n,u:r}=e,i=t?Xt(r):r,a={$referrer:n,$referring_domain:n==null?void 0:n==La?La:wa(n)?.host};if(i){a.$current_url=i;var o=wa(i);a.$host=o?.host,a.$pathname=o?.pathname,K(a,Pa(i))}return n&&K(a,Fa(n)),a}function Va(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Ha(){try{return new Date().getTimezoneOffset()}catch{return}}var Ua={flags:Ar,surveys:wr},Wa=[`cookie`,`localstorage`,`localstorage+cookie`,`sessionstorage`,`memory`],Ga=`main`,Ka=class{constructor(e,t,n){if(n===void 0&&(n=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=e,this.qt=n,this.props={},this.jt=!1,this.Bt=(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.Ct=this.Ht(e),this.Nt=this.Ut(e),this.load(),e.debug&&U.info(`Persistence loaded`,e.persistence,N({},this.props)),this.update_config(e,e,t),this.save(),C){var r=()=>this.flush();q(C,`beforeunload`,r,{capture:!1}),q(C,`pagehide`,r,{capture:!1})}}zt(){var e=this.Se?.persistence_save_debounce_ms;return V(e)&&e>0?e:0}isDisabled(){return!!this.Vt}Ht(e){Wa.indexOf(e.persistence.toLowerCase())===-1&&(U.critical(`Unknown persistence type `+e.persistence+`; falling back to localStorage+cookie`),e.persistence=`localStorage+cookie`);var t,n=function(e,t){e===void 0&&(e=[]),t===void 0&&(t=!1);var n=[...bi,...e];return N({},J,{F(e){try{var n={};try{n=vi.F(e)||{}}catch{}var r,i=JSON.parse(J.A(e)||`{}`);if(t){var a={};for(var o in n){var s=n[o];z(s)||s===``||(a[o]=s)}r=K(i,a)}else r=K(n,i);return J.q(e,r),r}catch{}return null},q(e,t,r,i,a,o){var s=J.q(e,t,void 0,void 0,o);try{var c={};n.forEach((e=>{t[e]&&(c[e]=t[e])})),Object.keys(c).length&&vi.q(e,c,r,i,a,o)}catch(e){J.D(e)}return s},P(e,t){try{C?.localStorage.removeItem(e),vi.P(e,t)}catch(e){J.D(e)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),r=!1,i=e.persistence.toLowerCase();return i===`localstorage`&&J.N()?(t=J,r=!0):i===`localstorage+cookie`&&n.N()?(t=n,r=!0):i===`sessionstorage`&&Y.N()?t=Y:i===`memory`?t=Si:i===`cookie`?t=vi:n.N()?(t=n,r=!0):t=vi,this.Dt=r,t}Wt(e){return this.Bt+`__`+e}Ut(e){return this.Dt&&!!e.split_storage}Gt(e){var t=e??this.Se.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var n=this.props[Ar];return!n||typeof n!=`number`||Date.now()-n>t}properties(){var e={};return G(this.props,((t,n)=>{var r=Ca(n);if(r?.exposure===`derived`){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,n===pr?()=>this.Gt():()=>!1))return;r.transformToEventProperties&&K(e,r.transformToEventProperties(t))}else if(!r||r.exposure===`event`){if(r!=null&&r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,(()=>!1)))return;e[n]=t}})),e}load(){if(!this.Vt){var e=this.Ct.F(this.Bt);e&&(this.props=K({},e)),this.Nt&&this.Zt()}}Zt(){for(var e of ba){var t=J.F(this.Wt(e));if(t&&!Ae(t)){var n=this.Qt(e);n.persisted=!0,this.Jt(e)||(n.fingerprint=this.Yt(t,e)),this.Kt(e,t)||K(this.props,t)}}}Jt(e){return Object.keys(this.props).some((t=>Ca(t)?.storageGroup===e))}Kt(e,t){var n=Ua[e];if(!n)return!1;var r=t[n],i=this.props[n];return V(r)&&V(i)&&i>r}refreshKey(e){if(!this.Vt){var t=this.Nt?Ca(e)?.storageGroup:void 0,n=t?J.F(this.Wt(t)):this.Ct.F(this.Bt);if(n&&e in n)this.Xt(e,n[e]);else{if(t){var r=this.Ct.F(this.Bt);if(r&&e in r)return void this.Xt(e,r[e])}this.er(e)}}}save(){if(!this.Vt){var e=this.zt();e>0?L(this.tr)&&(this.tr=setTimeout((()=>{this.tr=void 0,this.rr()}),e)):this.rr()}}flush(){L(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.Bt,this.props,Ga))}ir(){var{main:e,groups:t}=this.sr();for(var n of(this.nr(this.Ct,this.Bt,e,Ga),ba)){var r,i=t[n];(!Ae(i)||(r=this.$t[n])!=null&&r.persisted)&&this.nr(J,this.Wt(n),i,n)}}sr(){var e={},t={};for(var n of ba)t[n]={};return G(this.props,((n,r)=>{var i=Ca(r)?.storageGroup;i?t[i][r]=n:e[r]=n})),{main:e,groups:t}}Yt(e,t){if(t===Ga)return JSON.stringify(e)+`|`+this.ar+`|`+this.lr+`|`+this.ur;var n={};return G(e,((e,t)=>
1{var r;n[t]=(r=Ca(t))!=null&&r.volatile?`__volatile__`:e})),JSON.stringify(n)}nr(e,t,n,r){var i=this.Qt(r);if(r===Ga||i.dirty||L(i.fingerprint)){var a;try{if((a=this.Yt(n,r))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.q(t,n,this.ar,this.lr,this.ur,this.Se.debug)?(i.dirty=!1,r!==Ga&&(i.persisted=!0),L(a)||(i.fingerprint=a)):this.Se.debug&&U.warn(`failed to persist storage entry "`+t+`"; will retry on next save`)}}remove(e){var{keepGroupEntries:t=!1}=e===void 0?{}:e;if(L(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.P(this.Bt,!1),this.Ct.P(this.Bt,!0),!t&&this.qt)for(var n of ba)J.P(this.Wt(n));t?delete this.$t[Ga]:this.$t={}}clear(){this.remove(),this.props={}}register_once(e,t,n){if(I(e)){L(t)&&(t=`None`),this.ar=L(n)?this.hr:n;var r=!1;if(G(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.Xt(n,e),r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(I(e)){this.ar=L(t)?this.hr:t;var n=!1;if(G(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.Xt(r,t),n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.er(e),this.save())}update_campaign_params(){if(!this.jt){var e=Na(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);Ae(ai(e))||this.register(e),this.jt=!0}}update_search_keyword(){var e;this.register((e=E?.referrer)?Fa(e):{})}update_referrer_info(){this.register_once({$referrer:Ra(),$referring_domain:E!=null&&E.referrer&&wa(E.referrer)?.host||La},void 0)}set_initial_person_info(){this.props[Pr]||this.props[Fr]||this.register_once({[Ir]:za(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};G([Fr,Pr],(t=>{var n=this.props[t];n&&G(n,(function(t,n){e[`$initial_`+Te(n)]=t}))}));var t=this.props[Ir];return t&&K(e,function(e,t){t===void 0&&(t=!1);var n=Ba(e,t),r={};return G(n,(function(e,t){r[`$initial_`+Te(t)]=e})),r}(t,this.Se.disable_capture_url_hashes)),e}safe_merge(e){return G(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t,n){this.hr=this.ar=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var r=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var n=[...e].sort(),r=[...t].sort();return n.every(((e,t)=>e===r[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),i=r?this.Ht(e):this.Ct,a=this.Ut(e);if(r||a!==this.Nt){var o=this.props;this.clear(),this.Ct=i,this.Nt=a,this.props=o,this.save()}}set_disabled(e){this.Vt=e,this.Vt?this.remove():this.save()}set_cross_subdomain(e){e!==this.lr&&(this.lr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ur&&(this.ur=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var n=this.props[Yn]||{};n[e]=t,this.Xt(Yn,n),this.save()}remove_event_timer(e){var t=this.props[Yn]||{},n=t[e];return L(n)||(delete t[e],this.Xt(Yn,t),this.save()),n}get_property(e){return this.props[e]}set_property(e,t){this.Xt(e,t),this.save()}Xt(e,t){var n;this.props[e]=t,(n=Ca(e))!=null&&n.volatile||this.dr(e)}er(e){delete this.props[e],this.dr(e)}dr(e){var t=Ca(e)?.storageGroup;t&&(this.Qt(t).dirty=!0)}Qt(e){return this.$t[e]||(this.$t[e]={})}},qa={Activation:`events`,Cancellation:`cancelEvents`},Ja={Popover:`popover`,API:`api`,Widget:`widget`,ExternalSurvey:`external_survey`},Ya={Once:`once`,Recurring:`recurring`,Always:`always`},Xa={SHOWN:`survey shown`,DISMISSED:`survey dismissed`,SENT:`survey sent`,ABANDONED:`survey abandoned`},Za={SURVEY_ID:`$survey_id`,SURVEY_NAME:`$survey_name`,SURVEY_RESPONSE:`$survey_response`,SURVEY_ITERATION:`$survey_iteration`,SURVEY_ITERATION_START_DATE:`$survey_iteration_start_date`,SURVEY_PARTIALLY_COMPLETED:`$survey_partially_completed`,SURVEY_SUBMISSION_ID:`$survey_submission_id`,SURVEY_QUESTIONS:`$survey_questions`,SURVEY_COMPLETED:`$survey_completed`,PRODUCT_TOUR_ID:`$product_tour_id`,SURVEY_LAST_SEEN_DATE:`$survey_last_seen_date`,SURVEY_LANGUAGE:`$survey_language`},Qa={Popover:`popover`,Inline:`inline`},$a={SHOWN:`product tour shown`,DISMISSED:`product tour dismissed`,COMPLETED:`product tour completed`,STEP_SHOWN:`product tour step shown`,STEP_COMPLETED:`product tour step completed`,BUTTON_CLICKED:`product tour button clicked`,STEP_SELECTOR_FAILED:`product tour step selector failed`,BANNER_CONTAINER_SELECTOR_FAILED:`product tour banner container selector failed`,BANNER_ACTION_CLICKED:`product tour banner action clicked`},eo={TOUR_ID:`$product_tour_id`,TOUR_NAME:`$product_tour_name`,TOUR_ITERATION:`$product_tour_iteration`,TOUR_RENDER_REASON:`$product_tour_render_reason`,TOUR_STEP_ID:`$product_tour_step_id`,TOUR_STEP_ORDER:`$product_tour_step_order`,TOUR_STEP_TYPE:`$product_tour_step_type`,TOUR_DISMISS_REASON:`$product_tour_dismiss_reason`,TOUR_BUTTON_TEXT:`$product_tour_button_text`,TOUR_BUTTON_ACTION:`$product_tour_button_action`,TOUR_BUTTON_LINK:`$product_tour_button_link`,TOUR_BUTTON_TOUR_ID:`$product_tour_button_tour_id`,TOUR_STEPS_COUNT:`$product_tour_steps_count`,TOUR_STEP_SELECTOR:`$product_tour_step_selector`,TOUR_STEP_SELECTOR_FOUND:`$product_tour_step_selector_found`,TOUR_STEP_ELEMENT_TAG:`$product_tour_step_element_tag`,TOUR_STEP_ELEMENT_ID:`$product_tour_step_element_id`,TOUR_STEP_ELEMENT_CLASSES:`$product_tour_step_element_classes`,TOUR_STEP_ELEMENT_TEXT:`$product_tour_step_element_text`,TOUR_ERROR:`$product_tour_error`,TOUR_MATCHES_COUNT:`$product_tour_matches_count`,TOUR_FAILURE_PHASE:`$product_tour_failure_phase`,TOUR_WAITED_FOR_ELEMENT:`$product_tour_waited_for_element`,TOUR_WAIT_DURATION_MS:`$product_tour_wait_duration_ms`,TOUR_BANNER_SELECTOR:`$product_tour_banner_selector`,TOUR_LINKED_SURVEY_ID:`$product_tour_linked_survey_id`,USE_MANUAL_SELECTOR:`$use_manual_selector`,INFERENCE_DATA_PRESENT:`$inference_data_present`,TOUR_LAST_SEEN_DATE:`$product_tour_last_seen_date`,TOUR_TYPE:`$product_tour_type`},to=W(`[RateLimiter]`),no=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;
1if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{to.info((e||`events`)+` is quota limited.`),this.serverLimits[e]=new Date().getTime()+6e4}))}catch(e){to.warn(`could not rate limit - continuing. Error: "`+e?.message+`"`,{text:t});return}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){return this.instance.config.rate_limiting?.events_per_second||10}get captureEventsBurstLimit(){return Math.max(this.instance.config.rate_limiting?.events_burst_limit||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t;e===void 0&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:r}=this,i=new Date().getTime(),a=this.instance.persistence?.get_property(Nr)??{tokens:n,last:i};a.tokens+=(i-a.last)/1e3*r,a.last=i,a.tokens>n&&(a.tokens=n);var o=1>a.tokens;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture(`$$client_ingestion_warning`,{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to `+r+` events per second and `+n+` events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(t=this.instance.persistence)==null||t.set_property(Nr,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||`events`]||!1;return!1!==t&&new Date().getTime()<t}},ro=W(`[RemoteConfig]`),io=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=A._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}cr(e){var t,n;(t=A.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=A.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`remote-config`,(()=>e(this.remoteConfig))):e()}vr(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 ro.info(`Using preloaded remote config`,this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void ro.warn(`Remote config is disabled. Falling back to local config.`);this.cr((e=>{if(!e)return ro.info(`No config found after loading remote JS config. Falling back to JSON.`),void this.vr((e=>{this.pr(e),this.gr()}));this.pr(e),this.gr()}))}catch(e){ro.error(`Error loading remote config`,e)}}stop(){this.yr&&=(clearInterval(this.yr),void 0)}refresh(){!this._instance.mr()&&E&&E.visibilityState!==`hidden`&&this._instance.reloadFeatureFlags()}gr(){if(!this.yr){var e=this._instance.config.remote_config_refresh_interval_ms??3e5;e!==0&&(this.yr=setInterval((()=>{this.refresh()}),e))}}pr(e){var t;e||ro.error(`Failed to fetch remote config from PostHog.`),this._instance.pr(e??{}),!1!==e?.hasFeatureFlags&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}},ao={GZipJS:`gzip-js`,Base64:`base64`},oo=Uint8Array,X=Uint16Array,so=Uint32Array,co=new oo([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]),lo=new oo([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]),uo=new oo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fo=function(e,t){for(var n=new X(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new so(n[30]);for(r=1;30>r;++r)for(var a=n[r];n[r+1]>a;++a)i[a]=a-n[r]<<5|r;return[n,i]},po=fo(co,2),mo=po[1];po[0][28]=258,mo[258]=28;for(var ho=fo(lo,0)[1],go=new X(32768),Z=0;32768>Z;++Z){var _o=(43690&Z)>>>1|(21845&Z)<<1;go[Z]=((65280&(_o=(61680&(_o=(52428&_o)>>>2|(13107&_o)<<2))>>>4|(3855&_o)<<4))>>>8|(255&_o)<<8)>>>1}var vo=function(e,t,n){for(var r=e.length,i=0,a=new X(t);r>i;++i)++a[e[i]-1];var o,s=new X(t);for(i=0;t>i;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new X(1<<t);var c=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;f>=d;++d)o[go[d]>>>c]=l}else for(o=new X(r),i=0;r>i;++i)o[i]=go[s[e[i]-1]++]>>>15-e[i];return o},yo=new oo(288);for(Z=0;144>Z;++Z)yo[Z]=8;for(Z=144;256>Z;++Z)yo[Z]=9;for(Z=256;280>Z;++Z)yo[Z]=7;for(Z=280;288>Z;++Z)yo[Z]=8;var bo=new oo(32);for(Z=0;32>Z;++Z)bo[Z]=5;var xo=vo(yo,9,0),So=vo(bo,5,0),Co=function(e){return(e/8>>0)+(7&e&&1)},wo=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof X?X:e instanceof so?so:oo)(n-t);return r.set(e.subarray(t,n)),r},To=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},Eo=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Do=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[new oo(0),0];if(i==1){var o=new oo(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[d].f>n[l].f?l++:d++],c=n[l!=u&&n[d].f>n[l].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var f=a[0].s;for(r=1;i>r;++r)a[r].s>f&&(f=a[r].s);var p=new X(f+1),m=Oo(n[u-1],p,0);if(m>t){r=0;var h=0,g=m-t,_=1<<g;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i>r;++r){var v=a[r].s;if(t>=p[v])break;h+=_-(1<<m-p[v]),p[v]=t}for(h>>>=g;h>0;){var ee=a[r].s;t>p[ee]?h-=1<<t-p[ee]++-1:++r}for(;r>=0&&h;--r){var y=a[r].s;p[y]==t&&(--p[y],++h)}m=t}return[new oo(p),m]},Oo=function(e,t,n){return e.s==-1?Math.max(Oo(e.l,t,n+1),Oo(e.r,t,n+1)):t[e.s]=n},ko=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new X(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;t>=s;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>
12&&(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]},Ao=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},jo=function(e,t,n){var r=n.length,i=Co(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;r>a;++a)e[i+a+4]=n[a];return 8*(i+4+r)},Mo=function(e,t,n,r,i,a,o,s,c,l,u){To(t,u++,n),++i[256];for(var d=Do(i,15),f=d[0],p=d[1],m=Do(a,15),h=m[0],g=m[1],_=ko(f),v=_[0],ee=_[1],y=ko(h),b=y[0],x=y[1],S=new X(19),C=0;v.length>C;++C)S[31&v[C]]++;for(C=0;b.length>C;++C)S[31&b[C]]++;for(var w=Do(S,7),T=w[0],E=w[1],D=19;D>4&&!T[uo[D-1]];--D);var te,O,ne,re,k=l+5<<3,A=Ao(i,yo)+Ao(a,bo)+o,ie=Ao(i,f)+Ao(a,h)+o+14+3*D+Ao(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(A>=k&&ie>=k)return jo(t,u,e.subarray(c,c+l));if(To(t,u,1+(A>ie)),u+=2,A>ie){te=vo(f,p,0),O=f,ne=vo(h,g,0),re=h;var j=vo(T,E,0);for(To(t,u,ee-257),To(t,u+5,x-1),To(t,u+10,D-4),u+=14,C=0;D>C;++C)To(t,u+3*C,T[uo[C]]);u+=3*D;for(var ae=[v,b],M=0;2>M;++M){var N=ae[M];for(C=0;N.length>C;++C)To(t,u,j[oe=31&N[C]]),u+=T[oe],oe>15&&(To(t,u,N[C]>>>5&127),u+=N[C]>>>12)}}else te=xo,O=yo,ne=So,re=bo;for(C=0;s>C;++C)if(r[C]>255){var oe;Eo(t,u,te[257+(oe=r[C]>>>18&31)]),u+=O[oe+257],oe>7&&(To(t,u,r[C]>>>23&31),u+=co[oe]);var se=31&r[C];Eo(t,u,ne[se]),u+=re[se],se>3&&(Eo(t,u,r[C]>>>5&8191),u+=lo[se])}else Eo(t,u,te[r[C]]),u+=O[r[C]];return Eo(t,u,te[256]),u+O[256]},No=new so([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Po=function(){for(var e=new so(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Fo=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Io(e,t){t===void 0&&(t={});var n=function(){var e=4294967295;return{p(t){for(var n=e,r=0;t.length>r;++r)n=Po[255&n^t[r]]^n>>>8;e=n},d(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,a,o,s,c,l=(s=10+((i=t).filename&&i.filename.length+1||0),c=8,function(e,t,n,r,i,a){var o=e.length,s=new oo(r+o+5*(1+Math.floor(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=jo(c,l,e.subarray(u,d)):(c[u]=!0,l=jo(c,l,e.subarray(u,o)))}else{for(var f=No[t-1],p=f>>>13,m=8191&f,h=(1<<n)-1,g=new X(32768),_=new X(h+1),v=Math.ceil(n/3),ee=2*v,y=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<ee)&h},b=new so(25e3),x=new X(288),S=new X(32),C=0,w=0,T=(u=0,0),E=0,D=0;o>u;++u){var te=y(u),O=32767&u,ne=_[te];if(g[O]=ne,_[te]=O,u>=E){var re=o-u;if((C>7e3||T>24576)&&re>423){l=Mo(e,c,0,b,x,S,w,T,D,u-D,l),T=C=w=0,D=u;for(var k=0;286>k;++k)x[k]=0;for(k=0;30>k;++k)S[k]=0}var A=2,ie=0,j=m,ae=O-ne&32767;if(re>2&&te==y(u-ae))for(var M=Math.min(p,re)-1,N=Math.min(32767,u),oe=Math.min(258,re);N>=ae&&--j&&O!=ne;){if(e[u+A]==e[u+A-ae]){for(var se=0;oe>se&&e[u+se]==e[u+se-ae];++se);if(se>A){if(A=se,ie=ae,se>M)break;var ce=Math.min(ae,se-2),le=0;for(k=0;ce>k;++k){var ue=u-ae+k+32768&32767,de=ue-g[ue]+32768&32767;de>le&&(le=de,ne=ue)}}}ae+=(O=ne)-(ne=g[O])+32768&32767}if(ie){b[T++]=268435456|mo[A]<<18|ho[ie];var fe=31&mo[A],pe=31&ho[ie];w+=co[fe]+lo[pe],++x[257+fe],++S[pe],E=u+A,++C}else b[T++]=e[u],++x[e[u]]}}l=Mo(e,c,!0,b,x,S,w,T,D,u-D,l)}return wo(s,0,r+Co(l)+i)}(a=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+o.mem,s,c)),u=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Fo(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),Fo(l,u-8,n.d()),Fo(l,u-4,r),l}var Lo=!!O||!!te,Ro=`text/plain`,zo=!1,Bo=(e,t)=>{var[n,r]=e.split(`#`),[i,a]=n.split(`?`);if(!a)return e;var o=a.split(`&`).filter((e=>e.split(`=`)[0]!==t)).join(`&`);return i+(o?`?`+o:``)+(r?`#`+r:``)},Vo=function(e,t,n){n===void 0&&(n=!0);var[r,i]=e.split(`?`),a=N({},t),o=i?.split(`&`).map((e=>{var t,[r,i]=e.split(`=`),o=n&&(t=a[r])!=null?t:i;return delete a[r],r+`=`+o}))??[],s=function(e,t){var n,r;t===void 0&&(t=`&`);var i=[];return G(e,(function(e,t){L(e)||L(t)||t===`undefined`||(n=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+`=`+n)})),i.join(t)}(a);return s&&o.push(s),r+`?`+o.join(`&`)},Ho=(e,t)=>JSON.stringify(e,((e,t)=>
1typeof t==`bigint`?t.toString():t),t),Uo=e=>{if(e.xt)return e.xt;var{data:t,compression:n}=e;if(t){if(n===ao.GZipJS){var r=Io(function(e,t){var n=e.length;if(typeof TextEncoder<`u`)return new TextEncoder().encode(e);for(var r=new oo(e.length+(e.length>>>1)),i=0,a=function(e){r[i++]=e},o=0;n>o;++o){if(i+5>r.length){var s=new oo(i+8+(n-o<<1));s.set(r),r=s}var c=e.charCodeAt(o);128>c?a(c):2048>c?(a(192|c>>>6),a(128|63&c)):c>55295&&57344>c?(a(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++o))>>>18),a(128|c>>>12&63),a(128|c>>>6&63),a(128|63&c)):(a(224|c>>>12),a(128|c>>>6&63),a(128|63&c))}return wo(r,0,i)}(Ho(t)),{mtime:0});return{contentType:Ro,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===ao.Base64){var i=(e=>`data=`+encodeURIComponent(typeof e==`string`?e:Ho(e)))(function(e){return e&&btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16)))))}(Ho(t)));return{contentType:`application/x-www-form-urlencoded`,body:i,estimatedSize:new Blob([i]).size}}var a=Ho(t);return{contentType:`application/json`,body:a,estimatedSize:new Blob([a]).size}}},Wo=e=>{var t,n,r=()=>({url:Bo(e.url,`compression`),encodedBody:Uo(N({},e,{compression:void 0,xt:void 0}))});try{t=Uo(e)}catch(t){if(_e(e.compression,Ta(e.url,`compression`)))return U.error(`Failed to gzip request body, sending uncompressed payload`,t),r();throw t}return t&&_e(e.compression,Ta(e.url,`compression`))&&!((n=t.body)instanceof ArrayBuffer?ge(new Uint8Array(n)):ArrayBuffer.isView(n)&&ge(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(zo=!0,r()):{url:e.url,encodedBody:t}},Go=e=>{try{return Wo(e)}catch(t){U.error(t),e.callback==null||e.callback({statusCode:0,error:t});return}},Ko=function(){var e=M((function*(e){var t=yield function(e,t,n){return xe.apply(this,arguments)}(Ho(e.data),j.DEBUG,{rethrow:!0});if(!t)return e;var n=yield t.arrayBuffer();return N({},e,{xt:{contentType:Ro,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),qo=(e,t)=>Vo(e,{_:new Date().getTime().toString(),ver:j.JS_SDK_VERSION,compression:t}),Jo=[];te&&Jo.push({transport:`fetch`,method(e){var t=Go(e);if(t){var{url:n,encodedBody:r}=t,{contentType:i,body:a,estimatedSize:o}=r??{},s=new Headers;G(e.headers,(function(e,t){s.append(t,e)})),i&&s.append(`Content-Type`,i);var c=null,l=null;if(ne){var u=new ne;c={signal:u.signal,timeout:setTimeout((()=>{var t=e.timeout,n;(n=Error(`PostHog request timed out`+(t?` after `+t+`ms`:``))).name=`AbortError`,u.abort(l=n)}),e.timeout)}}te(n,N({method:e?.method||`GET`,headers:s,keepalive:e.method===`POST`&&52428.8>(o||0),body:a,signal:c?.signal},e.fetchOptions)).then((t=>t.text().then((n=>{var r={statusCode:t.status,text:n};if(t.status===200)try{r.json=JSON.parse(n)}catch(e){U.error(e)}e.callback==null||e.callback(r)})))).catch((t=>{t===l?U.warn(t):U.error(t),e.callback==null||e.callback({statusCode:0,error:t})})).finally((()=>c?clearTimeout(c.timeout):null))}}}),O&&Jo.push({transport:`XHR`,method(e){var t=Go(e);if(t){var n=new O,{url:r,encodedBody:i}=t;n.open(e.method||`GET`,r,!0);var{contentType:a,body:o}=i??{};G(e.headers,(function(e,t){n.setRequestHeader(t,e)})),a&&n.setRequestHeader(`Content-Type`,a),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var t={statusCode:n.status,text:n.responseText};if(n.status===200)try{t.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(t)}},n.send(o)}}}),T!=null&&T.sendBeacon&&Jo.push({transport:`sendBeacon`,method(e){try{var{url:t,encodedBody:n}=Wo(e),{contentType:r,body:i}=n??{};if(!i)return;var a=i instanceof Blob?i:new Blob([i],{type:r});T.sendBeacon(t,a)}catch{}}});var Yo=3e3,Xo=class{constructor(e,t){this.br=!0,this._r=[],this.wr=Ue(t?.flush_interval_ms||Yo,250,5e3,U.createLogger(`flush interval`),Yo),this.kr=e}enqueue(e){this._r.push(e),this.Sr||this.Cr()}unload(){this.Ir();var e=this._r.length>0?this.Tr():{},t=Object.values(e);[...t.filter((e=>e.url.indexOf(`/e`)===0)),...t.filter((e=>e.url.indexOf(`/e`)!==0))].map((e=>{this.Er(N({},e,{transport:`sendBeacon`}))}))}enable(){this.br=!1,this.Cr()}Cr(){var e=this;this.br||(this.Sr=setTimeout((()=>
1{if(this.Ir(),this._r.length>0){var t=this.Tr(),n=function(){var n=t[r],i=new Date().getTime();n.data&&F(n.data)&&G(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.Er(n)};for(var r in t)n()}}),this.wr))}Er(e){try{this.kr(e)}catch(e){U.error(e)}}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var e={};return G(this._r,(t=>{var n,r=t,i=(r?r.batchKey:null)||r.url;L(e[i])&&(e[i]=N({},r,{data:[]})),(n=e[i].data)==null||n.push(r.data)})),this._r=[],e}},Zo=[`retriesPerformedSoFar`],Qo=class{constructor(e){this.Mr=!1,this.Pr=3e3,this._r=[],this._instance=e,this._r=[],this.Rr=!0,!L(C)&&`onLine`in C.navigator&&(this.Rr=C.navigator.onLine,this.Or=()=>{this.Rr=!0,this.Lr()},this.Fr=()=>{this.Rr=!1},q(C,`online`,this.Or),q(C,`offline`,this.Fr))}get length(){return this._r.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=oe(e,Zo);Me(t)&&(n.url=Vo(n.url,{retry_count:t})),this._instance._send_request(N({},n,{callback:e=>{if(e.statusCode!==200&&(400>e.statusCode||e.statusCode>=500)){if((e.statusCode===0?3:10)>(t??0))return void this.st(N({retriesPerformedSoFar:t},n));e.statusCode===0&&U.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after `+(t??0)+` retries.`)}n.callback==null||n.callback(e)}}))}st(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*2**e,n=t/2,r=Math.min(18e5,t),i=Math.random()-.5;return Math.ceil(r+i*(r-n))}(t),r=Date.now()+n;this._r.push({retryAt:r,requestOptions:e});var i=`Enqueued failed request for retry in `+n;navigator.onLine||(i+=` (Browser is offline)`),U.warn(i),this.Mr||(this.Mr=!0,this.Ar())}Ar(){if(this.$r&&clearTimeout(this.$r),this._r.length===0)return this.Mr=!1,void(this.$r=void 0);this.$r=setTimeout((()=>{this.Rr&&this._r.length>0&&this.Lr(),this.Ar()}),this.Pr)}Lr(){var e=Date.now(),t=[],n=this._r.filter((n=>e>n.retryAt||(t.push(n),!1)));if(this._r=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$r&&=(clearTimeout(this.$r),void 0),this.Mr=!1,L(C)||(this.Or&&=(C.removeEventListener(`online`,this.Or),void 0),this.Fr&&=(C.removeEventListener(`offline`,this.Fr),void 0)),this._r))try{this._instance._send_request(N({},e,{transport:`sendBeacon`}))}catch(e){U.error(e)}this._r=[]}},$o=class{constructor(e){this.Dr=()=>{this.Nr||={};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.Nr.lastScrollY=Math.ceil(t),this.Nr.maxScrollY=Math.max(t,this.Nr.maxScrollY??0),this.Nr.maxScrollHeight=Math.max(n,this.Nr.maxScrollHeight??0),this.Nr.lastContentY=r,this.Nr.maxContentY=Math.max(r,this.Nr.maxContentY??0),this.Nr.maxContentHeight=Math.max(i,this.Nr.maxContentHeight??0)},this._instance=e}get qr(){return this._instance.config.scroll_root_selector}getContext(){return this.Nr}resetContext(){var e=this.Nr;return setTimeout(this.Dr,0),e}startMeasuringScrollPosition(){q(C,`scroll`,this.Dr,{capture:!0}),q(C,`scrollend`,this.Dr,{capture:!0}),q(C,`resize`,this.Dr)}scrollElement(){if(!this.qr)return C?.document.documentElement;for(var e of F(this.qr)?this.qr:[this.qr]){var t=C?.document.querySelector(e);if(t)return t}}jr(e){var t=e===`y`?`scrollTop`:`scrollLeft`;if(this.qr){var n=this.scrollElement();return n&&n[t]||0}return C?e===`y`?C.scrollY||C.pageYOffset||C.document.documentElement.scrollTop||0:C.scrollX||C.pageXOffset||C.document.documentElement.scrollLeft||0:0}scrollY(){return this.jr(`y`)}scrollX(){return this.jr(`x`)}},es=e=>za(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties,e?.config.disable_capture_url_hashes),ts=class{constructor(e,t,n,r){this.Br=e=>{var t=this.Hr();if(!t||t.sessionId!==e){var n={sessionId:e,props:this.Ur(this._instance)};this.zr.register({[Mr]:n})}},this._instance=e,this.Vr=t,this.zr=n,this.Ur=r||es,this.Vr.onSessionId(this.Br)}Hr(){return this.zr.props[Mr]}getSetOnceProps(){var e=this.Hr()?.props;return e?`r`in e?Ba(e,this._instance.config.disable_capture_url_hashes
1):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var e={};return G(ai(this.getSetOnceProps()),((t,n)=>{n===`$current_url`&&(n=`url`),e[`$session_entry_`+Te(n)]=t})),e}},ns=class{constructor(){this.Wr={}}on(e,t){return this.Wr[e]||(this.Wr[e]=[]),this.Wr[e].push(t),()=>{this.Wr[e]=this.Wr[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.Wr[e]||[])n(t);for(var r of this.Wr[`*`]||[])r(e,t)}},rs=W(`[SessionId]`),is=class{on(e,t){return this.Gr.on(e,t)}constructor(e,t,n){var r;if(this.Zr=null,this.Qr=[],this.Jr=void 0,this.Yr=!1,this.Gr=new ns,this.Kr=(e,t)=>!(!Me(e)||!Me(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error(`SessionIdManager requires a PostHogPersistence instance`);if(e.config.cookieless_mode===Gr)throw Error(`SessionIdManager cannot be used with cookieless_mode="always"`);this.Se=e.config,this.zr=e.persistence,this.Xr=void 0,this.ei=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ti=t||mi,this.ri=n||mi;var i=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*Ue(this.Se.session_idle_timeout_seconds||1800,60,36e3,rs.createLogger(`session_idle_timeout_seconds`),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ii(),this.ni=`ph_`+i+`_window_id`,this.si=`ph_`+i+`_primary_window_exists`,this.oi()){var a=Y.F(this.ni),o=Y.F(this.si);a&&!o?this.Xr=a:Y.P(this.ni),Y.q(this.si,!0)}if((r=this.Se.bootstrap)!=null&&r.sessionID)try{var s=(e=>{var t=this.Se.bootstrap.sessionID.replace(/-/g,``);if(t.length!==32)throw Error(`Not a valid UUID`);if(t[12]!==`7`)throw Error(`Not a UUIDv7`);return parseInt(t.substring(0,12),16)})();this.ai(this.Se.bootstrap.sessionID,new Date().getTime(),s)}catch(e){rs.error(`Invalid sessionID in bootstrap`,e)}this.li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return L(this.Qr)&&(this.Qr=[]),this.Qr.push(e),this.ei&&e(this.ei,this.Xr),()=>{this.Qr=this.Qr.filter((t=>t!==e))}}oi(){return this.Se.persistence!==`memory`&&!this.zr.Vt&&Y.N()}ui(e){e!==this.Xr&&(this.Xr=e,this.oi()&&Y.q(this.ni,e))}hi(){return this.Xr?this.Xr:this.oi()?Y.F(this.ni):null}di(e){var t=this.Zr;return!z(t)&&!z(e)&&5e3>Math.abs(e-t)}ai(e,t,n){var r=t!==this._sessionActivityTimestamp,i=!(e!==this.ei||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.ei=e,i&&!r||i&&this.di(t)||(this.Zr=t,this.zr.register({[dr]:[t,e,n]}))}ci(){var e=this.Se?.persistence_save_debounce_ms;return Me(e)&&e>0}vi(){this.ci()?this.zr.refreshKey(dr):(this.zr.flush(),this.zr.load())}fi(){if(!z(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Zr){this.vi();var[,e,t]=this.pi();e===this.ei&&t===this._sessionStartTimestamp&&(this.Zr=this._sessionActivityTimestamp,this.zr.register({[dr]:[this._sessionActivityTimestamp,this.ei??null,this._sessionStartTimestamp]}),this.zr.flush())}}gi(){var[e]=this.pi(),t=Me(e)?e:0,n=Me(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)}mi(e){return this.vi(),this.Kr(e,this.gi())}pi(){var e=this.zr.props[dr];return F(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Zr=null,clearTimeout(this.yi),this.yi=void 0,this.ai(null,null,null)}destroy(){this.Yr=!0,this.fi(),clearTimeout(this.yi),this.yi=void 0,this.Jr&&C&&(C.removeEventListener(Xr,this.Jr,{capture:!1}),this.Jr=void 0),this.Qr=[]}li(){this.Jr=()=>{this.fi(),this.oi()&&Y.P(this.si)},q(C,Xr,this.Jr,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.Se.cookieless_mode===Gr)throw Error(`checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"`);var n=t||new Date().getTime(),[,r,i]=this.pi(),a=this.gi(),o=this.hi(),s=Me(i)&&Math.abs(n-i)>864e5,c=!1,l=!1,u=!r,d=r,f=!u&&!e&&this.Kr(n,a);f&&((f=this.mi(n))||rs.info(`cross-tab refresh kept the session alive`,{sessionId:r}),[,r,i]=this.pi()),u||f||s?(r=this.ti(),o=this.ri(),rs.info(`new session ID generated`,{sessionId:r,windowId:o,changeReason:{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:s}}),i=n,c=!0):(o||(o=this.ri(),c=!0),(l=r!==d)&&(rs.info(`adopted cross-tab session id`,{sessionId:r,windowId:o}),c=!0));var p=Me(a)&&e&&!s?a:n,m=Me(i)?i:new Date().getTime();this.ui(o),this.ai(r,p,m),e||this.ii();var h={noSessionId:u,activityTimeout:f,sessionPastMaximumLength:s,crossTabAdoption:l};return c&&this.Qr.forEach((e=>e(r,o,h))),{sessionId:r,windowId:o,sessionStartTimestamp:m,changeReason:c?h:void 0,lastActivityTimestamp:a}}ii(){this.Yr||(clearTimeout(this.yi),this.yi=setTimeout((()=>
1{if(!this.Yr)if(this.mi(new Date().getTime())){var e=this.ei;this.resetSessionId(),this.Gr.emit(`forcedIdleReset`,{idleSessionId:e})}else this.ii()}),1.1*this.sessionTimeoutMs))}},as=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&Ce(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((e=>Ce(e?.brand,t))))return!0}catch{}return!!e.webdriver};function os(){return(os=M((function*(){var e=T?.userAgentData;if(e!=null&&e.getHighEntropyValues)try{var t=(yield e.getHighEntropyValues([`model`]))?.model;return R(t)&&t.length>0?t:void 0}catch(e){U.info(`Unable to resolve $device_model from userAgentData.getHighEntropyValues`,e);return}}))).apply(this,arguments)}var ss=function(e,t){if(!function(e){try{new RegExp(e)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function cs(e,t,n){return Ho({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var ls={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>ss(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!ss(t,e))))),icontains:(e,t)=>t.map(us).some((t=>e.map(us).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(us).every((t=>e.map(us).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n<parseFloat(e)))}))},us=e=>e.toLowerCase();function ds(e,t){return!e||Object.entries(e).every((e=>{var[n,r]=e,i=t?.[n];if(L(i)||z(i))return!1;var a=[String(i)],o=ls[r.operator];return!!o&&o(r.values,a)}))}var fs=`custom`,ps=`i.posthog.com`,ms=/^\/static\//,hs=class{constructor(e){this.bi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,``);return e===`https://app.posthog.com`?`https://us.i.posthog.com`:e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,``):this.apiHost}get uiHost(){var e=this.instance.config.ui_host?.replace(/\/$/,``);return e||=this.apiHost.replace(`.`+ps,`.posthog.com`),e===`https://app.posthog.com`?`https://us.posthog.com`:e}get region(){return this.bi[this.apiHost]||(this.bi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`us`:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`eu`:fs),this.bi[this.apiHost]}wi(e){if(ms.test(e)){var t=this.instance.config.asset_host;if(typeof t==`string`)return t.trim().replace(/\/$/,``)||void 0}}endpointFor(e,t){if(t===void 0&&(t=``),t&&=t[0]===`/`?t:`/`+t,e===`ui`)return this.uiHost+t;if(e===`flags`)return this.flagsApiHost+t;if(e===`assets`){var n=this.wi(t);if(n)return``+n+t}if(this.region===fs)return this.apiHost+t;var r=ps+t;switch(e){case`assets`:return`https://`+this.region+`-assets.`+r;case`api`:return`https://`+this.region+`.`+r}}},Q=W(`[Surveys]`),gs=`seenSurvey_`,_s=[Ja.Popover,Ja.Widget,Ja.API],vs={ignoreConditions:!1,ignoreDelay:!1,displayType:Qa.Popover},ys=W(`[PostHog ExternalIntegrations]`),bs={intercom:`intercom-integration`,crispChat:`crisp-chat-integration`},xs=class{constructor(e){this._instance=e}Mt(e,t){var n;(n=A.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(e=>{if(e)return ys.error(`failed to load script`,e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var n,i,a;!r||(n=A.__PosthogExtensions__)!=null&&(n=n.integrations)!=null&&n[t]||e.Mt(bs[t],(()=>{var n;(n=A.__PosthogExtensions__)==null||(n=n.integrations)==null||(n=n[t])==null||n.start(e._instance)})),!r&&(i=A.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[t]&&((a=A.__PosthogExtensions__)==null||(a=a.integrations)==null||(a=a[t])==null||a.stop())};for(var[n,r]of Object.entries((i=this._instance.config.integrations)??{})){var i;t(n)}}},Ss,Cs={},ws=0,Ts=()=>{},Es=`Consent opt in/out is not valid with cookieless_mode="always" and will be ignored`,Ds=`Surveys module not available`,Os=`sanitize_properties is deprecated. Use before_send instead`,ks=`Invalid value for property_denylist config: `,As=`posthog`,js=!Lo&&k?.indexOf(`MSIE`)===-1&&k?.indexOf(`Mozilla`)===-1,Ms=e=>{var t;return N({api_host:`https://us.i.posthog.com`,flags_api_host:null,ui_host:null,asset_host:null,token:``,autocapture:!0,cross_subdomain_cookie:si(E?.location),persistence:`localStorage+cookie`,persistence_name:``,cookie_persisted_properties:[],loaded:Ts,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:`if_capture_pageview`,defaults:e??`unset`,__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:D&&R(D?.search)&&D.search.indexOf(`__posthog_debug=true`)!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(C==null||(t=C.location)==null?void 0:t.protocol)===`https:`,ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:`localStorage`,consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){U.error(`Bad HTTP status: `+e.statusCode+` `+e.text)},get_device_id:e=>e,capture_performance:void 0,name:`posthog`,bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Jr,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Yo},error_tracking:{},_onCapture:Ts},(e=>({rageclick:e&&e>=`2026-05-30`?{content_ignorelist:Gi,ignore_text_selection:!0}
1:!e||`2025-11-30`>e||{content_ignorelist:!0},capture_pageview:!e||`2025-05-24`>e||`history_change`,session_recording:e&&e>=`2026-06-25`?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>=`2026-05-30`?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>=`2025-11-30`?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>=`2026-01-30`?`head`:`body`,internal_or_test_user_hostname:e&&e>=`2026-01-30`?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>=`2026-05-30`?250:0,split_storage:!(!e||`2026-05-30`>e),detect_google_search_app:!(!e||`2026-05-30`>e),disable_capture_url_hashes:!(!e||`2026-06-25`>e)}))(e))},Ns=[[`process_person`,`person_profiles`],[`xhr_headers`,`request_headers`],[`cookie_name`,`persistence_name`],[`disable_cookie`,`disable_persistence`],[`__preview_disable_beacon`,`disable_beacon`],[`store_google`,`save_campaign_params`],[`verbose`,`debug`]],Ps=e=>{var t={};for(var[n,r]of Ns)L(e[n])||(t[r]=e[n]);var i=K({},t,e),a=e.__preview_external_dependency_versioned_paths;return L(a)||(L(e.strict_script_versioning)&&(i.strict_script_versioning=!!a),R(a)&&L(e.asset_host)&&(i.asset_host=a)),F(e.property_blacklist)&&(L(e.property_denylist)?i.property_denylist=e.property_blacklist:F(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:U.error(ks+e.property_denylist)),i},Fs=class{constructor(){this.__forceAllowLocalhost=!1}get xi(){return this.__forceAllowLocalhost}set xi(e){U.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Is=class e{ki(e,t){if(e){var n=this.Si.indexOf(e);n!==-1&&this.Si.splice(n,1)}return this.Si.push(t),t.initialize==null||t.initialize(),t}Ci(){return this.config.cookieless_mode===Gr||this.config.cookieless_mode===Wr&&this.consent.isRejected()}get decideEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}get flagsEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}constructor(){this.webPerformance=new Fs,this.Ii=!1,this.version=j.LIB_VERSION,this.Ti=new ns,this.Si=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Ms(),this.SentryIntegration=va,this.sentryIntegration=e=>function(e,t){var n=_a(e,t);return{name:ga,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint=`/e/`,this.Ei=!1,this.Mi=null,this.Pi=null,this.Ri=null,this.scrollManager=new $o(this),this.pageViewManager=new ya(this),this.rateLimiter=new no(this),this.requestRouter=new hs(this),this.consent=new wi(this),this.externalIntegrations=new xs(this);var t=e.__defaultExtensionClasses??{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,n)=>{var r=R(e)?{[e]:t}:e;this.setPersonProperties(r),n?.({})},set_once:(e,t,n)=>{var r=R(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on(`eventCaptured`,(e=>U.info(`send "`+e?.event+`"`,e)))}init(t,n,r){if(r&&r!==As){var i=Cs[r]??new e;return i._init(t,n,r),Cs[r]=i,Cs[As][r]=i,i}return this._init(t,n,r)}_init(e,t,n){var r;t===void 0&&(t={});var i=R(e)?e.trim():``;if(!i)return U.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 console.warn(`[PostHog.js]`,`You have already initialized PostHog! Re-initializing is a no-op`),this;this.__loaded=!0,this.config={},t.debug=this.Oi(t.debug),this.Li=t,this.Fi=[],t.person_profiles?this.Pi=t.person_profiles:t.process_person&&(this.Pi=t.process_person);var a=Ms(t.defaults),o=Ps(t),s=K({},a,o,{name:n,token:i});I(a.rageclick)&&I(o.rageclick)&&(s.rageclick=K({},a.rageclick,o.rageclick)),I(a.session_recording)&&I(o.session_recording)&&(s.session_recording=K({},a.session_recording,o.session_recording)),this.set_config(s),this.config.on_xhr_error&&U.error(`on_xhr_error is deprecated. Use on_request_error instead`),this.compression=t.disable_compression?void 0:ao.GZipJS;var c=this.Ai();this.persistence=new Ka(this.config,c),this.sessionPersistence=this.config.persistence===`
1sessionStorage`||this.config.persistence===`memory`?this.persistence:new Ka(N({},this.config,{persistence:`sessionStorage`}),c,!1);var l=N({},this.persistence.props),u=N({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.$i=new Xo((e=>this.Di(e)),this.config.request_queue_config),this.Ni=new Qo(this),this.__request_queue=[];var d=this.Ci();if(d||(this.sessionManager=new is(this),this.sessionPropsManager=new ts(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(U.info(`Deferring extension initialization to improve startup performance`),setTimeout((()=>{this.qi(d)}),0)):(U.info(`Initializing extensions synchronously`),this.qi(d)),j.DEBUG=j.DEBUG||this.config.debug,j.DEBUG&&U.info(`Starting in debug mode`,{this:this,config:t,thisC:N({},this.config),p:l,s:u}),!this.config.identity_distinct_id||(r=t.bootstrap)!=null&&r.distinctID||(t.bootstrap=N({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),t.bootstrap?.distinctID!==void 0){var f=t.bootstrap.distinctID,p=this.get_distinct_id(),m=this.persistence.get_property(jr);if(t.bootstrap.isIdentifiedID&&p!=null&&p!==f&&m===Kr)this.identify(f);else if(t.bootstrap.isIdentifiedID&&p!=null&&p!==f&&m===qr)U.warn(`Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.`);else{var h=this.config.get_device_id(mi()),g=t.bootstrap.isIdentifiedID?h:f;this.persistence.set_property(jr,t.bootstrap.isIdentifiedID?qr:Kr),this.register({distinct_id:f,$device_id:g})}}if(d)this.register_once({distinct_id:zr,$device_id:null},``);else if(!this.get_distinct_id()){var _=this.config.get_device_id(mi());this.register_once({distinct_id:_,$device_id:_},``),this.persistence.set_property(jr,Kr)}return q(C,`onpagehide`in self?`pagehide`:`unload`,this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var n=e.config.segment;if(!n)return t();(function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||mi();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(jr,qr)),t()},i=n.user();`then`in i&&ke(i.then)?i.then(r):r(i)})(e,(()=>{n.register((e=>{typeof Promise<`u`&&Promise.resolve||ha.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()||(ha.info(`No userId set, resetting PostHog`),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(ha.info(`UserId set, identifying with PostHog`),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:`PostHog JS`,type:`enrichment`,version:`1.0.0`,isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,Zr),identify:e=>t(e,$r),screen:e=>t(e,`$screen`)}})(e)).then((()=>{t()}))}))}(this,(()=>this.ji())):this.ji(),ke(this.config._onCapture)&&this.config._onCapture!==Ts&&(U.warn("onCapture is deprecated. Please use `before_send` instead"),this.on(`eventCaptured`,(e=>this.config._onCapture(e.event,e)))),this.config.ip&&U.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return os.apply(this,arguments)}().then((e=>{e&&this.register({[qn]:e})})).catch(Ts),this}qi(t){var n=performance.now(),r=N({},e.__defaultExtensionClasses,this.config.__extensionClasses),i=[];r.featureFlags&&this.Si.push(this.featureFlags=this.featureFlags??new r.featureFlags(this)),r.exceptions&&this.Si.push(this.exceptions=this.exceptions??new r.exceptions(this)),r.historyAutocapture&&this.Si.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.Si.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.Si.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!t&&this.Si.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.autocapture&&this.Si.push(this.autocapture=new r.autocapture(this)),r.surveys&&this.Si.push(this.surveys=this.surveys??new r.surveys(this)),r.logs&&this.Si.push(this.logs=this.logs??new r.logs(this)),r.conversations&&this.Si.push(this.conversations=this.conversations??new r.conversations(this)),r.productTours&&this.Si.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.Si.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.Si.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.Si.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.Si.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,pa)),r.toolbar&&this.Si.push(this.toolbar=this.toolbar??new r.toolbar(this)),r.experiments&&this.Si.push(this.experiments=this.experiments??new r.experiments(this)),this.Si.forEach((e=>{e.initialize&&i.push((()=>{e.initialize==null||e.initialize()}))})),i.push((()=>
1{if(this.Bi){var e=this.Bi;this.Bi=void 0,this.pr(e)}})),this.Hi(i,n)}Hi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Hi(e,t)}),0);var n=e.shift();if(n)try{n()}catch(e){U.error(`Error initializing extension:`,e)}}var r=Math.round(performance.now()-t);this.register_for_session({[Br]:this.config.__preview_deferred_init_extensions?`deferred`:`synchronous`,[Vr]:r}),this.config.__preview_deferred_init_extensions&&U.info(`PostHog extensions initialized (`+r+`ms)`)}pr(e){var t;if(!E||!E.body)return U.info(`document not ready yet, trying again in 500 milliseconds...`),void setTimeout((()=>{this.pr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Bi=e),this.Ui=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=P(e.supportedCompression,ao.GZipJS)?ao.GZipJS:P(e.supportedCompression,ao.Base64)?ao.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pi?this.Pi:Jr}),this.Si.forEach((t=>t.onRemoteConfig==null?void 0:t.onRemoteConfig(e)))}ji(){try{this.config.loaded(this)}catch(e){U.critical("`loaded` function failed",e)}if(this.zi(),this.config.internal_or_test_user_hostname&&D!=null&&D.hostname){var e=D.hostname,t=this.config.internal_or_test_user_hostname;(typeof t==`string`?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ci())&&this.Vi()}),1),this.Wi=new io(this),this.Wi.load()}zi(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.$i)==null||e.enable())}_dom_loaded(){this.is_capturing()&&ti(this.__request_queue,(e=>this.Di(e))),this.__request_queue=[],this.zi()}_handle_unload(){var e,t,n,r;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),this.config.request_batching?(this.Gi()&&this.capture(Qr),(t=this.logs)==null||t.flushLogs(`sendBeacon`),(n=this.$i)==null||n.unload(),(r=this.Ni)==null||r.unload()):this.Gi()&&this.capture(Qr,null,{transport:`sendBeacon`})}_send_request(e){this.__loaded?js?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=N({},this.config.request_headers,e.headers),e.compression=e.compression===`best-available`?this.compression:e.compression,(L(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=[`sendBeacon`]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t=N({},e);t.timeout=t.timeout||6e4,t.url=qo(t.url,t.compression);var n=t.transport??`fetch`,r=Jo.filter((e=>!t.disableTransport||!e.transport||!t.disableTransport.includes(e.transport))),i=function(e,t){for(var r=0;e.length>r;r++)if(e[r].transport===n)return e[r]}(r)?.method??r[0].method;if(!i)throw Error(`No available transport method`);n!==`sendBeacon`&&t.data&&t.compression===ao.GZipJS&&re&&typeof Promise<`u`&&!zo?Ko(t).then((e=>{i(e)})).catch((n=>{if(ve(n))return zo=!0,void i(N({},t,{compression:void 0,url:qo(e.url,void 0)}));(e=>{if(!e||typeof e!=`object`)return!1;var t=`name`in e?String(e.name):``;return ve(e)||t===he})(n)&&(zo=!0),i(t)})):i(t)})(N({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(n=(r=this.config).on_request_error)==null||n.call(r,t),e.callback==null||e.callback(t)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}Di(e){this.Ni?this.Ni.retriableRequest(e):this._send_request(e)}_execute_array(e){ws++;try{var t,n=[],r=[],i=[];ti(e,(e=>{if(e)if(F(t=e[0]))i.push(e);else if(ke(e))try{e.call(this)}catch(t){U.error(`Error executing queued PostHog call`,e,t)}else F(e)&&t===`alias`?n.push(e):F(e)&&t.indexOf(`capture`)!==-1&&ke(this[t])?i.push(e):r.push(e)}));var a=function(e,t){ti(e,(function(e){try{if(F(e[0])){var n=t;G(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){U.error(`Error executing queued PostHog call`,e,t)}}))};a(n,this),a(r,this),a(i,this)}finally{ws--}}push(t){if(ws>0&&F(t)&&R(t[0])){var n=e.prototype[t[0]];ke(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(e,t,n){var r,i,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!L(e)&&R(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!s||this.config.__preview_capture_bot_pageviews){var c=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){t!=null&&t.$current_url&&!R(t?.$current_url)&&(U.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),e!==`$exception`||n!=null&&n.Zi||U.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,u=n?.timestamp||l,d=Yt(n?.uuid,mi),f={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},u,d)};e===Zr&&this.config.__preview_capture_bot_pageviews&&s&&(f.event=`$bot_pageview`,f.properties.$browser_type=`bot`),c&&(f.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),n!=null&&n.$set&&(f.$set=n?.$set);var p=n?.$unset;p&&(f.$unset=p);var m,h,g,_=this.Qi(n?.$set_once,e!==ei,e===$r);if(_&&(f.$set_once=_),n!=null&&n._noTruncate||(r=this.config.properties_string_max_length,i=f,a=e=>R(e)?e.slice(0,r):e,o=new Set,f=function e(t,n){return t===Object(t)?o.has(t)?void 0:(o.add(t),F(t)?(r=[],ti(t,(t=>{r.push(e(t))}))):(r={}
1,G(t,((t,n)=>{o.has(t)||(r[n]=e(t,n))}))),r):a?a(t):t;var r}(i)),f.timestamp=u,L(n?.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=l),e===Xa.DISMISSED||e===Xa.SENT){var v=t?.[Za.SURVEY_ID],ee=t?.[Za.SURVEY_ITERATION];(e=>{try{var t=(e=>((e,t)=>{var n=``+gs+t.id;return t.current_iteration&&t.current_iteration>0&&(n=``+gs+t.id+`_`+t.current_iteration),n})(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,`true`)}catch(e){Q.error(`Failed to persist survey seen state`,e)}})({id:v,current_iteration:ee}),f.$set=N({},f.$set,{[(m={id:v,current_iteration:ee},h=e===Xa.SENT?`responded`:`dismissed`,g=`$survey_`+h+`/`+m.id,m.current_iteration&&m.current_iteration>0&&(g=`$survey_`+h+`/`+m.id+`/`+m.current_iteration),g)]:!0})}else e===Xa.SHOWN&&(f.$set=N({},f.$set,{[Za.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===$a.SHOWN){var y=t?.[eo.TOUR_TYPE];y&&(f.$set=N({},f.$set,{[eo.TOUR_LAST_SEEN_DATE+`/`+y]:new Date().toISOString()}))}var b=N({},f.properties.$set,f.$set);if(Ae(b)||this.setPersonPropertiesForFlags(b),!B(this.config.before_send)){var x=this.it(f);if(!x)return;(f=x).uuid=Yt(f.uuid,mi)}this.Ti.emit(`eventCaptured`,f);var S={method:`POST`,url:n?._url??this.requestRouter.endpointFor(`api`,this.analyticsDefaultEndpoint),data:f,compression:`best-available`,batchKey:n?._batchKey,transport:n?.transport};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Di(S):this.$i.enqueue(S),f}U.critical(`This capture call is ignored due to client rate limiting.`)}}else U.error(`No event name provided to posthog.capture`)}else U.uninitializedWarning(`posthog.capture`)}_addCaptureHook(e){return this.on(`eventCaptured`,(t=>e(t.event,t)))}calculateEventProperties(e,t,n,r,i){if(n||=new Date,!this.persistence||!this.sessionPersistence)return t;var a=i?void 0:this.persistence.remove_event_timer(e),o=N({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.Ci()&&(o.$cookieless_mode=!0),e===`$snapshot`){var s=N({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=s.distinct_id,(!R(o.distinct_id)&&!V(o.distinct_id)||je(o.distinct_id))&&U.error(`Invalid distinct_id for replay event. This indicates a bug in your implementation`),o}var c,l=function(e,t,n,r){var i,a,o;if(r===void 0&&(r=!1),!k)return{};var s,c,l,u,d,f=e?[...ka,...t||[]]:[],[p,m]=function(e){for(var t=0;Kt.length>t;t++){var[n,r]=Kt[t],i=n.exec(e),a=i&&(ke(r)?r(i,e):r);if(a)return a}return[``,``]}(k),h=(s=typeof navigator<`u`?navigator:void 0)!=null&&s.brave?{brave:!0}:{},g={detectGoogleSearchApp:n},_=K(ai({$os:p,$os_version:m,$browser:Ut(k,navigator.vendor,h,g),$device:qt(k),$device_type:(l=k,u={userAgentDataPlatform:(i=navigator)==null||(i=i.userAgentData)==null?void 0:i.platform,maxTouchPoints:navigator?.maxTouchPoints,screenWidth:C==null||(a=C.screen)==null?void 0:a.width,screenHeight:C==null||(o=C.screen)==null?void 0:o.height,devicePixelRatio:C?.devicePixelRatio},d=qt(l),d===Xe||d===Ye||d===`Kobo`||d===`Kindle Fire`||d===Et?Je:d===ht||d===_t||d===gt||d===Ct?`Console`:d===Qe?`Wearable`:d?Ge:u?.userAgentDataPlatform===`Android`&&(u?.maxTouchPoints??0)>0?600>Math.min(u?.screenWidth??0,u?.screenHeight??0)/(u?.devicePixelRatio??1)?Ge:Je:`Desktop`),$timezone:Va(),$timezone_offset:Ha()}),{$current_url:Ea(r?Xt(D?.href):D?.href,f,ja),$host:D?.host,$pathname:D?.pathname,$raw_user_agent:k.length>1e3?k.substring(0,997)+`...`:k,$browser_version:Gt(k,navigator.vendor,h,g),$browser_language:Ia(),$browser_language_prefix:(c=Ia(),typeof c==`string`?c.split(`-`)[0]:void 0),$screen_height:C?.screen.height,$screen_width:C?.screen.width,$viewport_height:C?.innerHeight,$viewport_width:C?.innerWidth,$lib:j.LIB_NAME,$lib_version:j.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return j.SDK_DIST_CHANNEL&&(_.$sdk_dist_channel=j.SDK_DIST_CHANNEL),_}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes
1);if(this.sessionManager){var{sessionId:u,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime());o.$session_id=u,o.$window_id=d}this.sessionPropsManager&&K(o,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&K(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=this.Ni?.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===fs&&(o.$lib_custom_api_host=this.config.api_host),c=e!==Zr||i?e!==Qr||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),o=K(o,c),e===Zr&&E&&(o.title=E.title),!L(a)){var f=n.getTime()-a;o.$duration=parseFloat((f/1e3).toFixed(3))}k&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?`bot`:`browser`),(o=K({},l,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),F(this.config.property_denylist)?G(this.config.property_denylist,(function(e){delete o[e]})):U.error(ks+this.config.property_denylist+` or property_blacklist config: `+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(U.error(Os),o=p(o,e));var m=this.Ji();return o.$process_person_profile=m,m&&!i&&this.Yi(`_calculate_event_properties`),o}Qi(e,t,n){if(t===void 0&&(t=!0),n===void 0&&(n=!1),!this.persistence||!this.Ji()||this.Ii&&!n)return e;var r=K({},this.persistence.get_initial_props(),this.sessionPropsManager?.getSetOnceProps()||{},e||{}),i=this.config.sanitize_properties;return i&&(U.error(Os),r=i(r,`$set_once`)),t&&(this.Ii=!0),Ae(r)?void 0:r}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}Ki(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags?.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags?.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags?.getFeatureFlagResult(e,t)}getAllFeatureFlags(){return this.featureFlags?.getAllFeatureFlags()??[]}isFeatureEnabled(e,t){return this.featureFlags?.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,t,n){var r;(r=this.featureFlags)==null||r.updateFlags(e,t,n)}updateEarlyAccessFeatureEnrollment(e,t,n){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags?.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.Ti.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Ds}),()=>{})}onSessionId(e){return this.sessionManager?.onSessionId(e)??(()=>{})}getSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Ds})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Ds})}renderSurvey(e,t){var n;(n=this.surveys)==null||n.renderSurvey(e,t)}displaySurvey(e,t){var n;t===void 0&&(t=vs),(n=this.surveys)==null||n.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys?.canRenderSurvey(e)??{visible:!1,disabledReason:Ds}}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys?.canRenderSurveyAsync(e,t)??Promise.resolve({visible:!1,disabledReason:Ds})}Xi(e){return!e||je(e)?(U.critical(`Unique user id has not been set in posthog.identify`),!1):e===zr?(U.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):![`distinct_id`,`distinctid`].includes(e.toLowerCase())&&![`undefined`,`null`].includes(e.toLowerCase())||(U.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.`),!1)}identify(e,t,n){if(!this.__loaded||!this.persistence)return U.uninitializedWarning(`posthog.identify`);if(V(e)&&(e=e.toString(),U.warn(`The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.`)),this.Xi(e)&&this.Yi(`posthog.identify`)){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Kn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},``),e!==r&&e!==this.get_property(Jn)&&(this.unregister(Jn),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(jr)||Kr)===Kr;e!==r&&a?(this.persistence.set_property(jr,qr),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.capture($r,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Ri=cs(e,t,n),(i=this.featureFlags)==null||i.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(Dr))}}setPersonProperties(e,t){if((e||t)&&this.Yi(`posthog.setPersonProperties`)){var n=cs(this.get_distinct_id(),e,t);this.Ri===n?U.info(`A duplicate setPersonProperties call was made with the same properties. It has been ignored.`):(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture(`$set`,{$set:e||{},$set_once:t||{}}),this.Ri=n)}}unsetPersonProperties(e){var t,n=(F(e)?e:[e]).filter((e=>R(e)&&e.length>0));n.length!==0&&this.Yi(`posthog.unsetPersonProperties`)&&((t=this.featureFlags)==null||t.unsetPersonPropertiesForFlags(n,!0),this.capture(`$set`,{$unset:n}),this.Ri=null)}group(e,t,n){if(e&&t){var r=this.getGroups(),i=r[e]!==t;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:N({},r,{[e]:t})}),i||n){var a={$group_type:e,$group_key:t};n&&(a.$group_set=n),this.capture(ei,a)}n&&this.setGroupPropertiesForFlags({[e]:n}),i&&!n&&this.reloadFeatureFlags()}else U.error(`posthog.group requires a group type and group key`)}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),(n=this.featureFlags)==null||n.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;e===void 0&&(e=!0),(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),this.Yi(`posthog.setGroupPropertiesForFlags`)&&((n=this.featureFlags)==null||n.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,i,a,o,s,c,l;if(U.info(`reset`),!this.__loaded)return U.uninitializedWarning(`posthog.reset`);var u,d=this.get_property(Kn),f=this.get_property(qn),p=this.get_property(ar);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),L(p)||(u=this.persistence)==null||u.register({[ar]:p}),(r=this.surveys)==null||r.reset(),(i=this.Wi)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.conversations)==null||o.reset(),(s=this.logs)==null||s.reset(),(c=this.persistence)==null||c.set_property(jr,Kr),(l=this.sessionManager)==null||l.resetSessionId(),this.Ri=null,this.config.cookieless_mode===Gr)this.register_once({distinct_id:zr,$device_id:null},``);else{var m=this.config.get_device_id(mi());this.register_once({distinct_id:m,$device_id:e?m:d},``),e||L(f)||this.register({[qn]:f})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var n;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(n=this.conversations)==null||n.en()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.tn()}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;r+=`?t=`+Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0)}return r}alias(e,t){return e===this.get_property(Gn)?(U.critical(`Attempting to create alias for existing People user - aborting.`),-2):this.Yi(`posthog.alias`)?(L(t)&&(t=this.get_distinct_id()),e===t?(U.warn(`alias matches current distinct_id - skipping api call.`),this.identify(e),-1):(this.Ki(Jn,e),this.capture(`$create_alias`,{alias:e,distinct_id:t}))):void 0}set_config(e){var t=N({},this.config);if(I(e)){var n,r,i,a,o,s,c,l,u,d,f;K(this.config,Ps(e));var p=this.Ai();(n=this.persistence)==null||n.update_config(this.config,t,p),this.sessionPersistence=this.config.persistence===`
1sessionStorage`||this.config.persistence===`memory`?this.persistence:new Ka(N({},this.config,{persistence:`sessionStorage`}),p,!1);var m=this.Oi(this.config.debug);Ne(m)&&(this.config.debug=m),Ne(this.config.debug)&&(this.config.debug?(j.DEBUG=!0,J.N()&&J.q(`ph_debug`,!0),U.info(`set_config`,{config:e,oldConfig:t,newConfig:N({},this.config)})):(j.DEBUG=!1,J.N()&&J.P(`ph_debug`))),(r=this.exceptionObserver)==null||r.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.tracingHeaders)==null||o.startIfEnabledOrStop(),(s=this.autocapture)==null||s.startIfEnabled(),(c=this.heatmaps)==null||c.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),(d=this.surveys)==null||d.loadIfEnabled(),this.rn(),(f=this.externalIntegrations)==null||f.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){j.LIB_NAME=e,j.LIB_VERSION=t}startSessionRecording(e){var t,n,r,i,a,o=!0===e,s={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(s).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),s.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),s.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),s.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger(`url`)),s.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger(`event`))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){if(this.exceptions){var n=Error(`PostHog syntheticException`),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(N({},r,t))}}addExceptionStep(e,t){var n;(n=this.exceptions)==null||n.addExceptionStep(e,t)}captureLog(e){var t;(t=this.logs)==null||t.captureLog(e)}get logger(){return this.logs?.logger??e.nn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t;return(t=this.toolbar?.loadToolbar(e))!=null&&t}get_property(e){return this.persistence?.props[e]}getSessionProperty(e){return this.sessionPersistence?.props[e]}toString(){var e=this.config.name??As;return e!==As&&(e=As+`.`+e),e}_isIdentified(){return this.persistence?.get_property(jr)===qr||this.sessionPersistence?.get_property(jr)===qr}Ji(){var e,t;return!(this.config.person_profiles===`never`||this.config.person_profiles===Jr&&!this._isIdentified()&&Ae(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Jn])&&((t=this.persistence)==null||(t=t.props)==null||!t[Lr]))}Gi(){return!0===this.config.capture_pageleave||this.config.capture_pageleave===`if_capture_pageview`&&(!0===this.config.capture_pageview||this.config.capture_pageview===`history_change`)}createPersonProfile(){this.Ji()||this.Yi(`posthog.createPersonProfile`)&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yi(`posthog.setInternalOrTestUser`)&&this.setPersonProperties({$internal_or_test_user:!0})}Yi(e){return this.config.person_profiles===`never`?(U.error(e+` was called, but process_person is set to "never". This call will be ignored.`),!1):(this.Ki(Lr,!0),!0)}Ai(){if(this.config.cookieless_mode===`always`)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Wr)}rn(){var e,t,n=this.Ai();return this.persistence?.Vt!==n&&((e=this.persistence)==null||e.set_disabled(n)),this.sessionPersistence?.Vt!==n&&((t=this.sessionPersistence)==null||t.set_disabled(n)),n}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==Gr){if(this.Ci()){var r,i;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new is(this),this.pageViewM
1anager=new ya(this),this.persistence&&(this.sessionPropsManager=new ts(this,this.sessionManager,this.persistence));var a,o=this.config.__extensionClasses?.sessionRecording??e.__defaultExtensionClasses?.sessionRecording;o&&(this.sessionRecording=this.ki(this.sessionRecording,new o(this)),this.Ui&&((a=this.sessionRecording)==null||a.onRemoteConfig==null||a.onRemoteConfig(this.Ui)))}var s;this.consent.optInOut(!0),this.rn(),this.zi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Wr&&((s=this.surveys)==null||s.loadIfEnabled()),(L(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture(t?.captureEventName??`$opt_in`,t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vi()}else U.warn(Es)}opt_out_capturing(){var e,t,n;this.config.cookieless_mode===Gr?U.warn(Es):(this.config.cookieless_mode===Wr&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rn(),this.config.cookieless_mode===Wr&&(this.register({distinct_id:zr,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Vi(),this.zi()))}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?`granted`:e===0?`denied`:`pending`}is_capturing(){return this.config.cookieless_mode===Gr||(this.config.cookieless_mode===Wr?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rn()}_is_bot(){return T?as(T,this.config.custom_blocked_useragents):void 0}Vi(){E&&(E.visibilityState===`visible`?this.Ei||(this.Ei=!0,this.capture(Zr,{title:E.title},{send_instantly:!0}),this.Mi&&=(E.removeEventListener(Yr,this.Mi),null)):this.Mi||(this.Mi=this.Vi.bind(this),q(E,Yr,this.Mi)))}debug(e){!1===e?(C?.console.log(`You've disabled debug mode.`),this.set_config({debug:!1})):(C?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}mr(){var e,t,n,r,i,a,o=this.Li||{};return`advanced_disable_flags`in o?!!o.advanced_disable_flags:!1===this.config.advanced_disable_flags?!0===this.config.advanced_disable_decide?(U.warn(`Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version.`),!0):(n=`advanced_disable_decide`,r=U,i=(t=`advanced_disable_flags`)in(e=o)&&!B(e[t]),a=n in e&&!B(e[n]),i?e[t]:!!a&&(r&&r.warn(`Config field '`+n+`' is deprecated. Please use '`+t+`' instead. The old field will be removed in a future major version.`),e[n])):!!this.config.advanced_disable_flags}it(e){if(B(this.config.before_send))return e;var t=Object.keys(e.properties??{}).filter(Ie),n=F(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),B(r)){var a=`Event '`+e.event+`' was rejected in beforeSend function`;return Fe(e.event)?U.warn(a+`. This can cause unexpected behavior.`):U.info(a),null}r.properties&&!Ae(r.properties)||U.warn(`Event '`+e.event+`' has no properties after beforeSend function, this is likely an error.`)}for(var o of t)if(r.properties&&B(r.properties[o]))return U.warn(`Event '`+e.event+`' had its '`+o+`' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return r}getPageViewId(){return this.pageViewManager.Ot?.pageViewId}captureTraceFeedback(e,t){this.capture(`$ai_feedback`,{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture(`$ai_metric`,{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}Oi(e){var t=Ne(e)&&!e,n=J.N()&&J.A(`ph_debug`)===`true`;return!t&&(!!n||e)}};Is.__defaultExtensionClasses={},Is.nn={trace:Ss=()=>{},debug:Ss,info:Ss,warn:Ss,error:Ss,fatal:Ss},function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=ii(e.prototype[t[n]])}(Is,[`identify`]);var Ls=class{constructor(e){this.disabled=!1===e;var t=I(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}},Rs=`$copy_autocapture`,zs=W(`[AutoCapture]`);function Bs(e,t){return t.length>e?t.slice(0,e)+`...`:t}function Vs(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Ai(t));return t}function Hs(e,t){var n,{e:r,maskAllElementAttributes:i,maskAllText:a,elementAttributeIgnoreList:o,elementsC
1hainAsString:s,disableCaptureUrlHashes:c}=t;if(!Ai(e))return{props:{}};for(var l=[e],u=e;u.parentNode&&!ji(u,`body`);)if(Ni(u.parentNode))l.push(u.parentNode.host),u=u.parentNode.host;else{if(!Ai(u.parentNode))break;l.push(u.parentNode),u=u.parentNode}var d,f,p=[],m={},h=!1,g=!1;if(G(l,(e=>{var t=Qi(e);if(ji(e,`a`)){var n=e.getAttribute(`href`);h=!!(t&&n&&oa(n))&&(c?Xt(n):n)}P(Ii(e),`ph-no-capture`)&&(g=!0),p.push(function(e,t,n,r,i){i===void 0&&(i=!1);var a=e.tagName.toLowerCase(),o={tag_name:a};Bi.indexOf(a)>-1&&!n&&(o.$el_text=a.toLowerCase()===`a`||a.toLowerCase()===`button`?Bs(1024,sa(e)):Bs(1024,Ri(e)));var s=Ii(e);s.length>0&&(o.classes=s.filter((function(e){return e!==``}))),G(e.attributes,(function(n){var a;if((!$i(e)||[`name`,`id`,`class`,`aria-label`].indexOf(n.name)!==-1)&&(r==null||!r.includes(n.name))&&!t&&oa(n.value)&&(!R(a=n.name)||a.substring(0,10)!==`_ngcontent`&&a.substring(0,7)!==`_nghost`)){var s=n.value;n.name===`class`&&(s=Pi(s).join(` `)),o[`attr__`+n.name]=Bs(1024,n.name===`href`&&i?Xt(s):s)}}));for(var c=1,l=1,u=e;u=Vs(u);)c++,u.tagName===e.tagName&&l++;return o.nth_child=c,o.nth_of_type=l,o}(e,i,a,o,c)),K(m,function(e){if(!Qi(e))return{};var t={};return G(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&&oa(r)&&(t[n]=r)}})),t}(e))})),g)return{props:{},explicitNoCapture:g};if(a||(p[0].$el_text=ji(e,`a`)||ji(e,`button`)?sa(e):Ri(e)),h){var _;p[0].attr__href=h;var v=wa(h)?.host,ee=C==null||(_=C.location)==null?void 0:_.host;v&&ee&&v!==ee&&(d=h)}return{props:K({$event_type:r.type,$ce_version:1},s?{}:{$elements:p},{$elements_chain:(f=p,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=N({},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 ni(r).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return i[la(t.toString())]=la(n.toString())})),(t+=`:`)+ni(i).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:ua(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ni(e).filter((e=>{var[t]=e;return t.indexOf(`attr__`)===0})).forEach((e=>{var[n,r]=e;return t.attributes[n]=r})),t}))}(f)))},(n=p[0])!=null&&n.$el_text?{$el_text:p[0]?.$el_text}:{},d&&r.type===`click`?{$external_click_url:d}:{},m)}}var Us=W(`[ExceptionAutocapture]`),Ws=W(`[TracingHeaders]`),Gs=W(`[Web Vitals]`),Ks=9e5,qs=`disabled`,Js=`lazy_loading`,Ys=`awaiting_config`,Xs=`missing_config`;W(`[SessionRecording]`),W(`[SessionRecording]`);var Zs=`[SessionRecording]`,Qs=W(Zs),$s=W(`[Heatmaps]`);function ec(e){return I(e)&&`clientX`in e&&`clientY`in e&&V(e.clientX)&&V(e.clientY)}var tc=W(`[Product Tours]`),nc=e=>{var t;return!e.config.disable_product_tours&&!((t=e.persistence)==null||!t.get_property(rr))},rc=[`$set_once`,`$set`],ic=W(`[SiteApps]`),ac=`Error while initializing PostHog app with config id `;function oc(e,t,n){if(B(e))return!1;switch(n){case`exact`:return e===t;case`contains`:var r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/_/g,`.`).replace(/%/g,`.*`);return new RegExp(r,`i`).test(e);case`regex`:try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var sc=class{constructor(e){this.sn=new ns,this.an=(e,t)=>this.ln(e,t)&&this.un(e,t)&&this.hn(e,t)&&this.dn(e,t),this.ln=(e,t)=>t==null||!t.event||e?.event===t?.event,this._instance=e,this.cn=new Set,this.vn=new Set}init(){var e;L(this._instance?._addCaptureHook)||(e=this._instance)==null||e._addCaptureHook(((e,t)=>{this.on(e,t)}))}register(e){var t;if(!L(this._instance?._addCaptureHook)&&(e.forEach((e=>{var t,n;(t=this.vn)==null||t.add(e),(n=e.steps)==null||n.forEach((e=>{var t;(t=this.cn)==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)}))}
1)),(n=this._instance)==null||n.autocapture.setElementSelectors(r)}}on(e,t){t!=null&&e.length!=0&&(this.cn.has(e)||this.cn.has(t?.event))&&this.vn&&this.vn?.size>0&&this.vn.forEach((e=>{this.fn(t,e)&&this.sn.emit(`actionCaptured`,e.name)}))}pn(e){this.onAction(`actionCaptured`,(t=>e(t)))}fn(e,t){if(t?.steps==null)return!1;for(var n of t.steps)if(this.an(e,n))return!0;return!1}onAction(e,t){return this.sn.on(e,t)}un(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!=`string`||!oc(r,t.url,t.url_matching||`contains`))return!1}return!0}hn(e,t){return!!this.gn(e,t)&&!!this.mn(e,t)&&!!this.yn(e,t)}gn(e,t){var n;if(t==null||!t.href)return!0;var r=this.bn(e);if(r.length>0)return r.some((e=>oc(e.href,t.href,t.href_matching||`exact`)));var i,a=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!a&&oc((i=a.match(/(?::|")href="(.*?)"/))?i[1]:``,t.href,t.href_matching||`exact`)}mn(e,t){var n;if(t==null||!t.text)return!0;var r=this.bn(e);if(r.length>0)return r.some((e=>oc(e.text,t.text,t.text_matching||`exact`)||oc(e.$el_text,t.text,t.text_matching||`exact`)));var i,a,o,s=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!s&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!B(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(s),a=t.text,o=t.text_matching||`exact`,i.some((e=>oc(e,a,o))))}yn(e,t){var n,r;if(t==null||!t.selector)return!0;var i=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(i!=null&&i.includes(t.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||``;if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}bn(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}dn(e,t){return t==null||!t.properties||t.properties.length===0||ds(t.properties.reduce(((e,t)=>{var n=F(t.value)?t.value.map(String):t.value==null?[]:[String(t.value)];return e[t.key]={values:n,operator:t.operator||`exact`},e}),{}),e?.properties)}},cc=class{constructor(e){this._n=[],this._instance=e,this.wn=new Map,this.xn=new Map,this.kn=new Map}Sn(e,t){return!!e&&ds(e.propertyFilters,t?.properties)}Cn(e,t){var n=new Map;return e.forEach((e=>{var r;(r=e.conditions)==null||(r=r[t])==null||(r=r.values)==null||r.forEach((t=>{if(t!=null&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}}))})),n}In(e,t,n){var r=(n===qa.Activation?this.wn:this.xn).get(e),i=[];return this.Tn((e=>{i=e.filter((e=>r?.includes(e.id)))})),i.filter((r=>{var i,a=(i=r.conditions)==null||(i=i[n])==null||(i=i.values)==null?void 0:i.find((t=>t.name===e));return this.Sn(a,t)}))}register(e){L(this._instance?._addCaptureHook)||(this.En(e),this.Mn(e))}Mn(e){var t=e.filter((e=>{var t;return e.conditions?.actions&&((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null?void 0:t.length)>0}));t.length!==0&&(this.Pn??(this.Pn=new sc(this._instance),this.Pn.init(),this.Pn.pn((e=>{this.onAction(e)}))),t.forEach((e=>{var t,n,r,i,a;e.conditions&&(t=e.conditions)!=null&&t.actions&&(n=e.conditions)!=null&&(n=n.actions)!=null&&n.values&&((r=e.conditions)==null||(r=r.actions)==null||(r=r.values)==null?void 0:r.length)>0&&((i=this.Pn)==null||i.register(e.conditions.actions.values),(a=e.conditions)==null||(a=a.actions)==null||(a=a.values)==null||a.forEach((t=>{if(t&&t.name){var n=this.kn.get(t.name);n&&n.push(e.id),this.kn.set(t.name,n||[e.id])}})))})))}En(e){var t,n=e.filter((e=>{var t;return e.conditions?.events&&((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null?void 0:t.length)>0})),r=e.filter((e=>{var t;return e.conditions?.cancelEvents&&((t=e.conditions)==null||(t=t.cancelEvents)==null||(t=t.values)==null?void 0:t.length)>0}));n.length===0&&r.length===0||((t=this._instance)==null||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.wn=this.Cn(e,qa.Activation),this.xn=this.Cn(e,qa.Cancellation))}onEvent(e,t){var n,r,i=this.Rn(),a=(t==null||(n=t.properties)==null?void 0:n.$survey_id)||(t==null||(r=t.properties)==null?void 0:r.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var o=this.On(e,a);if(o===`consume`)return i.info(`event consumed activated item, remov
1ing it`,{event:e,itemId:a}),void this.Ln([a]);if(o===`persist`)return i.info(`shown item promoted to persisted activation`,{event:e,itemId:a}),void this.Fn(a)}if(this.xn.has(e)){var s=this.In(e,t,qa.Cancellation);s.length>0&&(i.info(`cancel event matched, cancelling items`,{event:e,itemsToCancel:s.map((e=>e.id))}),this.Ln(s.map((e=>e.id))),s.forEach((e=>this.An(e.id))))}if(this.wn.has(e)){i.info(`event name matched`,{event:e,eventPayload:t,items:this.wn.get(e)});var c=this.In(e,t,qa.Activation);this.$n(c.map((e=>e.id)))}}onAction(e){this.kn.has(e)&&this.$n(this.kn.get(e)||[])}$n(e){e.length!==0&&(this._n=[...new Set([...this._n,...e])],this.Rn().info(`updating activated items`,{activatedItems:this.getActivatedIds()}))}Fn(e){this._n=this._n.filter((t=>t!==e));var t=this.Dn();t.includes(e)||this.Nn([...t,e])}Ln(e){var t=new Set(e);this._n=this._n.filter((e=>!t.has(e)));var n=this.Dn(),r=n.filter((e=>!t.has(e)));r.length!==n.length&&this.Nn(r)}Dn(){var e,t=this.qn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.Dn(),...this._n])].filter((e=>!this.jn(e)))}reset(){this._n=[],this.Dn().length>0&&this.Nn([])}getEventToItemsMap(){return this.wn}Bn(){return this.Pn}},lc=class extends cc{constructor(e){super(e)}qn(){return Tr}Hn(){return Xa.SHOWN}Tn(e){var t;(t=this._instance)==null||t.getSurveys(e)}An(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}Rn(){return Q}Nn(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[Tr]:e})}jn(){return!1}On(e,t){var n;return this.Tn((e=>{n=e.find((e=>e.id===t))})),!n||function(e){var t,n,r=(((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null?void 0:t.length)??0)>0;return e.schedule===Ya.Always||!((n=e.conditions)==null||(n=n.events)==null||!n.repeatedActivation||!r)}(n)?e===Xa.SHOWN?`consume`:`ignore`:e===Xa.SHOWN?`persist`:e===Xa.DISMISSED||e===Xa.SENT?`consume`:`ignore`}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},uc=`SDK is not enabled or survey functionality is not yet loaded`,dc=`Disabled. Not loading surveys.`,fc=C!=null&&C.location?Da(C.location.hash,`__posthog`)||Da(location.hash,`state`):null,pc=`_postHogToolbarParams`,mc=W(`[Toolbar]`),$=W(`[FeatureFlags]`),hc=W(`[FeatureFlags]`,{debugEnabled:!0}),gc=`" failed. Feature flags didn't load in time.`,_c=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},vc=e=>{var t={};for(var[n,r]of ni(e||{}))r&&(t[n]=r);return t},yc=W(`[Error tracking]`),bc=`Refusing to render web experiment since the viewer is a likely bot`,xc={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>ss(t,e),not_regex:(e,t)=>!ss(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},Sc=class e{get Se(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){t===void 0&&(t=!1),n.getWebExperiments((t=>{e.Un(`retrieved web experiments from the server`),n.zn=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;n.zn&&(e.Un(`setting flag key `,t.feature_flag_key,` to web experiment `,t),(r=n.zn)==null||r.set(t.feature_flag_key,t));var i=n._instance.getFeatureFlag(t.feature_flag_key);R(i)&&t.variants[i]&&n.Vn(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var a in t.variants){var o=t.variants[a];e.Wn(o,n._instance)&&n.Vn(t.name,a,o.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())e.Un(bc);else if(!this.Se.disable_web_experiments){if(B(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.Un(`applying feature flags`,t),t.forEach((e=>{var t;if(this.zn&&(t=this.zn)!=null&&t.has(e)){var n=this._instance.getFeatureFlag(e),r=this.zn?.get(e);n&&r!=null&&r.variants[n]&&this.Vn(r.name,n,r.variants[n].transforms)}}))}}previewWebExperiment(){var t=e.getWindowLocation();if(t!=null&&t.search){var n=Ta(t?.search,`__experiment_id`),r=Ta(t?.search,`__experiment_variant`);n&&r&&(e.Un(`previewing web experiments `+n+` && `+r),this.getWebExperiments((e=>{this.Gn(parseInt(n),r,e)}),!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}
1getWebExperiments(e,t,n){if(this.Se.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.Se.token),method:`GET`,callback:t=>e(t.statusCode===200&&t.json&&t.json.experiments||[])})}Gn(t,n,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(e.Un(`Previewing web experiment [`+i[0].name+`] with variant [`+n+`]`),this.Vn(i[0].name,n,i[0].variants[n].transforms))}static Wn(t,n){return!B(t.conditions)&&e.Zn(t,n)&&e.Qn(t)}static Zn(t,n){if(B(t.conditions)||B(t.conditions?.url))return!0;var r=e.getWindowLocation();if(r){var i,a=Ti(n,r.href);return(i=t.conditions)==null||!i.url||xc[t.conditions?.urlMatchType??`icontains`](t.conditions.url,a)}return!1}static getWindowLocation(){return C?.location}static Qn(e){if(B(e.conditions)||B(e.conditions?.utm))return!0;var t=Na();if(t.utm_source){var n,r,i,a,o,s,c,l,u=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((r=e.conditions)==null||(r=r.utm)==null?void 0:r.utm_campaign)==t.utm_campaign,d=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==t.utm_source,f=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_medium||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_medium)==t.utm_medium,p=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_term)==t.utm_term;return u&&f&&p&&d}return!1}static Un(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];U.info(`[WebExperiments] `+e,n)}Vn(t,n,r){this._is_bot()?e.Un(bc):n===`control`?e.Un(`Control variants leave the page unmodified.`):r.forEach((r=>{r.selector&&(e.Un(`applying transform of variant `+n+` for experiment `+t+` `,r),(document?.querySelectorAll(r.selector))?.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute(`style`,r.css)})))}))}_is_bot(){return T&&this._instance?as(T,this.Se.custom_blocked_useragents):void 0}},Cc=W(`[Conversations]`),wc=`Conversations not available yet.`,Tc=`console`,Ec={featureFlags:class{constructor(e){this.Jn=!1,this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Se(){return this._instance.config}get zr(){return this._instance.persistence}ss(e){return this._instance.get_property(e)}os(){var e;return(e=this.zr?.Gt(this.Se.feature_flag_cache_ttl_ms))!=null&&e}ls(){return!!this.os()&&(this.ns||this.Kn||(this.ns=!0,$.warn(`Feature flag cache is stale, triggering refresh...`),this.reloadFeatureFlags()),!0)}us(){var e=this.Se.evaluation_contexts??this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.rs||($.warn(`evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version.`),this.rs=!0),e!=null&&e.length?e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||$.error(`Invalid evaluation context found:`,e,`Expected non-empty string`),t})):[]}hs(){return this.us().length>0}ds(){var e=this.Se.flag_keys;if(!L(e)){if(F(e))return e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||$.error(`Invalid flag key found:`,e,`Expected non-empty string`),t}));$.error(`Invalid flag_keys found:`,e,`Expected array of non-empty strings`)}}initialize(){var{config:e}=this._instance,t=e.bootstrap?.featureFlags??{};if(Object.keys(t).length){var n=e.bootstrap?.featureFlagPayloads??{},r=Object.keys(t).filter((e=>!!t[e])).reduce(((e,n)=>(e[n]=t[n]||!1,e)),{}),i=Object.keys(n).filter((e=>r[e])).reduce(((e,t)=>(n[t]&&(e[t]=n[t]),e)),{});this.receivedFeatureFlags({featureFlags:r,featureFlagPayloads:i})}}updateFlags(e,t,n){var r,i,a=n!=null&&n.merge&&(r=this.ss(pr))!=null?r:{},o=n!=null&&n.merge&&(i=this.ss(_r))!=null?i:{},s=N({},a,e),c=N({},o,t),l={};for(var[u,d]of Object.entries(s))l[u]={key:u,enabled:ce(d),variant:le(d),reason:void 0,metadata:L(c?.[u])?void 0:{id:0,version:void 0,description:void 0,payload:c[u]}};this.receivedFeatureFlags({flags:l})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.ss(gr),t=this.ss(yr),n=this.ss(br);if(!n&&!t)return e||{};var r=K({},e||{});for(var i of[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])]){var a,o,s=r[i],c=t?.[i],l=L(c)?(a=s?.enabled)!=null&&a:!!c,u=L(c)?s.variant:typeof c==`string`?c:void 0,d=n?.[i],f=N({},s,{enabled:l,variant:l?u??s?.variant:void 0});l!==s?.enabled&&(f.original_enabled=s?.enabled),u!==s?.variant&&(f.original_variant=s?.variant),d&&(f.metadata=N({},s?.metadata,{payload:d,original_payload:s==null||(o=s.metadata)==null?void 0:o.payload})),r[i]=f}return this.Jn||=($.warn(` Overriding feature flag details!`,{flagDetails:e,overriddenPayloads:n,finalDetails:r}),!0),r}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map((n=>{var r=e[n];return{key:n,enabled:ce(r),variant:le(r),payload:se(t[n])}}))}getFlagVariants(){var e=this.ss(pr),t=this.ss(yr);if(!t)return e||{};for(var n=K({},e),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Jn||=($.warn(` Overriding feature flags!`,{enabledFlags:e,overriddenFlags:t,finalFlags:n}),!0),n}getFlagPayloads(){var e=this.ss(_r),t=this.ss(br);if(!t)return e||{};for(var n=K({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Jn||=($.warn(` Overriding feature flag payloads!`,{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),!0),n}reloadFeatureFlags(){this.Xn||this.Se.advanced_disable_feature_flags||this.cs||(this._instance.Ti.emit(`featureFlagsReloading`,!0),this.cs=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.cs),this.cs=void 0}ensureFlagsLoaded(){this.Yn||this.Kn||this.cs||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Xn=e}vs(e){if(this.fs(),!this._instance.mr())if(this.Kn)this.es=!0;else{var t=this.Se.token,n=this.ss(Kn),r={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:N({},this.zr?.get_initial_props()||{},this.ss(xr)||{}),group_properties:this.ss(Sr),timezone:Va()};z(n)||L(n)||(r.$device_id=n),(e!=null&&e.disableFlags||this.Se.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.hs()&&(r.evaluation_contexts=this.us());var i=this.ds();L(i)||(r.flag_keys=i);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`+(this.Se.advanced_only_evaluate_survey_feature_flags?`&only_evaluate_survey_feature_flags=true`:``));this.Kn=!0,this._instance._send_request({method:`POST`,url:o,data:r,compression:this.Se.disable_compression?void 0:ao.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback:e=>{var t,n,i,o=!0;if(e.statusCode===200&&(this.es||(this.$anon_distinct_id=void 0),o=!1),this.Kn=!1,!r.disable_flags||this.es){this.ts=!o;var s=[];e.error?e.error instanceof Error?s.push(e.error.name===`AbortError`?`timeout`:`connection_error`):s.push(`unknown_error`):e.statusCode!==200&&s.push(`api_error_`+e.statusCode),(t=e.json)!=null&&t.errorsWhileComputingFlags&&s.push(`errors_while_computing_flags`);var c=!((n=e.json)==null||(n=n.quotaLimited)==null||!n.includes(`feature_flags`));c&&s.push(`quota_limited`),(i=this.zr)==null||i.register({[kr]:s}),c?$.warn(`You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.`):(r.disable_flags||this.receivedFeatureFlags(e.json??{},o,{partialResponse:a}
1),this.es&&(this.es=!1,this.vs()))}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),!t.fresh||this.ts)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var n=this.getFeatureFlagResult(e,t);return n?.variant??n?.enabled}}else $.warn(`getFeatureFlag for key "`+e+gc)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFeatureFlagResult(e,{send_event:!1})?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.ts)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var n=this.getFlagVariants(),r=e in n,i=n[e],a=this.getFlagPayloads()[e],o=String(i),s=this.ss(vr)||void 0,c=this.ss(Ar)||void 0,l=this.ss(Dr)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var u,d=this._instance.get_session_id(),f=this.ss(Or);d&&d!==f&&(l={},(u=this.zr)==null||u.register({[Dr]:l,[Or]:d}))}if((t.send_event||!(`send_event`in t))&&(!(e in l)||!l[e].includes(o))){var p,m,h,g,_,v,ee,y;F(l[e])?l[e].push(o):l[e]=[o],(p=this.zr)==null||p.register({[Dr]:l});var b=this.getFeatureFlagDetails(e),x=[...this.ss(kr)??[]];L(i)&&x.push(`flag_missing`);var S={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:a||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((m=this.Se.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[e])||null,$feature_flag_bootstrapped_payload:((h=this.Se.bootstrap)==null||(h=h.featureFlagPayloads)==null?void 0:h[e])||null,$used_bootstrap_value:!this.ts};L(b==null||(g=b.metadata)==null?void 0:g.version)||(S.$feature_flag_version=b.metadata.version);var C,w=(b==null||(_=b.reason)==null?void 0:_.description)??(b==null||(v=b.reason)==null?void 0:v.code);w&&(S.$feature_flag_reason=w),b!=null&&(ee=b.metadata)!=null&&ee.id&&(S.$feature_flag_id=b.metadata.id),L(b?.original_variant)&&L(b?.original_enabled)||(S.$feature_flag_original_response=L(b.original_variant)?b.original_enabled:b.original_variant),b!=null&&(y=b.metadata)!=null&&y.original_payload&&(S.$feature_flag_original_payload=b==null||(C=b.metadata)==null?void 0:C.original_payload),x.length&&(S.$feature_flag_error=x.join(`,`)),this._instance.capture(`$feature_flag_called`,S)}if(r)return{key:e,enabled:!!i,variant:typeof i==`string`?i:void 0,payload:se(a)}}}else $.warn(`getFeatureFlagResult for key "`+e+gc)}getRemoteConfigPayload(e,t){var n=this.Se.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.hs()&&(r.evaluation_contexts=this.us());var i=this.ds();L(i)||(r.flag_keys=i),this._instance._send_request({method:`POST`,url:this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`),data:r,compression:this.Se.disable_compression?void 0:ao.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback(n){var r=n.json?.featureFlagPayloads;t(r?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return L(n)?void 0:!!n}$.warn(`isFeatureEnabled for key "`+e+gc)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.zr){this.Yn=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(e,t,n,r,i,a){n===void 0&&(n={}),r===void 0&&(r={}),i===void 0&&(i={});var o=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>[e,t[e].variant??t[e].enabled]))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>t[e].metadata?.payload)).map((e=>[e,t[e].metadata?.payload])))):e.featureFlags&&$.warn(`Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version`),e})(e),s=o.flags,c=o.featureFlags,l=o.featureFlagPayloads;if(c){var u=e.requestId,d=e.evaluatedAt;if(F(c)){$.warn(`v1 of the feature flags endpoint is deprecated. Please use the latest version.`);var f={};if(c)for(var p=0;c.length>p;p++)f[c[p]]=!0;t&&t.register({[mr]:c,[pr]:f})}else{var m=c,h=l,g=s;if(a!=null&&a.partialResponse)m=N({},n,m),h=N({},r,h),g=N({},i,g);else if(e.errorsWhileComputingFlags)if(s){var _=new Set(Object.keys(s).filter((e=>{var t;return!((t=s[e])!=null&&t.failed)})));m=N({},n,Object.fromEntries(Object.entries(m).filter((e=>{var[t]=e;return _.has(t)})))),h=N({},r,Object.fromEntries(Object.entries(h||{}).filter((e=>{var[t]=e;return _.has(t)})))),g=N({},i,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return _.has(t)}))))}else m=N({},n,m),h=N({},r,h),g=N({},i,g);t&&t.register(N({[mr]:Object.keys(vc(m)),[pr]:m||{},[_r]:h||{},[gr]:g||{}},u?{[vr]:u}:{},d?{[Ar]:d}:{}))}}})(e,this.zr,r,i,a,n),t||(this.ns=!1),this.ps(t)}}override(e,t){t===void 0&&(t=!1),$.warn(`override is deprecated. Please use overrideFeatureFlags instead.`),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.zr)return $.uninitializedWarning(`posthog.featureFlags.overrideFeatureFlags`);if(!1===e)return this.zr.unregister(yr),this.zr.unregister(br),this.ps(),hc.info(`All overrides cleared`);if(F(e)){var t=_c(e);return this.zr.register({[yr]:t}),this.ps(),hc.info(`Flag overrides set`,{flags:e})}if(e&&typeof e==`object`&&(`flags`in e||`payloads`in e)){var n,r=e;if(this.Jn=!!((n=r.suppressWarning)!=null&&n),`flags`in r){if(!1===r.flags)this.zr.unregister(yr),hc.info(`Flag overrides cleared`);else if(r.flags){if(F(r.flags)){var i=_c(r.flags);this.zr.register({[yr]:i})}else this.zr.register({[yr]:r.flags});hc.info(`Flag overrides set`,{flags:r.flags})}}`payloads`in r&&(!1===r.payloads?(this.zr.unregister(br),hc.info(`Payload overrides cleared`)):r.payloads&&(this.zr.register({[br]:r.payloads}),hc.info(`Payload overrides set`,{payloads:r.payloads}))),this.ps();return}if(e&&typeof e==`object`)return this.zr.register({[yr]:e}),this.ps(),hc.info(`Flag overrides set`,{flags:e});$.warn(`Invalid overrideOptions provided to overrideFeatureFlags`,{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Yn){var{flags:t,flagVariants:n}=this.gs();try{e(t,n)}catch(e){$.error(`Error while running feature flags callback`,e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,i=(this.ss(hr)||[]).find((t=>t.flagKey===e)),a={[`$feature_enrollment/`+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};i&&(o.$early_access_feature_name=i.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture(`$feature_enrollment_update`,o),this.setPersonPropertiesForFlags(a,!1);var s=N({},this.getFlagVariants(),{[e]:t});(r=this.zr)==null||r.register({[mr]:Object.keys(vc(s)),[pr]:s}),this.ps()}
1getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.ss(hr),i=n?`&`+n.map((e=>`stage=`+e)).join(`&`):``;if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/early_access_features/?token=`+this.Se.token+i),method:`GET`,callback:t=>{var n,r;if(t.json){var i=t.json.earlyAccessFeatures;return(n=this.zr)==null||n.unregister(hr),(r=this.zr)==null||r.register({[hr]:i}),e(i)}}})}gs(){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)),{})}}ps(e){var{flags:t,flagVariants:n}=this.gs();this.featureFlagEventHandlers.forEach((r=>{try{r(t,n,{errorsLoading:e})}catch(e){$.error(`Error while running feature flags callback`,e)}}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.ss(xr)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),i=e?.$set_once,a={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(a[o]=i[o]));this._instance.register({[xr]:N({},n,a,r)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=N({},this.ss(xr)||{});e.forEach((e=>{delete n[e]})),this._instance.register({[xr]:n}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){e===void 0&&(e=!0),this._instance.unregister(xr),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.ss(Sr)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((t=>{n[t]=N({},n[t],e[t]),delete e[t]})),this._instance.register({[Sr]:N({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.ss(Sr)||{};this._instance.register({[Sr]:N({},t,{[e]:{}})})}else this._instance.unregister(Sr)}reset(){this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},Dc={sessionRecording:class{get Se(){return this._instance.config}get zr(){return this._instance.persistence}get started(){var e;return!((e=this.ys)==null||!e.isStarted)}get status(){return this.bs===Ys||this.bs===Xs?this.bs:this.ys?.status??this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=qs,this._s=void 0,this._instance=e,!this._instance.sessionManager)throw Qs.error(`started without valid sessionManager`),Error(Zs+` started without valid sessionManager. This is a bug.`);if(this.Se.cookieless_mode===Gr)throw Error(Zs+` cannot be used with cookieless_mode="always"`)}initialize(){this.startIfEnabledOrStop()}get ws(){var e,t=!((e=this._instance.get_property(ar))==null||!e.enabled),n=!this.Se.disable_session_recording,r=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return C&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.ws||(t=this.ys)==null||!t.isStarted){var n=!L(Object.assign)&&!L(Array.from);this.ws&&n?(this.xs(e),Qs.info(`starting`)):(this.bs=qs,this.stopRecording())}}xs(e){var t,n,r;this.ws&&(this.bs!==Ys&&this.bs!==Xs&&(this.bs=Js),A!=null&&(t=A.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=A.__PosthogExtensions__)!=null&&n.initSessionRecording?this.ks(e):(r=A.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ss,(t=>{if(t)return Qs.error(`could not load recorder`,t);this.ks(e)})))}stopRecording(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.stop()}Cs(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.discard()}Is(){var e,t;(e=this.zr)==null||e.unregister(fr),(t=this.zr)==null||t.unregister(or)}Ts(e,t){if(B(e))return null;var n,r=V(e)?e:parseFloat(e);return typeof(n=r)!=`number`||!Number.isFinite(n)||0>n||n>1?(Qs.warn(t+` must be between 0 and 1. Ignoring invalid value:`,e),null):r}Es(e){if(this.zr){var t,n=this.zr,r=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Ts(this.Se.session_recording?.sampleRate,`session_recording.sampleRate`),i=this.Ts(t?.sampleRate,`remote config sampleRate`),a=r??i;B(a)&&this.Is();var o=t?.minimumDurationMilliseconds;n.register({[ar]:N({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:N({capturePerformance:e.capturePerformance},t?.networkPayloadCapture),canvasRecording:{enabled:t?.recordCanvas,fps:t?.canvasFps,quality:t?.canvasQuality},sampleRate:a,minimumDurationMilliseconds:L(o)?null:o,endpoint:t?.endpoint,triggerMatchType:t?.triggerMatchType,masking:t?.masking,urlTriggers:t?.urlTriggers,version:t?.version,triggerGroups:t?.triggerGroups})})};r(),(t=this._s)==null||t.call(this),this._s=this._instance.sessionManager?.onSessionId(r)}}onRemoteConfig(e){`sessionRecording`in e?!1===e.sessionRecording?(this.Es(e),this.Cs()):(this.Es(e),this.startIfEnabledOrStop()):(this.bs===Ys&&(this.bs=Xs,Qs.warn(`config refresh failed, recording will not start until page reload`)),this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t=`log`),(n=this.ys)!=null&&n.log?this.ys.log(e,t):Qs.warn(`log called before recorder was ready`)}get Ss(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(ar);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||`lazy-recorder`}Ms(){var e,t=this._instance.get_property(ar);
1if(!t)return!1;try{e=typeof t==`object`?t:JSON.parse(t)}catch(e){return Qs.warn(`persisted remote config for session recording is invalid and will be ignored`,e),!1}var n=e.cache_timestamp??Date.now();return 36e5>=Date.now()-n}ks(e){var t;if((t=A.__PosthogExtensions__)==null||!t.initSessionRecording)return Qs.warn(`Called on script loaded before session recording is available. This can be caused by adblockers.`),void this._instance.register_for_session({[Hr]:!0});if(this.ys||(this.ys=A.__PosthogExtensions__?.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ms()){if(this.bs===Xs||this.bs===Ys)return;this.bs=Ys,Qs.info(`persisted remote config is stale, requesting fresh config before starting`),new io(this._instance).load();return}this.bs=Js,this.ys.start(e)}onRRwebEmit(e){var t;(t=this.ys)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||(t=this.zr)==null||t.register({[cr]:!0}),(e=this.ys)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||(t=this.zr)==null||t.register({[sr]:!0}),(e=this.ys)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.ys||(n=this.zr)==null||n.register({[e===`url`?lr:ur]:!0}),(t=this.ys)==null||t.overrideTrigger(e)}get sdkDebugProperties(){return this.ys?.sdkDebugProperties||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.ys)==null||!n.tryAddCustomEvent(e,t))}}},Oc={autocapture:class{constructor(e){this.Ps=!1,this.Rs=null,this.Os=!1,this.instance=e,this.rageclicks=new Ls(e.config.rageclick),this.Ls=null}initialize(){this.startIfEnabled()}get Se(){var e=I(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}Fs(){if(this.isBrowserSupported()){if(C&&E){var e=e=>{e||=C?.event;try{this.As(e)}catch(e){zs.error(`Failed to capture event`,e)}};if(q(E,`submit`,e,{capture:!0}),q(E,`change`,e,{capture:!0}),q(E,`click`,e,{capture:!0}),this.Se.capture_copied_text){var t=e=>{e||=C?.event;try{this.As(e,Rs)}catch(e){zs.error(`Failed to capture copy/cut event`,e)}};q(E,`copy`,t,{capture:!0}),q(E,`cut`,t,{capture:!0})}}}else zs.info(`Disabling Automatic Event Collection because this browser is not supported`)}startIfEnabled(){this.isEnabled&&!this.Ps&&(this.Fs(),this.Ps=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Os=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Xn]:!!e.autocapture_opt_out}),this.Rs=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Ls=e}getElementSelectors(e){var t,n=[];return(t=this.Ls)==null||t.forEach((t=>{(E?.querySelectorAll(t))?.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e=this.instance.persistence?.props[Xn];if(z(this.Rs)&&!Ne(e)&&!this.instance.mr())return!1;var t=this.Rs??!!e;return!!this.instance.config.autocapture&&!t}As(e,t){if(t===void 0&&(t=`$autocapture`),this.isEnabled){var n,r=zi(e);Mi(r)&&(r=r.parentNode||null),t===`$autocapture`&&e.type===`click`&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&Yi(r,this.instance.config.rageclick)&&this.As(e,`$rageclick`);var i=t===Rs;if(r&&function(e,t,n,r,i,a){var o,s,c;if(n===void 0&&(n=void 0),!C||Xi(e)||(o=n)!=null&&o.url_allowlist&&!Fi(n.url_allowlist,a)||(s=n)!=null&&s.url_ignorelist&&Fi(n.url_ignorelist,a))return!1;if((c=n)!=null&&c.dom_event_allowlist){var l=n.dom_event_allowlist;if(l&&!l.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=Zi(e,r);if(!function(e,t){var n=t?.element_allowlist;if(L(n))return!0;var r,i=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var a of e)if(r=i(a))return r.v;return!1}(d,n)||!Vi(d,n?.css_selector_allowlist)||Vi(d,n?.css_selector_ignorelist??Ui))return!1;var f=C.getComputedStyle(e);if(f&&f.getPropertyValue(`cursor`)===`pointer`&&t.type===`click`)return!0;var p=e.tagName.toLowerCase();switch(p){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 u?(i||[`click`]).indexOf(t.type)>=0:(i||[`click`]).indexOf(t.type)>=0&&(Bi.indexOf(p)>-1||e.getAttribute(`contenteditable`)===`true`)}}(r,e,this.Se,i,i?[`copy`,`cut`]:void 0,this.instance)){var{props:a,explicitNoCapture:o}=Hs(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsC
1hainAsString:this.Os,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes});if(o)return!1;var s=this.getElementSelectors(r);if(s&&s.length>0&&(a.$element_selectors=s),t===Rs){var c,l=Li(C==null||(c=C.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 ke(E?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.$s=(C==null||(t=C.location)==null?void 0:t.pathname)||``}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview===`history_change`}startIfEnabled(){this.isEnabled&&(U.info(`History API monitoring enabled, starting...`),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,U.info(`History API monitoring stopped`)}monitorHistoryChanges(){C&&C.history&&(this.Ns(`pushState`),this.Ns(`replaceState`),this.qs())}Ns(e){var t;if(C&&((t=C.history[e])==null||!t.__posthog_wrapped__)){var n=this;(function(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return ke(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]===i&&(e[t]=r)}}catch{return()=>{}}})(C.history,e,(t=>function(r,i,a){t.call(this,r,i,a),n.js(e)}))}}js(e){try{var t,n=C==null||(t=C.location)==null?void 0:t.pathname;if(!n)return;n!==this.$s&&this.isEnabled&&this._instance.capture(Zr,{navigation_type:e}),this.$s=n}catch(t){U.error(`Error capturing `+e+` pageview`,t)}}qs(){if(!this.Ds){var e=()=>{this.js(`popstate`)};q(C,`popstate`,e),this.Ds=()=>{C&&C.removeEventListener(`popstate`,e)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(e){var t;this.Bs=!1,this.Ps=!1,this.Hs=null,this.instance=e,this.Bs=!((t=this.instance.persistence)==null||!t.props[Zn]),this.rageclicks=new Ls(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return I(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(e=this.Se.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return B(this.Se.capture_heatmaps)?B(this.Se.enable_heatmaps)?this.Bs:this.Se.enable_heatmaps:!1!==this.Se.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ps)return;$s.info(`starting...`),this.Us(),this.ke()}else clearInterval(this.Hs??void 0),this.zs(),this.getAndClearBuffer()}onRemoteConfig(e){if(`heatmaps`in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Zn]:t}),this.Bs=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Vs(e){this.fe(e.originalEvent,`deadclick`)}ke(){this.Hs&&clearInterval(this.Hs),this.Hs=E?.visibilityState===`visible`?setInterval(this.Lr.bind(this),this.flushIntervalMilliseconds):null}Us(){C&&E&&(this.Ws=this.Lr.bind(this),q(C,Xr,this.Ws),this.Gs=e=>this.fe(e||C?.event),q(E,`click`,this.Gs,{capture:!0}),this.Zs=e=>this.Qs(e||C?.event),q(E,`mousemove`,this.Zs,{capture:!0}),this.Js=new ma(this.instance,fa,this.Vs.bind(this)),this.Js.startIfEnabledOrStop(),this.Ys=this.ke.bind(this),q(E,Yr,this.Ys),this.Ps=!0)}zs(){var e;C&&E&&(this.Ws&&C.removeEventListener(Xr,this.Ws),this.Gs&&E.removeEventListener(`click`,this.Gs,{capture:!0}),this.Zs&&E.removeEventListener(`mousemove`,this.Zs,{capture:!0}),this.Ys&&E.removeEventListener(Yr,this.Ys),clearTimeout(this.Ks),(e=this.Js)==null||e.stop(),this.Ps=!1)}Xs(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&&Ai(r)&&!ji(r,`body`);){if(r===n)return!1;if(P(t,C?.getComputedStyle(r).position))return!0;r=Hi(r)}return!1}(zi(e),[`fixed`,`sticky`],i);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:n),target_fixed:a,type:t}}fe(e,t){var n;if(t===void 0&&(t=`click`),!ki(e.target)&&ec(e)){var r=this.Xs(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&Yi(zi(e),this.instance.config.rageclick)&&this.eo(N({},r,{type:`rageclick`})),this.eo(r)}}Qs(e){!ki(e.target)&&ec(e)&&(clearTimeout(this.Ks),this.Ks=setTimeout((()=>{this.eo(this.Xs(e,`mousemove`))}),500))}eo(e){if(C){var t=this.Se.disable_capture_url_hashes?Xt(C.location.href):C.location.href,n=this.Se.custom_personal_data_properties,r=Ea(t,this.Se.mask_personal_data_properties?[...ka,...n||[]]:[],ja);this.R=this.R||{},this.R[r]||(this.R[r]=[]),this.R[r].push(e)}}Lr(){this.R&&!Ae(this.R)&&this.instance.capture(`$$heatmap`,{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:ma,webVitalsAutocapture:class{constructor(e){var t;this.Bs=!1,this.Ps=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ro=()=>{clearTimeout(this.io),this.R.metrics.length!==0&&(this._instance.capture(`$web_vitals`,this.R.metrics.reduce(((e,t)=>N({},e,{[`$web_vitals_`+t.name+`_event`]:N({},t),[`$web_vitals_`+t.name+`_value`]:t.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.no=e=>{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t=this.so();if(!L(t))if(B(e?.name)||B(e?.value))Gs.error(`Invalid metric received`,e);else if(!this.oo||this.oo>e.value){this.R.url!==t&&(this.ro(),this.io=setTimeout(this.ro,this.flushToCaptureTimeoutMs)),L(this.R.url)&&(this.R.url=t),this.R.firstMetricTimestamp=L(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=this._instance.sessionManager?.checkAndGetSessionAndWindowId(!0),r=N({},e,{$current_url:t,timestamp:Date.now()});L(n)||(r.$session_id=n.sessionId,r.$window_id=n.windowId),this.R.metrics.push(r),this.R.metrics.length===this.allowedMetrics.length&&this.ro()}else Gs.error(`Ignoring metric with value >= `+this.oo,e)},this.ao=()=>
1{if(!this.Ps){var e,t,n,r,i=A.__PosthogExtensions__;L(i)||L(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf(`LCP`)>-1&&e(this.no.bind(this)),this.allowedMetrics.indexOf(`CLS`)>-1&&t(this.no.bind(this)),this.allowedMetrics.indexOf(`FCP`)>-1&&n(this.no.bind(this)),this.allowedMetrics.indexOf(`INP`)>-1&&r(this.no.bind(this)),this.Ps=!0):Gs.error(`web vitals callbacks not loaded - not starting`)}},this._instance=e,this.Bs=!((t=this._instance.persistence)==null||!t.props[tr]),this.startIfEnabled()}get lo(){return this._instance.config.capture_performance}get allowedMetrics(){var e=I(this.lo)?this.lo?.web_vitals_allowed_metrics:void 0;return B(e)?this._instance.persistence?.props[ir]||[`CLS`,`FCP`,`INP`,`LCP`]:e}get flushToCaptureTimeoutMs(){return(I(this.lo)?this.lo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=I(this.lo)?this.lo.web_vitals_attribution:void 0;return e!=null&&e}get oo(){var e=I(this.lo)&&V(this.lo.__web_vitals_max_value)?this.lo.__web_vitals_max_value:Ks;return e>0&&6e4>=e?Ks:e}get isEnabled(){var e=D?.protocol;if(e!==`http:`&&e!==`https:`)return Gs.info(`Web Vitals are disabled on non-http/https protocols`),!1;var t=I(this.lo)?this.lo.web_vitals:Ne(this.lo)?this.lo:void 0;return Ne(t)?t:this.Bs}startIfEnabled(){this.isEnabled&&!this.Ps&&(Gs.info(`enabled, starting...`),this.Mt(this.ao))}onRemoteConfig(e){if(`capturePerformance`in e){var t=I(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=I(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tr]:t}),this._instance.persistence.register({[ir]:n})),this.Bs=t,this.startIfEnabled()}}Mt(e){var t,n;(t=A.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=A.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?`web-vitals-with-attribution`:`web-vitals`,(t=>{t?Gs.error(`failed to load script`,t):e()}))}so(){var e=C?this._instance.config.disable_capture_url_hashes?Xt(C.location.href):C.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return Ea(e,this._instance.config.mask_personal_data_properties?[...ka,...t||[]]:[],ja)}Gs.error(`Could not determine current URL`)}}},kc={exceptionObserver:class{constructor(e){var t;this.ao=()=>{var e;if(C&&this.isEnabled&&(e=A.__PosthogExtensions__)!=null&&e.errorWrappingFunctions){var t=A.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=A.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=A.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.uo&&this.Se.capture_unhandled_errors&&(this.uo=t(this.captureException.bind(this))),!this.ho&&this.Se.capture_unhandled_rejections&&(this.ho=n(this.captureException.bind(this))),!this.do&&this.Se.capture_console_errors&&(this.do=r(this.captureException.bind(this)))}catch(e){Us.error(`failed to start`,e),this.co()}}},this._instance=e,this.vo=!((t=this._instance.persistence)==null||!t.props[Qn]),this.fo=new We({refillRate:this._instance.config.error_tracking.__exceptionRateLimiterRefillRate??1,bucketSize:this._instance.config.error_tracking.__exceptionRateLimiterBucketSize??10,refillInterval:1e4,Ae:Us}),this.Se=this.po(),this.startIfEnabledOrStop()}po(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return I(e)?t=N({},t,e):(L(e)?this.vo:e)&&(t=N({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Us.info(`enabled`),this.co(),this.Mt(this.ao)):this.co()}Mt(e){var t,n;(t=A.__PosthogExtensions__)!=null&&t.errorWrappingFunctions?e():(n=A.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`exception-autocapture`,(t=>{if(t)return Us.error(`failed to load script`,t);
1e()}))}co(){var e,t,n;(e=this.uo)==null||e.call(this),this.uo=void 0,(t=this.ho)==null||t.call(this),this.ho=void 0,(n=this.do)==null||n.call(this),this.do=void 0}onRemoteConfig(e){`autocaptureExceptions`in e&&(this.vo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Qn]:this.vo}),this.Se=this.po(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this.po()}captureException(e){var t,n,r=(e==null||(t=e.$exception_list)==null||(t=t[0])==null?void 0:t.type)??`Exception`;this.fo.consumeRateLimit(r)?Us.info(`Skipping exception capture because of client rate limiting.`,{exception:r}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(e)}},exceptions:class{constructor(e){this.mo=[],this.yo=new fn([new wn,new Pn,new En,new Tn,new Mn,new jn,new On,new Nn],function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){r===void 0&&(r=0);for(var i=[],a=t.split(` 2`),o=r;a.length>o;o++){var s=a[o];if(1024>=s.length){var c=Cn.test(s)?s.replace(Cn,`$1`):s;if(!c.match(/\S*Error: /)){for(var l of n){var u=l(c,e);if(u){i.push(u);break}}if(i.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return N({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||pn});var n}))}(i)}}(`web:javascript`,yn,Sn)),this._instance=e,this.mo=this._instance.persistence?.get_property($n)??[],this.bo=zn(this._o()),this.wo=new Bn(this.bo)}onConfigChange(){this.bo=zn(this._o()),this.wo.setConfig(this.bo)}onRemoteConfig(e){if(`errorTracking`in e){var t=e.errorTracking?.suppressionRules??[],n=e.errorTracking?.captureExtensionExceptions;this.mo=t,this._instance.persistence&&this._instance.persistence.register({[$n]:this.mo,[er]:n})}}get xo(){var e,t=!!this._instance.get_property(er);return(e=this._instance.config.error_tracking.captureExtensionExceptions??t)!=null&&e}buildProperties(e,t){return this.yo.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.bo.enabled)try{if(!R(e)||e.trim().length===0)return void yc.warn(`Ignoring exception step because message must be a non-empty string`);var{sanitizedProperties:n,droppedKeys:r}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((n,r)=>Ln.has(r)?(t.push(r),n):(n[r]=e[r],n)),{}),droppedKeys:t}}(this.ko(t));r.length>0&&yc.warn(`Ignoring reserved exception step fields`,{droppedKeys:r}),this.wo.add(N({[Fn]:e,[In]:new Date().toISOString()},n))}catch(e){yc.error(`Failed to add exception step. Ignoring breadcrumb.`,e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.So(t)){if(this.Co(t))return this.Io(`Exception dropped: matched a suppression rule`),void yc.info(`Skipping exception capture because a suppression rule matched`);if(!this.xo&&this.To(t))return this.Io(`Exception dropped: thrown by a browser extension`),void yc.info(`Skipping exception capture because it was thrown by an extension`);if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Eo(t))return this.Io(`Exception dropped: thrown by the PostHog SDK`),void yc.info(`Skipping exception capture because it was thrown by the PostHog SDK`)}var n=this.bo.enabled&&B(e.$exception_steps)?this.Mo(e):e;try{var r=this._instance.capture(`$exception`,n,{_noTruncate:!0,_batchKey:`exceptionEvent`,Zi:!0});return r&&this.wo.clear(),r}catch(e){yc.error(`Failed to capture exception event. Dropping this exception.`,e),this.wo.clear();return}}catch(e){yc.error(`Failed to process exception event. Ignoring this exception.`,e);return}}Mo(e){try{var t=this.wo.getAttachable();return t.length===0?e:N({},e,{$exception_steps:t})}catch(t){return yc.error(`Failed to read buffered exception steps. Capturing exception without steps.`,t),e}}Io(e){this.bo.enabled&&this.wo.add({[Fn]:e,[In]:new Date().toISOString()})}ko(e){return I(e)?N({},e):{}}_o(){return this._instance.config.error_tracking?.exception_steps??{}}Co(e){if(e.length===0)return!1;var t=e.reduce(((e,t)=>{var{type:n,value:r}=t;return R(n)&&n.length>0&&e.$exception_types.push(n),R(r)&&r.length>0&&e.$exception_values.push(r),e}),{$exception_types:[],$exception_values:[]});return this.mo.some((e=>{var n=e.values.map((e=>{var n=ls[e.operator],r=F(e.value)?e.value:[e.value],i=t[e.key]??[];return r.length>0&&n(r,i)}));return e.type===`OR`?n.some(Boolean):n.every(Boolean)}))}To(e){return e.flatMap((e=>e.stacktrace?.frames??[])).some((e=>e.filename&&e.filename.startsWith(`chrome-extension://`)))}Eo(e){if(e.length>0){var t,n,r=e[0].stacktrace?.frames??[],i=r[r.length-1];return(t=i==null||(n=i.filename)==null?void 0:n.includes(`posthog.com/static`))!=null&&t}return!1}So(e){return!B(e)&&F(e)}}},Ac=N({productTours:class{get zr(){return this._instance.persistence}constructor(e){this.Po=null,this.Ro=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(`productTours`in e){var t;if(this.zr&&this.zr.register({[rr]:!!e.productTours}),!nc(this._instance))return!this.Po&&B(this.zr?.props[Er])||tc.info(`product tours disabled; stopping and clearing cached tours`),(t=this.Po)==null||t.stop(),this.Po=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Po&&nc(this._instance)&&this.Mt((()=>this.Oo()))}Mt(e){var t,n;(t=A.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=A.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`product-tours`,(t=>{t?tc.error(`Could not load product tours script`,t):e()}))}Oo(){var e;!this.Po&&(e=A.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Po=A.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!F(this.Ro)||t){var n=this.zr;if(n){var r=n.props[Er];if(F(r)&&!t)return this.Ro=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/product_tours/?token=`+this._instance.config.token),method:`GET`,callback:t=>{if(nc(this._instance)){var r=t.statusCode;if(r!==200||!t.json){var i=`Product Tours API could not be loaded, status: `+r;tc.error(i),e([],{isLoaded:!1,error:i});return}var a=F(t.json.product_tours)?t.json.product_tours:[];this.Ro=a,n&&n.register({[Er]:a}),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Ro,{isLoaded:!0})}getActiveProductTours(e){B(this.Po)?e([],{isLoaded:!1,error:`Product tours not loaded`}):this.Po.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Po)==null||t.showTourById(e)}previewTour(e){this.Po?this.Po.previewTour(e):this.Mt((()=>{var t;this.Oo(),(t=this.Po)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Po)==null||e.dismissTour(`user_clicked_skip`)}nextStep(){var e;(e=this.Po)==null||e.nextStep()}previousStep(){var e;(e=this.Po)==null||e.previousStep()}clearCache(){var e;this.Ro=null,(e=this.zr)==null||e.unregister(Er)}resetTour(e){var t;(t=this.Po)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Po)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Po)==null||t.cancelPendingTour(e)}}},Ec),jc={siteApps:class{constructor(e){this.Lo=0,this._instance=e,this.Fo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ao(e,t){if(t){var n=this.globalsForEvent(t);this.Fo.push(n),this.Fo.length>1e3&&(this.Fo=this.Fo.slice(10))}}get siteAppLoaders(){var e;return(e=A._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Ao.bind(this));this.$o=()=>{e(),this.Fo=[],this.$o=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:N({},oe(e,rc),{properties:N({},e.properties,s?{$set:N({},e.properties?.$set??{},s)}:{},o?{$set_once:N({},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}}Do(e){var t=e.tagName?.toLowerCase();
2return t===`style`&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(ic.error(`prepare_external_dependency_stylesheet returned null`),null):t===`script`&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(ic.error(`prepare_external_dependency_script returned null`),null):e}No(){var e;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var t=E?.defaultView,n=t==null||(e=t.Node)==null?void 0:e.prototype;if(!t||!n)return()=>{};if(this.Lo++,this.qo)return this.jo();var r=[],i=this,a=new WeakSet,o=(e,t,n)=>{if(e!=null&&e[t]){var i=e[t];e[t]=n(i),r.push((()=>{e[t]=i}))}},s=e=>{if(a.has(e))return e;var t=i.Do(e);return t&&a.add(t),t},c=e=>e.map((e=>typeof e==`string`?e:s(e))).filter((e=>!z(e)));return o(n,`appendChild`,(e=>function(t){var n=s(t);return n?e.call(this,n):t})),o(n,`insertBefore`,(e=>function(t,n){var r=s(t);return r?e.call(this,r,n):t})),o(n,`replaceChild`,(e=>function(t,n){var r=s(t);return r?e.call(this,r,n):n})),[t.Element?.prototype,t.Document?.prototype,t.DocumentFragment?.prototype].forEach((e=>{o(e,`append`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,c(n))})),o(e,`prepend`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,c(n))}))})),[t.Element?.prototype,t.CharacterData?.prototype,t.DocumentType?.prototype].forEach((e=>{o(e,`before`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,c(n))})),o(e,`after`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,c(n))})),o(e,`replaceWith`,(e=>function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=c(n);return n.length&&!i.length?void 0:e.apply(this,i)}))})),o(t.Element?.prototype,`insertAdjacentElement`,(e=>function(t,n){var r=s(n);return r?e.call(this,t,r):null})),this.qo=()=>{r.forEach((e=>e())),this.qo=void 0},this.jo()}jo(){var e=!1;return()=>{var t;e||(e=!0,this.Lo--,this.Lo===0&&((t=this.qo)==null||t.call(this)))}}Bo(e,t){t===void 0&&(t=!0);var n=this.No();try{var r=e(n);return t&&n(),r}catch(e){throw n(),e}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var n;!t.errored&&this.Fo.length&&(ic.info(`Processing `+this.Fo.length+` events for site app with id `+e.id),this.Fo.forEach((e=>this.Bo((()=>t.processEvent==null?void 0:t.processEvent(e))))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&((n=this.$o)==null||n.call(this))},r=!1,i=i=>{t.errored=!i,t.loaded=!0,ic.info(`Site app with id `+e.id+` `+(i?`loaded`:`errored`)),r&&n()};try{var{processEvent:a}=this.Bo((t=>e.init({posthog:this._instance,callback(e){t(),i(e)}})),!1);a&&(t.processEvent=a),r=!0}catch(t){ic.error(ac+e.id,t),i(!1)}if(r&&t.loaded)try{n()}catch(n){ic.error(`Error while processing buffered events PostHog app with config id `+e.id,n),t.errored=!0}}Ho(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Uo(e){var t=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e),r=function(r){try{t.Bo((()=>r.processEvent==null?void 0:r.processEvent(n)))}catch(t){ic.error(`Error while processing event `+e.event+` for site app `+r.id,t)}};for(var i of Object.values(this.apps))r(i)}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Ho(),void this._instance.on(`eventCaptured`,(e=>this.Uo(e)))):void ic.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`);if((n=this.$o)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(e){var t;A[`__$$ph_site_app_`+e]=i._instance,(t=A.__PosthogExtensions__)==null||t.loadSiteApp==null||t.loadSiteApp(i._instance,s,(t=>{if(t)return ic.error(ac+e,t)}))};for(var{id:o,url:s}of e.siteApps)a(o)}else ic.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`)}}},Mc={tracingHeaders:class{constructor(e){this.zo=void 0,this.Vo=void 0,this.Wo=void 0,this.ao=()=>{var e,t,n=this.Go();n?(L(this.zo)&&(this.zo=(e=A.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),L(this.Vo)&&(this.Vo=(t=A.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null?void 0:t._patchFetch(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.co()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Mt(e){var t,n;(t=A.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns?e():(n=A.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`tracing-headers`,(t=>{if(t)return Ws.error(`failed to load script`,t);
2e()}))}Zo(){return this._instance.config.tracing_headers??this._instance.config.addTracingHeaders??this._instance.config.__add_tracing_headers}Go(){var e=this.Zo();return F(e)?(F(this.Wo)?this.Wo.splice(0,this.Wo.length,...e):this.Wo=[...e],e.length>0?this.Wo:void 0):(F(this.Wo)&&this.Wo.splice(0),this.Wo=e||void 0,this.Wo)}co(){var e,t;(e=this.zo)==null||e.call(this),(t=this.Vo)==null||t.call(this),this.zo=void 0,this.Vo=void 0}startIfEnabledOrStop(){this.Go()?this.Mt(this.ao):this.co()}}},Nc=N({surveys:class{get Se(){return this._instance.config}constructor(e){this.Qo=void 0,this._surveyManager=null,this.Jo=!1,this.Yo=[],this.Ko=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Se.disable_surveys){var t=e.surveys;if(B(t))return Q.warn(`Flags not loaded yet. Not loading surveys.`);var n=F(t);this.Qo=n?t.length>0:t,Q.info(`flags response received, isSurveysEnabled: `+this.Qo),this.loadIfEnabled()}}reset(){try{var e;(e=this._surveyEventReceiver)==null||e.reset(),localStorage.removeItem(`lastSeenSurveyDate`);for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(gs)||r!=null&&r.startsWith(`inProgressSurvey_`))&&t.push(r)}t.forEach((e=>localStorage.removeItem(e)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.Jo)Q.info(`Already initializing surveys, skipping...`);else if(this.Se.disable_surveys)Q.info(dc);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())Q.info(`Not loading surveys in cookieless mode without consent.`);else{var e=A?.__PosthogExtensions__;if(e){if(!L(this.Qo)||this.Se.advanced_enable_surveys){var t=this.Qo||this.Se.advanced_enable_surveys;this.Jo=!0;try{var n=e.generateSurveys;if(n)return void this.Xo(n,t);var r=e.loadExternalDependency;if(!r)return void this.ea(Ur);r(this._instance,`surveys`,(n=>{n||!e.generateSurveys?this.ea(`Could not load surveys script`,n):this.Xo(e.generateSurveys,t)}))}catch(e){throw this.ea(`Error initializing surveys`,e),e}finally{this.Jo=!1}}}else Q.error(`PostHog Extensions not found.`)}}Xo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new lc(this._instance),Q.info(`Surveys loaded successfully`),this.ta({isLoaded:!0})}ea(e,t){Q.error(e,t),this.ta({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Yo.push(e),this._surveyManager&&this.ta({isLoaded:!0}),()=>{this.Yo=this.Yo.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.Se.disable_surveys)return Q.info(dc),e([]);var n,r=this._instance.get_property(Cr);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<`u`&&this.Ko?this.Ko.then((t=>{var{surveys:n,context:r}=t;return e(n,r)})):(typeof Promise<`u`&&(this.Ko=new Promise((e=>{n=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/surveys/?token=`+this.Se.token),method:`GET`,timeout:this.Se.surveys_request_timeout_ms,callback:t=>{var r;this.Ko=null;var i=t.statusCode;if(i!==200||!t.json){var a=`Surveys API could not be loaded, status: `+i;Q.error(a);var o={isLoaded:!1,error:a};e([],o),n?.({surveys:[],context:o});return}var s,c=t.json.surveys||[],l=c.filter((e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(function(e){var t;return!((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null||!t.length)}(e)||function(e){var t;return!((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null||!t.length)}(e))));l.length>0&&((s=this._surveyEventReceiver)==null||s.register(l)),(r=this._instance.persistence)==null||r.register({[Cr]:c,[wr]:Date.now()});var u={isLoaded:!0};e(c,u),n?.({surveys:c,context:u})}}))}ta(e){for(var t of this.Yo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Q.error(`Error in survey callback`,e)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!B(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Q.warn(`init was not called`)}ra(e){var t=null;return this.getSurveys((n=>{t=n.find((t=>t.id===e))??null})),t}ia(e){if(B(this._surveyManager))return{eligible:!1,reason:uc};var t=typeof e==`string`?this.ra(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:`Survey not found`}}canRenderSurvey(e){if(B(this._surveyManager))return Q.warn(`init was not called`),{visible:!1,disabledReason:uc};var t=this.ia(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return B(this._surveyManager)?(Q.warn(`init was not called`),Promise.resolve({visible:!1,disabledReason:uc})):new Promise((n=>
2{this.getSurveys((t=>{var r=t.find((t=>t.id===e))??null;if(r){var i=this.ia(r);n({visible:i.eligible,disabledReason:i.reason})}else n({visible:!1,disabledReason:`Survey not found`})}),t)}))}renderSurvey(e,t,n){var r;if(B(this._surveyManager))Q.warn(`init was not called`);else{var i=typeof e==`string`?this.ra(e):e;if(i!=null&&i.id)if(_s.includes(i.type)){var a=E?.querySelector(t);if(a)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(Q.info(`Rendering survey `+i.id+` with delay of `+i.appearance.surveyPopupDelaySeconds+` seconds`),void setTimeout((()=>{var e;Q.info(`Rendering survey `+i.id+` with delay of `+i.appearance?.surveyPopupDelaySeconds+` seconds`),(e=this._surveyManager)==null||e.renderSurvey(i,a,n),Q.info(`Survey `+i.id+` rendered`)}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,a,n);Q.warn(`Survey element not found`)}else Q.warn(`Surveys of type `+i.type+` cannot be rendered in the app`);else Q.warn(`Survey not found`)}}displaySurvey(e,t){var n;if(B(this._surveyManager))Q.warn(`init was not called`);else{var r=this.ra(e);if(r){var i=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=N({},r,{appearance:N({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==Qa.Popover&&t.initialResponses&&Q.warn(`initialResponses is only supported for popover surveys. prefill will not be applied.`),!1===t.ignoreConditions){var a=this.canRenderSurvey(r);if(!a.visible)return void Q.warn(`Survey is not eligible to be displayed: `,a.disabledReason)}t.displayType===Qa.Inline?this.renderSurvey(i,t.selector,t.properties):this._surveyManager.handlePopoverSurvey(i,t)}else Q.warn(`Survey not found`)}}cancelPendingSurvey(e){B(this._surveyManager)?Q.warn(`init was not called`):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},Ec),Pc={toolbar:class{constructor(e){this.instance=e}na(e){A.ph_toolbar_state=e}sa(){return A.ph_toolbar_state??0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),ci(this.instance.config)||!C||!E)return!1;e??=C.location,n??=C.history;try{if(!t){try{C.localStorage.setItem(`test`,`test`),C.localStorage.removeItem(`test`)}catch{return!1}t=C?.localStorage}var r,i=fc||Da(e.hash,`__posthog`)||Da(e.hash,`state`),a=i?ri((()=>JSON.parse(atob(decodeURIComponent(i)))))||ri((()=>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(pc)||`{}`)).source=`localstorage`,delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}oa(e){var t=A.ph_load_toolbar||A.ph_load_editor;!B(t)&&ke(t)?t(e,this.instance):mc.warn(`No toolbar load function found`)}loadToolbar(e){var t=!(E==null||!E.getElementById(Rr));if(!C||t)return!1;var n=this.instance.requestRouter.region===`custom`&&this.instance.config.advanced_disable_toolbar_metrics,r=N({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor(`ui`)},n?{instrument:!1}:{});if(C.localStorage.setItem(pc,JSON.stringify(N({},r,{source:void 0}))),this.sa()===2)this.oa(r);else if(this.sa()===0){var i;this.na(1),(i=A.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,`toolbar`,(e=>{if(e)return mc.error(`[Toolbar] Failed to load`,e),void this.na(0);this.na(2),this.oa(r)})),q(C,`turbolinks:load`,(()=>{this.na(0),this.loadToolbar(r)}))}return!0}aa(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},Fc=N({experiments:Sc},Ec),Ic=N({},Ec,Dc,Oc,kc,Ac,jc,Nc,Mc,Pc,Fc,{conversations:class{constructor(e){this.la=void 0,this._conversationsManager=null,this.ua=!1,this.ha=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;B(t)||(Ne(t)?this.la=t:(this.la=t.enabled,this.ha=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.la=void 0,this.ha=null}loadIfEnabled(){if(!(this._conversationsManager||this.ua||this._instance.config.disable_conversations||ci(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=A?.__PosthogExtensions__;if(e&&!L(this.la)&&this.la)if(this.ha&&this.ha.token){this.ua=!0;try{var t=e.initConversations;if(t)return this.da(t),void(this.ua=!1);var n=e.loadExternalDependency;if(!n)return void this.ca(Ur);n(this._instance,`conversations`,(t=>{t||!e.initConversations?this.ca(`Could not load conversations script`,t):this.da(e.initConversations),this.ua=!1}))}catch(e){this.ca(`Error initializing conversations`,e),this.ua=!1}}else Cc.error(`Conversations enabled but missing token in remote config.`)}}da(e){if(this.ha)try{this._conversationsManager=e(this.ha,this._instance),Cc.info(`Conversations loaded successfully`)}
2catch(e){this.ca(`Error completing conversations initialization`,e)}else Cc.error(`Cannot complete initialization: remote config is null`)}ca(e,t){Cc.error(e,t),this._conversationsManager=null,this.ua=!1}show(){this._conversationsManager?this._conversationsManager.show():Cc.warn(`Conversations not loaded yet.`)}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.la&&!z(this._conversationsManager)}isVisible(){var e;return(e=this._conversationsManager?.isVisible())!=null&&e}sendMessage(e,t,n){var r=this;return M((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(Cc.warn(wc),null)}))()}getMessages(e,t){var n=this;return M((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(Cc.warn(wc),null)}))()}markAsRead(e){var t=this;return M((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(Cc.warn(wc),null)}))()}getTickets(e){var t=this;return M((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(Cc.warn(wc),null)}))()}requestRestoreLink(e){var t=this;return M((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(Cc.warn(wc),null)}))()}restoreFromToken(e){var t=this;return M((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(Cc.warn(wc),null)}))()}restoreFromUrlToken(){var e=this;return M((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Cc.warn(wc),null)}))()}getCurrentTicketId(){return this._conversationsManager?.getCurrentTicketId()??null}getWidgetSessionId(){return this._conversationsManager?.getWidgetSessionId()??null}en(){var e;(e=this._conversationsManager)==null||e.setIdentity()}tn(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.va=!1,this.fa=!1,this.Ae=W(`[logs]`),this._r=[],this.pa=[],this.ga=()=>{var e,t;(e=this.ma)==null||e.onReconnect(),(t=this.ya)==null||t.onReconnect()},this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.va=!0),C&&q(C,`online`,this.ga)}ba(e,t,n,r){var i,a=function(e,t){var n=e?.flushIntervalMs??3e3,r=e?.maxBufferSize??100,i=t!=null&&t.consoleCapture?void 0:e?.maxLogsPerInterval??1e3,a=L(i)?Math.max(r,2048):Math.max(r,i),o=e?.resourceAttributes;return{serviceName:o?.[`service.name`]??e?.serviceName??t?.serviceNameDefault,serviceVersion:o?.[`service.version`]??e?.serviceVersion,environment:o?.[`deployment.environment`]??e?.environment,resourceAttributes:o,beforeSend:e?.beforeSend,flushIntervalMs:n,maxBufferSize:r,maxQueueSize:a,maxBatchRecordsPerPost:100,rateCapWindowMs:n,maxLogsPerInterval:i,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((i=this._instance)==null||(i=i.config)==null?void 0:i.logs,n);return[new sn(this._a(e,t),a,this.Ae,(()=>this.wa()),(e=>e()),void 0,r),a]}xa(){var e,t,n=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;return this.ma&&this.ka===n||((t=this.ma)==null||t.reset(),this.ka=n,[this.ma,this.Sa]=this.ba((()=>this._r),(e=>{this._r=e}))),this.ma}Ca(){var e,t,n=(e=this._instance)==null||(e=e.config)==null?void 0:e.logs;return this.ya&&this.Ia===n||((t=this.ya)==null||t.reset(),this.Ia=n,[this.ya,this.Ta]=this.ba((()=>this.pa),(e=>{this.pa=e}),{serviceNameDefault:`posthog-browser-logs`,consoleCapture:!0},Tc)),this.ya}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t=e.logs?.captureConsoleLogs;!B(t)&&t&&(this.va=!0,this.loadIfEnabled())}reset(){var e,t;this._r=[],(e=this.ma)==null||e.reset(),this.pa=[],(t=this.ya)==null||t.reset()}captureLog(e){this.xa().captureLog(e)}le(e){this.Ca().captureLog(e)}get logger(){return this.Ea||={trace:(e,t)=>this.captureLog({body:e,level:`trace`,attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:`debug`,attributes:t}),info:(e,t)=>this.captureLog({body:e,level:`info`,attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:`warn`,attributes:t}),error:(e,t)=>this.captureLog({body:e,level:`error`,attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:`fatal`,attributes:t})},this.Ea}flushLogs(e){e?this.Ma(e):(this.ma&&this.ma.flush().catch((e=>this.Ae.error(`PostHog logs flush failed:`,e))),this.ya&&this.ya.flush().catch((e=>this.Ae.error(`PostHog logs flush failed:`,e))))}loadIfEnabled(){if(this.va&&!this.fa){var e=A?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,`logs`,(t=>{var n;t||(n=e.logs)==null||!n.initializeLogs?this.Ae.error(`Could not load logs script`,t):(e.logs.initializeLogs(this._instance),this.fa=!0)})):this.Ae.error(Ur)}else this.Ae.error(`PostHog Extensions not found.`)}}_a(e,t){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:t=>t===de.LogsQueue?e():void 0,setPersistedProperty(e,n){e===de.LogsQueue&&t(n??[])},ht:e=>this.ht(e),getLibraryId:()=>j.LIB_NAME,getLibraryVersion:()=>j.LIB_VERSION}}ht(e){return new Promise((t=>{var n=!1,r=e=>{n||(n=!0,clearTimeout(i),t(e))},i=setTimeout((()=>r({kind:`retry-later`,error:Error(`logs request timed out`)})),9e4);this._instance._send_request({method:`POST`,url:this.Pa(),data:e,compression:`best-available`,batchKey:`logs`,fireCallbackOnDrop:!0,callback(e){var t=e.statusCode;r(t>=200&&300>t?{kind:`ok`}:t===413?{kind:`too-large`}:t!==0&&t!==429&&500>t?{kind:`fatal`,error:Error(`logs request failed with status `+t)}
2:{kind:`retry-later`,error:e.error??Error(`logs request failed with status `+t)})}})}))}Ma(e){this._r.length>0&&this.Ra(e,this._r,this.Sa,j.LIB_NAME,(e=>{this._r=e})),this.pa.length>0&&this.Ra(e,this.pa,this.Ta,Tc,(e=>{this.pa=e}))}Ra(e,t,n,r,i){if(t.length!==0){var a=t.map((e=>e.record));i([]);var o=on(a,an(n,j.LIB_NAME,j.LIB_VERSION),r,j.LIB_VERSION);this._instance._send_request({method:`POST`,url:this.Pa(),data:o,compression:`best-available`,batchKey:`logs`,transport:e})}}Pa(){return this._instance.requestRouter.endpointFor(`api`,`/i/v1/logs`)+`?token=`+encodeURIComponent(this._instance.config.token)}wa(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n,windowId:r,sessionStartTimestamp:i,lastActivityTimestamp:a}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n,t.windowId=r,B(i)||(t.sessionStartTimestamp=i),B(a)||(t.lastActivityTimestamp=a)}if(A!=null&&(e=A.location)!=null&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?Xt(A.location.href):A.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t}}});Is.__defaultExtensionClasses=N({},Ic);var Lc=function(){j.SDK_DIST_CHANNEL=`npm`;var e=Cs[As]=new Is;return function(){function e(){e.done||(e.done=!0,js=!1,G(Cs,(function(e){e._dom_loaded()})))}E!=null&&E.addEventListener?E.readyState===`complete`?e():q(E,`DOMContentLoaded`,e,{capture:!1}):C&&U.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}(),Rc=`phc_vJGbRjim8pcz2yfi2qUpZPiyjNbac9puNq5SuEz3WKih`;typeof window<`u`&&Rc&&Lc.init(Rc,{api_host:`https://us.i.posthog.com`,persistence:`localStorage+cookie`,capture_pageview:!0,capture_pageleave:!0});export{p as a,s as c,ee as i,l,S as n,d as o,x as r,o as s,Lc as t}; 3//# sourceMappingURL=posthog-CGdSeGPJ.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.