PageSourceSearch

https://shipwreckexpo.com/wp-content/assets/js/pages/attraction/5476.js

js shipwreckexpo.com collected 2026-10-02 13:54:08 UTC 195,647 bytes, 2 lines download raw bytes

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

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