PageSourceSearch

https://www.memberstack.com/_next/static/immutable/chunks/1_3rt63dscdez.js

js memberstack.com collected 2026-09-24 17:15:48 UTC 230,717 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,174564,e=>{"use strict";e.s(["BOOTSTRAP_DISTINCT_ID_COOKIE",0,"bootstrap_distinct_id","NAV_CONCEPT_FLAG",0,"nav-concept","NAV_VARIANTS",0,["control","b","c"],"NAV_VARIANT_COOKIE",0,"nav_variant","POSTHOG_HOST",0,"https://us.posthog.com","POSTHOG_KEY",0,"phc_K5q8e5XptMUOBOG3N12fN8edKrgRF67mCMkyT2OrkEQ"])},869093,(e,t,n)=>{"use strict";var i=e.r(344086),r=e.r(204571);Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return h}});var s=e.r(843476),o=e.r(271645),a=e.r(667585),u=e.r(652157);function l(e){return{default:e&&"default"in e?e.default:e}}var c={loader:function(){return Promise.resolve(l(function(){return null}))},loading:null,ssr:!0},h=function(e){var t=i._({},c,e),n=(0,o.lazy)(function(){return t.loader().then(l)}),h=t.loading;function d(e){var l=h?(0,s.jsx)(h,{isLoading:!0,pastDelay:!0,error:null}):null,c=!t.ssr||!!t.loading,d=c?o.Suspense:o.Fragment,f=t.ssr?(0,s.jsxs)(s.Fragment,{children:["u"<typeof window?(0,s.jsx)(u.PreloadChunks,{moduleIds:t.modules}):null,(0,s.jsx)(n,i._({},e))]}):(0,s.jsx)(a.BailoutToCSR,{reason:"next/dynamic",children:(0,s.jsx)(n,i._({},e))});return(0,s.jsx)(d,r._(i._({},c?{fallback:l}:{}),{children:f}))}return d.displayName="LoadableComponent",d}},770703,(e,t,n)=>{"use strict";var i=e.r(344086),r=e.r(204571),s=e.r(368996);Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return a}});var o=e.r(555682)._(e.r(869093));function a(e,t){var n,s={};"function"==typeof e&&(s.loader=e);var a=i._({},s,t);return(0,o.default)(r._(i._({},a),{modules:null==(n=a.loadableGenerated)?void 0:n.modules}))}("function"==typeof n.default||"object"===s._(n.default)&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},720565,604570,e=>{"use strict";var t,n,i=e.i(108487),r=e.i(500075),s=e.i(38981),o=e.i(292955),a=e.i(780646),u=e.i(299749),l=e.i(64217),c=e.i(651682),h=e.i(540316),d=e.i(513935),f="u">typeof window?window:void 0,v="u">typeof globalThis?globalThis:f;"u"<typeof self&&(v.self=v),"u"<typeof File&&(v.File=function(){});var p=null==v?void 0:v.navigator,_=null==v?void 0:v.document,g=null==v?void 0:v.location,y=null==v?void 0:v.fetch,m=null!=v&&v.XMLHttpRequest&&"withCredentials"in new v.XMLHttpRequest?v.XMLHttpRequest:void 0,k=null==v?void 0:v.AbortController,b=null==v?void 0:v.CompressionStream,x=null==p?void 0:p.userAgent,w=null!=f?f:{},E="1.386.6",S={DEBUG:!1,LIB_VERSION:E,LIB_NAME:"web",JS_SDK_VERSION:E};function P(e,t,n,i,r,s,o){try{var a=e[s](o),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function F(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var s=e.apply(t,n);function o(e){P(s,i,r,o,a,"next",e)}function a(e){P(s,i,r,o,a,"throw",e)}o(void 0)})}}function $(){return($=Object.assign.bind()).apply(null,arguments)}function I(e,t){if(null==e)return{};var n={};for(var i in e)if(({}).hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}var O,T,C,M=((O={}).GZipJS="gzip-js",O.Base64="base64",O),R=["$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"],A="NativeGzipValidationError",L=function(e){return e.length>=2&&31===e[0]&&139===e[1]},q=function(e){return!(!e||"object"!=(void 0===e?"undefined":(0,r._)(e)))&&"NotReadableError"===("name"in e?String(e.name):"")},D=function(e){var t=Error("Native gzip produced invalid output: "+e);throw t.name=A,t},N=(T=F(function(e,t){var n,i,r,s,o;return(0,d._)(this,function(a){switch(a.label){case 0:return 18>e.size&&D("too-short"),i=Uint8Array.bind,[4,e.slice(0,10).arrayBuffer()];case 1:return L(n=new(i.apply(Uint8Array,[void 0,a.sent()])))&&8===n[2]||D("invalid-header"),s=DataView.bind,[4,e.slice(e.size-8).arrayBuffer()];
1case 2:return(r=new(s.apply(DataView,[void 0,a.sent()]))).getUint32(0,!0)!==function(e){for(var t=function(){if(C)return C;C=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?0xedb88320^t>>>1:t>>>1;C[e]=t>>>0}return C}(),n=0xffffffff,i=0;e.length>i;i++)n=t[255&(n^e[i])]^n>>>8;return(0xffffffff^n)>>>0}(t)&&D("invalid-crc"),o=t.length>>>0,r.getUint32(4,!0)!==o&&D("invalid-size"),[2]}})}),function(e,t){return T.apply(this,arguments)});function j(){return(j=F(function(e,t,n){var i,r,s,o,a,u;return(0,d._)(this,function(l){switch(l.label){case 0:void 0===t&&(t=!0),l.label=1;case 1:var h;return l.trys.push([1,4,,5]),i=(new TextEncoder).encode(e),o=(s=(r=new CompressionStream("gzip")).writable.getWriter()).write(i).then(function(){return s.close()}).catch((h=F(function(e){return(0,d._)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,s.abort(e)];case 1:case 2:return t.sent(),[3,3];case 3:throw e}})}),function(e){return h.apply(this,arguments)})),[4,Promise.all([new Response(r.readable).blob(),o])];case 2:return[4,N(a=c._.apply(void 0,[l.sent(),1])[0],i)];case 3:return[2,(l.sent(),a)];case 4:if(u=l.sent(),null!=n&&n.rethrow)throw u;return[2,(t&&console.error("Failed to gzip compress data",u),null)];case 5:return[2]}})})).apply(this,arguments)}var H=["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"],z=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var n=e.toLowerCase();return H.concat(t).some(function(e){var t=e.toLowerCase();return -1!==n.indexOf(t)})};function U(e,t){return -1!==e.indexOf(t)}var G=function(e){return e.trim()},B=function(e){return e.replace(/^\$/,"")},W=Object.prototype,V=W.hasOwnProperty,K=W.toString,Y=Array.isArray||function(e){return"[object Array]"===K.call(e)},J=function(e){return"function"==typeof e},X=function(e){return e===Object(e)&&!Y(e)},Z=function(e){if(X(e)){for(var t in e)if(V.call(e,t))return!1;return!0}return!1},Q=function(e){return void 0===e},ee=function(e){return"[object String]"==K.call(e)},et=function(e){return ee(e)&&0===e.trim().length},en=function(e){return null===e},ei=function(e){return Q(e)||en(e)},er=function(e){return"[object Number]"==K.call(e)&&e==e},es=function(e){return er(e)&&e>0},eo=function(e){return"[object Boolean]"===K.call(e)};function ea(e){return null===e||"object"!=(void 0===e?"undefined":(0,r._)(e))}function eu(e,t){return({}).toString.call(e)==="[object "+t+"]"}function el(e){return"u">typeof Event&&function(e,t){try{return(0,i._)(e,t)}catch(e){return!1}}(e,Event)}var ec=[!0,"true",1,"1","yes"],eh=function(e){return U(ec,e)},ed=[!1,"false",0,"0","no"];function ef(e,t,n,i,r){return t>n&&(i.warn("min cannot be greater than max."),t=n),er(e)?e>n?(i.warn(" cannot be  greater than max: "+n+". Using max value instead."),n):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),ef(r||n,t,n,i))}var ev,ep,e_,eg,ey=function(){function e(t){(0,o._)(this,e),this.$t={}
1,this.zt=t.zt,this.Gt=ef(t.bucketSize,0,100,t.Zt),this.Qt=ef(t.refillRate,0,this.Gt,t.Zt),this.Jt=ef(t.refillInterval,0,864e5,t.Zt)}return(0,a._)(e,[{key:"Kt",value:function(e,t){var n=Math.floor((t-e.lastAccess)/this.Jt);n>0&&(e.tokens=Math.min(e.tokens+n*this.Qt,this.Gt),e.lastAccess=e.lastAccess+n*this.Jt)}},{key:"consumeRateLimit",value:function(e){var t,n=Date.now(),i=String(e),r=this.$t[i];return r?this.Kt(r,n):this.$t[i]=r={tokens:this.Gt,lastAccess:n},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.zt)||t.call(this,e)),0===r.tokens)}},{key:"stop",value:function(){this.$t={}}}]),e}(),em="Mobile",ek="Android",eb="Tablet",ex=ek+" "+eb,ew="iPad",eE="Apple",eS=eE+" Watch",eP="Safari",eF="BlackBerry",e$="Samsung",eI=e$+"Browser",eO=e$+" Internet",eT="Chrome",eC=eT+" OS",eM=eT+" iOS",eR="Internet Explorer",eA=eR+" "+em,eL="Opera",eq=eL+" Mini",eD="Edge",eN="Microsoft "+eD,ej="Firefox",eH=ej+" iOS",ez="Nintendo",eU="PlayStation",eG="Xbox",eB=ek+" "+em,eW=em+" "+eP,eV="Windows",eK=eV+" Phone",eY="Nokia",eJ="Ouya",eX="Generic",eZ=eX+" "+em.toLowerCase(),eQ=eX+" "+eb.toLowerCase(),e0="Konqueror",e1="Oculus Browser",e2="Vivaldi",e3="Yandex",e5="Whale",e8="DuckDuckGo",e6="Pale Moon",e4="Waterfox",e7="Brave",e9="Google Search App",te="(\\d+(\\.\\d+)?)",tt=RegExp("Version/"+te),tn=RegExp(eG,"i"),ti=RegExp(eU+" \\w+","i"),tr=RegExp(ez+" \\w+","i"),ts=RegExp(eF+"|PlayBook|BB10","i"),to={"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"},ta=function(e,t,n,i){var r;return t=t||"",(null!=n&&n.brave?e7:null)||(null!=i&&i.detectGoogleSearchApp&&U(e,"GSA/")?e9:U(e," OPR/")&&U(e,"Mini")?eq:U(e," OPR/")?eL:ts.test(e)?eF:U(e,"IE"+em)||U(e,"WPDesktop")?eA:U(e,"OculusBrowser")?e1:U(e,eI)?eO:U(e,eD)||U(e,"Edg/")?eN:U(e,e2+"/")?e2:U(e,"YaBrowser/")?e3:U(e,e5+"/")?e5:U(e,e8+"/")||U(e,"Ddg/")?e8:U(e,"FBIOS")?"Facebook "+em:U(e,"UCWEB")||U(e,"UCBrowser")?"UC Browser":U(e,"CriOS")?eM:U(e,"CrMo")||U(e,eT)?eT:U(e,ek)&&U(e,eP)?eB:U(e,"FxiOS")?eH:U(e.toLowerCase(),e0.toLowerCase())?e0:U(e,e7+"/")?e7:(r=t)&&U(r,eE)||U(e,eP)&&!U(e,eT)&&!U(e,ek)?U(e,em)?eW:eP:U(e,"PaleMoon/")?e6:U(e,e4+"/")?e4:U(e,ej)?ej:U(e,"MSIE")||U(e,"Trident/")?eR:U(e,"Gecko")?ej:"")},tu=(ev={},(0,u._)(ev,eA,[RegExp("rv:"+te)]),(0,u._)(ev,eN,[RegExp(eD+"?\\/"+te)]),(0,u._)(ev,eT,[RegExp("("+eT+"|CrMo)\\/"+te)]),(0,u._)(ev,eM,[RegExp("CriOS\\/"+te)]),(0,u._)(ev,"UC Browser",[RegExp("(UCBrowser|UCWEB)\\/"+te)]),(0,u._)(ev,eP,[tt]),(0,u._)(ev,eW,[tt]),(0,u._)(ev,eL,[RegExp("(Opera|OPR)\\/"+te)]),(0,u._)(ev,ej,[RegExp(ej+"\\/"+te)]),(0,u._)(ev,eH,[RegExp("FxiOS\\/"+te)]),(0,u._)(ev,e0,[RegExp("Konqueror[:/]?"+te,"i")]),(0,u._)(ev,eF,[RegExp(eF+" "+te),tt]),(0,u._)(ev,eB,[RegExp("android\\s"+te,"i")]),(0,u._)(ev,eO,[RegExp(eI+"\\/"+te)]),(0,u._)(ev,e1,[RegExp("OculusBrowser\\/"+te)]),(0,u._)(ev,e2,[RegExp(e2+"\\/"+te)]),(0,u._)(ev,e3,[RegExp("YaBrowser\\/"+te)]),(0,u._)(ev,e5,[RegExp(e5+"\\/"+te)]),(0,u._)(ev,e7,[RegExp(e7+"\\/"+te)]),(0,u._)(ev,e8,[RegExp("(DuckDuckGo|Ddg)\\/"+te)]),(0,u._)(ev,e6,[RegExp("PaleMoon\\/"+te)]),(0,u._)(ev,e4,[RegExp(e4+"\\/"+te)]),(0,u._)(ev,e9,[RegExp("GSA\\/"+te)]),(0,u._)(ev,eR,[RegExp("(rv:|MSIE )"+te)]),(0,u._)(ev,"Mozilla",[RegExp("rv:"+te)]),ev),tl=function(e,t,n,i){var r=tu[ta(e,t,n,i)];if(Q(r))return null;for(var s=0;r.length>s;s++){var o=e.match(r[s]);if(o)return parseFloat(o[o.length-2])}return null},tc=[[RegExp(eG+"; "+eG+" (.*?)[);]","i"),function(e){return[eG,e&&e[1]||""]}],[RegExp(ez,"i"),[ez,""]],[RegExp(eU,"i"),[eU,""]],[ts,[eF,""]],[RegExp(eV,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[eK,""];if(new RegExp(em).test(t)&&!/IEMobile\b/.test(t))return[eV+" "+em,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var i=to[n[1]]||"";return/arm/i.test(t)&&(i="RT"),[eV,i]}return[eV,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){return e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Q(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ek+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ek+")","i"),function(e){return e&&e[2]?[ek,[e[2],e[3],e[4]||"0"].join(".")]:[ek,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(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/,[eC,""]],[/Linux|debian/i,["Linux",""]]],th=function(e){return tr.test(e)?ez:ti.test(e)?eU:tn.test(e)?eG:RegExp(eJ,"i").test(e)?eJ:RegExp("("+eK+"|WPDesktop)","i").test(e)?eK:/iPad/.test(e)?ew:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?eS:ts.test(e)?eF:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eY,"i").test(e)?eY:/(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(em).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)?ek:ex:RegExp("(pda|"+em+")","i").test(e)?eZ:RegExp(eb,"i").test(e)&&!RegExp(eb+" pc","i").test(e)?eQ:""},td={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}},tf=td.info;function tv(e){var t=[];for(var n in e){var i=e[n];en(i)||Q(i)||t.push({key:n,value:function e(t){if(eo(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(Y(t))return{arrayValue:{values:t.map(function(t){return e(t)})}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(i)})}return t}var tp=function(){function e(t,n,i){(0,o._)(this,e),void 0===i&&(i=[]),this.coercers=t,this.stackParser=n,this.modifiers=i}return(0,a._)(e,[{key:"buildFromUnknown",value:function(e,t){void 0===t&&(t={});var n=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(n,t,0).apply(e),r=this.buildParsingContext(t),s=this.parseStacktrace(i,r);return{$exception_list:this.convertToExceptionList(s,n),$exception_level:"error"}}},{key:"modifyFrames",value:function(e){var t=this;return F(function(){var n,i,r,s,o,a,u,l;return(0,d._)(this,function(c){switch(c.label){case 0:n=!0,i=!1,r=void 0,c.label=1;case 1:c.trys.push([1,7,8,9]),s=e[Symbol.iterator](),c.label=2;case 2:if(n=(o=s.next()).done)return[3,6];if(!((a=o.value).stacktrace&&a.stacktrace.frames&&Y(a.stacktrace.frames)))return[3,4];return u=a.stacktrace,[4,t.applyModifiers(a.stacktrace.frames)];case 3:u.frames=c.sent(),c.label=4;case 4:c.label=5;case 5:return n=!0,[3,2];case 6:return[3,9];case 7:return l=c.sent(),i=!0,r=l,[3,9];case 8:try{n||null==s.return||s.return()}finally{if(i)throw r}
1return[7];case 9:return[2,e]}})})()}},{key:"coerceFallback",value:function(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}},{key:"parseStacktrace",value:function(e,t){var n,i;return null!=e.cause&&(n=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),$({},e,{cause:n,stack:i})}},{key:"applyChunkIds",value:function(e,t){return e.map(function(e){return e.filename&&t&&(e.chunk_id=t[e.filename]),e})}},{key:"applyCoercers",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var s,o=this.coercers[Symbol.iterator]();!(n=(s=o.next()).done);n=!0){var a=s.value;if(a.match(e))return a.coerce(e,t)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return this.coerceFallback(t)}},{key:"applyModifiers",value:function(e){var t=this;return F(function(){var n,i,r,s,o,a,u;return(0,d._)(this,function(l){switch(l.label){case 0:n=e,i=!0,r=!1,s=void 0,l.label=1;case 1:l.trys.push([1,6,7,8]),o=t.modifiers[Symbol.iterator](),l.label=2;case 2:if(i=(a=o.next()).done)return[3,5];return[4,(0,a.value)(n)];case 3:n=l.sent(),l.label=4;case 4:return i=!0,[3,2];case 5:return[3,8];case 6:return u=l.sent(),r=!0,s=u,[3,8];case 7:try{i||null==o.return||o.return()}finally{if(r)throw s}return[7];case 8:return[2,n]}})})()}},{key:"convertToExceptionList",value:function(e,t){var n,i,r,s={type:e.type,value:e.value,mechanism:{type:null!=(n=t.type)?n:"generic",handled:null==(i=t.handled)||i,synthetic:null!=(r=e.synthetic)&&r}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var o=[s];return null!=e.cause&&o.push.apply(o,(0,h._)(this.convertToExceptionList(e.cause,$({},t,{handled:!0})))),o}},{key:"buildParsingContext",value:function(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return eg&&n.length===e_||(e_=n.length,eg=n.reduce(function(n,i){ep||(ep={});var r=ep[i];if(r)n[r[0]]=r[1];else for(var s=e(i),o=s.length-1;o>=0;o--){var a=s[o],u=null==a?void 0:a.filename,l=t[i];if(u&&l){n[u]=l,ep[i]=[u,l];break}}return n},{})),eg}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}},{key:"buildCoercingContext",value:function(e,t,n){var i=this;void 0===n&&(n=0);var r=function(n,r){if(4>=r){var s=i.buildCoercingContext(e,t,r);return i.applyCoercers(n,s)}};return $({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:e,apply:function(e){return r(e,n)},next:function(e){return r(e,n+1)}})}}]),e}();function t_(e,t,n,i,r){var s={platform:e,filename:t,function:"<anonymous>"===n?"?":n,in_app:!0};return Q(i)||(s.lineno=i),Q(r)||(s.colno=r),s}var tg=function(e,t){var n=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return n||i?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},ty=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tm=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tk=/\((\S*)(?::(\d+))(?::(\d+))\)/,tb=function(e,t){var n=ty.exec(e);if(n){var i=(0,c._)(n,4);return t_(t,i[1],"?",+i[2],+i[3])}var r=tm.exec(e);if(r){if(r[2]&&0===r[2].indexOf("eval")){var s=tk.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var o=(0,c._)(tg(r[1]||"?",r[2]),2),a=o[0];return t_(t,o[1],a,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},tx=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tw=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tE=function(e,t){var n=tx.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var i,r=tw.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],o=n[1]||"?";return o=(i=(0,c._)(tg(o,s),2))[0],t_(t,s=i[1],o,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},tS=/\(error: (.*)\)/,tP=function(){function e(){(0,o._)(this,e)}return(0,a._)(e,[{key:"match",value:function(e){return this.isDOMException(e)||this.isDOMError(e)}},{key:"coerce",value:function(e,t){var n=ee(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}},{key:"getType",value:function(e){return this.isDOMError(e)?"DOMError":"DOMException"}},{key:"getValue",value:function(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}},{key:"isDOMException",value:function(e){return eu(e,"DOMException")}},{key:"isDOMError",value:function(e){return eu(e,"DOMError")}}]),e}(),tF=function(){function e(){(0,o._)(this,e)}return(0,a._)(e,[{key:"match",value:function(e){return(0,i._)(e,Error)}},{key:"coerce",value:function(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}}},{key:"getType",value:function(e){return e.name||e.constructor.name}},{key:"getMessage",value:function(e,t){var n=e.message;return String(n.error&&"string"==typeof n.error.message?n.error.message:n)}},{key:"getStack",value:function(e){return e.stacktrace||e.stack||void 0}}]),e}(),t$=function(){function e(){(0,o._)(this,e)}return(0,a._)(e,[{key:"match",value:function(e){return eu(e,"ErrorEvent")&&null!=e.error}},{key:"coerce",value:function(e,t){var n;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}}}]),e}(),tI=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,tO=function(){function e(){(0,o._)(this,e)}return(0,a._)(e,[{key:"match",value:function(e){return"string"==typeof e}},{key:"coerce",value:function(e,t){var n,i=(0,c._)(this.getInfos(e),2),r=i[0],s=i[1];return{type:null!=r?r:"Error",value:null!=s?s:e,stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}}},{key:"getInfos",value:function(e){var t="Error",n=e,i=e.match(tI);return i&&(t=i[1],n=i[2]),[t,n]}}]),e}(),tT=["fatal","error","warning","log","info","debug"];function tC(e,t){void 0===t&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var i=n.length;i>0;i--){var r=n.slice(0,i).join(", ");
1if(t>=r.length)return i===n.length?r:r.length>t?r.slice(0,t)+"...":r}return""}var tM=function(){function e(){(0,o._)(this,e)}return(0,a._)(e,[{key:"match",value:function(e){return"object"==(void 0===e?"undefined":(0,r._)(e))&&null!==e}},{key:"coerce",value:function(e,t){var n,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null==(n=t.syntheticException)?void 0:n.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}},{key:"getType",value:function(e){return el(e)?e.constructor.name:"Error"}},{key:"getValue",value:function(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 n=this.getObjectClassName(e);return(n&&"Object"!==n?"'"+n+"'":"Object")+" captured as exception with keys: "+tC(e)}},{key:"isSeverityLevel",value:function(e){return ee(e)&&!et(e)&&tT.indexOf(e)>=0}},{key:"getErrorPropertyFromObject",value:function(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var n=e[t];if((0,i._)(n,Error))return n}}},{key:"getObjectClassName",value:function(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}]),e}(),tR=function(){function e(){(0,o._)(this,e)}return(0,a._)(e,[{key:"match",value:function(e){return el(e)}},{key:"coerce",value:function(e,t){var n,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+tC(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}}}]),e}(),tA=function(){function e(){(0,o._)(this,e)}return(0,a._)(e,[{key:"match",value:function(e){return ea(e)}},{key:"coerce",value:function(e,t){var n;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}}}]),e}(),tL=function(){function e(){(0,o._)(this,e)}return(0,a._)(e,[{key:"match",value:function(e){return eu(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}},{key:"isCustomEventWrappingRejection",value:function(e){if(!el(e))return!1;try{var t=e.detail;return null!=t&&"object"==(void 0===t?"undefined":(0,r._)(t))&&"reason"in t}catch(e){return!1}}},{key:"coerce",value:function(e,t){var n,i=this.getUnhandledRejectionReason(e);return ea(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}:t.apply(i)}},{key:"getUnhandledRejectionReason",value:function(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==(0,r._)(e.detail)&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}]),e}(),tq="$message",tD="$timestamp",tN=new Set([tq,tD]),tj={enabled:!0,max_bytes:32768};function tH(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tj.enabled,max_bytes:function(e,t){if(!er(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}(e.max_bytes,tj.max_bytes)}:$({},tj)}var tz=function(){function e(t){(0,o._)(this,e),this.Yt=[],this.Xt=0,this.qt=tH(t)}return(0,a._)(e,[{key:"setConfig",value:function(e){this.qt=tH(e),this.er()}},{key:"add",value:function(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,function(e,n){if("bigint"==(void 0===n?"undefined":(0,r._)(n)))return n.toString();if("function"!=typeof n&&"symbol"!=(void 0===n?"undefined":(0,r._)(n))){if((0,i._)(n,Date))return n.toISOString();if((0,i._)(n,Error))return{name:n.name,message:n.message,stack:n.stack};if(n&&"object"==(void 0===n?"undefined":(0,r._)(n))){if(t.has(n))return"[Circular]";t.add(n)}return n}})}catch(e){return}}(e);if(t)try{var n=JSON.parse(t);if(!X(n))return;var s=n[tq],o=n[tD];if(!ee(s)||0===s.trim().length||!ee(o)&&!er(o))return;return{step:n,json:t}}catch(e){return}}(e);if(t){var n=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),n=0,i=0;t.length>i;i++)"%"===t[i]?(n+=1,i+=2):n+=1;return n}(t.json);n>this.qt.max_bytes||(this.Yt.push({step:t.step,bytes:n}),this.Xt+=n,this.er())}}},{key:"getAttachable",value:function(){return this.Yt.map(function(e){return e.step})}},{key:"clear",value:function(){this.Yt=[],this.Xt=0}},{key:"size",value:function(){return this.Yt.length}},{key:"er",value:function(){for(;this.Xt>this.qt.max_bytes&&this.Yt.length>0;){var e=this.Yt.shift();e&&(this.Xt-=e.bytes)}}}]),e}(),tU=function(e,t){var n=(void 0===t?{}:t).debugEnabled,i={k:function(t){if(f&&(S.DEBUG||w.POSTHOG_DEBUG||n)&&!Q(f.console)&&f.console){for(var i=("__rrweb_original__"in f.console[t])?f.console[t].__rrweb_original__:f.console[t],r=arguments.length,s=Array(r>1?r-1:0),o=1;r>o;o++)s[o-1]=arguments[o];i.apply(void 0,[e].concat((0,h._)(s)))}},debug:function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k.apply(i,["debug"].concat((0,h._)(t)))},info:function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k.apply(i,["log"].concat((0,h._)(t)))},warn:function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k.apply(i,["warn"].concat((0,h._)(t)))},error:function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k.apply(i,["error"].concat((0,h._)(t)))},critical:function(){for(var t,n=arguments.length,i=Array(n),r=0;n>r;r++)i[r]=arguments[r];(t=console).error.apply(t,[e].concat((0,h._)(i)))},uninitializedWarning:function(e){i.error("You must initialize PostHog before calling "+e)},createLogger:function(t,n){return tU(e+" "+t,n)}};return i},tG=tU("[PostHog.js]"),tB=tG.createLogger,tW=tB("[ExternalScriptsLoader]"),tV=function(e,t,n){if(e.config.disable_external_dependency_loading)return tW.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var i=null==_?void 0:_.querySelectorAll("script");
1if(i){for(var r,s=0;i.length>s;s++)if(r=function(){if(i[s].src===t){var e=i[s];return e.__posthog_loading_callback_fired?{v:n()}:(e.addEventListener("load",function(t){e.__posthog_loading_callback_fired=!0,n(void 0,t)}),e.onerror=function(e){return n(e)},{v:void 0})}}())return r.v}var o=function(){if(!_)return n("document not found");var i=_.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=t,i.onload=function(e){i.__posthog_loading_callback_fired=!0,n(void 0,e)},i.onerror=function(e){return n(e)},e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)_.head.appendChild(i);else{var r,s=_.querySelectorAll("body > script");s.length>0?null==(r=s[0].parentNode)||r.insertBefore(i,s[0]):_.body.appendChild(i)}};null!=_&&_.body?o():null==_||_.addEventListener("DOMContentLoaded",o)};w.__PosthogExtensions__=w.__PosthogExtensions__||{},w.__PosthogExtensions__.loadExternalDependency=function(e,t,n){if("remote-config"!==t){var i;if(e.config.strict_script_versioning)i=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var r="/static/"+t+".js?v="+e.version;"toolbar"===t&&(r=r+"&t="+3e5*Math.floor(Date.now()/3e5)),i=e.requestRouter.endpointFor("assets",r)}tV(e,i,n)}else{var s=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");tV(e,s,n)}},w.__PosthogExtensions__.loadSiteApp=function(e,t,n){var i=e.requestRouter.endpointFor("api",t);tV(e,i,n)};var tK="$people_distinct_id",tY="$device_id",tJ="__alias",tX="__timers",tZ="$autocapture_disabled_server_side",tQ="$heatmaps_enabled_server_side",t0="$exception_capture_enabled_server_side",t1="$error_tracking_suppression_rules",t2="$error_tracking_capture_extension_exceptions",t3="$web_vitals_enabled_server_side",t5="$dead_clicks_enabled_server_side",t8="$product_tours_enabled_server_side",t6="$web_vitals_allowed_metrics",t4="$session_recording_remote_config",t7="$replay_sample_rate",t9="$replay_override_sampling",ne="$replay_override_linked_flag",nt="$replay_override_url_trigger",nn="$replay_override_event_trigger",ni="$sesid",nr="$session_is_sampled",ns="$enabled_feature_flags",no="$active_feature_flags",na="$early_access_features",nu="$feature_flag_details",nl="$feature_flag_payloads",nc="$feature_flag_request_id",nh="$override_feature_flags",nd="$override_feature_flag_payloads",nf="$stored_person_properties",nv="$stored_group_properties",np="$surveys",n_="$surveys_loaded_at",ng="$surveys_activated",ny="ph_product_tours",nm="$flag_call_reported",nk="$flag_call_reported_session_id",nb="$feature_flag_errors",nx="$feature_flag_evaluated_at",nw="$user_state",nE="$client_session_props",nS="$capture_rate_limit",nP="$initial_campaign_params",nF="$initial_referrer_info",n$="$initial_person_info",nI="$epp",nO="__POSTHOG_TOOLBAR__",nT="$posthog_cookieless",nC="$sdk_debug_extensions_init_method",nM="$sdk_debug_extensions_init_time_ms",nR="$sdk_debug_recording_script_not_loaded",nA="PostHog loadExternalDependency extension not found.",nL="on_reject",nq="always",nD="anonymous",nN="identified",nj="identified_only",nH="visibilitychange",nz="beforeunload",nU="$pageview",nG="$pageleave",nB="$identify",nW="$groupidentify";function nV(e,t){Y(e)&&e.forEach(t)}function nK(e,t){if(!ei(e))if(Y(e))e.forEach(t);else if((0,i._)(e,FormData))e.forEach(function(e,n){return t(e,n)});else for(var n in e)V.call(e,n)&&t(e[n],n)}var nY=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];var r=!0,s=!1,o=void 0;try{for(var a,u=n[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var l=a.value;for(var c in l)void 0!==l[c]&&(e[c]=l[c])}}catch(e){s=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(s)throw o}}return e};function nJ(e){for(var t=Object.keys(e),n=t.length,i=Array(n);n--;)i[n]=[t[n],e[t[n]]];return i}var nX=function(e){try{return e()}catch(e){return}},nZ=function(e){return function(){try{for(var t=arguments.length,n=Array(t),i=0;t>i;i++)n[i]=arguments[i];return e.apply(this,n)}catch(e){tG.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),tG.critical(e)}}},nQ=function(e){var t={};return nK(e,function(e,n){(ee(e)&&e.length>0||er(e))&&(t[n]=e)}),t},n0=["herokuapp.com","vercel.app","netlify.app"];function n1(e,t,n,i){var r=null!=i?i:{},s=r.capture,o=r.passive;null==e||e.addEventListener(t,n,{capture:void 0!==s&&s,passive:void 0===o||o})}function n2(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 er(e)&&isFinite(e)&&Math.floor(e)===e});var n3,n5=function(){function e(t){if((0,o._)(this,e),this.bytes=t,16!==t.length)throw TypeError("not 128-bit length")}return(0,a._)(e,[{key:"toString",value:function(){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 Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,i,r){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>n||0>i||0>r||t>0xffffffffffff||n>4095||i>0x3fffffff||r>0xffffffff)throw RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/0x10000000000,s[1]=t/0x100000000,s[2]=t/0x1000000,s[3]=t/65536,s[4]=t/256,s[5]=t,s[6]=112|n>>>8,s[7]=n,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 e(s)}}]),e}(),n8=function(){function e(){(0,o._)(this,e),this.S=0,this.C=0,this.I=new n4}return(0,a._)(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(Q(e)){this.S=0;var t=this.generateOrAbort();if(Q(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.S)this.S=e,this.T();else{if(this.S>=e+1e4)return;this.C++,this.C>0x3ffffffffff&&(this.S++,this.T())}return n5.fromFieldsV7(this.S,Math.trunc(this.C/0x40000000),0x3fffffff&this.C,this.I.nextUint32())}},{key:"T",value:function(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}]),e}(),n6=function(e){if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};f&&!Q(f.crypto)&&crypto.getRandomValues&&(n6=function(e){return crypto.getRandomValues(e)});var n4=function(){function e(){(0,o._)(this,e),this.M=new Uint32Array(8),this.R=1/0}return(0,a._)(e,[{key:"nextUint32",value:function(){return this.M.length>this.R||(n6(this.M),this.R=0),this.M[this.R++]}}]),e}(),n7=function(){return n9().toString()},n9=function(){return(n3||(n3=new n8)).generate()},ie="",it=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,ii={O:function(){return!!_},D:function(e){tG.error("cookieStore error: "+e)},A:function(e){if(_){try{for(var t=e+"=",n=_.cookie.split(";").filter(function(e){return e.length}),i=0;n.length>i;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},F:function(e){var t;try{t=JSON.parse(ii.A(e))||{}}catch(e){}return t},N:function(e,t,n,i,r){if(!_)return!1;try{var s="",o="",a=function(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=_),ie)return ie;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),i=Math.min(n.length,8),r="dmn_chk_"+n7();!ie&&i--;){var s=n.slice(i).join("."),o=r+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",ie=s)}return ie}(e);if(!n){var i,r=(i=e.match(it))?i[0]:"";r!==n&&tG.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}(_.location.hostname,i);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),s="; expires="+u.toUTCString()}r&&(o="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&tG.warn("cookieStore warning: large cookie, len="+l.length),_.cookie=l,!0}catch(e){return!1}}
1,q:function(e,t){if(null!=_&&_.cookie)try{ii.N(e,"",-1,t)}catch(e){return}}},ir=null,is={O:function(){if(!en(ir))return ir;var e=!0;if(Q(f))e=!1;else try{var t="__mplssupport__";is.N(t,"xyz"),'"xyz"'!==is.A(t)&&(e=!1),is.q(t)}catch(t){e=!1}return e||tG.error("localStorage unsupported; falling back to cookie store"),ir=e,e},D:function(e){tG.error("localStorage error: "+e)},A:function(e){try{return null==f?void 0:f.localStorage.getItem(e)}catch(e){is.D(e)}return null},F:function(e){try{return JSON.parse(is.A(e))||{}}catch(e){}return null},N:function(e,t){try{return null==f||f.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){is.D(e)}return!1},q:function(e){try{null==f||f.localStorage.removeItem(e)}catch(e){is.D(e)}}},io=[tY,"distinct_id",ni,nr,nI,n$,nw],ia={},iu={O:function(){return!0},D:function(e){tG.error("memoryStorage error: "+e)},A:function(e){return ia[e]||null},F:function(e){return ia[e]||null},N:function(e,t){return ia[e]=t,!0},q:function(e){delete ia[e]}},il=null,ic={O:function(){if(!en(il))return il;if(il=!0,Q(f))il=!1;else try{var e="__support__";ic.N(e,"xyz"),'"xyz"'!==ic.A(e)&&(il=!1),ic.q(e)}catch(e){il=!1}return il},D:function(e){tG.error("sessionStorage error: ",e)},A:function(e){try{return null==f?void 0:f.sessionStorage.getItem(e)}catch(e){ic.D(e)}return null},F:function(e){try{return JSON.parse(ic.A(e))||null}catch(e){}return null},N:function(e,t){try{return null==f||f.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){ic.D(e)}return!1},q:function(e){try{null==f||f.sessionStorage.removeItem(e)}catch(e){ic.D(e)}}},ih=function(){function e(t){(0,o._)(this,e),this._instance=t}return(0,a._)(e,[{key:"qt",get:function(){return this._instance.config}},{key:"consent",get:function(){return this.rr()?0:this.ir}},{key:"isOptedOut",value:function(){return this.qt.cookieless_mode===nq||this.isRejected()||-1===this.consent&&this.qt.cookieless_mode===nL}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"isExplicitlyOptedOut",value:function(){return 0===this.consent}},{key:"isRejected",value:function(){return 0===this.consent||-1===this.consent&&this.qt.opt_out_capturing_by_default}},{key:"optInOut",value:function(e){this.nr.N(this.sr,+!!e,this.qt.cookie_expiration,this.qt.cross_subdomain_cookie,this.qt.secure_cookie)}},{key:"reset",value:function(){this.nr.q(this.sr,this.qt.cross_subdomain_cookie)}},{key:"sr",get:function(){var e=this._instance.config,t=e.token,n=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(n?n+t:"__ph_opt_in_out_"+t)}},{key:"ir",get:function(){var e=this.nr.A(this.sr);return eh(e)?1:U(ed,e)?0:-1}},{key:"nr",get:function(){var e=this.qt.opt_out_capturing_persistence_type,t="localStorage"===e?is:ii;if(!this.ar||this.ar!==t){this.ar=t;var n="localStorage"===e?ii:is;n.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(eh(n.A(this.sr))),n.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}},{key:"rr",value:function(){return!!this.qt.respect_dnt&&[null==p?void 0:p.doNotTrack,null==p?void 0:p.msDoNotTrack,w.doNotTrack].some(function(e){return eh(e)})}}]),e}();function id(e){return(0,i._)(e,Element)&&(e.id===nO||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function iv(e){return!!e&&1===e.nodeType}function ip(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function i_(e){return!!e&&3===e.nodeType}function ig(e){return!!e&&11===e.nodeType&&iv(e.host)}function iy(e){return e?G(e).split(/\s+/):[]}function im(e){var t=null==f?void 0:f.location.href;return!!(t&&e&&e.some(function(e){return t.match(e)}))}function ik(e){var t="";switch((0,r._)(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 iy(t)}function ib(e){return ei(e)?null:G(e).split(/(\s+)/).filter(function(e){return iU(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ix(e){var t="";return iA(e)&&!iL(e)&&e.childNodes&&e.childNodes.length&&nK(e.childNodes,function(e){var n;i_(e)&&e.textContent&&(t+=null!=(n=ib(e.textContent))?n:"")}),G(t)}function iw(e){var t;return Q(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var iE=["a","button","form","input","select","textarea","label"];function iS(e,t){if(Q(t))return!0;var n,i=function(e){if(t.some(function(t){return e.matches(t)}))return{v:!0}},r=!0,s=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var l=a.value;if(n=i(l))return n.v}}catch(e){s=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(s)throw o}}return!1}function iP(e){var t=e.parentNode;return!(!t||!iv(t))&&t}var iF=["next","previous","prev",">","<"],i$=(0,h._)(iF).concat(["+","-","−","–"]),iI=function(e,t){return/[a-z0-9]/i.test(t)?e.includes(t):e===t},iO=[".ph-no-rageclick",".ph-no-capture"],iT=["","text","search","email","password","url","tel","number"];function iC(e,t){if(!f||iM(e)||(eo(t)?(i=!!t&&iO,r=void 0,s=!1):(i=null!=(o=null==t?void 0:t.css_selector_ignorelist)?o:iO,r=null==t?void 0:t.content_ignorelist,s=null!=(a=null==t?void 0:t.ignore_text_selection)&&a),!1===i)||s&&!(!(n=e)||!iv(n))&&(ip(n,"textarea")||(ip(n,"input")?U(iT,(n.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}
1(n))))return!1;var n,i,r,s,o,a,u=iR(e,!1).targetElementList;return!function(e,t){var n;if(!1===e||Q(e))return!1;if(!0===e)n=iF;else{if(!Y(e))return!1;if(e.length>10)return tG.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;n=e.map(function(e){return e.toLowerCase()})}return t.some(function(e){var t=e.safeText,i=e.ariaLabel;return n.some(function(e){return iI(t,e)||iI(i,e)})})}(r,u.map(function(e){var t;return{safeText:ix(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!iS(u,i)}var iM=function(e){return!e||ip(e,"html")||!iv(e)},iR=function(e,t){if(!f||iM(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,i=[e],r=e;r.parentNode&&!ip(r,"body");)if(ig(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var s=iP(r);if(!s)break;if(t||iE.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var o=f.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(n=!0)}i.push(s),r=s}return{parentIsUsefulElement:n,targetElementList:i}};function iA(e){for(var t=e;t.parentNode&&!ip(t,"body");t=t.parentNode){var n=ik(t);if(U(n,"ph-sensitive")||U(n,"ph-no-capture"))return!1}if(U(ik(e),"ph-include"))return!0;var i=e.type||"";if(ee(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";return!ee(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function iL(e){return!!(ip(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ip(e,"select")||ip(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var iq="(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})",iD=RegExp("^(?:"+iq+")$"),iN=new RegExp(iq),ij="\\d{3}-?\\d{2}-?\\d{4}",iH=RegExp("^("+ij+")$"),iz=RegExp("("+ij+")");function iU(e,t){return void 0===t&&(t=!0),!(ei(e)||ee(e)&&(e=G(e),(t?iD:iN).test((e||"").replace(/[- ]/g,""))||(t?iH:iz).test(e)))&&!0}function iG(e){var t=ix(e);return iU(t=(t+" "+function e(t){var n="";return t&&t.childNodes&&t.childNodes.length&&nK(t.childNodes,function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=ix(t);n=(n+" "+r).trim(),t.childNodes&&t.childNodes.length&&(n=(n+" "+e(t)).trim())}catch(e){tG.error("[AutoCapture]",e)}}),n}(e)).trim())?t:""}function iB(e){return e.replace(/"|\\"/g,'\\"')}var iW=tB("[Dead Clicks]"),iV=function(){return!0},iK=function(e){var t,n=!(null==(t=e.instance.persistence)||!t.get_property(t5)),i=e.instance.config.capture_dead_clicks;return eo(i)?i:!!X(i)||n},iY=function(){function e(t,n,i){(0,o._)(this,e),this.instance=t,this.isEnabled=n,this.onCapture=i,this.startIfEnabledOrStop()}return(0,a._)(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this.lr}},{key:"onRemoteConfig",value:function(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register((0,u._)({},t5,e.captureDeadClicks)),this.startIfEnabledOrStop())}},{key:"startIfEnabledOrStop",value:function(){var e=this;this.isEnabled(this)?this.ur(function(){e.hr()}):this.stop()}},{key:"ur",value:function(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",function(t){t?iW.error("failed to load script",t):e()})}},{key:"hr",value:function(){var e;if(_){if(!this.lr&&null!=(e=w.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=X(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.lr=w.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.lr.start(_),iW.info("starting...")}}else iW.error("`document` not found. Cannot start.")}},{key:"stop",value:function(){this.lr&&(this.lr.stop(),this.lr=void 0,iW.info("stopping..."))}}]),e}(),iJ=tB("[SegmentIntegration]"),iX="posthog-js";function iZ(e,t){var n=void 0===t?{}:t,i=n.organization,r=n.projectId,s=n.prefix,o=n.severityAllowList,a=void 0===o?["error"]:o,u=n.sendExceptionsToPostHog,l=void 0===u||u;return function(t){if("*"!==a&&!a.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var n=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/pers
1on/"+e.get_distinct_id());t.tags["PostHog Person URL"]=n,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var o,u,c,h,d,f,v=(null==(o=t.exception)?void 0:o.values)||[],p=v.map(function(e){return $({},e,{stacktrace:e.stacktrace?$({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(function(e){return $({},e,{platform:"web:javascript"})})}):void 0})}),_={$exception_message:(null==(u=v[0])?void 0:u.value)||t.message,$exception_type:null==(c=v[0])?void 0:c.type,$exception_level:t.level,$exception_list:p,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(h=v[0])?void 0:h.value)||t.message,$sentry_exception_type:null==(d=v[0])?void 0:d.type,$sentry_tags:t.tags};return i&&r&&(_.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+t.event_id),l&&(null==(f=e.exceptions)||f.sendExceptionEvent(_)),t}}var iQ=function e(t,n,i,r,s,a){(0,o._)(this,e),this.name=iX,this.setupOnce=function(e){e(iZ(t,{organization:n,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==a||a}))}},i0=function(){function e(t){var n=this;(0,o._)(this,e),this.cr=function(e,t,i){i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(tG.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),n.dr=void 0,n._instance.scrollManager.resetContext())},this._instance=t,this.vr()}return(0,a._)(e,[{key:"vr",value:function(){var e;this.pr=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.cr)}},{key:"destroy",value:function(){var e;null==(e=this.pr)||e.call(this),this.pr=void 0}},{key:"doPageView",value:function(e,t){var n,i=this.gr(e,t);return this.dr={pathname:null!=(n=null==f?void 0:f.location.pathname)?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}},{key:"doPageLeave",value:function(e){var t;return this.gr(e,null==(t=this.dr)?void 0:t.pageViewId)}},{key:"doEvent",value:function(){var e;return{$pageview_id:null==(e=this.dr)?void 0:e.pageViewId}}},{key:"gr",value:function(e,t){var n=this.dr;if(!n)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:n.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var s=r.maxScrollHeight,o=r.lastScrollY,a=r.maxScrollY,u=r.maxContentHeight,l=r.lastContentY,c=r.maxContentY;if(!(Q(s)||Q(o)||Q(a)||Q(u)||Q(l)||Q(c))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),c=Math.ceil(c);var h=s>1?ef(o/s,0,1,tG):1,d=s>1?ef(a/s,0,1,tG):1,f=u>1?ef(l/u,0,1,tG):1,v=u>1?ef(c/u,0,1,tG):1;i=nY(i,{$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:l,$prev_pageview_last_content_percentage:f,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:v})}}return n.pathname&&(i.$prev_pageview_pathname=n.pathname),n.timestamp&&(i.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),i}}]),e}(),i1=["flags","surveys"],i2=(sx={},(0,u._)(sx,tK,{exposure:"hidden"}),(0,u._)(sx,tJ,{exposure:"hidden"}),(0,u._)(sx,"__cmpns",{exposure:"hidden"}),(0,u._)(sx,tX,{exposure:"hidden"}),(0,u._)(sx,tZ,{exposure:"event"}),(0,u._)(sx,tQ,{exposure:"hidden"}),(0,u._)(sx,t0,{exposure:"event"}),(0,u._)(sx,t1,{exposure:"hidden"}),(0,u._)(sx,t2,{exposure:"event"}),(0,u._)(sx,t3,{exposure:"event"}),(0,u._)(sx,t5,{exposure:"event"}),(0,u._)(sx,t8,{exposure:"hidden"}),(0,u._)(sx,t6,{exposure:"event"}),(0,u._)(sx,t4,{exposure:"hidden"}),(0,u._)(sx,"$session_recording_enabled_server_side",{exposure:"hidden"}),(0,u._)(sx,ni,{exposure:"hidden"}),(0,u._)(sx,nr,{exposure:"event"}),(0,u._)(sx,t7,{exposure:"event",shouldSkipFromEventProperties:function(e){return en(e)}}),(0,u._)(sx,"$session_past_minimum_duration",{exposure:"event"}),(0,u._)(sx,"$session_recording_url_trigger_activated_session",{exposure:"event"}),(0,u._)(sx,"$session_recording_event_trigger_activated_session",{exposure:"event"}),(0,u._)(sx,"$debug_first_full_snapshot_timestamp",{exposure:"event"}),(0,u._)(sx,ns,{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:function(e,t){return t()},transformToEventProperties:function(e){if(!X(e))return{};for(var t={},n=Object.keys(e),i=0;n.length>i;i++)t["$feature/"+n[i]]=e[n[i]];return t}}),(0,u._)(sx,no,{exposure:"event",storageGroup:"flags"}),(0,u._)(sx,na,{exposure:"hidden"}),(0,u._)(sx,nu,{exposure:"hidden",storageGroup:"flags"}),(0,u._)(sx,nl,{exposure:"event",storageGroup:"flags"}),(0,u._)(sx,nc,{exposure:"event",storageGroup:"flags",volatile:!0}),(0,u._)(sx,nh,{exposure:"event"}),(0,u._)(sx,nd,{exposure:"hidden"}),(0,u._)(sx,nf,{exposure:"hidden"}),(0,u._)(sx,nv,{exposure:"hidden"}),(0,u._)(sx,np,{exposure:"hidden",storageGroup:"surveys"}),(0,u._)(sx,n_,{exposure:"hidden",storageGroup:"surveys",volatile:!0}),(0,u._)(sx,ng,{exposure:"event"}),(0,u._)(sx,ny,{exposure:"hidden"}),(0,u._)(sx,"$product_tours_activated",{exposure:"hidden"}),(0,u._)(sx,"$conversations_widget_session_id",{exposure:"event"}),(0,u._)(sx,"$conversations_ticket_id",{exposure:"event"}),(0,u._)(sx,"$conversations_widget_state",{exposure:"event"}),(0,u._)(sx,"$conversations_user_traits",{exposure:"event"}),(0,u._)(sx,nm,{exposure:"hidden"}),(0,u._)(sx,nk,{exposure:"hidden"}),(0,u._)(sx,nb,{exposure:"hidden"}),(0,u._)(sx,nx,{exposure:"hidden",storageGroup:"flags",volatile:!0}),(0,u._)(sx,nw,{exposure:"hidden"}),(0,u._)(sx,nE,{exposure:"hidden"}),(0,u._)(sx,nS,{exposure:"hidden"}),(0,u._)(sx,nP,{exposure:"hidden"}),(0,u._)(sx,nF,{exposure:"hidden"}),(0,u._)(sx,n$,{exposure:"hidden"}),(0,u._)(sx,nI,{exposure:"hidden"}),(0,u._)(sx,t9,{exposure:"event"}),(0,u._)(sx,ne,{exposure:"event"}),(0,u._)(sx,nt,{exposure:"event"}),(0,u._)(sx,nn,{exposure:"event"}),(0,u._)(sx,nC,{exposure:"event"}),(0,u._)(sx,nM,{exposure:"event"}),(0,u._)(sx,nR,{exposure:"event"}),(0,u._)(sx,"$sdk_debug_replay_event_trigger_status",{exposure:"event"}),(0,u._)(sx,"$sdk_debug_replay_linked_flag_trigger_status",{exposure:"event"}),(0,u._)(sx,"$sdk_debug_replay_matched_recording_trigger_groups",{exposure:"event"}),(0,u._)(sx,"$sdk_debug_replay_remote_trigger_matching_config",{exposure:"event"}),(0,u._)(sx,"$sdk_debug_replay_trigger_groups_count",{exposure:"event"}),(0,u._)(sx,"$sdk_debug_replay_url_trigger_status",{exposure:"event"}),(0,u._)(sx,"$session_recording_start_reason",{exposure:"event"}),sx),i3=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],i5=function(e){var t=i2[e];if(t)return t;var n=!0,i=!1,r=void 0;try{for(var s,o=i3[Symbol.iterator]();!(n=(s=o.next()).done);
1n=!0){var a=(0,c._)(s.value,2),u=a[0],l=a[1];if(0===e.indexOf(u))return l}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}},i8=function(e){var t=null==_?void 0:_.createElement("a");return Q(t)?null:(t.href=e,t)},i6=function(e,t){for(var n,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;i.length>r;r++){var s=i[r].split("=");if(s[0]===t){n=s;break}}if(!Y(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch(e){tG.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},i4=function(e,t,n){if(!e||!t||!t.length)return e;for(var i=e.split("#"),r=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],u=(o||"").split("&"),l=[],c=0;u.length>c;c++){var h=u[c].split("=");Y(h)&&(t.includes(h[0])?l.push(h[0]+"="+n):l.push(u[c]))}var d=a;return null!=o&&(d+="?"+l.join("&")),null!=r&&(d+="#"+r),d},i7=function(e,t){var n=e.match(RegExp(t+"=([^&]*)"));return n?n[1]:null},i9="https?://(.*)",re=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rt=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"].concat((0,h._)(re)),rn="<masked>",ri=["li_fat_id"];function rr(e,t,n){if(!_)return{};var i,r=t?(0,h._)(re).concat((0,h._)(n||[])):[],s=rs(i4(_.URL,r,rn),e);return nY((i={},nK(ri,function(e){var t=ii.A(e);i[e]=t||null}),i),s)}function rs(e,t){var n=rt.concat(t||[]),i={};return nK(n,function(t){var n=i6(e,t);i[t]=n||null}),i}function ro(e){var t=e?0===e.search(i9+"google.([^/?]*)")?"google":0===e.search(i9+"bing.com")?"bing":0===e.search(i9+"yahoo.com")?"yahoo":0===e.search(i9+"duckduckgo.com")?"duckduckgo":null:null,n={};if(!en(t)){n.$search_engine=t;var i=_?i6(_.referrer,"yahoo"!=t?"q":"p"):"";i.length&&(n.ph_keyword=i)}return n}function ra(){return navigator.language||navigator.userLanguage}var ru="$direct";function rl(){return(null==_?void 0:_.referrer)||ru}function rc(e,t){var n=e?(0,h._)(re).concat((0,h._)(t||[])):[],i=null==g?void 0:g.href.substring(0,1e3);return{r:rl().substring(0,1e3),u:i?i4(i,n,rn):void 0}}function rh(e){var t,n=e.r,i=e.u,r={$referrer:n,$referring_domain:null==n?void 0:n==ru?ru:null==(t=i8(n))?void 0:t.host};if(i){r.$current_url=i;var s=i8(i);r.$host=null==s?void 0:s.host,r.$pathname=null==s?void 0:s.pathname,nY(r,rs(i))}return n&&nY(r,ro(n)),r}function rd(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rf={flags:nx,surveys:n_},rv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],rp="main",r_=function(){function e(t,n,i){var r,s=this;if((0,o._)(this,e),void 0===i&&(i=!0),this.mr={},this.yr=!1,this.br=!1,this.qt=t,this._r=i,this.props={},this.wr=!1,this.kr=(r="",t.token&&(r=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+r+"_posthog"),this.nr=this.Sr(t),this.br=this.Cr(t),this.load(),t.debug&&tG.info("Persistence loaded",t.persistence,$({},this.props)),this.update_config(t,t,n),this.save(),f){var a=function(){return s.flush()};n1(f,"beforeunload",a,{capture:!1}),n1(f,"pagehide",a,{capture:!1})}}return(0,a._)(e,[{key:"Ir",value:function(){var e,t=null==(e=this.qt)?void 0:e.persistence_save_debounce_ms;return er(t)&&t>0?t:0}},{key:"isDisabled",value:function(){return!!this.Tr}},{key:"Sr",value:function(e){-1===rv.indexOf(e.persistence.toLowerCase())&&(tG.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,n,i,r,s=(t=e.cookie_persisted_properties||[],n=e.__preview_cookie_wins_on_conflict||!1,void 0===t&&(t=[]),void 0===n&&(n=!1),i=(0,h._)(io).concat((0,h._)(t)),$({},is,{F:function(e){try{var t={};try{t=ii.F(e)||{}}catch(e){}var i,r=JSON.parse(is.A(e)||"{}");if(n){var s={};for(var o in t){var a=t[o];en(a)||""===a||(s[o]=a)}i=nY(r,s)}else i=nY(t,r);return is.N(e,i),i}catch(e){}return null},N:function(e,t,n,r,s,o){var a=is.N(e,t,void 0,void 0,o);try{var u={};i.forEach(function(e){t[e]&&(u[e]=t[e])}),Object.keys(u).length&&ii.N(e,u,n,r,s,o)}catch(e){is.D(e)}return a},q:function(e,t){try{null==f||f.localStorage.removeItem(e),ii.q(e,t)}catch(e){is.D(e)}}})),o=!1,a=e.persistence.toLowerCase();return"localstorage"===a&&is.O()?(r=is,o=!0):"localstorage+cookie"===a&&s.O()?(r=s,o=!0):"sessionstorage"===a&&ic.O()?r=ic:"memory"===a?r=iu:"cookie"===a?r=ii:s.O()?(r=s,o=!0):r=ii,this.yr=o,r}},{key:"Er",value:function(e){return this.kr+"__"+e}},{key:"Cr",value:function(e){return this.yr&&!!e.split_storage}},{key:"Mr",value:function(e){var t=null!=e?e:this.qt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var n=this.props[nx];return!n||"number"!=typeof n||Date.now()-n>t}},{key:"properties",value:function(){var e=this,t={};return nK(this.props,function(n,i){var r=i5(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(n,i===ns?function(){return e.Mr()}:function(){return!1}))return;r.transformToEventProperties&&nY(t,r.transformToEventProperties(n))}else if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(n,function(){return!1}))return;t[i]=n}}),t}},{key:"load",value:function(){if(!this.Tr){var e=this.nr.F(this.kr);e&&(this.props=nY({},e)),this.br&&this.Rr()}}},{key:"Rr",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=i1[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var s=i.value,o=is.F(this.Er(s));if(o&&!Z(o)){var a=this.Pr(s);a.persisted=!0,this.Or(s)||(a.fingerprint=this.Lr(o,s)),this.Ar(s,o)||nY(this.props,o)}}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}}},{key:"Or",value:function(e){return Object.keys(this.props).some(function(t){var n;return(null==(n=i5(t))?void 0:n.storageGroup)===e})}},{key:"Ar",value:function(e,t){var n=rf[e];if(!n)return!1;var i=t[n],r=this.props[n];return er(i)&&er(r)&&r>i}},{key:"refreshKey",value:function(e){var t;if(!this.Tr){var n=this.br?null==(t=i5(e))?void 0:t.storageGroup:void 0,i=n?is.F(this.Er(n)):this.nr.F(this.kr);if(i&&e in i)this.Fr(e,i[e]);else{if(n){var r=this.nr.F(this.kr);if(r&&e in r)return void this.Fr(e,r[e])}this.Nr(e)}}}},{key:"save",value:function(){var e=this;if(!this.Tr){var t=this.Ir();t>0?Q(this.Dr)&&(this.Dr=setTimeout(function(){e.Dr=void 0,e.$r()},t)):this.$r()}}},{key:"flush",value:function(){Q(this.Dr)||(clearTimeout(this.Dr),this.Dr=void 0,this.$r())}},{key:"$r",value:function(){this.Tr||(this.br?this.qr():this.jr(this.nr,this.kr,this.props,rp))}},{key:"qr",value:function(){var e=this.Br(),t=e.main,n=e.groups,i=!0,r=!1,s=void 0;try{for(var o,a=(this.jr(this.nr,this.kr,t,rp),i1)[Symbol.iterator]();!(i=(o=a.next()).done);i=!0){var u,l=o.value,c=n[l];(!Z(c)||null!=(u=this.mr[l])&&u.persisted)&&this.jr(is,this.Er(l),c,l)}}catch(e){r=!0,s=e}finally{try{i||null==a.return||a.return()}finally{if(r)throw s}}}},{key:"Br",value:function(){var e={},t={},n=!0,i=!1,r=void 0;try{for(var s,o=i1[Symbol.iterator]();!(n=(s=o.next()).done);
1n=!0)t[s.value]={}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return nK(this.props,function(n,i){var r,s=null==(r=i5(i))?void 0:r.storageGroup;s?t[s][i]=n:e[i]=n}),{main:e,groups:t}}},{key:"Lr",value:function(e,t){if(t===rp)return JSON.stringify(e)+"|"+this.Hr+"|"+this.Ur+"|"+this.zr;var n={};return nK(e,function(e,t){var i;n[t]=null!=(i=i5(t))&&i.volatile?"__volatile__":e}),JSON.stringify(n)}},{key:"jr",value:function(e,t,n,i){var r,s=this.Pr(i);if(i===rp||s.dirty||Q(s.fingerprint)){try{if((r=this.Lr(n,i))===s.fingerprint)return void(s.dirty=!1)}catch(e){r=void 0}e.N(t,n,this.Hr,this.Ur,this.zr,this.qt.debug)?(s.dirty=!1,i!==rp&&(s.persisted=!0),Q(r)||(s.fingerprint=r)):this.qt.debug&&tG.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}},{key:"remove",value:function(e){var t=(void 0===e?{}:e).keepGroupEntries,n=void 0!==t&&t,i=!0,r=!1,s=void 0;if(Q(this.Dr)||(clearTimeout(this.Dr),this.Dr=void 0),this.nr.q(this.kr,!1),this.nr.q(this.kr,!0),!n&&this._r)try{for(var o,a=i1[Symbol.iterator]();!(i=(o=a.next()).done);i=!0){var u=o.value;is.q(this.Er(u))}}catch(e){r=!0,s=e}finally{try{i||null==a.return||a.return()}finally{if(r)throw s}}n?delete this.mr[rp]:this.mr={}}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var i=this;if(X(e)){Q(t)&&(t="None"),this.Hr=Q(n)?this.Vr:n;var r=!1;if(nK(e,function(e,n){i.props.hasOwnProperty(n)&&i.props[n]!==t||(i.Fr(n,e),r=!0)}),r)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(X(e)){this.Hr=Q(t)?this.Vr:t;var i=!1;if(nK(e,function(t,r){e.hasOwnProperty(r)&&n.props[r]!==t&&(n.Fr(r,t),i=!0)}),i)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(this.Nr(e),this.save())}},{key:"update_campaign_params",value:function(){if(!this.wr){var e=rr(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);Z(nQ(e))||this.register(e),this.wr=!0}}},{key:"update_search_keyword",value:function(){var e;this.register((e=null==_?void 0:_.referrer)?ro(e):{})}},{key:"update_referrer_info",value:function(){var e;this.register_once({$referrer:rl(),$referring_domain:null!=_&&_.referrer&&(null==(e=i8(_.referrer))?void 0:e.host)||ru},void 0)}},{key:"set_initial_person_info",value:function(){this.props[nP]||this.props[nF]||this.register_once((0,u._)({},n$,rc(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)),void 0)}},{key:"get_initial_props",value:function(){var e=this,t={};nK([nF,nP],function(n){var i=e.props[n];i&&nK(i,function(e,n){t["$initial_"+B(n)]=e})});var n,i,r=this.props[n$];return r&&nY(t,(n=rh(r),i={},nK(n,function(e,t){i["$initial_"+B(t)]=e}),i)),t}},{key:"safe_merge",value:function(e){return nK(this.props,function(t,n){n in e||(e[n]=t)}),e}},{key:"update_config",value:function(e,t,n){this.Vr=this.Hr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var i=e.persistence!==t.persistence||!function(e,t){if(e.length!==t.length)return!1;var n=(0,h._)(e).sort(),i=(0,h._)(t).sort();return n.every(function(e,t){return e===i[t]})}(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),r=i?this.Sr(e):this.nr,s=this.Cr(e);if(i||s!==this.br){var o=this.props;this.clear(),this.nr=r,this.br=s,this.props=o,this.save()}}},{key:"set_disabled",value:function(e){this.Tr=e,this.Tr?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.Ur&&(this.Ur=e,this.remove({keepGroupEntries:!0}),this.save())}},{key:"set_secure",value:function(e){e!==this.zr&&(this.zr=e,this.remove({keepGroupEntries:!0}),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[tX]||{};n[e]=t,this.Fr(tX,n),this.save()}},{key:"remove_event_timer",value:function(e){var t=this.props[tX]||{},n=t[e];return Q(n)||(delete t[e],this.Fr(tX,t),this.save()),n}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.Fr(e,t),this.save()}},{key:"Fr",value:function(e,t){var n;this.props[e]=t,null!=(n=i5(e))&&n.volatile||this.Wr(e)}},{key:"Nr",value:function(e){delete this.props[e],this.Wr(e)}},{key:"Wr",value:function(e){var t,n=null==(t=i5(e))?void 0:t.storageGroup;n&&(this.Pr(n).dirty=!0)}},{key:"Pr",value:function(e){return this.mr[e]||(this.mr[e]={})}}]),e}(),rg="events",ry="cancelEvents",rm="survey shown",rk="survey sent",rb="popover",rx=tB("[RateLimiter]"),rw=function(){function e(t){var n=this;(0,o._)(this,e),this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=function(e){var t=e.text;
1if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(function(e){rx.info((e||"events")+" is quota limited."),n.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void rx.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return(0,a._)(e,[{key:"captureEventsPerSecond",get:function(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}},{key:"captureEventsBurstLimit",get:function(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}},{key:"clientRateLimitContext",value:function(e){void 0===e&&(e=!1);var t,n,i,r=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!=(t=null==(n=this.instance.persistence)?void 0:n.get_property(nS))?t:{tokens:r,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>r&&(a.tokens=r);var u=1>a.tokens;return u||e||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(i=this.instance.persistence)||i.set_property(nS,a),{isRateLimited:u,remainingTokens:a.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),rE=tB("[RemoteConfig]"),rS=function(){function e(t){(0,o._)(this,e),this._instance=t}return(0,a._)(e,[{key:"remoteConfig",get:function(){var e;return null==(e=w._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}},{key:"Gr",value:function(e){var t,n,i=this;null!=(t=w.__PosthogExtensions__)&&t.loadExternalDependency?null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"remote-config",function(){return e(i.remoteConfig)}):e()}},{key:"Zr",value:function(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:function(t){e(t.json)}})}},{key:"load",value:function(){var e=this;try{if(this.remoteConfig)return rE.info("Using preloaded remote config",this.remoteConfig),this.Qr(this.remoteConfig),void this.Jr();if(this._instance.Kr())return void rE.warn("Remote config is disabled. Falling back to local config.");this.Gr(function(t){t?(e.Qr(t),e.Jr()):(rE.info("No config found after loading remote JS config. Falling back to JSON."),e.Zr(function(t){e.Qr(t),e.Jr()}))})}catch(e){rE.error("Error loading remote config",e)}}},{key:"stop",value:function(){this.Yr&&(clearInterval(this.Yr),this.Yr=void 0)}},{key:"refresh",value:function(){!this._instance.Kr()&&_&&"hidden"!==_.visibilityState&&this._instance.reloadFeatureFlags()}},{key:"Jr",value:function(){var e,t=this;if(!this.Yr){var n=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==n&&(this.Yr=setInterval(function(){t.refresh()},n))}}},{key:"Qr",value:function(e){var t;e||rE.error("Failed to fetch remote config from PostHog."),this._instance.Qr(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())}}]),e}(),rP="gzip-js",rF="base64",r$=Uint8Array,rI=Uint16Array,rO=Uint32Array,rT=new r$([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]),rC=new r$([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]),rM=new r$([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rR=function(e,t){for(var n=new rI(31),i=0;31>i;++i)n[i]=t+=1<<e[i-1];var r=new rO(n[30]);for(i=1;30>i;++i)for(var s=n[i];n[i+1]>s;++s)r[s]=s-n[i]<<5|i;return[n,r]},rA=rR(rT,2),rL=rA[1];rA[0][28]=258,rL[258]=28;for(var rq=rR(rC,0)[1],rD=new rI(32768),rN=0;32768>rN;++rN){var rj=(43690&rN)>>>1|(21845&rN)<<1;rD[rN]=((65280&(rj=(61680&(rj=(52428&rj)>>>2|(13107&rj)<<2))>>>4|(3855&rj)<<4))>>>8|(255&rj)<<8)>>>1}var rH=function(e,t,n){for(var i=e.length,r=0,s=new rI(t);i>r;++r)++s[e[r]-1];var o,a=new rI(t);for(r=0;t>r;++r)a[r]=a[r-1]+s[r-1]<<1;if(n){o=new rI(1<<t);var u=15-t;for(r=0;i>r;++r)if(e[r])for(var l=r<<4|e[r],c=t-e[r],h=a[e[r]-1]++<<c,d=h|(1<<c)-1;d>=h;++h)o[rD[h]>>>u]=l}else for(o=new rI(i),r=0;i>r;++r)o[r]=rD[a[e[r]-1]++]>>>15-e[r];return o},rz=new r$(288);for(rN=0;144>rN;++rN)rz[rN]=8;for(rN=144;256>rN;++rN)rz[rN]=9;for(rN=256;280>rN;++rN)rz[rN]=7;for(rN=280;288>rN;++rN)rz[rN]=8;var rU=new r$(32);for(rN=0;32>rN;++rN)rU[rN]=5;var rG=rH(rz,9,0),rB=rH(rU,5,0),rW=function(e){return(e/8|0)+(7&e&&1)},rV=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new((0,i._)(e,rI)?rI:(0,i._)(e,rO)?rO:r$)(n-t);return r.set(e.subarray(t,n)),r},rK=function(e,t,n){var i=t/8|0;e[i]|=n<<=7&t,e[i+1]|=n>>>8},rY=function(e,t,n){var i=t/8|0;e[i]|=n<<=7&t,e[i+1]|=n>>>8,e[i+2]|=n>>>16},rJ=function(e,t){for(var n=[],i=0;e.length>i;++i)e[i]&&n.push({s:i,f:e[i]});var r=n.length,s=n.slice();if(!r)return[new r$(0),0];if(1==r){var o=new r$(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],u=n[1],l=0,c=1,h=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};c!=r-1;)a=n[n[h].f>n[l].f?l++:h++],u=n[l!=c&&n[h].f>n[l].f?l++:h++],n[c++]={s:-1,f:a.f+u.f,l:a,r:u};var d=s[0].s;for(i=1;r>i;++i)s[i].s>d&&(d=s[i].s);var f=new rI(d+1),v=rX(n[c-1],f,0);if(v>t){i=0;var p=0,_=v-t,g=1<<_;for(s.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});r>i;++i){var y=s[i].s;if(t>=f[y])break;p+=g-(1<<v-f[y]),f[y]=t}for(p>>>=_;p>0;){var m=s[i].s;t>f[m]?p-=1<<t-f[m]++-1:++i}for(;i>=0&&p;--i){var k=s[i].s;f[k]==t&&(--f[k],++p)}v=t}return[new r$(f),v]},rX=function(e,t,n){return -1==e.s?Math.max(rX(e.l,t,n+1),rX(e.r,t,n+1)):t[e.s]=n},rZ=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new rI(++t),i=0,r=e[0],s=1,o=function(e){n[i++]=e},a=1;t>=a;++a)if(e[a]==r&&a!=t)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=e[a]}return[n.subarray(0,i),t]},rQ=function(e,t){for(var n=0,i=0;t.length>i;++i)n+=e[i]*t[i];return n},r0=function(e,t,n){var i=n.length,r=rW(t+2);e[r]=255&i,e[r+1]=i>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var s=0;i>s;++s)e[r+s+4]=n[s];return 8*(r+4+i)},r1=function(e,t,n,i,r,s,o,a,u,l,c){rK(t,c++,n),++r[256];for(var h=rJ(r,15),d=h[0],f=h[1],v=rJ(s,15),p=v[0],_=v[1],g=rZ(d),y=g[0],m=g[1],k=rZ(p),b=k[0],x=k[1],w=new rI(19),E=0;y.length>E;++E)w[31&y[E]]++;for(E=0;b.length>E;++E)w[31&b[E]]++;for(var S=rJ(w,7),P=S[0],F=S[1],$=19;$>4&&!P[rM[$-1]];--$);var I,O,T,C,M=l+5<<3,R=rQ(r,rz)+rQ(s,rU)+o,A=rQ(r,d)+rQ(s,p)+o+14+3*$+rQ(w,P)+(2*w[16]+3*w[17]+7*w[18]);if(R>=M&&A>=M)return r0(t,c,e.subarray(u,u+l));if(rK(t,c,1+(R>A)),c+=2,R>A){I=rH(d,f,0),O=d,T=rH(p,_,0),C=p;var L=rH(P,F,0);for(rK(t,c,m-257),rK(t,c+5,x-1),rK(t,c+10,$-4),c+=14,E=0;$>E;++E)rK(t,c+3*E,P[rM[E]]);c+=3*$;for(var q=[y,b],D=0;2>D;++D){var N=q[D];for(E=0;N.length>E;++E)rK(t,c,L[j=31&N[E]]),c+=P[j],j>15&&(rK(t,c,N[E]>>>5&127),c+=N[E]>>>12)}}else I=rG,O=rz,T=rB,C=rU;for(E=0;a>E;++E)if(i[E]>255){rY(t,c,I[257+(j=i[E]>>>18&31)]),c+=O[j+257],j>7&&(rK(t,c,i[E]>>>23&31),c+=rT[j]);var j,H=31&i[E];rY(t,c,T[H]),c+=C[H],H>3&&(rY(t,c,i[E]>>>5&8191),c+=rC[H])}else rY(t,c,I[i[E]]),c+=O[i[E]];return rY(t,c,I[256]),c+O[256]},r2=new rO([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),r3=function(){for(var e=new rO(256),t=0;256>t;++t){for(var n=t,i=9;--i;)n=(1&n&&0xedb88320)^n>>>1;e[t]=n}return e}(),r5=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},r8=!!m||!!y,r6="text/plain",r4=!1,r7=function(e,t){var n=(0,c._)(e.split("#"),2),i=n[0],r=n[1],s=(0,c._)(i.split("?"),2),o=s[0],a=s[1];if(!a)return e;var u=a.split("&").filter(function(e){return e.split("=")[0]!==t}).join("&");return o+(u?"?"+u:"")+(r?"#"+r:"")},r9=function(e,t,n){void 0===n&&(n=!0);var r,s,o,a,u,l=(0,c._)(e.split("?"),2),h=l[0],d=l[1],f=$({},t),v=null!=(u=null==d?void 0:d.split("&").map(function(e){var t,i=(0,c._)(e.split("="),2),r=i[0],s=i[1],o=n&&null!=(t=f[r])?t:s;return delete f[r],r+"="+o}))?u:[],p=(void 0===r&&(r="&"),a=[],nK(f,function(e,t){Q(e)||Q(t)||"undefined"===t||(s=encodeURIComponent((0,i._)(e,File)?e.name:e.toString()),o=encodeURIComponent(t),a[a.length]=o+"="+s)}),a.join(r));return p&&v.push(p),h+"?"+v.join("&")},se=function(e,t){return JSON.stringify(e,function(e,t){return"bigint"==(void 0===t?"undefined":(0,r._)(t))?t.toString():t},t)},st=function(e){if(e.tr)return e.tr;var t=e.data,n=e.compression;if(t){if(n===rP){var i,r,s,o,a,u,l,c,h=(i=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new r$(e.length+(e.length>>>1)),i=0,r=function(e){n[i++]=e},s=0;t>s;++s){if(i+5>n.length){var o=new r$(i+8+(t-s<<1));o.set(n),n=o}var a=e.charCodeAt(s);128>a?r(a):(2048>a?r(192|a>>>6):(a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++s))>>>18),r(128|a>>>12&63)):r(224|a>>>12),r(128|a>>>6&63)),r(128|63&a))}return rV(n,0,i)}(se(t)),r={mtime:0},s=0xffffffff,o={p:function(e){for(var t=s,n=0;e.length>n;++n)t=r3[255&t^e[n]]^t>>>8;s=t},d:function(){return 0xffffffff^s}},a=i.length,o.p(i),c=(u=10+(r.filename&&r.filename.length+1||0),l=function(e,t,n,i){var r=e.length,s=new r$(i+r+5*(1+Math.floor(r/7e3))+8),o=s.subarray(i,s.length-8),a=0;if(!t||8>r)for(var u=0;r>=u;u+=65535){var l=u+65535;r>l?a=r0(o,a,e.subarray(u,l)):(o[u]=!0,a=r0(o,a,e.subarray(u,r)))}else{for(var c=r2[t-1],h=c>>>13,d=8191&c,f=(1<<n)-1,v=new rI(32768),p=new rI(f+1),_=Math.ceil(n/3),g=2*_,y=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<g)&f},m=new rO(25e3),k=new rI(288),b=new rI(32),x=0,w=0,E=(u=0,0),S=0,P=0;r>u;++u){var F=y(u),$=32767&u,I=p[F];if(v[$]=I,p[F]=$,u>=S){var O=r-u;if((x>7e3||E>24576)&&O>423){a=r1(e,o,0,m,k,b,w,E,P,u-P,a),E=x=w=0,P=u;for(var T=0;286>T;++T)k[T]=0;for(T=0;30>T;++T)b[T]=0}var C=2,M=0,R=d,A=$-I&32767;if(O>2&&F==y(u-A))for(var L=Math.min(h,O)-1,q=Math.min(32767,u),D=Math.min(258,O);q>=A&&--R&&$!=I;){if(e[u+C]==e[u+C-A]){for(var N=0;D>N&&e[u+N]==e[u+N-A];++N);if(N>C){if(C=N,M=A,N>L)break;var j=Math.min(A,N-2),H=0;for(T=0;j>T;++T){var z=u-A+T+32768&32767,U=z-v[z]+32768&32767;U>H&&(H=U,I=z)}}}A+=($=I)-(I=v[$])+32768&32767}if(M){m[E++]=0x10000000|rL[C]<<18|rq[M];var G=31&rL[C],B=31&rq[M];w+=rT[G]+rC[B],++k[257+G],++b[B],S=u+C,++x}
1else m[E++]=e[u],++k[e[u]]}}a=r1(e,o,!0,m,k,b,w,E,P,u-P,a)}return rV(s,0,i+rW(a)+8)}(i,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+r.mem,u)).length,function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&r5(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var i=0;n.length>=i;++i)e[i+10]=n.charCodeAt(i)}}(l,r),r5(l,c-8,o.d()),r5(l,c-4,a),l);return{contentType:r6,body:h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength),estimatedSize:h.byteLength}}if(n===rF){var d,f,v="data="+encodeURIComponent("string"==typeof(f=(d=se(t))?btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))})):d)?f:se(f));return{contentType:"application/x-www-form-urlencoded",body:v,estimatedSize:new Blob([v]).size}}var p=se(t);return{contentType:"application/json",body:p,estimatedSize:new Blob([p]).size}}},sn=function(e){var t,n,r,s=st(e);return!s||(n=e.compression,r=i6(e.url,"compression"),n!==M.GZipJS&&r!==M.GZipJS&&"gzip"!==r)||((0,i._)(t=s.body,ArrayBuffer)?L(new Uint8Array(t)):ArrayBuffer.isView(t)&&L(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))?{url:e.url,encodedBody:s}:(r4=!0,{url:r7(e.url,"compression"),encodedBody:st($({},e,{compression:void 0,tr:void 0}))})},si=(sb=F(function(e){var t,n;return(0,d._)(this,function(i){switch(i.label){case 0:return[4,function(e,t,n){return j.apply(this,arguments)}(se(e.data),S.DEBUG,{rethrow:!0})];case 1:if(!(t=i.sent()))return[2,e];return[4,t.arrayBuffer()];case 2:return n=i.sent(),[2,$({},e,{tr:{contentType:r6,body:n,estimatedSize:n.byteLength}})]}})}),function(e){return sb.apply(this,arguments)}),sr=function(e,t){return r9(e,{_:(new Date).getTime().toString(),ver:S.JS_SDK_VERSION,compression:t})},ss=[];y&&ss.push({transport:"fetch",method:function(e){var t,n=sn(e),i=n.url,r=n.encodedBody,s=null!=r?r:{},o=s.contentType,a=s.body,u=s.estimatedSize,l=new Headers;nK(e.headers,function(e,t){l.append(t,e)}),o&&l.append("Content-Type",o);var c=null;if(k){var h=new k;c={signal:h.signal,timeout:setTimeout(function(){return h.abort()},e.timeout)}}y(i,$({method:(null==e?void 0:e.method)||"GET",headers:l,keepalive:"POST"===e.method&&52428.8>(u||0),body:a,signal:null==(t=c)?void 0:t.signal},e.fetchOptions)).then(function(t){return t.text().then(function(n){var i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){tG.error(e)}null==e.callback||e.callback(i)})}).catch(function(t){tG.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(function(){return c?clearTimeout(c.timeout):null})}}),m&&ss.push({transport:"XHR",method:function(e){var t=new m,n=sn(e),i=n.url,r=n.encodedBody;t.open(e.method||"GET",i,!0);var s=null!=r?r:{},o=s.contentType,a=s.body;nK(e.headers,function(e,n){t.setRequestHeader(n,e)}),o&&t.setRequestHeader("Content-Type",o),e.timeout&&(t.timeout=e.timeout),t.onreadystatechange=function(){if(4===t.readyState){var n={statusCode:t.status,text:t.responseText};if(200===t.status)try{n.json=JSON.parse(t.responseText)}catch(e){}null==e.callback||e.callback(n)}},t.send(a)}}),null!=p&&p.sendBeacon&&ss.push({transport:"sendBeacon",method:function(e){try{var t=sn(e),n=t.url,r=t.encodedBody,s=r9(n,{beacon:"1"}),o=null!=r?r:{},a=o.contentType,u=o.body;if(!u)return;var l=(0,i._)(u,Blob)?u:new Blob([u],{type:a});p.sendBeacon(s,l)}catch(e){}}});var so=function(){function e(t,n){(0,o._)(this,e),this.Xr=!0,this.ei=[],this.ti=ef((null==n?void 0:n.flush_interval_ms)||3e3,250,5e3,tG.createLogger("flush interval"),3e3),this.ri=t}return(0,a._)(e,[{key:"enqueue",value:function(e){this.ei.push(e),this.ii||this.ni()}},{key:"unload",value:function(){var e=this;this.si();var t=Object.values(this.ei.length>0?this.oi():{});(0,h._)(t.filter(function(e){return 0===e.url.indexOf("/e")})).concat((0,h._)(t.filter(function(e){return 0!==e.url.indexOf("/e")}))).map(function(t){e.ri($({},t,{transport:"sendBeacon"}))})}},{key:"enable",value:function(){this.Xr=!1,this.ni()}},{key:"ni",value:function(){var e=this,t=this;this.Xr||(this.ii=setTimeout(function(){if(e.si(),e.ei.length>0){var n=e.oi();for(var i in n)!function(){var e=n[i],r=(new Date).getTime();e.data&&Y(e.data)&&nK(e.data,function(e){e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),t.ri(e)}()}},this.ti))}},{key:"si",value:function(){clearTimeout(this.ii),this.ii=void 0}},{key:"oi",value:function(){var e={};return nK(this.ei,function(t){var n,i=(t?t.batchKey:null)||t.url;Q(e[i])&&(e[i]=$({},t,{data:[]})),null==(n=e[i].data)||n.push(t.data)}),this.ei=[],e}}]),e}(),sa=["retriesPerformedSoFar"],su=function(){function e(t){var n=this;(0,o._)(this,e),this.ai=!1,this.li=3e3,this.ei=[],this._instance=t,this.ei=[],this.ui=!0,!Q(f)&&"onLine"in f.navigator&&(this.ui=f.navigator.onLine,this.hi=function(){n.ui=!0,n.ci()},this.di=function(){n.ui=!1},n1(f,"online",this.hi),n1(f,"offline",this.di))}return(0,a._)(e,[{key:"length",get:function(){return this.ei.length}}
1,{key:"retriableRequest",value:function(e){var t=this,n=e.retriesPerformedSoFar,i=I(e,sa);es(n)&&(i.url=r9(i.url,{retry_count:n})),this._instance._send_request($({},i,{callback:function(e){200===e.statusCode||e.statusCode>=400&&500>e.statusCode||(null!=n?n:0)>=10?null==i.callback||i.callback(e):t.vi($({retriesPerformedSoFar:n},i))}}))}},{key:"vi",value:function(e){var t,n,i=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=i+1;var r=Math.ceil((n=Math.min(18e5,t=3e3*Math.pow(2,i)))+(Math.random()-.5)*(n-t/2)),s=Date.now()+r;this.ei.push({retryAt:s,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),tG.warn(o),this.ai||(this.ai=!0,this.fi())}},{key:"fi",value:function(){var e=this;(this.pi&&clearTimeout(this.pi),0===this.ei.length)?(this.ai=!1,this.pi=void 0):this.pi=setTimeout(function(){e.ui&&e.ei.length>0&&e.ci(),e.fi()},this.li)}},{key:"ci",value:function(){var e=Date.now(),t=[],n=this.ei.filter(function(n){return e>n.retryAt||(t.push(n),!1)}),i=!0,r=!1,s=void 0;if(this.ei=t,n.length>0)try{for(var o,a=n[Symbol.iterator]();!(i=(o=a.next()).done);i=!0){var u=o.value.requestOptions;this.retriableRequest(u)}}catch(e){r=!0,s=e}finally{try{i||null==a.return||a.return()}finally{if(r)throw s}}}},{key:"unload",value:function(){var e=!0,t=!1,n=void 0;try{for(var i,r=(this.pi&&(clearTimeout(this.pi),this.pi=void 0),this.ai=!1,Q(f)||(this.hi&&(f.removeEventListener("online",this.hi),this.hi=void 0),this.di&&(f.removeEventListener("offline",this.di),this.di=void 0)),this.ei)[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var s=i.value.requestOptions;try{this._instance._send_request($({},s,{transport:"sendBeacon"}))}catch(e){tG.error(e)}}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}this.ei=[]}}]),e}(),sl=function(){function e(t){var n=this;(0,o._)(this,e),this.gi=function(){n.mi||(n.mi={});var e,t,i,r,s=n.scrollElement(),o=n.scrollY(),a=s?Math.max(0,s.scrollHeight-s.clientHeight):0,u=o+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;n.mi.lastScrollY=Math.ceil(o),n.mi.maxScrollY=Math.max(o,null!=(e=n.mi.maxScrollY)?e:0),n.mi.maxScrollHeight=Math.max(a,null!=(t=n.mi.maxScrollHeight)?t:0),n.mi.lastContentY=u,n.mi.maxContentY=Math.max(u,null!=(i=n.mi.maxContentY)?i:0),n.mi.maxContentHeight=Math.max(l,null!=(r=n.mi.maxContentHeight)?r:0)},this._instance=t}return(0,a._)(e,[{key:"yi",get:function(){return this._instance.config.scroll_root_selector}},{key:"getContext",value:function(){return this.mi}},{key:"resetContext",value:function(){var e=this.mi;return setTimeout(this.gi,0),e}},{key:"startMeasuringScrollPosition",value:function(){n1(f,"scroll",this.gi,{capture:!0}),n1(f,"scrollend",this.gi,{capture:!0}),n1(f,"resize",this.gi)}},{key:"scrollElement",value:function(){if(!this.yi)return null==f?void 0:f.document.documentElement;var e=Y(this.yi)?this.yi:[this.yi],t=!0,n=!1,i=void 0;try{for(var r,s=e[Symbol.iterator]();!(t=(r=s.next()).done);t=!0){var o=r.value,a=null==f?void 0:f.document.querySelector(o);if(a)return a}}catch(e){n=!0,i=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw i}}}},{key:"bi",value:function(e){if(this.yi){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return f?"y"===e?f.scrollY||f.pageYOffset||f.document.documentElement.scrollTop||0:f.scrollX||f.pageXOffset||f.document.documentElement.scrollLeft||0:0}},{key:"scrollY",value:function(){return this.bi("y")}},{key:"scrollX",value:function(){return this.bi("x")}}]),e}(),sc=function(e){return rc(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties)},sh=function(){function e(t,n,i,r){var s=this;(0,o._)(this,e),this.wi=function(e){var t=s.xi();if(!t||t.sessionId!==e){var n={sessionId:e,props:s.ki(s._instance)};s.Si.register((0,u._)({},nE,n))}},this._instance=t,this.Ci=n,this.Si=i,this.ki=r||sc,this.Ci.onSessionId(this.wi)}return(0,a._)(e,[{key:"xi",value:function(){return this.Si.props[nE]}},{key:"getSetOnceProps",value:function(){var e,t=null==(e=this.xi())?void 0:e.props;return t?"r"in t?rh(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}:{}}},{key:"getSessionProps",value:function(){var e={};return nK(nQ(this.getSetOnceProps()),function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_"+B(n)]=t}),e}}]),e}(),sd=function(){function e(){(0,o._)(this,e),this.Ii={}}return(0,a._)(e,[{key:"on",value:function(e,t){var n=this;return this.Ii[e]||(this.Ii[e]=[]),this.Ii[e].push(t),function(){n.Ii[e]=n.Ii[e].filter(function(e){return e!==t})}}},{key:"emit",value:function(e,t){var n=!0,i=!1,r=void 0;try{for(var s,o=(this.Ii[e]||[])[Symbol.iterator]();!(n=(s=o.next()).done);
1n=!0)(0,s.value)(t)}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}var a=!0,u=!1,l=void 0;try{for(var c,h=(this.Ii["*"]||[])[Symbol.iterator]();!(a=(c=h.next()).done);a=!0)(0,c.value)(e,t)}catch(e){u=!0,l=e}finally{try{a||null==h.return||h.return()}finally{if(u)throw l}}}}]),e}(),sf=tB("[SessionId]"),sv=function(){function e(t,n,i){var r,s=this;if((0,o._)(this,e),this.Ei=null,this.Mi=[],this.Ri=void 0,this.Pi=!1,this.Ti=new sd,this.Oi=function(e,t){return!(!es(e)||!es(t))&&Math.abs(e-t)>s.sessionTimeoutMs},!t.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===nq)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qt=t.config,this.Si=t.persistence,this.Li=void 0,this.Ai=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Fi=n||n7,this.Ni=i||n7;var a=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*ef(this.qt.session_idle_timeout_seconds||1800,60,36e3,sf.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Di(),this.$i="ph_"+a+"_window_id",this.qi="ph_"+a+"_primary_window_exists",this.ji()){var u=ic.F(this.$i),l=ic.F(this.qi);u&&!l?this.Li=u:ic.q(this.$i),ic.N(this.qi,!0)}if(null!=(r=this.qt.bootstrap)&&r.sessionID)try{var c=function(){var e=s.qt.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw Error("Not a valid UUID");if("7"!==e[12])throw Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)}();this.Bi(this.qt.bootstrap.sessionID,(new Date).getTime(),c)}catch(e){sf.error("Invalid sessionID in bootstrap",e)}this.Hi()}return(0,a._)(e,[{key:"on",value:function(e,t){return this.Ti.on(e,t)}},{key:"sessionTimeoutMs",get:function(){return this._sessionTimeoutMs}},{key:"onSessionId",value:function(e){var t=this;return Q(this.Mi)&&(this.Mi=[]),this.Mi.push(e),this.Ai&&e(this.Ai,this.Li),function(){t.Mi=t.Mi.filter(function(t){return t!==e})}}},{key:"ji",value:function(){return"memory"!==this.qt.persistence&&!this.Si.Tr&&ic.O()}},{key:"Ui",value:function(e){e!==this.Li&&(this.Li=e,this.ji()&&ic.N(this.$i,e))}},{key:"zi",value:function(){return this.Li?this.Li:this.ji()?ic.F(this.$i):null}},{key:"Vi",value:function(e){var t=this.Ei;return!en(t)&&!en(e)&&5e3>Math.abs(e-t)}},{key:"Bi",value:function(e,t,n){var i=t!==this._sessionActivityTimestamp,r=e===this.Ai&&n===this._sessionStartTimestamp;this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.Ai=e,r&&!i||r&&this.Vi(t)||(this.Ei=t,this.Si.register((0,u._)({},ni,[t,e,n])))}},{key:"Wi",value:function(){var e,t=null==(e=this.qt)?void 0:e.persistence_save_debounce_ms;return es(t)&&t>0}},{key:"Gi",value:function(){this.Wi()?this.Si.refreshKey(ni):(this.Si.flush(),this.Si.load())}},{key:"Zi",value:function(){var e;if(!en(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Ei){this.Gi();var t=(0,c._)(this.Qi(),3),n=t[1],i=t[2];n===this.Ai&&i===this._sessionStartTimestamp&&(this.Ei=this._sessionActivityTimestamp,this.Si.register((0,u._)({},ni,[this._sessionActivityTimestamp,null!=(e=this.Ai)?e:null,this._sessionStartTimestamp])),this.Si.flush())}}},{key:"Ji",value:function(){var e=(0,c._)(this.Qi(),1)[0];return Math.max(es(e)?e:0,es(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}},{key:"Ki",value:function(e){return this.Gi(),this.Oi(e,this.Ji())}},{key:"Qi",value:function(){var e=this.Si.props[ni];return Y(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this.Ei=null,clearTimeout(this.Yi),this.Yi=void 0,this.Bi(null,null,null)}},{key:"destroy",value:function(){this.Pi=!0,this.Zi(),clearTimeout(this.Yi),this.Yi=void 0,this.Ri&&f&&(f.removeEventListener(nz,this.Ri,{capture:!1}),this.Ri=void 0),this.Mi=[]}},{key:"Hi",value:function(){var e=this;this.Ri=function(){e.Zi(),e.ji()&&ic.q(e.qi)},n1(f,nz,this.Ri,{capture:!1})}},{key:"checkAndGetSessionAndWindowId",value:function(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.qt.cookieless_mode===nq)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var n,i=t||(new Date).getTime(),r=(0,c._)(this.Qi(),3),s=r[1],o=r[2],a=this.Ji(),u=this.zi(),l=es(o)&&Math.abs(i-o)>864e5,h=!1,d=!1,f=!s,v=s,p=!f&&!e&&this.Oi(i,a);p&&((p=this.Ki(i))||sf.info("cross-tab refresh kept the session alive",{sessionId:s}),s=(n=(0,c._)(this.Qi(),3))[1],o=n[2]),f||p||l?(s=this.Fi(),u=this.Ni(),sf.info("new session ID generated",{sessionId:s,windowId:u,changeReason:{noSessionId:f,activityTimeout:p,sessionPastMaximumLength:l}}),o=i,h=!0):(u||(u=this.Ni(),h=!0),(d=s!==v)&&(sf.info("adopted cross-tab session id",{sessionId:s,windowId:u}),h=!0));var _=es(a)&&e&&!l?a:i,g=es(o)?o:(new Date).getTime();this.Ui(u),this.Bi(s,_,g),e||this.Di();var y={noSessionId:f,activityTimeout:p,sessionPastMaximumLength:l,crossTabAdoption:d};return h&&this.Mi.forEach(function(e){return e(s,u,y)}),{sessionId:s,windowId:u,sessionStartTimestamp:g,changeReason:h?y:void 0,lastActivityTimestamp:a}}},{key:"Di",value:function(){var e=this;this.Pi||(clearTimeout(this.Yi),this.Yi=setTimeout(function(){if(!e.Pi)if(e.Ki((new Date).getTime())){var t=e.Ai;e.resetSessionId(),e.Ti.emit("forcedIdleReset",{idleSessionId:t})}else e.Di()},1.1*this.sessionTimeoutMs))}}]),e}(),sp=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&z(n,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some(function(e){return z(null==e?void 0:e.brand,t)}))return!0}catch(e){}return!!e.webdriver},s_=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 sg(e,t,n){return se({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var sy={exact:function(e,t){return t.some(function(t){return e.some(function(e){return t===e})})},is_not:function(e,t){return t.every(function(t){return e.every(function(e){return t!==e})})},regex:function(e,t){return t.some(function(t){return e.some(function(e){return s_(t,e)})})},not_regex:function(e,t){return t.every(function(t){return e.every(function(e){return!s_(t,e)})})},icontains:function(e,t){return t.map(sm).some(function(t){return e.map(sm).some(function(e){return t.includes(e)})})},not_icontains:function(e,t){return t.map(sm).every(function(t){return e.map(sm).every(function(e){return!t.includes(e)})})},gt:function(e,t){return t.some(function(t){var n=parseFloat(t);return!isNaN(n)&&e.some(function(e){return n>parseFloat(e)})})},lt:function(e,t){return t.some(function(t){var n=parseFloat(t);return!isNaN(n)&&e.some(function(e){return n<parseFloat(e)})})}},sm=function(e){return e.toLowerCase()};function sk(e,t){return!e||Object.entries(e).every(function(e){var n=(0,c._)(e,2),i=n[0],r=n[1],s=null==t?void 0:t[i];if(Q(s)||en(s))return!1;var o=[String(s)],a=sy[r.operator];return!!a&&a(r.values,o)})}var sb,sx,sw,sE="custom",sS="i.posthog.com",sP=/^\/static\//,sF=function(){function e(t){(0,o._)(this,e),this.Xi={},this.instance=t}return(0,a._)(e,[{key:"apiHost",get:function(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}},{key:"flagsApiHost",get:function(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}},{key:"uiHost",get:function(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+sS,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this.Xi[this.apiHost]||(this.Xi[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":sE),this.Xi[this.apiHost]}},{key:"en",value:function(e){if(sP.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}},{key:"endpointFor",value:function(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 n=this.en(t);if(n)return""+n+t}if(this.region===sE)return this.apiHost+t;var i=sS+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}]),e}(),s$=tB("[Surveys]"),sI="seenSurvey_",sO=["popover","widget","a
1pi"],sT={ignoreConditions:!1,ignoreDelay:!1,displayType:rb},sC=tB("[PostHog ExternalIntegrations]"),sM={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},sR=function(){function e(t){(0,o._)(this,e),this._instance=t}return(0,a._)(e,[{key:"ur",value:function(e,t){var n;null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,e,function(e){if(e)return sC.error("failed to load script",e);t()})}},{key:"startIfEnabledOrStop",value:function(){var e=this,t=function(t){var n,i,r;!h||null!=(n=w.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t]||e.ur(sM[t],function(){var n;null==(n=w.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[t])||n.start(e._instance)}),!h&&null!=(i=w.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[t]&&(null==(r=w.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.stop())},n=!0,i=!1,r=void 0;try{for(var s,o=Object.entries(null!=(a=this._instance.config.integrations)?a:{})[Symbol.iterator]();!(n=(s=o.next()).done);n=!0){var a,u=(0,c._)(s.value,2),l=u[0],h=u[1];t(l)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}]),e}(),sA={},sL=0,sq=function(){},sD='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',sN="Surveys module not available",sj="sanitize_properties is deprecated. Use before_send instead",sH="Invalid value for property_denylist config: ",sz="posthog",sU=!r8&&-1===(null==x?void 0:x.indexOf("MSIE"))&&-1===(null==x?void 0:x.indexOf("Mozilla")),sG=function(e){var t;return $({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!ee(t))return!1;var n=t.split(".").slice(-2).join("."),i=!0,r=!1,s=void 0;try{for(var o,a=n0[Symbol.iterator]();!(i=(o=a.next()).done);i=!0){var u=o.value;if(n===u)return!1}}catch(e){r=!0,s=e}finally{try{i||null==a.return||a.return()}finally{if(r)throw s}}return!0}(null==_?void 0:_.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:sq,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,__preview_cookie_wins_on_conflict:!1,debug:g&&ee(null==g?void 0:g.search)&&-1!==g.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,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==f||null==(t=f.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:function(e){tG.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:function(e){return e},capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:nj,before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:sq},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:i$,ignore_text_selection:!0}
1:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e)})},sB=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],sW=function(e){var t={},n=!0,i=!1,r=void 0;try{for(var s,o=sB[Symbol.iterator]();!(n=(s=o.next()).done);n=!0){var a=(0,c._)(s.value,2),u=a[0],l=a[1];Q(e[u])||(t[l]=e[u])}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}var d=nY({},t,e),f=e.__preview_external_dependency_versioned_paths;
1return Q(f)||(Q(e.strict_script_versioning)&&(d.strict_script_versioning=!!f),ee(f)&&Q(e.asset_host)&&(d.asset_host=f)),Y(e.property_blacklist)&&(Q(e.property_denylist)?d.property_denylist=e.property_blacklist:Y(e.property_denylist)?d.property_denylist=(0,h._)(e.property_blacklist).concat((0,h._)(e.property_denylist)):tG.error(sH+e.property_denylist)),d},sV=function(){function e(){(0,o._)(this,e),this.__forceAllowLocalhost=!1}return(0,a._)(e,[{key:"tn",get:function(){return this.__forceAllowLocalhost},set:function(e){tG.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),sK=function(){function e(){var t,n=this;(0,o._)(this,e),this.webPerformance=new sV,this.an=!1,this.version=S.LIB_VERSION,this.ln=new sd,this.nn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=sG(),this.SentryIntegration=iQ,this.sentryIntegration=function(e){var t;return t=iZ(n,e),{name:iX,processEvent:function(e){return t(e)}}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.un=!1,this.hn=null,this.cn=null,this.dn=null,this.scrollManager=new sl(this),this.pageViewManager=new i0(this),this.rateLimiter=new rw(this),this.requestRouter=new sF(this),this.consent=new ih(this),this.externalIntegrations=new sR(this);var i=null!=(t=e.__defaultExtensionClasses)?t:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:function(e,t,i){var r=ee(e)?(0,u._)({},e,t):e;n.setPersonProperties(r),null==i||i({})},set_once:function(e,t,i){var r=ee(e)?(0,u._)({},e,t):e;n.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",function(e){return tG.info('send "'+(null==e?void 0:e.event)+'"',e)})}return(0,a._)(e,[{key:"rn",value:function(e,t){if(e){var n=this.nn.indexOf(e);-1!==n&&this.nn.splice(n,1)}return this.nn.push(t),null==t.initialize||t.initialize(),t}},{key:"sn",value:function(){return this.config.cookieless_mode===nq||this.config.cookieless_mode===nL&&this.consent.isRejected()}},{key:"decideEndpointWasHit",get:function(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}},{key:"flagsEndpointWasHit",get:function(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}},{key:"init",value:function(t,n,i){if(i&&i!==sz){var r,s=null!=(r=sA[i])?r:new e;return s._init(t,n,i),sA[i]=s,sA[sz][i]=s,s}return this._init(t,n,i)}},{key:"_init",value:function(e,t,n){var i,r,s=this;void 0===t&&(t={});var o=ee(e)?e.trim():"";if(!o)return tG.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.vn(t.debug),this.fn=t,this.pn=[],t.person_profiles?this.cn=t.person_profiles:t.process_person&&(this.cn=t.process_person);var a=sG(t.defaults),u=sW(t),l=nY({},a,u,{name:n,token:o});X(a.rageclick)&&X(u.rageclick)&&(l.rageclick=nY({},a.rageclick,u.rageclick)),this.set_config(l),this.config.on_xhr_error&&tG.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:rP;var c=this.gn();this.persistence=new r_(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r_($({},this.config,{persistence:"sessionStorage"}),c,!1);var h=$({},this.persistence.props),d=$({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.mn=new so(function(e){return s.yn(e)},this.config.request_queue_config),this.bn=new su(this),this.__request_queue=[];var v=this.sn();if(v||(this.sessionManager=new sv(this),this.sessionPropsManager=new sh(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(tG.info("Deferring extension initialization to improve startup performance"),setTimeout(function(){s._n(v)},0)):(tG.info("Initializing extensions synchronously"),this._n(v)),S.DEBUG=S.DEBUG||this.config.debug,S.DEBUG&&tG.info("Starting in debug mode",{this:this,config:t,thisC:$({},this.config),p:h,s:d}),!this.config.identity_distinct_id||null!=(i=t.bootstrap)&&i.distinctID||(t.bootstrap=$({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}
1)),void 0!==(null==(r=t.bootstrap)?void 0:r.distinctID)){var p=t.bootstrap.distinctID,_=this.get_distinct_id(),g=this.persistence.get_property(nw);if(t.bootstrap.isIdentifiedID&&null!=_&&_!==p&&g===nD)this.identify(p);else if(t.bootstrap.isIdentifiedID&&null!=_&&_!==p&&g===nN)tG.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 y=this.config.get_device_id(n7()),m=t.bootstrap.isIdentifiedID?y:p;this.persistence.set_property(nw,t.bootstrap.isIdentifiedID?nN:nD),this.register({distinct_id:p,$device_id:m})}}if(v)this.register_once({distinct_id:nT,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(n7());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(nw,nD)}return n1(f,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var i=function(n){var i=function(){return n.anonymousId()||n7()};e.config.get_device_id=i,n.id()&&(e.register({distinct_id:n.id(),$device_id:i()}),e.persistence.set_property(nw,nN)),t()},r=n.user();"then"in r&&J(r.then)?r.then(i):i(r)}(e,function(){var i;n.register((Promise&&Promise.resolve||iJ.warn("This browser does not have Promise support, and can not use the segment integration"),i=function(t,n){if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(iJ.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(iJ.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},i,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return i(e,e.event.event)},page:function(e){return i(e,nU)},identify:function(e){return i(e,nB)},screen:function(e){return i(e,"$screen")}})).then(function(){t()})})}(this,function(){return s.wn()}):this.wn(),J(this.config._onCapture)&&this.config._onCapture!==sq&&(tG.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",function(e){return s.config._onCapture(e.event,e)})),this.config.ip&&tG.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}},{key:"_n",value:function(t){var n,i,r,s,o,a,u,l=this,c=performance.now(),h=$({},e.__defaultExtensionClasses,this.config.__extensionClasses),d=[];h.featureFlags&&this.nn.push(this.featureFlags=null!=(n=this.featureFlags)?n:new h.featureFlags(this)),h.exceptions&&this.nn.push(this.exceptions=null!=(i=this.exceptions)?i:new h.exceptions(this)),h.historyAutocapture&&this.nn.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.nn.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.nn.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this.nn.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||d.push(function(){l.scrollManager.startMeasuringScrollPosition()}),h.autocapture&&this.nn.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.nn.push(this.surveys=null!=(r=this.surveys)?r:new h.surveys(this)),h.logs&&this.nn.push(this.logs=null!=(s=this.logs)?s:new h.logs(this)),h.conversations&&this.nn.push(this.conversations=null!=(o=this.conversations)?o:new h.conversations(this)),h.productTours&&this.nn.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.nn.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.nn.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.nn.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.nn.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,iK)),h.toolbar&&this.nn.push(this.toolbar=null!=(a=this.toolbar)?a:new h.toolbar(this)),h.experiments&&this.nn.push(this.experiments=null!=(u=this.experiments)?u:new h.experiments(this)),this.nn.forEach(function(e){e.initialize&&d.push(function(){null==e.initialize||e.initialize()})}),d.push(function(){if(l.xn){var e=l.xn;l.xn=void 0,l.Qr(e)}}),this.kn(d,c)}},{key:"kn",value:function(e,t){for(var n,i=this;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(function(){i.kn(e,t)},0);var r=e.shift();if(r)try{r()}catch(e){tG.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session((n={},(0,u._)(n,nC,this.config.__preview_deferred_init_extensions?"deferred":"synchronous"),(0,u._)(n,nM,s),n)),this.config.__preview_deferred_init_extensions&&tG.info("PostHog extensions initialized ("+s+"ms)")}},{key:"Qr",value:function(e){var t,n=this;_&&_.body?(this.config.__preview_deferred_init_extensions&&(this.xn=e),this.Sn=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=U(e.supportedCompression,rP)?rP:U(e.supportedCompression,rF)?rF:void 0),null!=(t=e.anal
1ytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.cn?this.cn:nj}),this.nn.forEach(function(t){return null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)})):(tG.info("document not ready yet, trying again in 500 milliseconds..."),setTimeout(function(){n.Qr(e)},500))}},{key:"wn",value:function(){var e=this;try{this.config.loaded(this)}catch(e){tG.critical("`loaded` function failed",e)}if(this.Cn(),this.config.internal_or_test_user_hostname&&null!=g&&g.hostname){var t=g.hostname,n=this.config.internal_or_test_user_hostname;("string"==typeof n?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(function(){(e.consent.isOptedIn()||e.sn())&&e.In()},1),this.Tn=new rS(this),this.Tn.load()}},{key:"Cn",value:function(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.mn)||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.is_capturing()&&nV(this.__request_queue,function(t){return e.yn(t)}),this.__request_queue=[],this.Cn()}},{key:"_handle_unload",value:function(){var e,t,n,i;null==(e=this.surveys)||e.handlePageUnload(),this.config.request_batching?(this.En()&&this.capture(nG),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(n=this.mn)||n.unload(),null==(i=this.bn)||i.unload()):this.En()&&this.capture(nG,null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var t=this;this.__loaded&&(sU?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=r9(e.url,{ip:+!!this.config.ip}),e.headers=$({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(Q(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,function(e){var t,n,i,s=$({},e);s.timeout=s.timeout||6e4,s.url=sr(s.url,s.compression);var o=null!=(t=s.transport)?t:"fetch",a=ss.filter(function(e){return!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)}),u=null!=(n=null==(i=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===o)return e[t]}(a))?void 0:i.method)?n:a[0].method;if(!u)throw Error("No available transport method");"sendBeacon"!==o&&s.data&&s.compression===rP&&b&&!r4?si(s).then(function(e){u(e)}).catch(function(t){q(t)?(r4=!0,u($({},s,{compression:void 0,url:sr(e.url,void 0)}))):(function(e){if(!e||"object"!=(void 0===e?"undefined":(0,r._)(e)))return!1;var t="name"in e?String(e.name):"";return q(e)||t===A}(t)&&(r4=!0),u(s))}):u(s)}($({},e,{callback:function(n){var i,r;t.rateLimiter.checkForLimiting(n),400>n.statusCode||null==(i=(r=t.config).on_request_error)||i.call(r,n),null==e.callback||e.callback(n)}}))))}},{key:"yn",value:function(e){this.bn?this.bn.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t=this;sL++;try{var n,i=[],r=[],s=[];nV(e,function(e){if(e)if(Y(n=e[0]))s.push(e);else if(J(e))try{e.call(t)}catch(t){tG.error("Error executing queued PostHog call",e,t)}else Y(e)&&"alias"===n?i.push(e):Y(e)&&-1!==n.indexOf("capture")&&J(t[n])?s.push(e):r.push(e)});var o=function(e,t){nV(e,function(e){try{if(Y(e[0])){var n=t;nK(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){tG.error("Error executing queued PostHog call",e,t)}})};o(i,this),o(r,this),o(s,this)}finally{sL--}}},{key:"push",value:function(t){if(sL>0&&Y(t)&&ee(t[0])){var n=e.prototype[t[0]];J(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}},{key:"capture",value:function(e,t,n){var i,r,s,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.mn){if(this.is_capturing())if(!Q(e)&&ee(e)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var c=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==c||!c.isRateLimited){null!=t&&t.$current_url&&!ee(null==t?void 0:t.$current_url)&&(tG.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!=n&&n.Mn||tG.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 h=new Date,d=(null==n?void 0:n.timestamp)||h,f=(null==n?void 0:n.uuid)||n7(),v={uuid:f,event:e,properties:this.calculateEventProperties(e,t||{},d,f)};e===nU&&this.config.__preview_capture_bot_pageviews&&l&&(v.event="$bot_pageview",v.properties.$browser_type="bot"),c&&
1(v.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),(null==n?void 0:n.$set)&&(v.$set=null==n?void 0:n.$set);var p,_,g,y=this.Rn(null==n?void 0:n.$set_once,e!==nW,e===nB);if(y&&(v.$set_once=y),null!=n&&n._noTruncate||(r=this.config.properties_string_max_length,s=v,o=function(e){return ee(e)?e.slice(0,r):e},a=new Set,v=function e(t,n){var i;return t!==Object(t)?o?o(t):t:a.has(t)?void 0:(a.add(t),Y(t)?(i=[],nV(t,function(t){i.push(e(t))})):(i={},nK(t,function(t,n){a.has(t)||(i[n]=e(t,n))})),i)}(s)),v.timestamp=d,Q(null==n?void 0:n.timestamp)||(v.properties.$event_time_override_provided=!0,v.properties.$event_time_override_system_time=h),"survey dismissed"===e||e===rk){var m=null==t?void 0:t.$survey_id,k=null==t?void 0:t.$survey_iteration;(function(e){try{var t,n=(t=""+sI+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+sI+e.id+"_"+e.current_iteration),t);if(localStorage.getItem(n))return;localStorage.setItem(n,"true")}catch(e){s$.error("Failed to persist survey seen state",e)}})({id:m,current_iteration:k}),v.$set=$({},v.$set,(0,u._)({},(p={id:m,current_iteration:k},g="$survey_"+(_=e===rk?"responded":"dismissed")+"/"+p.id,p.current_iteration&&p.current_iteration>0&&(g="$survey_"+_+"/"+p.id+"/"+p.current_iteration),g),!0))}else e===rm&&(v.$set=$({},v.$set,(0,u._)({},"$survey_last_seen_date",(new Date).toISOString())));if("product tour shown"===e){var b=null==t?void 0:t.$product_tour_type;b&&(v.$set=$({},v.$set,(0,u._)({},"$product_tour_last_seen_date/"+b,(new Date).toISOString())))}var x=$({},v.properties.$set,v.$set);if(Z(x)||this.setPersonPropertiesForFlags(x),!ei(this.config.before_send)){var w=this.Pn(v);if(!w)return;v=w}this.ln.emit("eventCaptured",v);var E={method:"POST",url:null!=(i=null==n?void 0:n._url)?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:v,compression:"best-available",batchKey:null==n?void 0:n._batchKey,transport:null==n?void 0:n.transport};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this.yn(E):this.mn.enqueue(E),v}tG.critical("This capture call is ignored due to client rate limiting.")}}else tG.error("No event name provided to posthog.capture")}else tG.uninitializedWarning("posthog.capture")}},{key:"_addCaptureHook",value:function(e){return this.on("eventCaptured",function(t){return e(t.event,t)})}},{key:"calculateEventProperties",value:function(e,t,n,i,r){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var s,o=r?void 0:this.persistence.remove_event_timer(e),a=$({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.sn()&&(a.$cookieless_mode=!0),"$snapshot"===e){var u=$({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!ee(a.distinct_id)&&!er(a.distinct_id)||et(a.distinct_id))&&tG.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,d=function(e,t,n){if(!x)return{};var i,r,s,o,a,u,l,d,v,p,_,y,m=e?(0,h._)(re).concat((0,h._)(t||[])):[],k=(0,c._)(function(e){for(var t=0;tc.length>t;t++){var n=(0,c._)(tc[t],2),i=n[0],r=n[1],s=i.exec(e),o=s&&(J(r)?r(s,e):r);if(o)return o}return["",""]}(x),2),b=k[0],w=k[1],E=null!=(a="u">typeof navigator?navigator:void 0)&&a.brave?{brave:!0}:{},P={detectGoogleSearchApp:n},F=nY(nQ({$os:b,$os_version:w,$browser:ta(x,navigator.vendor,E,P),$device:th(x),$device_type:(l={userAgentDataPlatform:null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,maxTouchPoints:null==(r=navigator)?void 0:r.maxTouchPoints,screenWidth:null==f||null==(s=f.screen)?void 0:s.width,screenHeight:null==f||null==(o=f.screen)?void 0:o.height,devicePixelRatio:null==f?void 0:f.devicePixelRatio},(y=th(x))===ew||y===ex||"Kobo"===y||"Kindle Fire"===y||y===eQ?eb:y===ez||y===eG||y===eU||y===eJ?"Console":y===eS?"Wearable":y?em:"Android"===(null==l?void 0:l.userAgentDataPlatform)&&(null!=(d=null==l?void 0:l.maxTouchPoints)?d:0)>0?600>Math.min(null!=(v=null==l?void 0:l.screenWidth)?v:0,null!=(p=null==l?void 0:l.screenHeight)?p:0)/(null!=(_=null==l?void 0:l.devicePixelRatio)?_:1)?em:eb:"Desktop"),$timezone:rd(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:i4(null==g?void 0:g.href,m,rn),$host:null==g?void 0:g.host,$pathname:null==g?void 0:g.pathname,$raw_user_agent:x.length>1e3?x.substring(0,997)+"...":x,$browser_version:tl(x,navigator.vendor,E,P),$browser_language:ra(),$browser_language_prefix:"string"==typeof(u=ra())?u.split("-")[0]:void 0,$screen_height:null==f?void 0:f.screen.height,$screen_width:null==f?void 0:f.screen.width,$viewport_height:null==f?void 0:f.innerHe
1ight,$viewport_width:null==f?void 0:f.innerWidth,$lib:S.LIB_NAME,$lib_version:S.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return S.SDK_DIST_CHANNEL&&(F.$sdk_dist_channel=S.SDK_DIST_CHANNEL),F}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app);if(this.sessionManager){var v=this.sessionManager.checkAndGetSessionAndWindowId(r,n.getTime()),p=v.sessionId,y=v.windowId;a.$session_id=p,a.$window_id=y}this.sessionPropsManager&&nY(a,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&nY(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(s=this.bn)?void 0:s.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===sE&&(a.$lib_custom_api_host=this.config.api_host),l=e!==nU||r?e!==nG||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,i),a=nY(a,l),e===nU&&_&&(a.title=_.title),!Q(o)){var m=n.getTime()-o;a.$duration=parseFloat((m/1e3).toFixed(3))}x&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=nY({},d,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Y(this.config.property_denylist)?nK(this.config.property_denylist,function(e){delete a[e]}):tG.error(sH+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var k=this.config.sanitize_properties;k&&(tG.error(sj),a=k(a,e));var b=this.On();return a.$process_person_profile=b,b&&!r&&this.Ln("_calculate_event_properties"),a}},{key:"Rn",value:function(e,t,n){if(void 0===t&&(t=!0),void 0===n&&(n=!1),!this.persistence||!this.On()||this.an&&!n)return e;var i,r=nY({},this.persistence.get_initial_props(),(null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps())||{},e||{}),s=this.config.sanitize_properties;return s&&(tG.error(sj),r=s(r,"$set_once")),t&&(this.an=!0),Z(r)?void 0:r}},{key:"register",value:function(e,t){var n;null==(n=this.persistence)||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var i;null==(i=this.persistence)||i.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null==(t=this.sessionPersistence)||t.register(e)}},{key:"unregister",value:function(e){var t;null==(t=this.persistence)||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}},{key:"An",value:function(e,t){this.register((0,u._)({},e,t))}},{key:"getFeatureFlag",value:function(e,t){var n;return null==(n=this.featureFlags)?void 0:n.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}},{key:"getFeatureFlagResult",value:function(e,t){var n;return null==(n=this.featureFlags)?void 0:n.getFeatureFlagResult(e,t)}},{key:"isFeatureEnabled",value:function(e,t){var n;return null==(n=this.featureFlags)?void 0:n.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}},{key:"updateFlags",value:function(e,t,n){var i;null==(i=this.featureFlags)||i.updateFlags(e,t,n)}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t,n){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(e,t,n)}},{key:"getEarlyAccessFeatures",value:function(e,t,n){var i;return void 0===t&&(t=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(e,t,n)}},{key:"on",value:function(e,t){return this.ln.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),function(){})}},{key:"onSurveysLoaded",value:function(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:sN}),function(){})}},{key:"onSessionId",value:function(e){var t,n;return null!=(t=null==(n=this.sessionManager)?void 0:n.onSessionId(e))?t:function(){}}},{key:"getSurveys",value:function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:sN})}},{key:"getActiveMatchingSurveys",value:function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:sN})}},{key:"renderSurvey",value:function(e,t){var n;null==(n=this.surveys)||n.renderSurvey(e,t)}},{key:"displaySurvey",value:function(e,t){var n;void 0===t&&(t=sT),null==(n=this.surveys)||n.displaySurvey(e,t)}},{key:"cancelPendingSurvey",value:function(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}},{key:"canRenderSurvey",value:function(e){var t,n;return null!=(t=null==(n=this.surveys)?void 0:n.canRenderSurvey(e))?t:{visible:!1,disabledReason:sN}}},{key:"canRenderSurveyAsync",value:function(e,t){var n,i;return void 0===t&&(t=!1),null!=(n=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(e,t))?n:Promise.resolve({visible:!1,disabledReason:sN})}},{key:"Fn",value:function(e){return!e||et(e)?(tG.critical("Unique user id has not been set in posthog.identify"),!1):e===nT?(tG.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())||(tG.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'),!1)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return tG.uninitializedWarning("posthog.identify");if(er(e)&&(e=e.toString(),tG.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Fn(e)&&this.Ln("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:e}),this.get_property(tY)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),e!==i&&e!==this.get_property(tJ)&&(this.unregister(tJ),this.register({distinct_id:e}));var r,s=(this.persistence.get_property(nw)||nD)===nD;e!==i&&s?(this.persistence.set_property(nw,nN),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.capture(nB,{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:n||{}}),this.dn=sg(e,t,n),null==(r=this.featureFlags)||r.setAnonymousDistinctId(i)):(t||n)&&this.setPersonProperties(t,n),e!==i&&(this.reloadFeatureFlags(),this.unregister(nm))}}},{key:"setPersonProperties",value:function(e,t){if((e||t)&&this.Ln("posthog.setPersonProperties")){var n=sg(this.get_distinct_id(),e,t);this.dn!==n?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.dn=n):tG.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}},{key:"group",value:function(e,t,n){if(e&&t){var i=this.getGroups(),r=i[e]!==t;if(r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:$({},i,(0,u._)({},e,t))}),r||n){var s={$group_type:e,$group_key:t};n&&(s.$group_set=n),this.capture(nW,s)}n&&this.setGroupPropertiesForFlags((0,u._)({},e,n)),r&&!n&&this.reloadFeatureFlags()}else tG.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e,t){var n;void 0===t&&(t=!0),null==(n=this.featureFlags)||n.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}},{key:"setGroupPropertiesForFlags",value:function(e,t){var n;void 0===t&&(t=!0),this.Ln("posthog.setGroupPropertiesForFlags")&&(null==(n=this.featureFlags)||n.setGroupPropertiesForFlags(e,t))}},{key:"resetGroupPropertiesForFlags",value:function(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){if(tG.info("reset"),!this.__loaded)return tG.uninitializedWarning("posthog.reset");var t,n,i,r,s,o,a,l,c,h=this.get_property(tY),d=this.get_property(t4);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(n=this.sessionPersistence)||n.clear(),Q(d)||null==(c=this.persistence)||c.register((0,u._)({},t4,d)),null==(i=this.surveys)||i.reset(),null==(r=this.Tn)||r.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(nw,nD),null==(l=this.sessionManager)||l.resetSessionId(),this.dn=null,this.config.cookieless_mode===nq)this.register_once({distinct_id:nT,$device_id:null},"");else{var f=this.config.get_device_id(n7());this.register_once({distinct_id:f,$device_id:e?f:h},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}},{key:"setIdentity",value:function(e,t){var n;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(n=this.conversations)||n.Nn()}},{key:"clearIdentity",value:function(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.Dn()}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,i=t.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(null!=e&&e.withTimestamp&&i){var s,o=null!=(s=e.timestampLookBack)?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-o,0)}return r}},{key:"alias",value:function(e,t){return e===this.get_property(tK)?(tG.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ln("posthog.alias")?(Q(t)&&(t=this.get_distinct_id()),e!==t?(this.An(tJ,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(tG.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var t=$({},this.config);if(X(e)){nY(this.config,sW(e));var n,i,r,s,o,a,u,l,c,h,d,f=this.gn();null==(n=this.persistence)||n.update_config(this.config,t,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r_($({},this.config,{persistence:"sessionStorage"}),f,!1);var v=this.vn(this.config.debug);eo(v)&&(this.config.debug=v),eo(this.config.debug)&&(this.config.debug?(S.DEBUG=!0,is.O()&&is.N("ph_debug",!0),tG.info("set_config",{config:e,oldConfig:t,newConfig:$({},this.config)})):(S.DEBUG=!1,is.O()&&is.q("ph_debug"))),null==(i=this.exceptionObserver)||i.onConfigChange(),null==(r=this.exceptions)||r.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||
1c.startIfEnabledOrStop(),null==(h=this.surveys)||h.loadIfEnabled(),this.$n(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}},{key:"_overrideSDKInfo",value:function(e,t){S.LIB_NAME=e,S.LIB_VERSION=t}},{key:"startSessionRecording",value:function(e){var t,n,i,r,s,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==(n=this.sessionRecording)||n.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null==(e=this.sessionRecording)||!e.started)}},{key:"captureException",value:function(e,t){if(this.exceptions){var n=Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent($({},i,t))}}},{key:"addExceptionStep",value:function(e,t){var n;null==(n=this.exceptions)||n.addExceptionStep(e,t)}},{key:"captureLog",value:function(e){var t;null==(t=this.logs)||t.captureLog(e)}},{key:"logger",get:function(){var t,n;return null!=(t=null==(n=this.logs)?void 0:n.logger)?t:e.qn}},{key:"startExceptionAutocapture",value:function(e){this.set_config({capture_exceptions:null==e||e})}},{key:"stopExceptionAutocapture",value:function(){this.set_config({capture_exceptions:!1})}},{key:"loadToolbar",value:function(e){var t,n;return null!=(t=null==(n=this.toolbar)?void 0:n.loadToolbar(e))&&t}},{key:"get_property",value:function(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!=(e=this.config.name)?e:sz;return t!==sz&&(t=sz+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(nw))===nN||(null==(t=this.sessionPersistence)?void 0:t.get_property(nw))===nN}},{key:"On",value:function(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===nj&&!this._isIdentified()&&Z(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tJ])&&(null==(t=this.persistence)||null==(t=t.props)||!t[nI]))}},{key:"En",value:function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}},{key:"createPersonProfile",value:function(){this.On()||this.Ln("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"setInternalOrTestUser",value:function(){this.Ln("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}},{key:"Ln",value:function(e){return"never"===this.config.person_profiles?(tG.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.An(nI,!0),!0)}},{key:"gn",value:function(){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!==nL)}},{key:"$n",value:function(){var e,t,n,i,r=this.gn();return(null==(e=this.persistence)?void 0:e.Tr)!==r&&(null==(n=this.persistence)||n.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.Tr)!==r&&(null==(i=this.sessionPersistence)||i.set_disabled(r)),r}},{key:"opt_in_capturing",value:function(t){var n;if(this.config.cookieless_mode!==nq){if(this.sn()){this.reset(!0),null==(s=this.sessionManager)||s.destroy(),null==(o=this.pageViewManager)||o.destroy(),this.sessionManager=new sv(this),this.pageViewM
1anager=new i0(this),this.persistence&&(this.sessionPropsManager=new sh(this,this.sessionManager,this.persistence));var i,r,s,o,a,u,l,c,h=null!=(a=null==(u=this.config.__extensionClasses)?void 0:u.sessionRecording)?a:null==(l=e.__defaultExtensionClasses)?void 0:l.sessionRecording;h&&(this.sessionRecording=this.rn(this.sessionRecording,new h(this)),this.Sn&&(null==(c=this.sessionRecording)||null==c.onRemoteConfig||c.onRemoteConfig(this.Sn)))}this.consent.optInOut(!0),this.$n(),this.Cn(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),this.config.cookieless_mode==nL&&(null==(i=this.surveys)||i.loadIfEnabled()),(Q(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!=(r=null==t?void 0:t.captureEventName)?r:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.In()}else tG.warn(sD)}},{key:"opt_out_capturing",value:function(){var e,t,n;this.config.cookieless_mode!==nq?(this.config.cookieless_mode===nL&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.$n(),this.config.cookieless_mode===nL&&(this.register({distinct_id:nT,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.In(),this.Cn())):tG.warn(sD)}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"get_explicit_consent_status",value:function(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}},{key:"is_capturing",value:function(){return this.config.cookieless_mode===nq||(this.config.cookieless_mode===nL?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this.$n()}},{key:"_is_bot",value:function(){return p?sp(p,this.config.custom_blocked_useragents):void 0}},{key:"In",value:function(){_&&("visible"===_.visibilityState?this.un||(this.un=!0,this.capture(nU,{title:_.title},{send_instantly:!0}),this.hn&&(_.removeEventListener(nH,this.hn),this.hn=null)):this.hn||(this.hn=this.In.bind(this),n1(_,nH,this.hn)))}},{key:"debug",value:function(e){!1===e?(null==f||f.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==f||f.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}))}},{key:"Kr",value:function(){var e,t,n,i,r=this.fn||{};return"advanced_disable_flags"in r?!!r.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(tG.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",n=(e="advanced_disable_flags")in r&&!ei(r[e]),i=t in r&&!ei(r[t]),n?r[e]:!!i&&(tG&&tG.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}},{key:"Pn",value:function(e){if(ei(this.config.before_send))return e;var t=Y(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e,i=!0,r=!1,s=void 0;try{for(var o,a=t[Symbol.iterator]();!(i=(o=a.next()).done);i=!0){if(n=(0,o.value)(n),ei(n)){var u,l="Event '"+e.event+"' was rejected in beforeSend function";
1return(u=e.event,U(R,u))?tG.warn(l+". This can cause unexpected behavior."):tG.info(l),null}n.properties&&!Z(n.properties)||tG.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}}catch(e){r=!0,s=e}finally{try{i||null==a.return||a.return()}finally{if(r)throw s}}return n}},{key:"getPageViewId",value:function(){var e;return null==(e=this.pageViewManager.dr)?void 0:e.pageViewId}},{key:"captureTraceFeedback",value:function(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}},{key:"captureTraceMetric",value:function(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}},{key:"vn",value:function(e){var t=eo(e)&&!e,n=is.O()&&"true"===is.A("ph_debug");return!t&&(!!n||e)}}]),e}();sK.__defaultExtensionClasses={},sK.qn={trace:sw=function(){},debug:sw,info:sw,warn:sw,error:sw,fatal:sw},function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=nZ(e.prototype[t[n]])}(sK,["identify"]);var sY=function(){function e(t){(0,o._)(this,e),this.disabled=!1===t;var n=X(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}return(0,a._)(e,[{key:"isRageClick",value:function(e,t,n){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&this.timeoutMs>n-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),sJ="$copy_autocapture",sX=tB("[AutoCapture]");function sZ(e,t){return t.length>e?t.slice(0,e)+"...":t}var sQ=tB("[ExceptionAutocapture]"),s0=tB("[TracingHeaders]"),s1=tB("[Web Vitals]"),s2="disabled",s3="lazy_loading",s5="awaiting_config",s8="missing_config";tB("[SessionRecording]"),tB("[SessionRecording]");var s6="[SessionRecording]",s4=tB(s6),s7=tB("[Heatmaps]");function s9(e){return X(e)&&"clientX"in e&&"clientY"in e&&er(e.clientX)&&er(e.clientY)}var oe=tB("[Product Tours]"),ot=function(e){var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(t8))},on=["$set_once","$set"],oi=tB("[SiteApps]"),or="Error while initializing PostHog app with config id ";function os(e,t,n){if(ei(e))return!1;switch(n){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}var oo=function(){function e(t){var n=this;(0,o._)(this,e),this.jn=new sd,this.Bn=function(e,t){return n.Hn(e,t)&&n.Un(e,t)&&n.zn(e,t)&&n.Vn(e,t)},this.Hn=function(e,t){return null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)},this._instance=t,this.Wn=new Set,this.Gn=new Set}return(0,a._)(e,[{key:"init",value:function(){var e,t,n=this;Q(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook(function(e,t){n.on(e,t)})}},{key:"register",value:function(e){var t=this;if(!Q(null==(n=this._instance)?void 0:n._addCaptureHook)&&(e.forEach(function(e){var n,i;null==(n=t.Gn)||n.add(e),null==(i=e.steps)||i.forEach(function(e){var n;null==(n=t.Wn)||n.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var n,i,r,s=new Set;e.forEach(function(e){var t;null==(t=e.steps)||t.forEach(function(e){null!=e&&e.selector&&s.add(null==e?void 0:e.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(s)}}},{key:"on",value:function(e,t){var n,i=this;null!=t&&0!=e.length&&(this.Wn.has(e)||this.Wn.has(null==t?void 0:t.event))&&this.Gn&&(null==(n=this.Gn)?void 0:n.size)>0&&this.Gn.forEach(function(e){i.Zn(t,e)&&i.jn.emit("actionCaptured",e.name)})}},{key:"Qn",value:function(e){this.onAction("actionCaptured",function(t){return e(t)})}},{key:"Zn",value:function(e,t){if(null==(null==t?void 0:t.steps))return!1;var n=!0,i=!1,r=void 0;try{for(var s,o=t.steps[Symbol.iterator]();!(n=(s=o.next()).done);n=!0){var a=s.value;if(this.Bn(e,a))return!0}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return!1}},{key:"onAction",value:function(e,t){return this.jn.on(e,t)}},{key:"Un",value:function(e,t){if(null!=t&&t.url){var n,i=null==e||null==(n=e.properties)?void 0:n.$current_url;if(!i||"string"!=typeof i||!os(i,t.url,t.url_matching||"contains"))return!1}return!0}},{key:"zn",value:function(e,t){return!!this.Jn(e,t)&&!!this.Kn(e,t)&&!!this.Yn(e,t)}},{key:"Jn",value:function(e,t){if(null==t||!t.href)return!0;var n=this.Xn(e);if(n.length>0)return n.some(function(e){return os(e.href,t.href,t.href_matching||"exact")});var i,r,s=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";return!!s&&os((r=s.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}},{key:"Kn",value:function(e,t){if(null==t||!t.text)return!0;var n=this.Xn(e);if(n.length>0)return n.some(function(e){return os(e.text,t.text,t.text_matching||"exact")||os(e.$el_text,t.text,t.text_matching||"exact")});var i,r,s,o,a=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";return!!a&&(r=function(e){for(var t,n=[],i=/(?::|")text="(.*?)"/g;!ei(t=i.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(a),s=t.text,o=t.text_matching||"exact",r.some(function(e){return os(e,s,o)}))}},{key:"Yn",value:function(e,t){if(null==t||!t.selector)return!0;var n,i,r=null==e||null==(n=e.properties)?void 0:n.$element_selectors;if(null!=r&&r.includes(t.selector))return!0;var s=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch(e){}return!1}},{key:"Xn",value:function(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}},{key:"Vn",value:function(e,t){return null==t||!t.properties||0===t.properties.length||sk(t.properties.reduce(function(e,t){var n=Y(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:n,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}]),e}(),oa=function(e){function t(e){return(0,o._)(this,t),(0,s._)(this,t,[e])}return(0,l._)(t,e),(0,a._)(t,[{key:"ds",value:function(){return ng}},{key:"vs",value:function(){return rm}},{key:"ls",value:function(e){var t;null==(t=this._instance)||t.getSurveys(e)}},{key:"ps",value:function(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}},{key:"le",value:function(){return s$}},{key:"ys",value:function(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register((0,u._)({},ng,e))}},{key:"gs",value:function(){return!1}},{key:"getSurveys",value:function(){return this.getActivatedIds()}},{key:"getEventToSurveys",value:function(){return this.getEventToItems
1Map()}}]),t}(function(){function e(t){(0,o._)(this,e),this._instance=t,this.es=new Map,this.ts=new Map,this.rs=new Map}return(0,a._)(e,[{key:"ns",value:function(e,t){return!!e&&sk(e.propertyFilters,null==t?void 0:t.properties)}},{key:"ss",value:function(e,t){var n=new Map;return e.forEach(function(e){var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach(function(t){if(null!=t&&t.name){var i=n.get(t.name)||[];i.push(e.id),n.set(t.name,i)}})}),n}},{key:"os",value:function(e,t,n){var i=this,r=(n===rg?this.es:this.ts).get(e),s=[];return this.ls(function(e){s=e.filter(function(e){return null==r?void 0:r.includes(e.id)})}),s.filter(function(r){var s,o=null==(s=r.conditions)||null==(s=s[n])||null==(s=s.values)?void 0:s.find(function(t){return t.name===e});return i.ns(o,t)})}},{key:"register",value:function(e){var t;Q(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.us(e),this.hs(e))}},{key:"hs",value:function(e){var t=this,n=e.filter(function(e){var t,n;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)?void 0:n.length)>0});0!==n.length&&(null==this.cs&&(this.cs=new oo(this._instance),this.cs.init(),this.cs.Qn(function(e){t.onAction(e)})),n.forEach(function(e){var n,i,r,s,o;e.conditions&&null!=(n=e.conditions)&&n.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=t.cs)||s.register(e.conditions.actions.values),null==(o=e.conditions)||null==(o=o.actions)||null==(o=o.values)||o.forEach(function(n){if(n&&n.name){var i=t.rs.get(n.name);i&&i.push(e.id),t.rs.set(n.name,i||[e.id])}}))}))}},{key:"us",value:function(e){var t,n=this,i=e.filter(function(e){var t,n;return(null==(t=e.conditions)?void 0:t.events)&&(null==(n=e.conditions)||null==(n=n.events)||null==(n=n.values)?void 0:n.length)>0}),r=e.filter(function(e){var t,n;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(n=e.conditions)||null==(n=n.cancelEvents)||null==(n=n.values)?void 0:n.length)>0});0===i.length&&0===r.length||(null==(t=this._instance)||t._addCaptureHook(function(e,t){n.onEvent(e,t)}),this.es=this.ss(e,rg),this.ts=this.ss(e,ry))}},{key:"onEvent",value:function(e,t){var n,i=this,r=this.le(),s=this.ds(),o=this.vs(),a=(null==(n=this._instance)||null==(n=n.persistence)?void 0:n.props[s])||[];if(o===e&&t&&a.length>0){r.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:a});var u,l,c=(null==t||null==(u=t.properties)?void 0:u.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(c){var h=a.indexOf(c);0>h||(a.splice(h,1),this.fs(a))}}else{if(this.ts.has(e)){var d=this.os(e,t,ry);d.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:d.map(function(e){return e.id})}),d.forEach(function(e){var t=a.indexOf(e.id);0>t||a.splice(t,1),i.ps(e.id)}),this.fs(a))}if(this.es.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.es.get(e)});var f=this.os(e,t,rg);this.fs(a.concat(f.map(function(e){return e.id})||[]))}}}},{key:"onAction",value:function(e){var t,n=this.ds(),i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[n])||[];this.rs.has(e)&&this.fs(i.concat(this.rs.get(e)||[]))}},{key:"fs",value:function(e){var t=this,n=this.le(),i=(0,h._)(new Set(e)).filter(function(e){return!t.gs(e)});n.info("updating activated items",{activatedItems:i}),this.ys(i)}},{key:"getActivatedIds",value:function(){var e,t=this.ds();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}},{key:"getEventToItemsMap",value:function(){return this.es}},{key:"bs",value:function(){return this.cs}}]),e}()),ou="SDK is not enabled or survey functionality is not yet loaded",ol="Disabled. Not loading surveys.",oc=null!=f&&f.location?i7(f.location.hash,"__posthog")||i7(location.hash,"state"):null,oh="_postHogToolbarParams",od=tB("[Toolbar]"),of=tB("[FeatureFlags]"),ov=tB("[FeatureFlags]",{debugEnabled:!0}),op="\" failed. Feature flags didn't load in time.",o_=function(e){for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},og=function(e){var t={},n=!0,i=!1,r=void 0;try{for(var s,o=nJ(e||{})[Symbol.iterator]();!(n=(s=o.next()).done);
1n=!0){var a=(0,c._)(s.value,2),u=a[0],l=a[1];l&&(t[u]=l)}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}return t},oy=tB("[Error tracking]"),om="Refusing to render web experiment since the viewer is a likely bot",ok={icontains:function(e,t){return!!f&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e,t){return!!f&&-1===t.href.toLowerCase().indexOf(e.toLowerCase())},regex:function(e,t){return!!f&&s_(t.href,e)},not_regex:function(e,t){return!!f&&!s_(t.href,e)},exact:function(e,t){return t.href===e},is_not:function(e,t){return t.href!==e}},ob=function(){function e(t){var n=this;(0,o._)(this,e);var i=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),i.getWebExperiments(function(t){e._s("retrieved web experiments from the server"),i.ws=new Map,t.forEach(function(t){if(t.feature_flag_key){i.ws&&(e._s("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(n=i.ws)||n.set(t.feature_flag_key,t));var n,r=i._instance.getFeatureFlag(t.feature_flag_key);ee(r)&&t.variants[r]&&i.xs(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var s in t.variants){var o=t.variants[s];e.ks(o)&&i.xs(t.name,s,o.transforms)}})},t)},this._instance=t,this._instance.onFeatureFlags(function(e){n.onFeatureFlags(e)})}return(0,a._)(e,[{key:"qt",get:function(){return this._instance.config}},{key:"initialize",value:function(){}},{key:"onFeatureFlags",value:function(t){var n=this;if(this._is_bot())e._s(om);else if(!this.qt.disable_web_experiments){if(ei(this.ws))return this.ws=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e._s("applying feature flags",t),t.forEach(function(e){var t;if(n.ws&&null!=(t=n.ws)&&t.has(e)){var i,r=n._instance.getFeatureFlag(e),s=null==(i=n.ws)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&n.xs(s.name,r,s.variants[r].transforms)}})}}},{key:"previewWebExperiment",value:function(){var t=this,n=e.getWindowLocation();if(null!=n&&n.search){var i=i6(null==n?void 0:n.search,"__experiment_id"),r=i6(null==n?void 0:n.search,"__experiment_variant");i&&r&&(e._s("previewing web experiments "+i+" && "+r),this.getWebExperiments(function(e){t.Ss(parseInt(i),r,e)},!1,!0))}}},{key:"loadIfEnabled",value:function(){this.qt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}},{key:"getWebExperiments",value:function(e,t,n){if(this.qt.disable_web_experiments&&!n)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.qt.token),method:"GET",callback:function(t){return e(200===t.statusCode&&t.json&&t.json.experiments||[])}})}},{key:"Ss",value:function(t,n,i){var r=i.filter(function(e){return e.id===t});r&&r.length>0&&(e._s("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this.xs(r[0].name,n,r[0].variants[n].transforms))}},{key:"xs",value:function(t,n,i){this._is_bot()?e._s(om):"control"!==n?i.forEach(function(i){if(i.selector){e._s("applying transform of variant "+n+" for experiment "+t+" ",i);var r,s=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==s||s.forEach(function(e){i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):e._s("Control variants leave the page unmodified.")}},{key:"_is_bot",value:function(){return p&&this._instance?sp(p,this.qt.custom_blocked_useragents):void 0}}],[{key:"ks",value:function(t){return!ei(t.conditions)&&e.Cs(t)&&e.Is(t)}},{key:"Cs",value:function(t){if(ei(t.conditions)||ei(null==(n=t.conditions)?void 0:n.url))return!0;var n,i,r,s,o=e.getWindowLocation();return!!o&&(null==(i=t.conditions)||!i.url||ok[null!=(r=null==(s=t.conditions)?void 0:s.urlMatchType)?r:"icontains"](t.conditions.url,o))}},{key:"getWindowLocation",value:function(){return null==f?void 0:f.location}},{key:"Is",value:function(e){if(ei(e.conditions)||ei(null==(n=e.conditions)?void 0:n.utm))return!0;var t=rr();if(t.utm_source){var n,i,r,s,o,a,u,l,c,h=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==t.utm_campaign,d=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==t.utm_source,f=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==t.utm_medium,v=null==(l=e.conditions)||null==(l=l.utm)||!l.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==t.utm_term;return h&&f&&v&&d}return!1}},{key:"_s",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];tG.info("[WebExperiments] "+e,n)}}]),e}(),ox=tB("[Conversations]"),ow="Conversations not available yet.",oE={featureFlags:function(){function e(t){(0,o._)(this,e),this.Ts=!1,this.Es=!1,this.Ms=!1,this.Rs=!1,this.Ps=!1,this.Os=!1,this.Ls=!1,this.As=!1,this._instance=t,this.featureFlagEventHandlers=[]}return(0,a._)(e,[{key:"qt",get:function(){return this._instance.config}},{key:"Si",get:function(){return this._instance.persistence}},{key:"Fs",value:function(e){return this._instance.get_property(e)}},{key:"Ns",value:function(){var e,t;return null!=(e=null==(t=this.Si)?void 0:t.Mr(this.qt.feature_flag_cache_ttl_ms))&&e}},{key:"Ds",value:function(){return!!this.Ns()&&(this.As||this.Ms||(this.As=!0,of.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}},{key:"$s",value:function(){var e,t=null!=(e=this.qt.evaluation_contexts)?e:this.qt.evaluation_environments;return!this.qt.evaluation_environments||this.qt.evaluation_contexts||this.Ls||(of.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Ls=!0),null!=t&&t.length?t.filter(function(e){var t=e&&"string"==typeof e&&e.trim().length>0;return t||of.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}},{key:"qs",value:function(){return this.$s().length>0}},{key:"js",value:function(){var e=this.qt.flag_keys;if(!Q(e)){if(Y(e))return e.filter(function(e){var t=e&&"string"==typeof e&&e.trim().length>0;return t||of.error("Invalid flag key found:",e,"Expected non-empty string"),t});of.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}},{key:"initialize",value:function(){var e,t,n=this._instance.config,i=null!=(e=null==(t=n.bootstrap)?void 0:t.featureFlags)?e:{};
1if(Object.keys(i).length){var r,s,o=null!=(r=null==(s=n.bootstrap)?void 0:s.featureFlagPayloads)?r:{},a=Object.keys(i).filter(function(e){return!!i[e]}).reduce(function(e,t){return e[t]=i[t]||!1,e},{}),u=Object.keys(o).filter(function(e){return a[e]}).reduce(function(e,t){return o[t]&&(e[t]=o[t]),e},{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:u})}}},{key:"updateFlags",value:function(e,t,n){var i=null!=n&&n.merge?this.getFlagVariants():{},r=null!=n&&n.merge?this.getFlagPayloads():{},s=$({},i,e),o=$({},r,t),a={},u=!0,l=!1,h=void 0;try{for(var d,f=Object.entries(s)[Symbol.iterator]();!(u=(d=f.next()).done);u=!0){var v=(0,c._)(d.value,2),p=v[0],_=v[1],g="string"==typeof _;a[p]={key:p,enabled:!!g||!!_,variant:g?_:void 0,reason:void 0,metadata:Q(null==o?void 0:o[p])?void 0:{id:0,version:void 0,description:void 0,payload:o[p]}}}}catch(e){l=!0,h=e}finally{try{u||null==f.return||f.return()}finally{if(l)throw h}}this.receivedFeatureFlags({flags:a})}},{key:"hasLoadedFlags",get:function(){return this.Es}},{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagsWithDetails",value:function(){var e=this.Fs(nu),t=this.Fs(nh),n=this.Fs(nd);if(!n&&!t)return e||{};var i=nY({},e||{}),r=(0,h._)(new Set((0,h._)(Object.keys(n||{})).concat((0,h._)(Object.keys(t||{}))))),s=!0,o=!1,a=void 0;try{for(var u,l=r[Symbol.iterator]();!(s=(u=l.next()).done);s=!0){var c,d,f=u.value,v=i[f],p=null==t?void 0:t[f],_=Q(p)?null!=(c=null==v?void 0:v.enabled)&&c:!!p,g=Q(p)?v.variant:"string"==typeof p?p:void 0,y=null==n?void 0:n[f],m=$({},v,{enabled:_,variant:_?null!=g?g:null==v?void 0:v.variant:void 0});_!==(null==v?void 0:v.enabled)&&(m.original_enabled=null==v?void 0:v.enabled),g!==(null==v?void 0:v.variant)&&(m.original_variant=null==v?void 0:v.variant),y&&(m.metadata=$({},null==v?void 0:v.metadata,{payload:y,original_payload:null==v||null==(d=v.metadata)?void 0:d.payload})),i[f]=m}}catch(e){o=!0,a=e}finally{try{s||null==l.return||l.return()}finally{if(o)throw a}}return this.Ts||(of.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:i}),this.Ts=!0),i}},{key:"getFlagVariants",value:function(){var e=this.Fs(ns),t=this.Fs(nh);if(!t)return e||{};for(var n=nY({},e),i=Object.keys(t),r=0;i.length>r;r++)n[i[r]]=t[i[r]];return this.Ts||(of.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Ts=!0),n}},{key:"getFlagPayloads",value:function(){var e=this.Fs(nl),t=this.Fs(nd);if(!t)return e||{};for(var n=nY({},e||{}),i=Object.keys(t),r=0;i.length>r;r++)n[i[r]]=t[i[r]];return this.Ts||(of.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Ts=!0),n}},{key:"reloadFeatureFlags",value:function(){var e=this;this.Rs||this.qt.advanced_disable_feature_flags||this.Bs||(this._instance.ln.emit("featureFlagsReloading",!0),this.Bs=setTimeout(function(){e.Hs()},5))}},{key:"Us",value:function(){clearTimeout(this.Bs),this.Bs=void 0}},{key:"ensureFlagsLoaded",value:function(){this.Es||this.Ms||this.Bs||this.reloadFeatureFlags()}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.Rs=e}},{key:"Hs",value:function(e){var t,n=this;if(this.Us(),!this._instance.Kr())if(this.Ms)this.Ps=!0;else{var r=this.qt.token,s=this.Fs(tY),o={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:$({},(null==(t=this.Si)?void 0:t.get_initial_props())||{},this.Fs(nf)||{}),group_properties:this.Fs(nv),timezone:rd()};en(s)||Q(s)||(o.$device_id=s),(null!=e&&e.disableFlags||this.qt.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.qs()&&(o.evaluation_contexts=this.$s());var a=this.js();Q(a)||(o.flag_keys=a);var l=!!this.qt.advanced_only_evaluate_survey_feature_flags,c=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.qt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Ms=!0,this._instance._send_request({method:"POST",url:c,data:o,compression:this.qt.disable_compression?void 0:rF,timeout:this.qt.feature_flag_request_timeout_ms,callback:function(e){var t,r,s,a=!0;if(200===e.statusCode&&(n.Ps||(n.$anon_distinct_id=void 0),a=!1),n.Ms=!1,!o.disable_flags||n.Ps){
1n.Os=!a;var c=[];e.error?(0,i._)(e.error,Error)?c.push("AbortError"===e.error.name?"timeout":"connection_error"):c.push("unknown_error"):200!==e.statusCode&&c.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&c.push("errors_while_computing_flags");var h,d=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));(d&&c.push("quota_limited"),null==(s=n.Si)||s.register((0,u._)({},nb,c)),d)?of.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."):(o.disable_flags||n.receivedFeatureFlags(null!=(h=e.json)?h:{},a,{partialResponse:l}),n.Ps&&(n.Ps=!1,n.Hs()))}}})}}},{key:"getFeatureFlag",value:function(e,t){var n;if(void 0===t&&(t={}),!t.fresh||this.Os)if(this.Es||this.getFlags()&&this.getFlags().length>0){if(!this.Ds()){var i=this.getFeatureFlagResult(e,t);return null!=(n=null==i?void 0:i.variant)?n:null==i?void 0:i.enabled}}else of.warn('getFeatureFlag for key "'+e+op)}},{key:"getFeatureFlagDetails",value:function(e){return this.getFlagsWithDetails()[e]}},{key:"getFeatureFlagPayload",value:function(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}},{key:"getFeatureFlagResult",value:function(e,t){if(void 0===t&&(t={}),!t.fresh||this.Os)if(this.Es||this.getFlags()&&this.getFlags().length>0){if(!this.Ds()){var n=this.getFlagVariants(),i=e in n,r=n[e],s=this.getFlagPayloads()[e],o=String(r),a=this.Fs(nc)||void 0,l=this.Fs(nx)||void 0,c=this.Fs(nm)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var d,f,v=this._instance.get_session_id(),p=this.Fs(nk);v&&v!==p&&(c={},null==(f=this.Si)||f.register((d={},(0,u._)(d,nm,c),(0,u._)(d,nk,v),d)))}if((t.send_event||!("send_event"in t))&&(!(e in c)||!c[e].includes(o))){Y(c[e])?c[e].push(o):c[e]=[o],null==(m=this.Si)||m.register((0,u._)({},nm,c));var _=this.getFeatureFlagDetails(e),g=(0,h._)(null!=(k=this.Fs(nb))?k:[]);Q(r)&&g.push("flag_missing");var y={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(b=this.qt.bootstrap)||null==(b=b.featureFlags)?void 0:b[e])||null,$feature_flag_bootstrapped_payload:(null==(x=this.qt.bootstrap)||null==(x=x.featureFlagPayloads)?void 0:x[e])||null,$used_bootstrap_value:!this.Os};Q(null==_||null==(w=_.metadata)?void 0:w.version)||(y.$feature_flag_version=_.metadata.version);var m,k,b,x,w,E,S,P,F,$,I,O=null!=(E=null==_||null==(S=_.reason)?void 0:S.description)?E:null==_||null==(P=_.reason)?void 0:P.code;O&&(y.$feature_flag_reason=O),null!=_&&null!=(F=_.metadata)&&F.id&&(y.$feature_flag_id=_.metadata.id),Q(null==_?void 0:_.original_variant)&&Q(null==_?void 0:_.original_enabled)||(y.$feature_flag_original_response=Q(_.original_variant)?_.original_enabled:_.original_variant),null!=_&&null!=($=_.metadata)&&$.original_payload&&(y.$feature_flag_original_payload=null==_||null==(I=_.metadata)?void 0:I.original_payload),g.length&&(y.$feature_flag_error=g.join(",")),this._instance.capture("$feature_flag_called",y)}if(i){var T=s;if(!Q(s))try{T=JSON.parse(s)}catch(e){}return{key:e,enabled:!!r,variant:"string"==typeof r?r:void 0,payload:T}}}}else of.warn('getFeatureFlagResult for key "'+e+op)}},{key:"getRemoteConfigPayload",value:function(e,t){var n=this.qt.token,i={distinct_id:this._instance.get_distinct_id(),token:n};this.qs()&&(i.evaluation_contexts=this.$s());var r=this.js();Q(r)||(i.flag_keys=r),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.qt.disable_compression?void 0:rF,timeout:this.qt.feature_flag_request_timeout_ms,callback:function(n){var i,r=null==(i=n.json)?void 0:i.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}},{key:"isFeatureEnabled",value:function(e,t){if(void 0===t&&(t={}),!t.fresh||this.Os){if(this.Es||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return Q(n)?void 0:!!n}of.warn('isFeatureEnabled for key "'+e+op)}}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})}},{key:"receivedFeatureFlags",value:function(e,t,n){if(this.Si){this.Es=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(e,t,n,i,r,s){void 0===n&&(n={}),void 0===i&&(i={}),void 0===r&&(r={});var o=((v=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(v).map(function(e){var t;return[e,null!=(t=v[e].variant)?t:v[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(v).filter(function(e){return v[e].enabled}).filter(function(e){var t;return null==(t=v[e].metadata)?void 0:t.payload}).map(function(e){var t;return[e,null==(t=v[e].metadata)?void 0:t.payload]}))):of.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),a=o.flags,l=o.featureFlags,h=o.featureFlagPayloads;if(l){var d=e.requestId,f=e.evaluatedAt;if(Y(l)){of.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v,p,_={};if(l)for(var g=0;l.length>g;g++)_[l[g]]=!0;t&&t.register((p={},(0,u._)(p,no,l),(0,u._)(p,ns,_),p))}else{var y,m=l,k=h,b=a;if(null!=s&&s.partialResponse)m=$({},n,m),k=$({},i,k),b=$({},r,b);else if(e.errorsWhileComputingFlags)if(a){var x=new Set(Object.keys(a).filter(function(e){var t;return!(null!=(t=a[e])&&t.failed)}));m=$({},n,Object.fromEntries(Object.entries(m).filter(function(e){var t=(0,c._)(e,1)[0];return x.has(t)}))),k=$({},i,Object.fromEntries(Object.entries(k||{}).filter(function(e){var t=(0,c._)(e,1)[0];return x.has(t)}))),b=$({},r,Object.fromEntries(Object.entries(b||{}).filter(function(e){var t=(0,c._)(e,1)[0];return x.has(t)})))}else m=$({},n,m),k=$({},i,k),b=$({},r,b);
1t&&t.register($((y={},(0,u._)(y,no,Object.keys(og(m))),(0,u._)(y,ns,m||{}),(0,u._)(y,nl,k||{}),(0,u._)(y,nu,b||{}),y),d?(0,u._)({},nc,d):{},f?(0,u._)({},nx,f):{}))}}}(e,this.Si,i,r,s,n),t||(this.As=!1),this.zs(t)}}},{key:"override",value:function(e,t){void 0===t&&(t=!1),of.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}},{key:"overrideFeatureFlags",value:function(e){if(!this._instance.__loaded||!this.Si)return of.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.Si.unregister(nh),this.Si.unregister(nd),this.zs(),ov.info("All overrides cleared");if(Y(e)){var t,n=o_(e);return this.Si.register((0,u._)({},nh,n)),this.zs(),ov.info("Flag overrides set",{flags:e})}if(e&&"object"==(void 0===e?"undefined":(0,r._)(e))&&("flags"in e||"payloads"in e)){if(this.Ts=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this.Si.unregister(nh),ov.info("Flag overrides cleared");else if(e.flags){if(Y(e.flags)){var i=o_(e.flags);this.Si.register((0,u._)({},nh,i))}else this.Si.register((0,u._)({},nh,e.flags));ov.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.Si.unregister(nd),ov.info("Payload overrides cleared")):e.payloads&&(this.Si.register((0,u._)({},nd,e.payloads)),ov.info("Payload overrides set",{payloads:e.payloads}))),void this.zs()}if(e&&"object"==(void 0===e?"undefined":(0,r._)(e)))return this.Si.register((0,u._)({},nh,e)),this.zs(),ov.info("Flag overrides set",{flags:e});of.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.Es){var n=this.Vs();e(n.flags,n.flagVariants)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t,n){var i,r,s=(this.Fs(na)||[]).find(function(t){return t.flagKey===e}),o=(0,u._)({},"$feature_enrollment/"+e,t),a={$feature_flag:e,$feature_enrollment:t,$set:o};s&&(a.$early_access_feature_name=s.name),n&&(a.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=$({},this.getFlagVariants(),(0,u._)({},e,t));null==(r=this.Si)||r.register((i={},(0,u._)(i,no,Object.keys(og(l))),(0,u._)(i,ns,l),i)),this.zs()}},{key:"getEarlyAccessFeatures",value:function(e,t,n){var i=this;void 0===t&&(t=!1);var r=this.Fs(na),s=n?"&"+n.map(function(e){return"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:function(t){var n,r;if(t.json){var s=t.json.earlyAccessFeatures;return null==(n=i.Si)||n.unregister(na),null==(r=i.Si)||r.register((0,u._)({},na,s)),e(s)}}})}},{key:"Vs",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(e){return t[e]}),flagVariants:Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){return e[n]=t[n],e},{})}}},{key:"zs",value:function(e){var t=this.Vs(),n=t.flags,i=t.flagVariants;this.featureFlagEventHandlers.forEach(function(t){return t(n,i,{errorsLoading:e})})}},{key:"setPersonPropertiesForFlags",value:function(e,t){void 0===t&&(t=!0);var n=this.Fs(nf)||{},i=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),r=null==e?void 0:e.$set_once,s={};if(r)for(var o in r)({}).hasOwnProperty.call(r,o)&&(o in n||(s[o]=r[o]));this._instance.register((0,u._)({},nf,$({},n,s,i))),t&&this._instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(e){void 0===e&&(e=!0),this._instance.unregister(nf),e&&this._instance.reloadFeatureFlags()}},{key:"setGroupPropertiesForFlags",value:function(e,t){void 0===t&&(t=!0);var n=this.Fs(nv)||{};0!==Object.keys(n).length&&Object.keys(n).forEach(function(t){n[t]=$({},n[t],e[t]),delete e[t]}),this._instance.register((0,u._)({},nv,$({},n,e))),t&&this._instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.Fs(nv)||{};this._instance.register((0,u._)({},nv,$({},t,(0,u._)({},e,{}))))}else this._instance.unregister(nv)}},{key:"reset",value:function(){this.Es=!1,this.Ms=!1,this.Rs=!1,this.Ps=!1,this.Os=!1,this.$anon_distinct_id=void 0,this.Us(),this.Ts=!1}}]),e}()},oS={sessionRecording:function(){function e(t){if((0,o._)(this,e),this._forceAllowLocalhostNetworkCapture=!1,this.Gs=s2,this.Zs=void 0,this._instance=t,!this._instance.sessionManager)throw s4.error("started without valid sessionManager"),Error(s6+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===nq)throw Error(s6+' cannot be used with cookieless_mode="always"')}return(0,a._)(e,[{key:"qt",get:function(){return this._instance.config}},{key:"Si",get:function(){return this._instance.persistence}},{key:"started",get:function(){var e;return!(null==(e=this.Ws)||!e.isStarted)}},{key:"status",get:function(){var e,t;return this.Gs===s5||this.Gs===s8?this.Gs:null!=(e=null==(t=this.Ws)?void 0:t.status)?e:this.Gs}},{key:"initialize",value:function(){this.startIfEnabledOrStop()}},{key:"Qs",get:function(){var e,t=!(null==(e=this._instance.get_property(t4))||!e.enabled),n=!this.qt.disable_session_recording,i=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return f&&t&&n&&!i}},{key:"startIfEnabledOrStop",value:function(e){var t;if(!this.Qs||null==(t=this.Ws)||!t.isStarted){var n=!Q(Object.assign)&&!Q(Array.from);this.Qs&&n?(this.Js(e),s4.info("starting")):(this.Gs=s2,this.stopRecording())}}},{key:"Js",value:function(e){var t,n,i,r=this;this.Qs&&(this.Gs!==s5&&this.Gs!==s8&&(this.Gs=s3),null!=w&&null!=(t=w.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(n=w.__PosthogExtensions__)&&n.initSessionRecording?this.Ks(e):null==(i=w.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Ys,function(t){if(t)return s4.error("could not load recorder",t);r.Ks(e)}))}},{key:"stopRecording",value:function(){var e,t;null==(e=this.Zs)||e.call(this),this.Zs=void 0,null==(t=this.Ws)||t.stop()}},{key:"Xs",value:function(){var e,t;null==(e=this.Zs)||e.call(this),this.Zs=void 0,null==(t=this.Ws)||t.discard()}},{key:"eo",value:function(){var e,t;null==(e=this.Si)||e.unregister(nr),null==(t=this.Si)||t.unregister(t7)}},{key:"ro",value:function(e,t){if(ei(e))return null;var n=er(e)?e:parseFloat(e);return"number"!=typeof n||!Number.isFinite(n)||0>n||n>1?(s4.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):n}},{key:"io",value:function(e){var t=this;if(this.Si){var n,i,r=this.Si,s=function(){var n,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=t.ro(null==(n=t.qt.session_recording)?void 0:n.sampleRate,"session_recording.sampleRate"),o=t.ro(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;ei(a)&&t.eo();var l=null==i?void 0:i.minimumDurationMilliseconds;r.register((0,u._)({},t4,$({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:$({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:a,minimumDurationMilliseconds:Q(l)?null:l,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==(n=this.Zs)||n.call(this),this.Zs=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}},{key:"onRemoteConfig",value:function(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.io(e),void this.Xs()):(this.io(e),void this.startIfEnabledOrStop()):(this.Gs===s5&&(this.Gs=s8,s4.
1warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}},{key:"log",value:function(e,t){var n;void 0===t&&(t="log"),null!=(n=this.Ws)&&n.log?this.Ws.log(e,t):s4.warn("log called before recorder was ready")}},{key:"Ys",get:function(){var e,t,n=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(t4);return(null==n||null==(t=n.scriptConfig)?void 0:t.script)||"lazy-recorder"}},{key:"no",value:function(){var e,t,n=this._instance.get_property(t4);if(!n)return!1;try{t="object"==(void 0===n?"undefined":(0,r._)(n))?n:JSON.parse(n)}catch(e){return s4.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}var i=null!=(e=t.cache_timestamp)?e:Date.now();return 36e5>=Date.now()-i}},{key:"Ks",value:function(e){var t,n;if(null==(t=w.__PosthogExtensions__)||!t.initSessionRecording)return s4.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session((0,u._)({},nR,!0));if(this.Ws||(this.Ws=null==(n=w.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance),this.Ws._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.no()){if(this.Gs===s8||this.Gs===s5)return;return this.Gs=s5,s4.info("persisted remote config is stale, requesting fresh config before starting"),void new rS(this._instance).load()}this.Gs=s3,this.Ws.start(e)}},{key:"onRRwebEmit",value:function(e){var t;null==(t=this.Ws)||null==t.onRRwebEmit||t.onRRwebEmit(e)}},{key:"overrideLinkedFlag",value:function(){var e,t;this.Ws||null==(t=this.Si)||t.register((0,u._)({},ne,!0)),null==(e=this.Ws)||e.overrideLinkedFlag()}},{key:"overrideSampling",value:function(){var e,t;this.Ws||null==(t=this.Si)||t.register((0,u._)({},t9,!0)),null==(e=this.Ws)||e.overrideSampling()}},{key:"overrideTrigger",value:function(e){var t,n;this.Ws||null==(n=this.Si)||n.register((0,u._)({},"url"===e?nt:nn,!0)),null==(t=this.Ws)||t.overrideTrigger(e)}},{key:"sdkDebugProperties",get:function(){var e;return(null==(e=this.Ws)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}},{key:"tryAddCustomEvent",value:function(e,t){var n;return!(null==(n=this.Ws)||!n.tryAddCustomEvent(e,t))}}]),e}()},oP={autocapture:function(){function e(t){(0,o._)(this,e),this.so=!1,this.oo=null,this.ao=!1,this.instance=t,this.rageclicks=new sY(t.config.rageclick),this.lo=null}return(0,a._)(e,[{key:"initialize",value:function(){this.startIfEnabled()}},{key:"qt",get:function(){var e,t,n=X(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null==(e=n.url_allowlist)?void 0:e.map(function(e){return new RegExp(e)}),n.url_ignorelist=null==(t=n.url_ignorelist)?void 0:t.map(function(e){return new RegExp(e)}),n}},{key:"uo",value:function(){var e=this;if(this.isBrowserSupported()){if(f&&_){var t=function(t){t=t||(null==f?void 0:f.event);try{e.ho(t)}catch(e){sX.error("Failed to capture event",e)}};if(n1(_,"submit",t,{capture:!0}),n1(_,"change",t,{capture:!0}),n1(_,"click",t,{capture:!0}),this.qt.capture_copied_text){var n=function(t){t=t||(null==f?void 0:f.event);try{e.ho(t,sJ)}catch(e){sX.error("Failed to capture copy/cut event",e)}};n1(_,"copy",n,{capture:!0}),n1(_,"cut",n,{capture:!0})}}}else sX.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this.so&&(this.uo(),this.so=!0)}},{key:"onRemoteConfig",value:function(e){e.elementsChainAsString&&(this.ao=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register((0,u._)({},tZ,!!e.autocapture_opt_out)),this.oo=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"setElementSelectors",value:function(e){this.lo=e}},{key:"getElementSelectors",value:function(e){var t,n=[];return null==(t=this.lo)||t.forEach(function(t){var i=null==_?void 0:_.querySelectorAll(t);null==i||i.forEach(function(i){e===i&&n.push(t)})}),n}},{key:"isEnabled",get:function(){var e,t,n=null==(e=this.instance.persistence)?void 0:e.props[tZ];if(en(this.oo)&&!eo(n)&&!this.instance.Kr())return!1;var i=null!=(t=this.oo)?t:!!n;return!!this.instance.config.autocapture&&!i}},{key:"ho",value:function(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var n,r=iw(e);i_(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&(0,i._)(e,MouseEvent)&&this.instance.config.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&iC(r,this.instance.config.rageclick)&&this.ho(e,"$rageclick");var s=t===sJ;if(r&&function(e,t,n,i,r){if(void 0===n&&(n=void 0),!f||iM(e)||null!=(s=n)&&s.url_allowlist&&!im(n.url_allowlist)||null!=(o=n)&&o.url_ignorelist&&im(n.url_ignorelist))return!1;if(null!=(a=n)&&a.dom_event_allowlist){var s,o,a,u,l=n.dom_event_allowlist;if(l&&!l.some(function(e){return t.type===e}))return!1}var c=iR(e,i),h=c.parentIsUsefulElement,d=c.targetElementList;if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Q(n))return!0;var i,r=function(e){if(n.some(function(t){return e.tagName.toLowerCase()===t}))return{v:!0}},s=!0,o=!1,a=void 0;try{for(var u,l=e[Symbol.iterator]();!(s=(u=l.next()).done);s=!0){var c=u.value;if(i=r(c))return i.v}}catch(e){o=!0,a=e}finally{try{s||null==l.return||l.return()}finally{if(o)throw a}}return!1}(d,n)||!iS(d,null==(u=n)?void 0:u.css_selector_allowlist))return!1;var v=f.getComputedStyle(e);
1if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===t.type)return!0;var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return h?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(iE.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.qt,s,s?["copy","cut"]:void 0)){var o=function(e,t){var n,i,r=t.e,s=t.maskAllElementAttributes,o=t.maskAllText,a=t.elementAttributeIgnoreList,u=t.elementsChainAsString;if(!iv(e))return{props:{}};for(var l=[e],h=e;h.parentNode&&!ip(h,"body");)if(ig(h.parentNode))l.push(h.parentNode.host),h=h.parentNode.host;else{if(!iv(h.parentNode))break;l.push(h.parentNode),h=h.parentNode}var d,v=[],p={},_=!1,g=!1;if(nK(l,function(e){var t=iA(e);if(ip(e,"a")){var n=e.getAttribute("href");_=t&&!!n&&iU(n)&&n}U(ik(e),"ph-no-capture")&&(g=!0),v.push(function(e,t,n,i){var r=e.tagName.toLowerCase(),s={tag_name:r};iE.indexOf(r)>-1&&!n&&(s.$el_text="a"===r.toLowerCase()||"button"===r.toLowerCase()?sZ(1024,iG(e)):sZ(1024,ix(e)));var o=ik(e);o.length>0&&(s.classes=o.filter(function(e){return""!==e})),nK(e.attributes,function(n){var r;if((!iL(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==i||!i.includes(n.name))&&!t&&iU(n.value)&&(!ee(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){var o=n.value;"class"===n.name&&(o=iy(o).join(" ")),s["attr__"+n.name]=sZ(1024,o)}});for(var a=1,u=1,l=e;l=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!iv(t))return t}(l);)a++,l.tagName===e.tagName&&u++;return s.nth_child=a,s.nth_of_type=u,s}(e,s,o,a)),nY(p,function(e){if(!iA(e))return{};var t={};return nK(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),i=e.value;n&&i&&iU(i)&&(t[n]=i)}}),t}(e))}),g)return{props:{},explicitNoCapture:g};if(o||(v[0].$el_text=ip(e,"a")||ip(e,"button")?iG(e):ix(e)),_){v[0].attr__href=_;var y,m,k=null==(y=i8(_))?void 0:y.host,b=null==f||null==(m=f.location)?void 0:m.host;k&&b&&k!==b&&(d=_)}return{props:nY({$event_type:r.type,$ce_version:1},u?{}:{$elements:v},{$elements_chain:v.map(function(e){var t,n,i,r={text:null==(n=e.$el_text)?void 0:n.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:(t=e.attr__class)?Y(t)?t:iy(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return nJ(e).filter(function(e){return 0===(0,c._)(e,1)[0].indexOf("attr__")}).forEach(function(e){var t=(0,c._)(e,2),n=t[0],i=t[1];return r.attributes[n]=i}),r}).map(function(e){var t,n,i="",r=!0,s=!1,o=void 0;if(e.tag_name&&(i+=e.tag_name),e.attr_class)try{for(var a,u=(e.attr_class.sort(),e.attr_class)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var l=a.value;i+="."+l.replace(/"/g,"")}}catch(e){s=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(s)throw o}}var h=$({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(n=e.nth_of_type)?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),d={};return nJ(h).sort(function(e,t){var n=(0,c._)(e,1)[0],i=(0,c._)(t,1)[0];return n.localeCompare(i)}).forEach(function(e){var t=(0,c._)(e,2),n=t[0],i=t[1];return d[iB(n.toString())]=iB(i.toString())}),(i+=":")+nJ(d).map(function(e){var t=(0,c._)(e,2);return t[0]+'="'+t[1]+'"'}).join("")}).join(";")},null!=(n=v[0])&&n.$el_text?{$el_text:null==(i=v[0])?void 0:i.$el_text}:{},d&&"click"===r.type?{$external_click_url:d}:{},p)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.element_attribute_ignorelist,elementsChainAsString:this.ao}),a=o.props;if(o.explicitNoCapture)return!1;var u=this.getElementSelectors(r);if(u&&u.length>0&&(a.$element_selectors=u),t===sJ){var l,h=ib(null==f||null==(l=f.getSelection())?void 0:l.toString()),d=e.type||"clipboard";if(!h)return!1;a.$selected_content=h,a.$copy_type=d}return this.instance.capture(t,a),!0}}}},{key:"isBrowserSupported",value:function(){return J(null==_?void 0:_.querySelectorAll)}}]),e}(),historyAutocapture:function(){function e(t){var n;(0,o._)(this,e),this._instance=t,this.co=(null==f||null==(n=f.location)?void 0:n.pathname)||""}return(0,a._)(e,[{key:"initialize",value:function(){this.startIfEnabled()}},{key:"isEnabled",get:function(){return"history_change"===this._instance.config.capture_pageview}},{key:"startIfEnabled",value:function(){this.isEnabled&&(tG.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}},{key:"stop",value:function(){this.do&&this.do(),this.do=void 0,tG.info("History API monitoring stopped")}},{key:"monitorHistoryChanges",value:function(){f&&f.history&&(this.vo("pushState"),this.vo("replaceState"),this.fo())}},{key:"vo",value:function(e){var t;if(f&&(null==(t=f.history[e])||!t.__posthog_wrapped__)){var n=this;!function(e,t,n){try{if(!(t in e))return function(){};var i=e[t],r=n(i);J(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r}catch(e){return function(){}}}(f.history,e,function(t){return function(i,r,s){t.call(this,i,r,s),n.po(e)}})}}},{key:"po",value:function(e){try{var t,n=null==f||null==(t=f.location)?void 0:t.pathname;if(!n)return;n!==this.co&&this.isEnabled&&this._instance.capture(nU,{navigation_type:e}),this.co=n}catch(t){tG.error("Error capturing "+e+" pageview",t)}}},{key:"fo",value:function(){var e=this;if(!this.do){var t=function(){e.po("popstate")};n1(f,"popstate",t),this.do=function(){f&&f.removeEventListener("popstate",t)}}}}]),e}(),heatmaps:function(){function e(t){var n;(0,o._)(this,e),this.mo=!1,this.so=!1,this.yo=null,this.instance=t,this.mo=!(null==(n=this.instance.persistence)||!n.props[tQ]),this.rageclicks=new sY(t.config.rageclick)}return(0,a._)(e,[{key:"qt",get:function(){return this.instance.config}},{key:"initialize",value:function(){this.startIfEnabled()}},{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return X(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(e=this.qt.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){return ei(this.qt.capture_heatmaps)?ei(this.qt.enable_heatmaps)?this.mo:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}},{key:"startIfEnabled",value:function(){if(this.isEnabled)this.so||(s7.info("starting..."),this.bo(),this.At());else{var e;clearInterval(null!=(e=this.yo)?e:void 0),this._o(),this.getAndClearBuffer()}}},{key:"onRemoteConfig",value:function(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register((0,u._)({},tQ,t)),this.mo=t,this.startIfEnabled()}}},{key:"getAndClearBuffer",value:function(){var e=this.M;return this.M=void 0,e}},{key:"wo",value:function(e){this.Mt(e.originalEvent,"deadclick")}},{key:"At",value:function(){this.yo&&clearInterval(this.yo),this.yo="visible"===(null==_?void 0:_.visibilityState)?setInterval(this.ci.bind(this),this.flushIntervalMilliseconds):null}},{key:"bo",value:function(){var e=this;f&&_&&(this.xo=this.ci.bind(this),n1(f,nz,this.xo),this.ko=function(t){return e.Mt(t||(null==f?void 0:f.event))},n1(_,"click",this.ko,{capture:!0}),this.So=function(t){return e.Co(t||(null==f?void 0:f.event))},n1(_,"mousemove",this.So,{capture:!0}),this.Io=new iY(this.instance,iV,this.wo.bind(this)),this.Io.startIfEnabledOrStop(),this.To=this.At.bind(this),n1(_,nH,this.To),this.so=!0)}},{key:"_o",value:function(){var e;f&&_&&(this.xo&&f.removeEventListener(nz,this.xo),this.ko&&_.removeEventListener("click",this.ko,{capture:!0}),this.So&&_.removeEventListener("mousemove",this.So,{capture:!0}),this.To&&_.removeEventListener(nH,this.To),clearTimeout(this.Eo),null==(e=this.Io)||e.stop(),this.so=!1)}},{key:"Mo",value:function(e,t){var n=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),s=function(e,t,n){for(var i=e;i&&iv(i)&&!ip(i,"body")&&i!==n;){if(U(t,null==f?void 0:f.getComputedStyle(i).position))return!0;
1i=iP(i)}return!1}(iw(e),["fixed","sticky"],r);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:n),target_fixed:s,type:t}}},{key:"Mt",value:function(e,t){var n;if(void 0===t&&(t="click"),!id(e.target)&&s9(e)){var i=this.Mo(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&iC(iw(e),this.instance.config.rageclick)&&this.Ro($({},i,{type:"rageclick"})),this.Ro(i)}}},{key:"Co",value:function(e){var t=this;!id(e.target)&&s9(e)&&(clearTimeout(this.Eo),this.Eo=setTimeout(function(){t.Ro(t.Mo(e,"mousemove"))},500))}},{key:"Ro",value:function(e){if(f){var t=f.location.href,n=this.qt.custom_personal_data_properties,i=i4(t,this.qt.mask_personal_data_properties?(0,h._)(re).concat((0,h._)(n||[])):[],rn);this.M=this.M||{},this.M[i]||(this.M[i]=[]),this.M[i].push(e)}}},{key:"ci",value:function(){this.M&&!Z(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}]),e}(),deadClicksAutocapture:iY,webVitalsAutocapture:function(){function e(t){var n,i=this;(0,o._)(this,e),this.mo=!1,this.so=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Po=function(){clearTimeout(i.Oo),0!==i.M.metrics.length&&(i._instance.capture("$web_vitals",i.M.metrics.reduce(function(e,t){var n;return $({},e,(n={},(0,u._)(n,"$web_vitals_"+t.name+"_event",$({},t)),(0,u._)(n,"$web_vitals_"+t.name+"_value",t.value),n))},{})),i.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=function(e){i.M=i.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t,n=i.Lo();if(!Q(n))if(ei(null==e?void 0:e.name)||ei(null==e?void 0:e.value))s1.error("Invalid metric received",e);else if(!i.Ao||i.Ao>e.value){i.M.url!==n&&(i.Po(),i.Oo=setTimeout(i.Po,i.flushToCaptureTimeoutMs)),Q(i.M.url)&&(i.M.url=n),i.M.firstMetricTimestamp=Q(i.M.firstMetricTimestamp)?Date.now():i.M.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var r=null==(t=i._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),s=$({},e,{$current_url:n,timestamp:Date.now()});Q(r)||(s.$session_id=r.sessionId,s.$window_id=r.windowId),i.M.metrics.push(s),i.M.metrics.length===i.allowedMetrics.length&&i.Po()}else s1.error("Ignoring metric with value >= "+i.Ao,e)},this.Fo=function(){if(!i.so){var e,t,n,r,s,o=w.__PosthogExtensions__;Q(o)||Q(o.postHogWebVitalsCallbacks)||(t=(e=o.postHogWebVitalsCallbacks).onLCP,n=e.onCLS,r=e.onFCP,s=e.onINP),t&&n&&r&&s?(i.allowedMetrics.indexOf("LCP")>-1&&t(i.ht.bind(i)),i.allowedMetrics.indexOf("CLS")>-1&&n(i.ht.bind(i)),i.allowedMetrics.indexOf("FCP")>-1&&r(i.ht.bind(i)),i.allowedMetrics.indexOf("INP")>-1&&s(i.ht.bind(i)),i.so=!0):s1.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.mo=!(null==(n=this._instance.persistence)||!n.props[t3]),this.startIfEnabled()}return(0,a._)(e,[{key:"No",get:function(){return this._instance.config.capture_performance}},{key:"allowedMetrics",get:function(){var e,t,n=X(this.No)?null==(e=this.No)?void 0:e.web_vitals_allowed_metrics:void 0;return ei(n)?(null==(t=this._instance.persistence)?void 0:t.props[t6])||["CLS","FCP","INP","LCP"]:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(X(this.No)?this.No.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"useAttribution",get:function(){var e=X(this.No)?this.No.web_vitals_attribution:void 0;return null!=e&&e}},{key:"Ao",get:function(){var e=X(this.No)&&er(this.No.__web_vitals_max_value)?this.No.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}},{key:"isEnabled",get:function(){var e=null==g?void 0:g.protocol;if("http:"!==e&&"https:"!==e)return s1.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=X(this.No)?this.No.web_vitals:eo(this.No)?this.No:void 0;return eo(t)?t:this.mo}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this.so&&(s1.info("enabled, starting..."),this.ur(this.Fo))}},{key:"onRemoteConfig",value:function(e){if("capturePerformance"in e){var t=X(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=X(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register((0,u._)({},t3,t)),this._instance.persistence.register((0,u._)({},t6,n))),this.mo=t,this.startIfEnabled()}}},{key:"ur",value:function(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",function(t){t?s1.error("failed to load script",t):e()})}},{key:"Lo",value:function(){var e=f?f.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return i4(e,this._instance.config.mask_personal_data_properties?(0,h._)(re).concat((0,h._)(t||[])):[],rn)}s1.error("Could not determine current URL")}}]),e}()},oF={exceptionObserver:function(){function e(t){var n,i,r,s=this;(0,o._)(this,e),this.Fo=function(){var e;if(f&&s.isEnabled&&null!=(e=w.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=w.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=w.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=w.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!s.Do&&s.qt.capture_unhandled_errors&&(s.Do=t(s.captureException.bind(s))),!s.$o&&s.qt.capture_unhandled_rejections&&(s.$o=n(s.captureException.bind(s))),!s.qo&&s.qt.capture_console_errors&&(s.qo=i(s.captureException.bind(s)))}catch(e){sQ.error("failed to start",e),s.jo()}}},this._instance=t,this.Bo=!(null==(n=this._instance.persistence)||!n.props[t0]),this.Ho=new ey({refillRate:null!=(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?i:1,bucketSize:null!=(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?r:10,refillInterval:1e4,Zt:sQ}),this.qt=this.Uo(),this.startIfEnabledOrStop()}return(0,a._)(e,[{key:"Uo",value:function(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return X(e)?t=$({},t,e):(Q(e)?this.Bo:e)&&(t=$({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}},{key:"isEnabled",get:function(){return this.qt.capture_console_errors||this.qt.capture_unhandled_errors||this.qt.capture_unhandled_rejections}},{key:"startIfEnabledOrStop",value:function(){this.isEnabled?(sQ.info("enabled"),this.jo(),this.ur(this.Fo)):this.jo()}},{key:"ur",value:function(e){var t,n;
1null!=(t=w.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"exception-autocapture",function(t){if(t)return sQ.error("failed to load script",t);e()})}},{key:"jo",value:function(){var e,t,n;null==(e=this.Do)||e.call(this),this.Do=void 0,null==(t=this.$o)||t.call(this),this.$o=void 0,null==(n=this.qo)||n.call(this),this.qo=void 0}},{key:"onRemoteConfig",value:function(e){"autocaptureExceptions"in e&&(this.Bo=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register((0,u._)({},t0,this.Bo)),this.qt=this.Uo(),this.startIfEnabledOrStop())}},{key:"onConfigChange",value:function(){this.qt=this.Uo()}},{key:"captureException",value:function(e){var t,n,i,r=null!=(t=null==e||null==(n=e.$exception_list)||null==(n=n[0])?void 0:n.type)?t:"Exception";this.Ho.consumeRateLimit(r)?sQ.info("Skipping exception capture because of client rate limiting.",{exception:r}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(e)}}]),e}(),exceptions:function(){function e(t){var n,i;(0,o._)(this,e),this.zo=[],this.Vo=new tp([new tP,new tL,new t$,new tF,new tR,new tM,new tO,new tA],function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var r=[],s=t.split("\n"),o=i;s.length>o;o++){var a=s[o];if(1024>=a.length){var u=tS.test(a)?a.replace(tS,"$1"):a;if(!u.match(/\S*Error: /)){var l=!0,c=!1,h=void 0;try{for(var d,f=n[Symbol.iterator]();!(l=(d=f.next()).done);l=!0){var v=(0,d.value)(u,e);if(v){r.push(v);break}}}catch(e){c=!0,h=e}finally{try{l||null==f.return||f.return()}finally{if(c)throw h}}if(r.length>=50)break}}}if(!r.length)return[];var p=Array.from(r);return p.reverse(),p.slice(0,50).map(function(e){return $({},e,{filename:e.filename||(p[p.length-1]||{}).filename,function:e.function||"?"})})}}("web:javascript",tb,tE)),this._instance=t,this.zo=null!=(n=null==(i=this._instance.persistence)?void 0:i.get_property(t1))?n:[],this.Wo=tH(this.Go()),this.Zo=new tz(this.Wo)}return(0,a._)(e,[{key:"onConfigChange",value:function(){this.Wo=tH(this.Go()),this.Zo.setConfig(this.Wo)}},{key:"onRemoteConfig",value:function(e){var t,n,i;if("errorTracking"in e){var r,s=null!=(t=null==(n=e.errorTracking)?void 0:n.suppressionRules)?t:[],o=null==(i=e.errorTracking)?void 0:i.captureExtensionExceptions;this.zo=s,this._instance.persistence&&this._instance.persistence.register((r={},(0,u._)(r,t1,this.zo),(0,u._)(r,t2,o),r))}}},{key:"Qo",get:function(){var e,t=!!this._instance.get_property(t2),n=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=n?n:t)&&e}},{key:"buildProperties",value:function(e,t){return this.Vo.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}},{key:"addExceptionStep",value:function(e,t){if(this.Wo.enabled)try{if(!ee(e)||0===e.trim().length)return void oy.warn("Ignoring exception step because message must be a non-empty string");var n,i=this.Jo(t),r=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(function(n,i){return tN.has(i)?t.push(i):n[i]=e[i],n},{}),droppedKeys:t}}(i),s=r.sanitizedProperties,o=r.droppedKeys;o.length>0&&oy.warn("Ignoring reserved exception step fields",{droppedKeys:o}),this.Zo.add($((n={},(0,u._)(n,tq,e),(0,u._)(n,tD,(new Date).toISOString()),n),s))}catch(e){oy.error("Failed to add exception step. Ignoring breadcrumb.",e)}}},{key:"sendExceptionEvent",value:function(e){try{var t=e.$exception_list;if(this.Ko(t)){if(this.Yo(t))return this.Xo("Exception dropped: matched a suppression rule"),void oy.info("Skipping exception capture because a suppression rule matched");if(!this.Qo&&this.ea(t))return this.Xo("Exception dropped: thrown by a browser extension"),void oy.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ta(t))return this.Xo("Exception dropped: thrown by the PostHog SDK"),void oy.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.Wo.enabled&&ei(e.$exception_steps)?this.ra(e):e;try{var i=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",Mn:!0});return i&&this.Zo.clear(),i}catch(e){return oy.error("Failed to capture exception event. Dropping this exception.",e),void this.Zo.clear()}}catch(e){return void oy.error("Failed to process exception event. Ignoring this exception.",e)}}},{key:"ra",value:function(e){try{var t=this.Zo.getAttachable();return 0===t.length?e:$({},e,{$exception_steps:t})}catch(t){return oy.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}},{key:"Xo",value:function(e){var t;this.Wo.enabled&&this.Zo.add((t={},(0,u._)(t,tq,e),(0,u._)(t,tD,(new Date).toISOString()),t))}},{key:"Jo",value:function(e){return X(e)?$({},e):{}}},{key:"Go",value:function(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}},{key:"Yo",value:function(e){if(0===e.length)return!1;var t=e.reduce(function(e,t){var n=t.type,i=t.value;return ee(n)&&n.length>0&&e.$exception_types.push(n),ee(i)&&i.length>0&&e.$exception_values.push(i),e},{$exception_types:[],$exception_values:[]});return this.zo.some(function(e){var n=e.values.map(function(e){var n,i=sy[e.operator],r=Y(e.value)?e.value:[e.value],s=null!=(n=t[e.key])?n:[];return r.length>0&&i(r,s)});return"OR"===e.type?n.some(Boolean):n.every(Boolean)})}},{key:"ea",value:function(e){return e.flatMap(function(e){var t,n;return null!=(t=null==(n=e.stacktrace)?void 0:n.frames)?t:[]}).some(function(e){return e.filename&&e.filename.startsWith("chrome-extension://")})}},{key:"ta",value:function(e){if(e.length>0){var t,n,i,r,s=null!=(t=null==(n=e[0].stacktrace)?void 0:n.frames)?t:[],o=s[s.length-1];return null!=(i=null==o||null==(r=o.filename)?void 0:r.includes("posthog.com/static"))&&i}return!1}},{key:"Ko",value:function(e){return!ei(e)&&Y(e)}}]),e}()},o$=$({productTours:function(){function e(t){(0,o._)(this,e),this.ia=null,this.na=null,this._instance=t}return(0,a._)(e,[{key:"Si",get:function(){return this._instance.persistence}},{key:"initialize",value:function(){this.loadIfEnabled()}},{key:"onRemoteConfig",value:function(e){if("productTours"in e){var t,n;if(this.Si&&this.Si.register((0,u._)({},t8,!!e.productTours)),!ot(this._instance))return!this.ia&&ei(null==(t=this.Si)?void 0:t.props[ny])||oe.info("product tours disabled; stopping and clearing cached tours"),null==(n=this.ia)||n.stop(),this.ia=null,void this.clearCache();this.loadIfEnabled()}}},{key:"loadIfEnabled",value:function(){var e=this;!this.ia&&ot(this._instance)&&this.ur(function(){return e.sa()})}},{key:"ur",value:function(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.generateProductTours?e():null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"product-tours",function(t){t?oe.error("Could not load product tours script",t):e()})}},{key:"sa",value:function(){var e;!this.ia&&null!=(e=w.__PosthogExtensions__)&&e.generateProductTours&&(this.ia=w.__PosthogExtensions__.generateProductTours(this._instance,!0))}},{key:"getProductTours",value:function(e,t){var n=this;if(void 0===t&&(t=!1),!Y(this.na)||t){var i=this.Si;if(i){var r=i.props[ny];if(Y(r)&&!t)return this.na=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:function(t){if(ot(n._instance)){var r=t.statusCode;if(200!==r||!t.json){var s="Product Tours API could not be loaded, status: "+r;return oe.error(s),void e([],{isLoaded:!1,error:s})}var o=Y(t.json.product_tours)?t.json.product_tours:[];n.na=o,i&&i.register((0,u._)({},ny,o)),e(o,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.na,{isLoaded:!0})}},{key:"getActiveProductTours",value:function(e){ei(this.ia)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.ia.getActiveProductTours(e)}},{key:"showProductTour",value:function(e){var t;null==(t=this.ia)||t.showTourById(e)}},{key:"previewTour",value:function(e){var t=this;this.ia?this.ia.previewTour(e):this.ur(function(){var n;t.sa(),null==(n=t.ia)||n.previewTour(e)})}},{key:"dismissProductTour",value:function(){var e;null==(e=this.ia)||e.dismissTour("user_clicked_skip")}},{key:"nextStep",value:function(){var e;null==(e=this.ia)||e.nextStep()}},{key:"previousStep",value:function(){var e;null==(e=this.ia)||e.previousStep()}},{key:"clearCache",value:function(){var e;this.na=null,null==(e=this.Si)||e.unregister(ny)}},{key:"resetTour",value:function(e){var t;null==(t=this.ia)||t.resetTour(e)}},{key:"resetAllTours",value:function(){var e;null==(e=this.ia)||e.resetAllTours()}},{key:"cancelPendingTour",value:function(e){var t;null==(t=this.ia)||t.cancelPendingTour(e)}}]),e}()},oE),oI={siteApps:function(){function e(t){(0,o._)(this,e),this._instance=t,this.oa=[],this.apps={}}return(0,a._)(e,[{key:"isEnabled",get:function(){return!!this._instance.config.opt_in_site_apps}},{key:"aa",value:function(e,t){if(t){var n=this.globalsForEvent(t);this.oa.push(n),this.oa.length>1e3&&(this.oa=this.oa.slice(10))}}},{key:"siteAppLoaders",get:function(){var e;return null==(e=w._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}},{key:"initialize",value:function(){var e=this;if(this.isEnabled){var t=this._instance._addCaptureHook(this.aa.bind(this));this.la=function(){t(),e.oa=[],e.la=void 0}}}},{key:"globalsForEvent",value:function(e){if(!e)throw Error("Event payload is required");var t={},n=this._instance.get_property("$groups")||[],i=this._instance.get_property("$stored_group_properties")||{},r=!0,s=!1,o=void 0;try{for(var a,u,l,h,d,f,v,p,_=Object.entries(i)[Symbol.iterator]();!(r=(p=_.next()).done);r=!0){var g=(0,c._)(p.value,2),y=g[0],m=g[1];t[y]={id:n[y],type:y,properties:m}}}catch(e){s=!0,o=e}finally{try{r||null==_.return||_.return()}finally{if(s)throw o}}var k=e.$set_once,b=e.$set;return{event:$({},I(e,on),{properties:$({},e.properties,b?{$set:$({},null!=(a=null==(u=e.properties)?void 0:u.$set)?a:{},b)}:{},k?{$set_once:$({},null!=(l=null==(h=e.properties)?void 0:h.$set_once)?l:{},k)}:{}),elements_chain:null!=(d=null==(f=e.properties)?void 0:f.$elements_chain)?d:"",distinct_id:null==(v=e.properties)?void 0:v.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:t}}},{key:"setupSiteApp",value:function(e){var t=this,n=this.apps[e.id],i=function(){var i;!n.errored&&t.oa.length&&(oi.info("Processing "+t.oa.length+" events for site app with id "+e.id),t.oa.forEac
1h(function(e){return null==n.processEvent?void 0:n.processEvent(e)}),n.processedBuffer=!0),Object.values(t.apps).every(function(e){return e.processedBuffer||e.errored})&&(null==(i=t.la)||i.call(t))},r=!1,s=function(t){n.errored=!t,n.loaded=!0,oi.info("Site app with id "+e.id+" "+(t?"loaded":"errored")),r&&i()};try{var o=e.init({posthog:this._instance,callback:function(e){s(e)}}).processEvent;o&&(n.processEvent=o),r=!0}catch(t){oi.error(or+e.id,t),s(!1)}if(r&&n.loaded)try{i()}catch(t){oi.error("Error while processing buffered events PostHog app with config id "+e.id,t),n.errored=!0}}},{key:"ua",value:function(){var e=this.siteAppLoaders||[],t=!0,n=!1,i=void 0;try{for(var r,s=e[Symbol.iterator]();!(t=(r=s.next()).done);t=!0){var o=r.value;this.apps[o.id]={id:o.id,loaded:!1,errored:!1,processedBuffer:!1}}}catch(e){n=!0,i=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw i}}var a=!0,u=!1,l=void 0;try{for(var c,h=e[Symbol.iterator]();!(a=(c=h.next()).done);a=!0){var d=c.value;this.setupSiteApp(d)}}catch(e){u=!0,l=e}finally{try{a||null==h.return||h.return()}finally{if(u)throw l}}}},{key:"ha",value:function(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e),n=!0,i=!1,r=void 0;try{for(var s,o=Object.values(this.apps)[Symbol.iterator]();!(n=(s=o.next()).done);n=!0){var a=s.value;try{null==a.processEvent||a.processEvent(t)}catch(t){oi.error("Error while processing event "+e.event+" for site app "+a.id,t)}}}catch(e){i=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw r}}}}},{key:"onRemoteConfig",value:function(e){var t,n,i,r=this,s=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.ua(),void this._instance.on("eventCaptured",function(e){return r.ha(e)})):void oi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(n=this.la)||n.call(this),null!=(i=e.siteApps)&&i.length)if(this.isEnabled){var o=function(e){var t;w["__$$ph_site_app_"+e]=s._instance,null==(t=w.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(s._instance,v,function(t){if(t)return oi.error(or+e,t)})},a=!0,u=!1,l=void 0;try{for(var c,h=e.siteApps[Symbol.iterator]();!(a=(c=h.next()).done);a=!0){var d=c.value,f=d.id,v=d.url;o(f)}}catch(e){u=!0,l=e}finally{try{a||null==h.return||h.return()}finally{if(u)throw l}}}else oi.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}]),e}()},oO={tracingHeaders:function(){function e(t){var n=this;(0,o._)(this,e),this.ca=void 0,this.da=void 0,this.va=void 0,this.Fo=function(){var e,t,i=n.fa();i?(Q(n.ca)&&(n.ca=null==(e=w.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,function(){return n._instance.get_distinct_id()},n._instance.sessionManager)),Q(n.da)&&(n.da=null==(t=w.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,function(){return n._instance.get_distinct_id()},n._instance.sessionManager))):n.jo()},this._instance=t}return(0,a._)(e,[{key:"initialize",value:function(){this.startIfEnabledOrStop()}},{key:"ur",value:function(e){var t,n;null!=(t=w.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(n=w.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"tracing-headers",function(t){if(t)return s0.error("failed to load script",t);e()})}},{key:"pa",value:function(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}},{key:"fa",value:function(){var e,t=this.pa();return Y(t)?(Y(this.va)?(e=this.va).splice.apply(e,[0,this.va.length].concat((0,h._)(t))):this.va=(0,h._)(t),t.length>0?this.va:void 0):(Y(this.va)&&this.va.splice(0),this.va=t||void 0,this.va)}},{key:"jo",value:function(){var e,t;null==(e=this.ca)||e.call(this),null==(t=this.da)||t.call(this),this.ca=void 0,this.da=void 0}},{key:"startIfEnabledOrStop",value:function(){this.fa()?this.ur(this.Fo):this.jo()}}]),e}()},oT=$({surveys:function(){function e(t){(0,o._)(this,e),this.ga=void 0,this._surveyManager=null,this.ma=!1,this.ya=[],this.ba=null,this._instance=t,this._surveyEventReceiver=null}return(0,a._)(e,[{key:"qt",get:function(){return this._instance.config}},{key:"initialize",value:function(){this.loadIfEnabled()}},{key:"onRemoteConfig",value:function(e){if(!this.qt.disable_surveys){var t=e.surveys;if(ei(t))return s$.warn("Flags not loaded yet. Not loading surveys.");var n=Y(t);this.ga=n?t.length>0:t,s$.info("flags response received, isSurveysEnabled: "+this.ga),this.loadIfEnabled()}}},{key:"reset",value:function(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(null!=n&&n.startsWith(sI)||null!=n&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach(function(e){return localStorage.removeItem(e)})}},{key:"loadIfEnabled",value:function(){var e=this;if(!this._surveyManager)if(this.ma)s$.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)s$.info(ol);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())s$.info("Not loading surveys in cookieless mode without consent.");else{var t=null==w?void 0:w.__PosthogExtensions__;if(t){if(!Q(this.ga)||this.qt.advanced_enable_surveys){var n=this.ga||this.qt.advanced_enable_surveys;this.ma=!0;try{var i=t.generateSurveys;if(i)return void this._a(i,n);var r=t.loadExternalDependency;if(!r)return void this.wa(nA);r(this._instance,"surveys",function(i){i||!t.generateSurveys?e.wa("Could not load surveys script",i):e._a(t.generateSurveys,n)})}catch(e){throw this.wa("Error initializing surveys",e),e}finally{this.ma=!1}}}else s$.error("PostHog Extensions not found.")}}},{key:"_a",value:function(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new oa(this._instance),s$.info("Surveys loaded successfully"),this.xa({isLoaded:!0})}},{key:"wa",value:function(e,t){s$.error(e,t),this.xa({isLoaded:!1,error:e})}},{key:"onSurveysLoaded",value:function(e){var t=this;return this.ya.push(e),this._surveyManager&&this.xa({isLoaded:!0}),function(){t.ya=t.ya.filter(function(t){return t!==e})}}},{key:"getSurveys",value:function(e,t){var n=this;if(void 0===t&&(t=!1),this.qt.disable_surveys)return s$.info(ol),e([]);var i,r=this._instance.get_property(np);if(r&&!t)return e(r,{isLoaded:!0});"u">typeof Promise&&this.ba?this.ba.then(function(t){return e(t.surveys,t.context)}):("u">typeof Promise&&(this.ba=new Promise(function(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:function(t){n.ba=null;var r,s=t.statusCode;if(200!==s||!t.json){var o="Surveys API could not be loaded, status: "+s;s$.error(o);var a={isLoaded:!1,error:o};return e([],a),void(null==i||i({surveys:[],context:a}))}var l,c,h=t.json.surveys||[],d=h.filter(function(e){var t,n;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||!n.length))});d.length>0&&(null==(c=n._surveyEventReceiver)||c.register(d)),null==(l=n._instance.persistence)||l.register((r={},(0,u._)(r,np,h),(0,u._)(r,n_,Date.now()),r));var f={isLoaded:!0};e(h,f),null==i||i({surveys:h,context:f})}}))}},{key:"xa",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,s=this.ya[Symbol.iterator]();!(t=(r=s.next()).done);t=!0){var o=r.value;try{if(!e.isLoaded)return o([],e);
1this.getSurveys(o)}catch(e){s$.error("Error in survey callback",e)}}}catch(e){n=!0,i=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw i}}}},{key:"getActiveMatchingSurveys",value:function(e,t){if(void 0===t&&(t=!1),!ei(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);s$.warn("init was not called")}},{key:"ka",value:function(e){var t=null;return this.getSurveys(function(n){var i;t=null!=(i=n.find(function(t){return t.id===e}))?i:null}),t}},{key:"Sa",value:function(e){if(ei(this._surveyManager))return{eligible:!1,reason:ou};var t="string"==typeof e?this.ka(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}},{key:"canRenderSurvey",value:function(e){if(ei(this._surveyManager))return s$.warn("init was not called"),{visible:!1,disabledReason:ou};var t=this.Sa(e);return{visible:t.eligible,disabledReason:t.reason}}},{key:"canRenderSurveyAsync",value:function(e,t){var n=this;return ei(this._surveyManager)?(s$.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ou})):new Promise(function(i){n.getSurveys(function(t){var r,s=null!=(r=t.find(function(t){return t.id===e}))?r:null;if(s){var o=n.Sa(s);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}},{key:"renderSurvey",value:function(e,t,n){var i,r=this;if(ei(this._surveyManager))s$.warn("init was not called");else{var s="string"==typeof e?this.ka(e):e;if(null!=s&&s.id)if(sO.includes(s.type)){var o=null==_?void 0:_.querySelector(t);if(o)return null!=(i=s.appearance)&&i.surveyPopupDelaySeconds?(s$.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(function(){var e,t;s$.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=r._surveyManager)||t.renderSurvey(s,o,n),s$.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,o,n);s$.warn("Survey element not found")}else s$.warn("Surveys of type "+s.type+" cannot be rendered in the app");else s$.warn("Survey not found")}}},{key:"displaySurvey",value:function(e,t){var n;if(ei(this._surveyManager))s$.warn("init was not called");else{var i=this.ka(e);if(i){var r=i;if(null!=(n=i.appearance)&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=$({},i,{appearance:$({},i.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==rb&&t.initialResponses&&s$.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var s=this.canRenderSurvey(i);if(!s.visible)return void s$.warn("Survey is not eligible to be displayed: ",s.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else s$.warn("Survey not found")}}},{key:"cancelPendingSurvey",value:function(e){ei(this._surveyManager)?s$.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},{key:"handlePageUnload",value:function(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}]),e}()},oE),oC={toolbar:function(){function e(t){(0,o._)(this,e),this.instance=t}return(0,a._)(e,[{key:"Ca",value:function(e){w.ph_toolbar_state=e}},{key:"Ia",value:function(){var e;return null!=(e=w.ph_toolbar_state)?e:0}},{key:"initialize",value:function(){return this.maybeLoadToolbar()}},{key:"maybeLoadToolbar",value:function(e,t,n){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),n2(this.instance.config)||!f||!_)return!1;e=null!=e?e:f.location,n=null!=n?n:f.history;try{if(!t){try{f.localStorage.setItem("test","test"),f.localStorage.removeItem("test")}catch(e){return!1}t=null==f?void 0:f.localStorage}var i,r=oc||i7(e.hash,"__posthog")||i7(e.hash,"state"),s=r?nX(function(){return JSON.parse(atob(decodeURIComponent(r)))})||nX(function(){return JSON.parse(decodeURIComponent(r))}):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(oh)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(e){return!1}}},{key:"Ta",value:function(e){var t=w.ph_load_toolbar||w.ph_load_editor;!ei(t)&&J(t)?t(e,this.instance):od.warn("No toolbar load function found")}},{key:"loadToolbar",value:function(e){var t,n=this,i=!(null==_||!_.getElementById(nO));if(!f||i)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=$({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(f.localStorage.setItem(oh,JSON.stringify($({},s,{source:void 0}))),2===this.Ia())?this.Ta(s):0===this.Ia()&&(this.Ca(1),null==(t=w.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",function(e){e?(od.error("[Toolbar] Failed to load",e),n.Ca(0)):(n.C
1a(2),n.Ta(s))}),n1(f,"turbolinks:load",function(){n.Ca(0),n.loadToolbar(s)})),!0}},{key:"Ea",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(e,t,n){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}]),e}()},oM=$({experiments:ob},oE),oR={conversations:function(){function e(t){(0,o._)(this,e),this.Ma=void 0,this._conversationsManager=null,this.Ra=!1,this.Pa=null,this._instance=t}return(0,a._)(e,[{key:"initialize",value:function(){this.loadIfEnabled()}},{key:"onRemoteConfig",value:function(e){if(!this._instance.config.disable_conversations){var t=e.conversations;ei(t)||(eo(t)?this.Ma=t:(this.Ma=t.enabled,this.Pa=t),this.loadIfEnabled())}}},{key:"reset",value:function(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Ma=void 0,this.Pa=null}},{key:"loadIfEnabled",value:function(){var e=this;if(!(this._conversationsManager||this.Ra||this._instance.config.disable_conversations||n2(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==w?void 0:w.__PosthogExtensions__;if(t&&!Q(this.Ma)&&this.Ma)if(this.Pa&&this.Pa.token){this.Ra=!0;try{var n=t.initConversations;if(n)return this.Oa(n),void(this.Ra=!1);var i=t.loadExternalDependency;if(!i)return void this.La(nA);i(this._instance,"conversations",function(n){n||!t.initConversations?e.La("Could not load conversations script",n):e.Oa(t.initConversations),e.Ra=!1})}catch(e){this.La("Error initializing conversations",e),this.Ra=!1}}else ox.error("Conversations enabled but missing token in remote config.")}}},{key:"Oa",value:function(e){if(this.Pa)try{this._conversationsManager=e(this.Pa,this._instance),ox.info("Conversations loaded successfully")}catch(e){this.La("Error completing conversations initialization",e)}else ox.error("Cannot complete initialization: remote config is null")}},{key:"La",value:function(e,t){ox.error(e,t),this._conversationsManager=null,this.Ra=!1}},{key:"show",value:function(){this._conversationsManager?this._conversationsManager.show():ox.warn("Conversations not loaded yet.")}},{key:"hide",value:function(){this._conversationsManager&&this._conversationsManager.hide()}},{key:"isAvailable",value:function(){return!0===this.Ma&&!en(this._conversationsManager)}},{key:"isVisible",value:function(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}},{key:"sendMessage",value:function(e,t,n){var i=this;return F(function(){return(0,d._)(this,function(r){return[2,i._conversationsManager?i._conversationsManager.sendMessage(e,t,n):(ox.warn(ow),null)]})})()}},{key:"getMessages",value:function(e,t){var n=this;return F(function(){return(0,d._)(this,function(i){return[2,n._conversationsManager?n._conversationsManager.getMessages(e,t):(ox.warn(ow),null)]})})()}},{key:"markAsRead",value:function(e){var t=this;return F(function(){return(0,d._)(this,function(n){return[2,t._conversationsManager?t._conversationsManager.markAsRead(e):(ox.warn(ow),null)]})})()}},{key:"getTickets",value:function(e){var t=this;return F(function(){return(0,d._)(this,function(n){return[2,t._conversationsManager?t._conversationsManager.getTickets(e):(ox.warn(ow),null)]})})()}},{key:"requestRestoreLink",value:function(e){var t=this;return F(function(){return(0,d._)(this,function(n){return[2,t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ox.warn(ow),null)]})})()}},{key:"restoreFromToken",value:function(e){var t=this;return F(function(){return(0,d._)(this,function(n){return[2,t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ox.warn(ow),null)]})})()}},{key:"restoreFromUrlToken",value:function(){var e=this;return F(function(){return(0,d._)(this,function(t){return[2,e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ox.warn(ow),null)]})})()}},{key:"getCurrentTicketId",value:function(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}},{key:"getWidgetSessionId",value:function(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}},{key:"Nn",value:function(){var e;null==(e=this._conversationsManager)||e.setIdentity()}},{key:"Dn",value:function(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}]),e}()},oA={logs:function(){function e(t){var n;(0,o._)(this,e),this.Aa=!1,this.Fa=!1,this.Zt=tB("[logs]"),this.Na=[],this.Da=0,this.$a=0,this.qa=!1,this._instance=t,this._instance&&null!=(n=this._instance.config.logs)&&n.captureConsoleLogs&&(this.Aa=!0)}return(0,a._)(e,[{key:"initialize",value:function(){this.loadIfEnabled()}},{key:"onRemoteConfig",value:function(e){var t,n=null==(t=e.logs)?void 0:t.captureConsoleLogs;!ei(n)&&n&&(this.Aa=!0,this.loadIfEnabled())}},{key:"reset",value:function(){this.Na=[],this.ii&&(clearTimeout(this.ii),this.ii=void 0),this.Da=0,this.$a=0,this.qa=!1}},{key:"loadIfEnabled",value:function(){var e=this;if(this.Aa&&!this.Fa){var t=null==w?void 0:w.__PosthogExtensions__;if(t){var n=t.loadExternalDependency;n?n(this._instance,"logs",function(n){var i;n||null==(i=t.logs)||!i.initializeLogs?e.Zt.error("Could not load logs script",n):(t.logs.initializeLogs(e._instance),e.Fa=!0)}):this.Zt.error(nA)}else this.Zt.error("PostHog Extensions not found.")}}},{key:"captureLog",value:function(e){var t,n,i,r,s,o;if(this._instance.is_capturing())if(e&&e.body){var a=null!=(t=null==(n=this._instance.config.logs)?void 0:n.flushIntervalMs)?t:3e3,u=null!=(i=null==(r=this._instance.config.logs)?void 0:r.maxLogsPerInterval)?i:1e3,l=Date.now();if(a>l-this.$a||(this.$a=l,this.Da=0,this.qa=!1),u>this.Da){this.Da++;var c,h,d,f,v,p,_,g,y=(c=this.ja(),d=(h=td[e.level||"info"]||tf).text,f=h.number,v=String(Date.now())+"000000",p={},c.distinctId&&(p.posthogDistinctId=c.distinctId),c.sessionId&&(p.sessionId=c.sessionId),c.currentUrl&&(p["url.full"]=c.currentUrl),c.screenName&&(p["screen.name"]=c.screenName),c.appState&&(p["app.state"]=c.appState),c.activeFeatureFlags&&c.activeFeatureFlags.length>0&&(p.feature_flags=c.activeFeatureFlags),_=$({},p,e.attributes||{}),g={timeUnixNano:v,observedTimeUnixNano:v,severityNumber:f,severityText:d,body:{stringValue:e.body},attributes:tv(_)},e.trace_id&&(g.traceId=e.trace_id),e.span_id&&(g.spanId=e.span_id),Q(e.trace_flags)||(g.flags=e.trace_flags),g);this.Na.push({record:y}),(null!=(s=null==(o=this._instance.config.logs)?void 0:o.maxBufferSize)?s:100)>this.Na.length?this.Ba():this.flushLogs()}else this.qa||(this.Zt.warn("captureLog dropping logs: exceeded "+u+" logs per "+a+"ms"),this.qa=!0)}else this.Zt.warn("captureLog requires a body")}},{key:"logger",get:function(){var e=this;return this.Ha||(this.Ha={trace:function(t,n){return e.captureLog({body:t,level:"trace",attributes:n}
1)},debug:function(t,n){return e.captureLog({body:t,level:"debug",attributes:n})},info:function(t,n){return e.captureLog({body:t,level:"info",attributes:n})},warn:function(t,n){return e.captureLog({body:t,level:"warn",attributes:n})},error:function(t,n){return e.captureLog({body:t,level:"error",attributes:n})},fatal:function(t,n){return e.captureLog({body:t,level:"fatal",attributes:n})}}),this.Ha}},{key:"flushLogs",value:function(e){if(this.ii&&(clearTimeout(this.ii),this.ii=void 0),0!==this.Na.length){var t,n,i,r=this.Na;this.Na=[];var s=this._instance.config.logs,o=$({"service.name":(null==s?void 0:s.serviceName)||"unknown_service"},(null==s?void 0:s.environment)&&{"deployment.environment":s.environment},(null==s?void 0:s.serviceVersion)&&{"service.version":s.serviceVersion},null==s?void 0:s.resourceAttributes),a=(t=r.map(function(e){return e.record}),n=S.LIB_NAME,i=S.LIB_VERSION,{resourceLogs:[{resource:{attributes:tv(o)},scopeLogs:[{scope:{name:n,version:i},logRecords:t}]}]}),u=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.yn({method:"POST",url:u,data:a,compression:"best-available",batchKey:"logs",transport:e})}}},{key:"Ba",value:function(){var e,t,n=this;this.ii||(this.ii=setTimeout(function(){n.ii=void 0,n.flushLogs()},null!=(e=null==(t=this._instance.config.logs)?void 0:t.flushIntervalMs)?e:3e3))}},{key:"ja",value:function(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager&&(t.sessionId=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId),null!=w&&null!=(e=w.location)&&e.href&&(t.currentUrl=w.location.href),this._instance.featureFlags){var n=this._instance.featureFlags.getFlags();n&&n.length>0&&(t.activeFeatureFlags=n)}return t}}]),e}()},oL=$({},oE,oS,oP,oF,o$,oI,oT,oO,oC,oM,oR,oA);sK.__defaultExtensionClasses=$({},oL);var oq=(S.SDK_DIST_CHANNEL="npm",t=sA[sz]=new sK,function(){function e(){e.done||(e.done=!0,sU=!1,nK(sA,function(e){e._dom_loaded()}))}null!=_&&_.addEventListener?"complete"===_.readyState?e():n1(_,"DOMContentLoaded",e,{capture:!1}):f&&tG.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t);e.s(["default",0,oq],604570);var oD=e.i(271645),oN=(0,oD.createContext)({get client(){return n},bootstrap:void 0}),oj=function(e){return"function"==typeof e},oH=function(e,t){return(oH=Object.setPrototypeOf||(0,i._)({__proto__:[]},Array)&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};"function"==typeof SuppressedError&&SuppressedError;var oz={componentStack:null,exceptionEvent:null,error:null};!function(e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}function n(t){var n=e.call(this,t)||this;return n.state=oz,n}oH(n,e),n.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t),n.prototype.componentDidCatch=function(e,t){var n,i=this.props.additionalProperties;oj(i)?n=i(e):(void 0===i?"undefined":(0,r._)(i))==="object"&&(n=i);var s=this.context.client.captureException(e,n),o=t.componentStack;this.setState({error:e,componentStack:null!=o?o:null,exceptionEvent:s})},n.prototype.render=function(){var e=this.props,t=e.children,n=e.fallback,i=this.state;if(null==i.componentStack)return oj(t)?t():t;var r=oj(n)?oD.default.createElement(n,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):n;return oD.default.isValidElement(r)?r:(console.warn("[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."),oD.default.createElement(oD.default.Fragment,null))},n.contextType=oN}(oD.default.Component),n=oq,e.s(["PostHogProvider",0,function(e){var t,i,s=e.children,o=e.client,a=e.apiKey,u=e.options,l=(0,oD.useRef)(null),c=(0,oD.useMemo)(function(){if(o)return a&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),u&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),o;var e=n;return a||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),e},[o,a,JSON.stringify(u)]);return(0,oD.useEffect)(function(){if(!o&&a){var e=n,t=l.current;t?(a!==t.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),u&&!function e(t,n,i){if(void 0===i&&(i=new WeakMap),t===n)return!0;
1if((void 0===t?"undefined":(0,r._)(t))!=="object"||null===t||(void 0===n?"undefined":(0,r._)(n))!=="object"||null===n)return!1;if(i.has(t)&&i.get(t)===n)return!0;i.set(t,n);var s=Object.keys(t),o=Object.keys(n);if(s.length!==o.length)return!1;for(var a=0;a<s.length;a++){var u=s[a];if(!o.includes(u)||!e(t[u],n[u],i))return!1}return!0}(u,t.options)&&e.set_config(u)):(e.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),e.init(a,u)),l.current={apiKey:a,options:null!=u?u:{}}}},[o,a,JSON.stringify(u)]),oD.default.createElement(oN.Provider,{value:{client:c,bootstrap:null!=(t=null==u?void 0:u.bootstrap)?t:null==(i=null==o?void 0:o.config)?void 0:i.bootstrap}},s)},"useFeatureFlagVariantKey",0,function(e){var t,n=(0,oD.useContext)(oN),i=n.client,r=n.bootstrap,s=(0,oD.useState)(function(){return i.getFeatureFlag(e)}),o=s[0],a=s[1];return((0,oD.useEffect)(function(){return i.onFeatureFlags(function(){a(i.getFeatureFlag(e))})},[i,e]),!(null==(t=null==i?void 0:i.featureFlags)?void 0:t.hasLoadedFlags)&&(null==r?void 0:r.featureFlags))?r.featureFlags[e]:o},"usePostHog",0,function(){return(0,oD.useContext)(oN).client}],720565)}]);

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.