1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c485e5fd-5500-51cd-a48e-9bf713f9a127")}catch(e){}}(); 3(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,604570,e=>{"use strict";e.s(["default",()=>nM]);var t="undefined"!=typeof window?window:void 0,i="undefined"!=typeof globalThis?globalThis:t,s=Array.prototype,r=s.forEach,n=s.indexOf,a=null==i?void 0:i.navigator,o=null==i?void 0:i.document,l=null==i?void 0:i.location,c=null==i?void 0:i.fetch,u=null!=i&&i.XMLHttpRequest&&"withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:void 0,h=null==i?void 0:i.AbortController,d=null==a?void 0:a.userAgent,p=null!=t?t:{},g={DEBUG:!1,LIB_VERSION:"1.258.3"},_="$copy_autocapture",v=["$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"],f=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),m=["fatal","error","warning","log","info","debug"];function y(e,t){return -1!==e.indexOf(t)}var b=function(e){return e.trim()},w=function(e){return e.replace(/^\$/,"")},E=Array.isArray,S=Object.prototype,x=S.hasOwnProperty,k=S.toString,$=E||function(e){return"[object Array]"===k.call(e)},I=e=>"function"==typeof e,F=e=>e===Object(e)&&!$(e),C=e=>{if(F(e)){for(var t in e)if(x.call(e,t))return!1;return!0}return!1},P=e=>void 0===e,R=e=>"[object String]"==k.call(e),T=e=>R(e)&&0===e.trim().length,O=e=>null===e,A=e=>P(e)||O(e),M=e=>"[object Number]"==k.call(e),D=e=>"[object Boolean]"===k.call(e),L=e=>y(v,e),N=e=>{var i={t:function(i){if(t&&(g.DEBUG||p.POSTHOG_DEBUG)&&!P(t.console)&&t.console){for(var s=("__rrweb_original__"in t.console[i])?t.console[i].__rrweb_original__:t.console[i],r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];s(e,...n)}},info:function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];i.t("log",...t)},warn:function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];i.t("warn",...t)},error:function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];i.t("error",...t)},critical:function(){for(var t=arguments.length,i=Array(t),s=0;s<t;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning:e=>{i.error("You must initialize PostHog before calling "+e)},createLogger:t=>N(e+" "+t)};return i},q=N("[PostHog.js]"),j=q.createLogger,B=j("[ExternalScriptsLoader]"),H=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return B.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==o?void 0:o.querySelectorAll("script");if(s){for(var r=0;r<s.length;r++)if(s[r].src===t)return i()}var n=()=>{if(!o)return i("document not found");var s=o.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>i(void 0,e),s.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");var r,n=o.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):o.body.appendChild(s)};null!=o&&o.body?n():null==o||o.addEventListener("DOMContentLoaded",n)};function z(){return(z=Object.assign.bind()).apply(null,arguments)}function U(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}p.__PosthogExtensions__=p.__PosthogExtensions__||{},p.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var s="/static/"+t+".js?v="+e.version;"remote-config"===t&&(s="/array/"+e.config.token+"/config.js"),"toolbar"===t&&(s=s+"&t="+3e5*Math.floor(Date.now()/3e5));var r=e.requestRouter.endpointFor("assets",s);H(e,r,i)},p.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);H(e,s,i)};var G={};function V(e,t,i){if($(e)){if(r&&e.forEach===r)e.forEach(t,i);else if("length"in e&&e.length===+e.length){for(var s=0,n=e.length;s<n;s++)if(s in e&&t.call(i,e[s],s)===G)return}}}function W(e,t,i){if(!A(e)){if($(e))return V(e,t,i);if(e instanceof FormData){for(var s of e.entries())if(t.call(i,s[1],s[0])===G)return}else for(var r in e)if(x.call(e,r)&&t.call(i,e[r],r)===G)return}}var Y=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return V(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e},J=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return V(i,function(t){V(t,function(t){e.push(t)})}),e};function K(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var Z=function(e){try{return e()}catch(e){return}},X=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;s<t;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){q.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),q.critical(e)}}},Q=function(e){var t={};return W(e,function(e,i){(R(e)&&e.length>0||M(e))&&(t[i]=e)}),t},ee=["herokuapp.com","vercel.app","netlify.app"];function et(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function ei(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}var es="$people_distinct_id",er="__alias",en="__timers",ea="$autocapture_disabled_server_side",eo="$heatmaps_enabled_server_side",el="$exception_capture_enabled_server_side",ec="$error_tracking_suppression_rules",eu="$error_tracking_capture_extension_exceptions",eh="$web_vitals_enabled_server_side",ed="$dead_clicks_enabled_server_side",ep="$web_vitals_allowed_metrics",eg="$session_recording_enabled_server_side",e_="$console_log_recording_enabled_server_side",ev="$session_recording_network_payload_capture",ef="$session_recording_masking",em="$session_recording_canvas_recording",ey="$replay_sample_rate",eb="$replay_minimum_duration",ew="$replay_script_config",eE="$sesid",eS="$session_is_sampled",ex="$session_recording_url_trigger_activated_session",ek="$session_recording_event_trigger_activated_session",e$="$enabled_feature_flags",eI="$early_access_features",eF="$feature_flag_details",eC="$stored_person_properties",eP="$stored_group_properties",eR="$surveys",eT="$surveys_activated",eO="$flag_call_reported",eA="$user_state",eM="$client_session_props",eD="$capture_rate_limit",eL="$initial_campaign_params",eN="$initial_referrer_info",eq="$initial_person_info",ej="$epp",eB="__POSTHOG_TOOLBAR__",eH="$posthog_cookieless",ez=[es,er,"__cmpns",en,eg,eo,eE,e$,ec,eA,eI,eF,eP,eC,eR,eO,eM,eD,eL,eN,ej,eq];function eU(e){return e instanceof Element&&(e.id===eB||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function eG(e){return!!e&&1===e.nodeType}function eV(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}
3function eW(e){return!!e&&3===e.nodeType}function eY(e){return!!e&&11===e.nodeType}function eJ(e){return e?b(e).split(/\s+/):[]}function eK(e){var i=null==t?void 0:t.location.href;return!!(i&&e&&e.some(e=>i.match(e)))}function eZ(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 eJ(t)}function eX(e){return A(e)?null:b(e).split(/(\s+)/).filter(e=>tt(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function eQ(e){var t="";return e3(e)&&!e5(e)&&e.childNodes&&e.childNodes.length&&W(e.childNodes,function(e){var i;eW(e)&&e.textContent&&(t+=null!=(i=eX(e.textContent))?i:"")}),b(t)}function e0(e){var t;return P(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var e1=["a","button","form","input","select","textarea","label"];function e2(e){var t=e.parentNode;return!(!t||!eG(t))&&t}function e3(e){for(var t=e;t.parentNode&&!eV(t,"body");t=t.parentNode){var i=eZ(t);if(y(i,"ph-sensitive")||y(i,"ph-no-capture"))return!1}if(y(eZ(e),"ph-include"))return!0;var s=e.type||"";if(R(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";return!(R(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function e5(e){return!!(eV(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||eV(e,"select")||eV(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var e6="(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})",e8=RegExp("^(?:"+e6+")$"),e4=new RegExp(e6),e7="\\d{3}-?\\d{2}-?\\d{4}",e9=RegExp("^("+e7+")$"),te=RegExp("("+e7+")");function tt(e,t){return void 0===t&&(t=!0),!(A(e)||R(e)&&(e=b(e),(t?e8:e4).test((e||"").replace(/[- ]/g,""))||(t?e9:te).test(e)))&&!0}function ti(e){var t=eQ(e);return tt(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&W(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=eQ(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){q.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function ts(e){return e.replace(/"|\\"/g,'\\"')}class tr{isRageClick(e,t,i){var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<30&&i-s.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}constructor(){this.clicks=[]}}var tn=["localhost","127.0.0.1"],ta=e=>{var t=null==o?void 0:o.createElement("a");return P(t)?null:(t.href=e,t)},to=function(e,t){void 0===t&&(t="&");var i,s,r=[];return W(e,function(e,t){P(e)||P(t)||"undefined"===t||(i=encodeURIComponent(e instanceof File?e.name:e.toString()),s=encodeURIComponent(t),r[r.length]=s+"="+i)}),r.join(t)},tl=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<s.length;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!$(i)||i.length<2)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){q.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},tc=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[0]||"",n=s[1],a=r.split("?"),o=a[1],l=a[0],c=(o||"").split("&"),u=[],h=0;h<c.length;h++){var d=c[h].split("=");$(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(c[h]))}var p=l;return null!=o&&(p+="?"+u.join("&")),null!=n&&(p+="#"+n),p},tu=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},th=j("[AutoCapture]");function td(e,t){return t.length>e?t.slice(0,e)+"...":t}class tp{get S(){var e,t,i=F(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}
3$(){if(this.isBrowserSupported()){if(t&&o){var e=e=>{e=e||(null==t?void 0:t.event);try{this.k(e)}catch(e){th.error("Failed to capture event",e)}};if(ei(o,"submit",e,{capture:!0}),ei(o,"change",e,{capture:!0}),ei(o,"click",e,{capture:!0}),this.S.capture_copied_text){var i=e=>{e=e||(null==t?void 0:t.event),this.k(e,_)};ei(o,"copy",i,{capture:!0}),ei(o,"cut",i,{capture:!0})}}}else th.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.i&&(this.$(),this.i=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.h=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ea]:!!e.autocapture_opt_out}),this.o=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.m=e}getElementSelectors(e){var t,i=[];return null==(t=this.m)||t.forEach(t=>{var s=null==o?void 0:o.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[ea];if(O(this.o)&&!D(i)&&!this.instance.I())return!1;var s=null!=(t=this.o)?t:!!i;return!!this.instance.config.autocapture&&!s}k(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var s,r=e0(e);eW(r)&&(r=r.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(s=this.rageclicks)&&s.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.k(e,"$rageclick");var n=i===_;if(r&&function(e,i,s,r,n){if(void 0===s&&(s=void 0),!t||!e||eV(e,"html")||!eG(e)||null!=(a=s)&&a.url_allowlist&&!eK(s.url_allowlist)||null!=(o=s)&&o.url_ignorelist&&eK(s.url_ignorelist))return!1;if(null!=(l=s)&&l.dom_event_allowlist){var a,o,l,c=s.dom_event_allowlist;if(c&&!c.some(e=>i.type===e))return!1}for(var u=!1,h=[e],d=!0,p=e;p.parentNode&&!eV(p,"body");)if(eY(p.parentNode))h.push(p.parentNode.host),p=p.parentNode.host;else{if(!(d=e2(p)))break;if(r||e1.indexOf(d.tagName.toLowerCase())>-1)u=!0;else{var g=t.getComputedStyle(d);g&&"pointer"===g.getPropertyValue("cursor")&&(u=!0)}h.push(d),p=d}if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(P(i))return!0;var s,r=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(h,s)||!function(e,t){var i=null==t?void 0:t.css_selector_allowlist;if(P(i))return!0;var s,r=function(e){if(i.some(t=>e.matches(t)))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(h,s))return!1;var _=t.getComputedStyle(e);if(_&&"pointer"===_.getPropertyValue("cursor")&&"click"===i.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(i.type)>=0;default:return u?(n||["click"]).indexOf(i.type)>=0:(n||["click"]).indexOf(i.type)>=0&&(e1.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.S,n,n?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=function(e,i){for(var s,r,{e:n,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:c}=i,u=[e],h=e;h.parentNode&&!eV(h,"body");)eY(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var d,p=[],g={},_=!1,v=!1;if(W(u,e=>{var t=e3(e);"a"===e.tagName.toLowerCase()&&(_=e.getAttribute("href"),_=t&&_&&tt(_)&&_),y(eZ(e),"ph-no-capture")&&(v=!0),p.push(function(e,t,i,s){var r=e.tagName.toLowerCase(),n={tag_name:r};e1.indexOf(r)>-1&&!i&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?n.$el_text=td(1024,ti(e)):n.$el_text=td(1024,eQ(e)));var a=eZ(e);a.length>0&&(n.classes=a.filter(function(e){return""!==e})),W(e.attributes,function(i){var r;if((!e5(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&tt(i.value)&&(!R(r=i.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){var a=i.value;"class"===i.name&&(a=eJ(a).join(" ")),n["attr__"+i.name]=td(1024,a)}});for(var o=1,l=1,c=e;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!eG(t))return t}(c);)o++,c.tagName===e.tagName&&l++;return n.nth_child=o,n.nth_of_type=l,n}(e,a,o,l)),Y(g,function(e){if(!e3(e))return{};var t={};return W(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),s=e.value;i&&s&&tt(s)&&(t[i]=s)}}),t}(e))}),v)return{props:{},explicitNoCapture:v};if(o||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=ti(e):p[0].$el_text=eQ(e)),_){p[0].attr__href=_;
3var f,m,b=null==(f=ta(_))?void 0:f.host,w=null==t||null==(m=t.location)?void 0:m.host;b&&w&&b!==w&&(d=_)}return{props:Y({$event_type:n.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:p.map(e=>{var t,i,s,r={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(s=e.attr__href)?void 0:s.slice(0,2048),attr_class:(t=e.attr__class)?$(t)?t:eJ(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return K(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return r.attributes[t]=i}),r}).map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=z({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return K(n).sort((e,t)=>{var[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{var[t,i]=e;return a[ts(t.toString())]=ts(i.toString())}),s+=":",s+=K(a).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(s=p[0])&&s.$el_text?{$el_text:null==(r=p[0])?void 0:r.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},g)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.S.element_attribute_ignorelist,elementsChainAsString:this.h});if(o)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),i===_){var c,u=eX(null==t||null==(c=t.getSelection())?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=h}return this.instance.capture(i,a),!0}}}isBrowserSupported(){return I(null==o?void 0:o.querySelectorAll)}constructor(e){this.i=!1,this.o=null,this.rageclicks=new tr,this.h=!1,this.instance=e,this.m=null}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return M(e)&&isFinite(e)&&Math.floor(e)===e});var tg="0123456789abcdef";class t_{static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||e<0||t<0||i<0||s<0||e>0xffffffffffff||t>4095||i>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");var r=new Uint8Array(16);return r[0]=e/0x10000000000,r[1]=e/0x100000000,r[2]=e/0x1000000,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new t_(r)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+tg.charAt(this.bytes[t]>>>4)+tg.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new t_(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}}class tv{generate(){var e=this.generateOrAbort();if(P(e)){this.P=0;var t=this.generateOrAbort();if(P(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.P)this.P=e,this.M();else{if(!(e+1e4>this.P))return;this.R++,this.R>0x3ffffffffff&&(this.P++,this.M())}return t_.fromFieldsV7(this.P,Math.trunc(this.R/0x40000000),0x3fffffff&this.R,this.T.nextUint32())}M(){this.R=1024*this.T.nextUint32()+(1023&this.T.nextUint32())}constructor(){this.P=0,this.R=0,this.T=new ty}}var tf,tm=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};t&&!P(t.crypto)&&crypto.getRandomValues&&(tm=e=>crypto.getRandomValues(e));class ty{nextUint32(){return this.F>=this.C.length&&(tm(this.C),this.F=0),this.C[this.F++]}constructor(){this.C=new Uint32Array(8),this.F=1/0}}var tb=()=>tw().toString(),tw=()=>(tf||(tf=new tv)).generate(),tE="",tS=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,tx={O:()=>!!o,A:function(e){q.error("cookieStore error: "+e)},D:function(e){if(o){try{for(var t=e+"=",i=o.cookie.split(";").filter(e=>e.length),s=0;s<i.length;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},L:function(e){var t;try{t=JSON.parse(tx.D(e))||{}}catch(e){}return t},j:function(e,t,i,s,r){if(o)try{var n="",a="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=o),tE)return tE;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+tb();!tE&&s--;){var n=i.slice(s).join("."),a=r+"=1;domain=."+n+";path=/";t.cookie=a+";max-age=3",t.cookie.includes(r)&&(t.cookie=a+";max-age=0",tE=n)}return tE}(e);if(!i){var s,r=(s=e.match(tS))?s[0]:"";r!==i&&q.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(o.location.hostname,s);if(i){var c=new Date;c.setTime(c.getTime()+24*i*36e5),n="; expires="+c.toUTCString()}r&&(a="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+a;return u.length>3686.4&&q.warn("cookieStore warning: large cookie, len="+u.length),o.cookie=u,u}catch(e){return}}
3,N:function(e,t){try{tx.j(e,"",-1,t)}catch(e){return}}},tk=null,t$={O:function(){if(!O(tk))return tk;var e=!0;if(P(t))e=!1;else try{var i="__mplssupport__";t$.j(i,"xyz"),'"xyz"'!==t$.D(i)&&(e=!1),t$.N(i)}catch(t){e=!1}return e||q.error("localStorage unsupported; falling back to cookie store"),tk=e,e},A:function(e){q.error("localStorage error: "+e)},D:function(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(e){t$.A(e)}return null},L:function(e){try{return JSON.parse(t$.D(e))||{}}catch(e){}return null},j:function(e,i){try{null==t||t.localStorage.setItem(e,JSON.stringify(i))}catch(e){t$.A(e)}},N:function(e){try{null==t||t.localStorage.removeItem(e)}catch(e){t$.A(e)}}},tI=["distinct_id",eE,eS,ej,eq],tF=z({},t$,{L:function(e){try{var t={};try{t=tx.L(e)||{}}catch(e){}var i=Y(t,JSON.parse(t$.D(e)||"{}"));return t$.j(e,i),i}catch(e){}return null},j:function(e,t,i,s,r,n){try{t$.j(e,t,void 0,void 0,n);var a={};tI.forEach(e=>{t[e]&&(a[e]=t[e])}),Object.keys(a).length&&tx.j(e,a,i,s,r,n)}catch(e){t$.A(e)}},N:function(e,i){try{null==t||t.localStorage.removeItem(e),tx.N(e,i)}catch(e){t$.A(e)}}}),tC={},tP={O:function(){return!0},A:function(e){q.error("memoryStorage error: "+e)},D:function(e){return tC[e]||null},L:function(e){return tC[e]||null},j:function(e,t){tC[e]=t},N:function(e){delete tC[e]}},tR=null,tT={O:function(){if(!O(tR))return tR;if(tR=!0,P(t))tR=!1;else try{var e="__support__";tT.j(e,"xyz"),'"xyz"'!==tT.D(e)&&(tR=!1),tT.N(e)}catch(e){tR=!1}return tR},A:function(e){q.error("sessionStorage error: ",e)},D:function(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(e){tT.A(e)}return null},L:function(e){try{return JSON.parse(tT.D(e))||null}catch(e){}return null},j:function(e,i){try{null==t||t.sessionStorage.setItem(e,JSON.stringify(i))}catch(e){tT.A(e)}},N:function(e){try{null==t||t.sessionStorage.removeItem(e)}catch(e){tT.A(e)}}},tO=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class tA{get S(){return this._instance.config}get consent(){return this.U()?tO.DENIED:this.q}isOptedOut(){return this.consent===tO.DENIED||this.consent===tO.PENDING&&this.S.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.B.j(this.H,+!!e,this.S.cookie_expiration,this.S.cross_subdomain_cookie,this.S.secure_cookie)}reset(){this.B.N(this.H,this.S.cross_subdomain_cookie)}get H(){var{token:e,opt_out_capturing_cookie_prefix:t}=this._instance.config;return(t||"__ph_opt_in_out_")+e}get q(){var e=this.B.D(this.H);return"1"===e?tO.GRANTED:"0"===e?tO.DENIED:tO.PENDING}get B(){if(!this.W){var e=this.S.opt_out_capturing_persistence_type;this.W="localStorage"===e?t$:tx;var t="localStorage"===e?tx:t$;t.D(this.H)&&(this.W.D(this.H)||this.optInOut("1"===t.D(this.H)),t.N(this.H,this.S.cross_subdomain_cookie))}return this.W}U(){return!!this.S.respect_dnt&&!!et([null==a?void 0:a.doNotTrack,null==a?void 0:a.msDoNotTrack,p.doNotTrack],e=>y([!0,1,"1","yes"],e))}constructor(e){this._instance=e}}var tM=j("[Dead Clicks]"),tD=()=>!0,tL=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(ed)),s=e.instance.config.capture_dead_clicks;return D(s)?s:i};class tN{get lazyLoadedDeadClicksAutocapture(){return this.G}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[ed]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.J(()=>{this.V()})}J(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?tM.error("failed to load script",t):e()})}V(){var e;if(o){if(!this.G&&null!=(e=p.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=F(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.G=p.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.G.start(o),tM.info("starting...")}}else tM.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,tM.info("stopping..."))}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}}function tq(e,t,i,s,r){return t>i&&(q.warn("min cannot be greater than max."),t=i),M(e)?e>i?(s&&q.warn(s+" cannot be greater than max: "+i+". Using max value instead."),i):e<t?(s&&q.warn(s+" cannot be less than min: "+t+". Using min value instead."),t):e:(s&&q.warn(s+" must be a number. using max or fallback. max: "+i+", fallback: "+r),tq(r||i,t,i,s))}class tj{constructor(e){this.K={},this.Y=()=>
3{Object.keys(this.K).forEach(e=>{var t=this.X(e)+this.Z;t>=this.tt?delete this.K[e]:this.it(e,t)})},this.X=e=>this.K[String(e)],this.it=(e,t)=>{this.K[String(e)]=t},this.consumeRateLimit=e=>{var t,i=null!=(t=this.X(e))?t:this.tt;if(0===(i=Math.max(i-1,0)))return!0;this.it(e,i);var s,r=0===i;return r&&(null==(s=this.et)||s.call(this,e)),r},this.rt=e,this.et=this.rt.et,this.tt=tq(this.rt.bucketSize,0,100,"rate limiter bucket size"),this.Z=tq(this.rt.refillRate,0,this.tt,"rate limiter refill rate"),this.st=tq(this.rt.refillInterval,0,864e5,"rate limiter refill interval"),setInterval(()=>{this.Y()},this.st)}}var tB=j("[ExceptionAutocapture]");class tH{vt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return F(e)?t=z({},t,e):(P(e)?this.dt:e)&&(t=z({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.S.capture_console_errors||this.S.capture_unhandled_errors||this.S.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(tB.info("enabled"),this.J(this.nt))}J(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return tB.error("failed to load script",t);e()})}ht(){var e,t,i;null==(e=this.ot)||e.call(this),this.ot=void 0,null==(t=this.lt)||t.call(this),this.lt=void 0,null==(i=this.ut)||i.call(this),this.ut=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.dt=!!t,this.S=this.vt(),this._instance.persistence&&this._instance.persistence.register({[el]:this.dt}),this.startIfEnabled()}captureException(e){e.$exception_personURL=this._instance.requestRouter.endpointFor("ui")+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id();var t,i=null!=(t=e.$exception_list[0].type)?t:"Exception";this.ct.consumeRateLimit(i)?tB.info("Skipping exception capture because of client rate limiting.",{exception:e.$exception_list[0].type}):this._instance.exceptions.sendExceptionEvent(e)}constructor(e){var i,s,r;this.nt=()=>{var e;if(t&&this.isEnabled&&null!=(e=p.__PosthogExtensions__)&&e.errorWrappingFunctions){var i=p.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=p.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=p.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ot&&this.S.capture_unhandled_errors&&(this.ot=i(this.captureException.bind(this))),!this.lt&&this.S.capture_unhandled_rejections&&(this.lt=s(this.captureException.bind(this))),!this.ut&&this.S.capture_console_errors&&(this.ut=r(this.captureException.bind(this)))}catch(e){tB.error("failed to start",e),this.ht()}}},this._instance=e,this.dt=!(null==(i=this._instance.persistence)||!i.props[el]),this.S=this.vt(),this.ct=new tj({refillRate:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?s:1,bucketSize:null!=(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?r:10,refillInterval:1e4}),this.startIfEnabled()}}function tz(e){return!P(Event)&&tU(e,Event)}function tU(e,t){try{return e instanceof t}catch(e){return!1}}function tG(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return tU(e,Error)}}function tV(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function tW(e){return tV(e,"DOMError")}var tY=/\(error: (.*)\)/;function tJ(e,t,i,s){var r={platform:"web:javascript",filename:e,function:"<anonymous>"===t?"?":t,in_app:!0};return P(i)||(r.lineno=i),P(s)||(r.colno=s),r}var tK,tZ,tX,tQ=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,t0=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,t1=/\((\S*)(?::(\d+))(?::(\d+))\)/,t2=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,t3=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,t5=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];var s=t.sort((e,t)=>
3e[0]-t[0]).map(e=>e[1]);return function(e,t){void 0===t&&(t=0);for(var i=[],r=e.split("\n"),n=t;n<r.length;n++){var a=r[n];if(!(a.length>1024)){var o=tY.test(a)?a.replace(tY,"$1"):a;if(!o.match(/\S*Error: /)){for(var l of s){var c=l(o);if(c){i.push(c);break}}if(i.length>=50)break}}}if(!i.length)return[];var u=Array.from(i);return u.reverse(),u.slice(0,50).map(e=>{var t;return z({},e,{filename:e.filename||((t=u)[t.length-1]||{}).filename,function:e.function||"?"})})}}([30,e=>{var t=tQ.exec(e);if(t){var[,i,s,r]=t;return tJ(i,"?",+s,+r)}var n=t0.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){var a=t1.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}var[o,l]=t6(n[1]||"?",n[2]);return tJ(l,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{var t=t2.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var i=t3.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}var s=t[3],r=t[1]||"?";return[r,s]=t6(r,s),tJ(s,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),t6=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},t8=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function t4(e,t){void 0===t&&(t=0);var i=e.stacktrace||e.stack||"",s=e&&t7.test(e.message)?1:0;try{var r,n,a=(r=t5(i,s),n=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var i=Object.keys(t);return tX&&i.length===tZ||(tZ=i.length,tX=i.reduce((i,s)=>{tK||(tK={});var r=tK[s];if(r)i[r[0]]=r[1];else for(var n=e(s),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,c=t[s];if(l&&c){i[l]=c,tK[s]=[l,c];break}}return i},{})),tX}(t5),r.forEach(e=>{e.filename&&(e.chunk_id=n[e.filename])}),r);return a.slice(0,a.length-t)}catch(e){}return[]}var t7=/Minified React error #\d+;/i;function t9(e,t){return{$exception_list:function e(t,i){var s,r,n,a,o,l,c,u,h=(s=t,r=i,l=t4(s),c=null==(a=null==r?void 0:r.handled)||a,u=null!=(o=null==r?void 0:r.synthetic)&&o,{type:null!=r&&r.overrideExceptionType?r.overrideExceptionType:s.name,value:(n=s.message).error&&"string"==typeof n.error.message?String(n.error.message):String(n),stacktrace:{frames:l,type:"raw"},mechanism:{handled:c,synthetic:u}});return t.cause&&tG(t.cause)&&t.cause!==t?[h,...e(t.cause,{handled:null==i?void 0:i.handled,synthetic:null==i?void 0:i.synthetic})]:[h]}(e,t),$exception_level:"error"}}function ie(e,t){var i,s,r,n=null==(i=null==t?void 0:t.handled)||i,a=null==(s=null==t?void 0:t.synthetic)||s,o={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!=(r=null==t?void 0:t.defaultExceptionType)?r:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:n,synthetic:a}};if(null!=t&&t.syntheticException){var l=t4(t.syntheticException,1);l.length&&(o.stacktrace={frames:l,type:"raw"})}return{$exception_list:[o],$exception_level:"error"}}function it(e,t,i){try{if(!(t in e))return()=>{};var s=e[t],r=i(s);return I(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=s}}catch(e){return()=>{}}}class ii{get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(q.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.gt&&this.gt(),this.gt=void 0,q.info("History API monitoring stopped")}monitorHistoryChanges(){var e,i;if(t&&t.history){var s=this;null!=(e=t.history.pushState)&&e.__posthog_wrapped__||it(t.history,"pushState",e=>function(t,i,r){e.call(this,t,i,r),s._t("pushState")}),null!=(i=t.history.replaceState)&&i.__posthog_wrapped__||it(t.history,"replaceState",e=>function(t,i,r){e.call(this,t,i,r),s._t("replaceState")}),this.bt()}}_t(e){try{var i,s=null==t||null==(i=t.location)?void 0:i.pathname;if(!s)return;s!==this.ft&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ft=s}catch(t){q.error("Error capturing "+e+" pageview",t)}}bt(){if(!this.gt){var e=()=>{this._t("popstate")};ei(t,"popstate",e),this.gt=()=>{t&&t.removeEventListener("popstate",e)}}}constructor(e){var i;this._instance=e,this.ft=(null==t||null==(i=t.location)?void 0:i.pathname)||""}}function is(e){var t,i;return(null==(t=JSON.stringify(e,(i=[],function(e,t){if(F(t)){for(;i.length>0&&i[i.length-1]!==this;)i.pop();return i.includes(t)?"[Circular]":(i.push(t),t)}return t})))?void 0:t.length)||0}var ir=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ir||{}),ia=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(ia||{}),io="[SessionRecording]",il="redacted",ic={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},iu=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],ih=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],id=["/s/","/e/","/i/"];function ip(e,t,i,s){if(A(e))return e;var r=(null==t?void 0:t["content-length"])||new Blob([e]).size;return R(r)&&(r=parseInt(r)),r>i?io+" "+s+" body too large to record ("+r+" bytes)":e}function ig(e,t){if(A(e))return e;var i=e;return tt(i,!1)||(i=io+" "+t+" body "+il),W(ih,e=>{var s,r;null!=(s=i)&&s.length&&-1!==(null==(r=i)?void 0:r.indexOf(e))&&(i=io+" "+t+" body "+il+" as might contain: "+e)}),i}class i_{constructor(e,t){var i,s;void 0===t&&(t={}),this.yt={},this.wt=e=>{if(!this.yt[e]){this.yt[e]=!0;var t,i,s=this.St(e);null==(t=(i=this.rt).onBlockedNode)||t.call(i,e,s)}},this.$t=e=>{var t=this.St(e);
3if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var i=t.closest("svg");if(i)return[this._rrweb.mirror.getId(i),i]}return[e,t]},this.St=e=>this._rrweb.mirror.getNode(e),this.xt=e=>{var t,i,s,r,n,a,o,l;return(null!=(t=null==(i=e.removes)?void 0:i.length)?t:0)+(null!=(s=null==(r=e.attributes)?void 0:r.length)?s:0)+(null!=(n=null==(a=e.texts)?void 0:a.length)?n:0)+(null!=(o=null==(l=e.adds)?void 0:l.length)?o:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,i=this.xt(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var[t]=this.$t(e.id);return!this.ct.consumeRateLimit(t)&&e}));var s=this.xt(t);return 0!==s||i===s?e:void 0},this._rrweb=e,this.rt=t,this.ct=new tj({bucketSize:null!=(i=this.rt.bucketSize)?i:100,refillRate:null!=(s=this.rt.refillRate)?s:10,refillInterval:1e3,et:this.wt})}}var iv=Uint8Array,im=Uint16Array,iy=Uint32Array,ib=new iv([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]),iw=new iv([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]),iE=new iv([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iS=function(e,t){for(var i=new im(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];var r=new iy(i[30]);for(s=1;s<30;++s)for(var n=i[s];n<i[s+1];++n)r[n]=n-i[s]<<5|s;return[i,r]},ix=iS(ib,2),ik=ix[0],i$=ix[1];ik[28]=258,i$[258]=28;for(var iI=iS(iw,0)[1],iF=new im(32768),iC=0;iC<32768;++iC){var iP=(43690&iC)>>>1|(21845&iC)<<1;iP=(61680&(iP=(52428&iP)>>>2|(13107&iP)<<2))>>>4|(3855&iP)<<4,iF[iC]=((65280&iP)>>>8|(255&iP)<<8)>>>1}var iR=function(e,t,i){for(var s=e.length,r=0,n=new im(t);r<s;++r)++n[e[r]-1];var a,o=new im(t);for(r=0;r<t;++r)o[r]=o[r-1]+n[r-1]<<1;if(i){a=new im(1<<t);var l=15-t;for(r=0;r<s;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],h=o[e[r]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)a[iF[h]>>>l]=c}else for(a=new im(s),r=0;r<s;++r)a[r]=iF[o[e[r]-1]++]>>>15-e[r];return a},iT=new iv(288);for(iC=0;iC<144;++iC)iT[iC]=8;for(iC=144;iC<256;++iC)iT[iC]=9;for(iC=256;iC<280;++iC)iT[iC]=7;for(iC=280;iC<288;++iC)iT[iC]=8;var iO=new iv(32);for(iC=0;iC<32;++iC)iO[iC]=5;var iA=iR(iT,9,0),iM=iR(iO,5,0),iD=function(e){return(e/8|0)+(7&e&&1)},iL=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof im?im:e instanceof iy?iy:iv)(i-t);return s.set(e.subarray(t,i)),s},iN=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8},iq=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8,e[s+2]|=i>>>16},ij=function(e,t){for(var i=[],s=0;s<e.length;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new iv(0),0];if(1==r){var a=new iv(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],l=i[1],c=0,u=1,h=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=r-1;)o=i[i[c].f<i[h].f?c++:h++],l=i[c!=u&&i[c].f<i[h].f?c++:h++],i[u++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(s=1;s<r;++s)n[s].s>d&&(d=n[s].s);var p=new im(d+1),g=iB(i[u-1],p,0);if(g>t){s=0;var _=0,v=g-t,f=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s<r;++s){var m=n[s].s;if(!(p[m]>t))break;_+=f-(1<<g-p[m]),p[m]=t}for(_>>>=v;_>0;){var y=n[s].s;p[y]<t?_-=1<<t-p[y]++-1:++s}for(;s>=0&&_;--s){var b=n[s].s;p[b]==t&&(--p[b],++_)}g=t}return[new iv(p),g]},iB=function(e,t,i){return -1==e.s?Math.max(iB(e.l,t,i+1),iB(e.r,t,i+1)):t[e.s]=i},iH=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new im(++t),s=0,r=e[0],n=1,a=function(e){i[s++]=e},o=1;o<=t;++o)if(e[o]==r&&o!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(r),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(r);n=1,r=e[o]}return[i.subarray(0,s),t]},iz=function(e,t){for(var i=0,s=0;s<t.length;++s)i+=e[s]*t[s];return i},iU=function(e,t,i){var s=i.length,r=iD(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;n<s;++n)e[r+n+4]=i[n];return 8*(r+4+s)},iG=function(e,t,i,s,r,n,a,o,l,c,u){iN(t,u++,i),++r[256];for(var h=ij(r,15),d=h[0],p=h[1],g=ij(n,15),_=g[0],v=g[1],f=iH(d),m=f[0],y=f[1],b=iH(_),w=b[0],E=b[1],S=new im(19),x=0;x<m.length;++x)S[31&m[x]]++;for(x=0;x<w.length;++x)S[31&w[x]]++;for(var k=ij(S,7),$=k[0],I=k[1],F=19;F>4&&!$[iE[F-1]];--F);var C,P,R,T,O=c+5<<3,A=iz(r,iT)+iz(n,iO)+a,M=iz(r,d)+iz(n,_)+a+14+3*F+iz(S,$)+(2*S[16]+3*S[17]+7*S[18]);if(O<=A&&O<=M)return iU(t,u,e.subarray(l,l+c));if(iN(t,u,1+(M<A)),u+=2,M<A){C=iR(d,p,0),P=d,R=iR(_,v,0),T=_;var D=iR($,I,0);for(iN(t,u,y-257),iN(t,u+5,E-1),iN(t,u+10,F-4),u+=14,x=0;x<F;++x)iN(t,u+3*x,$[iE[x]]);u+=3*F;for(var L=[m,w],N=0;N<2;++N){var q=L[N];for(x=0;x<q.length;++x){var j=31&q[x];iN(t,u,D[j]),u+=$[j],j>15&&(iN(t,u,q[x]>>>5&127),u+=q[x]>>>12)}}}else C=iA,P=iT,R=iM,T=iO;for(x=0;x<o;++x)if(s[x]>255){iq(t,u,C[(j=s[x]>>>18&31)+257]),u+=P[j+257],j>7&&(iN(t,u,s[x]>>>23&31),u+=ib[j]);var B=31&s[x];iq(t,u,R[B]),u+=T[B],B>3&&(iq(t,u,s[x]>>>5&8191),u+=iw[B])}else iq(t,u,C[s[x]]),u+=P[s[x]];return iq(t,u,C[256]),u+P[256]},iV=new iy([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),iW=function(){for(var e=new iy(256),t=0;t<256;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),iY=function(){var e=0xffffffff;return{p:function(t){for(var i=e,s=0;s<t.length;++s)i=iW[255&i^t[s]]^i>>>8;e=i},d:function(){return 0xffffffff^e}}},iJ=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},iK=function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&iJ(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;s<=i.length;++s)e[s+10]=i.charCodeAt(s)}};function iZ(e,t){void 0===t&&(t={});var i,s,r,n=iY(),a=e.length;n.p(e);var o=(s=t,r=10+((i=t).filename&&i.filename.length+1||0),function(e,t,i,s,r,n){var a=e.length,o=new iv(s+a+5*(1+Math.floor(a/7e3))+8),l=o.subarray(s,o.length-r),c=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var h=u+65535;h<a?c=iU(l,c,e.subarray(u,h)):(l[u]=n,c=iU(l,c,e.subarray(u,a)))}else{for(var d=iV[t-1],p=d>>>13,g=8191&d,_=(1<<i)-1,v=new im(32768),f=new im(_+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&_},w=new iy(25e3),E=new im(288),S=new im(32),x=0,k=0,$=(u=0,0),I=0,F=0;u<a;
3++u){var C=b(u),P=32767&u,R=f[C];if(v[P]=R,f[C]=P,I<=u){var T=a-u;if((x>7e3||$>24576)&&T>423){c=iG(e,l,0,w,E,S,k,$,F,u-F,c),$=x=k=0,F=u;for(var O=0;O<286;++O)E[O]=0;for(O=0;O<30;++O)S[O]=0}var A=2,M=0,D=g,L=P-R&32767;if(T>2&&C==b(u-L))for(var N=Math.min(p,T)-1,q=Math.min(32767,u),j=Math.min(258,T);L<=q&&--D&&P!=R;){if(e[u+A]==e[u+A-L]){for(var B=0;B<j&&e[u+B]==e[u+B-L];++B);if(B>A){if(A=B,M=L,B>N)break;var H=Math.min(L,B-2),z=0;for(O=0;O<H;++O){var U=u-L+O+32768&32767,G=U-v[U]+32768&32767;G>z&&(z=G,R=U)}}}L+=(P=R)-(R=v[P])+32768&32767}if(M){w[$++]=0x10000000|i$[A]<<18|iI[M];var V=31&i$[A],W=31&iI[M];k+=ib[V]+iw[W],++E[257+V],++S[W],I=u+A,++x}else w[$++]=e[u],++E[e[u]]}}c=iG(e,l,n,w,E,S,k,$,F,u-F,c)}return iL(o,0,s+iD(c)+r)}(e,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+s.mem,r,8,!0)),l=o.length;return iK(o,t),iJ(o,l-8,n.d()),iJ(o,l-4,a),o}function iX(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var s=new iv(e.length+(e.length>>>1)),r=0,n=function(e){s[r++]=e},a=0;a<i;++a){if(r+5>s.length){var o=new iv(r+8+(i-a<<1));o.set(s),s=o}var l=e.charCodeAt(a);l<128||t?n(l):(l<2048?n(192|l>>>6):(l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return iL(s,0,r)}var iQ="disabled",i0="sampled",i1="active",i2="buffering",i3="paused",i5="trigger",i6=i5+"_activated",i8=i5+"_pending",i4=i5+"_"+iQ;function i7(e,t){return t.some(t=>"regex"===t.matching&&new RegExp(t.url).test(e))}class i9{triggerStatus(e){var t=this.kt.map(t=>t.triggerStatus(e));return t.includes(i6)?i6:t.includes(i8)?i8:i4}stop(){this.kt.forEach(e=>e.stop())}constructor(e){this.kt=e}}class se{triggerStatus(e){var t=new Set;for(var i of this.kt)t.add(i.triggerStatus(e));switch(t.delete(i4),t.size){case 0:return i4;case 1:return Array.from(t)[0];default:return i8}}stop(){this.kt.forEach(e=>e.stop())}constructor(e){this.kt=e}}class st{triggerStatus(){return i8}stop(){}}class si{onRemoteConfig(e){var t,i;this.Et=(null==(t=e.sessionRecording)?void 0:t.urlTriggers)||[],this.It=(null==(i=e.sessionRecording)?void 0:i.urlBlocklist)||[]}Pt(e){var t;return 0===this.Et.length?i4:(null==(t=this._instance)?void 0:t.get_property(ex))===e?i6:i8}triggerStatus(e){var t=this.Pt(e),i=t===i6?i6:t===i8?i8:i4;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:i}),i}checkUrlTriggerConditions(e,i,s){if(void 0!==t&&t.location.href){var r=t.location.href,n=this.urlBlocked,a=i7(r,this.It);n&&a||(a&&!n?e():!a&&n&&i(),i7(r,this.Et)&&s("url"))}}stop(){}constructor(e){this.Et=[],this.It=[],this.urlBlocked=!1,this._instance=e}}class ss{triggerStatus(){var e=i8;return A(this.linkedFlag)&&(e=i4),this.linkedFlagSeen&&(e=i6),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}onRemoteConfig(e,t){var i;if(this.linkedFlag=(null==(i=e.sessionRecording)?void 0:i.linkedFlag)||null,!A(this.linkedFlag)&&!this.linkedFlagSeen){var s=R(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,r=R(this.linkedFlag)?null:this.linkedFlag.variant;this.Rt=this._instance.onFeatureFlags((e,i)=>{var n=!1;if(F(i)&&s in i){var a=i[s];n=D(a)?!0===a:r?a===r:!!a}this.linkedFlagSeen=n,n&&t(s,r)})}}stop(){this.Rt()}constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Rt=()=>{},this._instance=e}}class sr{onRemoteConfig(e){var t;this.Tt=(null==(t=e.sessionRecording)?void 0:t.eventTriggers)||[]}Mt(e){var t;return 0===this.Tt.length?i4:(null==(t=this._instance)?void 0:t.get_property(ek))===e?i6:i8}triggerStatus(e){var t=this.Mt(e),i=t===i6?i6:t===i8?i8:i4;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:i}),i}stop(){}constructor(e){this.Tt=[],this._instance=e}}function sn(e){return e.isRecordingEnabled?i2:iQ}function sa(e){if(!e.receivedFlags)return i2;if(!e.isRecordingEnabled)return iQ;if(e.urlTriggerMatching.urlBlocked)return i3;var t=!0===e.isSampled,i=new i9([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?i0:i===i6?i1:i===i8?i2:!1===e.isSampled?iQ:i1}function so(e){if(!e.receivedFlags)return i2;if(!e.isRecordingEnabled)return iQ;if(e.urlTriggerMatching.urlBlocked)return i3;var t=new se([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),i=t!==i4,s=D(e.isSampled);return i&&t===i8?i2:i&&t===i4||s&&!e.isSampled?iQ:!0===e.isSampled?i0:i1}var sl="[SessionRecording]",sc=j(sl);function su(){var e;return null==p||null==(e=p.__PosthogExtensions__)||null==(e=e.rrweb)?void 0:e.record}var sh=[ia.MouseMove,ia.MouseInteraction,ia.Scroll,ia.ViewportResize,ia.Input,ia.TouchMove,ia.MediaInteraction,ia.Drag],sd=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function sp(e){return function(e,t){for(var i="",s=0;s<e.length;){var r=e[s++];(r<128||t)&&(i+=String.fromCharCode(r))}return i}(iZ(iX(JSON.stringify(e))),!0)}function sg(e){return e.type===ir.Custom&&"sessionIdle"===e.data.tag}class s_{get sessionId(){return this.Ct}get Ft(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Ot}get At(){if(!this._instance.sessionManager)throw Error(sl+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Dt(){var e,t;return this.Lt.triggerStatus(this.sessionId)===i8?6e4:null!=(e=null==(t=this._instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)?e:3e5}get jt(){var e=this._instance.get_property(eS);return D(e)?e:null}get Nt(){var e,t,i=null==(e=this.C)?void 0:e.data[(null==(t=this.C)?void 0:t.data.length)-1],{sessionStartTimestamp:s}=this.At.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-s:null}get zt(){var e=!!this._instance.get_property(eg),i=!this._instance.config.disable_session_recording;return t&&e&&i}get Ut(){var e=!!this._instance.get_property(e_),t=this._instance.config.enable_recording_console_log;return null!=t?t:e}get qt(){var e,t,i,s,r,n,a=this._instance.config.session_recording.captureCanvas,o=this._instance.get_property(em),l=null!=(e=null!=(t=null==a?void 0:a.recordCanvas)?t:null==o?void 0:o.enabled)&&e,c=null!=(i=null!=(s=null==a?void 0:a.canvasFps)?s:null==o?void 0:o.fps)?i:4,u=null!=(r=null!=(n=null==a?void 0:a.canvasQuality)?n:null==o?void 0:o.quality)?r:.4;if("string"==typeof u){var h=parseFloat(u);u=isNaN(h)?.4:h}return{enabled:l,fps:tq(c,0,12,"canvas recording fps",4),quality:tq(u,0,1,"canvas recording quality",.4)}}get Bt(){var e,t,i=this._instance.get_property(ev),s={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(t=this._instance.config.session_recording)?void 0:t.recordBody},r=(null==s?void 0:s.recordHeaders)||(null==i?void 0:i.recordHeaders),n=(null==s?void 0:s.recordBody)||(null==i?void 0:i.recordBody),a=F(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,o=!!(D(a)?a:null==i?void 0:i.capturePerformance);return r||n||o?{recordHeaders:r,recordBody:n,recordPerformance:o}:void 0}get Ht(){var e,t,i,s,r,n,a=this._instance.get_property(ef),o={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(t=this._instance.config.session_recording)?void 0:t.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector},l=null!=(s=null==o?void 0:o.maskAllInputs)?s:null==a?void 0:a.maskAllInputs,c=null!=(r=null==o?void 0:o.maskTextSelector)?r:null==a?void 0:a.maskTextSelector,u=null!=(n=null==o?void 0:o.blockSelector)?n:null==a?void 0:a.blockSelector;return P(l)&&P(c)&&P(u)?void 0:{maskAllInputs:null==l||l,maskTextSelector:c,blockSelector:u}}get Wt(){var e=this._instance.get_property(ey);return M(e)?e:null}get Gt(){var e=this._instance.get_property(eb);return M(e)?e:null}get status(){return this.Jt?this.Vt({receivedFlags:this.Jt,isRecordingEnabled:this.zt,isSampled:this.jt,urlTriggerMatching:this.Kt,eventTriggerMatching:this.Yt,linkedFlagMatching:this.Xt,sessionId:this.sessionId}):i2}startIfEnabledOrStop(e){this.zt?(this.gi(e),ei(t,"beforeunload",this.oi),ei(t,"offline",this.li),ei(t,"online",this.hi),ei(t,"visibilitychange",this.di),this.mi(),this.bi(),A(this.ii)&&(this.ii=this._instance.on("eventCaptured",e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this.yi(null==e?void 0:e.properties.$current_url):"";if(!t)return;this.ui("$pageview",{href:t})}}catch(e){sc.error("Could not add $pageview to rrweb session",e)}})),this.ei||(this.ei=this.At.onSessionId((e,t,i)=>{var s,r;i&&(this.ui("$session_id_change",{sessionId:e,windowId:t,changeReason:i}),null==(s=this._instance)||null==(s=s.persistence)||s.unregister(ek),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(ex))}))):this.stopRecording()}stopRecording(){var e,i,s,r;this.Ot&&this.ci&&(this.ci(),this.ci=void 0,this.Ot=!1,null==t||t.removeEventListener("beforeunload",this.oi),null==t||t.removeEventListener("offline",this.li),null==t||t.removeEventListener("online",this.hi),null==t||t.removeEventListener("visibilitychange",this.di),this.pi(),clearInterval(this.wi),null==(e=this.ii)||e.call(this),this.ii=void 0,null==(i=this.ni)||i.call(this),this.ni=void 0,null==(s=this.ei)||s.call(this),this.ei=void 0,null==(r=this.si)||r.call(this),this.si=void 0,this.Yt.stop(),this.Kt.stop(),this.Xt.stop(),sc.info("stopped"))}Si(){var e;null==(e=this._instance.persistence)||e.unregister(eS)}$i(e){var t,i=this.Ct!==e,s=this.Wt;if(M(s)){var r=this.jt,n=i||!D(r),a=n?function(e){for(var t=0,i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i)|0;return Math.abs(t)}(e)%100<tq(100*s,0,100):r;n&&(a?this.xi(i0):sc.warn("Sample rate ("+s+") has determined that this sessionId ("+e+") will not be sent to the server."),this.ui("samplingDecisionMade",{sampleRate:s,isSampled:a})),null==(t=this._instance.persistence)||t.register({[eS]:a})}else this.Si()}onRemoteConfig(e){var t,i,s,r;this.ui("$remote_config_received",e),this.ki(e),null!=(t=e.sessionRecording)&&t.endpoint&&(this.vi=null==(r=e.sessionRecording)?void 0:r.endpoint),this.mi(),"any"===(null==(i=e.sessionRecording)?void 0:i.triggerMatchType)?(this.Vt=sa,this.Lt=ne
3w i9([this.Yt,this.Kt])):(this.Vt=so,this.Lt=new se([this.Yt,this.Kt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==(s=e.sessionRecording)?void 0:s.triggerMatchType}),this.Kt.onRemoteConfig(e),this.Yt.onRemoteConfig(e),this.Xt.onRemoteConfig(e,(e,t)=>{this.xi("linked_flag_matched",{flag:e,variant:t})}),this.Jt=!0,this.startIfEnabledOrStop()}mi(){M(this.Wt)&&A(this.si)&&(this.si=this.At.onSessionId(e=>{this.$i(e)}))}ki(e){if(this._instance.persistence){var t,i=this._instance.persistence,s=()=>{var t,s,r,n,a,o,l,c,u,h=null==(t=e.sessionRecording)?void 0:t.sampleRate,d=A(h)?null:parseFloat(h);A(d)&&this.Si();var p=null==(s=e.sessionRecording)?void 0:s.minimumDurationMilliseconds;i.register({[eg]:!!e.sessionRecording,[e_]:null==(r=e.sessionRecording)?void 0:r.consoleLogRecordingEnabled,[ev]:z({capturePerformance:e.capturePerformance},null==(n=e.sessionRecording)?void 0:n.networkPayloadCapture),[ef]:null==(a=e.sessionRecording)?void 0:a.masking,[em]:{enabled:null==(o=e.sessionRecording)?void 0:o.recordCanvas,fps:null==(l=e.sessionRecording)?void 0:l.canvasFps,quality:null==(c=e.sessionRecording)?void 0:c.canvasQuality},[ey]:d,[eb]:P(p)?null:p,[ew]:null==(u=e.sessionRecording)?void 0:u.scriptConfig})};s(),null==(t=this.ri)||t.call(this),this.ri=this.At.onSessionId(s)}}log(e,t){var i;void 0===t&&(t="log"),null==(i=this._instance.sessionRecording)||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}gi(e){if(!P(Object.assign)&&!P(Array.from)&&!(this.Ot||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())){var t;(this.Ot=!0,this.At.checkAndGetSessionAndWindowId(),su())?this.Ei():null==(t=p.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,this.Ii,e=>{if(e)return sc.error("could not load recorder",e);this.Ei()}),sc.info("starting"),this.status===i1&&this.xi(e||"recording_initialized")}}get Ii(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property(ew))?void 0:e.script)||"recorder"}Pi(e){var t;return 3===e.type&&-1!==sh.indexOf(null==(t=e.data)?void 0:t.source)}Ri(e){var t=this.Pi(e);t||this.Zt||e.timestamp-this.ti>this.Ft&&(this.Zt=!0,clearInterval(this.wi),this.ui("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.ti,threshold:this.Ft,bufferLength:this.C.data.length,bufferSize:this.C.size}),this.ai());var i=!1;if(t&&(this.ti=e.timestamp,this.Zt)){var s="unknown"===this.Zt;this.Zt=!1,s||(this.ui("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)}if(!this.Zt){var{windowId:r,sessionId:n}=this.At.checkAndGetSessionAndWindowId(!t,e.timestamp),a=this.Ct!==n,o=this.fi!==r;this.fi=r,this.Ct=n,a||o?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):i&&this.Ti()}}Mi(e){try{return e.rrwebMethod(),!0}catch(t){return this.Qt.length<10?this.Qt.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):sc.warn("could not emit queued rrweb event.",t,e),!1}}ui(e,t){return this.Mi(sd(()=>su().addCustomEvent(e,t)))}Ci(){return this.Mi(sd(()=>su().takeFullSnapshot()))}Ei(){var e,t,i,s,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};for(var[n,a]of Object.entries(this._instance.config.session_recording||{}))n in r&&("maskInputOptions"===n?r.maskInputOptions=z({password:!0},a):r[n]=a);this.qt&&this.qt.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.qt.fps},r.dataURLOptions={type:"image/webp",quality:this.qt.quality}),this.Ht&&(r.maskAllInputs=null==(t=this.Ht.maskAllInputs)||t,r.maskTextSelector=null!=(i=this.Ht.maskTextSelector)?i:void 0,r.blockSelector=null!=(s=this.Ht.blockSelector)?s:void 0);var o=su();if(o){this.Fi=null!=(e=this.Fi)?e:new i_(o,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(e,t)=>
3{var i="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";sc.info(i,{node:t}),this.log(sl+" "+i,"warn")}});var l=this.Oi();this.ci=o(z({emit:e=>{this.onRRwebEmit(e)},plugins:l},r)),this.ti=Date.now(),this.Zt=D(this.Zt)?this.Zt:"unknown",this.ui("$session_options",{sessionRecordingOptions:r,activePlugins:l.map(e=>null==e?void 0:e.name)}),this.ui("$posthog_config",{config:this._instance.config})}else sc.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Ti(){if(this.wi&&clearInterval(this.wi),!0!==this.Zt){var e=this.Dt;e&&(this.wi=setInterval(()=>{this.Ci()},e))}}Oi(){var e,t,i,s,r,n,a,o,l,c,u,h,d,g=[],_=null==(h=p.__PosthogExtensions__)||null==(h=h.rrwebPlugins)?void 0:h.getRecordConsolePlugin;_&&this.Ut&&g.push(_());var v=null==(d=p.__PosthogExtensions__)||null==(d=d.rrwebPlugins)?void 0:d.getRecordNetworkPlugin;return this.Bt&&I(v)&&(!tn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?g.push(v((e=this._instance.config,t=this.Bt,r={payloadSizeLimitBytes:ic.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...ic.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...ic.payloadHostDenyList]},n=!1!==e.session_recording.recordHeaders&&t.recordHeaders,a=!1!==e.session_recording.recordBody&&t.recordBody,o=!1!==e.capture_performance&&t.recordPerformance,s=Math.min(1e6,null!=(i=r.payloadSizeLimitBytes)?i:1e6),l=e=>(null!=e&&e.requestBody&&(e.requestBody=ip(e.requestBody,e.requestHeaders,s,"Request")),null!=e&&e.responseBody&&(e.responseBody=ip(e.responseBody,e.responseHeaders,s,"Response")),e),c=t=>{var i;return l(((e,t)=>{var i,s=ta(e.name),r=0===t.indexOf("http")?null==(i=ta(t))?void 0:i.pathname:t;"/"===r&&(r="");var n=null==s?void 0:s.pathname.replace(r||"","");if(!(s&&n&&id.some(e=>0===n.indexOf(e))))return e})((A(i=t.requestHeaders)||W(Object.keys(null!=i?i:{}),e=>{iu.includes(e.toLowerCase())&&(i[e]=il)}),t),e.api_host))},(u=I(e.session_recording.maskNetworkRequestFn))&&I(e.session_recording.maskCapturedNetworkRequestFn)&&q.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var i=e.session_recording.maskNetworkRequestFn({url:t.name});return z({},t,{name:null==i?void 0:i.url})}),r.maskRequestFn=I(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var i,s=c(t);return s&&null!=(i=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(s))?i:void 0}:e=>(function(e){if(!P(e))return e.requestBody=ig(e.requestBody,"Request"),e.responseBody=ig(e.responseBody,"Response"),e})(c(e)),z({},ic,r,{recordHeaders:n,recordBody:a,recordPerformance:o,recordInitialRequests:o})))):sc.info("NetworkCapture not started because we are on localhost.")),g}onRRwebEmit(e){var t;if(this.Ai(),e&&F(e)){if(e.type===ir.Meta){var i=this.yi(e.data.href);if(this.Di=i,!i)return;e.data.href=i}else this.Li();if(this.Kt.checkUrlTriggerConditions(()=>this.ji(),()=>this.Ni(),e=>this.zi(e)),!this.Kt.urlBlocked||e.type===ir.Custom&&"recording paused"===e.data.tag){e.type===ir.FullSnapshot&&this.Ti(),e.type===ir.FullSnapshot&&this.Jt&&this.Lt.triggerStatus(this.sessionId)===i8&&this.pi();var s=this.Fi?this.Fi.throttleMutations(e):e;if(s){var r=function(e){if(e&&F(e)&&6===e.type&&F(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],i=0;i<e.data.payload.payload.length;i++)e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?t.push(e.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[i]);return e.data.payload.payload=t,e}return e}(s);if(this.Ri(r),!0!==this.Zt||sg(r)){if(sg(r)){var n=r.data.payload;n&&(r.timestamp=n.lastActivityTimestamp+n.threshold)}var a=null==(t=this._instance.config.session_recording.compress_events)||t?function(e){if(1024>is(e))return e;try{if(e.type===ir.FullSnapshot)return z({},e,{data:sp(e.data),cv:"2024-10"});if(e.type===ir.IncrementalSnapshot&&e.data.source===ia.Mutation)return z({},e,{cv:"2024-10",data:z({},e.data,{texts:sp(e.data.texts),attributes:sp(e.data.attributes),removes:sp(e.data.removes),adds:sp(e.data.adds)})});if(e.type===ir.IncrementalSnapshot&&e.data.source===ia.StyleSheetRule)return z({},e,{cv:"2024-10",data:z({},e.data,{adds:e.data.adds?sp(e.data.adds):void 0,removes:e.data.removes?sp(e.data.removes):void 0})})}catch(e){sc.error("could not compress event - will use uncompressed event",e)}return e}(r):r,o={$snapshot_bytes:is(a),$snapshot_data:a,$session_id:this.Ct,$window_id:this.fi};this.status!==iQ?this.Ui(o):this.pi()}}}}}Li(){if(!this._instance.config.capture_pageview&&t){var e=this.yi(t.location.href);this.Di!==e&&(this.ui("$url_changed",{href:e}),this.Di=e)}}Ai(){if(this.Qt.length){var e=[...this.Qt];
3this.Qt=[],e.forEach(e=>{Date.now()-e.enqueuedAt<=2e3&&this.Mi(e)})}}yi(e){var t=this._instance.config.session_recording;if(t.maskNetworkRequestFn){var i,s={url:e};return null==(i=s=t.maskNetworkRequestFn(s))?void 0:i.url}return e}pi(){return this.C={size:0,data:[],sessionId:this.Ct,windowId:this.fi},this.C}ai(){this.qi&&(clearTimeout(this.qi),this.qi=void 0);var e=this.Gt,t=this.Nt,i=M(t)&&t>=0,s=M(e)&&i&&t<e;return this.status===i2||this.status===i3||this.status===iQ||s?(this.qi=setTimeout(()=>{this.ai()},2e3),this.C):(this.C.data.length>0&&(function e(t,i){if(void 0===i&&(i=6606028.8),t.size>=i&&t.data.length>1){var s=Math.floor(t.data.length/2),r=t.data.slice(0,s),n=t.data.slice(s);return[e({size:is(r),data:r,sessionId:t.sessionId,windowId:t.windowId}),e({size:is(n),data:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap(e=>e)}return[t]})(this.C).forEach(e=>{this.Bi({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:"web",$lib_version:g.LIB_VERSION})}),this.pi())}Ui(e){var t,i=2+((null==(t=this.C)?void 0:t.data.length)||0);!this.Zt&&(this.C.size+e.$snapshot_bytes+i>943718.4||this.C.sessionId!==this.Ct)&&(this.C=this.ai()),this.C.size+=e.$snapshot_bytes,this.C.data.push(e.$snapshot_data),this.qi||this.Zt||(this.qi=setTimeout(()=>{this.ai()},2e3))}Bi(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.vi),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}zi(e){var t;this.Lt.triggerStatus(this.sessionId)===i8&&(null==(t=this._instance)||null==(t=t.persistence)||t.register({["url"===e?ex:ek]:this.Ct}),this.ai(),this.xi(e+"_trigger_matched"))}ji(){this.Kt.urlBlocked||(this.Kt.urlBlocked=!0,clearInterval(this.wi),sc.info("recording paused due to URL blocker"),this.ui("recording paused",{reason:"url blocker"}))}Ni(){this.Kt.urlBlocked&&(this.Kt.urlBlocked=!1,this.Ci(),this.Ti(),this.ui("recording resumed",{reason:"left blocked url"}),sc.info("recording resumed"))}bi(){0!==this.Yt.Tt.length&&A(this.ni)&&(this.ni=this._instance.on("eventCaptured",e=>{try{this.Yt.Tt.includes(e.event)&&this.zi("event")}catch(e){sc.error("Could not activate event trigger",e)}}))}overrideLinkedFlag(){this.Xt.linkedFlagSeen=!0,this.Ci(),this.xi("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[eS]:!0}),this.Ci(),this.xi("sampling_overridden")}overrideTrigger(e){this.zi(e)}xi(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),sc.info(e.replace("_"," "),t),y(["recording_initialized","session_id_changed"],e)||this.ui(e,t)}get sdkDebugProperties(){var{sessionStartTimestamp:e}=this.At.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.C.data.length,$sdk_debug_replay_internal_buffer_size:this.C.size,$sdk_debug_current_session_duration:this.Nt,$sdk_debug_session_start:e}}constructor(e){if(this.Vt=sn,this.Jt=!1,this.Qt=[],this.Zt="unknown",this.ti=Date.now(),this.Lt=new st,this.ii=void 0,this.ei=void 0,this.ri=void 0,this.si=void 0,this.ni=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.oi=()=>{this.ai()},this.li=()=>{this.ui("browser offline",{})},this.hi=()=>{this.ui("browser online",{})},this.di=()=>{if(null!=o&&o.visibilityState){var e="window "+o.visibilityState;this.ui(e,{})}},this._instance=e,this.Ot=!1,this.vi="/s/",this.ci=void 0,this.Jt=!1,!this._instance.sessionManager)throw sc.error("started without valid sessionManager"),Error(sl+" started without valid sessionManager. This is a bug.");if(this._instance.config.__preview_experimental_cookieless_mode)throw Error(sl+" cannot be used with __preview_experimental_cookieless_mode.");this.Xt=new ss(this._instance),this.Kt=new si(this._instance),this.Yt=new sr(this._instance);var{sessionId:t,windowId:i}=this.At.checkAndGetSessionAndWindowId();this.Ct=t,this.fi=i,this.C=this.pi(),this.Ft>=this.At.sessionTimeoutMs&&sc.warn("session_idle_threshold_ms ("+this.Ft+") is greater than the session timeout ("+this.At.sessionTimeoutMs+"). Session will never be detected as i
3dle")}}var sv=j("[SegmentIntegration]"),sf="posthog-js";function sm(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"]}=void 0===t?{}:t;return t=>{if(!("*"===n||n.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var a,o,l,c,u,h=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var d=(null==(a=t.exception)?void 0:a.values)||[],p=d.map(e=>z({},e,{stacktrace:e.stacktrace?z({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>z({},e,{platform:"web:javascript"}))}):void 0})),g={$exception_message:(null==(o=d[0])?void 0:o.value)||t.message,$exception_type:null==(l=d[0])?void 0:l.type,$exception_personURL:h,$exception_level:t.level,$exception_list:p,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=d[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(u=d[0])?void 0:u.type,$sentry_tags:t.tags};return i&&s&&(g.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),e.exceptions.sendExceptionEvent(g),t}}class sy{constructor(e,t,i,s,r){this.name=sf,this.setupOnce=function(n){n(sm(e,{organization:t,projectId:i,prefix:s,severityAllowList:r}))}}}var sb=null!=t&&t.location?tu(t.location.hash,"__posthog")||tu(location.hash,"state"):null,sw="_postHogToolbarParams",sE=j("[Toolbar]"),sS=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(sS||{});class sx{Hi(e){p.ph_toolbar_state=e}Wi(){var e;return null!=(e=p.ph_toolbar_state)?e:sS.UNINITIALIZED}maybeLoadToolbar(e,i,s){if(void 0===e&&(e=void 0),void 0===i&&(i=void 0),void 0===s&&(s=void 0),!t||!o)return!1;e=null!=e?e:t.location,s=null!=s?s:t.history;try{if(!i){try{t.localStorage.setItem("test","test"),t.localStorage.removeItem("test")}catch(e){return!1}i=null==t?void 0:t.localStorage}var r,n=sb||tu(e.hash,"__posthog")||tu(e.hash,"state"),a=n?Z(()=>JSON.parse(atob(decodeURIComponent(n))))||Z(()=>JSON.parse(decodeURIComponent(n))):null;return a&&"ph_authorize"===a.action?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:s?s.replaceState(s.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(i.getItem(sw)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch(e){return!1}}Gi(e){var t=p.ph_load_toolbar||p.ph_load_editor;!A(t)&&I(t)?t(e,this.instance):sE.warn("No toolbar load function found")}loadToolbar(e){var i,s=!(null==o||!o.getElementById(eB));if(!t||s)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=z({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(t.localStorage.setItem(sw,JSON.stringify(z({},n,{source:void 0}))),this.Wi()===sS.LOADED)?this.Gi(n):this.Wi()===sS.UNINITIALIZED&&(this.Hi(sS.LOADING),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return sE.error("[Toolbar] Failed to load",e),void this.Hi(sS.UNINITIALIZED);this.Hi(sS.LOADED),this.Gi(n)}),ei(t,"turbolinks:load",()=>{this.Hi(sS.UNINITIALIZED),this.loadToolbar(n)})),!0}Ji(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}constructor(e){this.instance=e}}var sk=j("[TracingHeaders]");class s${J(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return sk.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.J(this.nt):(null==(e=this.Vi)||e.call(this),null==(t=this.Ki)||t.call(this),this.Vi=void 0,this.Ki=void 0)}constructor(e){this.Vi=void 0,this.Ki=void 0,this.nt=()=>{var e,t;P(this.Vi)&&(null==(e=p.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),P(this.Ki)&&(null==(t=p.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}}var sI=j("[Web Vitals]");class sF{get allowedMetrics(){var e,t,i=F(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return P(i)?(null==(t=this._instance.persistence)?void 0:t.props[ep])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(F(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get ie(){var e=F(this._instance.config.capture_performance)&&M(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<e&&e<=6e4?9e5:e}get isEnabled(){var e=null==l?void 0:l.protocol;if("http:"!==e&&"https:"!==e)return sI.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=F(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:D(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return D(t)?t:this.Yi}startIfEnabled(){this.isEnabled&&!this.i&&(sI.info("enabled, starting..."),this.J(this.nt))}onRemoteConfig(e){var t=F(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=F(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[eh]:t}),this._instance.persistence.register({[ep]:i})),this.Yi=t,this.startIfEnabled()}J(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"web-vitals",t=>{t?sI.error("failed to load script",t):e()})}te(){var e=t?t.location.href:void 0;return e||sI.error("Could not determine current URL"),e}constructor(e){var t;this.Yi=!1,this.i=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Xi=()=>{clearTimeout(this.Qi),0!==this.C.metrics.length&&(this._instance.capture("$web_vitals",this.C.metrics.reduce((e,t)=>
3z({},e,{["$web_vitals_"+t.name+"_event"]:z({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Zi=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(P(i))sI.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.te();P(s)||(A(null==e?void 0:e.name)||A(null==e?void 0:e.value)?sI.error("Invalid metric received",e):this.ie&&e.value>=this.ie?sI.error("Ignoring metric with value >= "+this.ie,e):(this.C.url!==s&&(this.Xi(),this.Qi=setTimeout(this.Xi,this.flushToCaptureTimeoutMs)),P(this.C.url)&&(this.C.url=s),this.C.firstMetricTimestamp=P(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.C.metrics.push(z({},e,{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Xi()))}},this.nt=()=>{var e,t,i,s,r=p.__PosthogExtensions__;P(r)||P(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.Zi.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Zi.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Zi.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.Zi.bind(this)),this.i=!0):sI.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Yi=!(null==(t=this._instance.persistence)||!t.props[eh]),this.startIfEnabled()}}var sC=j("[Heatmaps]");function sP(e){return F(e)&&"clientX"in e&&"clientY"in e&&M(e.clientX)&&M(e.clientY)}class sR{get flushIntervalMilliseconds(){var e=5e3;return F(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return P(this.instance.config.capture_heatmaps)?P(this.instance.config.enable_heatmaps)?this.Yi:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.i||(sC.info("starting..."),this.re(),this.ee=setInterval(this.se.bind(this),this.flushIntervalMilliseconds));else{var e,t;clearInterval(null!=(e=this.ee)?e:void 0),null==(t=this.ne)||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[eo]:t}),this.Yi=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.C;return this.C=void 0,e}oe(e){this.ae(e.originalEvent,"deadclick")}re(){t&&o&&(ei(t,"beforeunload",this.se.bind(this)),ei(o,"click",e=>this.ae(e||(null==t?void 0:t.event)),{capture:!0}),ei(o,"mousemove",e=>this.le(e||(null==t?void 0:t.event)),{capture:!0}),this.ne=new tN(this.instance,tD,this.oe.bind(this)),this.ne.startIfEnabled(),this.i=!0)}ue(e,i){var s=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(e,i,s){for(var r=e;r&&eG(r)&&!eV(r,"body")&&r!==s;){if(y(i,null==t?void 0:t.getComputedStyle(r).position))return!0;r=e2(r)}return!1}(e0(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:s),target_fixed:a,type:i}}ae(e,t){var i;if(void 0===t&&(t="click"),!eU(e.target)&&sP(e)){var s=this.ue(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.he(z({},s,{type:"rageclick"})),this.he(s)}}le(e){!eU(e.target)&&sP(e)&&(clearTimeout(this.de),this.de=setTimeout(()=>{this.he(this.ue(e,"mousemove"))},500))}he(e){if(t){var i=t.location.href;this.C=this.C||{},this.C[i]||(this.C[i]=[]),this.C[i].push(e)}}se(){this.C&&!C(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}constructor(e){var t;this.rageclicks=new tr,this.Yi=!1,this.i=!1,this.ee=null,this.instance=e,this.Yi=!(null==(t=this.instance.persistence)||!t.props[eo])}}class sT{doPageView(e,i){var s,r=this.ve(e,i);return this.ce={pathname:null!=(s=null==t?void 0:t.location.pathname)?s:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.ve(e,null==(t=this.ce)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ce)?void 0:e.pageViewId}}ve(e,t){var i=this.ce;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:a,maxScrollY:o,maxContentHeight:l,lastContentY:c,maxContentY:u}=r;if(!(P(n)||P(a)||P(o)||P(l)||P(c)||P(u))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var h=n<=1?1:tq(a/n,0,1),d=n<=1?1:tq(o/n,0,1),p=l<=1?1:tq(c/l,0,1),g=l<=1?1:tq(u/l,0,1);s=Y(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:g})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}constructor(e){this._instance=e}}var sO=function(e){var t,i,s,r,n="";for(t=i=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<s;r++){var a=e.charCodeAt(r),o=null;a<128?i++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>
36&63|128,63&a|128),O(o)||(i>t&&(n+=e.substring(t,i)),n+=o,t=i=r+1)}return i>t&&(n+=e.substring(t,e.length)),n},sA=!!u||!!c,sM="text/plain",sD=(e,t)=>{var[i,s]=e.split("?"),r=z({},t);null==s||s.split("&").forEach(e=>{var[t]=e.split("=");delete r[t]});var n=to(r);return i+"?"+(n=n?(s?s+"&":"")+n:s)},sL=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),sN=e=>{var{data:t,compression:i}=e;if(t){if(i===f.GZipJS){var s=new Blob([iZ(iX(sL(t)),{mtime:0})],{type:sM});return{contentType:sM,body:s,estimatedSize:s.size}}if(i===f.Base64){var r=(e=>"data="+encodeURIComponent("string"==typeof e?e:sL(e)))(function(e){var t,i,s,r,n,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=0,l=0,c="",u=[];if(!e)return e;e=sO(e);do t=(n=e.charCodeAt(o++)<<16|e.charCodeAt(o++)<<8|e.charCodeAt(o++))>>18&63,i=n>>12&63,s=n>>6&63,r=63&n,u[l++]=a.charAt(t)+a.charAt(i)+a.charAt(s)+a.charAt(r);while(o<e.length)switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(sL(t)));return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}var n=sL(t);return{contentType:"application/json",body:n,estimatedSize:new Blob([n]).size}}},sq=[];c&&sq.push({transport:"fetch",method:e=>{var t,i,{contentType:s,body:r,estimatedSize:n}=null!=(t=sN(e))?t:{},a=new Headers;W(e.headers,function(e,t){a.append(t,e)}),s&&a.append("Content-Type",s);var o=e.url,l=null;if(h){var u=new h;l={signal:u.signal,timeout:setTimeout(()=>u.abort(),e.timeout)}}c(o,z({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&52428.8>(n||0),body:r,signal:null==(i=l)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){q.error(e)}null==e.callback||e.callback(s)})).catch(t=>{q.error(t),null==e.callback||e.callback({statusCode:0,text:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),u&&sq.push({transport:"XHR",method:e=>{var t,i=new u;i.open(e.method||"GET",e.url,!0);var{contentType:s,body:r}=null!=(t=sN(e))?t:{};W(e.headers,function(e,t){i.setRequestHeader(t,e)}),s&&i.setRequestHeader("Content-Type",s),e.timeout&&(i.timeout=e.timeout),i.withCredentials=!0,i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(r)}}),null!=a&&a.sendBeacon&&sq.push({transport:"sendBeacon",method:e=>{var t=sD(e.url,{beacon:"1"});try{var i,{contentType:s,body:r}=null!=(i=sN(e))?i:{},n="string"==typeof r?new Blob([r],{type:s}):r;a.sendBeacon(t,n)}catch(e){}}});var sj=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function sB(e,t,i){return sL({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var sH={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=>sj(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!sj(t,e))),icontains:(e,t)=>t.map(sz).some(t=>e.map(sz).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(sz).every(t=>e.map(sz).every(e=>!t.includes(e)))},sz=e=>e.toLowerCase(),sU=j("[Error tracking]");class sG{onRemoteConfig(e){var t,i,s,r=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(s=e.errorTracking)?void 0:s.captureExtensionExceptions;this.fe=r,this._instance.persistence&&this._instance.persistence.register({[ec]:this.fe,[eu]:n})}get pe(){var e,t=!!this._instance.get_property(eu),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}sendExceptionEvent(e){if(this.ge(e))sU.info("Skipping exception capture because a suppression rule matched");else{if(this.pe||!this._e(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});sU.info("Skipping exception capture because it was thrown by an extension")}}ge(e){var t=e.$exception_list;if(!t||!$(t)||0===t.length)return!1;var i=t.reduce((e,t)=>
3{var{type:i,value:s}=t;return R(i)&&i.length>0&&e.$exception_types.push(i),R(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.fe.some(e=>{var t=e.values.map(e=>{var t,s=sH[e.operator],r=$(e.value)?e.value:[e.value],n=null!=(t=i[e.key])?t:[];return r.length>0&&s(r,n)});return"OR"===e.type?t.some(Boolean):t.every(Boolean)})}_e(e){var t=e.$exception_list;return!(!t||!$(t))&&t.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}constructor(e){var t,i;this.fe=[],this._instance=e,this.fe=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(ec))?t:[]}}var sV="Mobile",sW="Android",sY="Tablet",sJ=sW+" "+sY,sK="iPad",sZ="Apple",sX=sZ+" Watch",sQ="Safari",s0="BlackBerry",s1="Samsung",s2=s1+"Browser",s3=s1+" Internet",s5="Chrome",s6=s5+" OS",s8=s5+" iOS",s4="Internet Explorer",s7=s4+" "+sV,s9="Opera",re=s9+" Mini",rt="Edge",ri="Microsoft "+rt,rs="Firefox",rr=rs+" iOS",rn="Nintendo",ra="PlayStation",ro="Xbox",rl=sW+" "+sV,rc=sV+" "+sQ,ru="Windows",rh=ru+" Phone",rd="Nokia",rp="Ouya",rg="Generic",r_=rg+" "+sV.toLowerCase(),rv=rg+" "+sY.toLowerCase(),rf="Konqueror",rm="(\\d+(\\.\\d+)?)",ry=RegExp("Version/"+rm),rb=RegExp(ro,"i"),rw=RegExp(ra+" \\w+","i"),rE=RegExp(rn+" \\w+","i"),rS=RegExp(s0+"|PlayBook|BB10","i"),rx={"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"},rk=function(e,t){let i;return t=t||"",y(e," OPR/")&&y(e,"Mini")?re:y(e," OPR/")?s9:rS.test(e)?s0:y(e,"IE"+sV)||y(e,"WPDesktop")?s7:y(e,s2)?s3:y(e,rt)||y(e,"Edg/")?ri:y(e,"FBIOS")?"Facebook "+sV:y(e,"UCWEB")||y(e,"UCBrowser")?"UC Browser":y(e,"CriOS")?s8:y(e,"CrMo")||y(e,s5)?s5:y(e,sW)&&y(e,sQ)?rl:y(e,"FxiOS")?rr:y(e.toLowerCase(),rf.toLowerCase())?rf:(i=t)&&y(i,sZ)||y(e,sQ)&&!y(e,s5)&&!y(e,sW)?y(e,sV)?rc:sQ:y(e,rs)?rs:y(e,"MSIE")||y(e,"Trident/")?s4:y(e,"Gecko")?rs:""},r$={[s7]:[RegExp("rv:"+rm)],[ri]:[RegExp(rt+"?\\/"+rm)],[s5]:[RegExp("("+s5+"|CrMo)\\/"+rm)],[s8]:[RegExp("CriOS\\/"+rm)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+rm)],[sQ]:[ry],[rc]:[ry],[s9]:[RegExp("(Opera|OPR)\\/"+rm)],[rs]:[RegExp(rs+"\\/"+rm)],[rr]:[RegExp("FxiOS\\/"+rm)],[rf]:[RegExp("Konqueror[:/]?"+rm,"i")],[s0]:[RegExp(s0+" "+rm),ry],[rl]:[RegExp("android\\s"+rm,"i")],[s3]:[RegExp(s2+"\\/"+rm)],[s4]:[RegExp("(rv:|MSIE )"+rm)],Mozilla:[RegExp("rv:"+rm)]},rI=function(e,t){var i=r$[rk(e,t)];if(P(i))return null;for(var s=0;s<i.length;s++){var r=i[s],n=e.match(r);if(n)return parseFloat(n[n.length-2])}return null},rF=[[RegExp(ro+"; "+ro+" (.*?)[);]","i"),e=>[ro,e&&e[1]||""]],[RegExp(rn,"i"),[rn,""]],[RegExp(ra,"i"),[ra,""]],[rS,[s0,""]],[RegExp(ru,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[rh,""];if(new RegExp(sV).test(t)&&!/IEMobile\b/.test(t))return[ru+" "+sV,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=rx[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[ru,s]}return[ru,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=P(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+sW+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+sW+")","i"),e=>e&&e[2]?[sW,[e[2],e[3],e[4]||"0"].join(".")]:[sW,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[s6,""]],[/Linux|debian/i,["Linux",""]]],rC=function(e){return rE.test(e)?rn:rw.test(e)?ra:rb.test(e)?ro:RegExp(rp,"i").test(e)?rp:RegExp("("+rh+"|WPDesktop)","i").test(e)?rh:/iPad/.test(e)?sK:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?sX:rS.test(e)?s0:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(rd,"i").test(e)?rd:/(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(sV).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)?sW:sJ:sW:RegExp("(pda|"+sV+")","i").test(e)?r_:RegExp(sY,"i").test(e)&&!RegExp(sY+" pc","i").test(e)?rv:""},rP="https?://(.*)",rR=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rT=J(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],rR),rO="<masked>",rA=["li_fat_id"];function rM(e,t,i){if(!o)return{};var s,r=t?J([],rR,i||[]):[],n=rD(tc(o.URL,r,rO),e);return Y((s={},W(rA,function(e){var t=tx.D(e);s[e]=t||null}),s),n)}function rD(e,t){var i=rT.concat(t||[]),s={};return W(i,function(t){var i=tl(e,t);s[t]=i||null}),s}function rL(e){var t=e?0===e.search(rP+"google.([^/?]*)")?"google":0===e.search(rP+"bing.com")?"bing":0===e.search(rP+"yahoo.com")?"yahoo":0===e.search(rP+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!O(t)){i.$search_engine=t;var s=o?tl(o.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function rN(){return navigator.language||navigator.userLanguage}function rq(){return(null==o?void 0:o.referrer)||"$direct"}function rj(e,t){var i=e?J([],rR,t||[]):[],s=null==l?void 0:l.href.substring(0,1e3);return{r:rq().substring(0,1e3),u:s?tc(s,i,rO):void 0}}function rB(e){var t,{r:i,u:s}=e,r={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=ta(i))?void 0:t.host};
3if(s){r.$current_url=s;var n=ta(s);r.$host=null==n?void 0:n.host,r.$pathname=null==n?void 0:n.pathname,Y(r,rD(s))}return i&&Y(r,rL(i)),r}function rH(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rz=j("[FeatureFlags]"),rU="$active_feature_flags",rG="$override_feature_flags",rV="$feature_flag_payloads",rW="$override_feature_flag_payloads",rY="$feature_flag_request_id",rJ=e=>{var t={};for(var[i,s]of K(e||{}))s&&(t[i]=s);return t},rK=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class rZ{flags(){if(this._instance.config.__preview_remote_config)this.$e=!0;else{var e=!this.ke&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Ee({disableFlags:e})}}get hasLoadedFlags(){return this.be}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(eF),t=this._instance.get_property(rG),i=this._instance.get_property(rW);if(!i&&!t)return e||{};var s=Y({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=s[r],l=null==t?void 0:t[r],c=P(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,u=P(l)?o.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[r],d=z({},o,{enabled:c,variant:c?null!=u?u:null==o?void 0:o.variant:void 0});c!==(null==o?void 0:o.enabled)&&(d.original_enabled=null==o?void 0:o.enabled),u!==(null==o?void 0:o.variant)&&(d.original_variant=null==o?void 0:o.variant),h&&(d.metadata=z({},null==o?void 0:o.metadata,{payload:h,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),s[r]=d}return this.me||(rz.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.me=!0),s}getFlagVariants(){var e=this._instance.get_property(e$),t=this._instance.get_property(rG);if(!t)return e||{};for(var i=Y({},e),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.me||(rz.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.me=!0),i}getFlagPayloads(){var e=this._instance.get_property(rV),t=this._instance.get_property(rW);
3if(!t)return e||{};for(var i=Y({},e||{}),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.me||(rz.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.me=!0),i}reloadFeatureFlags(){this.we||this._instance.config.advanced_disable_feature_flags||this.ke||(this.ke=setTimeout(()=>{this.Ee()},5))}Ie(){clearTimeout(this.ke),this.ke=void 0}ensureFlagsLoaded(){this.be||this.ye||this.ke||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.we=e}Ee(e){var t;if(this.Ie(),!this._instance.I())if(this.ye)this.Se=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:z({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(eC)||{}),group_properties:this._instance.get_property(eP)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0);var s=this._instance.config.__preview_remote_config,r=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",n=this._instance.requestRouter.endpointFor("api",(s?"/flags/?v=2":"/flags/?v=2&config=true")+r);s&&(i.timezone=rH()),this.ye=!0,this._instance.Pe({method:"POST",url:n,data:i,compression:this._instance.config.disable_compression?void 0:f.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,s,r,n=!0;200===e.statusCode&&(this.Se||(this.$anon_distinct_id=void 0),n=!1),this.ye=!1,this.$e||(this.$e=!0,this._instance.Re(null!=(r=e.json)?r:{})),(!i.disable_flags||this.Se)&&((this.xe=!n,e.json&&null!=(s=e.json.quotaLimited)&&s.includes(rK.FeatureFlags))?rz.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."):(i.disable_flags||this.receivedFeatureFlags(null!=(t=e.json)?t:{},n),this.Se&&(this.Se=!1,this.Ee())))}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this.be||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],s=""+i,r=this._instance.get_property(rY)||void 0,n=this._instance.get_property(eO)||{};if((t.send_event||!("send_event"in t))&&(!(e in n)||!n[e].includes(s))){$(n[e])?n[e].push(s):n[e]=[s],null==(l=this._instance.persistence)||l.register({[eO]:n});var a=this.getFeatureFlagDetails(e),o={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:r,$feature_flag_bootstrapped_response:(null==(c=this._instance.config.bootstrap)||null==(c=c.featureFlags)?void 0:c[e])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[e])||null,$used_bootstrap_value:!this.xe};P(null==a||null==(h=a.metadata)?void 0:h.version)||(o.$feature_flag_version=a.metadata.version);var l,c,u,h,d,p,g,_,v,f,m=null!=(d=null==a||null==(p=a.reason)?void 0:p.description)?d:null==a||null==(g=a.reason)?void 0:g.code;m&&(o.$feature_flag_reason=m),null!=a&&null!=(_=a.metadata)&&_.id&&(o.$feature_flag_id=a.metadata.id),P(null==a?void 0:a.original_variant)&&P(null==a?void 0:a.original_enabled)||(o.$feature_flag_original_response=P(a.original_variant)?a.original_enabled:a.original_variant),null!=a&&null!=(v=a.metadata)&&v.original_payload&&(o.$feature_flag_original_payload=null==a||null==(f=a.metadata)?void 0:f.original_payload),this._instance.capture("$feature_flag_called",o)}return i}rz.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var i=this._instance.config.token;this._instance.Pe({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:i}
3,compression:this._instance.config.disable_compression?void 0:f.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var s,r=null==(s=i.json)?void 0:s.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this.be||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);rz.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.be=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),r=this.getFlagsWithDetails();!function(e,t,i,s,r){void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r={});var n,a=((n=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(n).map(e=>{var t;return[e,null!=(t=n[e].variant)?t:n[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(n).filter(e=>n[e].enabled).filter(e=>{var t;return null==(t=n[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=n[e].metadata)?void 0:t.payload]}))):rz.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),o=a.flags,l=a.featureFlags,c=a.featureFlagPayloads;if(l){var u=e.requestId;if($(l)){rz.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var h={};if(l)for(var d=0;d<l.length;d++)h[l[d]]=!0;t&&t.register({[rU]:l,[e$]:h})}else{var p=l,g=c,_=o;e.errorsWhileComputingFlags&&(p=z({},i,p),g=z({},s,g),_=z({},r,_)),t&&t.register(z({[rU]:Object.keys(rJ(p)),[e$]:p||{},[rV]:g||{},[eF]:_||{}},u?{[rY]:u}:{}))}}}(e,this._instance.persistence,i,s,r),this.Te(t)}}override(e,t){void 0===t&&(t=!1),rz.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return rz.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(rG),this._instance.persistence.unregister(rW),void this.Te();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;if(this.me=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this._instance.persistence.unregister(rG);else if(e.flags)if($(e.flags)){for(var i={},s=0;s<e.flags.length;s++)i[e.flags[s]]=!0;this._instance.persistence.register({[rG]:i})}else this._instance.persistence.register({[rG]:e.flags})}return"payloads"in e&&(!1===e.payloads?this._instance.persistence.unregister(rW):e.payloads&&this._instance.persistence.register({[rW]:e.payloads})),void this.Te()}this.Te()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.be){var{flags:t,flagVariants:i}=this.Me();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this._instance.get_property(eI)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(a.$early_access_feature_name=r.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=z({},this.getFlagVariants(),{[e]:t});null==(s=this._instance.persistence)||s.register({[rU]:Object.keys(rJ(o)),[e$]:o}),this.Te()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this._instance.get_property(eI),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance.Pe({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+r),method:"GET",callback:t=>{var i,s;if(t.json){var r=t.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(eI),null==(s=this._instance.persistence)||s.register({[eI]:r}),e(r)}}})}Me(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}Te(e){var{flags:t,flagVariants:i}=this.Me();
vendor: 3,947 bytes, line 3
3this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(eC)||{};this._instance.register({[eC]:z({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(eC)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(eP)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=z({},i[t],e[t]),delete e[t]}),this._instance.register({[eP]:z({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(eP)||{};this._instance.register({[eP]:z({},t,{[e]:{}})})}else this._instance.unregister(eP)}reset(){this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$e=!1,this.xe=!1,this.$anon_distinct_id=void 0,this.Ie(),this.me=!1}constructor(e){this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$e=!1,this.xe=!1,this._instance=e,this.featureFlagEventHandlers=[]}}var rX=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class rQ{isDisabled(){return!!this.Ae}Oe(e){-1===rX.indexOf(e.persistence.toLowerCase())&&(q.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&t$.O()?t$:"localstorage+cookie"===t&&tF.O()?tF:"sessionstorage"===t&&tT.O()?tT:"memory"===t?tP:"cookie"===t?tx:tF.O()?tF:tx}properties(){var e={};return W(this.props,function(t,i){if(i===e$&&F(t))for(var s,r=Object.keys(t),a=0;a<r.length;a++)e["$feature/"+r[a]]=t[r[a]];else s=!1,(O(ez)?s:n&&ez.indexOf===n?-1!=ez.indexOf(i):(W(ez,function(e){if(s||(s=e===i))return G}),s))||(e[i]=t)}),e}load(){if(!this.Ae){var e=this.B.L(this.Fe);e&&(this.props=Y({},e))}}save(){this.Ae||this.B.j(this.Fe,this.props,this.De,this.Le,this.je,this.S.debug)}remove(){this.B.N(this.Fe,!1),this.B.N(this.Fe,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(F(e)){P(t)&&(t="None"),this.De=P(i)?this.Ne:i;var s=!1;if(W(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.props[i]=e,s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(F(e)){this.De=P(t)?this.Ne:t;var i=!1;if(W(e,(t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.props[s]=t,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Ce){var e=rM(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);C(Q(e))||this.register(e),this.Ce=!0}}update_search_keyword(){var e;this.register((e=null==o?void 0:o.referrer)?rL(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rq(),$referring_domain:null!=o&&o.referrer&&(null==(e=ta(o.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[eL]||this.props[eN]||this.register_once({[eq]:rj(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};W([eN,eL],t=>{var i=this.props[t];i&&W(i,function(t,i){e["$initial_"+w(i)]=t})});var t,i,s=this.props[eq];return s&&Y(e,(t=rB(s),i={},W(t,function(e,t){i["$initial_"+w(t)]=e}),i)),e}safe_merge(e){return W(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.Ne=this.De=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var s=this.Oe(e),r=this.props;this.clear(),this.B=s,this.props=r,this.save()}}set_disabled(e){this.Ae=e,this.Ae?this.remove():this.save()}set_cross_subdomain(e){e!==this.Le&&(this.Le=e,this.remove(),this.save())}set_secure(e){e!==this.je&&(this.je=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[en]||{};i[e]=t,this.props[en]=i,this.save()}remove_event_timer(e){var t=(this.props[en]||{})[e];
3return P(t)||(delete this.props[en][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}constructor(e,t){this.S=e,this.props={},this.Ce=!1,this.Fe=(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.B=this.Oe(e),this.load(),e.debug&&q.info("Persistence loaded",e.persistence,z({},this.props)),this.update_config(e,e,t),this.save()}}class r0{on(e,t){return this.ze[e]||(this.ze[e]=[]),this.ze[e].push(t),()=>{this.ze[e]=this.ze[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.ze[e]||[])i(t);for(var s of this.ze["*"]||[])s(e,t)}constructor(){this.ze={},this.ze={}}}class r1{init(){var e,t;P(null==(e=this._instance)?void 0:e.Ve)||null==(t=this._instance)||t.Ve((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!P(null==(t=this._instance)?void 0:t.Ve)&&(e.forEach(e=>{var t,i;null==(t=this.Je)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.Ge)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s,r=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&r.add(null==e?void 0:e.selector)})}),null==(s=this._instance)||s.autocapture.setElementSelectors(r)}}on(e,t){var i;null!=t&&0!=e.length&&(this.Ge.has(e)||this.Ge.has(null==t?void 0:t.event))&&this.Je&&(null==(i=this.Je)?void 0:i.size)>0&&this.Je.forEach(e=>{this.Ke(t,e)&&this.Ue.emit("actionCaptured",e.name)})}Ye(e){this.onAction("actionCaptured",t=>e(t))}Ke(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.qe(e,i))return!0;return!1}onAction(e,t){return this.Ue.on(e,t)}He(e,t){if(null!=t&&t.url){var i,s=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!s||"string"!=typeof s||!r1.Xe(s,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static Xe(e,i,s){switch(s){case"regex":return!!t&&sj(e,i);case"exact":return i===e;case"contains":return sj(e,r1.Qe(i).replace(/_/g,".").replace(/%/g,".*"));default:return!1}}static Qe(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}We(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.Ze(e).some(e=>!(null!=t&&t.href&&!r1.Xe(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&(null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&!(null!=t&&t.text&&!r1.Xe(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!r1.Xe(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))return!1;if(null!=t&&t.selector){var i,s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(!s||!s.includes(null==t?void 0:t.selector))return!1}return!0}Ze(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}constructor(e){this.Ue=new r0,this.qe=(e,t)=>this.Be(e,t)&&this.He(e,t)&&this.We(e,t),this.Be=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.Ge=new Set,this.Je=new Set}}(function(e){e.Button="button",e.Tab="tab",e.Selector="selector"})({}),function(e){e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger"}({});var r2=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),r3=(function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}({}),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}({}),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}({}),function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({})),r5=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_
3START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e}({}),r6=j("[Surveys]"),r8="seenSurvey_",r4=[r2.Popover,r2.Widget,r2.API];class r7{register(e){var t;P(null==(t=this._instance)?void 0:t.Ve)||(this.er(e),this.rr(e))}rr(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.sr&&(this.sr=new r1(this._instance),this.sr.init(),this.sr.Ye(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,s,r,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)?void 0:s.length)>0&&(null==(r=this.sr)||r.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.ir.get(t.name);i&&i.push(e.id),this.ir.set(t.name,i||[e.id])}}))}))}er(e){var t;0!==e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}).length&&(null==(t=this._instance)||t.Ve((e,t)=>{this.onEvent(e,t)}),e.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||t.forEach(t=>{if(t&&t.name){var i=this.tr.get(t.name);i&&i.push(e.id),this.tr.set(t.name,i||[e.id])}})}))}onEvent(e,t){var i,s=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[eT])||[];if("survey shown"===e&&t&&s.length>0){r6.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:s});var r,n=null==t||null==(r=t.properties)?void 0:r.$survey_id;if(n){var a=s.indexOf(n);a>=0&&(s.splice(a,1),this.nr(s))}}else this.tr.has(e)&&(r6.info("survey event matched, updating activated surveys",{event:e,surveys:this.tr.get(e)}),this.nr(s.concat(this.tr.get(e)||[])))}onAction(e){var t,i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[eT])||[];this.ir.has(e)&&this.nr(i.concat(this.ir.get(e)||[]))}nr(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[eT]:[...new Set(e)]})}getSurveys(){var e;return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[eT])||[]}getEventToSurveys(){return this.tr}ar(){return this.sr}constructor(e){this._instance=e,this.tr=new Map,this.ir=new Map}}class r9{onRemoteConfig(e){var t=e.surveys;if(A(t))return r6.warn("Flags not loaded yet. Not loading surveys.");var i=$(t);this.lr=i?t.length>0:t,r6.info("flags response received, isSurveysEnabled: "+this.lr),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(r8)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.hr)r6.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)r6.info("Disabled. Not loading surveys.");else{var e=null==p?void 0:p.__PosthogExtensions__;if(e){var t=this.lr;if(!P(t)){this.hr=!0;try{var i=e.generateSurveys;if(i)return void this.vr(i,t);var s=e.loadExternalDependency;if(!s)return void this.cr("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.cr("Could not load surveys script",i):this.vr(e.generateSurveys,t)})}catch(e){throw this.cr("Error initializing surveys",e),e}finally{this.hr=!1}}}else r6.error("PostHog Extensions not found.")}}vr(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new r7(this._instance),r6.info("Surveys loaded successfully"),this.pr({isLoaded:!0})}cr(e,t){r6.error(e,t),this.pr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.dr.push(e),this._surveyManager&&this.pr({isLoaded:!0}),()=>{this.dr=this.dr.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return r6.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(eR);if(i&&!t)return e(i,{isLoaded:!0});if(this.ur)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.ur=!0,this._instance.Pe({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{this.ur=!1;var i=t.statusCode;if(200!==i||!t.json){var s="Surveys API could not be loaded, status: "+i;return r6.error(s),e([],{isLoaded:!1,error:s})}var r,n,a=t.json.surveys||[],o=a.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});return o.length>0&&(null==(n=this._surveyEventReceiver)||n.register(o)),null==(r=this._instance.persistence)||r.register({[eR]:a}),e(a,{isLoaded:!0})}})}catch(e){throw this.ur=!1,e}}
3pr(e){for(var t of this.dr)try{e.isLoaded?this.getSurveys(t):t([],e)}catch(e){r6.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!A(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);r6.warn("init was not called")}gr(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}_r(e){if(A(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.gr(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(A(this._surveyManager))return r6.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this._r(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return A(this._surveyManager)?(r6.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this._r(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){if(A(this._surveyManager))r6.warn("init was not called");else{var i=this.gr(e);if(i)if(r4.includes(i.type)){var s=null==o?void 0:o.querySelector(t);s?this._surveyManager.renderSurvey(i,s):r6.warn("Survey element not found")}else r6.warn("Surveys of type "+i.type+" cannot be rendered in the app");else r6.warn("Survey not found")}}constructor(e){this.lr=void 0,this._surveyManager=null,this.ur=!1,this.hr=!1,this.dr=[],this._instance=e,this._surveyEventReceiver=null}}var ne=j("[RateLimiter]");class nt{clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,s,r=(new Date).getTime(),n=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(eD))?t:{tokens:this.captureEventsBurstLimit,last:r};n.tokens+=(r-n.last)/1e3*this.captureEventsPerSecond,n.last=r,n.tokens>this.captureEventsBurstLimit&&(n.tokens=this.captureEventsBurstLimit);var a=n.tokens<1;return a||e||(n.tokens=Math.max(0,n.tokens-1)),!a||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,null==(s=this.instance.persistence)||s.set_property(eD,n),{isRateLimited:a,remainingTokens:n.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{ne.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void ne.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(i=e.config.rate_limiting)?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}}var ni=j("[RemoteConfig]");class ns{get remoteConfig(){var e;return null==(e=p._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}mr(e){var t,i;null!=(t=p.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(ni.error("PostHog Extensions not found. Cannot load remote config."),e())}br(e){this._instance.Pe({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 ni.info("Using preloaded remote config",this.remoteConfig),void this.Re(this.remoteConfig);if(this._instance.I())return void ni.warn("Remote config is disabled. Falling back to local config.");this.mr(e=>{if(!e)return ni.info("No config found after loading remote JS config. Falling back to JSON."),void this.br(e=>{this.Re(e)});this.Re(e)})}catch(e){ni.error("Error loading remote config",e)}}Re(e){e?this._instance.config.__preview_remote_config?(this._instance.Re(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):ni.info("__preview_remote_config is disabled. Logging config instead",e):ni.error("Failed to fetch remote config from PostHog.")}constructor(e){this._instance=e}}class nr{enqueue(e){this.wr.push(e),this.kr||this.Er()}unload(){this.Ir();var e=Object.values(this.wr.length>0?this.Pr():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.$r(z({},e,{transport:"sendBeacon"}))})}enable(){this.yr=!1,this.Er()}Er(){var e=this;this.yr||(this.kr=setTimeout(()=>{if(this.Ir(),this.wr.length>0){var t=this.Pr();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&$(s.data)&&W(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.$r(s)}()}},this.Sr))}Ir(){clearTimeout(this.kr),this.kr=void 0}Pr(){var e={};return W(this.wr,t=>{var i,s=(t?t.batchKey:null)||t.url;P(e[s])&&(e[s]=z({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.wr=[],e}constructor(e,t){this.yr=!0,this.wr=[],this.Sr=tq((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,"flush interval",3e3),this.$r=e}}var nn=["retriesPerformedSoFar"];class na{get length(){return this.wr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=U(e,nn);M(t)&&t>0&&(i.url=sD(i.url,{retry_count:t})),this._instance.Pe(z({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.Cr(z({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}Cr(e){var t,i,s,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var n=(s=(Math.random()-.5)*((i=Math.min(18e5,t=3e3*Math.pow(2,r)))-t/2),Math.ceil(i+s)),a=Date.now()+n;this.wr.push({retryAt:a,requestOptions:e});var o="Enqueued failed request for retry in "+n;
3navigator.onLine||(o+=" (Browser is offline)"),q.warn(o),this.Rr||(this.Rr=!0,this.Fr())}Fr(){this.Or&&clearTimeout(this.Or),this.Or=setTimeout(()=>{this.Mr&&this.wr.length>0&&this.se(),this.Fr()},this.Tr)}se(){var e=Date.now(),t=[],i=this.wr.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.wr=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Or&&(clearTimeout(this.Or),this.Or=void 0),this.wr))try{this._instance.Pe(z({},e,{transport:"sendBeacon"}))}catch(e){q.error(e)}this.wr=[]}constructor(e){this.Rr=!1,this.Tr=3e3,this.wr=[],this._instance=e,this.wr=[],this.Mr=!0,!P(t)&&"onLine"in t.navigator&&(this.Mr=t.navigator.onLine,ei(t,"online",()=>{this.Mr=!0,this.se()}),ei(t,"offline",()=>{this.Mr=!1}))}}class no{getContext(){return this.Dr}resetContext(){var e=this.Dr;return setTimeout(this.Ar,0),e}startMeasuringScrollPosition(){ei(t,"scroll",this.Ar,{capture:!0}),ei(t,"scrollend",this.Ar,{capture:!0}),ei(t,"resize",this.Ar)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==t?void 0:t.document.documentElement;for(var e of $(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]){var i=null==t?void 0:t.document.querySelector(e);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return t&&(t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return t&&(t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft)||0}constructor(e){this.Ar=()=>{this.Dr||(this.Dr={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),a=r?Math.max(0,r.scrollHeight-r.clientHeight):0,o=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.Dr.lastScrollY=Math.ceil(n),this.Dr.maxScrollY=Math.max(n,null!=(e=this.Dr.maxScrollY)?e:0),this.Dr.maxScrollHeight=Math.max(a,null!=(t=this.Dr.maxScrollHeight)?t:0),this.Dr.lastContentY=o,this.Dr.maxContentY=Math.max(o,null!=(i=this.Dr.maxContentY)?i:0),this.Dr.maxContentHeight=Math.max(l,null!=(s=this.Dr.maxContentHeight)?s:0)},this._instance=e}}var nl=e=>rj(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class nc{jr(){return this.zr.props[eM]}getSetOnceProps(){var e,t=null==(e=this.jr())?void 0:e.props;return t?"r"in t?rB(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return W(Q(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+w(i)]=t}),e}constructor(e,t,i,s){this.Lr=e=>{var t=this.jr();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Nr(this._instance)};this.zr.register({[eM]:i})}},this._instance=e,this.Ur=t,this.zr=i,this.Nr=s||nl,this.Ur.onSessionId(this.Lr)}}var nu=j("[SessionId]");class nh{get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return P(this.qr)&&(this.qr=[]),this.qr.push(e),this.Ct&&e(this.Ct,this.fi),()=>{this.qr=this.qr.filter(t=>t!==e)}}Kr(){return"memory"!==this.S.persistence&&!this.zr.Ae&&tT.O()}Qr(e){e!==this.fi&&(this.fi=e,this.Kr()&&tT.j(this.Jr,e))}Zr(){return this.fi?this.fi:this.Kr()?tT.L(this.Jr):null}Yr(e,t,i){e===this.Ct&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Ct=e,this.zr.register({[eE]:[t,e,i]}))}ts(){if(this.Ct&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ct,this._sessionStartTimestamp];var e=this.zr.props[eE];return $(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Yr(null,null,null)}Xr(){ei(t,"beforeunload",()=>{this.Kr()&&tT.N(this.Vr)},{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.S.__preview_experimental_cookieless_mode)throw Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var i=t||(new Date).getTime(),[s,r,n]=this.ts(),a=this.Zr(),o=M(n)&&n>0&&Math.abs(i-n)>864e5,l=!1,c=!r,u=!e&&this.Br(i,s);c||u||o?(r=this.Hr(),a=this.Wr(),nu.info("new session ID generated",{sessionId:r,windowId:a,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:o}}),n=i,l=!0):a||(a=this.Wr(),l=!0);var h=0===s||!e||o?i:s,d=0===n?(new Date).getTime():n;return this.Qr(a),this.Yr(r,h,d),e||this.Gr(),l&&this.qr.forEach(e
3=>e(r,a,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:o}:void 0)),{sessionId:r,windowId:a,sessionStartTimestamp:d,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:o}:void 0,lastActivityTimestamp:s}}Gr(){clearTimeout(this.es),this.es=setTimeout(()=>{var[e]=this.ts();this.Br((new Date).getTime(),e)&&this.resetSessionId()},1.1*this.sessionTimeoutMs)}constructor(e,t,i){if(this.qr=[],this.Br=(e,t)=>Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.S=e.config,this.zr=e.persistence,this.fi=void 0,this.Ct=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Hr=t||tb,this.Wr=i||tb;var s,r=this.S.persistence_name||this.S.token,n=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*tq(n,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Gr(),this.Jr="ph_"+r+"_window_id",this.Vr="ph_"+r+"_primary_window_exists",this.Kr()){var a=tT.L(this.Jr),o=tT.L(this.Vr);a&&!o?this.fi=a:tT.N(this.Jr),tT.j(this.Vr,!0)}if(null!=(s=this.S.bootstrap)&&s.sessionID)try{var l=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.S.bootstrap.sessionID);this.Yr(this.S.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){nu.error("Invalid sessionID in bootstrap",e)}this.Xr()}}var nd=["$set_once","$set"],np=j("[SiteApps]");class ng{get isEnabled(){return!!this._instance.config.opt_in_site_apps}ss(e,t){if(t){var i=this.globalsForEvent(t);this.rs.push(i),this.rs.length>1e3&&(this.rs=this.rs.slice(10))}}get siteAppLoaders(){var e;return null==(e=p._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ve(this.ss.bind(this));this.ns=()=>{e(),this.rs=[],this.ns=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,a,o,l={},c=this._instance.get_property("$groups")||[];for(var[u,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[u]={id:c[u],type:u,properties:h};var{$set_once:d,$set:p}=e;return{event:z({},U(e,nd),{properties:z({},e.properties,p?{$set:z({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:z({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},d)}:{}),elements_chain:null!=(n=null==(a=e.properties)?void 0:a.$elements_chain)?n:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.rs.length&&(np.info("Processing "+this.rs.length+" events for site app with id "+e.id),this.rs.forEach(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.ns)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,np.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback:e=>{r(e)}});n&&(t.processEvent=n),s=!0}catch(t){np.error("Error while initializing PostHog app with config id "+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){np.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}os(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}ls(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){np.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,s,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.os(),void this._instance.on("eventCaptured",e=>this.ls(e))):void np.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.ns)||i.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled){var n=function(e){var t;p["__$$ph_site_app_"+e]=r._instance,null==(t=p.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(r._instance,o,t=>{if(t)return np.error("Error while initializing PostHog app with config id "+e,t)})};for(var{id:a,url:o}of e.siteApps)n(a)}else np.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}constructor(e){this._instance=e,this.rs=[],this.apps={}}}var n_=["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","hub
3spot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","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"],nv=function(e,t){if(!e)return!1;var i=e.toLowerCase();return n_.concat(t||[]).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})},nf=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&nv(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>nv(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},nm=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),ny="i.posthog.com";class nb{get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+ny,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.us[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.us[this.apiHost]=nm.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.us[this.apiHost]=nm.EU:this.us[this.apiHost]=nm.CUSTOM),this.us[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if(this.region===nm.CUSTOM)return this.apiHost+t;var i=ny+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}constructor(e){this.us={},this.instance=e}}var nw={icontains:(e,i)=>!!t&&i.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,i)=>!!t&&-1===i.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,i)=>!!t&&sj(i.href,e),not_regex:(e,i)=>!!t&&!sj(i.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class nE{onFeatureFlags(e){if(this._is_bot())nE.hs("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(A(this.ds))return this.ds=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nE.hs("applying feature flags",e),e.forEach(e=>{var t;if(this.ds&&null!=(t=this.ds)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.ds)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.vs(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=nE.getWindowLocation();if(null!=e&&e.search){var t=tl(null==e?void 0:e.search,"__experiment_id"),i=tl(null==e?void 0:e.search,"__experiment_variant");t&&i&&(nE.hs("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.fs(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance.Pe({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>200===t.statusCode&&t.json?e(t.json.experiments||[]):e([])})}fs(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(nE.hs("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.vs(s[0].name,t,s[0].variants[t].transforms))}static cs(e){return!A(e.conditions)&&nE.ps(e)&&nE.gs(e)}static ps(e){if(A(e.conditions)||A(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,s,r,n=nE.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||nw[null!=(s=null==(r=e.conditions)?void 0:r.urlMatchType)?s:"icontains"](e.conditions.url,n))}
3static getWindowLocation(){return null==t?void 0:t.location}static gs(e){if(A(e.conditions)||A(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rM();if(t.utm_source){var i,s,r,n,a,o,l,c,u,h=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==t.utm_source,p=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,g=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==t.utm_term;return h&&p&&g&&d}return!1}static hs(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];q.info("[WebExperiments] "+e,i)}vs(e,t,i){this._is_bot()?nE.hs("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){nE.hs("applying transform of variant "+t+" for experiment "+e+" ",i);var s,r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):nE.hs("Control variants leave the page unmodified.")}_is_bot(){return a&&this._instance?nf(a,this._instance.config.custom_blocked_useragents):void 0}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{nE.hs("retrieved web experiments from the server"),t.ds=new Map,e.forEach(e=>{if(e.feature_flag_key){t.ds&&(nE.hs("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.ds)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);R(s)&&e.variants[s]&&t.vs(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];nE.cs(n)&&t.vs(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}}var nS=j("[PostHog ExternalIntegrations]"),nx={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class nk{J(e,t){var i;null==(i=p.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return nS.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,s,n;!r||null!=(i=p.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.J(nx[e],()=>{var i;null==(i=p.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!r&&null!=(s=p.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=p.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[s,r]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(s)}constructor(e){this._instance=e}}var n$={},nI=()=>{},nF="posthog",nC=!sA&&-1===(null==d?void 0:d.indexOf("MSIE"))&&-1===(null==d?void 0:d.indexOf("Mozilla")),nP=e=>{var i;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!R(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of ee)if(i===s)return!1;return!0}(null==o?void 0:o.location),persistence:"localStorage+cookie",persistence_name:"",loaded:nI,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:"2025-05-24"!==e||"history_change",capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",debug:l&&R(null==l?void 0:l.search)&&-1!==l.search.indexOf("__posthog_debug=true")||!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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==t||null==(i=t.location)?void 0:i.protocol),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",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_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_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;q.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:nI}},nR=e=>{var t={};P(e.process_person)||(t.person_profiles=e.process_person),P(e.xhr_headers)||(t.request_headers=e.x
3hr_headers),P(e.cookie_name)||(t.persistence_name=e.cookie_name),P(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),P(e.store_google)||(t.save_campaign_params=e.store_google),P(e.verbose)||(t.debug=e.verbose);var i=Y({},t,e);return $(e.property_blacklist)&&(P(e.property_denylist)?i.property_denylist=e.property_blacklist:$(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:q.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class nT{get _s(){return this.__forceAllowLocalhost}set _s(e){q.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}constructor(){this.__forceAllowLocalhost=!1}}class nO{get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}init(e,t,i){if(i&&i!==nF){var s,r=null!=(s=n$[i])?s:new nO;return r._init(e,t,i),n$[i]=r,n$[nF][i]=r,r}return this._init(e,t,i)}_init(e,i,s){if(void 0===i&&(i={}),P(e)||T(e))return q.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 q.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.ks=i,this.Es=[],i.person_profiles&&(this.$s=i.person_profiles),this.set_config(Y({},nP(i.defaults),nR(i),{name:s,token:e})),this.config.on_xhr_error&&q.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:f.GZipJS;var r=this.Is();this.persistence=new rQ(this.config,r),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rQ(z({},this.config,{persistence:"sessionStorage"}),r);var n=z({},this.persistence.props),a=z({},this.sessionPersistence.props);if(this.register({$initialization_time:(new Date).toISOString()}),this.Ps=new nr(e=>this.Rs(e),this.config.request_queue_config),this.Ts=new na(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new nh(this),this.sessionPropsManager=new nc(this,this.sessionManager,this.persistence)),new s$(this).startIfEnabledOrStop(),this.siteApps=new ng(this),null==(o=this.siteApps)||o.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new s_(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new tp(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new sR(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new sF(this),this.exceptionObserver=new tH(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new tN(this,tL),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new ii(this),this.historyAutocapture.startIfEnabled(),g.DEBUG=g.DEBUG||this.config.debug,g.DEBUG&&q.info("Starting in debug mode",{this:this,config:i,thisC:z({},this.config),p:n,s:a}),void 0!==(null==(l=i.bootstrap)?void 0:l.distinctID)){var o,l,c,u,h=this.config.get_device_id(tb()),d=null!=(c=i.bootstrap)&&c.isIdentifiedID?h:i.bootstrap.distinctID;this.persistence.set_property(eA,null!=(u=i.bootstrap)&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:d})}if(this.Ms()){var p,_,v=Object.keys((null==(p=i.bootstrap)?void 0:p.featureFlags)||{}).filter(e=>{var t;return!(null==(t=i.bootstrap)||null==(t=t.featureFlags)||!t[e])}).reduce((e,t)=>{var s;return e[t]=(null==(s=i.bootstrap)||null==(s=s.featureFlags)?void 0:s[t])||!1,e},{}),m=Object.keys((null==(_=i.bootstrap)?void 0:_.featureFlagPayloads)||{}).filter(e=>v[e]).reduce((e,t)=>{var s,r;return null!=(s=i.bootstrap)&&null!=(s=s.featureFlagPayloads)&&s[t]&&(e[t]=null==(r=i.bootstrap)||null==(r=r.featureFlagPayloads)?void 0:r[t]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:m})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:eH,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(tb());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(eA,"anonymous")}return ei(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),i.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var s=i=>{var s=()=>i.anonymousId()||tb();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(eA,"identified")),t()},r=i.user();"then"in r&&I(r.then)?r.then(e=>s(e)):s(r)}(e,()=>{var s;i.register((Promise&&Promise.resolve||sv.warn("This browser does not have Promise support, and can not use the segment integration"),s=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(sv.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(sv.info("UserId set, identifying with PostHog"),e.identify(t.event.userId)
3);var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,"$pageview"),identify:e=>s(e,"$identify"),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Cs()):this.Cs(),I(this.config._onCapture)&&this.config._onCapture!==nI&&(q.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&q.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}Re(e){var t,i,s,r,n,a,l,c;if(!o||!o.body)return q.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Re(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=y(e.supportedCompression,f.GZipJS)?f.GZipJS:y(e.supportedCompression,f.Base64)?f.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.$s?this.$s:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(s=this.sessionRecording)||s.onRemoteConfig(e),null==(r=this.autocapture)||r.onRemoteConfig(e),null==(n=this.heatmaps)||n.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(e),null==(l=this.exceptionObserver)||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(c=this.deadClicksAutocapture)||c.onRemoteConfig(e)}Cs(){try{this.config.loaded(this)}catch(e){q.critical("`loaded` function failed",e)}this.Fs(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.Os()},1),new ns(this).load(),this.featureFlags.flags()}Fs(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null==(e=this.Ps)||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||V(this.__request_queue,e=>this.Rs(e)),this.__request_queue=[],this.Fs()}_handle_unload(){var e,t;this.config.request_batching?(this.As()&&this.capture("$pageleave"),null==(e=this.Ps)||e.unload(),null==(t=this.Ts)||t.unload()):this.As()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Pe(e){this.__loaded&&(nC?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=sD(e.url,{ip:+!!this.config.ip}),e.headers=z({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,s,r=z({},e);r.timeout=r.timeout||6e4,r.url=sD(r.url,{_:(new Date).getTime().toString(),ver:g.LIB_VERSION,compression:r.compression});var n=null!=(t=r.transport)?t:"fetch",a=null!=(i=null==(s=et(sq,e=>e.transport===n))?void 0:s.method)?i:sq[0].method;if(!a)throw Error("No available transport method");a(r)})(z({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(i=(s=this.config).on_request_error)||i.call(s,t)),null==e.callback||e.callback(t)}}))))}Rs(e){this.Ts?this.Ts.retriableRequest(e):this.Pe(e)}_execute_array(e){var t,i=[],s=[],r=[];V(e,e=>{e&&($(t=e[0])?r.push(e):I(e)?e.call(this):$(e)&&"alias"===t?i.push(e):$(e)&&-1!==t.indexOf("capture")&&I(this[t])?r.push(e):s.push(e))});var n=function(e,t){V(e,function(e){if($(e[0])){var i=t;W(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};n(i,this),n(s,this),n(r,this)}Ms(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ps){if(!this.consent.isOptedOut())if(!P(e)&&R(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var r=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==r||!r.isRateLimited){null!=t&&t.$current_url&&!R(null==t?void 0:t.$current_url)&&(q.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),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 n=new Date,a=(null==i?void 0:i.timestamp)||n,o=tb(),l={uuid:o,event:e,properties:this.calculateEventProperties(e,t||{},a,o)};r&&(l.properties.$lib_rate_limit_remaining_tokens=r.remainingTokens),(null==i?void 0:i.$set)&&(l.$set=null==i?void 0:i.$set);var c,u,h=this.Ds(null==i?void 0:i.$set_once);if(h&&(l.$set_once=h),(d=l,p=null!=i&&i._noTruncate?null:this.config.properties_string_max_length,g=e=>R(e)&&!O(p)?e.slice(0,p):e,_=new Set,l=function e(t,i){var s;return t!==Object(t)?g?g(t,i):t:_.has(t)?void 0:(_.add(t),$(t)?(s=[],V(t,t=>{s.push(e(t))})):(s={},W(t,(t,i)=>{_.has(t)||(s[i]=e(t,i))}
3)),s)}(d)).timestamp=a,P(null==i?void 0:i.timestamp)||(l.properties.$event_time_override_provided=!0,l.properties.$event_time_override_system_time=n),e===r3.DISMISSED||e===r3.SENT){var d,p,g,_,v,f,m,y=null==t?void 0:t[r5.SURVEY_ID],b=null==t?void 0:t[r5.SURVEY_ITERATION];localStorage.setItem((u=""+r8+(c={id:y,current_iteration:b}).id,c.current_iteration&&c.current_iteration>0&&(u=""+r8+c.id+"_"+c.current_iteration),u),"true"),l.$set=z({},l.$set,{[(v={id:y,current_iteration:b},m="$survey_"+(f=e===r3.SENT?"responded":"dismissed")+"/"+v.id,v.current_iteration&&v.current_iteration>0&&(m="$survey_"+f+"/"+v.id+"/"+v.current_iteration),m)]:!0})}var w=z({},l.properties.$set,l.$set);if(C(w)||this.setPersonPropertiesForFlags(w),!A(this.config.before_send)){var E=this.Ls(l);if(!E)return;l=E}this.ys.emit("eventCaptured",l);var S={method:"POST",url:null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:l,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Rs(S):this.Ps.enqueue(S),l}q.critical("This capture call is ignored due to client rate limiting.")}}else q.error("No event name provided to posthog.capture")}else q.uninitializedWarning("posthog.capture")}Ve(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,i,s,r,n){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;var a,c=n?void 0:this.persistence.remove_event_timer(e),u=z({},i);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(u.$cookieless_mode=!0),"$snapshot"===e){var h=z({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=h.distinct_id,(!R(u.distinct_id)&&!M(u.distinct_id)||T(u.distinct_id))&&q.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var p,_=function(e,i){if(!d)return{};var s,r,n=e?J([],rR,i||[]):[],[a,o]=function(e){for(var t=0;t<rF.length;t++){var[i,s]=rF[t],r=i.exec(e),n=r&&(I(s)?s(r,e):s);if(n)return n}return["",""]}(d);return Y(Q({$os:a,$os_version:o,$browser:rk(d,navigator.vendor),$device:rC(d),$device_type:(r=rC(d))===sK||r===sJ||"Kobo"===r||"Kindle Fire"===r||r===rv?sY:r===rn||r===ro||r===ra||r===rp?"Console":r===sX?"Wearable":r?sV:"Desktop",$timezone:rH(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:tc(null==l?void 0:l.href,n,rO),$host:null==l?void 0:l.host,$pathname:null==l?void 0:l.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+"...":d,$browser_version:rI(d,navigator.vendor),$browser_language:rN(),$browser_language_prefix:"string"==typeof(s=rN())?s.split("-")[0]:void 0,$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:"web",$lib_version:g.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:v,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,s.getTime());u.$session_id=v,u.$window_id=f}this.sessionPropsManager&&Y(u,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&Y(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=null==(a=this.Ts)?void 0:a.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nm.CUSTOM&&(u.$lib_custom_api_host=this.config.api_host),p="$pageview"!==e||n?"$pageleave"!==e||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,r),u=Y(u,p),"$pageview"===e&&o&&(u.title=o.title),!P(c)){var m=s.getTime()-c;u.$duration=parseFloat((m/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser"),(u=Y({},_,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this._isIdentified(),$(this.config.property_denylist)?W(this.config.property_denylist,function(e){delete u[e]}):q.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(q.error("sanitize_properties is deprecated. Use before_send instead"),u=y(u,e));var b=this.js();return u.$process_person_profile=b,b&&!n&&this.Ns("_calculate_event_properties"),u}Ds(e){if(!this.persistence||!this.js()||this.bs)return e;var t,i=Y({},this.persistence.get_initial_props(),(null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps())||{},e||{}),s=this.config.sanitize_properties;return s&&(q.error("sanitize_properties is deprecated. Use before_send instead"),i=s(i,"$set_once")),this.bs=!0,C(i)?void 0:i}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}zs(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.ys.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return q.uninitializedWarning("posthog.identify");if(M(e)&&(e=e.toString(),q.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))q.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
3ot a hardcoded string.');else if(e!==eH){if(this.Ns("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(er)&&(this.unregister(er),this.register({distinct_id:e}));var r="anonymous"===(this.persistence.get_property(eA)||"anonymous");e!==s&&r?(this.persistence.set_property(eA,"identified"),this.setPersonPropertiesForFlags(z({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.xs=sB(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(eO))}}else q.critical('The string "'+eH+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else q.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Ns("posthog.setPersonProperties")){var i=sB(this.get_distinct_id(),e,t);this.xs!==i?(this.setPersonPropertiesForFlags(z({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.xs=i):q.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.Ns("posthog.group")){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:z({},s,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),s[e]===t||i||this.reloadFeatureFlags()}}else q.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Ns("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){if(q.info("reset"),!this.__loaded)return q.uninitializedWarning("posthog.reset");var t,i,s,r,n=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(s=this.persistence)||s.set_property(eA,"anonymous"),null==(r=this.sessionManager)||r.resetSessionId(),this.xs=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:eH,$device_id:null},"");else{var a=this.config.get_device_id(tb());this.register_once({distinct_id:a,$device_id:e?a:n},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var r,n=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(es)?(q.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ns("posthog.alias")?(P(t)&&(t=this.get_distinct_id()),e!==t?(this.zs(er,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(q.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=z({},this.config);if(F(e)){Y(this.config,nR(e));var i,s,r,n,a,o=this.Is();null==(i=this.persistence)||i.update_config(this.config,t,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rQ(z({},this.config,{persistence:"sessionStorage"}),o),t$.O()&&"true"===t$.D("ph_debug")&&(this.config.debug=!0),this.config.debug&&(g.DEBUG=!0,q.info("set_config",{config:e,oldConfig:t,newConfig:z({},this.config)})),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(r=this.autocapture)||r.startIfEnabled(),null==(n=this.heatmaps)||n.startIfEnabled(),this.surveys.loadIfEnabled(),this.Us(),null==(a=this.externalIntegrations)||a.startIfEnabledOrStop()}}startSessionRecording(e){var t,i,s,r,n,a=!0===e,o={sampling:a||!(null==e||!e.sampling),linked_flag:a||!(null==e||!e.linked_flag),url_trigger:a||!(null==e||!e.url_trigger),event_trigger:a||!(null==e||!e.event_trigger)};Object.values(o).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),o.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),o.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=Error("PostHog syntheticException");return this.exceptions.sendExceptionEvent(z({},function(e,t){var{error:i,event:s}=e,r={$exception_list:[]},n=i||s;if(tW(n)||tV(n,"DOMException")){if("stack"in n)r=t9(n,t);else{var a=n.name||(tW(n)?"DOMError":"DOMException"),o=n.message?a+": "+n.message:a;r=ie(o,z({},t,{overrideExceptionType:tW(n)?"DOMError":"DOMException",defaultExceptionMessage:o}))}return"code"in n&&(r.$exception_DOMException_code=""+n.code),r}if(tV(n,"ErrorEvent")&&n.error)return t9(n.error,t);if(tG(n))return t9(n,t);if(tV(n,"Object")||tz(n))return function(e,t){var i,s,r,n=null==(s=null==t?void 0:t.handled)||s,a=null==(r=null==t?void 0:t.synthetic)||r,o={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:tz(e)?e.constructor.name:"Error",value:"Non-Error 'exception' captured with keys: "+function(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var s=i.length;s>0;s--){var r=i.slice(0,s).join(", ");
3if(!(r.length>t))return s===i.length||r.length<=t?r:r.slice(0,t)+"..."}return""}(e),mechanism:{handled:n,synthetic:a}};if(null!=t&&t.syntheticException){var l=t4(null==t?void 0:t.syntheticException,1);l.length&&(o.stacktrace={frames:l,type:"raw"})}return{$exception_list:[o],$exception_level:R(i=e.level)&&!T(i)&&m.indexOf(i)>=0?e.level:"error"}}(n,t);if(P(i)&&R(s)){var l="Error",c=s,u=s.match(t8);return u&&(l=u[1],c=u[2]),ie(c,z({},t,{overrideExceptionType:l,defaultExceptionMessage:c}))}return ie(n,t)}(e instanceof Error?{error:e,event:e.message}:{event:e},{syntheticException:i}),t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:nF;return t!==nF&&(t=nF+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(eA))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(eA))}js(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&C(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[er])&&(null==(t=this.persistence)||null==(t=t.props)||!t[ej]))}As(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.js()||this.Ns("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ns(e){return"never"===this.config.person_profiles?(q.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.zs(ej,!0),!0)}Is(){var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default;return this.config.disable_persistence||e&&!!t}Us(){var e,t,i,s,r=this.Is();return(null==(e=this.persistence)?void 0:e.Ae)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.Ae)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.Us(),(P(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(t=null==e?void 0:e.captureEventName)?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Os()}opt_out_capturing(){this.consent.optInOut(!1),this.Us()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this.Us()}_is_bot(){return a?nf(a,this.config.custom_blocked_useragents):void 0}Os(){o&&("visible"===o.visibilityState?this.ws||(this.ws=!0,this.capture("$pageview",{title:o.title},{send_instantly:!0}),this.Ss&&(o.removeEventListener("visibilitychange",this.Ss),this.Ss=null)):this.Ss||(this.Ss=this.Os.bind(this),ei(o,"visibilitychange",this.Ss)))}debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==t||t.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}I(){var e,t,i,s,r=this.ks||{};return"advanced_disable_flags"in r?!!r.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(q.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):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in r&&!P(r[e]),s=t in r&&!P(r[t]),i?r[e]:!!s&&(q&&q.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}Ls(e){if(A(this.config.before_send))return e;var t=$(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(A(i=s(i))){var r="Event '"+e.event+"' was rejected in beforeSend function";return L(e.event)?q.warn(r+". This can cause unexpected behavior."):q.info(r),null}i.properties&&!C(i.properties)||q.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;
3return null==(e=this.pageViewManager.ce)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}constructor(){this.webPerformance=new nT,this.bs=!1,this.version=g.LIB_VERSION,this.ys=new r0,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=nP(),this.SentryIntegration=sy,this.sentryIntegration=e=>(function(e,t){var i=sm(e,t);return{name:sf,processEvent:e=>i(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.ws=!1,this.Ss=null,this.$s=null,this.xs=null,this.featureFlags=new rZ(this),this.toolbar=new sx(this),this.scrollManager=new no(this),this.pageViewManager=new sT(this),this.surveys=new r9(this),this.experiments=new nE(this),this.exceptions=new sG(this),this.rateLimiter=new nt(this),this.requestRouter=new nb(this),this.consent=new tA(this),this.externalIntegrations=new nk(this),this.people={set:(e,t,i)=>{var s=R(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=R(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>q.info('send "'+(null==e?void 0:e.event)+'"',e))}}!function(e,t){for(var i=0;i<t.length;i++)e.prototype[t[i]]=X(e.prototype[t[i]])}(nO,["identify"]);var nA,nM=(nA=n$[nF]=new nO,function(){function e(){e.done||(e.done=!0,nC=!1,W(n$,function(e){e._dom_loaded()}))}null!=o&&o.addEventListener?"complete"===o.readyState?e():ei(o,"DOMContentLoaded",e,{capture:!1}):t&&q.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),nA)}]); 4 5//# sourceMappingURL=62e3992195880b58.js.map 6//# debugId=c485e5fd-5500-51cd-a48e-9bf713f9a127
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.