1"use strict"; 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]="162be6f4-e409-543a-88eb-ca893cec2dfc")}catch(e){}}(); 3(self.webpackChunkniche_spa=self.webpackChunkniche_spa||[]).push([[512],{10512:(dl,ys,bs)=>{bs.r(ys),bs.d(ys,{COPY_AUTOCAPTURE_EVENT:()=>Pt,Compression:()=>he,PostHog:()=>Mt,SurveyEventName:()=>hi,SurveyEventProperties:()=>gs,SurveyPosition:()=>ja,SurveyQuestionBranchingType:()=>Va,SurveyQuestionType:()=>za,SurveySchedule:()=>Ga,SurveyType:()=>Ua,SurveyWidgetType:()=>Ha,default:()=>Ln,knownUnsafeEditableEvent:()=>ks,posthog:()=>Ln,severityLevels:()=>$s});var s,g=typeof window<"u"?window:void 0,X=typeof globalThis<"u"?globalThis:g,ws=Array.prototype,Es=ws.forEach,Ss=ws.indexOf,ee=X?.navigator,y=X?.document,Q=X?.location,di=X?.fetch,pi=null!=X&&X.XMLHttpRequest&&"withCredentials"in new X.XMLHttpRequest?X.XMLHttpRequest:void 0,xs=X?.AbortController,Z=ee?.userAgent,x=g??{},we={DEBUG:!1,LIB_VERSION:"1.249.5"},Pt="$copy_autocapture",ks=["$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"],he=((s={}).GZipJS="gzip-js",s.Base64="base64",s),$s=["fatal","error","warning","log","info","debug"];function $(s,e){return-1!==s.indexOf(e)}var Ct=function(s){return s.trim()},gi=function(s){return s.replace(/^\$/,"")},Fs=Object.prototype,Is=Fs.hasOwnProperty,Tt=Fs.toString,C=Array.isArray||function(s){return"[object Array]"===Tt.call(s)},re=s=>"function"==typeof s,O=s=>s===Object(s)&&!C(s),Je=s=>{if(O(s)){for(var e in s)if(Is.call(s,e))return!1;return!0}return!1},f=s=>void 0===s,A=s=>"[object String]"==Tt.call(s),vi=s=>A(s)&&0===s.trim().length,Fe=s=>null===s,I=s=>f(s)||Fe(s),U=s=>"[object Number]"==Tt.call(s),de=s=>"[object Boolean]"===Tt.call(s),Un=s=>$(ks,s),Rs=s=>{var e={t:function(t){if(g&&(we.DEBUG||x.POSTHOG_DEBUG)&&!f(g.console)&&g.console){for(var i=("__rrweb_original__"in g.console[t]?g.console[t].__rrweb_original__:g.console[t]),r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];i(s,...n)}},info:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e.t("log",...i)},warn:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e.t("warn",...i)},error:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e.t("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];console.error(s,...i)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling "+t)},createLogger:t=>Rs(s+" "+t)};return e},E=Rs("[PostHog.js]"),B=E.createLogger,zn=B("[ExternalScriptsLoader]"),Ms=(s,e,t)=>{if(s.config.disable_external_dependency_loading)return zn.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var i=y?.querySelectorAll("script");if(i)for(var r=0;r<i.length;r++)if(i[r].src===e)return t();var n=()=>{if(!y)return t("document not found");var o=y.createElement("script");if(o.type="text/javascript",o.crossOrigin="anonymous",o.src=e,o.onload=c=>t(void 0,c),o.onerror=c=>t(c),s.config.prepare_external_dependency_script&&(o=s.config.prepare_external_dependency_script(o)),!o)return t("prepare_external_dependency_script returned null");var a,l=y.querySelectorAll("body > script");l.length>0?null==(a=l[0].parentNode)||a.insertBefore(o,l[0]):y.body.appendChild(o)};null!=y&&y.body?n():y?.addEventListener("DOMContentLoaded",n)};function m(){return m=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},m.apply(null,arguments)}function Ps(s,e){if(null==s)return{};var t={};for(var i in s)if({}.hasOwnProperty.call(s,i)){if(-1!==e.indexOf(i))continue;t[i]=s[i]}return t}x.__PosthogExtensions__=x.__PosthogExtensions__||{},x.__PosthogExtensions__.loadExternalDependency=(s,e,t)=>{var i="/static/"+e+".js?v="+s.version;if("remote-config"===e&&(i="/array/"+s.config.token+"/config.js"),"toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}
vendor: 5,054 bytes, line 3
3var n=s.requestRouter.endpointFor("assets",i);Ms(s,n,t)},x.__PosthogExtensions__.loadSiteApp=(s,e,t)=>{var i=s.requestRouter.endpointFor("api",e);Ms(s,i,t)};var Ot={};function Ie(s,e,t){if(C(s))if(Es&&s.forEach===Es)s.forEach(e,t);else if("length"in s&&s.length===+s.length)for(var i=0,r=s.length;i<r;i++)if(i in s&&e.call(t,s[i],i)===Ot)return}function M(s,e,t){if(!I(s)){if(C(s))return Ie(s,e,t);if((s=>s instanceof FormData)(s)){for(var i of s.entries())if(e.call(t,i[1],i[0])===Ot)return}else for(var r in s)if(Is.call(s,r)&&e.call(t,s[r],r)===Ot)return}}var L=function(s){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Ie(t,function(r){for(var n in r)void 0!==r[n]&&(s[n]=r[n])}),s},At=function(s){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Ie(t,function(r){Ie(r,function(n){s.push(n)})}),s};function Lt(s){for(var e=Object.keys(s),t=e.length,i=new Array(t);t--;)i[t]=[e[t],s[e[t]]];return i}var Cs=function(s){try{return s()}catch{return}},Vn=function(s){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return s.apply(this,t)}catch(r){E.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),E.critical(r)}}},_i=function(s){var e={};return M(s,function(t,i){(A(t)&&t.length>0||U(t))&&(e[i]=t)}),e},Wn=["herokuapp.com","vercel.app","netlify.app"];function Yn(s){var e=s?.hostname;if(!A(e))return!1;var t=e.split(".").slice(-2).join(".");for(var i of Wn)if(t===i)return!1;return!0}function Ts(s,e){for(var t=0;t<s.length;t++)if(e(s[t]))return s[t]}function T(s,e,t,i){var{capture:r=!1,passive:n=!0}=i??{};s?.addEventListener(e,t,{capture:r,passive:n})}var Os="$people_distinct_id",ht="__alias",dt="__timers",As="$autocapture_disabled_server_side",fi="$heatmaps_enabled_server_side",Ls="$exception_capture_enabled_server_side",mi="$error_tracking_suppression_rules",Ds="$web_vitals_enabled_server_side",Ns="$dead_clicks_enabled_server_side",qs="$web_vitals_allowed_metrics",yi="$session_recording_enabled_server_side",Bs="$console_log_recording_enabled_server_side",Hs="$session_recording_network_payload_capture",js="$session_recording_masking",Us="$session_recording_canvas_recording",zs="$replay_sample_rate",Vs="$replay_minimum_duration",Gs="$replay_script_config",Dt="$sesid",pt="$session_is_sampled",bi="$session_recording_url_trigger_activated_session",wi="$session_recording_event_trigger_activated_session",Ke="$enabled_feature_flags",Nt="$early_access_features",Ei="$feature_flag_details",gt="$stored_person_properties",qe="$stored_group_properties",Si="$surveys",qt="$surveys_activated",Bt="$flag_call_reported",Ee="$user_state",xi="$client_session_props",ki="$capture_rate_limit",$i="$initial_campaign_params",Fi="$initial_referrer_info",Ht="$initial_person_info",jt="$epp",Ws="__POSTHOG_TOOLBAR__",Ys="$posthog_cookieless",Jn=[Os,ht,"__cmpns",dt,yi,fi,Dt,Ke,mi,Ee,Nt,Ei,qe,gt,Si,Bt,xi,ki,$i,Fi,jt,Ht];function Js(s){return s instanceof Element&&(s.id===Ws||!(null==s.closest||!s.closest(".toolbar-global-fade-container")))}function Ut(s){return!!s&&1===s.nodeType}function Re(s,e){return!!s&&!!s.tagName&&s.tagName.toLowerCase()===e.toLowerCase()}function Ks(s){return!!s&&3===s.nodeType}function Xs(s){return!!s&&11===s.nodeType}function Ii(s){return s?Ct(s).split(/\s+/):[]}function Qs(s){var e=g?.location.href;return!!(e&&s&&s.some(t=>e.match(t)))}function zt(s){var e="";switch(typeof s.className){case"string":e=s.className;break;case"object":e=(s.className&&"baseVal"in s.className?s.className.baseVal:null)||s.getAttribute("class")||"";break;default:e=""}return Ii(e)}function Zs(s){return I(s)?null:Ct(s).split(/(\s+)/).filter(e=>Xe(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Vt(s){var e="";return Mi(s)&&!ir(s)&&s.childNodes&&s.childNodes.length&&M(s.childNodes,function(t){var i;Ks(t)&&t.textContent&&(e+=null!==(i=Zs(t.textContent))&&void 0!==i?i:"")}),Ct(e)}function er(s){return f(s.target)?s.srcElement||null:null!=(e=s.target)&&e.shadowRoot?s.composedPath()[0]||null:s.target||null;var e}var Ri=["a","button","form","input","select","textarea","label"];function tr(s){var e=s.parentNode;return!(!e||!Ut(e))&&e}function Mi(s){for(var e=s;e.parentNode&&!Re(e,"body");e=e.parentNode){var t=zt(e);if($(t,"ph-sensitive")||$(t,"ph-no-capture"))return!1}if($(zt(s),"ph-include"))return!0;var i=s.type||"";if(A(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=s.name||s.id||"";return!(A(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 ir(s){return!!(Re(s,"input")&&!["button","checkbox","submit","reset"].includes(s.type)||Re(s,"select")||Re(s,"textarea")||"true"===s.getAttribute("contenteditable"))}var sr="(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}
3)|((?:2131|1800|35[0-9]{3})[0-9]{11})",Xn=new RegExp("^(?:"+sr+")$"),Qn=new RegExp(sr),rr="\\d{3}-?\\d{2}-?\\d{4}",Zn=new RegExp("^("+rr+")$"),eo=new RegExp("("+rr+")");function Xe(s,e){return void 0===e&&(e=!0),!(I(s)||A(s)&&(s=Ct(s),(e?Xn:Qn).test((s||"").replace(/[- ]/g,""))||(e?Zn:eo).test(s)))}function nr(s){var e=Vt(s);return Xe(e=(e+" "+or(s)).trim())?e:""}function or(s){var e="";return s&&s.childNodes&&s.childNodes.length&&M(s.childNodes,function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=Vt(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+or(t)).trim())}catch(n){E.error("[AutoCapture]",n)}}),e}function to(s){return s.map(t=>{var i,r,n={text:null==(i=t.$el_text)?void 0:i.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:io(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Lt(t).filter(o=>{var[a]=o;return 0===a.indexOf("attr__")}).forEach(o=>{var[a,l]=o;return n.attributes[a]=l}),n}).map(i=>{var r,n,o="";if(i.tag_name&&(o+=i.tag_name),i.attr_class)for(var a of(i.attr_class.sort(),i.attr_class))o+="."+a.replace(/"/g,"");var l=m({},i.text?{text:i.text}:{},{"nth-child":null!==(r=i.nth_child)&&void 0!==r?r:0,"nth-of-type":null!==(n=i.nth_of_type)&&void 0!==n?n:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return Lt(l).sort((u,d)=>{var[h]=u,[p]=d;return h.localeCompare(p)}).forEach(u=>{var[d,h]=u;return c[ar(d.toString())]=ar(h.toString())}),(o+=":")+Lt(c).map(u=>{var[d,h]=u;return d+'="'+h+'"'}).join("")}).join(";")}function ar(s){return s.replace(/"|\\"/g,'\\"')}function io(s){var e=s.attr__class;return e?C(e)?e:Ii(e):void 0}class lr{constructor(){this.clicks=[]}isRageClick(e,t,i){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&i-r.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}}var so=["localhost","127.0.0.1"],Qe=s=>{var e=y?.createElement("a");return f(e)?null:(e.href=s,e)},Gt=function(s,e){for(var t,i=((s.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var n=i[r].split("=");if(n[0]===e){t=n;break}}if(!C(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{E.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Pi=function(s,e,t){if(!s||!e||!e.length)return s;for(var i=s.split("#"),n=i[1],o=(i[0]||"").split("?"),a=o[1],l=o[0],c=(a||"").split("&"),u=[],d=0;d<c.length;d++){var h=c[d].split("=");C(h)&&(e.includes(h[0])?u.push(h[0]+"="+t):u.push(c[d]))}var p=l;return null!=a&&(p+="?"+u.join("&")),null!=n&&(p+="#"+n),p},Wt=function(s,e){var t=s.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},cr=B("[AutoCapture]");function Ci(s,e){return e.length>s?e.slice(0,s)+"...":e}function no(s){if(s.previousElementSibling)return s.previousElementSibling;var e=s;do{e=e.previousSibling}while(e&&!Ut(e));return e}class lo{constructor(e){this.i=!1,this.o=null,this.rageclicks=new lr,this.h=!1,this.instance=e,this.m=null}get S(){var e,t,i=O(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(r=>new RegExp(r)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(r=>new RegExp(r)),i}$(){if(this.isBrowserSupported()){if(g&&y){var e=i=>{i=i||g?.event;try{this.k(i)}catch(r){cr.error("Failed to capture event",r)}};if(T(y,"submit",e,{capture:!0}),T(y,"change",e,{capture:!0}),T(y,"click",e,{capture:!0}),this.S.capture_copied_text){var t=i=>{this.k(i=i||g?.event,Pt)};T(y,"copy",t,{capture:!0}),T(y,"cut",t,{capture:!0})}}}else cr.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({[As]:!!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(r=>{var n=y?.querySelectorAll(r);n?.forEach(o=>{e===o&&i.push(r)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[As];if(Fe(this.o)&&!de(i)&&!this.instance.config.advanced_disable_decide)return!1;var n=null!==(t=this.o)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!n}k(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,r=er(e);Ks(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.k(e,"$rageclick");var n=t===Pt;if(r&&function Kn(s,e,t,i,r){var n,o,a;if(void 0===t&&(t=void 0),!g||!s||Re(s,"html")||!Ut(s)||null!=(n=t)&&n.url_allowlist&&!Qs(t.url_allowlist)||null!=(o=t)&&o.url_ignorelist&&Qs(t.url_ignorelist))return!1;if(null!=(a=t)&&a.dom_event_allowlist){var l=t.dom_event_allowlist;if(l&&!l.some(b=>e.type===b))return!1}for(var c=!1,u=[s],d=!0,h=s;h.parentNode&&!Re(h,"body");)if(Xs(h.parentNode))u.push(h.parentNode.host),h=h.parentNode.host;else{if(!(d=tr(h)))break;if(i||Ri.indexOf(d.tagName.toLowerCase())>-1)c=!0;else{var p=g.getComputedStyle(d);p&&"pointer"===p.getPropertyValue("cursor")&&(c=!0)}u.push(d),h=d}if(!function(b,w){var S=w?.element_allowlist;if(f(S))return!0;var k,R=function(J){if(S.some(j=>J.tagName.toLowerCase()===j))return{v:!0}};for(var D of b)if(k=R(D))return k.v;return!1}(u,t)||!function(b,w){var S=w?.css_selector_allowlist;if(f(S))return!0;var k,R=function(J){if(S.some(j=>J.matches(j)))return{v:!0}};for(var D of b)if(k=R(D))return k.v;return!1}(u,t))return!1;var _=g.getComputedStyle(s);if(_&&"pointer"===_.getPropertyValue("cursor")&&"click"===e.type)return!0;var v=s.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return c?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>
vendor: 6,709 bytes, line 3
3=0&&(Ri.indexOf(v)>-1||"true"===s.getAttribute("contenteditable"))}}(r,e,this.S,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function ao(s,e){for(var t,i,{e:r,maskAllElementAttributes:n,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,c=[s],u=s;u.parentNode&&!Re(u,"body");)Xs(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,h=[],p={},_=!1,v=!1;if(M(c,R=>{var D=Mi(R);"a"===R.tagName.toLowerCase()&&(_=R.getAttribute("href"),_=D&&_&&Xe(_)&&_),$(zt(R),"ph-no-capture")&&(v=!0),h.push(function oo(s,e,t,i){var r=s.tagName.toLowerCase(),n={tag_name:r};Ri.indexOf(r)>-1&&!t&&(n.$el_text="a"===r.toLowerCase()||"button"===r.toLowerCase()?Ci(1024,nr(s)):Ci(1024,Vt(s)));var o=zt(s);o.length>0&&(n.classes=o.filter(function(u){return""!==u})),M(s.attributes,function(u){var d;if((!ir(s)||-1!==["name","id","class","aria-label"].indexOf(u.name))&&(null==i||!i.includes(u.name))&&!e&&Xe(u.value)&&(!A(d=u.name)||"_ngcontent"!==d.substring(0,10)&&"_nghost"!==d.substring(0,7))){var h=u.value;"class"===u.name&&(h=Ii(h).join(" ")),n["attr__"+u.name]=Ci(1024,h)}});for(var a=1,l=1,c=s;c=no(c);)a++,c.tagName===s.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}(R,n,o,a));var J=function(j){if(!Mi(j))return{};var F={};return M(j.attributes,function(fe){if(fe.name&&0===fe.name.indexOf("data-ph-capture-attribute")){var ie=fe.name.replace("data-ph-capture-attribute-",""),ue=fe.value;ie&&ue&&Xe(ue)&&(F[ie]=ue)}}),F}(R);L(p,J)}),v)return{props:{},explicitNoCapture:v};if(o||(h[0].$el_text="a"===s.tagName.toLowerCase()||"button"===s.tagName.toLowerCase()?nr(s):Vt(s)),_){var b,w;h[0].attr__href=_;var S=null==(b=Qe(_))?void 0:b.host,k=null==g||null==(w=g.location)?void 0:w.host;S&&k&&S!==k&&(d=_)}return{props:L({$event_type:r.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:to(h)},null!=(t=h[0])&&t.$el_text?{$el_text:null==(i=h[0])?void 0:i.$el_text}:{},d&&"click"===r.type?{$external_click_url:d}:{},p)}}(r,{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(a)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(o.$element_selectors=l),t===Pt){var c,u=Zs(null==g||null==(c=g.getSelection())?void 0:c.toString()),d=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=d}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return re(y?.querySelectorAll)}}Math.trunc||(Math.trunc=function(s){return s<0?Math.ceil(s):Math.floor(s)}),Number.isInteger||(Number.isInteger=function(s){return U(s)&&isFinite(s)&&Math.floor(s)===s});var ur="0123456789abcdef";class Yt{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new Yt(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+ur.charAt(this.bytes[t]>>>4)+ur.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Yt(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}}class co{constructor(){this.I=0,this.P=0,this.R=new uo}generate(){var e=this.generateOrAbort();if(f(e)){this.I=0;var t=this.generateOrAbort();if(f(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.I)this.I=e,this.T();else{if(!(e+1e4>this.I))return;this.P++,this.P>4398046511103&&(this.I++,this.T())}return Yt.fromFieldsV7(this.I,Math.trunc(this.P/Math.pow(2,30)),this.P&Math.pow(2,30)-1,this.R.nextUint32())}T(){this.P=1024*this.R.nextUint32()+(1023&this.R.nextUint32())}}var hr,dr=s=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<s.length;e++)s[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return s};g&&!f(g.crypto)&&crypto.getRandomValues&&(dr=s=>crypto.getRandomValues(s));class uo{constructor(){this.M=new Uint32Array(8),this.C=1/0}nextUint32(){return this.C>=this.M.length&&(dr(this.M),this.C=0),this.M[this.C++]}}var Me=()=>ho().toString(),ho=()=>(hr||(hr=new co)).generate(),vt="",po=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Se={O:()=>!!y,F:function(s){E.error("cookieStore error: "+s)},A:function(s){if(y){try{for(var e=s+"=",t=y.cookie.split(";").filter(n=>n.length),i=0;i<t.length;i++){for(var r=t[i];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(e))return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},D:function(s){var e;try{e=JSON.parse(Se.A(s))||{}}catch{}return e},L:function(s,e,t,i,r){if(y)try{var n="",o="",a=function go(s,e){if(e){var t=function(r,n){if(void 0===n&&(n=y),vt)return vt;if(!n||["localhost","127.0.0.1"].includes(r))return"";for(var o=r.split("."),a=Math.min(o.length,8),l="dmn_chk_"+Me();!vt&&a--;){var c=o.slice(a).join("."),u=l+"=1;domain=."+c+";path=/";n.cookie=u+";max-age=3",n.cookie.includes(l)&&(n.cookie=u+";max-age=0",vt=c)}return vt}(s);if(!t){var i=(n=s.match(po))?n[0]:"";i!==t&&E.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}var n;return""}(y.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),n="; expires="+l.toUTCString()}r&&(o="; secure");var c=s+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+a+o;return c.length>3686.4&&E.warn("cookieStore warning: large cookie, len="+c.length),y.cookie=c,c}catch{return}},N:function(s,e){try{Se.L(s,"",-1,e)}catch{return}}},Ti=null,N={O:function(){if(!Fe(Ti))return Ti;var s=!0;if(f(g))s=!1;else try{var e="__mplssupport__";N.L(e,"xyz"),'"xyz"'!==N.A(e)&&(s=!1),N.N(e)}catch{s=!1}return s||E.error("localStorage unsupported; falling back to cookie store"),Ti=s,s},F:function(s){E.error("localStorage error: "+s)},A:function(s){try{return g?.localStorage.getItem(s)}catch(e){N.F(e)}return null},D:function(s){try{return JSON.parse(N.A(s))||{}}catch{}return null},L:function(s,e){try{g?.localStorage.setItem(s,JSON.stringify(e))}
3catch(t){N.F(t)}},N:function(s){try{g?.localStorage.removeItem(s)}catch(e){N.F(e)}}},vo=["distinct_id",Dt,pt,jt,Ht],Jt=m({},N,{D:function(s){try{var e={};try{e=Se.D(s)||{}}catch{}var t=L(e,JSON.parse(N.A(s)||"{}"));return N.L(s,t),t}catch{}return null},L:function(s,e,t,i,r,n){try{N.L(s,e,void 0,void 0,n);var o={};vo.forEach(a=>{e[a]&&(o[a]=e[a])}),Object.keys(o).length&&Se.L(s,o,t,i,r,n)}catch(a){N.F(a)}},N:function(s,e){try{g?.localStorage.removeItem(s),Se.N(s,e)}catch(t){N.F(t)}}}),Kt={},_o={O:function(){return!0},F:function(s){E.error("memoryStorage error: "+s)},A:function(s){return Kt[s]||null},D:function(s){return Kt[s]||null},L:function(s,e){Kt[s]=e},N:function(s){delete Kt[s]}},Be=null,H={O:function(){if(!Fe(Be))return Be;if(Be=!0,f(g))Be=!1;else try{var s="__support__";H.L(s,"xyz"),'"xyz"'!==H.A(s)&&(Be=!1),H.N(s)}catch{Be=!1}return Be},F:function(s){E.error("sessionStorage error: ",s)},A:function(s){try{return g?.sessionStorage.getItem(s)}catch(e){H.F(e)}return null},D:function(s){try{return JSON.parse(H.A(s))||null}catch{}return null},L:function(s,e){try{g?.sessionStorage.setItem(s,JSON.stringify(e))}catch(t){H.F(t)}},N:function(s){try{g?.sessionStorage.removeItem(s)}catch(e){H.F(e)}}},Ze=function(s){return s[s.PENDING=-1]="PENDING",s[s.DENIED=0]="DENIED",s[s.GRANTED=1]="GRANTED",s}({});class fo{constructor(e){this._instance=e}get S(){return this._instance.config}get consent(){return this.j()?Ze.DENIED:this.U}isOptedOut(){return this.consent===Ze.DENIED||this.consent===Ze.PENDING&&this.S.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.q.L(this.B,e?1:0,this.S.cookie_expiration,this.S.cross_subdomain_cookie,this.S.secure_cookie)}reset(){this.q.N(this.B,this.S.cross_subdomain_cookie)}get B(){var{token:e,opt_out_capturing_cookie_prefix:t}=this._instance.config;return(t||"__ph_opt_in_out_")+e}get U(){var e=this.q.A(this.B);return"1"===e?Ze.GRANTED:"0"===e?Ze.DENIED:Ze.PENDING}get q(){if(!this.H){var e=this.S.opt_out_capturing_persistence_type;this.H="localStorage"===e?N:Se;var t="localStorage"===e?Se:N;t.A(this.B)&&(this.H.A(this.B)||this.optInOut("1"===t.A(this.B)),t.N(this.B,this.S.cross_subdomain_cookie))}return this.H}j(){return!!this.S.respect_dnt&&!!Ts([ee?.doNotTrack,ee?.msDoNotTrack,x.doNotTrack],e=>$([!0,1,"1","yes"],e))}}var Xt=B("[Dead Clicks]"),mo=()=>!0,yo=s=>{var e,t=!(null==(e=s.instance.persistence)||!e.get_property(Ns)),i=s.instance.config.capture_dead_clicks;return de(i)?i:t};class pr{get lazyLoadedDeadClicksAutocapture(){return this.W}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Ns]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.G(()=>{this.J()})}G(e){var t,i;null!=(t=x.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=x.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",r=>{r?Xt.error("failed to load script",r):e()})}J(){var e;if(y){if(!this.W&&null!=(e=x.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=O(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.W=x.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.W.start(y),Xt.info("starting...")}}else Xt.error("`document` not found. Cannot start.")}stop(){this.W&&(this.W.stop(),this.W=void 0,Xt.info("stopping..."))}}function te(s,e,t,i,r){return e>t&&(E.warn("min cannot be greater than max."),e=t),U(s)?s>t?(i&&E.warn(i+" cannot be greater than max: "+t+". Using max value instead."),t):s<e?(i&&E.warn(i+" cannot be less than min: "+e+". Using min value instead."),e):s:(i&&E.warn(i+" must be a number. using max or fallback. max: "+t+", fallback: "+r),te(r||t,e,t,i))}class gr{constructor(e){this.V={},this.K=()=>{Object.keys(this.V).forEach(t=>{var i=this.Y(t)+this.X;i>=this.Z?delete this.V[t]:this.tt(t,i)})},this.Y=t=>this.V[String(t)],this.tt=(t,i)=>{this.V[String(t)]=i},this.consumeRateLimit=t=>{var i,r=null!==(i=this.Y(t))&&void 0!==i?i:this.Z;
3if(0===(r=Math.max(r-1,0)))return!0;this.tt(t,r);var n,o=0===r;return o&&(null==(n=this.it)||n.call(this,t)),o},this.et=e,this.it=this.et.it,this.Z=te(this.et.bucketSize,0,100,"rate limiter bucket size"),this.X=te(this.et.refillRate,0,this.Z,"rate limiter refill rate"),this.rt=te(this.et.refillInterval,0,864e5,"rate limiter refill interval"),setInterval(()=>{this.K()},this.rt)}}var Qt=B("[ExceptionAutocapture]");class bo{constructor(e){var t,i,r;this.st=()=>{var n;if(g&&this.isEnabled&&null!=(n=x.__PosthogExtensions__)&&n.errorWrappingFunctions){var o=x.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=x.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=x.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.nt&&this.S.capture_unhandled_errors&&(this.nt=o(this.captureException.bind(this))),!this.ot&&this.S.capture_unhandled_rejections&&(this.ot=a(this.captureException.bind(this))),!this.lt&&this.S.capture_console_errors&&(this.lt=l(this.captureException.bind(this)))}catch(c){Qt.error("failed to start",c),this.ut()}}},this._instance=e,this.ht=!(null==(t=this._instance.persistence)||!t.props[Ls]),this.S=this.dt(),this.vt=new gr({refillRate:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==i?i:1,bucketSize:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10,refillInterval:1e4}),this.startIfEnabled()}dt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return O(e)?t=m({},t,e):(f(e)?this.ht:e)&&(t=m({},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&&(Qt.info("enabled"),this.G(this.st))}G(e){var t,i;null!=(t=x.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=x.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return Qt.error("failed to load script",r);e()})}ut(){var e,t,i;null==(e=this.nt)||e.call(this),this.nt=void 0,null==(t=this.ot)||t.call(this),this.ot=void 0,null==(i=this.lt)||i.call(this),this.lt=void 0}onRemoteConfig(e){this.ht=!!e.autocaptureExceptions||!1,this.S=this.dt(),this._instance.persistence&&this._instance.persistence.register({[Ls]:this.ht}),this.startIfEnabled()}captureException(e){var t,i=this._instance.requestRouter.endpointFor("ui");e.$exception_personURL=i+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id();var r=null!==(t=e.$exception_list[0].type)&&void 0!==t?t:"Exception";this.vt.consumeRateLimit(r)?Qt.info("Skipping exception capture because of client rate limiting.",{exception:e.$exception_list[0].type}):this._instance.exceptions.sendExceptionEvent(e)}}function vr(s){return!f(Event)&&_r(s,Event)}function _r(s,e){try{return s instanceof e}catch{return!1}}function fr(s){switch(Object.prototype.toString.call(s)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return _r(s,Error)}}function Zt(s,e){return Object.prototype.toString.call(s)==="[object "+e+"]"}function Oi(s){return Zt(s,"DOMError")}var mr=/\(error: (.*)\)/;function Ai(s,e,t,i){var r={platform:"web:javascript",filename:s,function:"<anonymous>"===e?"?":e,in_app:!0};return f(t)||(r.lineno=t),f(i)||(r.colno=i),r}var wo=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Eo=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,So=/\((\S*)(?::(\d+))(?::(\d+))\)/,xo=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ko=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$o=function(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];var i=e.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return function(r,n){void 0===n&&(n=0);for(var o=[],a=r.split("\n"),l=n;l<a.length;l++){var c=a[l];if(!(c.length>1024)){var u=mr.test(c)?c.replace(mr,"$1"):c;if(!u.match(/\S*Error: /)){for(var d of i){var h=d(u);if(h){o.push(h);break}}if(o.length>=50)break}}}return function(p){if(!p.length)return[];var _=Array.from(p);return _.reverse(),_.slice(0,50).map(v=>m({},v,{filename:v.filename||Fo(_).filename,function:v.function||"?"}))}(o)}}([30,s=>{var e=wo.exec(s);if(e){var[,t,i,r]=e;return Ai(t,"?",+i,+r)}var n=Eo.exec(s);if(n){if(n[2]&&0===n[2].indexOf("eval")){var o=So.exec(n[2]);o&&(n[2]=o[1],n[3]=o[2],n[4]=o[3])}var[a,l]=wr(n[1]||"?",n[2]);return Ai(l,a,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,s=>{var e=xo.exec(s);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var t=ko.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}var i=e[3],r=e[1]||"?";return[r,i]=wr(r,i),Ai(i,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]);function Fo(s){return s[s.length-1]||{}}var ei,br,Li,wr=(s,e)=>{var t=-1!==s.indexOf("safari-extension"),i=-1!==s.indexOf("safari-web-extension");return t||i?[-1!==s.indexOf("@")?s.split("@")[0]:"?",t?"safari-extension:"+e:"safari-web-extension:"+e]:[s,e]},Io=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Di(s,e){void 0===e&&(e=0);var o,t=s.stacktrace||s.stack||"",i=(o=s)&&Ro.test(o.message)?1:0;try{var r=$o,n=function(o,a){var l=function(c){var u=globalThis._posthogChunkIds;if(!u)return{};var d=Object.keys(u);return Li&&d.length===br||(br=d.length,Li=d.reduce((h,p)=>{ei||(ei={});var _=ei[p];if(_)h[_[0]]=_[1];else for(var v=c(p),b=v.length-1;b>=0;b--){var w=v[b],S=w?.filename,k=u[p];if(S&&k){h[S]=k,ei[p]=[S,k];break}}return h},{})),Li}(a);return o.forEach(c=>{c.filename&&(c.chunk_id=l[c.filename])}),o}(r(t,i),r);return n.slice(0,n.length-e)}catch{}return[]}var Ro=/Minified React error #\d+;/i;function Er(s,e){var t=function Mo(s,e){var t,i,a,l,r=Di(s),n=null===(t=e?.handled)||void 0===t||t,o=null!==(i=e?.synthetic)&&void 0!==i&&i;return{type:null!=e&&e.overrideExceptionType?e.overrideExceptionType:s.name,value:(a=s,l=a.message,String(l.error&&"string"==typeof l.error.message?l.error.message:l)),stacktrace:{frames:r,type:"raw"},mechanism:{handled:n,synthetic:o}}}(s,e);return s.cause&&fr(s.cause)&&s.cause!==s?[t,...Er(s.cause,{handled:e?.handled,synthetic:e?.synthetic})]:[t]}function Ni(s,e){return{$exception_list:Er(s,e),$exception_level:"error"}}function qi(s,e){var t,i,r,n=null===(t=e?.handled)||void 0===t||t,o=null===(i=e?.synthetic)||void 0===i||i,a={type:null!=e&&e.overrideExceptionType?e.overrideExceptionType:null!==(r=e?.defaultExceptionType)&&void 0!==r?r:"Error",value:s||e?.defaultExceptionMessage,mechanism:{handled:n,synthetic:o}};if(null!=e&&e.syntheticException){var l=Di(e.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Po(s){return A(s)&&!vi(s)&&$s.indexOf(s)>=0}function Sr(s,e,t){try{if(!(e in s))return()=>{};var i=s[e],r=t(i);return re(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),s[e]=r,()=>{s[e]=i}}catch{return()=>{}}}class Oo{constructor(e){var t;this._instance=e,this.ct=(null==g||null==(t=g.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(E.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ft&&this.ft(),this.ft=void 0,E.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(g&&g.history){var i=this;null!=(e=g.history.pushState)&&e.__posthog_wrapped__||Sr(g.history,"pushState",r=>function(n,o,a){r.call(this,n,o,a),i._t("pushState")}),null!=(t=g.history.replaceState)&&t.__posthog_wrapped__||Sr(g.history,"replaceState",r=>function(n,o,a){r.call(this,n,o,a),i._t("replaceState")}),this.gt()}}_t(e){try{var t,i=null==g||null==(t=g.location)?void 0:t.pathname;if(!i)return;i!==this.ct&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ct=i}catch(r){E.error("Error capturing "+e+" pageview",r)}}
3gt(){if(!this.ft){var e=()=>{this._t("popstate")};T(g,"popstate",e),this.ft=()=>{g&&g.removeEventListener("popstate",e)}}}}function ti(s){var e,t;return(null==(e=JSON.stringify(s,(t=[],function(i,r){if(O(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r})))?void 0:e.length)||0}function Bi(s,e){if(void 0===e&&(e=6606028.8),s.size>=e&&s.data.length>1){var t=Math.floor(s.data.length/2),i=s.data.slice(0,t),r=s.data.slice(t);return[Bi({size:ti(i),data:i,sessionId:s.sessionId,windowId:s.windowId}),Bi({size:ti(r),data:r,sessionId:s.sessionId,windowId:s.windowId})].flatMap(n=>n)}return[s]}var xe=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(xe||{}),ce=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(ce||{}),Hi="[SessionRecording]",ji="redacted",ii={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:s=>s,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"]},Ao=["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"],Lo=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Do=["/s/","/e/","/i/"];function xr(s,e,t,i){if(I(s))return s;var r=e?.["content-length"]||new Blob([s]).size;return A(r)&&(r=parseInt(r)),r>t?Hi+" "+i+" body too large to record ("+r+" bytes)":s}function kr(s,e){if(I(s))return s;var t=s;return Xe(t,!1)||(t=Hi+" "+e+" body "+ji),M(Lo,i=>{var r,n;null!=(r=t)&&r.length&&-1!==(null==(n=t)?void 0:n.indexOf(i))&&(t=Hi+" "+e+" body "+ji+" as might contain: "+i)}),t}class qo{constructor(e,t){var i,r;void 0===t&&(t={}),this.bt={},this.yt=n=>{if(!this.bt[n]){var o,a;this.bt[n]=!0;var l=this.wt(n);null==(o=(a=this.et).onBlockedNode)||o.call(a,n,l)}},this.St=n=>{var o=this.wt(n);if("svg"!==o?.nodeName&&o instanceof Element){var a=o.closest("svg");if(a)return[this._rrweb.mirror.getId(a),a]}return[n,o]},this.wt=n=>this._rrweb.mirror.getNode(n),this.$t=n=>{var o,a,l,c,u,d,h,p;return(null!==(o=null==(a=n.removes)?void 0:a.length)&&void 0!==o?o:0)+(null!==(l=null==(c=n.attributes)?void 0:c.length)&&void 0!==l?l:0)+(null!==(u=null==(d=n.texts)?void 0:d.length)&&void 0!==u?u:0)+(null!==(h=null==(p=n.adds)?void 0:p.length)&&void 0!==h?h:0)},this.throttleMutations=n=>{if(3!==n.type||0!==n.data.source)return n;var o=n.data,a=this.$t(o);o.attributes&&(o.attributes=o.attributes.filter(c=>{var[u]=this.St(c.id);return!this.vt.consumeRateLimit(u)&&c}));var l=this.$t(o);return 0!==l||a===l?n:void 0},this._rrweb=e,this.et=t,this.vt=new gr({bucketSize:null!==(i=this.et.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.et.refillRate)&&void 0!==r?r:10,refillInterval:1e3,it:this.yt})}}var ne=Uint8Array,W=Uint16Array,tt=Uint32Array,Ui=new ne([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]),zi=new ne([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]),$r=new ne([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fr=function(s,e){for(var t=new W(31),i=0;i<31;++i)t[i]=e+=1<<s[i-1];var r=new tt(t[30]);for(i=1;i<30;++i)for(var n=t[i];n<t[i+1];++n)r[n]=n-t[i]<<5|i;return[t,r]},Ir=Fr(Ui,2),Vi=Ir[1];Ir[0][28]=258,Vi[258]=28;for(var Rr=Fr(zi,0)[1],Gi=new W(32768),P=0;P<32768;++P){var He=(43690&P)>>>1|(21845&P)<<1;He=(61680&(He=(52428&He)>>>2|(13107&He)<<2))>>>4|(3855&He)<<4,Gi[P]=((65280&He)>>>8|(255&He)<<8)>>>1}var _t=function(s,e,t){for(var i=s.length,r=0,n=new W(e);r<i;++r)++n[s[r]-1];var o,a=new W(e);for(r=0;r<e;++r)a[r]=a[r-1]+n[r-1]<<1;if(t){o=new W(1<<e);var l=15-e;for(r=0;r<i;++r)if(s[r])for(var c=r<<4|s[r],u=e-s[r],d=a[s[r]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)o[Gi[d]>>>l]=c}else for(o=new W(i),r=0;r<i;++r)o[r]=Gi[a[s[r]-1]++]>>>15-s[r];return o},je=new ne(288);for(P=0;P<144;++P)je[P]=8;for(P=144;P<256;++P)je[P]=9;for(P=256;P<280;++P)je[P]=7;for(P=280;P<288;++P)je[P]=8;var si=new ne(32);for(P=0;P<32;++P)si[P]=5;var Ho=_t(je,9,0),jo=_t(si,5,0),Mr=function(s){return(s/8|0)+(7&s&&1)},Pr=function(s,e,t){(null==t||t>s.length)&&(t=s.length);var i=new(s instanceof W?W:s instanceof tt?tt:ne)(t-e);return i.set(s.subarray(e,t)),i},ke=function(s,e,t){var i=e/8|0;s[i]|=t<<=7&e,s[i+1]|=t>>>8},ft=function(s,e,t){var i=e/8|0;s[i]|=t<<=7&e,s[i+1]|=t>>>8,s[i+2]|=t>>>16},Wi=function(s,e){for(var t=[],i=0;i<s.length;++i)s[i]&&t.push({s:i,f:s[i]});var r=t.length,n=t.slice();if(!r)return[new ne(0),0];if(1==r){var o=new ne(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(D,J){return D.f-J.f}),t.push({s:-1,f:25001});var a=t[0],l=t[1],c=0,u=1,d=2;for(t[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=t[t[c].f<t[d].f?c++:d++],l=t[c!=u&&t[c].f<t[d].f?c++:d++],t[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=n[0].s;for(i=1;i<r;++i)n[i].s>h&&(h=n[i].s);var p=new W(h+1),_=Yi(t[u-1],p,0);if(_>e){i=0;var v=0,b=_-e,w=1<<b;for(n.sort(function(D,J){return p[J.s]-p[D.s]||D.f-J.f});i<r;++i){var S=n[i].s;if(!(p[S]>e))break;v+=w-(1<<_-p[S]),p[S]=e}for(v>>>=b;v>0;){var k=n[i].s;p[k]<e?v-=1<<e-p[k]++-1:++i}for(;i>=0&&v;--i){var R=n[i].s;p[R]==e&&(--p[R],++v)}_=e}return[new ne(p),_]},Yi=function(s,e,t){return-1==s.s?Math.max(Yi(s.l,e,t+1),Yi(s.r,e,t+1)):e[s.s]=t},Cr=function(s){for(var e=s.length;e&&!s[--e];);for(var t=new W(++e),i=0,r=s[0],n=1,o=function(l){t[i++]=l},a=1;a<=e;++a)if(s[a]==r&&a!=e)++n;else{if(!r&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(r),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(r);n=1,r=s[a]}return[t.subarray(0,i),e]},mt=function(s,e){for(var t=0,i=0;i<e.length;++i)t+=s[i]*e[i];return t},Ji=function(s,e,t){var i=t.length,r=Mr(e+2);s[r]=255&i,s[r+1]=i>>>8,s[r+2]=255^s[r],s[r+3]=255^s[r+1];for(var n=0;n<i;++n)s[r+n+4]=t[n];return 8*(r+4+i)}
3,Tr=function(s,e,t,i,r,n,o,a,l,c,u){ke(e,u++,t),++r[256];for(var d=Wi(r,15),h=d[0],p=d[1],_=Wi(n,15),v=_[0],b=_[1],w=Cr(h),S=w[0],k=w[1],R=Cr(v),D=R[0],J=R[1],j=new W(19),F=0;F<S.length;++F)j[31&S[F]]++;for(F=0;F<D.length;++F)j[31&D[F]]++;for(var fe=Wi(j,7),ie=fe[0],ue=fe[1],ae=19;ae>4&&!ie[$r[ae-1]];--ae);var $e,me,ye,lt,Ae=c+5<<3,Ye=mt(r,je)+mt(n,si)+o,be=mt(r,h)+mt(n,v)+o+14+3*ae+mt(j,ie)+(2*j[16]+3*j[17]+7*j[18]);if(Ae<=Ye&&Ae<=be)return Ji(e,u,s.subarray(l,l+c));if(ke(e,u,1+(be<Ye)),u+=2,be<Ye){$e=_t(h,p,0),me=h,ye=_t(v,b,0),lt=v;var Le=_t(ie,ue,0);for(ke(e,u,k-257),ke(e,u+5,J-1),ke(e,u+10,ae-4),u+=14,F=0;F<ae;++F)ke(e,u+3*F,ie[$r[F]]);u+=3*ae;for(var ct=[S,D],K=0;K<2;++K){var le=ct[K];for(F=0;F<le.length;++F){var se=31&le[F];ke(e,u,Le[se]),u+=ie[se],se>15&&(ke(e,u,le[F]>>>5&127),u+=le[F]>>>12)}}}else $e=Ho,me=je,ye=jo,lt=si;for(F=0;F<a;++F)if(i[F]>255){ft(e,u,$e[257+(se=i[F]>>>18&31)]),u+=me[se+257],se>7&&(ke(e,u,i[F]>>>23&31),u+=Ui[se]);var ut=31&i[F];ft(e,u,ye[ut]),u+=lt[ut],ut>3&&(ft(e,u,i[F]>>>5&8191),u+=zi[ut])}else ft(e,u,$e[i[F]]),u+=me[i[F]];return ft(e,u,$e[256]),u+me[256]},Uo=new tt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),zo=function(){for(var s=new tt(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;s[e]=t}return s}(),Ki=function(s,e,t){for(;t;++e)s[e]=t,t>>>=8};function Or(s,e){void 0===e&&(e={});var t=function(){var s=4294967295;return{p:function(e){for(var t=s,i=0;i<e.length;++i)t=zo[255&t^e[i]]^t>>>8;s=t},d:function(){return 4294967295^s}}}(),i=s.length;t.p(s);var r=function(s,e,t){return function(n,o,a,l,c,u){var d=n.length,h=new ne(l+d+5*(1+Math.floor(d/7e3))+8),p=h.subarray(l,h.length-8),_=0;if(!o||d<8)for(var v=0;v<=d;v+=65535){var b=v+65535;b<d?_=Ji(p,_,n.subarray(v,b)):(p[v]=u,_=Ji(p,_,n.subarray(v,d)))}else{for(var w=Uo[o-1],S=w>>>13,k=8191&w,R=(1<<a)-1,D=new W(32768),J=new W(R+1),j=Math.ceil(a/3),F=2*j,fe=function(ms){return(n[ms]^n[ms+1]<<j^n[ms+2]<<F)&R},ie=new tt(25e3),ue=new W(288),ae=new W(32),$e=0,me=0,ye=(v=0,0),lt=0,Ae=0;v<d;++v){var Ye=fe(v),be=32767&v,Le=J[Ye];if(D[be]=Le,J[Ye]=be,lt<=v){var ct=d-v;if(($e>7e3||ye>24576)&&ct>423){_=Tr(n,p,0,ie,ue,ae,me,ye,Ae,v-Ae,_),ye=$e=me=0,Ae=v;for(var K=0;K<286;++K)ue[K]=0;for(K=0;K<30;++K)ae[K]=0}var le=2,se=0,ut=k,De=be-Le&32767;if(ct>2&&Ye==fe(v-De))for(var ll=Math.min(S,ct)-1,cl=Math.min(32767,v),ul=Math.min(258,ct);De<=cl&&--ut&&be!=Le;){if(n[v+le]==n[v+le-De]){for(var Ne=0;Ne<ul&&n[v+Ne]==n[v+Ne-De];++Ne);if(Ne>le){if(le=Ne,se=De,Ne>ll)break;var hl=Math.min(De,Ne-2),Dn=0;for(K=0;K<hl;++K){var fs=v-De+K+32768&32767,Nn=fs-D[fs]+32768&32767;Nn>Dn&&(Dn=Nn,Le=fs)}}}De+=(be=Le)-(Le=D[be])+32768&32767}if(se){ie[ye++]=268435456|Vi[le]<<18|Rr[se];var qn=31&Vi[le],Bn=31&Rr[se];me+=Ui[qn]+zi[Bn],++ue[257+qn],++ae[Bn],lt=v+le,++$e}else ie[ye++]=n[v],++ue[n[v]]}}_=Tr(n,p,u,ie,ue,ae,me,ye,Ae,v-Ae,_)}return Pr(h,0,l+Mr(_)+8)}(s,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+e.mem,t,0,!0)}(s,e,function(s){return 10+(s.filename&&s.filename.length+1||0)}(e)),n=r.length;return function(s,e){var t=e.filename;if(s[0]=31,s[1]=139,s[2]=8,s[8]=e.level<2?4:9==e.level?2:0,s[9]=3,0!=e.mtime&&Ki(s,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){s[3]=8;for(var i=0;i<=t.length;++i)s[i+10]=t.charCodeAt(i)}}(r,e),Ki(r,n-8,t.d()),Ki(r,n-4,i),r}function Ar(s,e){var t=s.length;if(typeof TextEncoder<"u")return(new TextEncoder).encode(s);for(var i=new ne(s.length+(s.length>>>1)),r=0,n=function(c){i[r++]=c},o=0;o<t;++o){if(r+5>i.length){var a=new ne(r+8+(t-o<<1));a.set(i),i=a}var l=s.charCodeAt(o);l<128||e?n(l):l<2048?(n(192|l>>>6),n(128|63&l)):l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&s.charCodeAt(++o))>>>18),n(128|l>>>12&63),n(128|l>>>6&63),n(128|63&l)):(n(224|l>>>12),n(128|l>>>6&63),n(128|63&l))}return Pr(i,0,r)}var Pe="disabled",Xi="sampled",ri="active",Ue="buffering",Qi="paused",Zi="trigger",pe=Zi+"_activated",z=Zi+"_pending",ge=Zi+"_"+Pe;function Lr(s,e){return e.some(t=>"regex"===t.matching&&new RegExp(t.url).test(s))}class Dr{constructor(e){this.kt=e}triggerStatus(e){var t=this.kt.map(i=>i.triggerStatus(e));return t.includes(pe)?pe:t.includes(z)?z:ge}
3stop(){this.kt.forEach(e=>e.stop())}}class Nr{constructor(e){this.kt=e}triggerStatus(e){var t=new Set;for(var i of this.kt)t.add(i.triggerStatus(e));switch(t.delete(ge),t.size){case 0:return ge;case 1:return Array.from(t)[0];default:return z}}stop(){this.kt.forEach(e=>e.stop())}}class Ko{triggerStatus(){return z}stop(){}}class Xo{constructor(e){this.xt=[],this.Et=[],this.urlBlocked=!1,this._instance=e}onRemoteConfig(e){var t,i;this.xt=(null==(t=e.sessionRecording)?void 0:t.urlTriggers)||[],this.Et=(null==(i=e.sessionRecording)?void 0:i.urlBlocklist)||[]}It(e){var t;return 0===this.xt.length?ge:(null==(t=this._instance)?void 0:t.get_property(bi))===e?pe:z}triggerStatus(e){var t=this.It(e),i=t===pe?pe:t===z?z:ge;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:i}),i}checkUrlTriggerConditions(e,t,i){if(void 0!==g&&g.location.href){var r=g.location.href,n=this.urlBlocked,o=Lr(r,this.Et);n&&o||(o&&!n?e():!o&&n&&t(),Lr(r,this.xt)&&i("url"))}}stop(){}}class Qo{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Pt=()=>{},this._instance=e}triggerStatus(){var e=z;return I(this.linkedFlag)&&(e=ge),this.linkedFlagSeen&&(e=pe),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,!I(this.linkedFlag)&&!this.linkedFlagSeen){var r=A(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=A(this.linkedFlag)?null:this.linkedFlag.variant;this.Pt=this._instance.onFeatureFlags((o,a)=>{var l=!1;if(O(a)&&r in a){var c=a[r];l=de(c)?!0===c:n?c===n:!!c}this.linkedFlagSeen=l,l&&t(r,n)})}}stop(){this.Pt()}}class Zo{constructor(e){this.Rt=[],this._instance=e}onRemoteConfig(e){var t;this.Rt=(null==(t=e.sessionRecording)?void 0:t.eventTriggers)||[]}Tt(e){var t;return 0===this.Rt.length?ge:(null==(t=this._instance)?void 0:t.get_property(wi))===e?pe:z}triggerStatus(e){var t=this.Tt(e),i=t===pe?pe:t===z?z:ge;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:i}),i}stop(){}}function ea(s){return s.isRecordingEnabled?Ue:Pe}function ta(s){if(!s.receivedDecide)return Ue;if(!s.isRecordingEnabled)return Pe;if(s.urlTriggerMatching.urlBlocked)return Qi;var e=!0===s.isSampled,t=new Dr([s.eventTriggerMatching,s.urlTriggerMatching,s.linkedFlagMatching]).triggerStatus(s.sessionId);return e?Xi:t===pe?ri:t===z?Ue:!1===s.isSampled?Pe:ri}function ia(s){if(!s.receivedDecide)return Ue;if(!s.isRecordingEnabled)return Pe;if(s.urlTriggerMatching.urlBlocked)return Qi;var e=new Nr([s.eventTriggerMatching,s.urlTriggerMatching,s.linkedFlagMatching]).triggerStatus(s.sessionId),t=e!==ge,i=de(s.isSampled);return t&&e===z?Ue:t&&e===ge||i&&!s.isSampled?Pe:!0===s.isSampled?Xi:ri}var yt="[SessionRecording]",V=B(yt);function ni(){var s;return null==x||null==(s=x.__PosthogExtensions__)||null==(s=s.rrweb)?void 0:s.record}var ra=[ce.MouseMove,ce.MouseInteraction,ce.Scroll,ce.ViewportResize,ce.Input,ce.TouchMove,ce.MediaInteraction,ce.Drag],qr=s=>({rrwebMethod:s,enqueuedAt:Date.now(),attempt:1});function ze(s){return function(e){for(var i="",r=0;r<e.length;){var n=e[r++];i+=String.fromCharCode(n)}return i}(Or(Ar(JSON.stringify(s))))}function Br(s){return s.type===xe.Custom&&"sessionIdle"===s.data.tag}class na{get sessionId(){return this.Mt}get Ct(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Ot}get Ft(){if(!this._instance.sessionManager)throw new Error(yt+" must be started with a valid sessionManager.");return this._instance.sessionManager}get At(){var e,t;return this.Dt.triggerStatus(this.sessionId)===z?6e4:null!==(e=null==(t=this._instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:3e5}get Lt(){var e=this._instance.get_property(pt);return de(e)?e:null}get Nt(){var e,t,i=null==(e=this.M)?void 0:e.data[(null==(t=this.M)?void 0:t.data.length)-1],{sessionStartTimestamp:r}=this.Ft.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-r:null}get jt(){var e=!!this._instance.get_property(yi);return g&&e&&!this._instance.config.disable_session_recording}get zt(){var e=!!this._instance.get_property(Bs);return this._instance.config.enable_recording_console_log??e}get Ut(){var e,t,i,r,n,o,a=this._instance.config.session_recording.captureCanvas,l=this._instance.get_property(Us),c=null!==(e=null!==(t=a?.recordCanvas)&&void 0!==t?t:l?.enabled)&&void 0!==e&&e,u=null!==(i=null!==(r=a?.canvasFps)&&void 0!==r?r:l?.fps)&&void 0!==i?i:4,d=null!==(n=null!==(o=a?.canvasQuality)&&void 0!==o?o:l?.quality)&&void 0!==n?n:.4;if("string"==typeof d){var h=parseFloat(d);d=isNaN(h)?.4:h}return{enabled:c,fps:te(u,0,12,"canvas recording fps",4),quality:te(d,0,1,"canvas recording quality",.4)}}get qt(){var e,t,i=this._instance.get_property(Hs),r_recordHeaders=null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,r_recordBody=null==(t=this._instance.config.session_recording)?void 0:t.recordBody,n=r_recordHeaders||i?.recordHeaders,o=r_recordBody||i?.recordBody,a=O(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,l=!!(de(a)?a:i?.capturePerformance);return n||o||l?{recordHeaders:n,recordBody:o,recordPerformance:l}:void 0}get Bt(){var e,t,i,r,n,o,a=this._instance.get_property(js),l_maskAllInputs=null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,l_maskTextSelector=null==(t=this._instance.config.session_recording)?void 0:t.maskTextSelector,l_blockSelector=null==(i=this._instance.config.session_recording)?void 0:i.blockSelector,c=null!==(r=l_maskAllInputs)&&void 0!==r?r:a?.maskAllInputs,u=null!==(n=l_maskTextSelector)&&void 0!==n?n:a?.maskTextSelector,d=null!==(o=l_blockSelector)&&void 0!==o?o:a?.blockSelector;return f(c)&&f(u)&&f(d)?void 0:{maskAllInputs:null==c||c,maskTextSelector:u,blockSelector:d}}get Ht(){var e=this._instance.get_property(zs);return U(e)?e:null}get Wt(){var e=this._instance.get_property(Vs);return U(e)?e:null}get status(){return this.Gt?this.Jt({receivedDecide:this.Gt,isRecordingEnabled:this.jt,isSampled:this.Lt,urlTriggerMatching:this.Vt,eventTriggerMatching:this.Kt,linkedFlagMatching:this.Yt,sessionId:this.sessionId}):Ue}constructor(e){if(this.Jt=ea,this.Gt=!1,this.Xt=[],this.Qt="unknown",this.Zt=Date.now(),this.Dt=new Ko,this.ti=void 0,this.ii=void 0,this.ei=void 0,this.ri=void 0,this.si=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.ni=()=>{this.oi()},this.ai=()=>{this.li("browser offline",{})},this.ui=()=>{this.li("browser online",{})},this.hi=()=>{null!=y&&y.visibilityState&&this.li("window "+y.visibilityState,{})},this._instance=e,this.Ot=!1,this.di="/s/",this.vi=void 0,this.Gt=!1,!this._instance.sessionManager)throw V.error("started without valid sessionManager"),new Error(yt+" started without valid sessionManager. This is a bug.");if(this._instance.config.__preview_experimental_cookieless_mode)throw new Error(yt+" cannot be used with __preview_experimental_cookieless_mode.");this.Yt=new Qo(this._instance),this.Vt=new Xo(this._instance),this.Kt=new Zo(this._instance);var{sessionId:t,windowId:i}=this.Ft.checkAndGetSessionAndWindowId();this.Mt=t,this.ci=i,this.M=this.fi(),this.Ct>=this.Ft.sessionTimeoutMs&&V.warn("session_idle_threshold_ms ("+this.Ct+") is greater than the session timeout ("+this.Ft.sessionTimeoutMs+"). Session will never be detected as i
3dle")}startIfEnabledOrStop(e){this.jt?(this.pi(e),T(g,"beforeunload",this.ni),T(g,"offline",this.ai),T(g,"online",this.ui),T(g,"visibilitychange",this.hi),this.gi(),this.mi(),I(this.ti)&&(this.ti=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){var i=null!=t&&t.properties.$current_url?this.bi(t?.properties.$current_url):"";if(!i)return;this.li("$pageview",{href:i})}}catch(r){V.error("Could not add $pageview to rrweb session",r)}})),this.ii||(this.ii=this.Ft.onSessionId((t,i,r)=>{var n,o;r&&(this.li("$session_id_change",{sessionId:t,windowId:i,changeReason:r}),null==(n=this._instance)||null==(n=n.persistence)||n.unregister(wi),null==(o=this._instance)||null==(o=o.persistence)||o.unregister(bi))}))):this.stopRecording()}stopRecording(){var e,t,i,r;this.Ot&&this.vi&&(this.vi(),this.vi=void 0,this.Ot=!1,g?.removeEventListener("beforeunload",this.ni),g?.removeEventListener("offline",this.ai),g?.removeEventListener("online",this.ui),g?.removeEventListener("visibilitychange",this.hi),this.fi(),clearInterval(this.yi),null==(e=this.ti)||e.call(this),this.ti=void 0,null==(t=this.si)||t.call(this),this.si=void 0,null==(i=this.ii)||i.call(this),this.ii=void 0,null==(r=this.ri)||r.call(this),this.ri=void 0,this.Kt.stop(),this.Vt.stop(),this.Yt.stop(),V.info("stopped"))}wi(){var e;null==(e=this._instance.persistence)||e.unregister(pt)}Si(e){var t,i=this.Mt!==e,r=this.Ht;if(U(r)){var n=this.Lt,o=i||!de(n),a=o?function Jo(s,e){return function(t){for(var i=0,r=0;r<t.length;r++)i=(i<<5)-i+t.charCodeAt(r),i|=0;return Math.abs(i)}(s)%100<te(100*e,0,100)}(e,r):n;o&&(a?this.$i(Xi):V.warn("Sample rate ("+r+") has determined that this sessionId ("+e+") will not be sent to the server."),this.li("samplingDecisionMade",{sampleRate:r,isSampled:a})),null==(t=this._instance.persistence)||t.register({[pt]:a})}else this.wi()}onRemoteConfig(e){var t,i,r,n;this.li("$remote_config_received",e),this.ki(e),null!=(t=e.sessionRecording)&&t.endpoint&&(this.di=null==(n=e.sessionRecording)?void 0:n.endpoint),this.gi(),"any"===(null==(i=e.sessionRecording)?void 0:i.triggerMatchType)?(this.Jt=ta,this.Dt=new Dr([this.Kt,this.Vt])):(this.Jt=ia,this.Dt=new Nr([this.Kt,this.Vt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==(r=e.sessionRecording)?void 0:r.triggerMatchType}),this.Vt.onRemoteConfig(e),this.Kt.onRemoteConfig(e),this.Yt.onRemoteConfig(e,(o,a)=>{this.$i("linked_flag_matched",{flag:o,variant:a})}),this.Gt=!0,this.startIfEnabledOrStop()}gi(){U(this.Ht)&&I(this.ri)&&(this.ri=this.Ft.onSessionId(e=>{this.Si(e)}))}ki(e){if(this._instance.persistence){var t,i=this._instance.persistence,r=()=>{var n,o,a,l,c,u,d,h,p,_=null==(n=e.sessionRecording)?void 0:n.sampleRate,v=I(_)?null:parseFloat(_);I(v)&&this.wi();var b=null==(o=e.sessionRecording)?void 0:o.minimumDurationMilliseconds;i.register({[yi]:!!e.sessionRecording,[Bs]:null==(a=e.sessionRecording)?void 0:a.consoleLogRecordingEnabled,[Hs]:m({capturePerformance:e.capturePerformance},null==(l=e.sessionRecording)?void 0:l.networkPayloadCapture),[js]:null==(c=e.sessionRecording)?void 0:c.masking,[Us]:{enabled:null==(u=e.sessionRecording)?void 0:u.recordCanvas,fps:null==(d=e.sessionRecording)?void 0:d.canvasFps,quality:null==(h=e.sessionRecording)?void 0:h.canvasQuality},[zs]:v,[Vs]:f(b)?null:b,[Gs]:null==(p=e.sessionRecording)?void 0:p.scriptConfig})};r(),null==(t=this.ei)||t.call(this),this.ei=this.Ft.onSessionId(r)}}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()})}pi(e){var t;f(Object.assign)||f(Array.from)||this.Ot||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut()||(this.Ot=!0,this.Ft.checkAndGetSessionAndWindowId(),ni()?this.xi():null==(t=x.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,this.Ei,i=>{if(i)return V.error("could not load recorder",i);this.xi()}),V.info("starting"),this.status===ri&&this.$i(e||"recording_initialized"))}get Ei(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property(Gs))?void 0:e.script)||"recorder"}Ii(e){var t;return 3===e.type&&-1!==ra.indexOf(null==(t=e.data)?void 0:t.source)}Pi(e){var t=this.Ii(e);t||this.Qt||e.timestamp-this.Zt>this.Ct&&(this.Qt=!0,clearInterval(this.yi),this.li("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.Zt,threshold:this.Ct,bufferLength:this.M.data.length,bufferSize:this.M.size}),this.oi());var i=!1;if(t&&(this.Zt=e.timestamp,this.Qt)){var r="unknown"===this.Qt;this.Qt=!1,r||(this.li("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)}if(!this.Qt){var{windowId:n,sessionId:o}=this.Ft.checkAndGetSessionAndWindowId(!t,e.timestamp),a=this.Mt!==o,l=this.ci!==n;this.ci=n,this.Mt=o,a||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):i&&this.Ri()}}Ti(e){try{return e.rrwebMethod(),!0}catch(t){return this.Xt.length<10?this.Xt.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):V.warn("could not emit queued rrweb event.",t,e),!1}}li(e,t){return this.Ti(qr(()=>ni().addCustomEvent(e,t)))}
3Mi(){return this.Ti(qr(()=>ni().takeFullSnapshot()))}xi(){var e,t,i,r,n={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},o=this._instance.config.session_recording;for(var[a,l]of Object.entries(o||{}))a in n&&("maskInputOptions"===a?n.maskInputOptions=m({password:!0},l):n[a]=l);this.Ut&&this.Ut.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.Ut.fps},n.dataURLOptions={type:"image/webp",quality:this.Ut.quality}),this.Bt&&(n.maskAllInputs=null===(t=this.Bt.maskAllInputs)||void 0===t||t,n.maskTextSelector=null!==(i=this.Bt.maskTextSelector)&&void 0!==i?i:void 0,n.blockSelector=null!==(r=this.Bt.blockSelector)&&void 0!==r?r:void 0);var c=ni();if(c){this.Ci=null!==(e=this.Ci)&&void 0!==e?e:new qo(c,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(d,h)=>{var p="Too many mutations on node '"+d+"'. Rate limiting. This could be due to SVG animations or something similar";V.info(p,{node:h}),this.log(yt+" "+p,"warn")}});var u=this.Oi();this.vi=c(m({emit:d=>{this.onRRwebEmit(d)},plugins:u},n)),this.Zt=Date.now(),this.Qt=de(this.Qt)?this.Qt:"unknown",this.li("$session_options",{sessionRecordingOptions:n,activePlugins:u.map(d=>d?.name)}),this.li("$posthog_config",{config:this._instance.config})}else V.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Ri(){if(this.yi&&clearInterval(this.yi),!0!==this.Qt){var e=this.At;e&&(this.yi=setInterval(()=>{this.Mi()},e))}}Oi(){var e,t,i=[],r=null==(e=x.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;
3r&&this.zt&&i.push(r());var n=null==(t=x.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin;return this.qt&&re(n)&&(!so.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(n(((s,e)=>{var i,r,n={payloadSizeLimitBytes:ii.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...ii.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...ii.payloadHostDenyList]},o=!1!==s.session_recording.recordHeaders&&e.recordHeaders,a=!1!==s.session_recording.recordBody&&e.recordBody,l=!1!==s.capture_performance&&e.recordPerformance,c=(r=Math.min(1e6,null!==(i=n.payloadSizeLimitBytes)&&void 0!==i?i:1e6),h=>(null!=h&&h.requestBody&&(h.requestBody=xr(h.requestBody,h.requestHeaders,r,"Request")),null!=h&&h.responseBody&&(h.responseBody=xr(h.responseBody,h.responseHeaders,r,"Response")),h)),u=h=>{return c(((v,b)=>{var w,S=Qe(v.name),k=0===b.indexOf("http")?null==(w=Qe(b))?void 0:w.pathname:b;"/"===k&&(k="");var R=S?.pathname.replace(k||"","");if(!(S&&R&&Do.some(D=>0===R.indexOf(D))))return v})((_=(p=h).requestHeaders,I(_)||M(Object.keys(_??{}),v=>{Ao.includes(v.toLowerCase())&&(_[v]=ji)}),p),s.api_host));var p,_},d=re(s.session_recording.maskNetworkRequestFn);return d&&re(s.session_recording.maskCapturedNetworkRequestFn)&&E.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(s.session_recording.maskCapturedNetworkRequestFn=h=>{var p=s.session_recording.maskNetworkRequestFn({url:h.name});return m({},h,{name:p?.url})}),n.maskRequestFn=re(s.session_recording.maskCapturedNetworkRequestFn)?h=>{var p,_=u(h);return _&&null!==(p=null==s.session_recording.maskCapturedNetworkRequestFn?void 0:s.session_recording.maskCapturedNetworkRequestFn(_))&&void 0!==p?p:void 0}:h=>function(p){if(!f(p))return p.requestBody=kr(p.requestBody,"Request"),p.responseBody=kr(p.responseBody,"Response"),p}(u(h)),m({},ii,n,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})})(this._instance.config,this.qt))):V.info("NetworkCapture not started because we are on localhost.")),i}onRRwebEmit(e){var t;if(this.Fi(),e&&O(e)){if(e.type===xe.Meta){var i=this.bi(e.data.href);if(this.Ai=i,!i)return;e.data.href=i}else this.Di();if(this.Vt.checkUrlTriggerConditions(()=>this.Li(),()=>this.Ni(),h=>this.ji(h)),!this.Vt.urlBlocked||(r=e).type===xe.Custom&&"recording paused"===r.data.tag){var r;e.type===xe.FullSnapshot&&this.Ri(),e.type===xe.FullSnapshot&&this.Gt&&this.Dt.triggerStatus(this.sessionId)===z&&this.fi();var n=this.Ci?this.Ci.throttleMutations(e):e;if(n){var o=function(h){var p=h;if(p&&O(p)&&6===p.type&&O(p.data)&&"rrweb/console@1"===p.data.plugin){p.data.payload.payload.length>10&&(p.data.payload.payload=p.data.payload.payload.slice(0,10),p.data.payload.payload.push("...[truncated]"));for(var _=[],v=0;v<p.data.payload.payload.length;v++)_.push(p.data.payload.payload[v]&&p.data.payload.payload[v].length>2e3?p.data.payload.payload[v].slice(0,2e3)+"...[truncated]":p.data.payload.payload[v]);return p.data.payload.payload=_,h}return h}(n);if(this.Pi(o),!0!==this.Qt||Br(o)){if(Br(o)){var a=o.data.payload;a&&(o.timestamp=a.lastActivityTimestamp+a.threshold)}var u=null===(t=this._instance.config.session_recording.compress_events)||void 0===t||t?function(h){if(ti(h)<1024)return h;try{if(h.type===xe.FullSnapshot)return m({},h,{data:ze(h.data),cv:"2024-10"});if(h.type===xe.IncrementalSnapshot&&h.data.source===ce.Mutation)return m({},h,{cv:"2024-10",data:m({},h.data,{texts:ze(h.data.texts),attributes:ze(h.data.attributes),removes:ze(h.data.removes),adds:ze(h.data.adds)})});if(h.type===xe.IncrementalSnapshot&&h.data.source===ce.StyleSheetRule)return m({},h,{cv:"2024-10",data:m({},h.data,{adds:h.data.adds?ze(h.data.adds):void 0,removes:h.data.removes?ze(h.data.removes):void 0})})}catch(p){V.error("could not compress event - will use uncompressed event",p)}return h}(o):o,d={$snapshot_bytes:ti(u),$snapshot_data:u,$session_id:this.Mt,$window_id:this.ci};this.status!==Pe?this.zi(d):this.fi()}}}}}Di(){if(!this._instance.config.capture_pageview&&g){var e=this.bi(g.location.href);this.Ai!==e&&(this.li("$url_changed",{href:e}),this.Ai=e)}}Fi(){if(this.Xt.length){var e=[...this.Xt];this.Xt=[],e.forEach(t=>{Date.now()-t.enqueuedAt<=2e3&&this.Ti(t)})}}bi(e){var t=this._instance.config.session_recording;
3if(t.maskNetworkRequestFn){var i,r={url:e};return null==(i=r=t.maskNetworkRequestFn(r))?void 0:i.url}return e}fi(){return this.M={size:0,data:[],sessionId:this.Mt,windowId:this.ci},this.M}oi(){this.Ui&&(clearTimeout(this.Ui),this.Ui=void 0);var e=this.Wt,t=this.Nt,i=U(t)&&t>=0,r=U(e)&&i&&t<e;return this.status===Ue||this.status===Qi||this.status===Pe||r?(this.Ui=setTimeout(()=>{this.oi()},2e3),this.M):(this.M.data.length>0&&Bi(this.M).forEach(n=>{this.qi({$snapshot_bytes:n.size,$snapshot_data:n.data,$session_id:n.sessionId,$window_id:n.windowId,$lib:"web",$lib_version:we.LIB_VERSION})}),this.fi())}zi(e){var t,i=2+((null==(t=this.M)?void 0:t.data.length)||0);!this.Qt&&(this.M.size+e.$snapshot_bytes+i>943718.4||this.M.sessionId!==this.Mt)&&(this.M=this.oi()),this.M.size+=e.$snapshot_bytes,this.M.data.push(e.$snapshot_data),this.Ui||this.Qt||(this.Ui=setTimeout(()=>{this.oi()},2e3))}qi(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.di),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}ji(e){var t;this.Dt.triggerStatus(this.sessionId)===z&&(null==(t=this._instance)||null==(t=t.persistence)||t.register({["url"===e?bi:wi]:this.Mt}),this.oi(),this.$i(e+"_trigger_matched"))}Li(){this.Vt.urlBlocked||(this.Vt.urlBlocked=!0,clearInterval(this.yi),V.info("recording paused due to URL blocker"),this.li("recording paused",{reason:"url blocker"}))}Ni(){this.Vt.urlBlocked&&(this.Vt.urlBlocked=!1,this.Mi(),this.Ri(),this.li("recording resumed",{reason:"left blocked url"}),V.info("recording resumed"))}mi(){0!==this.Kt.Rt.length&&I(this.si)&&(this.si=this._instance.on("eventCaptured",e=>{try{this.Kt.Rt.includes(e.event)&&this.ji("event")}catch(t){V.error("Could not activate event trigger",t)}}))}overrideLinkedFlag(){this.Yt.linkedFlagSeen=!0,this.Mi(),this.$i("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[pt]:!0}),this.Mi(),this.$i("sampling_overridden")}overrideTrigger(e){this.ji(e)}$i(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),V.info(e.replace("_"," "),t),$(["recording_initialized","session_id_changed"],e)||this.li(e,t)}get sdkDebugProperties(){var{sessionStartTimestamp:e}=this.Ft.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.M.data.length,$sdk_debug_replay_internal_buffer_size:this.M.size,$sdk_debug_current_session_duration:this.Nt,$sdk_debug_session_start:e}}}var es=B("[SegmentIntegration]"),Hr="posthog-js";function jr(s,e){var{organization:t,projectId:i,prefix:r,severityAllowList:n=["error"]}=void 0===e?{}:e;return o=>{var a,l,c,u,d;if("*"!==n&&!n.includes(o.level)||!s.__loaded)return o;o.tags||(o.tags={});var h=s.requestRouter.endpointFor("ui","/project/"+s.config.token+"/person/"+s.get_distinct_id());o.tags["PostHog Person URL"]=h,s.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=s.get_session_replay_url({withTimestamp:!0}));var p=(null==(a=o.exception)?void 0:a.values)||[],_=p.map(b=>m({},b,{stacktrace:b.stacktrace?m({},b.stacktrace,{type:"raw",frames:(b.stacktrace.frames||[]).map(w=>m({},w,{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null==(l=p[0])?void 0:l.value)||o.message,$exception_type:null==(c=p[0])?void 0:c.type,$exception_personURL:h,$exception_level:o.level,$exception_list:_,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(null==(u=p[0])?void 0:u.value)||o.message,$sentry_exception_type:null==(d=p[0])?void 0:d.type,$sentry_tags:o.tags};return t&&i&&(v.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+o.event_id),s.exceptions.sendExceptionEvent(v),o}}class aa{constructor(e,t,i,r,n){this.name=Hr,this.setupOnce=function(o){o(jr(e,{organization:t,projectId:i,prefix:r,severityAllowList:n}))}}}var la=null!=g&&g.location?Wt(g.location.hash,"__posthog")||Wt(location.hash,"state"):null,Ur="_postHogToolbarParams",zr=B("[Toolbar]"),Ce=function(s){return s[s.UNINITIALIZED=0]="UNINITIALIZED",s[s.LOADING=1]="LOADING",s[s.LOADED=2]="LOADED",s}(Ce||{});class ca{constructor(e){this.instance=e}Bi(e){x.ph_toolbar_state=e}Hi(){var e;return null!==(e=x.ph_toolbar_state)&&void 0!==e?e:Ce.UNINITIALIZED}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),!g||!y)return!1;e=e??g.location,i=i??g.history;try{if(!t){try{g.localStorage.setItem("test","test"),g.localStorage.removeItem("test")}catch{return!1}t=g?.localStorage}var r,n=la||Wt(e.hash,"__posthog")||Wt(e.hash,"state"),o=n?Cs(()=>JSON.parse(atob(decodeURIComponent(n))))||Cs(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(Ur)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Wi(e){var t=x.ph_load_toolbar||x.ph_load_editor;!I(t)&&re(t)?t(e,this.instance):zr.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==y||!y.getElementById(Ws));if(!g||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=m({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(g.localStorage.setItem(Ur,JSON.stringify(m({},r,{source:void 0}))),this.Hi()===Ce.LOADED)this.Wi(r);else if(this.Hi()===Ce.UNINITIALIZED){var n;this.Bi(Ce.LOADING),null==(n=x.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"toolbar",o=>{if(o)return zr.error("[Toolbar] Failed to load",o),void this.Bi(Ce.UNINITIALIZED);this.Bi(Ce.LOADED),this.Wi(r)}),T(g,"turbolinks:load",()=>{this.Bi(Ce.UNINITIALIZED),this.loadToolbar(r)})}return!0}Gi(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)}}var ua=B("[TracingHeaders]");class ha{constructor(e){this.Ji=void 0,this.Vi=void 0,this.st=()=>{var t,i;f(this.Ji)&&(null==(t=x.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.sessionManager)),f(this.Vi)&&(null==(i=x.__PosthogExtensions__)||null==(i=i.tracingHeadersPatchFns)||i._patchFetch(this._instance.sessionManager))},this._instance=e}G(e){var t,i;null!=(t=x.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=x.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return ua.error("failed to load script",r);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.G(this.st):(null==(e=this.Ji)||e.call(this),null==(t=this.Vi)||t.call(this),this.Ji=void 0,this.Vi=void 0)}}var Te=B("[Web Vitals]");class da{constructor(e){var t;this.Ki=!1,this.i=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Yi=()=>{clearTimeout(this.Xi),0!==this.M.metrics.length&&(this._instance.capture("$web_vitals",this.M.metrics.reduce((i,r)=>m({},i,{["$web_vitals_"+r.name+"_event"]:m({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Qi=i=>{var r,n=null==(r=this._instance.sessionManager)?void 0:r.checkAndGetSessionAndWindowId(!0);if(f(n))Te.error("Could not read session ID. Dropping metrics!");else{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this.Zi();f(o)||(I(i?.name)||I(i?.value)?Te.error("Invalid metric received",i):this.te&&i.value>=this.te?Te.error("Ignoring metric with value >= "+this.te,i):(this.M.url!==o&&(this.Yi(),this.Xi=setTimeout(this.Yi,this.flushToCaptureTimeoutMs)),f(this.M.url)&&(this.M.url=o),this.M.firstMetricTimestamp=f(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.M.metrics.push(m({},i,{$current_url:o,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),this.M.metrics.length===this.allowedMetrics.length&&this.Yi()))}},this.st=()=>{var i,r,n,o,a=x.__PosthogExtensions__;f(a)||f(a.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:r,onFCP:n,onINP:o}=a.postHogWebVitalsCallbacks),i&&r&&n&&o?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Qi.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Qi.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this.Qi.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this.Qi.bind(this)),this.i=!0):Te.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Ki=!(null==(t=this._instance.persistence)||!t.props[Ds]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=O(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return f(i)?(null==(t=this._instance.persistence)?void 0:t.props[qs])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(O(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get te(){var e=O(this._instance.config.capture_performance)&&U(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=Q?.protocol;if("http:"!==e&&"https:"!==e)return Te.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=O(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:de(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return de(t)?t:this.Ki}startIfEnabled(){this.isEnabled&&!this.i&&(Te.info("enabled, starting..."),this.G(this.st))}onRemoteConfig(e){var t=O(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=O(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ds]:t}),this._instance.persistence.register({[qs]:i})),this.Ki=t,this.startIfEnabled()}G(e){var t,i;null!=(t=x.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(i=x.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"web-vitals",r=>{r?Te.error("failed to load script",r):e()})}Zi(){var e=g?g.location.href:void 0;return e||Te.error("Could not determine current URL"),e}}var pa=B("[Heatmaps]");function Gr(s){return O(s)&&"clientX"in s&&"clientY"in s&&U(s.clientX)&&U(s.clientY)}class ga{constructor(e){var t;this.rageclicks=new lr,this.Ki=!1,this.i=!1,this.ie=null,this.instance=e,this.Ki=!(null==(t=this.instance.persistence)||!t.props[fi])}get flushIntervalMilliseconds(){var e=5e3;return O(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 f(this.instance.config.capture_heatmaps)?f(this.instance.config.enable_heatmaps)?this.Ki:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.i)return;pa.info("starting..."),this.ee(),this.ie=setInterval(this.re.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this.ie)&&void 0!==e?e:void 0),null==(t=this.se)||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[fi]:t}),this.Ki=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.M;return this.M=void 0,e}ne(e){this.oe(e.originalEvent,"deadclick")}ee(){g&&y&&(T(g,"beforeunload",this.re.bind(this)),T(y,"click",e=>this.oe(e||g?.event),{capture:!0}),T(y,"mousemove",e=>this.ae(e||g?.event),{capture:!0}),this.se=new pr(this.instance,mo,this.ne.bind(this)),this.se.startIfEnabled(),this.i=!0)}le(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(a,l,c){for(var u=a;u&&Ut(u)&&!Re(u,"body");){if(u===c)return!1;if($(l,g?.getComputedStyle(u).position))return!0;u=tr(u)}return!1}(er(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}oe(e,t){var i;if(void 0===t&&(t="click"),!Js(e.target)&&Gr(e)){var r=this.le(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.ue(m({},r,{type:"rageclick"})),this.ue(r)}}ae(e){!Js(e.target)&&Gr(e)&&(clearTimeout(this.he),this.he=setTimeout(()=>{this.ue(this.le(e,"mousemove"))},500))}ue(e){if(g){var t=g.location.href;this.M=this.M||{},this.M[t]||(this.M[t]=[]),this.M[t].push(e)}}re(){this.M&&!Je(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class va{constructor(e){this._instance=e}doPageView(e,t){var i,r=this.de(e,t);return this.ve={pathname:null!==(i=g?.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.de(e,null==(t=this.ve)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ve)?void 0:e.pageViewId}}de(e,t){var i=this.ve;if(!i)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:a,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:d}=n;
3if(!(f(o)||f(a)||f(l)||f(c)||f(u)||f(d))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d);var h=o<=1?1:te(a/o,0,1),p=o<=1?1:te(l/o,0,1),_=c<=1?1:te(u/c,0,1),v=c<=1?1:te(d/c,0,1);r=L(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:v})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var fa=!!pi||!!di,Wr="text/plain",oi=(s,e)=>{var[t,i]=s.split("?"),r=m({},e);i?.split("&").forEach(o=>{var[a]=o.split("=");delete r[a]});var n=function(s,e){var t,i;void 0===e&&(e="&");var r=[];return M(s,function(n,o){f(n)||f(o)||"undefined"===o||(t=encodeURIComponent(n instanceof File?n.name:n.toString()),i=encodeURIComponent(o),r[r.length]=i+"="+t)}),r.join(e)}(r);return t+"?"+(n?(i?i+"&":"")+n:i)},bt=(s,e)=>JSON.stringify(s,(t,i)=>"bigint"==typeof i?i.toString():i,e),ts=s=>{var l,{data:e,compression:t}=s;if(e){if(t===he.GZipJS){var i=Or(Ar(bt(e)),{mtime:0}),r=new Blob([i],{type:Wr});return{contentType:Wr,body:r,estimatedSize:r.size}}if(t===he.Base64){var n=function(l){var c,u,d,h,p,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",v=0,b=0,w="",S=[];if(!l)return l;l=function(s){var e,t,i,r,n="";for(e=t=0,i=(s=(s+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<i;r++){var o=s.charCodeAt(r),a=null;o<128?t++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Fe(a)||(t>e&&(n+=s.substring(e,t)),n+=a,e=t=r+1)}return t>e&&(n+=s.substring(e,s.length)),n}(l);do{c=(p=l.charCodeAt(v++)<<16|l.charCodeAt(v++)<<8|l.charCodeAt(v++))>>18&63,u=p>>12&63,d=p>>6&63,h=63&p,S[b++]=_.charAt(c)+_.charAt(u)+_.charAt(d)+_.charAt(h)}while(v<l.length);switch(w=S.join(""),l.length%3){case 1:w=w.slice(0,-2)+"==";break;case 2:w=w.slice(0,-1)+"="}return w}(bt(e)),o=(l=n,"data="+encodeURIComponent("string"==typeof l?l:bt(l)));return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=bt(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},wt=[];di&&wt.push({transport:"fetch",method:s=>{var e,t,{contentType:i,body:r,estimatedSize:n}=null!==(e=ts(s))&&void 0!==e?e:{},o=new Headers;M(s.headers,function(u,d){o.append(d,u)}),i&&o.append("Content-Type",i);var a=s.url,l=null;if(xs){var c=new xs;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),s.timeout)}}di(a,m({method:s?.method||"GET",headers:o,keepalive:"POST"===s.method&&(n||0)<52428.8,body:r,signal:null==(t=l)?void 0:t.signal},s.fetchOptions)).then(u=>u.text().then(d=>{var h={statusCode:u.status,text:d};if(200===u.status)try{h.json=JSON.parse(d)}catch(p){E.error(p)}null==s.callback||s.callback(h)})).catch(u=>{E.error(u),null==s.callback||s.callback({statusCode:0,text:u})}).finally(()=>l?clearTimeout(l.timeout):null)}}),pi&&wt.push({transport:"XHR",method:s=>{var e,t=new pi;t.open(s.method||"GET",s.url,!0);var{contentType:i,body:r}=null!==(e=ts(s))&&void 0!==e?e:{};M(s.headers,function(n,o){t.setRequestHeader(o,n)}),i&&t.setRequestHeader("Content-Type",i),s.timeout&&(t.timeout=s.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(4===t.readyState){var n={statusCode:t.status,text:t.responseText};if(200===t.status)try{n.json=JSON.parse(t.responseText)}catch{}null==s.callback||s.callback(n)}},t.send(r)}}),null!=ee&&ee.sendBeacon&&wt.push({transport:"sendBeacon",method:s=>{var e=oi(s.url,{beacon:"1"});try{var t,{contentType:i,body:r}=null!==(t=ts(s))&&void 0!==t?t:{},n="string"==typeof r?new Blob([r],{type:i}):r;ee.sendBeacon(e,n)}catch{}}});var it=function(s,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(s)}catch{return!1}};function Yr(s,e,t){return bt({distinct_id:s,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var ma={exact:(s,e)=>e.some(t=>s.some(i=>t===i)),is_not:(s,e)=>e.every(t=>s.every(i=>t!==i)),regex:(s,e)=>e.some(t=>s.some(i=>it(t,i))),not_regex:(s,e)=>e.every(t=>s.every(i=>!it(t,i))),icontains:(s,e)=>e.map(ai).some(t=>s.map(ai).some(i=>t.includes(i))),not_icontains:(s,e)=>e.map(ai).every(t=>s.map(ai).every(i=>!t.includes(i)))},ai=s=>s.toLowerCase(),ya=B("[Error tracking]");class ba{constructor(e){var t,i;this.ce=[],this._instance=e,this.ce=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(m
3i))&&void 0!==t?t:[]}onRemoteConfig(e){var t,i,r=null!==(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)&&void 0!==t?t:[];this.ce=r,this._instance.persistence&&this._instance.persistence.register({[mi]:this.ce})}sendExceptionEvent(e){this.fe(e)?ya.info("Skipping exception capture because a suppression rule matched"):this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}fe(e){var t=e.$exception_list;if(!t||!C(t)||0===t.length)return!1;var i=t.reduce((r,n)=>{var{type:o,value:a}=n;return A(o)&&o.length>0&&r.$exception_types.push(o),A(a)&&a.length>0&&r.$exception_values.push(a),r},{$exception_types:[],$exception_values:[]});return this.ce.some(r=>{var n=r.values.map(o=>{var a,l=ma[o.operator],c=C(o.value)?o.value:[o.value],u=null!==(a=i[o.key])&&void 0!==a?a:[];return c.length>0&&l(c,u)});return"OR"===r.type?n.some(Boolean):n.every(Boolean)})}}var oe="Mobile",li="iOS",ve="Android",Et="Tablet",Jr=ve+" "+Et,Qr="Apple Watch",St="Safari",st="BlackBerry",Zr="Samsung",en=Zr+"Browser",tn=Zr+" Internet",Ve="Chrome",wa=Ve+" OS",sn=Ve+" "+li,is="Internet Explorer",rn=is+" "+oe,ss="Opera",Ea=ss+" Mini",rs="Edge",nn="Microsoft "+rs,rt="Firefox",on=rt+" "+li,xt="Nintendo",kt="PlayStation",nt="Xbox",an=ve+" "+oe,ln=oe+" "+St,$t="Windows",ns=$t+" Phone",os="Ouya",un="Generic",Sa=un+" "+oe.toLowerCase(),hn=un+" "+Et.toLowerCase(),as="Konqueror",Y="(\\d+(\\.\\d+)?)",ls=new RegExp("Version/"+Y),xa=new RegExp(nt,"i"),ka=new RegExp(kt+" \\w+","i"),$a=new RegExp(xt+" \\w+","i"),cs=new RegExp(st+"|PlayBook|BB10","i"),Fa={"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"},dn=function(s,e){return e=e||"",$(s," OPR/")&&$(s,"Mini")?Ea:$(s," OPR/")?ss:cs.test(s)?st:$(s,"IE"+oe)||$(s,"WPDesktop")?rn:$(s,en)?tn:$(s,rs)||$(s,"Edg/")?nn:$(s,"FBIOS")?"Facebook "+oe:$(s,"UCWEB")||$(s,"UCBrowser")?"UC Browser":$(s,"CriOS")?sn:$(s,"CrMo")||$(s,Ve)?Ve:$(s,ve)&&$(s,St)?an:$(s,"FxiOS")?on:$(s.toLowerCase(),as.toLowerCase())?as:((s,e)=>{return e&&$(e,"Apple")||$(t=s,St)&&!$(t,Ve)&&!$(t,ve);var t})(s,e)?$(s,oe)?ln:St:$(s,rt)?rt:$(s,"MSIE")||$(s,"Trident/")?is:$(s,"Gecko")?rt:""},Ra={[rn]:[new RegExp("rv:"+Y)],[nn]:[new RegExp(rs+"?\\/"+Y)],[Ve]:[new RegExp("(Chrome|CrMo)\\/"+Y)],[sn]:[new RegExp("CriOS\\/"+Y)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Y)],[St]:[ls],[ln]:[ls],[ss]:[new RegExp("(Opera|OPR)\\/"+Y)],[rt]:[new RegExp(rt+"\\/"+Y)],[on]:[new RegExp("FxiOS\\/"+Y)],[as]:[new RegExp("Konqueror[:/]?"+Y,"i")],[st]:[new RegExp(st+" "+Y),ls],[an]:[new RegExp("android\\s"+Y,"i")],[tn]:[new RegExp(en+"\\/"+Y)],[is]:[new RegExp("(rv:|MSIE )"+Y)],Mozilla:[new RegExp("rv:"+Y)]},Ma=function(s,e){var t=dn(s,e),i=Ra[t];if(f(i))return null;for(var r=0;r<i.length;r++){var o=s.match(i[r]);if(o)return parseFloat(o[o.length-2])}return null},pn=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),s=>[nt,s&&s[1]||""]],[new RegExp(xt,"i"),[xt,""]],[new RegExp(kt,"i"),[kt,""]],[cs,[st,""]],[new RegExp($t,"i"),(s,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[ns,""];if(new RegExp(oe).test(e)&&!/IEMobile\b/.test(e))return[$t+" "+oe,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var r=Fa[t[1]]||"";return/arm/i.test(e)&&(r="RT"),[$t,r]}return[$t,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,s=>s&&s[3]?[li,[s[3],s[4],s[5]||"0"].join(".")]:[li,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,s=>{var e="";return s&&s.length>=3&&(e=f(s[2])?s[3]:s[2]),["watchOS",e]}],[new RegExp("("+ve+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ve+")","i"),s=>s&&s[2]?[ve,[s[2],s[3],s[4]||"0"].join(".")]:[ve,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,s=>{var e=["Mac OS X",""];return s&&s[1]&&(e[1]=[s[1],s[2],s[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[wa,""]],[/Linux|debian/i,["Linux",""]]],gn=function(s){return $a.test(s)?xt:ka.test(s)?kt:xa.test(s)?nt:new RegExp(os,"i").test(s)?os:new RegExp("("+ns+"|WPDesktop)","i").test(s)?ns:/iPad/.test(s)?"iPad":/iPod/.test(s)?"iPod Touch":/iPhone/.test(s)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(s)?Qr:cs.test(s)?st:/(kobo)\s(ereader|touch)/i.test(s)?"Kobo":new RegExp("Nokia","i").test(s)?"Nokia":/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(s)||/(kf[a-z]+)( bui|\)).+silk\//i.test(s)?"Kindle Fire":/(Android|ZTE)/i.test(s)?!new RegExp(oe).test(s)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(s)?/pixel[\daxl ]{1,6}/i.test(s)&&!/pixel c/i.test(s)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(s)||/lmy47v/i.test(s)&&!/QTAQZ3/i.test(s)?ve:Jr:ve:new RegExp("(pda|Mobile)","i").test(s)?Sa:new RegExp(Et,"i").test(s)&&!new RegExp(Et+" pc","i").test(s)?hn:""},ci="https?://(.*)",ui=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Pa=At(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ui),us="<masked>";function vn(s,e,t){if(!y)return{};var i=e?At([],ui,t||[]):[];return _n(Pi(y.URL,i,us),s)}function _n(s,e){var t=Pa.concat(e||[]),i={};return M(t,function(r){var n=Gt(s,r);i[r]=n||null}),i}function fn(s){var n,e=(n=s)?0===n.search(ci+"google.([^/?]*)")?"google":0===n.search(ci+"bing.com")?"bing":0===n.search(ci+"yahoo.com")?"yahoo":0===n.search(ci+"duckduckgo.com")?"duckduckgo":null:null,t="yaho
3o"!=e?"q":"p",i={};if(!Fe(e)){i.$search_engine=e;var r=y?Gt(y.referrer,t):"";r.length&&(i.ph_keyword=r)}return i}function mn(){return navigator.language||navigator.userLanguage}function yn(){return y?.referrer||"$direct"}function bn(s,e){var t=s?At([],ui,e||[]):[],i=Q?.href.substring(0,1e3);return{r:yn().substring(0,1e3),u:i?Pi(i,t,us):void 0}}function wn(s){var e,{r:t,u:i}=s,r={$referrer:t,$referring_domain:null==t?void 0:"$direct"==t?"$direct":null==(e=Qe(t))?void 0:e.host};if(i){r.$current_url=i;var n=Qe(i);r.$host=n?.host,r.$pathname=n?.pathname;var o=_n(i);L(r,o)}if(t){var a=fn(t);L(r,a)}return r}function En(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Ca(){try{return(new Date).getTimezoneOffset()}catch{return}}var _e=B("[FeatureFlags]"),hs="$active_feature_flags",ot="$override_feature_flags",Sn="$feature_flag_payloads",Ft="$override_feature_flag_payloads",xn="$feature_flag_request_id",kn=s=>{var e={};for(var[t,i]of Lt(s||{}))i&&(e[t]=i);return e},Aa=function(s){return s.FeatureFlags="feature_flags",s.Recordings="recordings",s}({});class La{constructor(e){this.pe=!1,this._e=!1,this.ge=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this._instance=e,this.featureFlagEventHandlers=[]}decide(){this._instance.config.__preview_remote_config?this.ye=!0:this.$e({disableFlags:!this.Se&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load)})}get hasLoadedFlags(){return this._e}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Ei),t=this._instance.get_property(ot),i=this._instance.get_property(Ft);if(!i&&!t)return e||{};var r=L({},e||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var o of n){var a,l,c=r[o],u=t?.[o],d=f(u)?null!==(a=c?.enabled)&&void 0!==a&&a:!!u,h=f(u)?c.variant:"string"==typeof u?u:void 0,p=i?.[o],_=m({},c,{enabled:d,variant:d?h??c?.variant:void 0});d!==c?.enabled&&(_.original_enabled=c?.enabled),h!==c?.variant&&(_.original_variant=c?.variant),p&&(_.metadata=m({},c?.metadata,{payload:p,original_payload:null==c||null==(l=c.metadata)?void 0:l.payload})),r[o]=_}return this.pe||(_e.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.pe=!0),r}getFlagVariants(){var e=this._instance.get_property(Ke),t=this._instance.get_property(ot);if(!t)return e||{};for(var i=L({},e),r=Object.keys(t),n=0;n<r.length;n++)i[r[n]]=t[r[n]];return this.pe||(_e.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.pe=!0),i}getFlagPayloads(){var e=this._instance.get_property(Sn),t=this._instance.get_property(Ft);if(!t)return e||{};for(var i=L({},e||{}),r=Object.keys(t),n=0;n<r.length;n++)i[r[n]]=t[r[n]];return this.pe||(_e.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.pe=!0),i}reloadFeatureFlags(){this.me||this._instance.config.advanced_disable_feature_flags||this.Se||(this.Se=setTimeout(()=>{this.$e()},5))}ke(){clearTimeout(this.Se),this.Se=void 0}ensureFlagsLoaded(){this._e||this.ge||this.Se||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.me=e}$e(e){var t;if(this.ke(),!this._instance.config.advanced_disable_decide)if(this.ge)this.be=!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:m({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(gt)||{}),group_properties:this._instance.get_property(qe)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0);var r=this._instance.config.__preview_flags_v2&&this._instance.config.__preview_remote_config,a=this._instance.requestRouter.endpointFor("api",(r?"/flags/?v=2":"/decide/?v=4")+(this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));r&&(i.timezone=En()),this.ge=!0,this._instance.xe({method:"POST",url:a,data:i,compression:this._instance.config.disable_compression?void 0:he.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,d=!0;if(200===l.statusCode&&(this.be||(this.$anon_distinct_id=void 0),d=!1),this.ge=!1,this.ye||(this.ye=!0,this._instance.Ee(null!==(u=l.json)&&void 0!==u?u:{})),!i.disable_flags||this.be)if(this.we=!d,l.json&&null!=(c=l.json.quotaLimited)&&c.includes(Aa.FeatureFlags))_e.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.");else{var h;i.disable_flags||this.receivedFeatureFlags(null!==(h=l.json)&&void 0!==h?h:{},d),this.be&&(this.be=!1,this.$e())}}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],r=""+i,n=this._instance.get_property(xn)||void 0,o=this._instance.get_property(Bt)||{};if((t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(r))){var a,l,c,u,d,h,p,_,v;C(o[e])?o[e].push(r):o[e]=[r],null==(a=this._instance.persistence)||a.register({[Bt]:o});var b=this.getFeatureFlagDetails(e),w={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:n,$feature_flag_bootstrapped_response:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlags)?void 0:l[e])||null,$feature_flag_bootstrapped_payload:(null==(c=this._instance.config.bootstrap)||null==(c=c.featureFlagPayloads)?void 0:c[e])||null,$used_bootstrap_value:!this.we};f(null==b||null==(u=b.metadata)?void 0:u.version)||(w.$feature_flag_version=b.metadata.version);var S,k=null!==(d=null==b||null==(h=b.reason)?void 0:h.description)&&void 0!==d?d:null==b||null==(p=b.reason)?void 0:p.code;k&&(w.$feature_flag_reason=k),null!=b&&null!=(_=b.metadata)&&_.id&&(w.$feature_flag_id=b.metadata.id),f(b?.original_variant)&&f(b?.original_enabled)||(w.$feature_flag_original_response=f(b.original_variant)?b.original_enabled:b.original_variant),null!=b&&null!=(v=b.metadata)&&v.original_payload&&(w.$feature_flag_original_payload=null==b||null==(S=b.metadata)?void 0:S.original_payload),this._instance.capture("$feature_flag_called",w)}return i}_e.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.xe({method:"POST",url:this._instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this._instance.get_distinct_id(),token:i}
3,compression:this._instance.config.disable_compression?void 0:he.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var n,o=null==(n=r.json)?void 0:n.featureFlagPayloads;t(o?.[e]||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);_e.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._e=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),n=this.getFlagsWithDetails();(function(o,a,l,c,u){void 0===l&&(l={}),void 0===c&&(c={}),void 0===u&&(u={});var d=(s=>{var e=s.flags;return e?(s.featureFlags=Object.fromEntries(Object.keys(e).map(t=>{var i;return[t,null!==(i=e[t].variant)&&void 0!==i?i:e[t].enabled]})),s.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(t=>e[t].enabled).filter(t=>{var i;return null==(i=e[t].metadata)?void 0:i.payload}).map(t=>{var i;return[t,null==(i=e[t].metadata)?void 0:i.payload]}))):_e.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),s})(o),h=d.flags,p=d.featureFlags,_=d.featureFlagPayloads;if(p){var v=o.requestId;if(C(p)){_e.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var b={};if(p)for(var w=0;w<p.length;w++)b[p[w]]=!0;a&&a.register({[hs]:p,[Ke]:b})}else{var S=p,k=_,R=h;o.errorsWhileComputingFlags&&(S=m({},l,S),k=m({},c,k),R=m({},u,R)),a&&a.register(m({[hs]:Object.keys(kn(S)),[Ke]:S||{},[Sn]:k||{},[Ei]:R||{}},v?{[xn]:v}:{}))}}})(e,this._instance.persistence,i,r,n),this.Ie(t)}}override(e,t){void 0===t&&(t=!1),_e.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return _e.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(ot),this._instance.persistence.unregister(Ft),void this.Ie();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,i=e;if(this.pe=!(null===(t=i.suppressWarning)||void 0===t||!t),"flags"in i)if(!1===i.flags)this._instance.persistence.unregister(ot);else if(i.flags)if(C(i.flags)){for(var r={},n=0;n<i.flags.length;n++)r[i.flags[n]]=!0;this._instance.persistence.register({[ot]:r})}else this._instance.persistence.register({[ot]:i.flags});return"payloads"in i&&(!1===i.payloads?this._instance.persistence.unregister(Ft):i.payloads&&this._instance.persistence.register({[Ft]:i.payloads})),void this.Ie()}this.Ie()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._e){var{flags:t,flagVariants:i}=this.Pe();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var i,r=(this._instance.get_property(Nt)||[]).find(l=>l.flagKey===e),n={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(o.$early_access_feature_name=r.name),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=m({},this.getFlagVariants(),{[e]:t});null==(i=this._instance.persistence)||i.register({[hs]:Object.keys(kn(a)),[Ke]:a}),this.Ie()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this._instance.get_property(Nt),n=i?"&"+i.map(o=>"stage="+o).join("&"):"";if(r&&!t)return e(r);this._instance.xe({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:o=>{var a;if(o.json){var l=o.json.earlyAccessFeatures;return null==(a=this._instance.persistence)||a.register({[Nt]:l}),e(l)}}})}Pe(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(i=>t[i]),flagVariants:Object.keys(t).filter(i=>t[i]).reduce((i,r)=>(i[r]=t[r],i),{})}}Ie(e){var{flags:t,flagVariants:i}=this.Pe();
vendor: 5,301 bytes, line 3
3this.featureFlagEventHandlers.forEach(r=>r(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(gt)||{};this._instance.register({[gt]:m({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(gt)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(qe)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(r=>{i[r]=m({},i[r],e[r]),delete e[r]}),this._instance.register({[qe]:m({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(qe)||{};this._instance.register({[qe]:m({},t,{[e]:{}})})}else this._instance.unregister(qe)}}var Da=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class ds{constructor(e){var t,i;this.S=e,this.props={},this.Re=!1,this.Te=(i="",(t=e).token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"),this.q=this.Me(e),this.load(),e.debug&&E.info("Persistence loaded",e.persistence,m({},this.props)),this.update_config(e,e),this.save()}Me(e){-1===Da.indexOf(e.persistence.toLowerCase())&&(E.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&N.O()?N:"localstorage+cookie"===t&&Jt.O()?Jt:"sessionstorage"===t&&H.O()?H:"memory"===t?_o:"cookie"===t?Se:Jt.O()?Jt:Se}properties(){var e={};return M(this.props,function(t,i){if(i===Ke&&O(t))for(var r=Object.keys(t),n=0;n<r.length;n++)e["$feature/"+r[n]]=t[r[n]];else a=i,l=!1,(Fe(o=Jn)?l:Ss&&o.indexOf===Ss?-1!=o.indexOf(a):(M(o,function(c){if(l||(l=c===a))return Ot}),l))||(e[i]=t);var o,a,l}),e}load(){if(!this.Ce){var e=this.q.D(this.Te);e&&(this.props=L({},e))}}save(){this.Ce||this.q.L(this.Te,this.props,this.Oe,this.Fe,this.Ae,this.S.debug)}remove(){this.q.N(this.Te,!1),this.q.N(this.Te,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(O(e)){f(t)&&(t="None"),this.Oe=f(i)?this.De:i;var r=!1;if(M(e,(n,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==t||(this.props[o]=n,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(O(e)){this.Oe=f(t)?this.De:t;var i=!1;if(M(e,(r,n)=>{e.hasOwnProperty(n)&&this.props[n]!==r&&(this.props[n]=r,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.Re){var e=vn(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);Je(_i(e))||this.register(e),this.Re=!0}}update_search_keyword(){var e;this.register((e=y?.referrer)?fn(e):{})}update_referrer_info(){var e;this.register_once({$referrer:yn(),$referring_domain:null!=y&&y.referrer&&(null==(e=Qe(y.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[$i]||this.props[Fi]||this.register_once({[Ht]:bn(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};M([Fi,$i],o=>{var a=this.props[o];a&&M(a,function(l,c){e["$initial_"+gi(c)]=l})});var t,i,r=this.props[Ht];if(r){var n=(t=wn(r),i={},M(t,function(o,a){i["$initial_"+gi(a)]=o}),i);L(e,n)}return e}safe_merge(e){return M(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t){if(this.De=this.Oe=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this.Me(e),r=this.props;this.clear(),this.q=i,this.props=r,this.save()}}set_disabled(e){this.Ce=e,this.Ce?this.remove():this.save()}set_cross_subdomain(e){e!==this.Fe&&(this.Fe=e,this.remove(),this.save())}set_secure(e){e!==this.Ae&&(this.Ae=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[dt]||{};i[e]=t,this.props[dt]=i,this.save()}remove_event_timer(e){var t=(this.props[dt]||{})[e];return f(t)||(delete this.props[dt][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class $n{constructor(){this.Le={},this.Le={}}on(e,t){return this.Le[e]||(this.Le[e]=[]),this.Le[e].push(t),()=>{this.Le[e]=this.Le[e].filter(i=>i!==t)}}emit(e,t){for(var i of this.Le[e]||[])i(t);for(var r of this.Le["*"]||[])r(e,t)}}class Ge{constructor(e){this.Ne=new $n,this.je=(t,i)=>this.ze(t,i)&&this.Ue(t,i)&&this.qe(t,i),this.ze=(t,i)=>null==i||!i.event||t?.event===i?.event,this._instance=e,this.Be=new Set,this.He=new Set}init(){var e,t;f(null==(e=this._instance)?void 0:e.We)||null==(t=this._instance)||t.We((i,r)=>{this.on(i,r)})}register(e){var t,i;if(!f(null==(t=this._instance)?void 0:t.We)&&(e.forEach(o=>{var a,l;null==(a=this.He)||a.add(o),null==(l=o.steps)||l.forEach(c=>{var u;null==(u=this.Be)||u.add(c?.event||"")})}),null!=(i=this._instance)&&i.autocapture)){var r,n=new Set;e.forEach(o=>{var a;null==(a=o.steps)||a.forEach(l=>{null!=l&&l.selector&&n.add(l?.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(n)}}on(e,t){var i;null!=t&&0!=e.length&&(this.Be.has(e)||this.Be.has(t?.event))&&this.He&&(null==(i=this.He)?void 0:i.size)>0&&this.He.forEach(r=>{this.Ge(t,r)&&this.Ne.emit("actionCaptured",r.name)}
3)}Je(e){this.onAction("actionCaptured",t=>e(t))}Ge(e,t){if(null==t?.steps)return!1;for(var i of t.steps)if(this.je(e,i))return!0;return!1}onAction(e,t){return this.Ne.on(e,t)}Ue(e,t){if(null!=t&&t.url){var i,r=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r||!Ge.Ve(r,t?.url,t?.url_matching||"contains"))return!1}return!0}static Ve(e,t,i){switch(i){case"regex":return!!g&&it(e,t);case"exact":return t===e;case"contains":var r=Ge.Ke(t).replace(/_/g,".").replace(/%/g,".*");return it(e,r);default:return!1}}static Ke(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}qe(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.Ye(e).some(n=>!(null!=t&&t.href&&!Ge.Ve(n.href||"",t?.href,t?.href_matching||"exact")||null!=t&&t.tag_name&&n.tag_name!==t?.tag_name||null!=t&&t.text&&!Ge.Ve(n.text||"",t?.text,t?.text_matching||"exact")&&!Ge.Ve(n.$el_text||"",t?.text,t?.text_matching||"exact"))))return!1;if(null!=t&&t.selector){var i,r=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(!r||!r.includes(t?.selector))return!1}return!0}Ye(e){return null==e?.properties.$elements?[]:e?.properties.$elements}}var q=B("[Surveys]"),ps="seenSurvey_",Na=(s,e)=>{var t="$survey_"+e+"/"+s.id;return s.current_iteration&&s.current_iteration>0&&(t="$survey_"+e+"/"+s.id+"/"+s.current_iteration),t};class qa{constructor(e){this._instance=e,this.Xe=new Map,this.Qe=new Map}register(e){var t;f(null==(t=this._instance)?void 0:t.We)||(this.Ze(e),this.tr(e))}tr(e){var t=e.filter(i=>{var r,n;return(null==(r=i.conditions)?void 0:r.actions)&&(null==(n=i.conditions)||null==(n=n.actions)||null==(n=n.values)?void 0:n.length)>0});0!==t.length&&(null==this.ir&&(this.ir=new Ge(this._instance),this.ir.init(),this.ir.Je(i=>{this.onAction(i)})),t.forEach(i=>{var r,n,o,a,l;i.conditions&&null!=(r=i.conditions)&&r.actions&&null!=(n=i.conditions)&&null!=(n=n.actions)&&n.values&&(null==(o=i.conditions)||null==(o=o.actions)||null==(o=o.values)?void 0:o.length)>0&&(null==(a=this.ir)||a.register(i.conditions.actions.values),null==(l=i.conditions)||null==(l=l.actions)||null==(l=l.values)||l.forEach(c=>{if(c&&c.name){var u=this.Qe.get(c.name);u&&u.push(i.id),this.Qe.set(c.name,u||[i.id])}}))}))}Ze(e){var t;0!==e.filter(i=>{var r,n;return(null==(r=i.conditions)?void 0:r.events)&&(null==(n=i.conditions)||null==(n=n.events)||null==(n=n.values)?void 0:n.length)>0}).length&&(null==(t=this._instance)||t.We((i,r)=>{this.onEvent(i,r)}),e.forEach(i=>{var r;null==(r=i.conditions)||null==(r=r.events)||null==(r=r.values)||r.forEach(n=>{if(n&&n.name){var o=this.Xe.get(n.name);o&&o.push(i.id),this.Xe.set(n.name,o||[i.id])}})}))}onEvent(e,t){var i,r=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[qt])||[];if("survey shown"===e&&t&&r.length>0){var n;q.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:r});var o=null==t||null==(n=t.properties)?void 0:n.$survey_id;if(o){var a=r.indexOf(o);a>=0&&(r.splice(a,1),this.er(r))}}else this.Xe.has(e)&&(q.info("survey event matched, updating activated surveys",{event:e,surveys:this.Xe.get(e)}),this.er(r.concat(this.Xe.get(e)||[])))}onAction(e){var t,i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[qt])||[];this.Qe.has(e)&&this.er(i.concat(this.Qe.get(e)||[]))}er(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[qt]:[...new Set(e)]})}getSurveys(){var e;return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[qt])||[]}getEventToSurveys(){return this.Xe}rr(){return this.ir}}class Ba{constructor(e){this.sr=null,this.nr=!1,this.ar=!1,this.lr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t=e.surveys;if(I(t))return q.warn("Decide not loaded yet. Not loading surveys.");var i=C(t);this.ur=i?t.length>0:t,q.info("decide response received, hasSurveys: "+this.ur),this.ur&&this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(ps)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(r=>localStorage.removeItem(r))}loadIfEnabled(){if(!this.sr)if(this.ar)q.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)q.info("Disabled. Not loading surveys.");else if(this.ur){var e=x?.__PosthogExtensions__;if(e){this.ar=!0;try{var t=e.generateSurveys;if(t)return void this.hr(t);var i=e.loadExternalDependency;if(!i)return void this.dr("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",r=>{r||!e.generateSurveys?this.dr("Could not load surveys script",r):this.hr(e.generateSurveys)})}catch(r){throw this.dr("Error initializing surveys",r),r}finally{this.ar=!1}}else q.error("PostHog Extensions not found.")}else q.info("No surveys to load.")}hr(e){this.sr=e(this._instance),this._surveyEventReceiver=new qa(this._instance),q.info("Surveys loaded successfully"),this.vr({isLoaded:!0})}dr(e,t){q.error(e,t),this.vr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.lr.push(e),this.sr&&this.vr({isLoaded:!0}),()=>{this.lr=this.lr.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return q.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(Si);if(i&&!t)return e(i,{isLoaded:!0});if(this.nr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.nr=!0,this._instance.xe({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var n;this.nr=!1;var o=r.statusCode;if(200!==o||!r.json){var a="Surveys API could not be loaded, status: "+o;return q.error(a),e([],{isLoaded:!1,error:a})}var l,c=r.json.surveys||[],u=c.filter(d=>{return!(!(h=d).start_date||h.end_date)&&(function(h){var p;return!(null==(p=h.conditions)||null==(p=p.events)||null==(p=p.values)||!p.length)}(d)||function(h){var p;return!(null==(p=h.conditions)||null==(p=p.actions)||null==(p=p.values)||!p.length)}(d));var h});return u.length>0&&(null==(l=this._surveyEventReceiver)||l.register(u)),null==(n=this._instance.persistence)||n.register({[Si]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.nr=!1,r}}
vendor: 6,861 bytes, line 3
3vr(e){for(var t of this.lr)try{e.isLoaded?this.getSurveys(t):t([],e)}catch(i){q.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!I(this.sr))return this.sr.getActiveMatchingSurveys(e,t);q.warn("init was not called")}cr(e){var t=null;return this.getSurveys(i=>{var r;t=null!==(r=i.find(n=>n.id===e))&&void 0!==r?r:null}),t}pr(e){if(I(this.sr))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.cr(e):e;return t?this.sr.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(I(this.sr))return q.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.pr(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return I(this.sr)?(q.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(r=>{var n,o=null!==(n=r.find(l=>l.id===e))&&void 0!==n?n:null;if(o){var a=this.pr(o);i({visible:a.eligible,disabledReason:a.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){if(I(this.sr))q.warn("init was not called");else{var i=this.cr(e),r=y?.querySelector(t);i?r?this.sr.renderSurvey(i,r):q.warn("Survey element not found"):q.warn("Survey not found")}}}var Ha=function(s){return s.Button="button",s.Tab="tab",s.Selector="selector",s}({}),ja=function(s){return s.TopLeft="top_left",s.TopRight="top_right",s.TopCenter="top_center",s.MiddleLeft="middle_left",s.MiddleRight="middle_right",s.MiddleCenter="middle_center",s.Left="left",s.Center="center",s.Right="right",s.NextToTrigger="next_to_trigger",s}({}),Ua=function(s){return s.Popover="popover",s.API="api",s.Widget="widget",s}({}),za=function(s){return s.Open="open",s.MultipleChoice="multiple_choice",s.SingleChoice="single_choice",s.Rating="rating",s.Link="link",s}({}),Va=function(s){return s.NextQuestion="next_question",s.End="end",s.ResponseBased="response_based",s.SpecificQuestion="specific_question",s}({}),Ga=function(s){return s.Once="once",s.Recurring="recurring",s.Always="always",s}({}),hi=function(s){return s.SHOWN="survey shown",s.DISMISSED="survey dismissed",s.SENT="survey sent",s}({}),gs=function(s){return s.SURVEY_ID="$survey_id",s.SURVEY_NAME="$survey_name",s.SURVEY_RESPONSE="$survey_response",s.SURVEY_ITERATION="$survey_iteration",s.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",s.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",s.SURVEY_SUBMISSION_ID="$survey_submission_id",s.SURVEY_QUESTIONS="$survey_questions",s.SURVEY_COMPLETED="$survey_completed",s}({}),Fn=B("[RateLimiter]");class Wa{constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var n=r.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(o=>{Fn.info((o||"events")+" is quota limited."),this.serverLimits[o]=(new Date).getTime()+6e4})}catch(o){return void Fn.warn('could not rate limit - continuing. Error: "'+o?.message+'"',{text:n})}},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}clientRateLimitContext(e){var t,i,r;void 0===e&&(e=!1);var n=(new Date).getTime(),o=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(ki))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:n};o.tokens+=(n-o.last)/1e3*this.captureEventsPerSecond,o.last=n,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var a=o.tokens<1;return a||e||(o.tokens=Math.max(0,o.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==(r=this.instance.persistence)||r.set_property(ki,o),{isRateLimited:a,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var We=B("[RemoteConfig]");class Ya{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=x._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}_r(e){var t,i;null!=(t=x.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=x.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(We.error("PostHog Extensions not found. Cannot load remote config."),e())}gr(e){this._instance.xe({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 We.info("Using preloaded remote config",this.remoteConfig),void this.Ee(this.remoteConfig);if(this._instance.config.advanced_disable_decide)return void We.warn("Remote config is disabled. Falling back to local config.");this._r(e=>{if(!e)return We.info("No config found after loading remote JS config. Falling back to JSON."),void this.gr(t=>{this.Ee(t)});this.Ee(e)})}catch(e){We.error("Error loading remote config",e)}}Ee(e){e?this._instance.config.__preview_remote_config?(this._instance.Ee(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):We.info("__preview_remote_config is disabled. Logging config instead",e):We.error("Failed to fetch remote config from PostHog.")}}class Ja{constructor(e,t){this.mr=!0,this.br=[],this.yr=te(t?.flush_interval_ms||3e3,250,5e3,"flush interval",3e3),this.wr=e}enqueue(e){this.br.push(e),this.Sr||this.$r()}unload(){this.kr();var e=this.br.length>0?this.Er():{},t=Object.values(e);[...t.filter(i=>0===i.url.indexOf("/e")),...t.filter(i=>0!==i.url.indexOf("/e"))].map(i=>{this.wr(m({},i,{transport:"sendBeacon"}))})}enable(){this.mr=!1,this.$r()}$r(){var e=this;this.mr||(this.Sr=setTimeout(()=>{if(this.kr(),this.br.length>0){var t=this.Er(),i=function(){var n=t[r],o=(new Date).getTime();n.data&&C(n.data)&&M(n.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),e.wr(n)};for(var r in t)i()}},this.yr))}kr(){clearTimeout(this.Sr),this.Sr=void 0}Er(){var e={};return M(this.br,t=>{var i,r=t,n=(r?r.batchKey:null)||r.url;f(e[n])&&(e[n]=m({},r,{data:[]})),null==(i=e[n].data)||i.push(r.data)}),this.br=[],e}}var Ka=["retriesPerformedSoFar"];class Xa{constructor(e){this.Ir=!1,this.Pr=3e3,this.br=[],this._instance=e,this.br=[],this.Rr=!0,!f
3(g)&&"onLine"in g.navigator&&(this.Rr=g.navigator.onLine,T(g,"online",()=>{this.Rr=!0,this.re()}),T(g,"offline",()=>{this.Rr=!1}))}get length(){return this.br.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=Ps(e,Ka);U(t)&&t>0&&(i.url=oi(i.url,{retry_count:t})),this._instance.xe(m({},i,{callback:r=>{200!==r.statusCode&&(r.statusCode<400||r.statusCode>=500)&&(t??0)<10?this.Tr(m({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(r)}}))}Tr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var a,l,c,u,i=(l=(a=3e3*Math.pow(2,t))/2,c=Math.min(18e5,a),u=(Math.random()-.5)*(c-l),Math.ceil(c+u)),r=Date.now()+i;this.br.push({retryAt:r,requestOptions:e});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),E.warn(n),this.Ir||(this.Ir=!0,this.Mr())}Mr(){this.Cr&&clearTimeout(this.Cr),this.Cr=setTimeout(()=>{this.Rr&&this.br.length>0&&this.re(),this.Mr()},this.Pr)}re(){var e=Date.now(),t=[],i=this.br.filter(n=>n.retryAt<e||(t.push(n),!1));if(this.br=t,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Cr&&(clearTimeout(this.Cr),this.Cr=void 0),this.br))try{this._instance.xe(m({},e,{transport:"sendBeacon"}))}catch(t){E.error(t)}this.br=[]}}class Qa{constructor(e){this.Or=()=>{var t,i,r,n;this.Fr||(this.Fr={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,c=a+(o?.clientHeight||0),u=o?.scrollHeight||0;this.Fr.lastScrollY=Math.ceil(a),this.Fr.maxScrollY=Math.max(a,null!==(t=this.Fr.maxScrollY)&&void 0!==t?t:0),this.Fr.maxScrollHeight=Math.max(l,null!==(i=this.Fr.maxScrollHeight)&&void 0!==i?i:0),this.Fr.lastContentY=c,this.Fr.maxContentY=Math.max(c,null!==(r=this.Fr.maxContentY)&&void 0!==r?r:0),this.Fr.maxContentHeight=Math.max(u,null!==(n=this.Fr.maxContentHeight)&&void 0!==n?n:0)},this._instance=e}getContext(){return this.Fr}resetContext(){var e=this.Fr;return setTimeout(this.Or,0),e}startMeasuringScrollPosition(){T(g,"scroll",this.Or,{capture:!0}),T(g,"scrollend",this.Or,{capture:!0}),T(g,"resize",this.Or)}scrollElement(){if(!this._instance.config.scroll_root_selector)return g?.document.documentElement;var e=C(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var i=g?.document.querySelector(t);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return g&&(g.scrollY||g.pageYOffset||g.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return g&&(g.scrollX||g.pageXOffset||g.document.documentElement.scrollLeft)||0}}var Za=s=>bn(s?.config.mask_personal_data_properties,s?.config.custom_personal_data_properties);class el{constructor(e,t,i,r){this.Ar=n=>{var o=this.Dr();if(!o||o.sessionId!==n){var a={sessionId:n,props:this.Lr(this._instance)};this.Nr.register({[xi]:a})}},this._instance=e,this.jr=t,this.Nr=i,this.Lr=r||Za,this.jr.onSessionId(this.Ar)}Dr(){return this.Nr.props[xi]}getSetOnceProps(){var e,t=null==(e=this.Dr())?void 0:e.props;return t?"r"in t?wn(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 M(_i(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+gi(i)]=t}),e}}var In=B("[SessionId]");class tl{constructor(e,t,i){var r;if(this.zr=[],!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.S=e.config,this.Nr=e.persistence,this.ci=void 0,this.Mt=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ur=t||Me,this.qr=i||Me;var n=this.S.persistence_name||this.S.token;if(this._sessionTimeoutMs=1e3*te(this.S.session_idle_timeout_seconds||1800,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Br(),this.Hr="ph_"+n+"_window_id",this.Wr="ph_"+n+"_primary_window_exists",this.Gr()){var a=H.D(this.Hr),l=H.D(this.Wr);a&&!l?this.ci=a:H.N(this.Hr),H.L(this.Wr,!0)}if(null!=(r=this.S.bootstrap)&&r.sessionID)try{var c=(()=>{var d=this.S.bootstrap.sessionID.replace(/-/g,"");if(32!==d.length)throw new Error("Not a valid UUID");if("7"!==d[12])throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})();this.Jr(this.S.bootstrap.sessionID,(new Date).getTime(),c)}catch(u){In.error("Invalid sessionID in bootstrap",u)}this.Vr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return f(this.zr)&&(this.zr=[]),this.zr.push(e),this.Mt&&e(this.Mt,this.ci),()=>{this.zr=this.zr.filter(t=>t!==e)}}Gr(){return"memory"!==this.S.persistence&&!this.Nr.Ce&&H.O()}Kr(e){e!==this.ci&&(this.ci=e,this.Gr()&&H.L(this.Hr,e))}Yr(){return this.ci?this.ci:this.Gr()?H.D(this.Hr):null}Jr(e,t,i){e===this.Mt&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Mt=e,this.Nr.register({[Dt]:[t,e,i]}))}Xr(){if(this.Mt&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Mt,this._sessionStartTimestamp];var e=this.Nr.props[Dt];return C(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Jr(null,null,null)}Vr(){T(g,"beforeunload",()=>{this.Gr()&&H.N(this.Wr)},{capture:!1})}
vendor: 4,510 bytes, line 3
3checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.S.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var i=t||(new Date).getTime(),[r,n,o]=this.Xr(),a=this.Yr(),l=U(o)&&o>0&&Math.abs(i-o)>864e5,c=!1,u=!n,d=!e&&Math.abs(i-r)>this.sessionTimeoutMs;u||d||l?(n=this.Ur(),a=this.qr(),In.info("new session ID generated",{sessionId:n,windowId:a,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),o=i,c=!0):a||(a=this.qr(),c=!0);var h=0===r||!e||l?i:r,p=0===o?(new Date).getTime():o;return this.Kr(a),this.Jr(n,h,p),e||this.Br(),c&&this.zr.forEach(_=>_(n,a,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0)),{sessionId:n,windowId:a,sessionStartTimestamp:p,changeReason:c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}Br(){clearTimeout(this.Qr),this.Qr=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var il=["$set_once","$set"],Oe=B("[SiteApps]");class sl{constructor(e){this._instance=e,this.Zr=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ts(e,t){if(t){var i=this.globalsForEvent(t);this.Zr.push(i),this.Zr.length>1e3&&(this.Zr=this.Zr.slice(10))}}get siteAppLoaders(){var e;return null==(e=x._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.We(this.ts.bind(this));this.es=()=>{e(),this.Zr=[],this.es=void 0}}}globalsForEvent(e){var t,i,r,n,o,a,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,p]of Object.entries(d))c[h]={id:u[h],type:h,properties:p};var{$set_once:_,$set:v}=e;return{event:m({},Ps(e,il),{properties:m({},e.properties,v?{$set:m({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},v)}:{},_?{$set_once:m({},null!==(r=null==(n=e.properties)?void 0:n.$set_once)&&void 0!==r?r:{},_)}:{}),elements_chain:null!==(o=null==(a=e.properties)?void 0:a.$elements_chain)&&void 0!==o?o:"",distinct_id:null==(l=e.properties)?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var a;!t.errored&&this.Zr.length&&(Oe.info("Processing "+this.Zr.length+" events for site app with id "+e.id),this.Zr.forEach(l=>null==t.processEvent?void 0:t.processEvent(l)),t.processedBuffer=!0),Object.values(this.apps).every(l=>l.processedBuffer||l.errored)&&(null==(a=this.es)||a.call(this))},r=!1,n=a=>{t.errored=!a,t.loaded=!0,Oe.info("Site app with id "+e.id+" "+(a?"loaded":"errored")),r&&i()};try{var{processEvent:o}=e.init({posthog:this._instance,callback:a=>{n(a)}});o&&(t.processEvent=o),r=!0}catch(a){Oe.error("Error while initializing PostHog app with config id "+e.id,a),n(!1)}if(r&&t.loaded)try{i()}catch(a){Oe.error("Error while processing buffered events PostHog app with config id "+e.id,a),t.errored=!0}}rs(){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)}ss(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(r){Oe.error("Error while processing event "+e.event+" for site app "+i.id,r)}}}onRemoteConfig(e){var t,i,r,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.rs(),void this._instance.on("eventCaptured",c=>this.ss(c))):void Oe.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.es)||i.call(this),null!=(r=e.siteApps)&&r.length)if(this.isEnabled){var o=function(c){var u;x["__$$ph_site_app_"+c]=n._instance,null==(u=x.__PosthogExtensions__)||null==u.loadSiteApp||u.loadSiteApp(n._instance,l,d=>{if(d)return Oe.error("Error while initializing PostHog app with config id "+c,d)})};for(var{id:a,url:l}of e.siteApps)o(a)}else Oe.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var rl=["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"],Rn=function(s,e){if(!s)return!1;var t=s.toLowerCase();return rl.concat(e||[]).some(i=>{var r=i.toLowerCase();return-1!==t.indexOf(r)})},Mn=function(s,e){if(!s)return!1;var t=s.userAgent;if(t&&Rn(t,e))return!0;try{var i=s?.userAgentData;if(null!=i&&i.brands&&i.brands.some(r=>Rn(r?.brand,e)))return!0}catch{}return!!s.webdriver},It=function(s){return s.US="us",s.EU="eu",s.CUSTOM="custom",s}({}),Pn="i.posthog.com";class nl{constructor(e){this.ns={},this.instance=e}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("."+Pn,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.ns[this.apiHost]||(this.ns[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?It.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?It.EU:It.CUSTOM),this.ns[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===It.CUSTOM)return this.apiHost+t;var i=Pn+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var ol={icontains:(s,e)=>!!g&&e.href.toLowerCase().indexOf(s.toLowerCase())>-1,not_icontains:(s,e)=>!!g&&-1===e.href.toLowerCase().indexOf(s.toLowerCase()),regex:(s,e)=>!!g&&it(e.href,s),not_regex:(s,e)=>!!g&&!it(e.href,s),exact:(s,e)=>e.href===s,is_not:(s,e)=>e.href!==s};class G{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){void 0===i&&(i=!1),t.getWebExperiments(r=>{G.os("retrieved web experiments from the server"),t.ls=new Map,r.forEach(n=>{if(n.feature_flag_key){var o;t.ls&&(G.os("setting flag key ",n.feature_flag_key," to web experiment ",n),null==(o=t.ls)||o.set(n.feature_flag_key,n));var a=t._instance.getFeatureFlag(n.feature_flag_key);A(a)&&n.variants[a]&&t.us(n.name,a,n.variants[a].transforms)}else if(n.variants)for(var l in n.variants){var c=n.variants[l];G.hs(c)&&t.us(n.name,l,c.transforms)}})},i)},this._instance=e,this._instance.onFeatureFlags(i=>{this.onFeatureFlags(i)})}onFeatureFlags(e){if(this._is_bot())G.os("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(I(this.ls))return this.ls=new Map,this.loadIfEnabled(),void this.previewWebExperiment();G.os("applying feature flags",e),e.forEach(t=>{var i;if(this.ls&&null!=(i=this.ls)&&i.has(t)){var r,n=this._instance.getFeatureFlag(t),o=null==(r=this.ls)?void 0:r.get(t);n&&null!=o&&o.variants[n]&&this.us(o.name,n,o.variants[n].transforms)}})}}previewWebExperiment(){var e=G.getWindowLocation();if(null!=e&&e.search){var t=Gt(e?.search,"__experiment_id"),i=Gt(e?.search,"__experiment_variant");t&&i&&(G.os("previewing web experiments "+t+" && "+i),this.getWebExperiments(r=>{this.ds(parseInt(t),i,r)},!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 r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance.xe({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:n=>e(200===n.statusCode&&n.json&&n.json.experiments||[])})}ds(e,t,i){var r=i.filter(n=>n.id===e);r&&r.length>0&&(G.os("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.us(r[0].name,t,r[0].variants[t].transforms))}static hs(e){return!I(e.conditions)&&G.vs(e)&&G.cs(e)}static vs(e){var t;if(I(e.conditions)||I(null==(t=e.conditions)?void 0:t.url))return!0;var i,r,n,o=G.getWindowLocation();return!!o&&(null==(i=e.conditions)||!i.url||ol[null!==(r=null==(n=e.conditions)?void 0:n.urlMatchType)&&void 0!==r?r:"icontains"](e.conditions.url,o))}
3static getWindowLocation(){return g?.location}static cs(e){var t;if(I(e.conditions)||I(null==(t=e.conditions)?void 0:t.utm))return!0;var i=vn();if(i.utm_source){var r,n,o,a,l,c,u,d,h=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,p=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_source||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==i.utm_source,_=null==(l=e.conditions)||null==(l=l.utm)||!l.utm_medium||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_medium)==i.utm_medium,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(d=e.conditions)||null==(d=d.utm)?void 0:d.utm_term)==i.utm_term;return h&&_&&v&&p}return!1}static os(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];E.info("[WebExperiments] "+e,i)}us(e,t,i){this._is_bot()?G.os("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(r=>{if(r.selector){var n;G.os("applying transform of variant "+t+" for experiment "+e+" ",r);var o=null==(n=document)?void 0:n.querySelectorAll(r.selector);o?.forEach(a=>{var l=a;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)})}}):G.os("Control variants leave the page unmodified.")}_is_bot(){return ee&&this._instance?Mn(ee,this._instance.config.custom_blocked_useragents):void 0}}var Rt={},_s=()=>{},at="posthog",Cn=!fa&&-1===Z?.indexOf("MSIE")&&-1===Z?.indexOf("Mozilla"),Tn=s=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Yn(y?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:_s,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:"2025-05-24"!==s||"history_change",capture_pageleave:"if_capture_pageview",defaults:s??"unset",debug:Q&&A(Q?.search)&&-1!==Q.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==g||null==(e=g.location)?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_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:t=>{E.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,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:_s}},On=s=>{var e={};f(s.process_person)||(e.person_profiles=s.process_person),f(s.xhr_headers)||(e.request_headers=s.xhr_headers),f(s.cookie_name)||(e.persistence_name=s.cookie_name),f(s.disable_cookie)||(e.disable_persistence=s.disable_cookie),f(s.store_google)||(e.save_campaign_params=s.store_google),f(s.verbose)||(e.debug=s.verbose);var t=L({},e,s);return C(s.property_blacklist)&&(f(s.property_denylist)?t.property_denylist=s.property_blacklist:C(s.property_denylist)?t.property_denylist=[...s.property_blacklist,...s.property_denylist]:E.error("Invalid value for property_denylist config: "+s.property_denylist)),t};class al{constructor(){this.__forceAllowLocalhost=!1}get fs(){return this.__forceAllowLocalhost}set fs(e){E.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Mt{get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new al,this.ps=!1,this.version=we.LIB_VERSION,this._s=new $n,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Tn(),this.SentryIntegration=aa,this.sentryIntegration=e=>{return r=jr(this,e),{name:Hr,processEvent:n=>r(n)};var r},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.gs=!1,this.bs=null,this.ys=null,this.ws=null,this.featureFlags=new La(this),this.toolbar=ne
3w ca(this),this.scrollManager=new Qa(this),this.pageViewManager=new va(this),this.surveys=new Ba(this),this.experiments=new G(this),this.exceptions=new ba(this),this.rateLimiter=new Wa(this),this.requestRouter=new nl(this),this.consent=new fo(this),this.people={set:(e,t,i)=>{var r=A(e)?{[e]:t}:e;this.setPersonProperties(r),i?.({})},set_once:(e,t,i)=>{var r=A(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),i?.({})}},this.on("eventCaptured",e=>E.info('send "'+e?.event+'"',e))}init(e,t,i){if(i&&i!==at){var r,n=null!==(r=Rt[i])&&void 0!==r?r:new Mt;return n._init(e,t,i),Rt[i]=n,Rt[at][i]=n,n}return this._init(e,t,i)}_init(e,t,i){var r,n;if(void 0===t&&(t={}),f(e)||vi(e))return E.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 E.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.Ss=[],t.person_profiles&&(this.ys=t.person_profiles),this.set_config(L({},Tn(t.defaults),On(t),{name:i,token:e})),this.config.on_xhr_error&&E.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:he.GZipJS,this.persistence=new ds(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ds(m({},this.config,{persistence:"sessionStorage"}));var o=m({},this.persistence.props),a=m({},this.sessionPersistence.props);if(this.register({$initialization_time:(new Date).toISOString()}),this.$s=new Ja(w=>this.ks(w),this.config.request_queue_config),this.xs=new Xa(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new tl(this),this.sessionPropsManager=new el(this,this.sessionManager,this.persistence)),new ha(this).startIfEnabledOrStop(),this.siteApps=new sl(this),null==(r=this.siteApps)||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new na(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new lo(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new ga(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new da(this),this.exceptionObserver=new bo(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new pr(this,yo),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new Oo(this),this.historyAutocapture.startIfEnabled(),we.DEBUG=we.DEBUG||this.config.debug,we.DEBUG&&E.info("Starting in debug mode",{this:this,config:t,thisC:m({},this.config),p:o,s:a}),this.Es(),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var l,c,u=this.config.get_device_id(Me()),d=null!=(l=t.bootstrap)&&l.isIdentifiedID?u:t.bootstrap.distinctID;this.persistence.set_property(Ee,null!=(c=t.bootstrap)&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.Is()){var h,p,_=Object.keys((null==(h=t.bootstrap)?void 0:h.featureFlags)||{}).filter(w=>{var S;return!(null==(S=t.bootstrap)||null==(S=S.featureFlags)||!S[w])}).reduce((w,S)=>{var k;return w[S]=(null==(k=t.bootstrap)||null==(k=k.featureFlags)?void 0:k[S])||!1,w},{}),v=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlagPayloads)||{}).filter(w=>_[w]).reduce((w,S)=>{var k,R;return null!=(k=t.bootstrap)&&null!=(k=k.featureFlagPayloads)&&k[S]&&(w[S]=null==(R=t.bootstrap)||null==(R=R.featureFlagPayloads)?void 0:R[S]),w},{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:v})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Ys,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(Me());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(Ee,"anonymous")}return T(g,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?function oa(s,e){var t=s.config.segment;if(!t)return e();!function(i,r){var n=i.config.segment;if(!n)return r();var o=l=>{var c=()=>l.anonymousId()||Me();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(Ee,"identified")),r()},a=n.user();"then"in a&&re(a.then)?a.then(l=>o(l)):o(a)}(s,()=>{t.register((i=>{Promise&&Promise.resolve||es.warn("This browser does not have Promise support, and can not use the segment integration");var r=(n,o)=>
3{if(!o)return n;n.event.userId||n.event.anonymousId===i.get_distinct_id()||(es.info("No userId set, resetting PostHog"),i.reset()),n.event.userId&&n.event.userId!==i.get_distinct_id()&&(es.info("UserId set, identifying with PostHog"),i.identify(n.event.userId));var a=i.calculateEventProperties(o,n.event.properties);return n.event.properties=Object.assign({},a,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:n=>r(n,n.event.event),page:n=>r(n,"$pageview"),identify:n=>r(n,"$identify"),screen:n=>r(n,"$screen")}})(s)).then(()=>{e()})})}(this,()=>this.Ps()):this.Ps(),re(this.config._onCapture)&&this.config._onCapture!==_s&&(E.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",w=>this.config._onCapture(w.event,w))),this}Ee(e){var t,i,r,n,o,a,l,c;if(!y||!y.body)return E.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ee(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=$(e.supportedCompression,he.GZipJS)?he.GZipJS:$(e.supportedCompression,he.Base64)?he.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.ys?this.ys:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(r=this.sessionRecording)||r.onRemoteConfig(e),null==(n=this.autocapture)||n.onRemoteConfig(e),null==(o=this.heatmaps)||o.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)}Ps(){try{this.config.loaded(this)}catch(e){E.critical("`loaded` function failed",e)}this.Rs(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.Ts()},1),new Ya(this).load(),this.featureFlags.decide()}Rs(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null==(e=this.$s)||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||Ie(this.__request_queue,e=>this.ks(e)),this.__request_queue=[],this.Rs()}_handle_unload(){var e,t;this.config.request_batching?(this.Ms()&&this.capture("$pageleave"),null==(e=this.$s)||e.unload(),null==(t=this.xs)||t.unload()):this.Ms()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}xe(e){this.__loaded&&(Cn?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=oi(e.url,{ip:this.config.ip?1:0}),e.headers=m({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var i,r,n,o=m({},t);o.timeout=o.timeout||6e4,o.url=oi(o.url,{_:(new Date).getTime().toString(),ver:we.LIB_VERSION,compression:o.compression});var a=null!==(i=o.transport)&&void 0!==i?i:"fetch",l=null!==(r=null==(n=Ts(wt,c=>c.transport===a))?void 0:n.method)&&void 0!==r?r:wt[0].method;if(!l)throw new Error("No available transport method");l(o)})(m({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(i=(r=this.config).on_request_error)||i.call(r,t)),null==e.callback||e.callback(t)}}))))}ks(e){this.xs?this.xs.retriableRequest(e):this.xe(e)}_execute_array(e){var t,i=[],r=[],n=[];Ie(e,a=>{a&&(C(t=a[0])?n.push(a):re(a)?a.call(this):C(a)&&"alias"===t?i.push(a):C(a)&&-1!==t.indexOf("capture")&&re(this[t])?n.push(a):r.push(a))});var o=function(a,l){Ie(a,function(c){if(C(c[0])){var u=l;M(c,function(d){u=u[d[0]].apply(u,d.slice(1))})}else this[c[0]].apply(this,c.slice(1))},l)};o(i,this),o(r,this),o(n,this)}Is(){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 r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$s){if(!this.consent.isOptedOut())if(!f(e)&&A(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var n=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==n||!n.isRateLimited){null!=t&&t.$current_url&&!A(t?.$current_url)&&(E.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 o=new Date,a=i?.timestamp||o,l=Me(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},a,l)};n&&(c.properties.$lib_rate_limit_remaining_tokens=n.remainingTokens),i?.$set&&(c.$set=i?.$set);var u,d,h=this.Cs(i?.$set_once);if(h&&(c.$set_once=h),(c=function Gn(s,e){return t=s,i=n=>A(n)&&!Fe(e)?n.slice(0,e):n,r=new Set,function n(o,a){return o!==Object(o)?i?i(o):o:r.has(o)?void 0:(r.add(o),C(o)?(l=[],Ie(o,c=>{l.push(n(c))})):(l={},M(o,(c,u)=>{r.has(c)||(l[u]=n(c))})),l);var l}(t);var t,i,r}(c,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,f(i?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=o),e===hi.DISMISSED||e===hi.SENT){var p=t?.[gs.SURVEY_ID],_=t?.[gs.SURVEY_ITERATION];localStorage.setItem((d=""+ps+(u={id:p,current_iteration:_}).id,u.current_iteration&&u.current_iteration>0&&(d=""+ps+u.id+"_"+u.current_iteration),d),"true"),c.$set=m({},c.$set,{[Na({id:p,current_iteration:_},e===hi.SENT?"responded":"dismissed")]:!0})}var v=m({},c.properties.$set,c.$set);if(Je(v)||this.setPersonPropertiesForFlags(v),!I(this.config.before_send)){var b=this.Os(c);if(!b)return;c=b}this._s.emit("eventCaptured",c);var w={method:"POST",url:null!==(r=i?._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.ks(w):this.$s.enqueue(w),c}E.critical("This capture call is ignored due to client rate limiting.")}}else E.error("No event name provided to posthog.capture")}else E.uninitializedWarning("posthog.capture")}We(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o=n?void 0:this.persistence.remove_event_timer(e),a=m({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=m({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!A(a.distinct_id)&&!U(a.distinct_id)||vi(a.distinct_id))&&E.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var c,u=function Ta(s,e){if(!Z)return{};var t,i,r,n=s?At([],ui,e||[]):[],[o,a]=function(l){for(var c=0;c<pn.length;c++){var[u,d]=pn[c],h=u.exec(l),p=h&&(re(d)?d(h,l):d);if(p)return p}return["",""]}(Z);return L(_i({$os:o,$os_version:a,$browser:dn(Z,navigator.vendor),$device:gn(Z),$device_type:(i=Z,r=gn(i),"iPad"===r||r===Jr||"Kobo"===r||"Kindle Fire"===r||r===hn?
vendor: 4,519 bytes, line 3
3Et:r===xt||r===nt||r===kt||r===os?"Console":r===Qr?"Wearable":r?oe:"Desktop"),$timezone:En(),$timezone_offset:Ca()}),{$current_url:Pi(Q?.href,n,us),$host:Q?.host,$pathname:Q?.pathname,$raw_user_agent:Z.length>1e3?Z.substring(0,997)+"...":Z,$browser_version:Ma(Z,navigator.vendor),$browser_language:mn(),$browser_language_prefix:(t=mn(),"string"==typeof t?t.split("-")[0]:void 0),$screen_height:g?.screen.height,$screen_width:g?.screen.width,$viewport_height:g?.innerHeight,$viewport_width:g?.innerWidth,$lib:"web",$lib_version:we.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:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());a.$session_id=d,a.$window_id=h}this.sessionPropsManager&&L(a,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&L(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(p=this.xs)?void 0:p.length}catch(w){a.$sdk_debug_error_capturing_properties=String(w)}if(this.requestRouter.region===It.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),c="$pageview"!==e||n?"$pageleave"!==e||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),a=L(a,c),"$pageview"===e&&y&&(a.title=y.title),!f(o)){var _=i.getTime()-o;a.$duration=parseFloat((_/1e3).toFixed(3))}Z&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=L({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),C(this.config.property_denylist)?M(this.config.property_denylist,function(w){delete a[w]}):E.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var v=this.config.sanitize_properties;v&&(E.error("sanitize_properties is deprecated. Use before_send instead"),a=v(a,e));var b=this.Fs();return a.$process_person_profile=b,b&&!n&&this.As("_calculate_event_properties"),a}Cs(e){var t;if(!this.persistence||!this.Fs()||this.ps)return e;var i=this.persistence.get_initial_props(),r=null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps(),n=L({},i,r||{},e||{}),o=this.config.sanitize_properties;return o&&(E.error("sanitize_properties is deprecated. Use before_send instead"),n=o(n,"$set_once")),this.ps=!0,Je(n)?void 0:n}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var r;null==(r=this.persistence)||r.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)}Ds(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this._s.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))&&void 0!==t?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 E.uninitializedWarning("posthog.identify");if(U(e)&&(e=e.toString(),E.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()))E.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(this.As("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(ht)&&(this.unregister(ht),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(Ee)||"anonymous");e!==r&&o?(this.persistence.set_property(Ee,"identified"),this.setPersonPropertiesForFlags(m({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.ws=Yr(e,t,i),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(Bt))}}else E.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.As("posthog.setPersonProperties")){var i=Yr(this.get_distinct_id(),e,t);this.ws!==i?(this.setPersonPropertiesForFlags(m({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.ws=i):E.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.As("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:m({},r,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===t||i||this.reloadFeatureFlags()}}else E.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.As("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,r,n;if(E.info("reset"),!this.__loaded)return E.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),null==(r=this.persistence)||r.set_property(Ee,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.ws=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Ys,$device_id:null},"");else{var a=this.config.get_device_id(Me());this.register_once({distinct_id:a,$device_id:e?a:o},"")}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)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var n,o=null!==(n=e.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-o,0)}return r}alias(e,t){return e===this.get_property(Os)?(E.critical("Attempting to create alias for existing People user - aborting."),-2):this.As("posthog.alias")?(f(t)&&(t=this.get_distinct_id()),e!==t?(this.Ds(ht,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(E.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,i,r,n,o=m({},this.config);O(e)&&(L(this.config,On(e)),null==(t=this.persistence)||t.update_config(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ds(m({},this.config,{persistence:"sessionStorage"})),N.O()&&"true"===N.A("ph_debug")&&(this.config.debug=!0),this.config.debug&&(we.DEBUG=!0,E.info("set_config",JSON.stringify({config:e,oldConfig:o,newConfig:m({},this.config)},null,2))),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),null==(r=this.autocapture)||r.startIfEnabled(),null==(n=this.heatmaps)||n.startIfEnabled(),this.surveys.loadIfEnabled(),this.Es())}startSessionRecording(e){var r,n,o,a,l,t=!0===e,i={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};Object.values(i).some(Boolean)&&(null==(r=this.sessionManager)||r.checkAndGetSessionAndWindowId(),i.sampling&&(null==(n=this.sessionRecording)||n.overrideSampling()),i.linked_flag&&(null==(o=this.sessionRecording)||o.overrideLinkedFlag()),i.url_trigger&&(null==(a=this.sessionRecording)||a.overrideTrigger("url")),i.event_trigger&&(null==(l=this.sessionRecording)||l.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=new Error("PostHog syntheticException");this.exceptions.sendExceptionEvent(m({},function To(s,e){var{error:t,event:i}=s,r={$exception_list:[]},n=t||i;if(Oi(n)||Zt(n,"DOMException")){var o=n;if("stack"in n)r=Ni(n,e);else{var a=o.name||(Oi(o)?"DOMError":"DOMException"),l=o.message?a+": "+o.message:a;r=qi(l,m({},e,{overrideExceptionType:Oi(o)?"DOMError":"DOMException",defaultExceptionMessage:l}))}return"code"in o&&(r.$exception_DOMException_code=""+o.code),r}if(h=n,Zt(h,"ErrorEvent")&&n.error)return Ni(n.error,e);var h;if(fr(n))return Ni(n,e);if(function(h){return Zt(h,"Object")}(n)||vr(n))return function Co(s,e){var t,i,r=null===(t=e?.handled)||void 0===t||t,n=null===(i=e?.synthetic)||void 0===i||i,l={type:null!=e&&e.overrideExceptionType?e.overrideExceptionType:vr(s)?s.constructor.name:"Error",value:"Non-Error 'exception' captured with keys: "+function(u,d){void 0===d&&(d=40);var h=Object.keys(u);if(h.sort(),!h.length)return"[object has no keys]";for(var p=h.length;p>0;p--){var _=h.slice(0,p).join(", ");
3if(!(_.length>d))return p===h.length||_.length<=d?_:_.slice(0,d)+"..."}return""}(s),mechanism:{handled:r,synthetic:n}};if(null!=e&&e.syntheticException){var c=Di(e?.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:Po(s.level)?s.level:"error"}}(n,e);if(f(t)&&A(i)){var c="Error",u=i,d=i.match(Io);return d&&(c=d[1],u=d[2]),qi(u,m({},e,{overrideExceptionType:c,defaultExceptionMessage:u}))}return qi(n,e)}(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)&&void 0!==e?e:at;return t!==at&&(t=at+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(Ee))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(Ee))}Fs(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Je(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[ht])&&(null==(t=this.persistence)||null==(t=t.props)||!t[jt]))}Ms(){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.Fs()||this.As("posthog.createPersonProfile")&&this.setPersonProperties({},{})}As(e){return"never"===this.config.person_profiles?(E.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ds(jt,!0),!0)}Es(){var e,t,i,r,n=this.consent.isOptedOut(),a=this.config.disable_persistence||n&&!!this.config.opt_out_persistence_by_default;(null==(e=this.persistence)?void 0:e.Ce)!==a&&(null==(i=this.persistence)||i.set_disabled(a)),(null==(t=this.sessionPersistence)?void 0:t.Ce)!==a&&(null==(r=this.sessionPersistence)||r.set_disabled(a))}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.Es(),(f(e?.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=e?.captureEventName)&&void 0!==t?t:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ts()}opt_out_capturing(){this.consent.optInOut(!1),this.Es()}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.Es()}_is_bot(){return ee?Mn(ee,this.config.custom_blocked_useragents):void 0}Ts(){y&&("visible"===y.visibilityState?this.gs||(this.gs=!0,this.capture("$pageview",{title:y.title},{send_instantly:!0}),this.bs&&(y.removeEventListener("visibilitychange",this.bs),this.bs=null)):this.bs||(this.bs=this.Ts.bind(this),T(y,"visibilitychange",this.bs)))}debug(e){!1===e?(g?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(g?.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}))}Os(e){if(I(this.config.before_send))return e;var t=C(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of t){if(i=r(i),I(i)){var n="Event '"+e.event+"' was rejected in beforeSend function";return Un(e.event)?E.warn(n+". This can cause unexpected behavior."):E.info(n),null}i.properties&&!Je(i.properties)||E.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return null==(e=this.pageViewManager.ve)?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)})}}!function(s,e){for(var t=0;t<e.length;t++)s.prototype[e[t]]=Vn(s.prototype[e[t]])}(Mt,["identify"]);var An,Ln=(An=Rt[at]=new Mt,function(){function s(){s.done||(s.done=!0,Cn=!1,M(Rt,function(e){e._dom_loaded()}))}null!=y&&y.addEventListener?"complete"===y.readyState?s():T(y,"DOMContentLoaded",s,{capture:!1}):g&&E.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),An)}}]); 4//# sourceMappingURL=512.516a5fa3bff793b5.js.map 5//# debugId=162be6f4-e409-543a-88eb-ca893cec2dfc
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.