posthog-js 1.421.1 → 1.422.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.js.map +1 -1
  11. package/dist/array.no-external.js +1 -1
  12. package/dist/array.no-external.js.map +1 -1
  13. package/dist/conversations.js +1 -1
  14. package/dist/conversations.js.map +1 -1
  15. package/dist/crisp-chat-integration.js.map +1 -1
  16. package/dist/customizations.d.ts +23 -1
  17. package/dist/customizations.full.js +1 -1
  18. package/dist/customizations.full.js.map +1 -1
  19. package/dist/customizations.js +1 -1
  20. package/dist/customizations.js.map +1 -1
  21. package/dist/dead-clicks-autocapture.js +1 -1
  22. package/dist/dead-clicks-autocapture.js.map +1 -1
  23. package/dist/default-extensions.js +1 -1
  24. package/dist/default-extensions.js.map +1 -1
  25. package/dist/exception-autocapture.js +1 -1
  26. package/dist/exception-autocapture.js.map +1 -1
  27. package/dist/extension-bundles.js +1 -1
  28. package/dist/extension-bundles.js.map +1 -1
  29. package/dist/external-scripts-loader.js.map +1 -1
  30. package/dist/intercom-integration.js.map +1 -1
  31. package/dist/lazy-recorder.js +1 -1
  32. package/dist/lazy-recorder.js.map +1 -1
  33. package/dist/logs.js +1 -1
  34. package/dist/logs.js.map +1 -1
  35. package/dist/main.d.ts +23 -1
  36. package/dist/main.js +1 -1
  37. package/dist/main.js.map +1 -1
  38. package/dist/module.d.ts +23 -1
  39. package/dist/module.full.d.ts +23 -1
  40. package/dist/module.full.js +1 -1
  41. package/dist/module.full.js.map +1 -1
  42. package/dist/module.full.no-external.d.ts +23 -1
  43. package/dist/module.full.no-external.js +1 -1
  44. package/dist/module.full.no-external.js.map +1 -1
  45. package/dist/module.js +1 -1
  46. package/dist/module.js.map +1 -1
  47. package/dist/module.no-external.d.ts +23 -1
  48. package/dist/module.no-external.js +1 -1
  49. package/dist/module.no-external.js.map +1 -1
  50. package/dist/module.slim.js +1 -1
  51. package/dist/module.slim.js.map +1 -1
  52. package/dist/module.slim.no-external.d.ts +23 -1
  53. package/dist/module.slim.no-external.js +1 -1
  54. package/dist/module.slim.no-external.js.map +1 -1
  55. package/dist/posthog-recorder.js +1 -1
  56. package/dist/posthog-recorder.js.map +1 -1
  57. package/dist/product-tours-preview.js.map +1 -1
  58. package/dist/product-tours.js +1 -1
  59. package/dist/product-tours.js.map +1 -1
  60. package/dist/recorder-v2.js +1 -1
  61. package/dist/recorder-v2.js.map +1 -1
  62. package/dist/recorder.js +1 -1
  63. package/dist/recorder.js.map +1 -1
  64. package/dist/rrweb-plugin-console-record.js +1 -1
  65. package/dist/rrweb-plugin-console-record.js.map +1 -1
  66. package/dist/rrweb.js +1 -1
  67. package/dist/rrweb.js.map +1 -1
  68. package/dist/src/constants.d.ts +1 -0
  69. package/dist/src/extensions/replay/external/lazy-loaded-session-recorder.d.ts +1 -0
  70. package/dist/src/extensions/replay/external/mutation-throttler.d.ts +1 -0
  71. package/dist/src/logs-types.d.ts +24 -0
  72. package/dist/src/posthog-logs.d.ts +24 -1
  73. package/dist/src/utils/console-original.d.ts +6 -0
  74. package/dist/src/utils/globals.d.ts +2 -0
  75. package/dist/surveys-preview.js +1 -1
  76. package/dist/surveys-preview.js.map +1 -1
  77. package/dist/surveys.js +1 -1
  78. package/dist/surveys.js.map +1 -1
  79. package/dist/tracing-headers.js +1 -1
  80. package/dist/tracing-headers.js.map +1 -1
  81. package/dist/web-vitals-soft-navs.js.map +1 -1
  82. package/dist/web-vitals-with-attribution-soft-navs.js.map +1 -1
  83. package/dist/web-vitals-with-attribution.js.map +1 -1
  84. package/dist/web-vitals.js.map +1 -1
  85. package/lib/package.json +1 -1
  86. package/lib/src/constants.d.ts +1 -0
  87. package/lib/src/constants.js +4 -3
  88. package/lib/src/constants.js.map +1 -1
  89. package/lib/src/entrypoints/logs.js +47 -18
  90. package/lib/src/entrypoints/logs.js.map +1 -1
  91. package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.d.ts +1 -0
  92. package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js +9 -0
  93. package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js.map +1 -1
  94. package/lib/src/extensions/replay/external/mutation-throttler.d.ts +1 -0
  95. package/lib/src/extensions/replay/external/mutation-throttler.js +9 -0
  96. package/lib/src/extensions/replay/external/mutation-throttler.js.map +1 -1
  97. package/lib/src/extensions/replay/rrweb-plugins/patch.js +16 -5
  98. package/lib/src/extensions/replay/rrweb-plugins/patch.js.map +1 -1
  99. package/lib/src/logs-types.d.ts +24 -0
  100. package/lib/src/logs-types.js +11 -0
  101. package/lib/src/logs-types.js.map +1 -0
  102. package/lib/src/persistence-key-policy.js +1 -0
  103. package/lib/src/persistence-key-policy.js.map +1 -1
  104. package/lib/src/posthog-core.js +10 -5
  105. package/lib/src/posthog-core.js.map +1 -1
  106. package/lib/src/posthog-logs.d.ts +24 -1
  107. package/lib/src/posthog-logs.js +266 -10
  108. package/lib/src/posthog-logs.js.map +1 -1
  109. package/lib/src/request.js +1 -3
  110. package/lib/src/request.js.map +1 -1
  111. package/lib/src/utils/console-original.d.ts +6 -0
  112. package/lib/src/utils/console-original.js +16 -0
  113. package/lib/src/utils/console-original.js.map +1 -0
  114. package/lib/src/utils/globals.d.ts +2 -0
  115. package/lib/src/utils/globals.js.map +1 -1
  116. package/lib/tsconfig.tsbuildinfo +1 -1
  117. package/package.json +7 -6
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t,i=null==e?void 0:e.navigator,r=null==e?void 0:e.document,n=null==e?void 0:e.location,s=null==e?void 0:e.fetch,a=null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest?e.XMLHttpRequest:void 0,o=null==e?void 0:e.AbortController,l=null==e?void 0:e.CompressionStream,u=null==i?void 0:i.userAgent;function h(){return!(!t||!1===t.navigator.onLine)}var d="undefined"!=typeof globalThis?globalThis:t;d&&"undefined"==typeof self&&(d.self=d),d&&"undefined"==typeof File&&(d.File=function(){});var v=null!=t?t:{};function c(t,e,i,r,n,s,a){try{var o=t[s](a),l=o.value}catch(t){return void i(t)}o.done?e(l):Promise.resolve(l).then(r,n)}function f(t){return function(){var e=this,i=arguments;return new Promise((function(r,n){var s=t.apply(e,i);function a(t){c(s,r,n,a,o,"next",t)}function o(t){c(s,r,n,a,o,"throw",t)}a(void 0)}))}}function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},p.apply(null,arguments)}function g(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}var m={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},y={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},b=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function _(t){return"string"==typeof t||t}function w(t){return"string"==typeof t?t:void 0}var k,S=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],x=function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),C=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),T="min_length",M="max_length",E=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],I=["token"],R="NativeGzipValidationError",P=t=>t.length>=2&&31===t[0]&&139===t[1],A=(t,e)=>t===C.GZipJS||e===C.GZipJS||"gzip"===e,F=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),O=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return F(t)||e===R},L=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=R,e},D=function(){var t=f((function*(t,e){18>t.size&&L("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());P(i)&&8===i[2]||L("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(k)return k;k=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;k[t]=e>>>0}return k})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&L("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&L("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function N(t,e,i){return q.apply(this,arguments)}function q(){return q=f((function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),s=n.writable.getWriter(),a=s.write(r).then((()=>s.close())).catch(function(){var t=f((function*(t){try{yield s.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),o=new Response(n.readable).blob(),l=(yield Promise.all([o,a]))[0];return yield D(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),q.apply(this,arguments)}var j=20,B=1e3,H=1e4,U="[Circular]",z="[Truncated]",W="[Unserializable]",V="[Function]";function G(t){for(var e="",i=0;t.length>i;i++){var r=t.charCodeAt(i);if(55296>r||r>56319)e+=56320>r||r>57343?t[i]:"�";else{var n=t.charCodeAt(i+1);56320>n||n>57343?e+="�":(e+=t[i]+t[i+1],i++)}}return e}var Z=["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"],Q=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return Z.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function J(t,e){return-1!==t.indexOf(e)}var K=function(t){return t.trim()},Y=function(t){return t.replace(/^\$/,"")};function X(t){var e,i=[];return null!==(e=JSON.stringify(t,(function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(e))return"[Circular]";i.push(e)}return e}})))&&void 0!==e?e:"null"}var tt=Object.prototype,et=tt.hasOwnProperty,it=tt.toString,rt=Array.isArray||function(t){return"[object Array]"===it.call(t)},nt=t=>"function"==typeof t,st=t=>t===Object(t)&&!rt(t),at=t=>{if(st(t)){for(var e in t)if(et.call(t,e))return!1;return!0}return!1},ot=t=>void 0===t,lt=t=>"[object String]"==it.call(t),ut=t=>lt(t)&&0===t.trim().length,ht=t=>null===t,dt=t=>ot(t)||ht(t),vt=t=>"[object Number]"==it.call(t)&&t==t,ct=t=>vt(t)&&t>0,ft=t=>"[object Boolean]"===it.call(t),pt=t=>t instanceof FormData,gt=t=>J(E,t),mt=t=>J(I,t);function yt(t){return null===t||"object"!=typeof t}function bt(t,e){return{}.toString.call(t)==="[object "+e+"]"}function _t(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return kt(t,Error)}}function wt(t){return"undefined"!=typeof Event&&kt(t,Event)}function kt(t,e){try{return t instanceof e}catch(t){return!1}}var St=[!0,"true",1,"1","yes"],xt=t=>J(St,t),Ct=[!1,"false",0,"0","no"];function Tt(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),vt(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),Tt(n||i,e,i,r))}class Mt{constructor(t){this.k={},this.S=t.S,this.C=Tt(t.bucketSize,0,100,t.I),this.R=Tt(t.refillRate,0,this.C,t.I),this.A=Tt(t.refillInterval,0,864e5,t.I)}O(t,e){var i=Math.floor((e-t.lastAccess)/this.A);i>0&&(t.tokens=Math.min(t.tokens+i*this.R,this.C),t.lastAccess=t.lastAccess+i*this.A)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.k[r];return n?this.O(n,i):this.k[r]=n={tokens:this.C,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.S)||e.call(this,t)),0===n.tokens)}stop(){this.k={}}}var Et="Mobile",It="iOS",Rt="Android",Pt="Tablet",At=Rt+" "+Pt,Ft="iPad",Ot="Apple",Lt=Ot+" Watch",Dt="Safari",$t="BlackBerry",Nt="Samsung",qt=Nt+"Browser",jt=Nt+" Internet",Bt="Chrome",Ht=Bt+" OS",Ut=Bt+" "+It,zt="Internet Explorer",Wt=zt+" "+Et,Vt="Opera",Gt=Vt+" Mini",Zt="Edge",Qt="Microsoft "+Zt,Jt="Firefox",Kt=Jt+" "+It,Yt="Nintendo",Xt="PlayStation",te="Xbox",ee=Rt+" "+Et,ie=Et+" "+Dt,re="Windows",ne=re+" Phone",se="Nokia",ae="Ouya",oe="Generic",le=oe+" "+Et.toLowerCase(),ue=oe+" "+Pt.toLowerCase(),he="Konqueror",de="Oculus Browser",ve="Vivaldi",ce="Yandex",fe="Whale",pe="DuckDuckGo",ge="Pale Moon",me="Waterfox",ye="Brave",be="Google Search App",_e="(\\d+(\\.\\d+)?)",we=new RegExp("Version/"+_e),ke=new RegExp(te,"i"),Se=new RegExp(Xt+" \\w+","i"),xe=new RegExp(Yt+" \\w+","i"),Ce=new RegExp($t+"|PlayBook|BB10","i"),Te={"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"},Me=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?ye:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&J(t,"GSA/")?be:J(t," OPR/")&&J(t,"Mini")?Gt:J(t," OPR/")?Vt:Ce.test(t)?$t:J(t,"IE"+Et)||J(t,"WPDesktop")?Wt:J(t,"OculusBrowser")?de:J(t,qt)?jt:J(t,Zt)||J(t,"Edg/")?Qt:J(t,ve+"/")?ve:J(t,"YaBrowser/")?ce:J(t,fe+"/")?fe:J(t,pe+"/")||J(t,"Ddg/")?pe:J(t,"FBIOS")?"Facebook "+Et:J(t,"UCWEB")||J(t,"UCBrowser")?"UC Browser":J(t,"CriOS")?Ut:J(t,"CrMo")||J(t,Bt)?Bt:J(t,Rt)&&J(t,Dt)?ee:J(t,"FxiOS")?Kt:J(t.toLowerCase(),he.toLowerCase())?he:J(t,ye+"/")?ye:((t,e)=>e&&J(e,Ot)||function(t){return J(t,Dt)&&!J(t,Bt)&&!J(t,Rt)}(t))(t,e)?J(t,Et)?ie:Dt:J(t,"PaleMoon/")?ge:J(t,me+"/")?me:J(t,Jt)?Jt:J(t,"MSIE")||J(t,"Trident/")?zt:J(t,"Gecko")?Jt:"")},Ee={[Wt]:[new RegExp("rv:"+_e)],[Qt]:[new RegExp(Zt+"?\\/"+_e)],[Bt]:[new RegExp("("+Bt+"|CrMo)\\/"+_e)],[Ut]:[new RegExp("CriOS\\/"+_e)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+_e)],[Dt]:[we],[ie]:[we],[Vt]:[new RegExp("(Opera|OPR)\\/"+_e)],[Jt]:[new RegExp(Jt+"\\/"+_e)],[Kt]:[new RegExp("FxiOS\\/"+_e)],[he]:[new RegExp("Konqueror[:/]?"+_e,"i")],[$t]:[new RegExp($t+" "+_e),we],[ee]:[new RegExp("android\\s"+_e,"i")],[jt]:[new RegExp(qt+"\\/"+_e)],[de]:[new RegExp("OculusBrowser\\/"+_e)],[ve]:[new RegExp(ve+"\\/"+_e)],[ce]:[new RegExp("YaBrowser\\/"+_e)],[fe]:[new RegExp(fe+"\\/"+_e)],[ye]:[new RegExp(ye+"\\/"+_e)],[pe]:[new RegExp("(DuckDuckGo|Ddg)\\/"+_e)],[ge]:[new RegExp("PaleMoon\\/"+_e)],[me]:[new RegExp(me+"\\/"+_e)],[be]:[new RegExp("GSA\\/"+_e)],[zt]:[new RegExp("(rv:|MSIE )"+_e)],Mozilla:[new RegExp("rv:"+_e)]},Ie=function(t,e,i,r){var n=Me(t,e,i,r),s=Ee[n];if(ot(s))return null;for(var a=0;s.length>a;a++){var o=t.match(s[a]);if(o)return parseFloat(o[o.length-2])}return null},Re=[[new RegExp(te+"; "+te+" (.*?)[);]","i"),t=>[te,t&&t[1]||""]],[new RegExp(Yt,"i"),[Yt,""]],[new RegExp(Xt,"i"),[Xt,""]],[Ce,[$t,""]],[new RegExp(re,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[ne,""];if(new RegExp(Et).test(e)&&!/IEMobile\b/.test(e))return[re+" "+Et,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Te[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[re,r]}return[re,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[It,[t[3],t[4],t[5]||"0"].join(".")]:[It,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ot(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Rt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Rt+")","i"),t=>t&&t[2]?[Rt,[t[2],t[3],t[4]||"0"].join(".")]:[Rt,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ht,""]],[/Linux|debian/i,["Linux",""]]],Pe=function(t){return xe.test(t)?Yt:Se.test(t)?Xt:ke.test(t)?te:new RegExp(ae,"i").test(t)?ae:new RegExp("("+ne+"|WPDesktop)","i").test(t)?ne:/iPad/.test(t)?Ft:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Lt:Ce.test(t)?$t:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(se,"i").test(t)?se:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Et).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Rt:At:new RegExp("(pda|"+Et+")","i").test(t)?le:new RegExp(Pt,"i").test(t)&&!new RegExp(Pt+" pc","i").test(t)?ue:""},Ae=function(t,e){var i,r,n,s,a=Pe(t);return a===Ft||a===At||"Kobo"===a||"Kindle Fire"===a||a===ue?Pt:a===Yt||a===te||a===Xt||a===ae?"Console":a===Lt?"Wearable":a?Et:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(i=null==e?void 0:e.maxTouchPoints)&&void 0!==i?i:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?Et:Pt:"Desktop"},Fe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Oe(t,e){return"string"==typeof(i=t)&&Fe.test(i)?t:e();var i}function Le(t){return t?t.split("#")[0]:t}function De(t,e){var i=setTimeout(t,e);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function $e(t,e,i){return Ne.apply(this,arguments)}function Ne(){return(Ne=f((function*(t,e,i){var r;try{return yield Promise.race([t,new Promise(((t,n)=>{r=De((()=>{try{null==i||i(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var qe={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}},je=qe.info,Be=0x8000000000000000,He={}.propertyIsEnumerable;function Ue(t,e){try{return Ve(t,e,{ancestors:new WeakSet,remainingNodes:H},0)}catch(t){return[]}}function ze(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:z};if(i.remainingNodes--,ft(t))return{boolValue:t};if("number"==typeof t){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if("undefined"==typeof BigInt)return{stringValue:String(t)};var n=BigInt(t).toString();return t>=Be||-Be>t?(null==e||e.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:G(t)};if("function"==typeof t)return{stringValue:V};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:U};if(r>=j)return{stringValue:z};if(t instanceof Date){var s=t.getTime(),a=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof a?G(a):String(a)}}i.ancestors.add(t);try{try{var o=t.toJSON;if("function"==typeof o)return ze(o.call(t),e,i,r+1)}catch(t){}return rt(t)?{arrayValue:{values:We(t,e,i,r+1)}}:{kvlistValue:{values:Ve(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:G(String(t))}}function We(t,e,i,r){for(var n=[],s=Math.min(t.length,B),a=0;s>a&&i.remainingNodes>0;a++)try{var o=a in t?t[a]:void 0;if(dt(o))continue;n.push(ze(o,e,i,r))}catch(t){n.push({stringValue:W})}return t.length>a&&n.push({stringValue:z}),n}function Ve(t,e,i,r){var n=[];for(var s in t)if(He.call(t,s)){if(n.length>=B||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=t[s];if(ht(a)||ot(a))continue;n.push({key:G(s),value:ze(a,e,i,r)})}catch(t){n.push({key:G(s),value:{stringValue:W}})}}return n}function Ge(t){try{return G(String(t))}catch(t){return W}}function Ze(t,e,i){var r=qe[t.level||"info"]||je,n=r.text,s=r.number,a=String(Date.now())+"000000",o={};e.distinctId&&(o.posthogDistinctId=e.distinctId),e.sessionId&&(o.sessionId=e.sessionId),e.windowId&&(o["window.id"]=e.windowId),dt(e.sessionStartTimestamp)||(o.sessionStartTimestamp=String(e.sessionStartTimestamp)),dt(e.lastActivityTimestamp)||(o.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(o["url.full"]=e.currentUrl),e.screenName&&(o["screen.name"]=e.screenName),e.appState&&(o["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(o.feature_flags=e.activeFeatureFlags);var l=p({},o),u=t.attributes;if(u){var h=[];try{h=Object.keys(u)}catch(t){h=[]}for(var d of h){var v=void 0;try{v=u[d]}catch(t){v=W}Object.defineProperty(l,d,{value:v,enumerable:!0,writable:!0,configurable:!0})}}var c={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:s,severityText:n,body:{stringValue:Ge(t.body)},attributes:Ue(l,i)};return t.trace_id&&(c.traceId=t.trace_id),t.span_id&&(c.spanId=t.span_id),ot(t.trace_flags)||(c.flags=t.trace_flags),c}function Qe(t,e,i){return p({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}function Je(t,e,i,r){return{resourceLogs:[{resource:{attributes:Ue(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}let Ke=class{constructor(t,e,i,r,n,s,a){var o;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.Wi=e,this.I=i,this.hn=r,this.dn=n,this.vn=s,this.cn=a,this.fn=null,this.pn=0,this.gn=0,this.mn=0,this.yn=0,this.bn=!1,this._n=e.maxBufferSize,this.wn=Math.max(null!==(o=e.maxQueueSize)&&void 0!==o?o:e.maxBufferSize,e.maxBufferSize),this.kn=e.flushIntervalMs,this.Sn=e.maxBatchRecordsPerPost,this.xn=e.rateCapWindowMs,this.Cn=e.maxLogsPerInterval}reset(){this.Tn(),this.fn=null,this.mn=0,this.yn=0,this.bn=!1,this.pn=0,this.gn=0,this.Sn=this.Wi.maxBatchRecordsPerPost}onReconnect(){this.gn=0,this.Mn()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var e=this.En(t);if(null!==e)if(e.body){if(this.In()){var i={record:Ze(e,this.hn(),this.I)};this.dn((()=>this.Rn(i)))}}else this.I.info("Log was rejected in beforeSend function")}}En(t){var e=this.Wi.beforeSend;if(!e)return t;var i=rt(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.I.info("Log was rejected in beforeSend function"),null;r=s}catch(t){return this.I.error("Error in beforeSend function for log:",t),null}return r}In(){if(void 0===this.Cn)return!0;var t=Date.now(),e=t-this.mn;return this.xn>e&&e>=0||(this.mn=t,this.yn=0,this.bn=!1),this.Cn>this.yn?(this.yn++,!0):(this.bn||(this.I.warn("captureLog dropping logs: exceeded "+this.Cn+" logs per "+this.xn+"ms"),this.bn=!0),!1)}flush(){var t=this;return f((function*(){if(!t._instance.isDisabled)return t.fn||(t.fn=t.Pn().finally((()=>{t.fn=null}))),t.fn}))()}Pn(){var t=this;return f((function*(){var e;t.Tn();var i=null!==(e=t._instance.getPersistedProperty(x.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,a;t.pn=0;var o=Math.min(i.length,t.Sn),l=i.slice(0,o),u=l.map((t=>t.record)),h=Je(u,t.An(),null!==(s=t.cn)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.Fn(h);if("too-large"===d.kind&&l.length>1)t.Sn=Math.max(1,Math.floor(l.length/2)),t.I.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.Sn);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.I.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t.Wi.maxBatchRecordsPerPost>t.Sn&&(t.Sn=Math.min(t.Wi.maxBatchRecordsPerPost,t.Sn+1)),yield t.On(l.length),i=null!==(a=t._instance.getPersistedProperty(x.LogsQueue))&&void 0!==a?a:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}On(t){var e=this;return f((function*(){var i,r=Math.max(0,t-e.pn),n=null!==(i=e._instance.getPersistedProperty(x.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(x.LogsQueue,n.slice(r)),yield e.vn()}))()}An(){return Qe(this.Wi,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Rn(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(x.LogsQueue))&&void 0!==e?e:[];this.wn>i.length||(i.shift(),this.pn++,this.I.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(x.LogsQueue,i),this._n>i.length?this.Ln():this.Mn()}}Ln(t){void 0===t&&(t=this.kn),this.Dn||(this.Dn=De((()=>{this.Dn=void 0,this.Mn()}),t))}$n(){var t=Math.min(Math.max(0,this.gn-1),6);return this.kn*Math.pow(2,t)}Nn(){var t=this._instance.getPersistedProperty(x.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return f((function*(){e.Tn();var i=e.flush().catch((()=>{}));void 0!==t?yield $e(i,t):yield i}))()}flushWithTimeout(t){var e=this;return f((function*(){var i=e.flush();yield $e(i,t,(()=>{i.catch((()=>{}))}))}))()}Mn(){this.flush().then((()=>{this.gn=0}),(t=>{this.gn++,this.I.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.Nn()&&this.Ln(this.$n())}))}Tn(){this.Dn&&(clearTimeout(this.Dn),this.Dn=void 0)}};var Ye=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Xe(t){return String(t)+"000000"}function ti(t,e,i,r){var n="";return r&&(n=Object.keys(r).sort().map((t=>JSON.stringify(t)+":"+JSON.stringify(r[t]))).join(",")),t+"\0"+e+"\0"+(null!=i?i:"")+"\0"+n}let ei=class{constructor(t,e,i){this._instance=t,this.Wi=e,this.I=i,this.qn=new Map,this.fn=null,this.jn=!1,this.Bn=new Map,this.Hn=new Set,this.Un=0}count(t,e,i){void 0===e&&(e=1),this.zn({name:t,type:"count",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(t,e,i){this.zn({name:t,type:"gauge",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(t,e,i){this.zn({name:t,type:"histogram",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var t=this,e=this.fn,i=function(){var i=f((function*(){e&&(yield e.catch((()=>{}))),yield t.Wn()}));return function(){return i.apply(this,arguments)}}(),r=i().finally((()=>{this.fn===r&&(this.fn=null)}));return this.fn=r,r}drainWindow(){if(0===this.qn.size)return null;var t=this.qn;return this.qn=new Map,this.jn=!1,this.Bn=new Map,this.Hn=new Set,this.Vn(t)}reset(){this.Un++,this.Tn(),this.qn=new Map,this.fn=null,this.jn=!1,this.Bn=new Map,this.Hn=new Set}zn(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.En(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.I.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,r;try{i=e.attributes?p({},e.attributes):void 0,r=ti(e.type,e.name,e.unit,i)}catch(t){return void this.I.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var n=this.qn.get(r);if(!n){if(!this.Gn())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.qn.set(r,n)}var s=this.Bn.get(e.name);void 0===s?this.Bn.set(e.name,e.type):s===e.type||this.Hn.has(e.name)||(this.Hn.add(e.name),this.I.warn("Metric name '"+e.name+"' is already used as a "+s+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Zn(n,e.value),this.Ln()}else this.I.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}Gn(){return this.Wi.maxSeriesPerFlush>this.qn.size||(this.jn||(this.jn=!0,this.I.warn("Metric series cap reached ("+this.Wi.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Zn(t,e){var i;switch(t.type){case"count":t.total=(null!==(i=t.total)&&void 0!==i?i:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Ye.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[function(t,e){for(var i=0;e.length>i;i++)if(e[i]>=t)return i;return e.length}(e,Ye)]+=1}}En(t){var e=this.Wi.beforeSend;if(!e)return t;var i=rt(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.I.info("Metric was rejected in beforeSend function"),null;r=s}catch(t){return this.I.error("Error in beforeSend function for metric:",t),null}return r}Ln(){this.Dn||(this.Dn=De((()=>{this.Dn=void 0,this.flush().catch((t=>{this.I.error("Metrics flush failed:",t)}))}),this.Wi.flushIntervalMs))}Tn(){this.Dn&&(clearTimeout(this.Dn),this.Dn=void 0)}Wn(){var t=this;return f((function*(){if(0!==t.qn.size){var e=t.qn;t.qn=new Map,t.jn=!1,t.Bn=new Map,t.Hn=new Set;var i=t.Un,r=yield t._instance.Qn(t.Vn(e));if(i===t.Un)switch(r.kind){case"ok":return;case"retry-later":return t.Jn(e),void t.Ln();case"too-large":return void t.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.I.error("Failed to send metrics batch:",r.error)}}}))()}Vn(t){return e=this.Kn(t),i=function(t,e,i){return p({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}(this.Wi,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Ue(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Kn(t){var e=Xe(Date.now()),i=new Map;for(var r of t.values()){var n,s=ti(r.type,r.name,r.unit,void 0),a=i.get(s);a||(a=p({name:r.name},r.unit&&{unit:r.unit}),"count"===r.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===r.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(s,a));var o=Ue(null!==(n=r.attributes)&&void 0!==n?n:{},this.I),l=Xe(r.windowStartMs);if("count"===r.type){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:e,asDouble:null!==(u=r.total)&&void 0!==u?u:0};a.sum.dataPoints.push(h)}else if("gauge"===r.type){var d,v={attributes:o,timeUnixNano:e,asDouble:null!==(d=r.last)&&void 0!==d?d:0};a.gauge.dataPoints.push(v)}else r.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:Ye})}return Array.from(i.values())}Jn(t){var e,i;for(var r of t){var n=r[0],s=r[1],a=this.qn.get(n);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,s.windowStartMs),a.type){case"count":a.total=(null!==(e=a.total)&&void 0!==e?e:0)+(null!==(i=s.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(s.hist)if(a.hist){a.hist.count+=s.hist.count,a.hist.sum+=s.hist.sum,a.hist.min=Math.min(a.hist.min,s.hist.min),a.hist.max=Math.max(a.hist.max,s.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=s.hist.bucketCounts[o]}else a.hist=s.hist}else this.Gn()&&this.qn.set(n,s)}}};function ii(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var ri,ni,si;function ai(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return si&&i.length===ni||(ni=i.length,si=i.reduce(((i,r)=>{ri||(ri={});var n=ri[r];if(n)i[n[0]]=n[1];else for(var s=t(r),a=s.length-1;a>=0;a--){var o=s[a],l=null==o?void 0:o.filename,u=e[r];if(l&&u){i[l]=u,ri[r]=[l,u];break}}return i}),{})),si}}class oi{constructor(t,e,i){void 0===i&&(i=[]),this.coercers=t,this.stackParser=e,this.modifiers=i}buildFromUnknown(t,e){void 0===e&&(e={});var i=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(t){var e=this;return f((function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&rt(i.stacktrace.frames)&&(i.stacktrace.frames=yield e.applyModifiers(i.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,r;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(r=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),p({},t,{cause:i,stack:r})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var i of this.coercers)if(i.match(t))return i.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return f((function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i}))()}convertToExceptionList(t,e){var i,r,n,s={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(r=e.handled)||void 0===r||r,synthetic:null!==(n=t.synthetic)&&void 0!==n&&n}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,p({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:ai(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var r=(i,r)=>{if(4>=r){var n=this.buildCoercingContext(t,e,r);return this.applyCoercers(i,n)}};return p({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}}var li="?";function ui(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?li:i,in_app:!(null!=e&&e.startsWith("webkit-masked-url://"))&&"<anonymous>"!==e};return ot(r)||(s.lineno=r),ot(n)||(s.colno=n),s}var hi=(t,e)=>{var i=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return i||r?[-1!==t.indexOf("@")?t.split("@")[0]:li,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},di=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,vi=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ci=/\((\S*)(?::(\d+))(?::(\d+))\)/,fi=(t,e)=>{var i=di.exec(t);if(i)return ui(e,i[1],li,+i[2],+i[3]);var r=vi.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=ci.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=hi(r[1]||li,r[2]);return ui(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},pi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,gi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,mi=(t,e)=>{var i=pi.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=gi.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var n=i[3],s=i[1]||li,a=hi(s,n);return ui(e,n=a[1],s=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},yi=/\(error: (.*)\)/,bi=50;class _i{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=lt(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return bt(t,"DOMException")}isDOMError(t){return bt(t,"DOMError")}}class wi{match(t){return _t(t)}coerce(t,e){var i,r=this.getStack(t),n=void 0===r;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=r?r:null==(i=e.syntheticException)?void 0:i.stack,cause:t.cause?e.next(t.cause):void 0,synthetic:n}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var i=t.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(t){return t.stacktrace||t.stack||void 0}}class ki{constructor(){}match(t){return!!bt(t,"ErrorEvent")&&(null!=t.error||this.wi(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var r=e.apply(t.message);return p({},r,{stack:null!==(i=this.ki(t))&&void 0!==i?i:r.stack,synthetic:!0})}wi(t){return lt(t.message)&&t.message.length>0}ki(t){var e,i,r=t,n=null!==(e=r.lineno)&&void 0!==e?e:0,s=null!==(i=r.colno)&&void 0!==i?i:0;if(lt(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}}var Si=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class xi{match(t){return"string"==typeof t}coerce(t,e){var i,r=this.getInfos(t),n=r[0],s=r[1];return{type:null!=n?n:"Error",value:null!=s?s:t,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(t){var e="Error",i=t,r=t.match(Si);return r&&(e=r[1],i=r[2]),[e,i]}}var Ci=["fatal","error","warning","log","info","debug"];function Ti(t,e){void 0===e&&(e=40);var i=Object.keys(t);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var n=i.slice(0,r).join(", ");if(e>=n.length)return r===i.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class Mi{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var i,r,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(i=this.getStack(t))&&void 0!==i?i:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(wt(t))return t.constructor.name;var e="name"in t?t.name:void 0;return lt(e)&&!ut(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var i=this.getObjectClassName(t);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+Ti(t)}isSeverityLevel(t){return lt(t)&&!ut(t)&&Ci.indexOf(t)>=0}getStack(t){try{return lt(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:lt(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var i=t[e];if(_t(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Ei{match(t){return wt(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Ti(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Ii{match(t){return yt(t)}coerce(t,e){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Ri{match(t){return bt(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!wt(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var i,r=this.getUnhandledRejectionReason(t);return yt(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Pi="$message",Ai="$timestamp",Fi=new Set([Pi,Ai]),Oi={enabled:!0,max_bytes:32768};function Li(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Oi.enabled,max_bytes:$i(t.max_bytes,Oi.max_bytes)}:p({},Oi)}class Di{constructor(t){this.Yn=[],this.Xn=0,this.Wi=Li(t)}setConfig(t){this.Wi=Li(t),this.ts()}add(t){var e=function(t){var e;try{e=X(t)}catch(t){return}try{var i=JSON.parse(e);if(!st(i))return;var r=i,n=r[Pi],s=r[Ai];if(!lt(n)||0===n.trim().length)return;if(!lt(s)&&!vt(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),i=0,r=0;e.length>r;r++)"%"===e[r]?(i+=1,r+=2):i+=1;return i}(e.json);i>this.Wi.max_bytes||(this.Yn.push({step:e.step,bytes:i}),this.Xn+=i,this.ts())}}getAttachable(){return this.Yn.map((t=>t.step))}clear(){this.Yn=[],this.Xn=0}size(){return this.Yn.length}ts(){for(;this.Xn>this.Wi.max_bytes&&this.Yn.length>0;){var t=this.Yn.shift();t&&(this.Xn-=t.bytes)}}}function $i(t,e){if(!vt(t)||t===1/0||t===-1/0)return e;var i=Math.floor(t);return 0>i?e:i}var Ni={DEBUG:!1,LIB_VERSION:"0.6.0",LIB_NAME:"browser-common"},qi=function(e,i){var r=(void 0===i?{}:i).debugEnabled,n={P(i){if(t&&(Ni.DEBUG||t.POSTHOG_DEBUG||r)&&!ot(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i]),s=arguments.length,a=new Array(s>1?s-1:0),o=1;s>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("error",...e)},critical(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(t,i)=>qi(e+" "+t,i)};return n},ji=qi("[PostHog.js]"),Bi=ji.createLogger;function Hi(t,e){rt(t)&&t.forEach(e)}function Ui(t,e){if(!dt(t))if(rt(t))t.forEach(e);else if(pt(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)et.call(t,i)&&e(t[i],i)}var zi=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var n of i)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function Wi(t){for(var e=Object.keys(t),i=e.length,r=new Array(i);i--;)r[i]=[e[i],t[e[i]]];return r}var Vi=function(t){try{return t()}catch(t){return}},Gi=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){ji.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ji.critical(t)}}},Zi=function(t){var e={};return Ui(t,(function(t,i){(lt(t)&&t.length>0||vt(t))&&(e[i]=t)})),e};var Qi=["herokuapp.com","vercel.app","netlify.app"];function Ji(t){var e=null==t?void 0:t.hostname;if(!lt(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Qi)if(i===r)return!1;return!0}function Ki(t,e,i,r){var n=null!=r?r:{},s=n.capture,a=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===a||a})}function Yi(t){return"ph_toolbar_internal"===t.name}var Xi=["localhost","127.0.0.1"],tr=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return X(t)}},er=t=>{var e=null==r?void 0:r.createElement("a");return ot(e)?null:(e.href=t,e)},ir=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return Ui(t,(function(t,e){ot(t)||ot(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),n[n.length]=r+"="+i)})),n.join(e)},rr=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;r.length>n;n++){var s=r[n].split("=");if(s[0]===e){i=s;break}}if(!rt(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(t){ji.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},nr=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),a=s[1],o=s[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");rt(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=o;return null!=a&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},sr=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},ar=(t,e)=>t>=e&&h(),or=(t,e,i,r)=>{if(0===t){if(h()){var n=e+1;return n===i&&r(),n}return e}return 0};function lr(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!nt(r))return e;try{var n=r(e);return lt(n)&&n?n:e}catch(t){return ji.error("Error in get_current_url, falling back to window.location.href",t),e}}function ur(e){var i,r=null==t||null==(i=t.location)?void 0:i.href;return ot(r)?void 0:lr(e,r)}var hr="__POSTHOG_TOOLBAR__",dr=1,vr=3,cr=11;function fr(t){return t instanceof Element&&(t.id===hr||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function pr(t){return!!t&&t.nodeType===dr}function gr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function mr(t){return!!t&&t.nodeType===vr}function yr(t){return!!t&&t.nodeType===cr&&pr(t.host)}var br=1e3;function _r(t){return t?K(t).split(/\s+/):[]}function wr(t,e){var i=ur(e);return!!(i&&t&&t.some((t=>i.match(t))))}function kr(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return _r(e)}function Sr(t){return dt(t)?null:K(t).split(/(\s+)/).filter((t=>Zr(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function xr(t){var e="";return qr(t)&&!jr(t)&&t.childNodes&&t.childNodes.length&&Ui(t.childNodes,(function(t){var i;mr(t)&&t.textContent&&(e+=null!==(i=Sr(t.textContent))&&void 0!==i?i:"")})),K(e)}function Cr(t){var e;return ot(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Tr=["a","button","form","input","select","textarea","label"];function Mr(t,e){if(ot(e))return!0;var i,r=function(t){if(e.some((e=>function(t,e){var i=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!i&&i.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function Er(t){var e=t.parentNode;return!(!e||!pr(e))&&e}var Ir=[".ph-no-autocapture","[data-ph-no-autocapture]"],Rr=["next","previous","prev",">","<"],Pr=[...Rr,"+","-","−","–"],Ar=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Fr=[".ph-no-deadclick",".ph-no-capture"],Or=[".ph-no-rageclick",".ph-no-capture"],Lr=["","text","search","email","password","url","tel","number"];function Dr(e,i){if(!t||$r(e))return!1;var r,n,s,a,o;if(ft(i)?(r=!!i&&Or,n=void 0,s=!1):(r=null!==(a=null==i?void 0:i.css_selector_ignorelist)&&void 0!==a?a:Or,n=null==i?void 0:i.content_ignorelist,s=null!==(o=null==i?void 0:i.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(s&&function(t){return!(!t||!pr(t))&&(!!gr(t,"textarea")||(gr(t,"input")?J(Lr,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}(e))return!1;var l=Nr(e,!1).targetElementList;return!function(t,e){if(!1===t||ot(t))return!1;var i;if(!0===t)i=Rr;else{if(!rt(t))return!1;if(t.length>10)return ji.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=t.map((t=>t.toLowerCase()))}return e.some((t=>{var e=t.safeText,r=t.ariaLabel;return i.some((t=>Ar(e,t)||Ar(r,t)))}))}(n,l.map((t=>{var e;return{safeText:xr(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Mr(l,r)}var $r=t=>!t||gr(t,"html")||!pr(t),Nr=(e,i)=>{if(!t||$r(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],s=e;s.parentNode&&!gr(s,"body");)if(yr(s.parentNode))n.push(s.parentNode.host),s=s.parentNode.host;else{var a=Er(s);if(!a)break;if(i||Tr.indexOf(a.tagName.toLowerCase())>-1)r=!0;else try{var o=t.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(t){}n.push(a),s=a}return{parentIsUsefulElement:r,targetElementList:n}};function qr(t){for(var e=new Set,i=0,r=t;r.parentNode&&!gr(r,"body");r=r.parentNode){if(i++>=br||e.has(r))return!1;e.add(r);var n=kr(r);if(J(n,"ph-sensitive")||J(n,"ph-no-capture"))return!1}if(J(kr(t),"ph-include"))return!0;var s=t.type||"";if(lt(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!lt(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function jr(t){return!!(gr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||gr(t,"select")||gr(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Br=new RegExp("^(?:(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}))$"),Hr=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Ur=[16,15,14,13],zr=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Wr=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Vr=/[0-9A-Za-z_]/;function Gr(t){for(var e=0,i=!1,r=t.length-1;r>=0;r--){var n=t.charCodeAt(r)-48;i&&(n*=2)>9&&(n-=9),e+=n,i=!i}return e%10==0}function Zr(t,e){if(void 0===e&&(e=!0),dt(t))return!1;if(lt(t)){t=K(t);var i=e?Br.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Hr.lastIndex=0;e=Hr.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Ur){var a=n+s;if(r.length>=a){var o=r.slice(n,a);if(Br.test(o)&&Gr(o))return!0}}}return!1}(t);if(i)return!1;var r=e?zr.test(t):function(t){var e;for(Wr.lastIndex=0;e=Wr.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&Vr.test(i)&&Vr.test(r)))return!0}return!1}(t);if(r)return!1}return!0}function Qr(t){var e=xr(t);return Zr(e=(e+" "+Jr(t)).trim())?e:""}function Jr(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Ui(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=xr(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Jr(t)).trim())}catch(t){ji.error("[AutoCapture]",t)}})),e}function Kr(t){return t.replace(/"|\\"/g,'\\"')}function Yr(t){var e=t.attr__class;if(e)return rt(e)?e:_r(e)}var Xr="[SessionRecording]",tn="redacted",en=1e6;function rn(t){var e;return Math.min(en,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:en)}var nn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:en,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},sn=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],an=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],on=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],ln=t=>{dt(t)||Ui(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return sn.includes(e)||on.some((t=>e.includes(t)))})(e)&&(t[e]=tn)}))},un=["/s/","/e/","/i/"];function hn(t,e,i,r){if(dt(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return lt(n)&&(n=parseInt(n)),n>i?Xr+" "+r+" body too large to record ("+n+" bytes)":t}function dn(t,e){if(dt(t))return t;var i=t;return Zr(i,!1)||(i=Xr+" "+e+" body "+tn),Ui(an,(t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i=Xr+" "+e+" body "+tn+" as might contain: "+t)})),i}var vn=new WeakSet,cn="$people_distinct_id",fn="distinct_id",pn="$device_id",gn="$device_model",mn="__alias",yn="__timers",bn="$autocapture_disabled_server_side",_n="$heatmaps_enabled_server_side",wn="$exception_capture_enabled_server_side",kn="$error_tracking_suppression_rules",Sn="$error_tracking_capture_extension_exceptions",xn="$web_vitals_enabled_server_side",Cn="$dead_clicks_enabled_server_side",Tn="$product_tours_enabled_server_side",Mn="$web_vitals_allowed_metrics",En="$session_recording_remote_config",In="$replay_sample_rate",Rn="$replay_override_sampling",Pn="$replay_override_linked_flag",An="$replay_override_url_trigger",Fn="$replay_override_event_trigger",On="$sesid",Ln="$session_is_sampled",Dn="$session_past_minimum_duration",$n="$session_recording_url_trigger_activated_session",Nn="$session_recording_event_trigger_activated_session",qn="$posthog_sr_group_event_trigger_",jn="$posthog_sr_group_url_trigger_",Bn="$posthog_sr_group_sampling_",Hn="$debug_first_full_snapshot_timestamp",Un="$sess_rec_flush_size",zn="$enabled_feature_flags",Wn="$active_feature_flags",Vn="$early_access_features",Gn="$feature_flag_details",Zn="$feature_flag_payloads",Qn="$feature_flag_request_id",Jn="$minimal_flag_called_events",Kn="$override_feature_flags",Yn="$override_feature_flag_payloads",Xn="$stored_person_properties",ts="$stored_group_properties",es="$groups",is="$surveys",rs="$surveys_loaded_at",ns="$surveys_activated",ss="$surveys_activated_session",as="$surveys_activated_timestamps",os="ph_product_tours",ls="$flag_call_reported",us="$flag_call_reported_session_id",hs="$feature_flag_errors",ds="$feature_flag_evaluated_at",vs="$user_state",cs="$client_session_props",fs="$capture_rate_limit",ps="$initial_campaign_params",gs="$initial_referrer_info",ms="$initial_person_info",ys="$epp",bs="$posthog_cookieless",_s="$cookieless_mode",ws="$sdk_debug_extensions_init_method",ks="$sdk_debug_extensions_init_time_ms",Ss="$sdk_debug_recording_script_not_loaded",xs="$sdk_debug_replay_event_trigger_status",Cs="$sdk_debug_replay_linked_flag_trigger_status",Ts="$sdk_debug_replay_matched_recording_trigger_groups",Ms="$sdk_debug_replay_pending_trigger_conditions",Es="$sdk_debug_replay_remote_trigger_matching_config",Is="$sdk_debug_replay_trigger_groups_count",Rs="$sdk_debug_replay_url_trigger_status",Ps="$session_recording_start_reason",As="PostHog loadExternalDependency extension not found.",Fs="on_reject",Os="always",Ls="anonymous",Ds="identified",$s="identified_only",Ns="visibilitychange",qs="beforeunload",js="$pageview",Bs="$pageleave",Hs="$identify",Us="$groupidentify",zs="disabled",Ws="sampled",Vs="active",Gs="buffering",Zs="paused",Qs="lazy_loading",Js="awaiting_config",Ks="missing_config",Ys="rrweb_error",Xs="trigger",ta=Xs+"_activated",ea=Xs+"_pending",ia=Xs+"_"+zs;function ra(t,e,i,r,n,s){return 0===e?ia:(null==t?void 0:t.get_property(i?r+i:n))===s?ta:ea}function na(t,e,i){return e.some((e=>{var r;return"regex"===e.matching&&(null!==(r=null==i?void 0:i.get(e.url))&&void 0!==r?r:new RegExp(e.url)).test(t)}))}function sa(t){return t.includes(ta)?ta:t.includes(ea)?ea:ia}function aa(t){var e=new Set(t);switch(e.delete(ia),e.size){case 0:return ia;case 1:return Array.from(e)[0];default:return ea}}class oa{constructor(t){this.F=t}triggerStatus(t){return sa(this.F.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return sa(this.F.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.F.forEach((t=>t.stop()))}}class la{constructor(t){this.F=t}triggerStatus(t){return aa(this.F.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return aa(this.F.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.F.forEach((t=>t.stop()))}}class ua{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return ta}stop(){}}var ha=t=>"sessionRecording"in t;class da{constructor(t,e){this.N=[],this.q=[],this.j=new Map,this.B=new Map,this.H="",this.urlBlocked=!1,this._instance=t,this.U=e}onConfig(t){var e,i;this.N=(ha(t)?st(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.q=(ha(t)?st(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.$()}$(){for(var t of(this.j.clear(),this.B.clear(),this.N))if("regex"===t.matching&&!this.j.has(t.url))try{this.j.set(t.url,new RegExp(t.url))}catch(e){ji.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.q)if("regex"===e.matching&&!this.B.has(e.url))try{this.B.set(e.url,new RegExp(e.url))}catch(t){ji.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}W(t){return ra(this._instance,this.N.length,this.U,jn,$n,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Rs]:e}),e}triggerStatusNoSideEffects(t){return this.W(t)}isCurrentUrlBlocked(){var t=ur(this._instance);if(!t)return!1;try{return na(t,this.q,this.B)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=ur(this._instance);if(i&&i!==this.H){this.H=i;var r=this.urlBlocked,n=na(i,this.q,this.B);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=ur(this._instance);if(n&&n!==this.H){this.H=n;var s=this.urlBlocked,a=na(n,this.q,this.B);a&&!s?t():!a&&s&&e();var o=this.W(r)===ta,l=na(n,this.N,this.j);!o&&l&&i("url",n)}}stop(){this.H=""}}class va{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.V=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Cs]:t}),t}triggerStatusNoSideEffects(){var t=ea;return dt(this.linkedFlag)&&(t=ia),this.linkedFlagSeen&&(t=ta),t}onConfig(t,e){var i;if(this.linkedFlag=(ha(t)?st(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!dt(this.linkedFlag)&&!this.linkedFlagSeen){var r=lt(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=lt(this.linkedFlag)?null:this.linkedFlag.variant;this.V=this._instance.onFeatureFlags(((t,i)=>{var s=!1;if(st(i)&&r in i){var a=i[r];s=ft(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(r,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.V()}}class ca{constructor(t,e){this.Z=[],this._instance=t,this.U=e}onConfig(t){var e;this.Z=(ha(t)?st(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}G(t){return ra(this._instance,this.Z.length,this.U,qn,Nn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[xs]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}checkEventTriggerConditions(t,e,i){if(0!==this.Z.length){var r=this.G(i)===ta,n=this.Z.includes(t);!r&&n&&e("event",t)}}stop(){}}class fa{constructor(t,e,i){if(this._instance=t,this.group=e,this.J=new da(t,e.id),this.Y=new ca(t,e.id),this.K=new va(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var r=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:r,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.J.onConfig(n),this.Y.onConfig(n),this.K.onConfig(n,i);var s=[this.Y,this.J,this.K];this.X="any"===e.conditions.matchType?new oa(s):new la(s)}else this.X=new ua}triggerStatus(t){return this.X.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.X.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==ea?[]:[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===ea)).map((t=>t.label))}checkEventTriggerConditions(t,e,i){this.Y.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.J.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i;null==(i=this._instance.persistence)||i.register({["url"===t?jn+this.group.id:qn+this.group.id]:e})}stop(){this.J.stop(),this.Y.stop(),this.K.stop()}}function pa(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Gs;if(!t.isRecordingEnabled)return zs;if(t.urlTriggerMatching.urlBlocked)return Zs;var e=!0===t.isSampled,i=new oa([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Ws:i===ta?Vs:i===ea?Gs:!1===t.isSampled?zs:Vs}function ga(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Gs;if(!t.isRecordingEnabled)return zs;if(t.urlTriggerMatching.urlBlocked)return Zs;var e=new la([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==ia,r=ft(t.isSampled);return i&&e===ea?Gs:i&&e===ia||r&&!t.isSampled?zs:!0===t.isSampled?Ws:Vs}function ma(){var t=[];return function(e,i){if(st(i)||rt(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function ya(t){var e=JSON.stringify(t,ma());return e?new Blob([e]).size:0}function ba(t){if(ht(t))return 4;if(ot(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(rt(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=ot(r)||ht(r)?4:ba(r)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var l=n[o];ot(l)||(a||(s+=1),a=!1,s+=o.length+3+ba(l))}return s;default:return 0}}function _a(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var i=Math.floor(t.data.length/2),r=t.sizes.slice(0,i),n=t.sizes.slice(i);return[_a({size:r.reduce(((t,e)=>t+e),0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),_a({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(i),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}var wa=Uint8Array,ka=Uint16Array,Sa=Uint32Array,xa=new wa([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]),Ca=new wa([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]),Ta=new wa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ma=function(t,e){for(var i=new ka(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new Sa(i[30]);for(r=1;30>r;++r)for(var s=i[r];i[r+1]>s;++s)n[s]=s-i[r]<<5|r;return[i,n]},Ea=Ma(xa,2),Ia=Ea[1];Ea[0][28]=258,Ia[258]=28;for(var Ra=Ma(Ca,0)[1],Pa=new ka(32768),Aa=0;32768>Aa;++Aa){var Fa=(43690&Aa)>>>1|(21845&Aa)<<1;Pa[Aa]=((65280&(Fa=(61680&(Fa=(52428&Fa)>>>2|(13107&Fa)<<2))>>>4|(3855&Fa)<<4))>>>8|(255&Fa)<<8)>>>1}var Oa=function(t,e,i){for(var r=t.length,n=0,s=new ka(e);r>n;++n)++s[t[n]-1];var a,o=new ka(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(i){a=new ka(1<<e);var l=15-e;for(n=0;r>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=o[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)a[Pa[d]>>>l]=u}else for(a=new ka(r),n=0;r>n;++n)a[n]=Pa[o[t[n]-1]++]>>>15-t[n];return a},La=new wa(288);for(Aa=0;144>Aa;++Aa)La[Aa]=8;for(Aa=144;256>Aa;++Aa)La[Aa]=9;for(Aa=256;280>Aa;++Aa)La[Aa]=7;for(Aa=280;288>Aa;++Aa)La[Aa]=8;var Da=new wa(32);for(Aa=0;32>Aa;++Aa)Da[Aa]=5;var $a=Oa(La,9,0),Na=Oa(Da,5,0),qa=function(t){return(t/8>>0)+(7&t&&1)},ja=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof ka?ka:t instanceof Sa?Sa:wa)(i-e);return r.set(t.subarray(e,i)),r},Ba=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Ha=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Ua=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var n=i.length,s=i.slice();if(!n)return[new wa(0),0];if(1==n){var a=new wa(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=n-1;)o=i[i[d].f>i[u].f?u++:d++],l=i[u!=h&&i[d].f>i[u].f?u++:d++],i[h++]={s:-1,f:o.f+l.f,l:o,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new ka(v+1),f=za(i[h-1],c,0);if(f>e){r=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return c[e.s]-c[t.s]||t.f-e.f}));n>r;++r){var y=s[r].s;if(e>=c[y])break;p+=m-(1<<f-c[y]),c[y]=e}for(p>>>=g;p>0;){var b=s[r].s;e>c[b]?p-=1<<e-c[b]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;c[_]==e&&(--c[_],++p)}f=e}return[new wa(c),f]},za=function(t,e,i){return-1==t.s?Math.max(za(t.l,e,i+1),za(t.r,e,i+1)):e[t.s]=i},Wa=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new ka(++e),r=0,n=t[0],s=1,a=function(t){i[r++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[i.subarray(0,r),e]},Va=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Ga=function(t,e,i){var r=i.length,n=qa(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;r>s;++s)t[n+s+4]=i[s];return 8*(n+4+r)},Za=function(t,e,i,r,n,s,a,o,l,u,h){Ba(e,h++,i),++n[256];for(var d=Ua(n,15),v=d[0],c=d[1],f=Ua(s,15),p=f[0],g=f[1],m=Wa(v),y=m[0],b=m[1],_=Wa(p),w=_[0],k=_[1],S=new ka(19),x=0;y.length>x;++x)S[31&y[x]]++;for(x=0;w.length>x;++x)S[31&w[x]]++;for(var C=Ua(S,7),T=C[0],M=C[1],E=19;E>4&&!T[Ta[E-1]];--E);var I,R,P,A,F=u+5<<3,O=Va(n,La)+Va(s,Da)+a,L=Va(n,v)+Va(s,p)+a+14+3*E+Va(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&L>=F)return Ga(e,h,t.subarray(l,l+u));if(Ba(e,h,1+(O>L)),h+=2,O>L){I=Oa(v,c,0),R=v,P=Oa(p,g,0),A=p;var D=Oa(T,M,0);for(Ba(e,h,b-257),Ba(e,h+5,k-1),Ba(e,h+10,E-4),h+=14,x=0;E>x;++x)Ba(e,h+3*x,T[Ta[x]]);h+=3*E;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Ba(e,h,D[B=31&j[x]]),h+=T[B],B>15&&(Ba(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else I=$a,R=La,P=Na,A=Da;for(x=0;o>x;++x)if(r[x]>255){var B;Ha(e,h,I[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Ba(e,h,r[x]>>>23&31),h+=xa[B]);var H=31&r[x];Ha(e,h,P[H]),h+=A[H],H>3&&(Ha(e,h,r[x]>>>5&8191),h+=Ca[H])}else Ha(e,h,I[r[x]]),h+=R[r[x]];return Ha(e,h,I[256]),h+R[256]},Qa=new Sa([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ja=function(){for(var t=new Sa(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Ka=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Ja[255&i^e[r]]^i>>>8;t=i},d:()=>4294967295^t}},Ya=function(t,e,i,r,n){return function(t,e,i,r,n,s){var a=t.length,o=new wa(r+a+5*(1+Math.floor(a/7e3))+n),l=o.subarray(r,o.length-n),u=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?u=Ga(l,u,t.subarray(h,d)):(l[h]=true,u=Ga(l,u,t.subarray(h,a)))}else{for(var v=Qa[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new ka(32768),m=new ka(p+1),y=Math.ceil(i/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new Sa(25e3),k=new ka(288),S=new ka(32),x=0,C=0,T=(h=0,0),M=0,E=0;a>h;++h){var I=_(h),R=32767&h,P=m[I];if(g[R]=P,m[I]=R,h>=M){var A=a-h;if((x>7e3||T>24576)&&A>423){u=Za(t,l,0,w,k,S,C,T,E,h-E,u),T=x=C=0,E=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var O=2,L=0,D=f,N=R-P&32767;if(A>2&&I==_(h-N))for(var q=Math.min(c,A)-1,j=Math.min(32767,h),B=Math.min(258,A);j>=N&&--D&&R!=P;){if(t[h+O]==t[h+O-N]){for(var H=0;B>H&&t[h+H]==t[h+H-N];++H);if(H>O){if(O=H,L=N,H>q)break;var U=Math.min(N,H-2),z=0;for(F=0;U>F;++F){var W=h-N+F+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,P=W)}}}N+=(R=P)-(P=g[R])+32768&32767}if(L){w[T++]=268435456|Ia[O]<<18|Ra[L];var G=31&Ia[O],Z=31&Ra[L];C+=xa[G]+Ca[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=Za(t,l,true,w,k,S,C,T,E,h-E,u)}return ja(o,0,r+qa(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,i,r)},Xa=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},to=function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Xa(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}},eo=function(t){return 10+(t.filename&&t.filename.length+1||0)};function io(t,e){void 0===e&&(e={});var i=Ka(),r=t.length;i.p(t);var n=Ya(t,e,eo(e),8),s=n.length;return to(n,e),Xa(n,s-8,i.d()),Xa(n,s-4,r),n}function ro(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new wa(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},a=0;i>a;++a){if(n+5>r.length){var o=new wa(n+8+(i-a<<1));o.set(r),r=o}var l=t.charCodeAt(a);128>l||e?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++a))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return ja(r,0,n)}function no(t,e){for(var i="",r=0;t.length>r;){var n=t[r++];i+=String.fromCharCode(n)}return i}class so{constructor(t,e){var i,r;void 0===e&&(e={}),this.ee={},this.te=t=>{if(!this.ee[t]){var e,i;this.ee[t]=!0;var r=this.re(t);null==(e=(i=this.ie).onBlockedNode)||e.call(i,t,r)}},this.ne=t=>{var e=this.re(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var i=e.closest("svg");if(i)return[this._rrweb.mirror.getId(i),i]}return[t,e]},this.re=t=>this._rrweb.mirror.getNode(t),this.ae=t=>{var e,i,r,n,s,a,o,l;return(null!==(e=null==(i=t.removes)?void 0:i.length)&&void 0!==e?e:0)+(null!==(r=null==(n=t.attributes)?void 0:n.length)&&void 0!==r?r:0)+(null!==(s=null==(a=t.texts)?void 0:a.length)&&void 0!==s?s:0)+(null!==(o=null==(l=t.adds)?void 0:l.length)&&void 0!==o?o:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.ae(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var e=this.ne(t.id);return!this.oe.consumeRateLimit(e[0])&&t})));var r=this.ae(e);return 0!==r||i===r?t:void 0},this._rrweb=t,this.ie=e,this.oe=new Mt({bucketSize:null!==(i=this.ie.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.ie.refillRate)&&void 0!==r?r:10,refillInterval:1e3,S:this.te,I:ji})}reset(){this.ee={}}stop(){this.oe.stop(),this.reset()}}Ni.DEBUG=!1,Ni.LIB_VERSION="1.421.1",Ni.LIB_NAME="web";class ao{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.se=t.get_property.bind(t),this.ue=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.ue(Un,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.se(Un);return st(e=i)&&lt(e.sessionId)&&vt(e.size)&&i.sessionId===t?i.size:0}}function oo(t,e){return function(t){for(var e=0,i=0;t.length>i;i++)e=(e<<5)-e+t.charCodeAt(i),e|=0;return Math.abs(e)}(t)%100<Tt(100*e,0,100,ji)}function lo(t){return"$survey_response_"+t}function uo(t,e){if(!e)return null;var i=t[lo(e)];return rt(i)?[...i]:i}function ho(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!ot(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=uo(t,e.id);ot(s)||(i[n]=s)}})),p({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:uo(t,e.id)})))},t,i)}function vo(t,e){var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i}function co(t){return"string"==typeof t&&t.trim()?t.trim():null}function fo(t){return t.toLowerCase()}function po(t,e,i){if(!t||!e)return null;var r=fo(e),n=Object.keys(t).find((t=>fo(t)===r));if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],a=Object.keys(t).find((t=>fo(t)===s));if(a)return null==i||i.debug("Found base language translation match: "+a+" (from "+e+")"),a}return null}var go=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function mo(t,e,i){var r,n=po(t.translations,e,i),s=p({},t),a=!1;if(n){var o,l=null==(o=t.translations)?void 0:o[n];if(l)if(null==i||i.info("Applying survey-level translation for language: "+n),ot(l.name)||(s.name=l.name,a=!0),s.appearance){var u=p({},s.appearance);for(var h of go){var d=l[h];ot(d)||(u[h]=d,a=!0)}s.appearance=u}else(function(t){return go.some((e=>!ot(t[e])))})(l)&&(a=!0)}var v=t.questions.map((t=>function(t,e,i){var r,n=po(t.translations,e,i);if(!n)return{question:t,matchedKey:null,hasChanges:!1};var s=null==(r=t.translations)?void 0:r[n];if(!s)return{question:t,matchedKey:null,hasChanges:!1};var a=p({},t),o=!1;return ot(s.question)||(a.question=s.question,o=!0),ot(s.description)||(a.description=s.description,o=!0),ot(s.buttonText)||(a.buttonText=s.buttonText,o=!0),"link"in a&&!ot(s.link)&&(a.link=s.link,o=!0),"lowerBoundLabel"in a&&!ot(s.lowerBoundLabel)&&(a.lowerBoundLabel=s.lowerBoundLabel,o=!0),"upperBoundLabel"in a&&!ot(s.upperBoundLabel)&&(a.upperBoundLabel=s.upperBoundLabel,o=!0),"choices"in a&&function(t){return rt(t.choices)}(s)&&(a.choices=s.choices,o=!0),{question:o?a:t,matchedKey:o?n:null,hasChanges:o}}(t,e,i))),c=v.map((t=>t.question)),f=v.some((t=>t.hasChanges)),g=null;return n||(g=(null==(r=v.find((t=>t.matchedKey)))?void 0:r.matchedKey)||null),f&&(s.questions=c,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:s,matchedKey:a?n||g:null}}function yo(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function bo(t){var e;return yo(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var _o=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},wo=t=>t.toLowerCase(),ko={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>_o(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!_o(e,t))))),icontains:(t,e)=>e.map(wo).some((e=>t.map(wo).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(wo).every((e=>t.map(wo).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i<parseFloat(t)))}))};function So(t,e){return!t||Object.entries(t).every((t=>{var i=t[1],r=null==e?void 0:e[t[0]];if(null==r)return!1;var n=ko[i.operator];return!!n&&n(i.values,[String(r)])}))}function xo(t,e,i){return tr({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Co=new Set(["is_not","not_icontains","not_regex"]);function To(t,e,i){return!t||0===t.length||t.every((t=>{var r="person"===t.type?i:e,n=null==r?void 0:r[t.key],s=t.operator||"exact";if(ot(n)||ht(n))return Co.has(s);var a=ko[s];return!!a&&!ot(t.value)&&!ht(t.value)&&a(rt(t.value)?t.value.map(String):[String(t.value)],rt(n)?n.map(String):[String(n)])}))}var Mo=Bi("[SessionRecording]");function Eo(t,e){return e?t:"!"+t}function Io(t,e){return t===e||t!=="!"+e&&null}class Ro{constructor(t,e,i,r,n,s,a){this.le=null,this.ce=ga,this._instance=t,this.J=e,this.Y=i,this.K=r,this.he=n,this.de=s,this.ve=a}onRemoteConfig(t){this.le=vt(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.fe=new oa([this.Y,this.J]),this.ce=pa):(this.fe=new la([this.Y,this.J]),this.ce=ga),this._instance.register_for_session({[Es]:t.triggerMatchType}),this.J.onConfig(t),this.Y.onConfig(t),this.K.onConfig(t,((t,e)=>{this.he("linked_flag_matched",{flag:t,variant:e}),this.ve()}))}getStatus(t){return this.ce({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),i=null==e?void 0:e.minimumDurationMilliseconds;return vt(i)?i:null}checkUrlTriggers(t,e,i,r){this.J.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.Y.Z.length&&dt(this.pe))return this.pe=t((t=>{try{this.Y.checkEventTriggerConditions(t.event,i,e)}catch(t){Mo.error("Could not activate event trigger",t)}})),this.pe}makeSamplingDecisions(t){var e,i,r,n=this.le;if(!vt(n))return null==(i=this._instance.persistence)||i.unregister(Ln),void(null==(r=this._instance.persistence)||r.unregister(In));var s=this._instance.get_property(Ln),a=this._instance.get_property(In),o=Io(s,t),l=vt(a)&&a!==n,u=ot(a)&&s===t,h=l||u||!ft(o),d=h?oo(t,n):o;h&&(d?this.he("sampled"):Mo.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Ln]:Eo(t,d),[In]:ht(a)&&s===t?null:n})}ensureSamplingDecision(t){if(vt(this.le)){var e=this._instance.get_property(Ln);ft(Io(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(Nn),null==(e=this._instance.persistence)||e.unregister($n),null==(i=this._instance.persistence)||i.unregister(Ln),null==(r=this._instance.persistence)||r.unregister(In),null==(n=this._instance.persistence)||n.unregister(Dn)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.fe)?void 0:e.triggerStatus(t))===ea}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===ea)).map((t=>t.label))}stop(){var t;null==(t=this.pe)||t.call(this),this.pe=void 0,this.Y.stop(),this.J.stop(),this.K.stop()}}class Po{constructor(t,e,i,r,n){this.ge=[],this.me=new Map,this.ye=!1,this._instance=t,this.J=e,this.he=i,this.be=r,this.ve=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.we(t.triggerGroups),this._instance.register_for_session({[Es]:"v2_trigger_groups",[Is]:t.triggerGroups.length}),this.J.onConfig(t)):Mo.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Ys;if(t.urlTriggerMatching.urlBlocked)return Zs;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return zs;var r=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===ta){var o=s.group.id,l=i.get(o);ot(l)?ji.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===l&&(n=!0)}else a===ea&&(r=!0)}return n?Ws:r?Gs:zs}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.ge,triggerGroupSamplingResults:this.me,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var i of this.ge)if("trigger_activated"===i.triggerStatus(t)){var r=i.group.minDurationMs;vt(r)&&(ht(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.J.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,(e=>{n.ke(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.ve(e))}),t)};for(var a of this.ge)s(a)}setupEventTriggerListeners(t,e,i){var r=this;return this.pe=t((t=>{var i;if(this.ye)return Mo.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.pe)||i.call(this),void(this.pe=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,(n=>{if(r.ke(i,t.properties)){var s=(i.group.conditions.events||[]).filter((e=>e.name===t.event)),a=r._instance.get_property(Xn),o=s.some((e=>!e.properties||0===e.properties.length||To(e.properties,t.properties,a)));o&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.ve(n))}}),e)};for(var s of this.ge)n(s)}catch(t){Mo.error("Could not activate event trigger for trigger groups",t)}})),this.pe}makeSamplingDecisions(t){for(var e of this.ge){var i,r=e.group,n=r.id,s=r.sampleRate,a=Bn+n,o=this._instance.get_property(a),l=null,u=!1,h=!1,d=!1;if(st(o)){var v=o.sessionId,c=o.sampleRate,f=o.sampled;u="string"==typeof v&&v!==t,h=vt(c)&&c!==s,l=v===t&&vt(c)&&c===s&&ft(f)?f:null}else l=o===t||null,u="string"==typeof o&&o!==t,d=o===t;var p=u||h||d||!ft(l),g=p?oo(t+n,s):l;p&&this.be("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.me.set(n,g),null==(i=this._instance.persistence)||i.register({[a]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.ye=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister(Ln),null==(e=this._instance.persistence)||e.unregister(In),null==(i=this._instance.persistence)||i.unregister(Dn),this.ge)){var n,s,a,o=r.group.id;null==(n=this._instance.persistence)||n.unregister(qn+o),null==(s=this._instance.persistence)||s.unregister(jn+o),null==(a=this._instance.persistence)||a.unregister(Bn+o)}}updateActiveTriggers(t){var e=[];for(var i of this.ge){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),a=!0===this.me.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:a})}this._instance.register_for_session({[Ts]:e})}hasPendingTriggers(t){for(var e of this.ge)if(e.triggerStatus(t)===ea)return!0;return!1}getPendingTriggerConditions(t){return this.ge.flatMap((e=>e.triggerStatusNoSideEffects(t)!==ea?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.pe)||t.call(this),this.pe=void 0,this.ge.forEach((t=>t.stop())),this.ge=[],this.me.clear(),this.J.stop()}ke(t,e){var i=t.group.conditions.properties;return!i||0===i.length||To(i,e,this._instance.get_property(Xn))}we(t){var e=this;this.ge.forEach((t=>t.stop())),this.ge=[],this.me.clear();var i=function(t){var i=new fa(e._instance,t,((i,r)=>{e.he("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.ve()}));e.ge.push(i)};for(var r of t)i(r)}}var Ao=t=>{if(r){try{for(var e=t+"=",i=r.cookie.split(";").filter((t=>t.length)),n=0;i.length>n;n++){for(var s=i[n];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(e))return decodeURIComponent(s.substring(e.length,s.length))}}catch(t){}return null}},Fo="https?://(.*)",Oo=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Lo=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Oo],Do="<masked>",$o=["li_fat_id"];function No(t,e,i){if(!r)return{};var n,s=e?[...Oo,...i||[]]:[],a=qo(nr(r.URL,s,Do),t),o=(n={},Ui($o,(function(t){var e=Ao(t);n[t]=e||null})),n);return zi(o,a)}function qo(t,e){var i=Lo.concat(e||[]),r={};return Ui(i,(function(e){var i=rr(t,e);r[e]=i||null})),r}function jo(t){var e=function(t){return t?0===t.search(Fo+"google.([^/?]*)")?"google":0===t.search(Fo+"bing.com")?"bing":0===t.search(Fo+"yahoo.com")?"yahoo":0===t.search(Fo+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",n={};if(!ht(e)){n.$search_engine=e;var s=r?rr(r.referrer,i):"";s.length&&(n.ph_keyword=s)}return n}function Bo(){return navigator.language||navigator.userLanguage}var Ho="$direct";function Uo(){return(null==r?void 0:r.referrer)||Ho}function zo(t,e,i){void 0===i&&(i=!1);var r=t?[...Oo,...e||[]]:[],s=i?Le(null==n?void 0:n.href):null==n?void 0:n.href,a=null==s?void 0:s.substring(0,1e3);return{r:Uo().substring(0,1e3),u:a?nr(a,r,Do):void 0}}function Wo(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?Le(n):n,a={$referrer:r,$referring_domain:null==r?void 0:r==Ho?Ho:null==(i=er(r))?void 0:i.host};if(s){a.$current_url=s;var o=er(s);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname;var l=qo(s);zi(a,l)}if(r){var u=jo(r);zi(a,u)}return a}function Vo(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Go(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Zo=1e5,Qo="https://schema.org",Jo=[],Ko="actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),Yo="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Xo="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),tl="Accommodation AdministrativeArea Country Place State".split(" "),el={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:Yo,publisher:Xo},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Jo},Offer:{seller:Xo},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:Xo,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Xo,areaServed:tl,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Jo}},il={},rl=[[Yo,il],["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),el.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),el.Event],[Xo,el.Organization],[tl,el.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),el.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),il]],nl="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function sl(t,e){return et.call(t,e)?t[e]:void 0}function al(t){var e=typeof t;return ht(t)||"string"===e||"number"===e||"boolean"===e}function ol(t){return al(t)||rt(t)&&t.every(al)?t:void 0}function ll(t){if(et.call(el,t))return el[t];for(var e of rl){var i=e[1];if(e[0].includes(t))return i}return nl.includes(t)?il:void 0}function ul(t,e){if(!st(t))return null;var i=sl(t,"@type"),r=function(t){return("string"==typeof t?[t]:rt(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!ll(t)))}(i).filter((t=>!e||!e.length||e.includes(t)));if(!r.length)return null;var n={"@type":"string"==typeof i?r[0]:r},s=ol(sl(t,"@id"));for(var a of(ot(s)||(n["@id"]=s),Ko)){var o=ol(sl(t,a));ot(o)||(n[a]=o)}for(var l of r){var u=ll(l),h=function(){var e=sl(t,d),i=u[d];if(!0===i){var r=ol(e);ot(r)||(n[d]=r)}else if(rt(e)){var s=e.map((t=>ul(t,i))).filter(st);s.length&&(n[d]=s)}else{var a=ul(e,i);a&&(n[d]=a)}};for(var d of Object.keys(u))h()}return n}function hl(t){if(!st(t))return null;var e=sl(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var i=ul(t);if(i)return p({"@context":Qo},i);var r=sl(t,"@graph");if(!rt(r))return null;var n=r.map((t=>ul(t))).filter(st);return n.length?{"@context":Qo,"@graph":n}:null}function dl(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function vl(t,e,i){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some((t=>(e.lastIndex=0,e.test(t)))))return!0;try{return!!i&&t.matches(i)}catch(t){return!1}}function cl(t){return dl(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(dl)}function fl(t){return ot(t)?void 0:Math.round(t)}function pl(t){return st(t)?t.network_timing:t}var gl,ml,yl=36e5,bl=943718.4,_l="[SessionRecording]",wl=Bi(_l),kl=[y.MouseMove,y.MouseInteraction,y.Scroll,y.ViewportResize,y.Input,y.TouchMove,y.MediaInteraction,y.Drag],Sl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function xl(){var t;return null==v||null==(t=v.__PosthogExtensions__)?void 0:t.rrweb}function Cl(){var t;return null==(t=xl())?void 0:t.record}function Tl(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,ma())}}function Ml(t){return no(io(ro(Tl(t))))}function El(t){return Il.apply(this,arguments)}function Il(){return(Il=f((function*(t){var e=Tl(t),i=yield N(e,Ni.DEBUG,{rethrow:!0});return no(new Uint8Array(yield i.arrayBuffer()))}))).apply(this,arguments)}var Rl="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Pl=!1;function Al(t){return rt(t)&&0===t.length?gl=null!=gl?gl:Ml([]):Ml(t)}function Fl(t){return Ol.apply(this,arguments)}function Ol(){return(Ol=f((function*(t){return rt(t)&&0===t.length?gl||(ml=null!=ml?ml:El([]).then((t=>(gl=t,t))).catch((t=>{throw gl=void 0,ml=void 0,t}))):El(t)}))).apply(this,arguments)}function Ll(t){return Rl&&!Pl&&function(t){return t.type===m.FullSnapshot||t.type===m.IncrementalSnapshot&&(t.data.source===y.Mutation||t.data.source===y.StyleSheetRule)}(t)}function Dl(t){return{event:t,size:ba(t)}}function $l(t,e){return p({},t,{data:e,cv:"2024-10"})}function Nl(t,e){return p({},t,{cv:"2024-10",data:p({},t.data,e)})}function ql(t){try{if(t.type===m.FullSnapshot)return Dl($l(t,Ml(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation)return Dl(Nl(t,{texts:Al(t.data.texts),attributes:Al(t.data.attributes),removes:Al(t.data.removes),adds:Al(t.data.adds)}));if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule)return Dl(Nl(t,{adds:t.data.adds?Ml(t.data.adds):void 0,removes:t.data.removes?Ml(t.data.removes):void 0}))}catch(t){wl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:ya(t)}}function jl(){return jl=f((function*(t){try{if(t.type===m.FullSnapshot)return Dl($l(t,yield El(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation){var e=yield Promise.all([Fl(t.data.texts),Fl(t.data.attributes),Fl(t.data.removes),Fl(t.data.adds)]);return Dl(Nl(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule){var i=yield Promise.all([t.data.adds?El(t.data.adds):void 0,t.data.removes?El(t.data.removes):void 0]);return Dl(Nl(t,{adds:i[0],removes:i[1]}))}}catch(e){return O(e)&&(Pl=!0),wl.error("could not compress event asynchronously - trying synchronous compression",e),ql(t)}return{event:t,size:ya(t)}})),jl.apply(this,arguments)}function Bl(t,e){return t.type===m.Custom&&t.data.tag===e}function Hl(t){return Bl(t,"sessionIdle")}function Ul(t){return Bl(t,"$session_ending")}function zl(t){return Bl(t,"$session_starting")}class Wl{get sessionId(){return this._e}get Se(){if(!this._instance.sessionManager)throw new Error(_l+" must be started with a valid sessionManager.");return this._instance.sessionManager}get xe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Ce(){return Io(this._instance.get_property(Ln),this.sessionId)}get le(){var t,e=null==(t=this.Me)?void 0:t.sampleRate;return vt(e)?e:null}get Te(){var t,e;return null!==(t=null==(e=this.Ie)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.Ee="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Re=void 0,this.Ae=!1,this.Le=Date.now(),this.Oe=!1,this.Pe=[],this.De="unknown",this.Fe=0,this.Ne=!1,this.qe=!1,this.je=!1,this.Be=!1,this.He=!1,this.Ue=!1,this.$e=!1,this.We=!1,this.ze=!1,this.Ve=!1,this.Ze=!1,this.Ge=!1,this.Qe=[],this.Je=void 0,this.Ye=void 0,this.Ke=[],this.Xe=0,this.et=0,this.tt=!1,this.rt=void 0,this.pe=void 0,this.it=void 0,this.nt=void 0,this.ot=void 0,this.st=(t,e,i)=>{var r,n,s;if(i&&(t!==this._e||e!==this.ut)){var a,o=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this._e,u=this.ut;if(o&&this.be("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.Le,flushed_size:null==(a=this.ct)?void 0:a.currentTrackedSize(l)}),null==(r=this._instance.persistence)||r.unregister(Hn),this.$e=!1,null==(n=xl())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.be("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.ht(),!(!1===this.De&&this.isStarted||this._e===t&&this.ut===e)){var h=this._e!==t&&!1!==this.De;this.De="unknown",this.dt(h)}o&&this.be("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.Le}),null==(s=this.Ie)||s.makeSamplingDecisions(t)}},this.vt=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[Dn])===this._e},this.ft=()=>{var t,e;if(0===this.yt.data.length)return null;var i=null==(t=this.yt.data[0])?void 0:t.timestamp,r=null==(e=this.yt.data[this.yt.data.length-1])?void 0:e.timestamp;return vt(i)&&vt(r)?r-i:null},this.bt=()=>{var t,e,i=this.Te;if(!vt(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.wt;return vt(r)&&r>=0&&i>r}if(this.vt())return!1;var n,s=this.ft();return!!ht(s)||i>s||(null==(n=this._instance.persistence)||n.register({[Dn]:this._e}),!1)},this.kt=()=>{this.status!==Gs?(this.Ne&&this.qe&&this._t&&!this.je&&(this.Ne=!1),this.St(),this.xt()):this.Ct()},this.Mt=()=>{this.kt()},this.Tt=()=>{this.be("browser offline",{})},this.It=()=>{this.be("browser online",{})},this.Et=()=>{null!=r&&r.visibilityState&&("visible"===r.visibilityState&&(this._t=!0),this.be("window "+r.visibilityState,{}))},this._instance=t,this._t=null==e||e;var i=this.Se.checkAndGetSessionAndWindowId(),n=i.windowId;this._e=i.sessionId,this.ut=n,this.K=new va(this._instance),this.J=new da(this._instance),this.Y=new ca(this._instance),this.yt=this.Ct(),this.Se.sessionTimeoutMs>this.xe||wl.warn("session_idle_threshold_ms ("+this.xe+") is greater than the session timeout ("+this.Se.sessionTimeoutMs+"). Session will never be detected as idle"),this.ct=new ao(this._instance)}setDocumentWasEverVisible(t){t&&(this._t=!0)}get Rt(){var t,e,i,r,n,s,a,o,l,u=null==(t=this.Me)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(i=this._instance.config.session_recording)?void 0:i.maskTextSelector,blockSelector:null==(r=this._instance.config.session_recording)?void 0:r.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==u?void 0:u.maskAllInputs,v=null!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a:null==u?void 0:u.maskTextSelector,c=null!==(o=null==h?void 0:h.blockSelector)&&void 0!==o?o:null==u?void 0:u.blockSelector,f=null!==(l=null==h?void 0:h.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return ot(d)&&ot(v)&&ot(c)&&ot(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}At(){var t;if(!this.ze){var e=null==(t=this.Me)?void 0:t.masking;if(!dt(e)){var i=this._instance.config.session_recording,r=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((t=>{var r=null==i?void 0:i[t],n=e[t];return!ot(r)&&r!==n}));0!==r.length&&(this.ze=!0,wl.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+r.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==i?void 0:i.maskAllInputs,maskTextSelector:null==i?void 0:i.maskTextSelector,blockSelector:null==i?void 0:i.blockSelector,maskAllElementAttributes:null==i?void 0:i.maskAllElementAttributes},project:e}))}}}get Lt(){var t;return Tt(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Bi("canvas recording resolution scale"),1)}get Ot(){var t,e,i,r,n,s,a,o=this._instance.config.session_recording.captureCanvas,l=null==(t=this.Me)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==o?void 0:o.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==o?void 0:o.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(a=null==o?void 0:o.canvasQuality)&&void 0!==a?a:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof d){var v=parseFloat(d);d=isNaN(v)?.4:v}return{enabled:u,fps:Tt(h,0,12,Bi("canvas recording fps"),4),quality:Tt(d,0,1,Bi("canvas recording quality"),.4)}}get Pt(){var t,e=!(null==(t=this.Me)||!t.consoleLogRecordingEnabled),i=this._instance.config.enable_recording_console_log;return null!=i?i:e}get Dt(){var t,e,i,r=null==(t=this.Me)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(i=this._instance.config.session_recording)?void 0:i.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==r?void 0:r.recordHeaders),a=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),o=pl(this._instance.config.capture_performance),l=pl(null==r?void 0:r.capturePerformance),u=!!(ft(o)?o:l);return s||a||u?{recordHeaders:s,recordBody:a,recordPerformance:u}:void 0}Ft(){var t,e,i=[],r=null==(t=v.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.Pt&&i.push(r());var s=null==(e=v.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Dt&&nt(s))if(!Xi.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var a=nt(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,n={payloadSizeLimitBytes:nn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...nn.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...nn.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,o=!1!==t.capture_performance&&e.recordPerformance,l=(r=rn(n),t=>(null!=t&&t.requestBody&&(t.requestBody=hn(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=hn(t.responseBody,t.responseHeaders,r,"Response")),t)),u=e=>{return l(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=er(t.name),s=0===e.indexOf("http")?null==(r=er(e))?void 0:r.pathname:e;"/"===s&&(s="");var a=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&a&&un.some((t=>0===a.indexOf(t)))))return t}})((ln((r=e).requestHeaders),ln(r.responseHeaders),r),t.api_host,i));var r},h=nt(t.session_recording.maskNetworkRequestFn);return h&&nt(t.session_recording.maskCapturedNetworkRequestFn)&&ji.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:p({},e,{name:null==i?void 0:i.url})}),n.maskRequestFn=nt(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var i=u(e);if(i){var r=i.isInitial?{name:"",entryType:i.entryType,startTime:i.startTime,duration:i.duration,endTime:i.endTime,timeOrigin:i.timeOrigin,timestamp:i.timestamp,isInitial:!0}:void 0,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(i);return dt(n)&&r?(vn.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!ot(t))return t.requestBody=dn(t.requestBody,"Request"),t.responseBody=dn(t.responseBody,"Response"),t}(u(t)),p({},nn,n,{recordHeaders:s,recordBody:a,recordPerformance:o,recordInitialRequests:o,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Dt,a)))}else wl.info("NetworkCapture not started because we are on localhost.");return i}Nt(t){return this._instance.config.disable_capture_url_hashes?Le(t):t}qt(t,e){void 0===e&&(e=!1);var i=e?Le(t):this.Nt(t),r=this._instance.config.mask_personal_data_properties?[...Oo,...this._instance.config.custom_personal_data_properties||[]]:[];return this.jt(nr(i,r,Do))}jt(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var i,r=e.maskCapturedNetworkRequestFn({name:t});return null!==(i=null==r?void 0:r.name)&&void 0!==i?i:null==r?void 0:r.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}Bt(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Pe.length?this.Pe.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):wl.warn("could not emit queued rrweb event.",e,t),!1}}be(t,e){return this.Bt(Sl((()=>Cl().addCustomEvent(t,e))))}Ht(){var t;return this.Ae&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.J.urlBlocked&&!0!==this.De}Ut(t){if(!this.Ht())return!1;try{var e=Cl();return!!e&&(e.addCustomEvent("$json_ld",t),this.Ht())}catch(t){return!1}}$t(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.Wt)?void 0:e.scan(t)}))}zt(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),i=this.qt(e.origin+e.pathname+e.search);this.Vt!==i&&(this.Vt=i,this.be("$url_changed",{href:i}))}catch(t){}}Zt(){if(this.Pe.length){var t=[...this.Pe];this.Pe=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.Bt(t)}))}}de(){return this.Bt(Sl((()=>Cl().takeFullSnapshot())))}get Gt(){var t,e,i;if(null!=(t=this.Ie)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var r,n=null==(r=this._instance.config.session_recording)?void 0:r.trigger_pending_buffer_interval_millis;return vt(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(i=this._instance.config.session_recording)?void 0:i.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Qt(){if(this.Jt&&clearInterval(this.Jt),!0!==this.De){var t=this.Gt;t&&(this.Jt=setInterval((()=>{this.de()}),t))}}ve(t){"event"===t&&this.Yt(),!this.J.urlBlocked&&["sampled","active"].includes(this.status)&&this.Qt()}Kt(){var t;this.J.urlBlocked||(this.J.urlBlocked=!0,null==(t=this.Wt)||t.scan(),clearInterval(this.Jt),wl.info("recording paused due to URL blocker"),this.be("recording paused",{reason:"url blocker"}))}Xt(){var t;this.J.urlBlocked&&(null==(t=this.Wt)||t.scan(),this.J.urlBlocked=!1,this.de(),this.$t(),this.Qt(),this.be("recording resumed",{reason:"left blocked url"}),wl.info("recording resumed"))}er(t,e){var i;if("event"===t&&this.Yt(),!this.Oe&&null!=(i=this.Ie)&&i.hasPendingTriggers(this.sessionId)){this.Oe=!0;try{var r,n;null==(r=this._instance.persistence)||r.register({["url"===t?$n:Nn]:this.sessionId}),null==(n=this.Ie)||n.updateActiveTriggers(this.sessionId),this.ve(),this.xt(),this.he(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Oe=!1}}}get isStarted(){return!!this.Re}get Me(){var t=this._instance.get_property(En);if(t){var e;try{e=st(t)?t:JSON.parse(t)}catch(t){return void wl.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>yl)return wl.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(r=this._instance.persistence)||r.unregister(En))}return e}}tr(t,e,i){this._instance.get_property(t)&&(e(),i())}start(e){var i,n,s=this.Me;if(s){this.isStarted||(this.Ne=!1!==this.De&&!this.Be,this.Be=!1,this.qe=this.Ne,this.je=!1),this.tt&&(this.rr(),this.Ct());var a=this.Se.checkAndGetSessionAndWindowId(),o=a.windowId;this._e=a.sessionId,this.ut=o,null==(i=this._instance.persistence)||i.unregister(Hn),null!=s&&s.endpoint&&(this.Ee=null==s?void 0:s.endpoint),this.Ie=2===(null==s?void 0:s.version)&&(null==s?void 0:s.triggerGroups)&&s.triggerGroups.length>0?new Po(this._instance,this.J,this.he.bind(this),this.be.bind(this),this.ve.bind(this)):new Ro(this._instance,this.J,this.Y,this.K,this.he.bind(this),this.de.bind(this),this.ve.bind(this)),this.Ie.onRemoteConfig(s),null==(n=this.pe)||n.call(this),this.pe=this.Ie.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.er(t,e))),this.tr(Rn,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Rn)})),this.tr(Pn,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Pn)})),this.tr(Fn,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Fn)})),this.tr(An,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(An)})),this.Ie.makeSamplingDecisions(this.sessionId),this.ir(),this.He||(Ki(t,"beforeunload",this.kt),Ki(t,"pagehide",this.Mt),Ki(t,"offline",this.Tt),Ki(t,"online",this.It),Ki(r,"visibilitychange",this.Et),!this.it&&nt(this.Se.onSessionId)&&(this.it=this.Se.onSessionId(this.st)),!this.nt&&nt(this.Se.on)?this.nt=this.Se.on("forcedIdleReset",(()=>{this.ht(),this.De="unknown",this.stop(),this.ot=this.Se.onSessionId(((t,e,i)=>{var r;null==(r=this.ot)||r.call(this),this.ot=void 0,this.st(t,e,i)}))})):nt(this.Se.on)||wl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),dt(this.rt)&&(this.rt=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.qt(t.properties.$current_url):"";if(!e)return;this.be("$pageview",{href:e})}}catch(t){wl.error("Could not add $pageview to rrweb session",t)}}))),this.status===Vs&&this.he(e||"recording_initialized"))}else wl.info("remote config must be stored in persistence before recording can start")}nr(){var e,i,n,s,a,o;null==t||t.removeEventListener("beforeunload",this.kt),null==t||t.removeEventListener("pagehide",this.Mt),null==t||t.removeEventListener("offline",this.Tt),null==t||t.removeEventListener("online",this.It),null==r||r.removeEventListener("visibilitychange",this.Et),clearInterval(this.Jt),this.ar(),null==(e=this.rt)||e.call(this),this.rt=void 0,null==(i=this.pe)||i.call(this),this.pe=void 0,null==(n=this.it)||n.call(this),this.it=void 0,null==(s=this.nt)||s.call(this),this.nt=void 0,null==(a=this.ot)||a.call(this),this.ot=void 0,null==(o=this.Ie)||o.stop(),this.sr(),this.rr()}rr(){this.et+=1,this.Ke=[],this.Xe=0,this.ur=void 0,this.tt=!1}sr(){var t,e,i;null==(t=this.lr)||t.stop(),this.Pe=[],null==(e=this.Wt)||e.stop(),this.Wt=void 0,this.Ae=!1,null==(i=this.Re)||i.call(this),this.Re=void 0}cr(){if(!this.ur||0===this.Xe)return!1;if(this.tt)return!0;this.tt=!0;var t=this.et;return this.ar(),this.sr(),this.ur.catch((()=>{})).then((()=>{t===this.et&&(this.tt=!1,this.xt(),this.Ct(),this.nr(),wl.info("stopped"))})).catch((()=>{this.tt=!1,this.nr(),wl.info("stopped")})),!0}stop(){this.sr(),this.cr()||(this.xt(),this.Ct(),this.nr(),wl.info("stopped"))}dt(t){var e;this.stop(),this.hr=void 0,this.dr=void 0,null==(e=xl())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed"),this.Ne=t,this.qe=!1}Yt(){this.isStarted||(this.Be=!0),this.Ne&&(this.Ne=!1,this.qe=!1,this.je&&(this.je=!1,this.de()),this.vr())}discard(){this.Ct(),this.nr(),wl.info("discarded")}pr(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};this.status!==zs?(this.gr(t,r),this.mr(s)):this.Ct()}yr(){try{this.br()}catch(t){this.We||(this.We=!0,wl.error("could not track full snapshot cost",t))}}br(){var t,e=null==(t=xl())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.dr&&(this.dr=e,this.hr&&this.hr.durationMs>=e.durationMs||(this.hr=e),500>e.durationMs||wl.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}gr(t,e){t.type!==m.FullSnapshot?t.type===m.IncrementalSnapshot&&(ot(this.Je)||this.Je===e||this.Ye===e||(this.Ye=e,wl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.de())):this.Je=e}wr(t){t.counted&&t.generation===this.et&&(this.Xe=Math.max(0,this.Xe-1)),t.counted=!1,this.Ke=this.Ke.filter((e=>e!==t))}kr(t,e,i){t.processed||t.generation!==this.et||(t.processed=!0,this.pr(t.event,e,i,t.targetSessionId,t.targetWindowId))}_r(t){try{var e=t.compressionEnabled?ql(t.event):{event:t.event,size:ya(t.event)};this.kr(t,e.event,e.size)}finally{this.wr(t)}}St(){[...this.Ke].forEach((t=>{this._r(t)}))}Sr(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.et,processed:!1,counted:!0};this.Ke.push(s),this.Xe+=1;var a=function(){var i=f((function*(){try{if(s.processed)return;var i,r;try{var a=e?Ll(t)?yield function(t){return jl.apply(this,arguments)}(t):ql(t):{event:t,size:ya(t)};i=a.event,r=a.size}catch(e){wl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=ya(t)}n.kr(s,i,r)}finally{n.wr(s)}}));return function(){return i.apply(this,arguments)}}();this.ur=this.ur?this.ur.catch((()=>{})).then(a):a()}onRRwebEmit(t){var e,i,r,n,s,a,o,l,u;if(this._instance.sessionManager&&(this.Zt(),t&&st(t))){if(t.type===m.Meta){var h=this.qt(t.data.href);if(this.Vt=h,!h)return;t.data.href=h}else this.zt();if(null==(e=this.Ie)||e.checkUrlTriggers(this.sessionId,(()=>this.Kt()),(()=>this.Xt()),((t,e)=>this.er(t,e))),!this.J.urlBlocked||function(t){return t.type===m.Custom&&"recording paused"===t.data.tag}(t)){var d,v,c;t.type===m.FullSnapshot&&(null!=(d=xl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this.$e=!0),this.yr(),Promise.resolve().then((()=>this.yr())),this.Qt(),null==(v=this.lr)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[Hn]:t.timestamp},void 0));var f=t.type===m.FullSnapshot&&(null==(i=this.Ie)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.Cr();var p=this.lr?this.lr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&st(e)&&6===e.type&&st(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var i=[],r=0;e.data.payload.payload.length>r;r++)i.push(e.data.payload.payload[r]&&e.data.payload.payload[r].length>2e3?e.data.payload.payload[r].slice(0,2e3)+"...[truncated]":e.data.payload.payload[r]);return e.data.payload.payload=i,t}return t}(p),b=function(t){return Ul(t)?t.data.payload:null}(g),_=function(t){return zl(t)?t.data.payload:null}(g),w=function(t){return Hl(t)?t.data.payload:null}(g);b||_?null!=b&&b.lastActivityTimestamp&&(g.timestamp=b.lastActivityTimestamp):null!=w&&w.sessionId||this.Mr(g),t.type===m.FullSnapshot&&(this.Qe.push([this._e,t.timestamp]),this.Qe.length>6&&(this.Qe=this.Qe.slice(-6)));var k=null!==(r=null!==(n=null!==(s=null==b?void 0:b.currentSessionId)&&void 0!==s?s:null==_?void 0:_.nextSessionId)&&void 0!==n?n:null==w?void 0:w.sessionId)&&void 0!==r?r:this._e,S=null!==(a=null!==(o=null!==(l=null==b?void 0:b.currentWindowId)&&void 0!==l?l:null==_?void 0:_.nextWindowId)&&void 0!==o?o:null==w?void 0:w.windowId)&&void 0!==a?a:this.ut;if(!0!==this.De||function(t){return Hl(t)||Ul(t)||zl(t)}(g)){g.type===m.FullSnapshot&&(this.Fe=0),w&&(g.timestamp=w.lastActivityTimestamp+w.threshold);var x=this.Ae;this.Ae=!0,f?this.$t(!0):x||this.$t();var C=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.Xe>0||C&&Ll(g))this.Sr(g,C,k,S);else{var T=C?ql(g):{event:g,size:ya(g)};this.pr(g,T.event,T.size,k,S)}}else(function(t){return t.type===m.FullSnapshot||t.type===m.Meta||t.type===m.IncrementalSnapshot&&t.data.source!==y.CanvasMutation})(g)&&this.Fe++}else!0===this.De&&this.Fe++}}}get status(){return this.Ie?this.Ie.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Ce,rrwebError:this.He,urlTriggerMatching:this.J,eventTriggerMatching:this.Y,linkedFlagMatching:this.K,remoteConfig:this.Me}):zs}log(t,e){var i;void 0===e&&(e="log"),null==(i=this._instance.sessionRecording)||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.K.linkedFlagSeen=!0,this.de(),this.Yt(),this.he("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Ln]:this.sessionId,[In]:null}),this.de(),this.Yt(),this.he("sampling_overridden")}overrideTrigger(t){this.er(t),this.Yt()}Tr(){try{var e,i=null==t||null==(e=t.location)?void 0:e.href;if(!i)return;var r=this.qt(i);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}ar(){this.Ir&&(clearTimeout(this.Ir),this.Ir=void 0)}vr(){this.Ir||(this.Ir=setTimeout((()=>{this.xt()}),2e3))}Er(){return this.Je!==this.yt.sessionId&&0!==this.yt.data.length&&this.yt.data.every((t=>(null==t?void 0:t.type)===m.Custom&&!Ul(t)&&!zl(t)))}Rr(){var t,e;return null!==(t=null==(e=this.Ie)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Ar(t){if(t!==Gs)return ot(this.Lr)||this._instance.register_for_session({[Ms]:[]}),void(this.Lr=void 0);var e=this.Rr();if(0===e.length)return ot(this.Lr)||this._instance.register_for_session({[Ms]:[]}),void(this.Lr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.Lr&&(this.Lr=r,this._instance.register_for_session({[Ms]:e}),wl.info("buffering: "+i))}xt(){var t;if(this.ar(),this.Ne)return this.yt;if(this.Er())return this.yt.size>bl?this.Ct():this.yt;var e=this.yt;null==(t=this.Ie)||t.ensureSamplingDecision(this.sessionId);var i=this.bt(),r=this.status;if(this.Ar(r),r===Gs||r===Zs||r===zs||i)return this.vr(),this.yt;if(this.yt!==e)return this.yt;if(e.data.length>0){var n,s=this.Tr();_a(e).forEach((t=>{var e;null==(e=this.ct)||e.trackSize(t.sessionId,t.size),this.Or({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Ni.LIB_NAME,$lib_version:Ni.LIB_VERSION,$snapshot_host:s})})),null==(n=this.Ie)||n.onFlushComplete()}return this.Ct()}mr(t){var e,i=2+((null==(e=this.yt)?void 0:e.data.length)||0),r=t.$session_id,n=this.yt.sessionId!==r;if(n||!0!==this.De&&!this.Ne&&this.yt.size+t.$snapshot_bytes+i>bl){var s=this._e;if(this.yt=this.xt(),this._e!==s)return;n&&this.yt.data.length>0&&(this.yt=this.Ct()),this.yt.sessionId=r,this.yt.windowId=t.$window_id}this.Ne&&(this.je||this.yt.size+t.$snapshot_bytes+i>bl)?this.je||(this.je=!0,this.yt=this.Ct()):(this.yt.size+=t.$snapshot_bytes,this.yt.data.push(t.$snapshot_data),this.yt.sizes.push(t.$snapshot_bytes),!0===this.De||this.Ne||this.vr())}Or(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Ee),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get wt(){var t,e,i=null==(t=this.yt)?void 0:t.data[(null==(e=this.yt)?void 0:e.data.length)-1],r=this.Se.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-r.sessionStartTimestamp:null}Cr(){if(!this.yt||0===this.yt.data.length)return this.Ct();for(var t=-1,e=this.yt.data.length-1;e>=0;e--)if(this.yt.data[e].type===m.Meta){t=e;break}return 0>t?this.Ct():(this.yt.data=this.yt.data.slice(t),this.yt.sizes=this.yt.sizes.slice(t),this.yt.size=this.yt.sizes.reduce(((t,e)=>t+e),0),this.yt)}Ct(){return this.yt={size:0,data:[],sizes:[],sessionId:this._e,windowId:this.ut},this.yt}he(t,e){this._instance.register_for_session({[Ps]:t}),wl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.be("$recording_started",p({reason:t},e))}Pr(t){var e;return 3===t.type&&-1!==kl.indexOf(null==(e=t.data)?void 0:e.source)}Mr(t){var e=this.Pr(t);e||!0===this.De||t.timestamp-this.Le>this.xe&&(this.De=!0,clearInterval(this.Jt),this.be("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Le,threshold:this.xe,bufferLength:this.yt.data.length,bufferSize:this.yt.size,sessionId:this._e,windowId:this.ut}),this.xt());var i=!1;if(e&&(this.Le=t.timestamp,this.De)){var r="unknown"===this.De;this.De=!1,r||(this.be("sessionNoLongerIdle",{reason:"user activity",type:t.type}),i=!0)}var n=this.Se.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,a=n.sessionId,o=this._e!==a,l=this.ut!==s;if(this.ut=s,this._e=a,o||l){var u=o&&!1!==this.De;u&&(this.De="unknown"),this.dt(u)}else if(e&&this.Yt(),i){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.Ie)?void 0:h.hasPendingTriggers(this.sessionId));this.Fe>0&&d&&this.de(),this.$t(),this.Qt()}}ht(){var t;null==(t=this.Ie)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,a,o,l,u=this.Se.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=xl())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.yt.data.length,$sdk_debug_replay_internal_buffer_size:this.yt.size,$sdk_debug_current_session_duration:this.wt,$sdk_debug_session_start:u,$sdk_debug_replay_flushed_size:null==(e=this.ct)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Qe,$snapshot_max_depth_exceeded:this.$e,$sdk_debug_replay_slowest_full_snapshot_ms:fl(null==(i=this.hr)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:fl(null==(r=this.hr)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.hr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.hr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.hr)?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:fl(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:fl(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:fl(null==(o=xl())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=xl())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_rrweb_error:this.He,$sdk_debug_rrweb_attached:!!this.Re,$sdk_debug_rrweb_start_attempted:this.Ue}}ir(){var e;if(!this.Re){this.Ue=!0;var i,n,s,a,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},l=this._instance.config.session_recording;for(var u of Object.entries(l||{})){var h=u[0],d=u[1];if(h in o)if("maskInputOptions"===h)o.maskInputOptions=p({password:!0},d);else if("sampling"===h){var v=null!=d?d:{},c={};ot(v.mousemove)||(c.mousemove=v.mousemove),ot(v.mouseInteraction)||(c.mouseInteraction=v.mouseInteraction),o.sampling=c}else o[h]=d}!0===(null==l?void 0:l.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=p({},o.slimDOMOptions,{script:!0})),this.Ot&&this.Ot.enabled&&(o.recordCanvas=!0,o.sampling=p({},o.sampling,{canvas:this.Ot.fps}),o.dataURLOptions={type:"image/webp",quality:this.Ot.quality},o.canvasResolutionScale=this.Lt,o.canvasMasking={configured:()=>{var t;return nt(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,i=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(nt(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.Ze||(this.Ze=!0,wl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Rt&&(o.maskAllInputs=null===(i=this.Rt.maskAllInputs)||void 0===i||i,o.maskTextSelector=null!==(n=this.Rt.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(s=this.Rt.blockSelector)&&void 0!==s?s:void 0,o.maskAllElementAttributes=null!==(a=this.Rt.maskAllElementAttributes)&&void 0!==a&&a),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.Ve||(this.Ve=!0,wl.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.At();var f=Cl();if(f){this.lr=null!==(e=this.lr)&&void 0!==e?e:new so(f,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var i="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";wl.info(i,{node:e}),this.log(_l+" "+i,"warn")}});var g=this.Ft();if(this.Re=f(p({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.Ge||(this.Ge=!0,wl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Re)return this.He=!0,void wl.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.He=!1,!0===(null==l?void 0:l.captureJsonLd)&&r&&null!=t&&t.MutationObserver&&!this.Wt&&(this.Wt=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=Zo,a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var i=t;i;){if(vl(i,e.blockClass,e.blockSelector)||vl(i,e.maskTextClass,e.maskTextSelector))return!0;var r=i.parentNode;i=i.parentElement||(r&&r.nodeType===r.DOCUMENT_FRAGMENT_NODE?r.host:null)}return!1}(e,i))return;var o=function(t){if(!t||t.length>Zo)return null;try{var e=JSON.parse(t),i=rt(e)?e.map(hl):hl(e);if(ht(i)||rt(i)&&(!i.length||i.some(ht)))return null;var r=JSON.stringify(i);return r.length>2e4?null:[i,r]}catch(t){return null}}(e.text);if(!o)return void r.delete(e);var l=o[0],u=o[1];if(ht(a))return void r.set(e,u);if(r.get(e)!==u){if(u.length>s)return void(s=0);i.emit(l)&&(r.set(e,u),s-=u.length)}}catch(t){return}};try{var o=new e((t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of cl(t))a(e)};for(var i of t)if("childList"===i.type)dl(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&dl(r)&&a(r)}else"attributes"===i.type&&dl(i.target)&&a(i.target)}catch(t){return}}));return o.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&cl(t.documentElement).forEach((t=>{e&&r.delete(t),a(t)}))},stop(){return o.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(r,t.MutationObserver,{blockClass:o.blockClass,blockSelector:o.blockSelector,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.J.urlBlocked||this.J.isCurrentUrlBlocked()?null:this.Ht()},emit:t=>this.Ut(t)}),this.J.isCurrentUrlBlocked()&&this.Wt.scan()),this.Le=Date.now(),this.De=ft(this.De)?this.De:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Me),this.be("$session_options",{sessionRecordingOptions:o,activePlugins:g.map((t=>null==t?void 0:t.name))}),this.be("$posthog_config",{config:this._instance.config})}else wl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.be(t,e)}}var Vl,Gl=["type"],Zl=Object.defineProperty,Ql=(t,e,i)=>((t,e,i)=>e in t?Zl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Jl=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Jl||{}),Kl=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Kl||{}),Yl=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Yl||{}),Xl=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Xl||{}),tu=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(tu||{}),eu=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(eu||{}),iu=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(iu||{});function ru(t,e){return-1!==t.indexOf(e)}var nu={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},su={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},au={};function ou(t){if(au[t])return au[t];var e=function(t){var e,i,r=null==(i=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in nu?nu[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in su?su[t]:void 0,a=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&a)return au[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var l=!1;try{document.body.appendChild(o);var u=o.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return ru(t,"AppleWebKit")&&!ru(t,"Chrome")}(navigator.userAgent)&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),au[t]=h):i}catch(t){return i}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var lu={};function uu(t,e,i){var r,n=t+"."+String(i);if(lu[n])return lu[n].call(e);var s=ou(t),a=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return a?(lu[n]=a,a.call(e)):e[i]}var hu={};function du(t,e,i){var r=t+"."+String(i);if(hu[r])return hu[r].bind(e);var n=ou(t)[i];return"function"!=typeof n?e[i]:(hu[r]=n,n.bind(e))}function vu(){return ou("MutationObserver").constructor}function cu(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n={next:r},s=i((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var i=t[e];"function"==typeof i&&i.__rrweb_layer__;){var r=i.__rrweb_layer__;if(r.next===s)return void(r.next=n.next);i=r.next}else t[e]=n.next}}catch(t){return()=>{}}}var fu={childNodes:t=>uu("Node",t,"childNodes"),parentNode:t=>uu("Node",t,"parentNode"),parentElement:t=>uu("Node",t,"parentElement"),textContent:t=>uu("Node",t,"textContent"),contains:(t,e)=>du("Node",t,"contains")(e),getRootNode:t=>du("Node",t,"getRootNode")(),host:t=>t&&"host"in t?uu("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?uu("Element",t,"shadowRoot"):null,querySelector:(t,e)=>du("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>du("Element",t,"querySelectorAll")(e),mutationObserver:vu,patch:cu},pu=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function gu(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var mu=0,yu=6e4;function bu(){mu+=1}function _u(){return mu}function wu(t,e){return e!==mu||t>yu}var ku=0,Su=0,xu=0,Cu=pu(),Tu=null,Mu=null,Eu=[],Iu=0,Ru=0,Pu={slowestBatchMs:0},Au={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},Fu=t=>t&&t>0?t:null;function Ou(t){(ku+=1)>1||(Cu=pu(),Eu=[],Iu=0,Mu=Fu(t),Su=gu(),xu=mu)}function Lu(){return 0===ku?Tu||pu():(ku-=1)>0?Cu:(Cu.durationMs=gu()-Su,Cu.deferredStylesheetCount=Iu,Au.deferredCount+=Iu,Mu=null,wu(Cu.durationMs,xu)?Cu:Tu=Cu)}var Du=32;function $u(t,e,i){var r=t.length;if(i>=Du)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)r+=$u(a,e,i+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var l=o.rules||o.cssRules;l&&(r+=$u(l,e,i+1))}}}catch(t){}}return r}function Nu(t){if(0!==ku){var e=$u(t,null,0);Cu.cssRuleCount+=e,Ru>0&&(Cu.nonDeferrableCssRuleCount+=e)}}function qu(t){Ru+=1;try{return t()}finally{Ru-=1}}function ju(t){ku>0&&(Cu.stylesheetMs+=t)}function Bu(t){if(0===ku||null===Mu)return!1;var e=Cu.cssRuleCount-Cu.nonDeferrableCssRuleCount;return e>=Mu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),$u(e,i,0)}catch(t){return 0}}(t)>Mu}function Hu(){Au.failedCount+=1}function Uu(t){t>0&&(Au.abandonedCount+=t)}function zu(t){return t.nodeType===t.ELEMENT_NODE}function Wu(t){var e=t&&"host"in t&&"mode"in t&&fu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&fu.shadowRoot(e)===t)}function Vu(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Gu(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function Zu(t){var e=t.cssText;if(3>e.split('"').length)return e;var i=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?i.push("layer"):t.layerName&&i.push("layer("+t.layerName+")"),t.supportsText&&i.push("supports("+t.supportsText+")"),t.media.length&&i.push(t.media.mediaText),i.join(" ")+";"}var Qu=0;function Ju(t){var e=0===Qu,i=e?gu():0;Qu+=1;try{var r=t.rules||t.cssRules;if(!r)return null;Nu(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Gu(Array.from(r,(t=>Ku(t,n))).join(""))}catch(t){return null}finally{Qu-=1,e&&ju(gu()-i)}}function Ku(t,e){var i;if(Xu(t)){var r;try{r=Ju(t.styleSheet)||Zu(t)}catch(e){r=t.cssText}try{if(r&&(null==(i=t.styleSheet)?void 0:i.href))return ph(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return th(t)&&t.selectorText.includes(":")&&(n=Yu(n)),e?ph(n,e):n}function Yu(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Xu(t){return"styleSheet"in t}function th(t){return"selectorText"in t}var eh=/^-?[A-Za-z_][\w-]*$/,ih=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function rh(t){var e=[],i=!1,r=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var o=e[e.length-1];return o.parts.push(t),void(o.index+=1)}if(!n.importRule)return i=!0,void(r=t);a(e[e.length-1],n.importRule,t)}function a(t,e,i){var r;try{var n;try{n=i||Zu(e)}catch(t){n=e.cssText}try{n&&(null==(r=e.styleSheet)?void 0:r.href)&&(n=ph(n,e.styleSheet.href))}catch(t){}n&&t.parts.push(n),t.index+=1}catch(t){s(null)}}function o(t){var i=t.rules[t.index];if("sheet"===t.kind&&Xu(i)){var r=n.get(i);return null===r?(t.parts.push(i.cssText),void(t.index+=1)):r?void e.push({kind:"sheet",sheet:r.sheet,rules:r.rules,sheetHref:r.sheetHref,index:0,parts:[],importRule:i}):void a(t,i,null)}if(!function(t,i){try{var r=function(t){var e,i=t;if(!i.cssRules||0===i.cssRules.length)return null;if(i.media&&"string"==typeof i.media.mediaText)return"@media "+i.media.mediaText+" {";if(th(t)){if("number"==typeof i.type&&1!==i.type)return null;var r=i.style?i.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in i)return"string"!=typeof i.containerQuery||i.containerName&&!eh.test(i.containerName)?null:"@container "+(i.containerName?i.containerName+" ":"")+i.containerQuery+" {";if("string"==typeof i.conditionText){var n="";try{n=(null==(e=t.constructor)?void 0:e.name)||""}catch(t){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+i.conditionText+" {":null}return"string"==typeof i.name?"keyText"in i.cssRules[0]?eh.test(i.name)?"@keyframes "+i.name+" {":null:""===i.name?"@layer {":ih.test(i.name)?"@layer "+i.name+" {":null:null}(t);if(null===r)return!1;var n=i.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?ph(r,n):r,fixColons:"sheet"===i.kind&&th(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&th(i)&&i.selectorText.includes(":")&&(s=Yu(s)),t.parts.push(t.sheetHref?ph(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;Nu(i);var r=t.href;!r&&t.ownerNode&&(r=t.ownerNode.baseURI);var s=Array.from(i);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:r,index:0,parts:[],importRule:null}),function(t,e){for(var i=[{sheet:e,rules:t,index:0}],r=function(){var t=i[i.length-1];if(t.index>=t.rules.length)return i.pop(),0;var e=t.rules[t.index];if(t.index+=1,!Xu(e)||n.has(e))return 0;var r=null;try{r=e.styleSheet}catch(t){return n.set(e,null),0}if(!r||i.some((t=>t.sheet===r)))return 0;try{var s=r.rules||r.cssRules;if(!s)return 0;Nu(s);var a=r.href;!a&&r.ownerNode&&(a=r.ownerNode.baseURI);var o=Array.from(s);n.set(e,{sheet:r,rules:o,sheetHref:a}),i.push({sheet:r,rules:o,index:0})}catch(t){}};i.length>0;)r()}(s,t),!0}catch(t){return!1}}(t)||(i=!0),{advance(t){if(i)return!0;var n=gu(),a=t>0?t:1;try{for(;!i&&a>0;){var l=e[e.length-1];if(l.rules.length>l.index){a-=1;try{o(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?Yu(h):h}else u=Gu(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{ju(gu()-n)}return i},text:()=>i?r:null,remainingRules(){if(i)return 0;var t=0;for(var r of e)t+=r.rules.length-r.index;return t}}}class nh{constructor(){Ql(this,"idNodeMap",new Map),Ql(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),zu(t)){var i=fu.shadowRoot(t);i&&this.removeNodeFromMap(i),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function sh(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&ah(n);return(i[r.toLowerCase()]||o&&i[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function ah(t){return t.toLowerCase()}var oh=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function lh(t){var e=t.element,i=t.name,r=t.value,n=t.maskAttributeFn,s=t.isGenerated;return r?t.maskAllElementAttributes?void 0!==s&&s&&oh.has(ah(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var uh="__rrweb_original__";function hh(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ah(e):null}catch(t){return null}}var dh=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,vh=/^(?:[a-z+]+:)?\/\//i,ch=/^www\..*/i,fh=/^(data:)([^,]*),(.*)/i;function ph(t,e){return(t||"").replace(dh,((t,i,r,n,s,a)=>{var o,l=r||s||a,u=i||n||"";if(!l)return t;if(vh.test(l)||ch.test(l))return"url("+u+l+u+")";if(fh.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var v of(h.pop(),d))"."!==v&&(".."===v?h.pop():h.push(v));return"url("+u+h.join("/")+u+")"}))}var gh,mh,yh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",bh=4096,_h=1e5,wh=10,kh=new Map,Sh=1,xh=new RegExp("[^a-z0-9-_:]"),Ch=-2;function Th(){return Sh++}var Mh=/^[^ \t\n\r\u000c]+/,Eh=/^[, \t\n\r\u000c]+/,Ih=new WeakMap;function Rh(t,e){return e&&""!==e.trim()?Ph(t,e):e}function Ph(t,e){var i=Ih.get(t);if(i||(i=t.createElement("a"),Ih.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Ah(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?yh:t}(t,e.maxBase64ImageLength):t}function Fh(t,e,i,r,n,s){var a;if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o=null==(a=n.sheet)?void 0:a.href;if(o)return o}var l=Rh(t,r);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,i,r){if(_h>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>bh||t.naturalHeight>bh)return e;var n=kh.get(e);if(n&&n.type===i&&n.quality===r)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>o.length?o:e;if(kh.size>=wh){var u=kh.keys().next().value;void 0!==u&&kh.delete(u)}return kh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Ah(u,s)}if("image"===e)return Ah(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=Rh(t,r);return"image"===e&&h.startsWith("data:")?Ah(h,s):h}return"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(i+=(r=n[0]).length,r):""}for(var n=[];r(Eh),e.length>i;){var s=r(Mh);if(","===s.slice(-1))s=Rh(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Rh(t,s);for(var o=!1;;){var l=e.charAt(i);if(""===l){n.push((s+a).trim());break}if(o)")"===l&&(o=!1);else{if(","===l){i+=1,n.push((s+a).trim());break}"("===l&&(o=!0)}a+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?ph(r,Ph(t)):"object"===e&&"data"===i?Rh(t,r):r:Rh(t,r)}function Oh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function Lh(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&Lh(fu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&Lh(fu.parentNode(t),e,i)}function Dh(t,e,i,r){var n;if(zu(t)){if(!fu.childNodes(n=t).length)return!1}else{if(null===fu.parentElement(t))return!1;n=fu.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(Lh(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function $h(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var Nh=new Map;function qh(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function jh(t){return null==t?"":t.toLowerCase()}var Bh=50,Hh=!1,Uh=!1;function zh(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,v=e.maskInputOptions,c=void 0===v?{}:v,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,b=e.slimDOMOptions,_=e.dataURLOptions,w=void 0===_?{}:_,k=e.inlineImages,S=void 0!==k&&k,x=e.recordCanvas,C=void 0!==x&&x,T=e.canvasMaskingConfigured,M=e.onSerialize,E=e.onIframeLoad,I=e.iframeLoadTimeout,R=void 0===I?5e3:I,P=e.onIframeListenerRegistered,A=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,O=void 0===F?5e3:F,L=e.keepIframeSrcFn,D=void 0===L?()=>!1:L,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,H=e.maxDepth,U=void 0===H?Bh:H,z=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=U)return Uh=!0,Hh||(Hh=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+U+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;z||(z=Dh(t,a,o,void 0===z)),ku>0&&(Cu.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,u=e.maskTextFn,h=e.maskInputFn,d=e.maskAllElementAttributes,v=void 0!==d&&d,c=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,b=e.keepIframeSrcFn,_=e.newlyAddedElement,w=void 0!==_&&_,k=function(t,e){if(e.hasNode(t)){var i=e.getId(t);return 1===i?void 0:i}}(i,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:iu.Document,childNodes:[],compatMode:t.compatMode}:{type:iu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:iu.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e){for(var i,r,n,s=e.doc,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,u=e.maskInputFn,h=e.maskAllElementAttributes,d=void 0!==h&&h,v=e.maskAttributeFn,c=e.dataURLOptions,f=void 0===c?{}:c,p=e.inlineImages,g=e.recordCanvas,m=e.canvasMaskingConfigured,y=e.keepIframeSrcFn,b=e.newlyAddedElement,_=void 0!==b&&b,w=e.rootId,k=function(t,e,i){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;if(i)return t.matches(i)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),S=function(t){if(t instanceof HTMLFormElement)return"form";var e=ah(t.tagName);return xh.test(e)?"div":e}(t),x=new Set,C={},T=t.attributes.length,M=0;T>M;M++){var E=t.attributes[M];Oh(S,E.name)||(C[E.name]=Fh(s,S,ah(E.name),E.value,t,f))}if("link"===S&&a&&!k){var I=t.sheet;if(!I){var R=function(t){return t.href}(t);R&&!(I=qh(s,R))&&R.includes(".css")&&(I=qh(s,window.location.origin+"/"+R.replace(window.location.href,"")))}var P=null;I&&(Bu(I)?ku>0&&(Eu.push(t),Iu+=1):P=Ju(I)),P&&(delete C.rel,delete C.href,C._cssText=P)}if("style"===S&&t.sheet&&!(t.innerText||fu.textContent(t)||"").trim().length){var A=qu((()=>Ju(t.sheet)));A&&(C._cssText=A)}if("input"===S||"textarea"===S||"select"===S){var F=t.value,O=t.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&F?C.value=sh({element:t,type:hh(t),tagName:S,value:F,maskInputOptions:l,maskInputFn:u}):O&&(C.checked=O)}if("option"===S&&(t.selected&&!l.select?C.selected=!0:delete C.selected),"dialog"===S&&t.open){try{C.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){C.rr_open_mode="modal",C.ph_rr_could_not_detect_modal=!0}x.add("rr_open_mode")}if("canvas"===S&&g&&!(null==m?void 0:m()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var i=0;t.width>i;i+=50)for(var r=0;t.height>r;r+=50){var n=e.getImageData;if(new Uint32Array((uh in n?n[uh]:n).call(e,i,r,Math.min(50,t.width-i),Math.min(50,t.height-r)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(C.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){var L=t.toDataURL(f.type,f.quality),D=s.createElement("canvas");D.width=t.width,D.height=t.height,L!==D.toDataURL(f.type,f.quality)&&(C.rr_dataURL=L)}var N,q,j=!1;if("img"===S&&p){gh||(gh=s.createElement("canvas"),mh=gh.getContext("2d"));var B=t,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",U=B.crossOrigin,z=(e,i)=>j?lh({element:t,name:e,value:i,maskAllElementAttributes:d,maskAttributeFn:v}):i,W=()=>{$h(B,"load",W);try{gh.width=B.naturalWidth,gh.height=B.naturalHeight,mh.drawImage(B,0,0);var t=gh.toDataURL(f.type,f.quality);C.rr_dataURL=z("rr_dataURL",t)}catch(t){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?W():B.addEventListener("load",W));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===B.crossOrigin&&(U?C.crossOrigin=z("crossOrigin",U):B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?W():B.addEventListener("load",W)}if("audio"===S||"video"===S){var V=C;V.rr_mediaState=t.paused?"paused":"played",x.add("rr_mediaState"),V.rr_mediaCurrentTime=t.currentTime,V.rr_mediaPlaybackRate=t.playbackRate,V.rr_mediaMuted=t.muted,V.rr_mediaLoop=t.loop,V.rr_mediaVolume=t.volume}if(_||(t.scrollLeft&&(C.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(C.rr_scrollTop=t.scrollTop)),k){var G=t.getBoundingClientRect(),Z=G.width,Q=G.height,J=G.left,K=G.top,Y=null==(i=s.defaultView)?void 0:i.getComputedStyle(t);C={class:C.class,rr_width:Z+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null==(r=s.defaultView)?void 0:r.scrollX)||0))+"px",rr_top:Math.floor(K+((null==(n=s.defaultView)?void 0:n.scrollY)||0))+"px"},x.add("rr_width"),x.add("rr_height"),x.add("rr_left"),x.add("rr_top"),Y&&(C.rr_position=Y.position||"static",x.add("rr_position"),Y.transform&&"none"!==Y.transform&&(C.rr_transform=Y.transform,x.add("rr_transform")),Y.display&&Y.display.startsWith("inline")&&(C.rr_display=Y.display,x.add("rr_display")))}if("iframe"!==S||y(C.src)||(t.contentDocument||(C.rr_src=C.src),delete C.src),d||v)for(var X of Object.entries(C)){var tt=X[0],et=X[1];"string"!=typeof et&&null!==et||(C[tt]=lh({element:t,name:tt,value:et,maskAllElementAttributes:d,maskAttributeFn:v,isGenerated:x.has(tt)}))}j=!0;try{customElements.get(S)&&(N=!0)}catch(t){}return{type:iu.Element,tagName:S,attributes:C,childNodes:[],isSVG:(q=t,Boolean("svg"===q.tagName||q.ownerSVGElement)||void 0),needBlock:k,rootId:w,isCustom:N}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i,r=e.needsMask,n=e.maskTextFn,s=e.rootId,a=fu.parentNode(t),o=a&&a.tagName,l=fu.textContent(t),u="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(Bu(a.sheet));else if(null==(i=a.sheet)?void 0:i.cssRules){var d=Ju(a.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=ph(l,Ph(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&r&&(l=n?n(l,fu.parentElement(t)):l.replace(/[\S]/g,"*")),{type:iu.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:iu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:iu.Comment,textContent:fu.textContent(t)||"",rootId:k};default:return!1}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,keepIframeSrcFn:D,newlyAddedElement:q});if(!Z)return console.warn(t,"not serialized"),null;G=r.hasNode(t)?r.getId(t):function(t,e){if(e.comment&&t.type===iu.Comment)return!0;if(t.type===iu.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var i,r;try{r=new URL(t,window.location.href)}catch(t){return null}var n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(i=null==n?void 0:n[1])&&void 0!==i?i:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(jh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===jh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(jh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&jh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(jh(t.attributes.property).match(/^(og|twitter|fb):/)||jh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===jh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(jh(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(jh(t.attributes.name))||jh(t.attributes.property).match(/^article:/)||jh(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(jh(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===iu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?Ch:Th();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),G===Ch)return null;M&&M(t);var J=!u;if(Q.type===iu.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=fu.shadowRoot(t);K&&Vu(K)&&(Q.isShadowHost=!0)}if((Q.type===iu.Document||Q.type===iu.Element)&&J){b.headWhitespace&&Q.type===iu.Element&&"head"===Q.tagName&&(V=!1);var Y={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:a,maskTextSelector:o,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:U};if(Q.type===iu.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(fu.childNodes(t))){var tt=zh(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(zu(t)&&(et=fu.shadowRoot(t)))for(var it of Array.from(fu.childNodes(et))){var rt=zh(it,Y);rt&&(Vu(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=fu.parentNode(t);if(nt&&Wu(nt)&&Vu(nt)&&(Q.isShadow=!0),Q.type===iu.Element&&"iframe"===Q.tagName){var st=function(t,e,i){var r,n=()=>{},s=t.contentWindow;if(!s)return n;try{r=s.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==r){var o=!1,l=null,u=()=>{o||(o=!0,null!==l&&(clearTimeout(l),l=null),$h(t,"load",h),t.addEventListener("load",a),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),o?$h(t,"load",a):(o=!0,$h(t,"load",h))}}var d,v="about:blank";try{d=s.location.href}catch(t){return n}if(d!==v||t.src===v||""===t.src){var c=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(c),$h(t,"load",a)}}return t.addEventListener("load",a),()=>{$h(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&E){var i=zh(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:U});i&&E(t,i)}}),R);null==P||P(t,st)}return Q.type===iu.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!Nh.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,g=!1,_=()=>{if(!g){g=!0;try{(()=>{if(A){var e=zh(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B,maxDepth:U});e&&A(t,e)}})()}finally{Nh.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),Nh.set(e,v)}}}(t,0,O),Q}function Wh(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class Vh{constructor(){Ql(this,"parentElement",null),Ql(this,"parentNode",null),Ql(this,"ownerDocument"),Ql(this,"firstChild",null),Ql(this,"lastChild",null),Ql(this,"previousSibling",null),Ql(this,"nextSibling",null),Ql(this,"ELEMENT_NODE",1),Ql(this,"TEXT_NODE",3),Ql(this,"nodeType"),Ql(this,"nodeName"),Ql(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Vh))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Gh(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>Zh(i,t,e,r)}function Zh(t,e,i,r){Qh((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))}))}function Qh(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Jh="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",Kh={map:{},getId(){return console.error(Jh),-1},getNode(){return console.error(Jh),null},removeNodeFromMap(){console.error(Jh)},has(){return console.error(Jh),!1},reset(){console.error(Jh)}};function Yh(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,a)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,a)}),u))}}function Xh(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){if(setTimeout((()=>{try{i.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>Xh(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Kh=new Proxy(Kh,{get(t,e,i){return"map"===e&&console.error(Jh),Reflect.get(t,e,i)}}));var td=Date.now;function ed(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=fu.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=fu.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function id(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function rd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function nd(t){return t?t.nodeType===t.ELEMENT_NODE?t:fu.parentElement(t):null}function sd(t,e,i,r){if(!t)return!1;var n=nd(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(Lh(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function ad(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===Ch}function od(t,e){if(Wu(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=fu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||od(r,e))}function ld(t){return Boolean(t.changedTouches)}function ud(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function hd(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function dd(t){return!!t&&(t instanceof Vh&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(fu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(td=()=>(new Date).getTime());class vd{constructor(){Ql(this,"id",1),Ql(this,"styleIDMap",new WeakMap),Ql(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function cd(t){var e,i=null;return"getRootNode"in t&&(null==(e=fu.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&fu.host(fu.getRootNode(t))&&(i=fu.host(fu.getRootNode(t))),i}function fd(t){var e=t.ownerDocument;return!!e&&(fu.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=cd(i);)i=e;return i}(t);return fu.contains(e,i)}(t))}function pd(t){return"__ln"in t}class gd{constructor(){Ql(this,"length",0),Ql(this,"head",null),Ql(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,i=0;t>i;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&pd(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&pd(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var md,yd=(t,e)=>t+"@"+e;class bd{constructor(){Ql(this,"frozen",!1),Ql(this,"locked",!1),Ql(this,"texts",[]),Ql(this,"attributes",[]),Ql(this,"attributeMap",new WeakMap),Ql(this,"generatedAttributes",new WeakMap),Ql(this,"removes",[]),Ql(this,"mapRemoves",[]),Ql(this,"movedMap",{}),Ql(this,"addedSet",new Set),Ql(this,"movedSet",new Set),Ql(this,"droppedSet",new Set),Ql(this,"removesSubTreeCache",new Set),Ql(this,"mutationCb"),Ql(this,"blockClass"),Ql(this,"blockSelector"),Ql(this,"maskTextClass"),Ql(this,"maskTextSelector"),Ql(this,"inlineStylesheet"),Ql(this,"maskInputOptions"),Ql(this,"maskTextFn"),Ql(this,"maskInputFn"),Ql(this,"maskAllElementAttributes"),Ql(this,"maskAttributeFn"),Ql(this,"keepIframeSrcFn"),Ql(this,"recordCanvas"),Ql(this,"canvasMaskingConfigured"),Ql(this,"inlineImages"),Ql(this,"slimDOMOptions"),Ql(this,"dataURLOptions"),Ql(this,"doc"),Ql(this,"mirror"),Ql(this,"iframeManager"),Ql(this,"stylesheetManager"),Ql(this,"shadowDomManager"),Ql(this,"canvasManager"),Ql(this,"processedNodeManager"),Ql(this,"unattachedDoc"),Ql(this,"canvasManagerReleased",!1),Ql(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Ql(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,i=gu(),r=_u();try{this.processBufferedMutations()}finally{t=gu()-i,e=r,ku>0||wu(t,null!=e?e:mu)||t>Pu.slowestBatchMs&&(Pu.slowestBatchMs=t)}}})),Ql(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,i=new gd,r=t=>{for(var e=t,i=Ch;i===Ch;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=fu.parentNode(n);if(s&&fd(n)&&"TEXTAREA"!==s.tagName){var a=Wu(s)?this.mirror.getId(cd(n)):this.mirror.getId(s),o=r(n);if(-1===a||-1===o)return i.addNode(n);var l=zh(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{ud(t,this.mirror)&&this.iframeManager.addIframe(t),hd(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),dd(t)&&!sd(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(fu.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:a,nextId:o,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)wd(this.removesSubTreeCache,s)&&!this.movedSet.has(fu.parentNode(s))||n(s);for(var a of this.addedSet)kd(this.droppedSet,a)||wd(this.removesSubTreeCache,a)?kd(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;i.length;){var l=null;if(o){var u=this.mirror.getId(fu.parentNode(o.value)),h=r(o.value);-1!==u&&-1!==h&&(l=o)}if(!l)for(var d=i.tail;d;){var v=d;if(d=d.previous,v){var c=this.mirror.getId(fu.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=fu.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=fu.host(f);if(-1!==this.mirror.getId(p)){l=v;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}o=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,i=fu.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e,i=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof i.style){var r=JSON.stringify(t.styleDiff),n=JSON.stringify(t._unchangedStyles);i.style.length>r.length&&(r+n).split("var(").length===i.style.split("var(").length&&(i.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var s of Object.entries(i)){var a=s[0],o=s[1];"string"!=typeof o&&null!==o||(i[a]=lh({element:t.node,name:a,value:o,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(e=this.generatedAttributes.get(t.node))?void 0:e.has(a)}))}return{id:this.mirror.getId(t.node),attributes:i}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))})),Ql(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),Ql(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var i=Array.from(fu.childNodes(t),(t=>fu.textContent(t)||"")).join("");e.attributes.value=sh({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:hh(t),value:i,maskInputFn:this.maskInputFn})})),Ql(this,"processMutation",(t=>{var e;if(!ad(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var i=fu.textContent(t.target);sd(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue||this.texts.push({value:Dh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,nd(t.target)):i.replace(/[\S]/g,"*"):i,node:t.target});break;case"attributes":var r,n=t.target,s=t.attributeName,a=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,o=function(t,e,i){if(!i)return e;var r=t.getAttributeNodeNS(i,e);if(r)return r.name;if("http://www.w3.org/1999/xlink"===i)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===i)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===i)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(i);return n?n+":"+e:e}(n,s,a),l=a?n.getAttributeNS(a,s):t.target.getAttribute(s);if("value"===o){var u=n,h=hh(u);l=sh({element:u,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:l,maskInputFn:this.maskInputFn})}if(sd(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;var d=this.attributeMap.get(t.target),v="IFRAME"===n.tagName&&"src"===o;if(v&&!this.keepIframeSrcFn(l)&&n.contentDocument)return;if(d||(this.attributes.push(d={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,d)),"type"===o&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Oh(n.tagName,o)){var c=Fh(this.doc,ah(n.tagName),ah(o),l,n,this.dataURLOptions);if(v&&!this.keepIframeSrcFn(l)&&(o="rr_src"),d.attributes[o]=c,null==(e=this.generatedAttributes.get(t.target))||e.delete(o),"style"===o){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=n.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?d.styleDiff[g]=""===y?m:[m,y]:d._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(d.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===n.tagName){d.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var _=this.generatedAttributes.get(t.target);_||this.generatedAttributes.set(t.target,_=new Set),_.add("rr_open_mode")}}break;case"childList":if(sd(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var i=this.mirror.getId(e),r=Wu(t.target)?this.mirror.getId(fu.host(t.target)):this.mirror.getId(t.target);sd(t.target,this.blockClass,this.blockSelector,!1)||ad(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(_d(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||od(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[yd(i,r)]?_d(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!Wu(t.target)||!Vu(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),fu.childNodes(r).forEach((t=>i.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),Ql(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(ad(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[yd(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);sd(t,this.blockClass,this.blockSelector,!1)||(fu.childNodes(t).forEach((t=>this.genAdds(t))),dd(t)&&fu.childNodes(fu.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function _d(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),fu.childNodes(r).forEach((t=>i.push(t)))}}function wd(t,e,i){return 0!==t.size&&function(t,e,i){var r=fu.parentNode(e);return!!r&&t.has(r)}(t,e)}function kd(t,e){if(0===t.size)return!1;for(var i=fu.parentNode(e);i;){if(t.has(i))return!0;i=fu.parentNode(i)}return!1}var Sd=function(t,e){return void 0===e&&(e="rrweb"),md?function(){try{return t(...arguments)}catch(t){if(md&&!0===md(t,e))return;throw t}}:t},xd=[];function Cd(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function Td(t,e){var i,r=new bd;r.init(t);try{i=new(vu())(Sd(r.processMutations.bind(r)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),xd.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function Md(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,l=t=>{var a=Cd(t);if(a&&!sd(a,n,s,!0)){var l,u,h=r.getId(a);if(a===i&&i.defaultView){var d=ed(i.defaultView);l=d.left,u=d.top}else l=a.scrollLeft,u=a.scrollTop;var v=l+","+u;o.get(h)!==v&&(o.set(h,v),e({id:h,x:l,y:u}))}},u=[Gh("scroll",Sd(Yh(Sd((t=>l(t))),a.scroll||100)),i)];return"onscrollend"in i&&u.push(Gh("scrollend",Sd(l),i)),()=>u.forEach((t=>t()))}function Ed(t,e){for(var i=xd.length-1;i>=0;i--){var r=xd[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),xd.splice(i,1))}}}var Id=["INPUT","TEXTAREA","SELECT"],Rd=new WeakMap;function Pd(t){return function t(e,i){if(Dd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Dd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Dd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Dd("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);return i.unshift(r),t(e.parentRule,i)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);i.unshift(n)}return i}(t,[])}function Ad(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}var Fd=5e3;function Od(t,e){var i,r,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:fu.host(e));var o="#document"===e.nodeName?null==(i=e.defaultView)?void 0:i.Document:null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.ShadowRoot,l=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,i;try{i=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return i}}),Sd((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Ld(t,e){void 0===e&&(e={});var i,r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,v=t.fontCb,c=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),v(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),c(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var s,a,o,l,u,h,d,v,c=[],f=Sd((()=>{if(r){r.destroy(),r.reset();var e=xd.indexOf(r);-1!==e&&xd.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),c.forEach((t=>t()))}));try{if(t.recordDOM){var g=Td(t,t.doc);i=g.observer,r=g.buffer}if(c.push(function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,a="number"==typeof i.mousemove?i.mousemove:50,o="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=Yh(Sd((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),o),h=Sd(Yh(Sd((t=>{var e=Cd(t),i=ld(t)?t.changedTouches[0]:t,r=i.clientX,a=i.clientY;s||(s=td()),l.push({x:r,y:a,id:n.getId(e),timeOffset:td()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Kl.Drag:t instanceof MouseEvent?Kl.MouseMove:Kl.TouchMove)})),a,{trailing:!1})),d=[Gh("mousemove",h,r),Gh("touchmove",h,r),Gh("drag",h,r)];return Sd((()=>{d.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var o=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],u=null;return Object.keys(Yl).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t])).forEach((t=>{var a=ah(t),o=(t=>i=>{var a=Cd(i);if(!sd(a,n,s,!0)){var o=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":o=Xl.Mouse;break;case"touch":o=Xl.Touch;break;case"pen":o=Xl.Pen}o===Xl.Touch&&(Yl[t]===Yl.MouseDown?l="TouchStart":Yl[t]===Yl.MouseUp&&(l="TouchEnd"))}else ld(i)&&(o=Xl.Touch);null!==o?(u=o,(l.startsWith("Touch")&&o===Xl.Touch||l.startsWith("Mouse")&&o===Xl.Mouse)&&(o=null)):Yl[t]===Yl.Click&&(o=u,u=null);var h=ld(i)?i.changedTouches[0]:i;if(h){var d=r.getId(a),v=h.clientX,c=h.clientY;Sd(e)(p({type:Yl[l],id:d,x:v,y:c},null!==o&&{pointerType:o}))}}})(t);if(window.PointerEvent)switch(Yl[t]){case Yl.MouseDown:case Yl.MouseUp:a=a.replace("mouse","pointer");break;case Yl.TouchStart:case Yl.TouchEnd:return}l.push(Gh(a,o,i))})),Sd((()=>{l.forEach((t=>t()))}))}(t)),c.push(Md(t)),c.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return Gh("resize",Sd(Yh(Sd((()=>{var t=id(),e=rd();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),r)}(t,{win:n})),c.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.ignoreClass,o=t.ignoreSelector,l=t.maskInputOptions,u=t.maskInputFn,h=t.userTriggeredOnInput;function d(t){var e=Cd(t),r=t.isTrusted,d=i.defaultView;if(!e||!d||e instanceof d.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=fu.parentElement(e)),e&&c&&Id.indexOf(c)>=0&&!sd(e,n,s,!0)&&!(e.classList.contains(a)||o&&e.matches(o))){var f=e.value,p=!1,g=hh(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=sh({element:e,maskInputOptions:l,tagName:c,type:g,value:f,maskInputFn:u})),v(e,h?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var i=t.value;v(t,h?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}}))}}}function v(t,i){var n=Rd.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){Rd.set(t,i);var s=r.getId(t);Sd(e)(p({},i,{id:s}))}}var c=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>Gh(t,Sd(d),i))),f=i.defaultView;if(!f)return()=>{c.forEach((t=>t()))};var g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value");return g&&g.set&&c.push(...[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]].map((t=>Xh(t[0],t[1],{set(){Sd(d)({target:this,isTrusted:!1})}},!1,f)))),Sd((()=>{c.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mediaInteractionCb,i=t.blockClass,r=t.blockSelector,n=t.mirror,s=t.sampling,a=t.doc,o=Sd((t=>Yh(Sd((s=>{var a=Cd(s);if(a&&!sd(a,i,r,!0)){var o=a.currentTime,l=a.volume,u=a.muted,h=a.playbackRate,d=a.loop;e({type:t,id:n.getId(a),currentTime:o,volume:l,muted:u,playbackRate:h,loop:d})}})),s.media||500))),l=[Gh("play",o(eu.Play),a),Gh("pause",o(eu.Pause),a),Gh("seeked",o(eu.Seeked),a),Gh("volumechange",o(eu.VolumeChange),a),Gh("ratechange",o(eu.RateChange),a)];return Sd((()=>{l.forEach((t=>t()))}))}(t)),t.recordDOM){var m=function(t){var e=new Map,i=new Set,r=!0,n=t=>{if(r)try{t()}catch(t){}},s=t=>{var i,r=e.get(t);if(r){for(;null==(i=r[0])?void 0:i.ready;){var s=r.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===r.length&&e.delete(t)}};return{queueMutation(t,i){if(t){var r=e.get(t);r?(r.push({emit:i,ready:!0}),s(t)):n(i)}else n(i)},queuePendingMutation(a,o,l){if(!r)return()=>{};var u=e.get(a);u||e.set(a,u=[]);var h={emit:o,ready:!1};u.push(h);var d,v=!1,c=!1,f=()=>{v||c||(v=!0,void 0!==d&&i.delete(d),h.ready=!0,h.emit=void 0,s(a))};try{d=t.setTimeout(f,Fd),v||c?t.clearTimeout(d):i.add(d)}catch(t){f()}return e=>{!c&&r&&(c=!0,void 0!==d&&(t.clearTimeout(d),i.delete(d)),v?e&&n(l):(h.ready=!0,e||(h.emit=void 0),s(a)))}},reset(){r=!1,i.forEach((e=>t.clearTimeout(e))),i.clear(),e.clear()}}}(n);c.push(m.reset),c.push(function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win,a=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Sd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Ad(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,adds:[{rule:o,index:l}]}))),l}),"host")}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){return void 0===i&&(i=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",i])};var l,u,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:Sd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Ad(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,removes:[{index:o}]}))),l}),"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(l=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:Sd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);try{var u=null==l?void 0:l.then;if(e.ownerNode||!l||"function"!=typeof u)return l;n.onCssomSheetMutation(e);var h=Ad(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=a.queuePendingMutation(e,(()=>i({id:d,styleId:v,replace:o})),(()=>{var t=Ju(e);null!==t&&i({id:d,styleId:v,replace:t})}));try{u.call(l,(()=>c(!0)),(()=>c(!1)))}catch(t){c(!1)}}catch(t){}return l}),"host")})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Sd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Ad(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,replaceSync:o}))),l}),"host")}));var d={};$d("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:($d("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),$d("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),$d("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));var v={};return Object.entries(d).forEach((t=>{var e=t[0],s=t[1];v[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(v[e].insertRule,{apply:Sd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Ad(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Pd(e),l];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,adds:[{rule:o,index:v}]})))}return l}),"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:Sd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Ad(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Pd(e),o];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,removes:[{index:v}]})))}return l}),"host")})})),Sd((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=h,l&&(s.CSSStyleSheet.prototype.replace=l),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach((t=>{var e=t[0],i=t[1];i.prototype.insertRule=v[e].insertRule,i.prototype.deleteRule=v[e].deleteRule}))}))}(t,{win:n,mutationQueue:m})),c.push(Od(t,t.doc)),c.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=e.mutationQueue,l=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:Sd(((t,e,a)=>{var l,u=a[0],h=a[1],d=a[2],v=t.apply(e,a);if(n.has(u))return v;var c=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=Ad(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Pd(e.parentRule);o.queueMutation(c,(()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m})))}return v}),"host")});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Sd(((t,e,a)=>{var l,u=a[0],h=t.apply(e,a);if(n.has(u))return h;var d=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=Ad(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=Pd(e.parentRule);o.queueMutation(d,(()=>i({id:c,styleId:f,remove:{property:u},index:p})))}return h}),"host")}),Sd((()=>{a.CSSStyleDeclaration.prototype.setProperty=l,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n,mutationQueue:m})),t.collectFonts&&c.push(function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,a=r.FontFace;r.FontFace=function(t,e,i){var r=new a(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var o=cu(i.fonts,"add",(function(t){return function(i){return setTimeout(Sd((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=a})),n.push(o),Sd((()=>{n.forEach((t=>t()))}))}(t))}for(var y of(c.push((a=(s=t).doc,o=s.mirror,l=s.blockClass,u=s.blockSelector,h=s.selectionCb,d=!0,(v=Sd((()=>{var t=a.getSelection();if(!(!t||d&&(null==t?void 0:t.isCollapsed))){d=t.isCollapsed||!1;for(var e=[],i=t.rangeCount||0,r=0;i>r;r++){var n=t.getRangeAt(r),s=n.startContainer,v=n.startOffset,c=n.endContainer,f=n.endOffset;sd(s,l,u,!0)||sd(c,l,u,!0)||e.push({start:o.getId(s),startOffset:v,end:o.getId(c),endOffset:f})}h({ranges:e})}})))(),Gh("selectionchange",v))),c.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?cu(i.customElements,"define",(function(t){return function(i,r,n){try{e({define:{name:i}})}catch(t){console.warn("Custom element callback failed for "+i)}return t.apply(this,[i,r,n])}})):()=>{}}(t)),t.plugins))c.push(y.observer(y.callback,n,y.options))}catch(t){try{f()}catch(t){}throw t}return f}function Dd(t){return void 0!==window[t]}function $d(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Nd{constructor(t){Ql(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Ql(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){if(0>e)return e;var n=i||this.getRemoteIdToLocalIdMap(t),s=r||this.getLocalIdToRemoteIdMap(t),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}getIds(t,e){var i=this.getRemoteIdToLocalIdMap(t),r=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getId(t,e,i,r)))}getRemoteId(t,e,i){var r;return"number"!=typeof e||0>e?e:null!==(r=(i||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==r?r:-1}getRemoteIds(t,e){var i=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getRemoteId(t,e,i)))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}}class qd{constructor(t){Ql(this,"iframes",new WeakMap),Ql(this,"crossOriginIframeMap",new WeakMap),Ql(this,"crossOriginIframeMirror",new Nd(Th)),Ql(this,"crossOriginIframeStyleMirror"),Ql(this,"crossOriginIframeRootIdMap",new WeakMap),Ql(this,"mirror"),Ql(this,"mutationCb"),Ql(this,"wrappedEmit"),Ql(this,"loadListener"),Ql(this,"pageHideListener"),Ql(this,"stylesheetManager"),Ql(this,"recordCrossOriginIframes"),Ql(this,"messageHandler"),Ql(this,"nestedIframeListeners",new Map),Ql(this,"attachedWindows",new WeakMap),Ql(this,"attachedDocuments",new WeakMap),Ql(this,"attachedIframes",new Map),Ql(this,"loadListenerDisposers",new WeakMap),Ql(this,"iframeElementsById",new Map),Ql(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Nd(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var i=this.loadListenerDisposers.get(t);i||this.loadListenerDisposers.set(t,i=new Set),i.add(e);var r=this.mirror.getId(t);-1!==r&&this.iframeElementsById.set(r,t)}getIframeElementById(t){var e,i,r;return null!==(e=null!==(i=null==(r=this.attachedIframes.get(t))?void 0:r.element)&&void 0!==i?i:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>Qh(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Zh(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var i=this.mirror.getId(t);return this.attachedIframes.set(i,{element:t,content:e}),i}attachIframe(t,e){var i,r=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:r,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var a=this.handleMessage.bind(this);Qh((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}Qh((()=>{var e=t.contentWindow;if(e){var i=this.pageHideHandlers.get(t);if(i)for(var r of i)if(r.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}})),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var i=this.crossOriginIframeMap.get(t.source);if(i){var r=this.transformCrossOriginEvent(i,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var i;switch(e.type){case Jl.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Jl.IncrementalSnapshot,data:{source:Kl.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Jl.Meta:case Jl.Load:case Jl.DomContentLoaded:return!1;case Jl.Plugin:return e;case Jl.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Jl.IncrementalSnapshot:switch(e.data.source){case Kl.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(e.node,i)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Kl.Drag:case Kl.TouchMove:case Kl.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Kl.ViewportResize:return!1;case Kl.MediaInteraction:case Kl.MouseInteraction:case Kl.Scroll:case Kl.CanvasMutation:case Kl.Input:return this.replaceIds(e.data,t,["id"]),e;case Kl.StyleSheetRule:case Kl.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Kl.Font:return e;case Kl.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Kl.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(i=e.data.styles)||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,i,r){for(var n of r)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(i,e[n]):t.getId(i,e[n]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===iu.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),i=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),i){var r=i.contentWindow,n=this.attachedWindows.get(i);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(Zh(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(Zh(r,"message",this.nestedIframeListeners.get(r)),this.nestedIframeListeners.delete(r)),r&&this.crossOriginIframeMap.delete(r),this.iframes.delete(i),this.disposeLoadListeners(i),this.removePageHideListener(i);var s=this.attachedDocuments.get(i);s&&(s.forEach((t=>{Qh((()=>this.mirror.removeNodeFromMap(t)))})),Qh((()=>Ed(i,s))),this.attachedDocuments.delete(i))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,i)=>{this.mirror.has(i)||t.push(i)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var i=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&Zh(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Zh(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class jd{constructor(t){Ql(this,"shadowDoms",new WeakSet),Ql(this,"mutationCb"),Ql(this,"scrollCb"),Ql(this,"bypassOptions"),Ql(this,"mirror"),Ql(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var i,r;if(Vu(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null==(r=fu.host(t))?void 0:r.ownerDocument)&&void 0!==i?i:e,s=Td(p({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=s.observer,o=s.buffer;this.restoreHandlers.push({doc:n,handler(){a.disconnect(),o.destroy(),o.releaseCanvasManager();var t=xd.indexOf(o);-1!==t&&xd.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:Md(p({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(fu.host(t))),this.restoreHandlers.push({doc:n,handler:Od({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var i=this;this.restoreHandlers.push({doc:e,handler:cu(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=fu.shadowRoot(this);return s&&fd(this)&&i.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var i of this.restoreHandlers)if(i.doc===t)try{i.handler()}catch(t){}else e.push(i);this.restoreHandlers=e}}var Bd="skip-frame";function Hd(t){if("object"!=typeof t||null===t)return!1;var e=t.y,i=t.width,r=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var Ud="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Wd=0;64>Wd;Wd++)zd[Ud.charCodeAt(Wd)]=Wd;var Vd=new Map,Gd=(t,e,i)=>{if(t&&(Jd(t,e)||"object"==typeof t)){var r=function(t,e){var i=Vd.get(t);return i||Vd.set(t,i=new Map),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function Zd(t,e,i,r){if(t instanceof Array)return t.map((t=>Zd(t,e,i,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=Ud[i[e]>>2],n+=Ud[(3&i[e])<<4|i[e+1]>>4],n+=Ud[(15&i[e+1])<<2|i[e+2]>>6],n+=Ud[63&i[e+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[Zd(t.buffer,e,i,r),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(r.type,r.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Zd(t.data,e,i,r),t.width,t.height]}:Jd(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Gd(t,e,i)}:t}var Qd=(t,e,i,r)=>t.map((t=>Zd(t,e,i,r))),Jd=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(i.find((i=>t instanceof e[i])))},Kd=["webgl","webgl2"];function Yd(t){return"nodeType"in t}function Xd(t,e,i,r){var n=[];try{if(r){var s=function(t,e,i){var r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return cu(r.prototype,"configure",(function(r){return function(n){var s=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!s||Yd(s)&&sd(s,e,i,!0))return r.call(this,n);Yd(s)&&!("__context"in s)&&(s.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return r.call(this,null!==a&&n?p({},n,{usage:"number"==typeof n.usage?n.usage|a:a}):n)}}))}(t,e,i);s&&n.push(s)}var a=cu(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];if(!sd(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&Kd.includes(s)))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...o])}}));n.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function tv(t,e,i,r,n,s,a){var o=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=cu(t,l,(function(t){return function(){for(var o=arguments.length,u=new Array(o),h=0;o>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(Gd(d,s,this),this.canvas&&"tagName"in this.canvas&&!sd(this.canvas,r,n,!0)){var v=Qd(u,s,this,a);i(this.canvas,{type:e,property:l,args:v})}return d}}));o.push(u)}catch(s){var h=Xh(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!sd(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});o.push(h)}};for(var h of l)u(h);return o}var ev,iv,rv,nv='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',sv="undefined"!=typeof self&&self.Blob&&new Blob([nv],{type:"text/javascript;charset=utf-8"});function av(t){var e;try{if(!(e=sv&&(self.URL||self.webkitURL).createObjectURL(sv)))throw"";var i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),i}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(nv),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class ov{constructor(t){Ql(this,"pendingCanvasMutations",new Map),Ql(this,"rafStamps",{latestId:0,invokeId:null}),Ql(this,"mirror"),Ql(this,"mutationCb"),Ql(this,"resetObservers"),Ql(this,"frozen",!1),Ql(this,"locked",!1),Ql(this,"rafIdTimestamp",null),Ql(this,"rafIdFlush",null),Ql(this,"refCount",0),Ql(this,"torndown",!1),Ql(this,"resetFrameDedup",null),Ql(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var e=t.sampling,i=void 0===e?"all":e,r=t.win,n=t.blockClass,s=t.blockSelector,a=t.recordCanvas,o=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===i&&this.initCanvasMutationObserver(r,n,s,o),a&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:o,resolutionScale:l,canvasMasking:u})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,e,i,r,n){var s=this;if("OffscreenCanvas"in e){var a,o="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,l=Xd(e,i,r,!0),u=new Map;try{a=new av}catch(t){return}var h=!1;a.onerror=()=>{var t;h=!0,cancelAnimationFrame(d),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(u.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:tu["2D"],commands:[{property:"clearRect",args:[0,0,r,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i.base64}],type:i.type}]},0,0,r,n]}],displayWidth:r,displayHeight:n})}};var d,v=1e3/t,c=0,p=t=>{var l,g;h||(c&&v>t-c||(c=t,(l=[],g=t=>{try{t.querySelectorAll("canvas").forEach((t=>{sd(t,i,r,!0)||l.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&g(t.shadowRoot)}))}catch(t){}},g(e.document),l).forEach(function(){var t=f((function*(t){var e,i,r=s.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){u.set(r,!0);try{if(["webgl","webgl2"].includes(t.__context)){var l=t.getContext(t.__context);if(null==(e=null==l?void 0:l.isContextLost)?void 0:e.call(l))return void u.set(r,!1);!1===(null==(i=null==l?void 0:l.getContextAttributes())?void 0:i.preserveDrawingBuffer)&&l.clear(l.COLOR_BUFFER_BIT)}var h=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(h*o)),c=Math.max(1,Math.round(d*o)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Bd}if(void 0!==a){if(!Array.isArray(a)||!a.every(Hd))return Bd;var o=i/n,l=r/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*l)-i}}))}}}(n.canvasMasking,t,v,c,h,d);if(f===Bd)return void u.set(r,!1);var p=yield createImageBitmap(t,1>o?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});a.postMessage({id:r,bitmap:p,width:v,height:c,displayWidth:h,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){u.set(r,!1)}}}));return function(e){return t.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(d),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Xd(t,e,i,!1),s=function(t,e,i,r,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=cu(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];return sd(this.canvas,i,r,!0)||setTimeout((()=>{var i=Qd(l,e,this,n);t(this.canvas,{type:tu["2D"],property:a,args:i})}),0),s.apply(this,l)}}));s.push(o)}catch(n){var l=Xh(e.CanvasRenderingContext2D.prototype,a,{set(e){sd(this.canvas,i,r,!0)||t(this.canvas,{type:tu["2D"],property:a,args:[e],setter:!0})}});s.push(l)}};for(var l of a)o(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r),a=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...tv(e.WebGLRenderingContext.prototype,tu.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...tv(e.WebGL2RenderingContext.prototype,tu.WebGL2,t,i,r,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),a()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(t);if(i&&-1!==e){var r=i.map((t=>g(t,Gl)));this.mutationCb({id:e,type:i[0].type,commands:r}),this.pendingCanvasMutations.delete(t)}}}}class lv{constructor(t){var e;Ql(this,"trackedLinkElements",new WeakSet),Ql(this,"pendingDeferredSheets",new Set),Ql(this,"mutationCb"),Ql(this,"adoptedStyleSheetCb"),Ql(this,"maskAllElementAttributes"),Ql(this,"maskAttributeFn"),Ql(this,"styleMirror",new vd),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var i=null,r=null;try{(r=t.sheet)&&(i=rh(r))}catch(t){}if(!i||!r)return Hu(),null;var n=i,s=!1,a={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(a);var o=!1;return{advance:i=>{if(o)return!0;var l,u,h=gu(),d=_u(),v=!0;try{if(s)return o=!0,Hu(),!0;if(!n.advance(i))return v=!1,!1;o=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(Hu(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(Hu(),!0)}finally{v&&this.pendingDeferredSheets.delete(a),wu(l=gu()-h,null!=(u=d)?u:mu)||(Au.totalMs+=l,l>Au.slowestSliceMs&&(Au.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var i;null==(i=this.beginDeferredLinkInlining(t,e))||i.advance(1/0)}emitCssTextMutation(t,e,i){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:lh({element:t,name:"_cssText",value:i,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;if(i.styleMirror.has(t))e=i.styleMirror.getId(t);else{var s=i.styleMirror.add(t);e=s;var a=gu();try{qu((()=>{try{var e=t.rules||t.cssRules;e&&Nu(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:Ku(e,t.href),index:i})))})}))}finally{ju(gu()-a)}}r.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Nh.forEach((t=>t.abort())),Nh.clear()}trackStylesheetInLinkElement(t){}}class uv{constructor(){Ql(this,"nodeMap",new WeakMap),Ql(this,"active",!1)}inOtherBuffer(t,e){var i=this.nodeMap.get(t);return i&&Array.from(i).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var hv=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var dv=document.createElement("iframe");document.body.appendChild(dv),Array.from=(null==(Vl=dv.contentWindow)?void 0:Vl.Array.from)||Array.from,document.body.removeChild(dv)}}catch(t){console.debug("Unable to override Array.from",t)}var vv=new nh,cv=new Set([Kl.Mutation,Kl.MediaInteraction,Kl.StyleSheetRule,Kl.CanvasMutation,Kl.Font,Kl.Log,Kl.StyleDeclaration,Kl.AdoptedStyleSheet]);function fv(t){var e=window;if("function"==typeof e.requestIdleCallback){var i=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null==(t=e.cancelIdleCallback)?void 0:t.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function pv(t){var e;void 0===t&&(t={});var i=t,r=i.emit,n=i.checkoutEveryNms,s=i.checkoutEveryNth,a=i.blockClass,o=void 0===a?"rr-block":a,l=i.blockSelector,u=void 0===l?null:l,h=i.ignoreClass,d=void 0===h?"rr-ignore":h,v=i.ignoreSelector,c=void 0===v?null:v,f=i.maskTextClass,g=void 0===f?"rr-mask":f,m=i.maskTextSelector,y=void 0===m?null:m,b=i.inlineStylesheet,_=void 0===b||b,w=i.inlineStylesheetBudgetRules,k=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,T=i.maskTextFn,M=i.maskAllElementAttributes,E=void 0!==M&&M,I=i.maskAttributeFn,R=i.hooks,P=i.packFn,A=i.sampling,F=void 0===A?{}:A,O=i.dataURLOptions,L=void 0===O?{}:O,D=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,j=i.recordDOM,B=void 0===j||j,H=i.recordCanvas,U=void 0!==H&&H,z=i.recordCrossOriginIframes,W=void 0!==z&&z,V=i.recordAfter,G=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,Z=i.userTriggeredOnInput,Q=void 0!==Z&&Z,J=i.collectFonts,K=void 0!==J&&J,Y=i.inlineImages,X=void 0!==Y&&Y,tt=i.plugins,et=i.keepIframeSrcFn,it=void 0===et?()=>!1:et,rt=i.ignoreCSSAttributes,nt=void 0===rt?new Set([]):rt,st=i.attributeFilter;md=i.errorHandler;var at=p({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},L),ot=!W||window.parent===window,lt=!1;if(!ot)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(ot&&!r)throw new Error("emit function is required");if(!ot&&!lt)return()=>{};void 0!==q&&void 0===F.mousemove&&(F.mousemove=q),vv.reset();var ut,ht=!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},dt=Wh(void 0!==x&&x);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var vt,ct,ft=0,pt=new Map,gt=t=>{for(var e of tt||[])e.eventProcessor&&(t=e.eventProcessor(t));return P&&!lt&&(t=P(t)),t};ev=(t,e)=>{var i,a=t;if(a.timestamp=td(),!(null==(i=xd[0])?void 0:i.isFrozen())||a.type===Jl.FullSnapshot||a.type===Jl.IncrementalSnapshot&&cv.has(a.data.source)||xd.forEach((t=>t.unfreeze())),ot)null==r||r(gt(a),e);else if(lt){var o={type:"rrweb",event:gt(a),origin:window.location.origin,isCheckout:e};window.parent.postMessage(o,"*")}if(a.type===Jl.FullSnapshot)ut=a,ft=0;else if(a.type===Jl.IncrementalSnapshot){if(a.data.source===Kl.Mutation&&a.data.isAttachIframe)return;ft++,(s&&ft>=s||n&&a.timestamp-ut.timestamp>n)&&iv(!0)}};var mt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var r of t.adds){var n=vv.getNode(r.node.id);n&&"IFRAME"===n.nodeName&&i.add(n)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=wt.getIframeElementById(r);n&&i.has(n)?wt.forgetIframeId(r):(null==vt||vt(r),wt.removeIframeById(r))}})),null==ct||ct(),wt.cleanupDetachedIframes()}ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.Mutation},t)})},yt=t=>ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.Scroll},t)}),bt=t=>ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.CanvasMutation},t)}),_t=new lv({mutationCb:mt,adoptedStyleSheetCb:t=>ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.AdoptedStyleSheet},t)}),maskAllElementAttributes:E,maskAttributeFn:I}),wt=new qd({mirror:vv,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:ev});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:vv,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new uv,xt=null==N?void 0:N.configured;rv=new ov({recordCanvas:U,mutationCb:bt,win:window,blockClass:o,blockSelector:u,mirror:vv,sampling:F.canvas,dataURLOptions:at,resolutionScale:D,canvasMasking:N});var Ct=new jd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskInputOptions:ht,dataURLOptions:at,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:E,maskAttributeFn:I,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:X,sampling:F,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:_t,canvasManager:rv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:vv});iv=function(t){if(void 0===t&&(t=!1),B){Ou(w);try{ev({type:Jl.Meta,data:{href:window.location.href,width:rd(),height:id()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),xd.forEach((t=>t.lock()));var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new nh:r,s=i.blockClass,a=void 0===s?"rr-block":s,o=i.blockSelector,l=void 0===o?null:o,u=i.maskTextClass,h=void 0===u?"rr-mask":u,d=i.maskTextSelector,v=void 0===d?null:d,c=i.inlineStylesheet,f=void 0===c||c,p=i.inlineImages,g=void 0!==p&&p,m=i.recordCanvas,y=void 0!==m&&m,b=i.canvasMaskingConfigured,_=i.maskAllInputs,w=void 0!==_&&_,k=i.maskTextFn,S=i.maskInputFn,x=i.maskAllElementAttributes,C=void 0!==x&&x,T=i.maskAttributeFn,M=i.slimDOM,E=i.dataURLOptions,I=i.preserveWhiteSpace,R=i.onSerialize,P=i.onIframeLoad,A=i.iframeLoadTimeout,F=i.onIframeListenerRegistered,O=i.onStylesheetLoad,L=i.stylesheetLoadTimeout,D=i.keepIframeSrcFn,N=void 0===D?()=>!1:D,q=i.maxDepth,j=i.inlineStylesheetBudgetRules,B=!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===w?{password:!0}:w,H=Wh(void 0!==M&&M);Ou(j);try{return zh(t,{doc:t,mirror:n,blockClass:a,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:H,dataURLOptions:E,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:I,onSerialize:R,onIframeLoad:P,iframeLoadTimeout:A,onIframeListenerRegistered:F,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{Lu()}}(document,{mirror:vv,blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:E,maskAttributeFn:I,slimDOM:dt,dataURLOptions:at,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){ud(t,vv)&&wt.addIframe(t),hd(t,vv)&&_t.trackLinkElement(t),dd(t)&&Ct.addShadowRoot(fu.shadowRoot(t),document)},onIframeLoad(t,e){wt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){wt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){_t.attachLinkElement(t,e)},keepIframeSrcFn:it})}finally{s=Eu,Eu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(ev({type:Jl.FullSnapshot,data:{node:r,initialOffset:ed(window)}},t),xd.forEach((t=>t.unlock())),rv.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,a=null,o=()=>null!==a||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&Qh((()=>{a=e.beginDeferredLinkInlining(i,vv.getId(i))}))},u=()=>{if(a){var t=a,e=!0;Qh((()=>{e=t.advance(200)})),e&&(a=null)}},h=t=>{if(n=null,!r){var e=0;do{try{a||l(),u()}catch(t){null==a||a.discard(),a=null,Uu(1)}e+=1}while(!r&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(o()?n=fv(h):i())}};return n=fv(h),{cancel(){r=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;o()&&50>e;){a||l();var d=a;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),a=null,h+=1;else{try{u()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(o()||h>0){for(var v=h+(null!==a?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);Uu(v),null==a||a.discard(),a=null}i()}}}}(i,_t,(()=>{e===n&&(e=void 0)}));e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&_t.adoptStyleSheets(document.adoptedStyleSheets,vv.getId(document))}finally{Lu()}var s}};try{var Tt=[];for(var Mt of(Tt.push(Gh("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Tt.push(Gh(Mt,bu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach((t=>{Qh(t);var e=Tt.indexOf(t);-1!==e&&Tt.splice(e,1)})),pt.delete(t))},ct=()=>{for(var t of pt){var e=t[0],i=vv.getNode(e);if(i)try{i.contentDocument&&i.contentDocument.defaultView||null==vt||vt(e)}catch(t){null==vt||vt(e)}else null==vt||vt(e)}};var Et=t=>{var e;return Sd(Ld)({mutationCb:mt,mousemoveCb:(t,e)=>ev({type:Jl.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.ViewportResize},t)}),inputCb:t=>ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.Input},t)}),mediaInteractionCb:t=>ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.MediaInteraction},t)}),styleSheetRuleCb:t=>ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.StyleSheetRule},t)}),styleDeclarationCb:t=>ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.Font},t)}),selectionCb(t){ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.Selection},t)})},customElementCb(t){ev({type:Jl.IncrementalSnapshot,data:p({source:Kl.CustomElement},t)})},blockClass:o,ignoreClass:d,ignoreSelector:c,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:_,sampling:F,recordDOM:B,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:E,maskAttributeFn:I,keepIframeSrcFn:it,blockSelector:u,slimDOMOptions:dt,dataURLOptions:at,mirror:vv,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:rv,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==(e=null==tt?void 0:tt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ev({type:Jl.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},R)};wt.addLoadListener((t=>{try{var e=vv.getId(t),i=Et(t.contentDocument);if("function"==typeof i&&(Tt.push(i),-1!==e)){var r=pt.get(e);r||pt.set(e,r=new Set),r.add(i)}}catch(t){console.warn(t)}})),wt.addPageHideListener((t=>{var e=vv.getId(t);null==vt||vt(e),Ed(t)}));var It=-1,Rt=t=>ev({type:Jl.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Pt=()=>{var t,e,i,r,n=document,s=null!==(t=null!==(e=null!==(i=null!==(r=n.fullscreenElement)&&void 0!==r?r:n.webkitFullscreenElement)&&void 0!==i?i:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=s?vv.getId(s):-1;a!==It&&(-1!==It&&Rt({id:It,enter:!1}),It=a,-1!==a&&Rt({id:a,enter:!0}))},At=()=>{iv();var t=Et(document);"function"==typeof t&&Tt.push(t),Tt.push(Gh("fullscreenchange",Pt)),Tt.push(Gh("webkitfullscreenchange",Pt)),Tt.push(Gh("mozfullscreenchange",Pt)),Tt.push(Gh("MSFullscreenChange",Pt)),hv=!0};return["interactive","complete"].includes(document.readyState)?At():(Tt.push(Gh("DOMContentLoaded",(()=>{ev({type:Jl.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&At()}))),Tt.push(Gh("load",(()=>{ev({type:Jl.Load,data:{}}),"load"===G&&At()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach((t=>Qh(t))),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),vv.reset(),hv=!1,md=void 0}}catch(t){console.warn(t)}}pv.addCustomEvent=(t,e)=>{if(!hv)throw new Error("please add custom event after start recording");ev({type:Jl.Custom,data:{tag:t,payload:e}})},pv.freezePage=()=>{xd.forEach((t=>t.freeze()))},pv.takeFullSnapshot=t=>{if(!hv)throw new Error("please take full snapshot after start recording");iv(t)},pv.mirror=vv;var gv=Object.defineProperty,mv=(t,e,i)=>((t,e,i)=>e in t?gv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class yv{constructor(t){mv(this,"fileName"),mv(this,"functionName"),mv(this,"lineNumber"),mv(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var bv=/(^|@)\S+:\d+/,_v=/^\s*at .*(\S+:\d+|\(native\))/m,wv=/^(eval@)?(\[native code])?$/,kv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(_v)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(_v)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),i=e.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(e=i?e.replace(i[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(i?i[1]:r.pop()),s=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new yv({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(wv)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new yv({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new yv({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),r=[],n=2,s=i.length;s>n;n+=2){var a=e.exec(i[n]);a&&r.push(new yv({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;s>n;n+=2){var a=e.exec(i[n]);a&&r.push(new yv({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(bv)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),i=this.extractLocation(e.pop()),r=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new yv({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function Sv(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var a=r.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===i&&n.push(a)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function xv(t){return Array.isArray(t)}function Cv(t){return"object"==typeof t&&null!==t&&!xv(t)}function Tv(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(Cv(t[r])&&Tv(t[r],e-1))return!0;return!1}function Mv(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,(function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Cv(a=e)&&Object.keys(a).length>i.numOfKeysLimit||"function"==typeof a||Cv(a)&&Tv(a,i.depthOfLimit))return function(t){var e=t.toString();return i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"..."),e}(e);var a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var l in e){var u=e[l];o[l]=xv(u)?Sv(u.length?u[0]:null):u}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Ev={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Iv(t,e,i){var r,n=i?Object.assign({},Ev,i):Ev,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var a=0,o=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=kv.parse(e.error).map((t=>t.toString())),s=[Mv(i,n.stringifyOptions)];t({level:"error",trace:r,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var i,r;e.reason instanceof Error?r=[Mv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Mv("Uncaught (in promise)",n.stringifyOptions),Mv(e.reason,n.stringifyOptions)]);var s=kv.parse(i).map((t=>t.toString()));t({level:"error",trace:s,payload:r})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(v(r,d));return()=>{l.forEach((t=>t()))};function v(e,i){var r=this;return e[i]?function(e,s,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||o)){o=!0;try{var h=kv.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===i?l.slice(1):l).map((t=>Mv(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:i,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Mv("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{o=!1}}})((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var i=t.__rrweb_layer__;if(i.next===d)return void(i.next=h.next);t=i.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var Rv=t=>({name:"rrweb/console@1",observer:Iv,options:t}),Pv=t=>"undefined"!=typeof Document&&t instanceof Document,Av=()=>{};function Fv(t,e,i){try{if(!(e in t))return Av;var r={next:t[e]},n=i((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return r.next.apply(this,e)}));return nt(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=n,()=>{if(t[e]!==n)for(var i=t[e];nt(i)&&i.__posthog_layer__;){var s=i.__posthog_layer__;if(s.next===n)return void(s.next=r.next);i=s.next}else t[e]=r.next}}catch(t){return Av}}function Ov(t,e){var i,r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}var Lv=Bi("[Recorder]"),Dv=t=>"navigation"===t.entryType,$v=t=>"resource"===t.entryType;function Nv(t,e){return!!e&&(ft(e)||e[t])}function qv(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var jv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Bv(t){var e=t.type,i=t.recordBody,r=t.headers;function n(t){var e=Object.keys(r).find((t=>"content-type"===t.toLowerCase())),i=e&&r[e];return t.some((t=>null==i?void 0:i.toLowerCase().includes(t)))}if(!i)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!qv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(jv))return!1;if(ft(i))return!0;if(rt(i))return n(i);var s=i[e];return ft(s)?s:n(s)}function Hv(t,e,i,r,n,s){return Uv.apply(this,arguments)}function Uv(){return Uv=f((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return Lv.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var a=function(t,i){for(var s=t.length-1;s>=0;s-=1)if($v(a=t[s])&&a.initiatorType===e&&(ot(r)||a.startTime>=r)&&(ot(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(i));return a||(yield new Promise((t=>setTimeout(t,50*s))),Hv(t,e,i,r,n,s+1))})),Uv.apply(this,arguments)}function zv(t){var e=t.body,i=t.options,r=t.url;if(dt(e))return null;var n=Ov(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(lt(e))return e;if(Pv(e))return e.textContent;if(pt(e))return ir(e);if(st(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Wv=t=>!ht(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Vv(t){var e=t.entry,i=t.method,r=t.status,n=t.networkRequest,s=t.isInitial,a=t.start,o=t.end,l=t.url,u=t.initiatorType;a=e?e.startTime:a,o=e?e.responseEnd:o;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(a||0)),v=[p({},e?e.toJSON():{name:l},{startTime:ot(a)?void 0:Math.round(a),endTime:ot(o)?void 0:Math.round(o),timeOrigin:h,timestamp:d,method:i,initiatorType:u||(e?e.initiatorType:void 0),status:r,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:s})];if(Wv(e))for(var c of e.serverTiming||[])v.push({timeOrigin:h,timestamp:d,startTime:Math.round(e.startTime),name:c.name,duration:c.duration,entryType:"serverTiming"});return v}var Gv=["video/","audio/"];function Zv(t){return st(t)&&nt(t.getReader)&&nt(t.tee)}var Qv=500,Jv="[SessionReplay] Timeout while trying to read body",Kv="[SessionReplay] Failed to read body";function Yv(t){return Kv+": "+t}function Xv(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function tc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var i=setTimeout((()=>e(Jv)),Qv);try{t.clone().text().then((t=>e(t)),(t=>e(Yv(t)))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e(Kv)}}))}(t);var i=rn(e);return function(t,e){try{var i,r=null==(i=t.headers)||null==i.get?void 0:i.get("content-length");if(!r)return!1;var n=parseInt(r,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,i)?Promise.resolve(Xv(i)):function(t,e){return new Promise((i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel()}catch(t){}}function a(t){n||(n=!0,clearTimeout(l),s(),i(t))}var o,l=setTimeout((()=>a(Jv)),Qv);try{o=t.clone()}catch(t){return void a(Kv)}var u=o.body;if(Zv(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void a(Kv)}var h=[],d=0;!function t(){r.read().then((i=>{var r=i.done,o=i.value;if(n)s();else if(r)a((new TextDecoder).decode(function(t,e){var i=new Uint8Array(e),r=0;for(var n of t)i.set(n,r),r+=n.byteLength;return i}(h,d)));else{if(o){if(d+o.byteLength>e)return void a(Xv(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(Yv(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(Yv(t))))}catch(t){a(Kv)}}))}(t,i)}function ec(){return ec=f((function*(t){var e=t.r,i=t.options,r=Ov(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):tc(e,i)})),ec.apply(this,arguments)}function ic(){return ic=f((function*(t){var e=t.r,i=t.options,r=function(t){var e,i=t.r,r=t.options,n=t.url;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=Gv.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=Ov(n,r);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return ht(r)?tc(e,i):Promise.resolve(r)})),ic.apply(this,arguments)}var rc=null;function nc(t,e,i){if(!("performance"in e))return()=>{};if(rc)return Lv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},nn,i):nn,n=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var s=r.maskRequestFn(t);e||(n=!s||(t=>!!t&&vn.has(t))(s)),s&&i.push(s)}})),i.length>0&&t(p({},e,{requests:i}))},s=function(t,e,i){if(i.recordInitialRequests){var r=e.performance.getEntries().filter((t=>Dv(t)||$v(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>Vv({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var r=e.getEntries().filter((t=>Dv(t)||$v(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>Vv({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>i.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(n,e,r),a=()=>{},o=()=>{};return(r.recordHeaders||r.recordBody)&&(a=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=Nv("request",i.recordHeaders),n=Nv("response",i.recordHeaders),s=Fv(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(o),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),r&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(Bv({type:"request",headers:g,url:o,recordBody:i.recordBody})&&(p.requestBody=zv({body:t,options:i,url:o})),v=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),c=e.performance.now();var r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)})),n&&(p.responseHeaders=r),Bv({type:"response",headers:r,url:o,recordBody:i.recordBody})&&(p.responseBody=zv({body:d.response,options:i,url:o})),Hv(e,"xmlhttprequest",f.url,v,c).then((e=>{var i=Vv({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){Lv.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),l,u,h)}));return()=>{s()}}(n,e,r),o=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=Nv("request",i.recordHeaders),n=Nv("response",i.recordHeaders),s=Fv(e,"fetch",(s=>function(){var a=f((function*(a,o){var l,u;try{l=new Request(a,o)}catch(t){return Lv.error("Failed to instrument fetch for network capture",t),s(a,o)}var h,d,v={};try{try{var c={};l.headers.forEach(((t,e)=>{c[e]=t})),r&&(v.requestHeaders=c),!Zv(null==o?void 0:o.body)&&Bv({type:"request",headers:c,url:a,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return ec.apply(this,arguments)}({r:l,options:i,url:a}))}catch(t){Lv.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=qv(a)?yield s(l):yield s(a,o),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),n&&(v.responseHeaders=f),Bv({type:"response",headers:f,url:a,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return ic.apply(this,arguments)}({r:u,options:i,url:a})),u}finally{Hv(e,"fetch",l.url,h,d).then((e=>{var i,r=Vv({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:r})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}(n,e,r)),rc=()=>{s(),a(),o(),rc=null}}var sc=t=>({name:"rrweb/network@1",observer:nc,options:t});v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Rv,getRecordNetworkPlugin:sc},v.__PosthogExtensions__.rrweb={record:pv,version:"v2",wasMaxDepthReached:()=>Uh,resetMaxDepthState(){Uh=!1,Hh=!1},getLastSnapshotCost:()=>Tu,getMutationCost:()=>p({},Pu),resetSnapshotCostState(){ku=0,Su=0,xu=0,mu=0,Cu=pu(),Tu=null,Mu=null,Eu=[],Iu=0,Ru=0,Pu={slowestBatchMs:0},Au={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},v.rrweb={record:pv,version:"v2"},v.rrwebConsoleRecord={getRecordConsolePlugin:Rv},v.getRecordNetworkPlugin=sc,v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initSessionRecording=(t,e)=>new Wl(t,e);var ac,oc,lc,uc,hc,dc,vc,cc,fc,pc,gc,mc,yc,bc,_c,wc={},kc=[],Sc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,xc=Array.isArray;function Cc(t,e){for(var i in e)t[i]=e[i];return t}function Tc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Mc(t,e,i){var r,n,s,a={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?ac.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return Ec(t,a,r,n,null)}function Ec(t,e,i,r,n){var s={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++lc:n,__i:-1,__u:0};return null==n&&null!=oc.vnode&&oc.vnode(s),s}function Ic(t){return t.children}function Rc(t,e){this.props=t,this.context=e}function Pc(t,e){if(null==e)return t.__?Pc(t.__,t.__i+1):null;for(var i;t.__k.length>e;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?Pc(t):null}function Ac(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Cc({},e);s.__v=e.__v+1,oc.vnode&&oc.vnode(s),Hc(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?Pc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,zc(r,s,n),e.__e=e.__=null,s.__e!=i&&Fc(s)}}function Fc(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some((function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e})),Fc(t)}function Oc(t){(!t.__d&&(t.__d=!0)&&uc.push(t)&&!Lc.__r++||hc!=oc.debounceRendering)&&((hc=oc.debounceRendering)||dc)(Lc)}function Lc(){try{for(var t,e=1;uc.length;)uc.length>e&&uc.sort(vc),t=uc.shift(),e=uc.length,Ac(t)}finally{uc.length=Lc.__r=0}}function Dc(t,e,i,r,n,s,a,o,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||kc,b=e.length;for(l=function(t,e,i,r,n){var s,a,o,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(a=e[s])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=t.__k[s]=Ec(null,a,null,null,null):xc(a)?a=t.__k[s]=Ec(Ic,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=t.__k[s]=Ec(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[s]=a,l=s+v,a.__=t,a.__b=t.__b+1,o=null,-1!=(u=a.__i=Nc(a,i,l,d))&&(d--,(o=i[u])&&(o.__u|=2)),null==o||null==o.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,a.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(o=i[s])&&0==(2&o.__u)&&(o.__e==r&&(r=Pc(o)),Gc(o,o));return r}(i,e,y,l,b),d=0;b>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||wc,c.__i=d,g=Hc(t,c,v,n,s,a,o,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&Vc(v.ref,null,c),h.push(c.ref,c.__c||f,c)),null==p&&null!=f&&(p=f),(m=!!(4&c.__u))||v.__k===c.__k?(l=$c(c,l,t,m),m&&v.__e&&(v.__e=null)):"function"==typeof c.type&&void 0!==g?l=g:f&&(l=f.nextSibling),c.__u&=-7);return i.__e=p,l}function $c(t,e,i,r){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=$c(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Pc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Nc(t,e,i,r){var n,s,a,o=t.key,l=t.type,u=e[i],h=null!=u&&0==(2&u.__u);if(null===u&&null==o||h&&o==u.key&&l==u.type)return i;if(r>(h?1:0))for(n=i-1,s=i+1;n>=0||e.length>s;)if(null!=(u=e[a=0>n?s++:n--])&&0==(2&u.__u)&&o==u.key&&l==u.type)return a;return-1}function qc(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Sc.test(e)?i:i+"px"}function jc(t,e,i,r,n){var s,a;t:if("style"==e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||qc(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||qc(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(gc,"$1")),a=e.toLowerCase(),e=a in t||"onFocusOut"==e||"onFocusIn"==e?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[pc]=r[pc]:(i[pc]=mc,t.addEventListener(e,s?bc:yc,s)):t.removeEventListener(e,s?bc:yc,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==i?"":i))}}function Bc(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[fc])e[fc]=mc++;else if(i[pc]>e[fc])return;return i(oc.event?oc.event(e):e)}}}function Hc(t,e,i,r,n,s,a,o,l,u){var h,d,v,c,f,p,g,m,y,b,$,_,w,k,S,x,C=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[o=e.__e=i.__e]),(h=oc.__b)&&h(e);t:if("function"==typeof C){d=a.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],_=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(b?e.__c=v=new C(y,_):(e.__c=v=new Rc(y,_),v.constructor=C,v.render=Zc),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),b&&null==v.__s&&(v.__s=v.state),b&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=Cc({},v.__s)),Cc(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)b&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),b&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,_),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,_)){e.__v!=i.__v&&(v.props=y,v.state=v.__s,v.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some((function(t){t&&(t.__=e)})),kc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&a.push(v);break t}null!=v.componentWillUpdate&&v.componentWillUpdate(y,v.__s,_),b&&null!=v.componentDidUpdate&&v.__h.push((function(){v.componentDidUpdate(f,p,g)}))}if(v.context=_,v.props=y,v.__P=t,v.__e=!1,w=oc.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),kc.push.apply(v.__h,v._sb),v._sb=[];else do{v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),v.state=v.__s}while(v.__d&&25>++k);v.state=v.__s,null!=v.getChildContext&&(r=Cc(Cc({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Ic&&null==h.key?Wc(h.props.children):h,o=Dc(t,xc(S)?S:[S],e,i,r,n,s,a,o,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&a.push(v),m&&(v.__E=v.__=null)}catch(t){if(a.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;null!=s&&(s[s.indexOf(o)]=null),e.__e=o}else{if(null!=s)for(x=s.length;x--;)Tc(s[x]);Uc(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||Uc(e);oc.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):o=e.__e=function(t,e,i,r,n,s,a,o,l){var u,h,d,v,c,f,p,g=i.props||wc,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((c=s[u])&&"setAttribute"in c==!!y&&(y?c.localName==y:3==c.nodeType)){t=c,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),o&&(oc.__m&&oc.__m(e,s),o=!1),s=null}if(null==y)g===m||o&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&ac.call(t.childNodes),!o&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(c=t.attributes[u]).name]=c.value;for(u in g)c=g[u],"dangerouslySetInnerHTML"==u?d=c:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||jc(t,u,null,c,n);for(u in m)c=m[u],"children"==u?v=c:"dangerouslySetInnerHTML"==u?h=c:"value"==u?f=c:"checked"==u?p=c:o&&"function"!=typeof c||g[u]===c||jc(t,u,c,g[u],n);if(h)o||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),Dc("template"==e.type?t.content:t,xc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,a,s?s[0]:i.__k&&Pc(i,0),o,l),null!=s)for(u=s.length;u--;)Tc(s[u]);o&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&jc(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&jc(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,a,l,u);return(h=oc.diffed)&&h(e),128&e.__u?void 0:o}function Uc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Uc))}function zc(t,e,i){for(var r=0;i.length>r;r++)Vc(i[r],i[++r],i[++r]);oc.__c&&oc.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){oc.__e(t,e.__v)}}))}function Wc(t){return"object"!=typeof t||null==t||t.__b>0?t:xc(t)?t.map(Wc):void 0!==t.constructor?null:Cc({},t)}function Vc(t,e,i){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){oc.__e(t,i)}}function Gc(t,e,i){var r,n;if(oc.unmount&&oc.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Vc(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){oc.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&Gc(r[n],e,i||"function"!=typeof t.type);i||Tc(t.__e),t.__c=t.__=t.__e=void 0}function Zc(t,e,i){return this.constructor(t,i)}function Qc(t,e,i){var r,n,s;e==document&&(e=document.documentElement),oc.__&&oc.__(t,e),r=e.__k,n=[],s=[],Hc(e,t=e.__k=Mc(Ic,null,[t]),r||wc,wc,e.namespaceURI,r?null:e.firstChild?ac.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),zc(n,t,s),t.props.children=null}ac=kc.slice,oc={__e(t,e,i,r){for(var n,s,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),a=n.__d),a)return n.__E=n}catch(e){t=e}throw t}},lc=0,Rc.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Cc({},this.state),"function"==typeof t&&(t=t(Cc({},i),this.props)),t&&Cc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),Oc(this))},Rc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Oc(this))},Rc.prototype.render=Ic,uc=[],dc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,vc=function(t,e){return t.__v.__b-e.__v.__b},Lc.__r=0,cc=Math.random().toString(8),fc="__d"+cc,pc="__a"+cc,gc=/(PointerCapture)$|Capture$/i,mc=0,yc=Bc(!1),bc=Bc(!0),_c=0;var Jc,Kc,Yc,Xc,tf=0,ef=[],rf=oc,nf=rf.__b,sf=rf.__r,af=rf.diffed,of=rf.__c,lf=rf.unmount,uf=rf.__;function hf(t,e){rf.__h&&rf.__h(Kc,t,tf||e),tf=0;var i=Kc.__H||(Kc.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function df(t){return tf=1,function(t,e,i){var r=hf(Jc++,2);if(r.t=t,!r.__c&&(r.__=[kf(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=Kc,!Kc.__f)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=!1,a=r.__c.props!==t;if(r.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),s){var o=s.call(this,t,e,i);return n?o||a:o}return!n||a};Kc.__f=!0;var s=Kc.shouldComponentUpdate,a=Kc.componentWillUpdate;Kc.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}a&&a.call(this,t,e,i)},Kc.shouldComponentUpdate=n}return r.__N||r.__}(kf,t)}function vf(t,e){var i=hf(Jc++,3);!rf.__s&&wf(i.__H,e)&&(i.__=t,i.u=e,Kc.__H.__h.push(i))}function cf(t){return tf=5,ff((function(){return{current:t}}),[])}function ff(t,e){var i=hf(Jc++,7);return wf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function pf(t){var e=Kc.context[t.__c],i=hf(Jc++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(Kc)),e.props.value):t.__}function gf(){for(var t;t=ef.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(bf),e.__h.some(_f),e.__h=[]}catch(i){e.__h=[],rf.__e(i,t.__v)}}}rf.__b=function(t){Kc=null,nf&&nf(t)},rf.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),uf&&uf(t,e)},rf.__r=function(t){sf&&sf(t),Jc=0;var e=(Kc=t.__c).__H;e&&(Yc===Kc?(e.__h=[],Kc.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&gf(),Jc=0)),Yc=Kc},rf.diffed=function(t){af&&af(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==ef.push(e)&&Xc===rf.requestAnimationFrame||((Xc=rf.requestAnimationFrame)||yf)(gf)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),Yc=Kc=null},rf.__c=function(t,e){e.some((function(t){try{t.__h.some(bf),t.__h=t.__h.filter((function(t){return!t.__||_f(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],rf.__e(i,t.__v)}})),of&&of(t,e)},rf.unmount=function(t){lf&&lf(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some((function(t){try{bf(t)}catch(t){e=t}})),i.__H=void 0,e&&rf.__e(e,i.__v))};var mf="function"==typeof requestAnimationFrame;function yf(t){var e,i=function(){clearTimeout(r),mf&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);mf&&(e=requestAnimationFrame(i))}function bf(t){var e=Kc,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Kc=e}function _f(t){var e=Kc;t.__c=t.__(),Kc=e}function wf(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function kf(t,e){return"function"==typeof e?e(t):e}function Sf(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&nt(i.then)&&i.then(void 0,(()=>{}))}}}}var xf="gzip-js",Cf="base64",Tf="events",Mf="cancelEvents",Ef={Tab:"tab",Selector:"selector"},If={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Rf={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Pf={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Af={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Ff={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Of="always",Lf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Df={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},$f="popover",Nf=Bi("[Surveys]");function qf(t){return!(!t.start_date||t.end_date)}function jf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Bf="seenSurvey_",Hf="inProgressSurvey_",Uf=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),zf=t=>Uf(Bf,t),Wf=t=>{try{var e=zf(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Nf.error("Failed to persist survey seen state",t)}},Vf=[Pf.Popover,Pf.Widget,Pf.API],Gf={ignoreConditions:!1,ignoreDelay:!1,displayType:$f},Zf="featureFlags",Qf="logs";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return vt(t)&&isFinite(t)&&Math.floor(t)===t});class Jf{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new Jf(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Jf(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}}class Kf{generate(){var t=this.generateOrAbort();if(!ot(t))return t;this.Dr=0;var e=this.generateOrAbort();if(ot(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.Dr)this.Dr=t,this.Fr();else{if(this.Dr>=t+1e4)return;this.Nr++,this.Nr>4398046511103&&(this.Dr++,this.Fr())}return Jf.fromFieldsV7(this.Dr,Math.trunc(this.Nr/Math.pow(2,30)),this.Nr&Math.pow(2,30)-1,this.qr.nextUint32())}Fr(){this.Nr=1024*this.qr.nextUint32()+(1023&this.qr.nextUint32())}constructor(){this.Dr=0,this.Nr=0,this.qr=new tp}}var Yf,Xf=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!ot(t.crypto)&&crypto.getRandomValues&&(Xf=t=>crypto.getRandomValues(t));class tp{nextUint32(){return this.yt.length>this.jr||(Xf(this.yt),this.jr=0),this.yt[this.jr++]}constructor(){this.yt=new Uint32Array(8),this.jr=1/0}}var ep=()=>ip().toString(),ip=()=>(Yf||(Yf=new Kf)).generate(),rp="",np=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var sp={Br:()=>!!r,Wr(t){ji.error("cookieStore error: "+t)},Ur:Ao,zr(t){var e;try{e=JSON.parse(sp.Ur(t))||{}}catch(t){}return e},Hr(t,e,i,n,s){if(!r)return!1;try{var a="",o="",l=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),rp)return rp;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),n=Math.min(i.length,8),s="dmn_chk_"+ep();!rp&&n--;){var a=i.slice(n).join("."),o=s+"=1;domain=."+a+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(s)&&(e.cookie=o+";max-age=0",rp=a)}return rp}(t);if(!i){var n=(t=>{var e=t.match(np);return e?e[0]:""})(t);n!==i&&ji.info("Warning: cookie subdomain discovery mismatch",n,i),i=n}return i?"; domain=."+i:""}return""}(r.location.hostname,n);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),a="; expires="+u.toUTCString()}s&&(o="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+a+"; SameSite=Lax; path=/"+l+o;return h.length>3686.4&&ji.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},$r(t,e){if(null!=r&&r.cookie)try{sp.Hr(t,"",-1,e)}catch(t){return}}},ap=null,op={Br(){if(!ht(ap))return ap;var e=!0;if(ot(t))e=!1;else try{var i="__mplssupport__";op.Hr(i,"xyz"),'"xyz"'!==op.Ur(i)&&(e=!1),op.$r(i)}catch(t){e=!1}return e||ji.error("localStorage unsupported; falling back to cookie store"),ap=e,e},Wr(t){ji.error("localStorage error: "+t)},Ur(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){op.Wr(t)}return null},zr(t){try{return JSON.parse(op.Ur(t))||{}}catch(t){}return null},Hr(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){op.Wr(t)}return!1},$r(e){try{null==t||t.localStorage.removeItem(e)}catch(t){op.Wr(t)}}},lp=[Xn,Wn,zn,Gn,Zn,Qn,ds,hs,ls],up=[pn,fn,On,Ln,ys,ms,vs],hp=t=>t+"_cpm",dp=["__proto__","constructor","prototype"],vp=t=>{if(!st(t))return{};var e={};return Object.keys(t).forEach((i=>{-1===dp.indexOf(i)&&(e[i]=t[i])})),e},cp=function(t,e){void 0===e&&(e=[]);var i={};return[...up,...e].forEach((e=>{var r=t[e];ot(r)||ht(r)||""===r||(i[e]=r)})),i},fp=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var n=t.charCodeAt(r);e=33*e^n,i=Math.imul(i^n,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},pp=(t,e)=>({p:e,f:fp(JSON.stringify(t))}),gp=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=sp.zr(hp(t)),r=(null==i?void 0:i.f)===fp(e)&&rt(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},mp=(t,e)=>e+"|"+(sp.Ur(hp(t))||""),yp={},bp={Br:()=>!0,Wr(t){ji.error("memoryStorage error: "+t)},Ur:t=>yp[t]||null,zr:t=>yp[t]||null,Hr:(t,e)=>(yp[t]=e,!0),$r(t){delete yp[t]}},_p=null,wp={Br(){if(!ht(_p))return _p;if(_p=!0,ot(t))_p=!1;else try{var e="__support__";wp.Hr(e,"xyz"),'"xyz"'!==wp.Ur(e)&&(_p=!1),wp.$r(e)}catch(t){_p=!1}return _p},Wr(t){ji.error("sessionStorage error: ",t)},Ur(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){wp.Wr(t)}return null},zr(t){try{return JSON.parse(wp.Ur(t))||null}catch(t){}return null},Hr(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){wp.Wr(t)}return!1},$r(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){wp.Wr(t)}}},kp=Bi("[Stylesheet Loader]"),Sp=t,xp=r,Cp="#020617",Tp={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:If.Right,widgetType:Ef.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Cp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Mp=[If.Center,If.Left,If.Right];function Ep(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Ip(t){var e;void 0===t&&(t=Tp.backgroundColor),"#"===t[0]&&(e=Ep(t)),t.startsWith("rgb")&&(e=t);var i={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(i&&(e=Ep(i)),!e)return Cp;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),a=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+a*a*.114)>127.5?Cp:"white"}return Cp}var Rp=(t,e,i)=>{var r=Qp(t),n=xp.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var s=xp.createElement("div");((t,e,i)=>{var r=p({},Tp,i),n=t.style,s=!Mp.includes(r.position)||e===Pf.Widget&&(null==i?void 0:i.widgetType)===Ef.Tab;n.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(r.fontFamily)),n.setProperty("--ph-survey-box-padding",r.boxPadding),n.setProperty("--ph-survey-max-width",r.maxWidth),n.setProperty("--ph-survey-z-index",r.zIndex),n.setProperty("--ph-survey-border-color",r.borderColor),s?(n.setProperty("--ph-survey-border-radius",r.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",r.backgroundColor),n.setProperty("--ph-survey-box-shadow",r.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Ip(r.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",Ip(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Ip(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",Ip(r.widgetColor)),n.setProperty("--ph-widget-z-index",r.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),o=a||r.inputBackground;a||"white"!==r.backgroundColor||(o="#f8f8f8"),n.setProperty("--ph-survey-input-background",o);var l=(null==i?void 0:i.inputTextColor)||Ip(o);n.setProperty("--ph-survey-input-text-color",l),n.setProperty("--ph-survey-rating-text-color",l),n.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",r.outlineColor)})(s,t.type,t.appearance),s.className=r;var a=s.attachShadow({mode:"open"}),o=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return nt(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(kp.error("prepare_external_dependency_stylesheet returned null"),null)})(xp,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.intro-screen-header~.bottom-section,.thank-you-message-header~.bottom-section{padding-top:16px}.intro-screen,.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.intro-screen-body,.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.intro-screen,.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.intro-screen{animation:ph-survey-fade-in .3s ease-out forwards;text-align:center}.intro-screen-header{margin:10px 0 0}.intro-screen-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(o){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(o)}return xp.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},Pp=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,n=t.posthog,s=t.isSurveyCompleted,a=t.properties,o=t.surveyLanguage;n?(Wf(i),n.capture(Lf.SENT,p({[Df.SURVEY_NAME]:i.name,[Df.SURVEY_ID]:i.id,[Df.SURVEY_ITERATION]:i.current_iteration,[Df.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Df.SURVEY_SUBMISSION_ID]:r,[Df.SURVEY_COMPLETED]:s},o&&{[Df.SURVEY_LANGUAGE]:o},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},ho(e,i),a,{$set:{[vo(i,"responded")]:!0}})),s&&(Sp.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Zp(i),n.reloadFeatureFlags())):Nf.error("[survey sent] event not captured, PostHog instance not found.")},Ap=(t,e,i)=>{return p({[Df.SURVEY_NAME]:t.name,[Df.SURVEY_ID]:t.id,[Df.SURVEY_ITERATION]:t.current_iteration,[Df.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Df.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some((t=>!dt(t))))},(null==e?void 0:e.surveyLanguage)&&{[Df.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Df.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},ho(null==e?void 0:e.responses,t));var r},Fp=(t,e,i,r)=>{if(e){if(!i){var n=Vp(t);e.capture(Lf.DISMISSED,p({},Ap(t,n,e),r&&{[Df.SURVEY_LANGUAGE]:r},{$set:{[vo(t,"dismissed")]:!0}})),Zp(t),Wf(t),Sp.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Nf.error("[survey dismissed] event not captured, PostHog instance not found.")},Op=(t,e)=>{if(e){var i=(t=>Uf("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=Vp(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(Lf.ABANDONED,Ap(t,r,e),{transport:"sendBeacon"})}}else Nf.error("[survey abandoned] event not captured, PostHog instance not found.")},Lp=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),Dp=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,$p=t=>{var e=t.map((t=>t.id));return e.every((t=>!!t))?e:void 0},Np=(t,e)=>{return(t=>t.questions.some((t=>{var e;return!(null==(e=t.branching)||!e.type)})))(t)?t.questions:e?null!==(i=((t,e)=>{if(!e||e.length!==t.questions.length)return null;var i=new Map(t.questions.map((t=>[t.id,t]))),r=[];for(var n of e){var s=i.get(n);if(!s)return null;r.push(s)}return r})(t,e.questionOrder))&&void 0!==i?i:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?Dp(t.questions,Lp(t.questions)):t.questions;var i},qp=t=>bo(t)||Gp(t),jp=function(t){function e(t){var i,r;return this.getChildContext||(i=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&i.forEach((function(t){t.__e=!0,Oc(t)}))},this.sub=function(t){i.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i&&i.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+_c++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Bp=()=>pf(jp),Hp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,a,o=Cc({},t.props);for(s in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=void 0===e[s]&&null!=a?a[s]:e[s];return arguments.length>2&&(o.children=arguments.length>3?ac.call(arguments,2):i),Ec(t.type,o,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Up(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n=ur(e);if(!n)return!1;var s=[t.conditions.url],a=function(t){return null!=t?t:"icontains"}(null==(r=t.conditions)?void 0:r.urlMatchType);return ko[a](s,[n])}var zp=t=>Uf(Hf,t),Wp=(t,e)=>{try{localStorage.setItem(zp(t),JSON.stringify(e))}catch(t){Nf.error("Error setting in-progress survey state in localStorage",t)}},Vp=t=>{try{var e=localStorage.getItem(zp(t));if(e)return JSON.parse(e)}catch(t){Nf.error("Error getting in-progress survey state from localStorage",t)}return null},Gp=t=>{var e=Vp(t);return!dt(null==e?void 0:e.surveySubmissionId)},Zp=t=>{try{localStorage.removeItem(zp(t))}catch(t){Nf.error("Error clearing in-progress survey state from localStorage",t)}};function Qp(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Jp(t,e,i){if(void 0===e&&(e=If.Right),t===Pf.ExternalSurvey)return{};switch(e){case If.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case If.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case If.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case If.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case If.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case If.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case If.Left:return{left:"30px"};case If.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Pf.Widget&&i===Ef.Tab?"60px":"30px"}}}var Kp=0;function Yp(t,e,i,r,n,s){e||(e={});var a,o,l=e;if("ref"in l)for(o in l={},e)"ref"==o?a=e[o]:l[o]=e[o];var u={type:t,props:l,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Kp,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(a=t.defaultProps))for(o in a)void 0===l[o]&&(l[o]=a[o]);return oc.vnode&&oc.vnode(u),u}var Xp=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yp("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),tg=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yp("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),eg=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yp("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),ig=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yp("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),rg=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yp("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),ng=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Yp("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),sg=Yp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Yp("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),ag=function(t){var e=(void 0===t?{}:t).fill,i=void 0===e?"currentColor":e;return Yp("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Yp("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Yp("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:i})]})},og=Yp("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Yp("g",{"clip-path":"url(#clip0_2415_6911)",children:[Yp("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Yp("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Yp("g",{mask:"url(#mask0_2415_6911)",children:[Yp("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Yp("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Yp("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Yp("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Yp("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Yp("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Yp("defs",{children:Yp("clipPath",{id:"clip0_2415_6911",children:Yp("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function lg(t){var e=t.urlParams,i=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return Yp("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",og]})}function ug(e){var i=e.text,r=e.submitDisabled,n=e.appearance,s=e.onSubmit,a=e.link,o=e.onPreviewSubmit,l=e.skipSubmitButton,u=e.canGoBack,h=e.onBack,d=pf(jp).isPreviewMode,v=!!u&&!!h,c=!l&&Yp("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){a&&(null==t||t.open(a)),d?null==o||o():s()},children:i});return Yp("div",{className:"bottom-section",children:[v?Yp("div",{className:"form-buttons form-buttons-with-back",children:[Yp("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),c]}):c,!n.whiteLabel&&Yp(lg,{urlParams:{utm_source:"survey-footer"}})]})}function hg(t){var e=t.question,i=t.forceDisableHtml;return Yp("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Yp(e.type===Af.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Hp({component:Mc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function dg(t){return Yp("button",{className:"form-cancel",onClick:t.onClick,disabled:pf(jp).isPreviewMode,"aria-label":"Close survey",type:"button",children:ag({fill:"black"})})}Yp("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Yp("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var vg=t;function cg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onClose,o=pf(jp).isPopup;return vf((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),a())};return Ki(vg,"keydown",t),()=>{vg.removeEventListener("keydown",t)}}),[a]),Yp("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[o&&!0!==s.hideCancelButton&&Yp(dg,{onClick:()=>a()}),Yp("h3",{className:"thank-you-message-header",children:e}),i&&Hp({component:Mc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),o&&Yp(ug,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})}function fg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onStart,o=pf(jp),l=o.onPreviewSubmit,u=o.onPopupSurveyDismissed;return Yp("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[o.isPopup&&!0!==s.hideCancelButton&&Yp(dg,{onClick:()=>u()}),e&&Yp("h3",{className:"intro-screen-header",children:e}),i&&Hp({component:Mc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),Yp(ug,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:a,onPreviewSubmit:()=>l(null)})]})}var pg=t=>rt(t)&&t.every((t=>lt(t)));function gg(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,a=t.displayQuestionIndex,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=Bp().isPreviewMode,d=cf(null),v=df((()=>lt(o)?o:"")),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;vf((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+a,m=ff((()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var a of e)switch(a.type){case T:if(void 0!==a.value&&a.value>s.length)return null!==(r=a.errorMessage)&&void 0!==r?r:"Please enter at least "+a.value+" characters";break;case M:if(void 0!==a.value&&s.length>a.value)return null!==(n=a.errorMessage)&&void 0!==n?n:"Please enter no more than "+a.value+" characters"}return!1}(c,e.validation,e.optional)),[c,e.validation,e.optional]),y=ii(e.validation,T),b=ii(e.validation,M),_=ff((()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return Yp(Ic,{children:[Yp("div",{className:"question-container",children:[Yp(hg,{question:e,forceDisableHtml:i,htmlFor:g}),Yp("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?k():w())},value:c}),_&&Yp("div",{className:"validation-hint",children:_})]}),Yp(ug,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function mg(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,a=t.onBack;return Yp(Ic,{children:[Yp("div",{className:"question-container",children:Yp(hg,{question:e,forceDisableHtml:t.forceDisableHtml})}),Yp(ug,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:a})]})}function yg(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,a=t.onSubmit,o=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=df((()=>vt(l)?l:rt(l)&&l.length>0&&vt(parseInt(l[0]))?parseInt(l[0]):lt(l)&&vt(parseInt(l))?parseInt(l):null)),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Bp().isPreviewMode,y=t=>m?o(t):a(t);return Yp(Ic,{children:[Yp("div",{className:"question-container",children:[Yp(hg,{question:i,forceDisableHtml:r}),Yp("div",{className:"rating-section",children:[Yp("div",{className:"rating-options",children:["emoji"===i.display&&Yp("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=xg[i.scale])?void 0:e.map(((t,e)=>Yp("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),i.skipSubmitButton&&y(t)},children:t},e)))}),"number"===i.display&&Yp("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:Cg(i.scale).map(((t,e)=>Yp(bg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e)))})]}),!g&&Yp("div",{className:"rating-text",children:[Yp("div",{children:i.lowerBoundLabel}),Yp("div",{children:i.upperBoundLabel})]})]})]}),Yp(ug,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:ht(f)&&!i.optional,appearance:s,onSubmit:()=>a(f),onPreviewSubmit:()=>o(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function bg(t){var e=t.num,i=t.setActiveNumber;return Yp("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){i(e)},children:e})}function _g(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,n=t.appearance,s=t.onSubmit,a=t.onPreviewSubmit,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=cf(null),d=ff((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=Dp(e,Lp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),v=df((()=>((t,e)=>lt(t)||pg(t)?t:e===Af.SingleChoice?null:[])(o,e.type))),c=v[0],f=v[1],g=df((()=>((t,e)=>{if(lt(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(pg(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(o,d))),m=g[0],y=g[1],b=Bp().isPreviewMode,_=e.type===Af.SingleChoice,w=e.type===Af.MultipleChoice,k=e.skipSubmitButton&&_&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>p({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),_&&f(""),void(i&&setTimeout((()=>{var t;return null==(t=h.current)?void 0:t.focus()}),75))}if(_)return f(t),y((t=>p({},t,{isSelected:!1,inputValue:""}))),void(k&&(s(t),b&&a(t)));w&&rt(c)&&(c.includes(t)?f(c.filter((e=>e!==t))):f([...c,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>p({},t,{inputValue:e}))),_&&f(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),M()),"Escape"===t.key&&(t.preventDefault(),y((t=>p({},t,{isSelected:!1,inputValue:""}))),_&&f(null))},T=()=>!(e.optional||!ht(c)&&(!rt(c)||m.isSelected||0!==c.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?rt(c)&&(b?a([...c,m.inputValue]):s([...c,m.inputValue])):b?a(c):s(c)};return Yp(Ic,{children:[Yp("div",{className:"question-container",children:[Yp(hg,{question:e,forceDisableHtml:i}),Yp("fieldset",{className:"multiple-choice-options limit-height",children:[Yp("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),d.map(((t,i)=>{var n=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+r+"Choice"+i,a=s+"Open",o=n?m.isSelected:_?c===t:rt(c)&&c.includes(t);return Yp("label",{className:n?"choice-option-open":"",children:[Yp("div",{className:"response-choice",children:[Yp("input",{type:_?"radio":"checkbox",name:s,checked:o,onChange:()=>S(t,n),id:s,"aria-controls":a}),Yp("span",{children:n?t+":":t})]}),n&&Yp("input",{type:"text",ref:h,id:a,name:"question"+r+"Open",value:m.inputValue,onKeyDown:C,onInput:x,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)}))]})]}),Yp(ug,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:l,onBack:u})]})}var wg=[1,2,3,4,5],kg=[1,2,3,4,5,6,7],Sg=[0,1,2,3,4,5,6,7,8,9,10],xg={2:[ng,sg],3:[eg,tg,Xp],5:[ig,eg,tg,Xp,rg]};function Cg(t){switch(t){case 5:default:return wg;case 7:return kg;case 10:return Sg}}var Tg=Bi("[Surveys]");function Mg(t,e,i){var r,n=t.questions[e],s=e+1;if(null==(r=n.branching)||!r.type)return e===t.questions.length-1?Ff.End:s;if(n.branching.type===Ff.End)return Ff.End;if(n.branching.type===Ff.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Ff.ResponseBased){if(n.type===Af.SingleChoice){var a,o=n.choices.indexOf(""+i);if(-1===o&&n.hasOpenChoice&&(o=n.choices.length-1),null!=(a=n.branching)&&null!=(a=a.responseValues)&&a.hasOwnProperty(o)){var l=n.branching.responseValues[o];return Number.isInteger(l)?l:l===Ff.End?Ff.End:s}}else if(n.type===Af.Rating){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(i,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===Ff.End?Ff.End:s}}return s}return Tg.warn("Falling back to next question index due to unexpected branching type"),s}var Eg=Bi("[SurveyTranslations]");function Ig(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=co(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?co(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var a=co(r);return a?(null==e||e.info("Using detected locale: "+a),a):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:nt(t.get_property)?t.get_property(Xn):void 0,locale:Bo()},Eg)}(e);if(!i)return Eg.info("No user language detected"),{survey:t,language:null};var r=mo(t,i,Eg);return{survey:r.survey,language:r.matchedKey}}var Rg=-1,Pg=t,Ag=r,Fg="ph:show_survey_widget",Og="PHWidgetSurveyClickListener";function Lg(t,e){try{var i=t.getBoundingClientRect(),r=Pg.innerHeight,n=Pg.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var a=r-i.bottom,o=250>a&&i.top>a;return{position:"fixed",top:o?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:o?r-i.top+12+"px":"auto",zIndex:Tp.zIndex}}catch(t){return Nf.warn("Failed to calculate trigger position:",t),null}}class Dg{constructor(t){var e=this;this.Vr=new Map,this.Zr=new Map,this.Gr=new Map,this.Qr=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(is);if(t)for(var e of t)Gp(e)&&Op(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var n,s,a,o,l,u=(void 0===r?{}:r).resumeDelayFromActivation,h=void 0!==u&&u,d=e.Jr(t),v=d.survey,c=d.language,f=null!=i&&i.position||null!=i&&i.selector?p({},v,{appearance:p({},v.appearance,i.position&&{position:i.position},i.selector&&{widgetSelector:i.selector})}):v;e.Yr(f.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.Kr(f,y,m,c);if(!b||null!=(n=f.appearance)&&n.displayThankYouMessage){e.Xr(f);var _={};if((null==(s=f.appearance)?void 0:s.position)===If.NextToTrigger&&null!=(a=f.appearance)&&a.widgetSelector){var w,k=Ag.querySelector(f.appearance.widgetSelector);k&&(_=Lg(k,parseInt((null==(w=f.appearance)?void 0:w.maxWidth)||Tp.maxWidth))||{})}var S=(null==(o=f.appearance)?void 0:o.surveyPopupDelaySeconds)||0,x=Rp(f,e._posthog).shadow;e.Gr.set(x,x.host);var C={posthog:e._posthog,survey:f,removeSurveyFromFocus:e.ei,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:c};if(0>=S)return Qc(Yp(Bg,p({},C)),x);var T=()=>{if(!e.ti(f))return Nf.info("Survey "+f.id+" no longer eligible when its display delay elapsed; not displaying"),e.ei(f);Qc(Yp(Bg,p({},C,{survey:p({},f,{appearance:p({},f.appearance,{surveyPopupDelaySeconds:0})})})),x)},M=h?null==(l=e._posthog.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(f.id):void 0,E=vt(M)?Math.max(0,Date.now()-M):0,I=Math.max(0,1e3*S-E);if(0>=I)return T();var R=Pg.setTimeout((()=>{e.Vr.delete(f.id),T()}),I);e.Vr.set(f.id,R)}},this.ri=t=>{var e=this.Jr(t),i=e.survey,r=e.language,n=Rp(i,this._posthog),s=n.shadow,a=n.isNewlyCreated;this.Gr.set(s,s.host),a&&Qc(Yp(Ug,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.ii=t=>{var e=this.Zr.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Og),this.Zr.delete(t),Nf.info("Removed click listener for survey "+t))},this.ni=t=>{this.ai(t)||(this.oi(t),this.ii(t.id))},this.ai=t=>{try{var e,i=Ag.querySelector(Qp(t,!0));return!(null==i||null==(e=i.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.si=(t,e)=>{var i=Ag.querySelector(e),r=this.Zr.get(t.id);if(i){if(this.ri(t),r){if(i===r.element)return;Nf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.ii(t.id)}if(!i.hasAttribute(Og)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===If.NextToTrigger?Lg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||Tp.maxWidth)):{};Pg.dispatchEvent(new CustomEvent(Fg,{detail:{surveyId:t.id,position:n}}))};Ki(i,"click",n),i.setAttribute(Og,"true"),this.Zr.set(t.id,{element:i,listener:n,survey:t}),Nf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.ni(t)},this.renderPopover=t=>{var e=this.Jr(t),i=e.survey,r=e.language,n=Rp(i,this._posthog).shadow;this.Gr.set(n,n.host),Qc(Yp(Bg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.ei,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.Jr(t),s=n.survey,a=n.language,o=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(o=this.ui(s,a,i)),Qc(Yp(Bg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.ei,isPopup:!1,properties:i,isSurveyCompleted:o,surveyLanguage:a}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys((i=>{var r=i.filter((t=>e.ti(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===Pf.Popover||t.type===Pf.Widget)),r=new Set(i.map((t=>t.id)));for(var n of Array.from(e.Vr.keys()))r.has(n)||e.cancelSurvey(n);var s=e.li(i),a=new Set;s.forEach((t=>{if(t.type===Pf.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===Ef.Tab)return void e.ri(t);(null==(r=t.appearance)?void 0:r.widgetType)===Ef.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),e.si(t,null==(s=t.appearance)?void 0:s.widgetSelector))}ht(e.ci)&&t.type===Pf.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.Zr.forEach((t=>{var i=t.survey;a.has(i.id)||e.ni(i)}))}),t)},this.Xr=t=>{ht(this.ci)||Nf.error("Survey "+this.ci+" already in focus. Cannot add survey "+t.id+"."),this.ci=t.id},this.ei=t=>{this.ci!==t.id&&Nf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Yr(t.id),this.ci=null,this.oi(t)},this._posthog=t,this.ci=null}get hi(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,Zf))&&void 0!==t?t:this._posthog.featureFlags}Yr(t){var e=this.Vr.get(t);e&&(clearTimeout(e),this.Vr.delete(t))}cancelSurvey(t){this.Vr.has(t)&&(Nf.info("Cancelled pending survey "+t),this.Yr(t),this.ci===t&&(this.ci=null))}setAutomaticDisplayDispose(t){this.di=t}dispose(){var t;null==(t=this.di)||t.call(this),this.di=void 0,this.Vr.forEach(((t,e)=>this.Yr(e))),this.Zr.forEach(((t,e)=>this.ii(e))),this.Gr.forEach(((t,e)=>{Qc(null,e),null==t||t.remove()})),this.Gr.clear(),this.ci=null}li(t){return t.sort(((t,e)=>{var i,r,n=Gp(t),s=Gp(e);if(n&&!s)return-1;if(!n&&s)return 1;var a=t.schedule===Of,o=e.schedule===Of;return a&&!o?1:!a&&o?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}Jr(t){return Ig(t,this._posthog)}ui(t,e,i){if(this.Qr.has(t.id))return!1;var r=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};var n=r.split("&");for(var s of n){var a=s.split("="),o=a[0],l=a[1];if(o&&!ot(l)){var u=decodeURIComponent(o),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var v=parseInt(d[1],10);e[v]||(e[v]=[]),e[v].push(h)}}else i=!0}}return{params:e,autoSubmit:i}}(Pg.location.search),n=r.params;if(0===Object.keys(n).length)return!1;Nf.info("[Survey Prefill] Detected URL prefill parameters");var s=this.vi(t,n,e);return!!s&&(this.fi(t,s,i,e),this.Qr.add(t.id),s.isSurveyCompleted)}fi(t,e,i,r){var n=e.responses,s=e.submissionId,a=e.isSurveyCompleted,o=e.skippedResponses;(Object.keys(o).length>0&&t.enable_partial_responses||a)&&Pp({responses:a?n:o,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:a,properties:i,surveyLanguage:r})}Kr(t,e,i,r){var n={};for(var s of Object.entries(e)){var a=s[1];n[parseInt(s[0])]=rt(a)?a.map(String):[String(a)]}Nf.info("[Survey] Processing initial responses");var o=this.vi(t,n,r);return!!o&&(this.fi(t,o,i,r),o.isSurveyCompleted)}vi(t,e,i){try{var r=function(t,e){var i={};return t.questions.forEach(((t,r)=>{if(e[r]&&t.id){var n=e[r],s=lo(t.id);try{switch(t.type){case Af.SingleChoice:if(!t.choices||0===t.choices.length)return void ji.warn("[Survey Prefill] Question "+r+" has no choices");var a=parseInt(n[0],10);if(isNaN(a)||0>a||a>=t.choices.length)return void ji.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[a];break;case Af.MultipleChoice:if(!t.choices||0===t.choices.length)return void ji.warn("[Survey Prefill] Question "+r+" has no choices");var o=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===o.length)return void ji.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(o.map((e=>t.choices[e])))];o.length>l.length&&ji.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case Af.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void ji.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:ji.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){ji.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(r).length)return Nf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=ep(),s=Object.keys(e).map((t=>parseInt(t,10))),a=function(t,e,i){for(var r=0,n={},s=[],a=t.questions.length+1,o=0;t.questions.length>r&&a>o&&(o++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=lo(l.id);ot(i[u])||(n[u]=i[u])}s.push(r);var h=Mg(t,r,l.id?i[lo(l.id)]:null);if(h===Ff.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,s,r),o=a.startQuestionIndex,l=a.skippedResponses,u=a.skippedIndices,h=o>=t.questions.length;return Wp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:$p(t.questions),visitedIndices:u,surveyLanguage:i}),Nf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:h,skippedResponses:l}}catch(t){return Nf.error("[Survey Prefill] Error handling prefill:",t),null}}pi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.hi,r=!(null==i||!i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),n=!0;return e&&(n=(null==i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),r&&n}gi(e){return!e.conditions||Up(e,this._posthog)&&function(e){var r,n;return function(e,r){var n,s,a;if(!e||0===e.length)return!0;if(!u)return!1;var o=Ae(u,{userAgentDataPlatform:null==i||null==(n=i.userAgentData)?void 0:n.platform,maxTouchPoints:null==i?void 0:i.maxTouchPoints,screenWidth:null==t||null==(s=t.screen)?void 0:s.width,screenHeight:null==t||null==(a=t.screen)?void 0:a.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio});return ko[null!=r?r:"icontains"](e,[o])}(null==(r=e.conditions)?void 0:r.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}(e)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==xp||!xp.querySelector(t.conditions.selector))}(e)}mi(t){var e;return qp(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this.hi)&&e.hasLoadedFlags?{satisfied:this.pi(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,i,r={eligible:!0,reason:void 0};if(!qf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Vf.includes(t.type))return r.eligible=!1,r.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",r;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.pi(t.linked_flag_key,n))return r.eligible=!1,r.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",r;if(!this.pi(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,a=this.mi(t);return a.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=new Date,n=Math.abs(r.getTime()-i.getTime());return Math.ceil(n/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,op.Ur("lastSeenSurveyDate"))?(t=>!!op.Ur(zf(t))&&!qp(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(s=a.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.yi(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}yi(t){var e;if(!yo(t)&&!jf(t))return!0;var i=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==i||!i.includes(t.id))}bi(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.pi(e)}))}ti(t){return this.checkSurveyEligibility(t).eligible&&this.gi(t)&&this.yi(t)&&this.bi(t)}oi(t){try{var e=Ag.querySelector(Qp(t,!0));null!=e&&e.shadowRoot&&(Qc(null,e.shadowRoot),this.Gr.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Nf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Xr,removeSurveyFromFocus:this.ei,surveyInFocus:this.ci,surveyTimeouts:this.Vr,handleWidget:this.ri,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.si,sortSurveysByAppearanceDelay:this.li,checkFlags:this.bi.bind(this),isSurveyFeatureFlagEnabled:this.pi.bind(this)}}}function $g(t,e){if(Ag&&Pg){var i,r=new Dg(t);if(t.config.disable_surveys_automatic_display)return Nf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Nf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ot(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},s=()=>{ot(i)||(clearInterval(i),i=void 0)};n();var a=()=>{Ag.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return Ki(Ag,"visibilitychange",a),r.setAutomaticDisplayDispose((()=>{s(),Ag.removeEventListener("visibilitychange",a)})),r}}function Ng(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,a=void 0!==s&&s,o=t.posthog;vf((()=>{var t;if(!a&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===Pf.Widget,s=Up(e,o),a=(null==(t=e.appearance)?void 0:t.widgetType)===Ef.Tab&&i;if(!s)return Nf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);a&&(Nf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Ki(Pg,"popstate",i),Ki(Pg,"hashchange",i);var s=Pg.history.pushState,l=Pg.history.replaceState;return Pg.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.apply(this,e),i()},Pg.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];l.apply(this,e),i()},()=>{Pg.removeEventListener("popstate",i),Pg.removeEventListener("hashchange",i),Pg.history.pushState=s,Pg.history.replaceState=l}}}),[a,e,r,n,o])}var qg=200;function jg(t){switch(void 0===t&&(t=Rf.Right),t){case Rf.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Rf.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Rf.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Bg(t){var e,i,r,n,s,a,o,l,u,h,d,v,c=t.survey,f=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,b=t.previewPageIndex,_=t.removeSurveyFromFocus,w=void 0===_?()=>{}:_,k=t.isPopup,S=void 0===k||k,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,T=t.onPreviewBack,M=void 0===T?()=>{}:T,E=t.onPopupSurveyDismissed,I=void 0===E?()=>{}:E,R=t.onCloseConfirmationMessage,P=void 0===R?()=>{}:R,A=t.properties,F=t.isSurveyCompleted,O=t.skipShownEvent,L=t.surveyLanguage,D=cf(null),N=Number.isInteger(b),q=null!=(e=c.appearance)&&e.surveyPopupDelaySeconds?1e3*c.appearance.surveyPopupDelaySeconds:0,j=function(t,e,i,r,n,s,a,o,l){var u=df(r||0===i||t.type===Pf.ExternalSurvey),h=u[0],d=u[1],v=df(!1),c=v[0],f=v[1],g=cf(!1),m=()=>{var e=()=>{s&&n(t),d(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+qg+"ms ease-out",i.style.opacity="0",setTimeout((()=>{g.current=!1,e()}),qg+50)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return vf((()=>{if(e){if(!r){var n,s=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return m();f(!0),null!=(r=t.appearance)&&r.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},a=()=>{if(Up(t,e)){d(!0),Pg.dispatchEvent(new Event("PHSurveyShown")),o||e.capture(Lf.SHOWN,p({[Df.SURVEY_NAME]:t.name,[Df.SURVEY_ID]:t.id,[Df.SURVEY_ITERATION]:t.current_iteration,[Df.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[Df.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};Ki(Pg,"PHSurveyClosed",y),Ki(Pg,"PHSurveySent",s);var u=i>0?setTimeout(a,i):void 0;return ot(u)&&a(),()=>{ot(u)||clearTimeout(u),ot(n)||clearTimeout(n),Pg.removeEventListener("PHSurveyClosed",y),Pg.removeEventListener("PHSurveySent",s)}}}else Nf.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Ng({survey:t,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:r,posthog:e}),{isPopupVisible:h,isSurveySent:c,setIsPopupVisible:d,hidePopupWithAnimation:m}}(c,g,q,N,w,S,D,O,L),B=j.isPopupVisible,H=j.hidePopupWithAnimation,U=j.isSurveySent||b===c.questions.length||!0===F,z=df(!1),W=z[0],V=z[1],G=ff((()=>!!Vp(c)),[c]),Z=!!(null!=(i=c.appearance)&&i.introScreenHeader||null!=(r=c.appearance)&&r.introScreenDescription),Q=N?b===Rg:!(null==(n=c.appearance)||!n.displayIntroScreen)&&Z&&!W&&!G,J=ff((()=>{var t=Vp(c),e=(null==t?void 0:t.surveySubmissionId)||ep();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){L?Fp(c,g,N,L):Fp(c,g,N),I()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:M,posthog:g,properties:A,surveyLanguage:L}}),[N,b,S,g,c,I,C,M,A,L]);return B?Yp(jp.Provider,{value:J,children:Yp("div",{className:"ph-survey",style:p({},Jp(c.type,null==(s=c.appearance)?void 0:s.position,null==(a=c.appearance)?void 0:a.widgetType),y),ref:D,children:U?Yp(cg,{header:(null==(o=c.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(l=c.appearance)?void 0:l.thankYouMessageDescription)||"",forceDisableHtml:!!f,contentType:null==(u=c.appearance)?void 0:u.thankYouMessageDescriptionContentType,appearance:c.appearance||Tp,onClose(){H(),P()}}):Q?Yp(fg,{header:(null==(h=c.appearance)?void 0:h.introScreenHeader)||"",description:(null==(d=c.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!f,contentType:null==(v=c.appearance)?void 0:v.introScreenDescriptionContentType,appearance:c.appearance||Tp,onStart:()=>V(!0)}):Yp(Hg,{survey:c,forceDisableHtml:!!f,posthog:g})})}):null}function Hg(t){var e,i,r=t.survey,n=t.forceDisableHtml,s=t.posthog,a=ff((()=>{var t=Vp(r);if(!t)return null;var e=vt(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Zp(r),null)}),[r]),o=df((()=>(null!=a&&a.responses&&Nf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{}))),l=o[0],u=o[1],h=pf(jp),d=h.previewPageIndex,v=h.onPopupSurveyDismissed,c=h.isPopup,f=h.onPreviewSubmit,g=h.onPreviewBack,m=h.surveySubmissionId,y=h.isPreviewMode,b=h.properties,_=h.surveyLanguage,w=df((()=>{var t=null==a?void 0:a.lastQuestionIndex,e=vt(t)&&t>=0&&r.questions.length>t?t:0;return vt(d)&&d>=0?d:e})),k=w[0],S=w[1],x=df((()=>{var t;return(null!==(t=null==a?void 0:a.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&r.questions.length>t))})),C=x[0],T=x[1],M=ff((()=>Np(r,a)),[r,a]);vf((()=>{!y||ot(d)||0>d||S(d)}),[d,y]);var E=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=d?d:0)>0:C.length>0),I=M.at(k);return I?Yp("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&Yp(dg,{onClick(){v()}}),Yp("div",{className:"survey-box","data-question-index":k,children:zg({question:I,forceDisableHtml:n,displayQuestionIndex:k,appearance:r.appearance||Tp,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,n=t.questionId;if(s)if(n){var a=lo(n),o=p({},l,{[a]:e});u(o);var h=Mg(r,i,e),d=h===Ff.End,v=[...C,i];if(d||(T(v),S(h),Wp(r,{surveySubmissionId:m,responses:o,lastQuestionIndex:h,questionOrder:$p(M),visitedIndices:v,surveyLanguage:_})),r.enable_partial_responses||d){var c=new Set(v.map((t=>{var e;return null==(e=M[t])?void 0:e.id})).filter((t=>!!t)).map((t=>lo(t)))),f=Object.fromEntries(Object.entries(o).filter((t=>c.has(t[0]))));Pp({responses:f,survey:r,surveySubmissionId:m,isSurveyCompleted:d,posthog:s,properties:b,surveyLanguage:_})}}else Nf.error("onNextButtonClick called without a questionId.");else Nf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:I.id}),onPreviewSubmit:f,initialValue:I.id?l[lo(I.id)]:void 0,canGoBack:E,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),Wp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:t,questionOrder:$p(M),visitedIndices:e,surveyLanguage:_})}}})})]}):null}function Ug(t){var e,i,r,n,s,a,o,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=df(!0),f=c[0],p=c[1],g=df(!1),m=g[0],y=g[1],b=df({}),_=b[0],w=b[1],k=cf(void 0),S=()=>{y(!m)};if(vf((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(Nf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return Ki(Pg,Fg,e),()=>{ot(k.current)||(clearTimeout(k.current),k.current=void 0),Pg.removeEventListener(Fg,e)}}}else Nf.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),Ng({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==Of&&p(!1),ot(k.current)||clearTimeout(k.current),k.current=setTimeout((()=>{k.current=void 0,y(!1)}),200)};return Yp(Ic,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Yp("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Rf.Top?"widget-tab-top":""),onClick:S,disabled:d,style:jg(null==(a=l.appearance)?void 0:a.tabPosition),children:(null==(o=l.appearance)?void 0:o.widgetLabel)||""}),m&&Yp(Bg,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var zg=t=>{var e=t.question,i=t.onSubmit,r=t.onPreviewSubmit,n={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){r(t)},onSubmit(t){i(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case Af.Open:return Mc(gg,p({},n,{question:e,key:e.id}));case Af.Link:return Mc(mg,p({},n,{question:e,key:e.id}));case Af.Rating:return Mc(yg,p({},n,{question:e,key:e.id}));case Af.SingleChoice:case Af.MultipleChoice:return Mc(_g,p({},n,{question:e,key:e.id}));default:return Nf.error("Unsupported question type: "+e.type),null}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.generateSurveys=$g,v.extendPostHogWithSurveys=$g;var Wg=(t,e,i)=>i.remaining>0?e.length>i.remaining?(t.push(e.slice(0,i.remaining)),i.remaining=0,i.truncated=!0,!1):(t.push(e),i.remaining-=e.length,!0):(i.truncated=!0,!1),Vg=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return Wg(e,r,i);if(i.truncated=!0,2>i.remaining)return!1;for(var n=0,s=Math.min(t.length,i.remaining-2);s>n;){var a=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,a)).length>i.remaining?s=a-1:n=a}return Wg(e,JSON.stringify(t.slice(0,n)),i)},Gg=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Zg=(t,e,i)=>{if(!i.truncated){if(i.keysRemaining-=1,i.sizeRemaining-=String(e).length+t.length,0>=i.keysRemaining||0>=i.sizeRemaining)return i.truncated=!0,void(i.result.attributes_truncated=!0);i.result[t]=e}},Qg=(t,e,i)=>{if(!i.truncated)if(st(t)){if(i.seen.has(t))return void Zg(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(Qg(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Zg(e,t,i)},Jg=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Gg(t))return!n||Wg(e,"null",i);if(ht(t)||(t=>{try{return vt(t)||ft(t)}catch(t){return!1}})(t))return Wg(e,JSON.stringify(t),i);if("string"==typeof t)return Vg(t,e,i);if(!st(t)&&!rt(t))return Wg(e,JSON.stringify(t),i);if(r.has(t))return Vg("[Circular]",e,i);r.add(t);try{var a=t.toJSON;if(nt(a))return Jg(a.call(t),e,i,r,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return Vg(String(t.valueOf()),e,i);if("[object Number]"===o||"[object Boolean]"===o)return Wg(e,JSON.stringify(t.valueOf()),i)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return Jg(l,e,i,r,n,s)}if(rt(t)){if(!Wg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Wg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Jg(d,e,i,r,!0))return!1}return Wg(e,"]",i)}if(!Wg(e,"{",i))return!1;var v=!0;try{for(var c in t)if({}.hasOwnProperty.call(t,c)){if(0>=i.remaining)return i.truncated=!0,!1;var f=void 0;try{f=t[c]}catch(t){continue}if(s)try{Qg(f,c,s)}catch(t){}if(Gg(f)){var p=(v?"":",")+JSON.stringify(c)+":";if(p.length>=i.remaining)return i.truncated=!0,!1;var g=e.length,m=i.remaining,y=i.truncated;if(!Wg(e,p,i))return!1;var b=e.length,_=Jg(f,e,i,r,!1),w=i.truncated;if(e.length!==b){if(v=!1,!_)return!1}else if(e.length=g,i.remaining=m,i.truncated=_?y:w,!_)return!1}}}catch(t){}return Wg(e,"}",i)},Kg={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},Yg=t=>"canCapture"in t;v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.logs={initializeLogs(t){var e=t,i=[],r={host:v.location.host},n=!1,s=function(t){var s=v.console[t],a=(i=>function(){for(var s=!1,a=arguments.length,o=new Array(a),l=0;a>l;l++)o[l]=arguments[l];try{var u=e;if(o.length>0&&!n&&u){var h=(t=>Yg(t)?t.canCapture?t.getExtension(Qf):void 0:t.is_capturing()?t.logs:void 0)(u);if(h){n=!0,s=!0;var d=((t,e)=>{for(var i=[],r={remaining:1e4,truncated:!1},n=st(t[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||Wg(i," ",r))&&Jg(t[s],i,r,new WeakSet,!1,0===s?n:void 0);s++);return{body:i.join("")+(r.truncated?"...":""),truncated:r.truncated,attributes:(null==n?void 0:n.result)||{}}})(o),c=d.body,f=d.attributes,g=p({},r,d.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(Yg(t))e.captureConsoleLog(i);else{var r=(t=>{var e=/^1\.(\d+)\.(\d+)$/.exec(t);if(e){var i=Number(e[1]),r=Number(e[2]);if(i>=392&&419>=i)return 410===i?r>4?r>10?void 0:"de":"le":418===i?r>3?r>10?r>14?r>17?void 0:"vi":"ci":"ui":"he":419===i?r>2?void 0:"vi":410>i?"le":"he"}})(t.version),n=r?e[r]:void 0;nt(n)&&n.call(e,i)}})(u,h,{level:Kg[t],body:c,attributes:p({"log.source":"console."+t},g,f)})}}}catch(t){}finally{s&&(n=!1),i.apply(v.console,o)}})(s);a.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(s),v.console[t]=a,i.push((()=>{v.console[t]===a&&(v.console[t]=s)}))};for(var a of Object.keys(Kg))s(a);return()=>{e=void 0,i.forEach((t=>t()))}}};var Xg=Bi("[Error tracking]"),tm=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],em=["__firefox__","__gCrWeb"];function im(){return new oi([new _i,new Ri,new ki,new wi,new Ei,new Mi,new xi,new Ii],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];return function(e,r){void 0===r&&(r=0);for(var n=[],s=e.split("\n"),a=r;s.length>a;a++){var o=s[a];if(1024>=o.length){var l=yi.test(o)?o.replace(yi,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,t);if(h){n.push(h);break}}if(n.length>=bi)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,bi).map((t=>{return p({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||li});var i}))}(n)}}("web:javascript",fi,mi))}var rm=Bi("[ExceptionAutocapture]"),nm=im(),sm=e=>{var i=t;i||rm.info("window not available, cannot wrap onerror");var r=i.onerror;return i.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var a=nm.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(lt(e)&&lt(i)&&i.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:i,lineno:r,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}});return e(a),!!nt(r)&&null!==(t=r(...n))&&void 0!==t&&t},i.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=i.onerror)||delete t.__POSTHOG_INSTRUMENTED__,i.onerror=r}},am=function(e,i){void 0===i&&(i=!1);var r=t;r||rm.info("window not available, cannot wrap onUnhandledRejection");var n=r.onunhandledrejection;return r.onunhandledrejection=function(t){var r,s=nm.buildFromUnknown(t,{mechanism:{handled:!1}});return e(s),nt(n)?null!==(r=n(t))&&void 0!==r&&r:i},r.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=r.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,r.onunhandledrejection=n}},om={wrapOnError:sm,wrapUnhandledRejection:am,wrapConsoleError(t){var e=console;e||rm.info("console not available, cannot wrap console.error");var i=e.error;return e.error=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var a=n.find((t=>t instanceof Error)),o=nm.buildFromUnknown(a||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(o),nt(i)&&i(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=i}}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.errorWrappingFunctions=om,v.posthogErrorWrappingFunctions=om;var lm=(t,e)=>{if(nt(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!ht(i)&&"object"==typeof i&&rt(i.errors_to_ignore)?i.errors_to_ignore.reduce(((t,e)=>{try{t.push(new RegExp(e))}catch(t){rm.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t}),[]):[],n=e=>{try{null==t.capture||t.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){rm.error("Failed to capture exception for a legacy client",t)}};sm((t=>{r.some((e=>t.$exception_list.some((t=>e.test(t.value||"")))))||n(t)})),am(n,!0)}};v.extendPostHogWithExceptionAutoCapture=lm,v.extendPostHogWithExceptionAutocapture=lm;var um="X-POSTHOG-SESSION-ID",hm="X-POSTHOG-WINDOW-ID",dm="X-POSTHOG-DISTINCT-ID",vm=[um,hm,dm],cm=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],fm=(t,e)=>({}.hasOwnProperty.call(t,e)),pm=t=>"object"==typeof t&&!ht(t)||nt(t),gm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),mm=e=>{try{var i;return gm(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==t||null==(i=t.location)?void 0:i.href).toString()}catch(t){return}},ym=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(rt(t)&&!t.includes(s))return!1;var a=!1;if(i){var o=i.checkAndGetSessionAndWindowId(!0),l=o.windowId;n.set(um,o.sessionId),n.set(hm,l),a=!0}var u=(t=>nt(t)?t():t)(e);return u&&u!==bs&&(n.set(dm,u),a=!0),a};v.__PosthogExtensions__=v.__PosthogExtensions__||{};var bm={_patchFetch:(e,i,r)=>Fv(t,"fetch",(t=>function(n,s){var a=arguments.length>1?[n,s]:[n],o=a;try{var l=mm(n);if(l)if(gm(n)){var u=new Request(n,s);ym(e,i,r,u.url,u.headers),o=[u]}else{var h=new Headers(pm(s)?s.headers:void 0);if(ym(e,i,r,l,h)){var d=((t,e)=>{if(ot(t)||ht(t))return{headers:e};if(pm(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var r=Object.create(i);return Object.defineProperty(r,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),r}return new Proxy({headers:e},{get:(t,e)=>fm(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>fm(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),cm.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var r=Reflect.getOwnPropertyDescriptor(t,e);if(r)return r;if("string"==typeof e&&cm.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var n=Reflect.getOwnPropertyDescriptor(i,e);return n?p({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(s,h);d&&(o=[n,d])}}}catch(t){o=a}return t.apply(this,o)})),_patchXHR:(e,i,r)=>Fv(t.XMLHttpRequest.prototype,"open",(t=>function(n,s,a,o,l){void 0===a&&(a=!0);var u=this,h=new Headers,d=mm(s);d&&ym(e,i,r,d,h);var v=t.call(u,n,s,a,o,l);return vm.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),v}))};v.__PosthogExtensions__.tracingHeadersPatchFns=bm,v.postHogTracingHeadersPatchFns=bm,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,i=Math.trunc(t)||0;return 0>i&&(i+=e),0>i||i>=e?void 0:this[i]},writable:!0,enumerable:!1,configurable:!0});let _m=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var wm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},km=t=>{if("loading"===document.readyState)return"loading";var e=wm();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Sm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},xm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Sm(n),...Array.from(null!==(r=n.classList)&&void 0!==r?r:[]).sort()].join(".");if(e.length+s.length>99)return e||s;if(e=e?s+">"+e:s,n.id)break;t=n.parentNode}}catch(t){}return e},Cm=new WeakMap;function Tm(t,e){var i=Cm.get(e);return i||(i=new WeakMap,Cm.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var Mm=-1,Em=()=>Mm,Im=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Mm=e.timeStamp,t(e))}),!0)},Rm=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},Pm=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Am=()=>{var t,e;return null!==(t=null==(e=wm())?void 0:e.activationStart)&&void 0!==t?t:0},Fm=-1,Om=new Set,Lm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Dm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Om)e();isFinite(Fm)||(Fm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Dm,!0))}},$m=function(t){if(void 0===t&&(t=!1),t&&(Fm=1/0),0>Fm){var e,i=Am(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;Fm=null!=r?r:Lm(),addEventListener("visibilitychange",Dm,!0),addEventListener("prerenderingchange",Dm,!0),Im((()=>{setTimeout((()=>{Fm=Lm()}))}))}return{get firstHiddenTime(){return Fm},onHidden(t){Om.add(t)}}},Nm=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=wm(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Em()?o&&(document.prerendering||Am()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==o?void 0:o.name),navigationStartTime:a||0}},qm=function(t,e,i){void 0===i&&(i={});try{var r=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(r.length>0){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{var i=t.getEntries();r.length>1&&i.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(i)}))}));for(var s of r)n.observe(p({type:s,buffered:!0},i));return n}}catch(t){}},jm=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Bm=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Hm=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let Um=class{constructor(){this.u=void 0}};var zm,Wm=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Vm=[1800,3e3],Gm=function(t,e){void 0===e&&(e={});var i=jm(e);Wm((()=>{var r,n=Tm(e,Um),s=$m(),a=Nm("FCP"),o=qm(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-Am(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=Rm(t,a,Vm,e.reportAllChanges),Im((i=>{a=Nm("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Em()),r=Rm(t,a,Vm,e.reportAllChanges),Pm((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&qm(["soft-navigation"],(i=>{i.forEach((i=>{n.u&&i.navigationId&&Bm(n.u,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=Nm("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Rm(t,a,Vm,e.reportAllChanges))(!0)}))}),e)}))},Zm=[.1,.25],Qm=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],Jm=0,Km=1/0,Ym=0,Xm=t=>{for(var e of t)e.interactionId&&(Km=Math.min(Km,e.interactionId),Ym=Math.max(Ym,e.interactionId),Jm=Ym?(Ym-Km)/7+1:0)},ty=()=>{var t;return zm?Jm:null!==(t=performance.interactionCount)&&void 0!==t?t:0},ey=0;let iy=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){ey=ty(),this.h.length=0,this.v.clear()}T(t){var e=ty()-ey,i=Math.min(this.h.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.h[i]:{D:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.h.at(-1),r=this.v.get(t.interactionId);if(r||10>this.h.length||t.duration>i.D){var n;if(r?t.duration>r.D?(r.entries=[t],r.D=t.duration):t.duration===r.D&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.v.set((r={id:t.interactionId,entries:[t],D:t.duration}).id,r),this.h.push(r)),this.h.sort(((t,e)=>e.D-t.D)),this.h.length>10){var s=this.h.splice(10);for(var a of s)this.v.delete(a.id)}null==(n=this.m)||n.call(this,r)}}}};var ry=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Hm(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},ny=[200,500];let sy=class{constructor(){this.p=void 0,this.u=void 0}l(t){var e;null==(e=this.p)||e.call(this,t)}};var ay=[2500,4e3],oy=-1,ly=()=>oy,uy=t=>{addEventListener("pageshow",(e=>{e.persisted&&(oy=e.timeStamp,t(e))}),!0)},hy=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},dy=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},vy=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},cy=()=>{var t,e;return null!==(t=null==(e=vy())?void 0:e.activationStart)&&void 0!==t?t:0},fy=-1,py=new Set,gy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,my=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of py)e();isFinite(fy)||(fy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",my,!0))}},yy=function(t){if(void 0===t&&(t=!1),t&&(fy=1/0),0>fy){var e,i=cy(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;fy=null!=r?r:gy(),addEventListener("visibilitychange",my,!0),addEventListener("prerenderingchange",my,!0),uy((()=>{setTimeout((()=>{fy=gy()}))}))}return{get firstHiddenTime(){return fy},onHidden(t){py.add(t)}}},by=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=vy(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>ly()?o&&(document.prerendering||cy()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==o?void 0:o.name),navigationStartTime:a||0}},_y=new WeakMap;function wy(t,e){var i=_y.get(e);return i||(i=new WeakMap,_y.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}let ky=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}};var Sy=function(t,e,i){void 0===i&&(i={});try{var r=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(r.length>0){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{var i=t.getEntries();r.length>1&&i.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(i)}))}));for(var s of r)n.observe(p({type:s,buffered:!0},i));return n}}catch(t){}},xy=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Cy=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Ty=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let My=class{constructor(){this.l=void 0}};var Ey,Iy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Ry=[1800,3e3],Py=function(t,e){void 0===e&&(e={});var i=xy(e);Iy((()=>{var r,n=wy(e,My),s=yy(),a=by("FCP"),o=Sy(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-cy(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=hy(t,a,Ry,e.reportAllChanges),uy((i=>{a=by("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,ly()),r=hy(t,a,Ry,e.reportAllChanges),dy((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Sy(["soft-navigation"],(i=>{i.forEach((i=>{n.l&&i.navigationId&&Cy(n.l,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=by("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=hy(t,a,Ry,e.reportAllChanges))(!0)}))}),e)}))},Ay=[.1,.25],Fy=function(t,e){void 0===e&&(e={});var i=yy();Py(Ty((()=>{var r,n=by("CLS",0),s=wy(e,ky),a=(i,a,o,l,u)=>{n=by("CLS",0,i,a,o,l,u),s.i=0,r=hy(t,n,Ay,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{o(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.h(e):l(e);o()},h=["layout-shift"];xy(e)&&h.push("soft-navigation");var d=Sy(h,u);d&&(r=hy(t,n,Ay,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),uy((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,ly()),dy(r)})),setTimeout(r))})))},Oy=0,Ly=1/0,Dy=0,$y=t=>{for(var e of t)e.interactionId&&(Ly=Math.min(Ly,e.interactionId),Dy=Math.max(Dy,e.interactionId),Oy=Dy?(Dy-Ly)/7+1:0)},Ny=()=>{var t;return Ey?Oy:null!==(t=performance.interactionCount)&&void 0!==t?t:0},qy=0;let jy=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){qy=Ny(),this.u.length=0,this.v.clear()}M(t){var e=Ny()-qy,i=Math.min(this.u.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.u[i]:{_:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.u.at(-1),r=this.v.get(t.interactionId);if(r||10>this.u.length||t.duration>i._){var n;if(r?t.duration>r._?(r.entries=[t],r._=t.duration):t.duration===r._&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.v.set((r={id:t.interactionId,entries:[t],_:t.duration}).id,r),this.u.push(r)),this.u.sort(((t,e)=>e._-t._)),this.u.length>10){var s=this.u.splice(10);for(var a of s)this.v.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}};var By=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Ty(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},Hy=[200,500],Uy=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=yy();Iy((()=>{var r;"interactionCount"in performance||Ey||(Ey=Sy(["event"],$y,{durationThreshold:0}));var n,s=by("INP"),a=wy(e,jy),o=(i,r,o,l,u)=>{a.T(),s=by("INP",-1,i,r,o,l,u),n=hy(t,s,Hy,e.reportAllChanges)},l=()=>{var t=a.M(s.navigationType);t&&t._!==s.value&&(s.value=t._,s.entries=t.entries,n())},u=t=>{l(),n(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),By((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];xy(e)&&d.push("soft-navigation");var v=Sy(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=hy(t,s,Hy,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),uy((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,ly())})))}))}};let zy=class{constructor(){this.m=void 0,this.l=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}};var Wy=[2500,4e3],Vy=function(t,e){void 0===e&&(e={});var i=!1,r=xy(e);Iy((()=>{var n,s=yy(),a=by("LCP"),o=wy(e,zy),l=(r,o,l,u,h)=>{a=by("LCP",-1,r,o,l,u,h),n=hy(t,a,Wy,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=yy(!0))},u=t=>{o.l&&t.navigationId&&Cy(o.l,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-cy(),0),o.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Sy(d,h);if(v){n=hy(t,a,Wy,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;By((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});uy((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,ly()),n=hy(t,a,Wy,e.reportAllChanges),dy((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))},Gy={onLCP(t,e){void 0===e&&(e={});var i=Tm(e=Object.assign({},e),sy),r=new WeakMap;jm(e)&&(i.u=new Map),i.p=t=>{var i=t.element;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:xm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=jm(e);Wm((()=>{var n,s=$m(),a=Nm("LCP"),o=Tm(e,sy),l=(r,o,l,u,h)=>{a=Nm("LCP",-1,r,o,l,u,h),n=Rm(t,a,ay,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=$m(!0))},u=t=>{o.u&&t.navigationId&&Bm(o.u,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-Am(),0),o.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=qm(d,h);if(v){n=Rm(t,a,ay,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;ry((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});Im((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Em()),n=Rm(t,a,ay,e.reportAllChanges),Pm((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var n,s,a,o,l,u,h=t.entries.at(-1),d=h.url&&performance.getEntriesByType("resource").find((t=>t.name===h.url));e.target=r.get(h),e.lcpEntry=h,h.url&&(e.url=h.url),d&&(e.lcpResourceEntry=d);var v=0,c=0;if("soft-navigation"!==t.navigationType?(v=null!==(n=null==(s=u=wm())?void 0:s.activationStart)&&void 0!==n?n:0,c=null!==(a=null==(o=u)?void 0:o.responseStart)&&void 0!==a?a:0):(v=t.navigationStartTime||0,u=null==(l=i.u)?void 0:l.get(t.navigationId)),u){var f=Math.max(0,c-v),g=Math.max(f,d?(d.requestStart||d.startTime)-v:0),m=Math.min(t.value,Math.max(g,d?d.responseEnd-v:0));e=p({},e,{timeToFirstByte:f,resourceLoadDelay:g-f,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var i=Tm(e=Object.assign({},e),_m),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Qm(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:xm(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=$m();Gm(Hm((()=>{var r,n=Nm("CLS",0),s=Tm(e,_m),a=(i,a,o,l,u)=>{n=Nm("CLS",0,i,a,o,l,u),s.o=0,r=Rm(t,n,Zm,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{o(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.l(e):l(e);o()},h=["layout-shift"];jm(e)&&h.push("soft-navigation");var d=qm(h,u);d&&(r=Rm(t,n,Zm,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Im((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Em()),Pm(r)})),setTimeout(r))})))}((e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(i=n.sources)&&i.length){var s=Qm(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:km(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={});var i=Tm(e=Object.assign({},e),Um);jm(e)&&(i.u=new Map),Gm((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:km(Em())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=wm(),n=t.entries.at(-1);if(r){var s=Math.max(0,r.responseStart-(r.activationStart||0));e={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:km(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var a,o=null==(a=i.u)?void 0:a.get(t.navigationId);o&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:o})}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=Tm(e=Object.assign({},e),iy),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(ry(h),l=!0)},h=()=>{var t=new Set(i.h.map((t=>a.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var o=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)o.add(v)}r=r.filter((t=>t.startTime>s||o.has(t))),l=!1};i.p=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var o=n.length-1;o>=0;o--){var l=n[o];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&a.set(t,i),u()},i.m=t=>{if(!o.get(t)){var i,r=null==(i=t.entries.find((t=>t.target)))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:xm(r);o.set(t,s)}else{var a,l=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;l&&o.set(t,l)}}};var d=(t,e)=>{var i=[];for(var n of r)if(n.startTime+n.duration>=t){if(n.startTime>e)break;i.push(n)}return i};qm(["long-animation-frame"],(t=>{r=r.concat(t),u()}),e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=$m();Wm((()=>{var r;"interactionCount"in performance||zm||(zm=qm(["event"],Xm,{durationThreshold:0}));var n,s=Nm("INP"),a=Tm(e,iy),o=(i,r,o,l,u)=>{a.M(),s=Nm("INP",-1,i,r,o,l,u),n=Rm(t,s,ny,e.reportAllChanges)},l=()=>{var t=a.T(s.navigationType);t&&t.D!==s.value&&(s.value=t.D,s.entries=t.entries,n())},u=t=>{l(),n(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),ry((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];jm(e)&&d.push("soft-navigation");var v=qm(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=Rm(t,s,ny,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),Im((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Em())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:km(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=a.get(r),s=n.processingStart,l=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,l),h=n.entries.sort(((t,e)=>t.processingStart-e.processingStart)),v=d(r.startTime,u),c=i.v.get(r.interactionId),f={interactionTarget:o.get(c),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:l,processedEventEntries:h,longAnimationFrameEntries:v,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:l-u,loadState:km(r.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var i=t.interactionTime,r=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&i&&r){var n,s,a=t.inputDelay,o=t.processingDuration,l=0,u=0,h=0,d=0;for(var v of t.longAnimationFrameEntries)for(var c of(u=u+v.startTime+v.duration-v.styleAndLayoutStart,v.scripts)){var f=c.startTime+c.duration;if(f>=i){var p=f-Math.max(i,c.startTime),g=c.duration?p/c.duration*c.forcedStyleAndLayoutDuration:0;l+=p-g,u+=g,p>d&&(s=i+a>c.startTime?"input-delay":i+a+o>c.startTime?"processing-duration":"presentation-delay",n=c,d=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=i+a+o&&(h=r-y),n&&s&&(t.longestScript={entry:n,subpart:s,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=h,t.totalUnattributedDuration=r-i-l-u-h}})(f),Object.assign(t,{attribution:f})})(e))}),e)},withoutAttribution:{onLCP:Vy,onCLS:Fy,onFCP:Py,onINP:Uy}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Gy,v.__PosthogExtensions__.postHogWebVitalsCallbacks=Gy,v.postHogWebVitalsCallbacks=Gy;var Zy={onLCP:Vy,onCLS:Fy,onFCP:Py,onINP:Uy};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=Zy,v.__PosthogExtensions__.postHogWebVitalsCallbacks=Zy,v.postHogWebVitalsCallbacks=Zy,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Zy;let Qy=class{constructor(){this.t=void 0,this.o=0,this.i=[]}u(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var Jy=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ky=t=>{if("loading"===document.readyState)return"loading";var e=Jy();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Yy=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Xy=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r=t,n=r.id?"#"+r.id:[Yy(r),...Array.from(r.classList).sort()].join(".");if(e.length+n.length>99)return e||n;if(e=e?n+">"+e:n,r.id)break;t=r.parentNode}}catch(t){}return e},tb=new WeakMap;function eb(t,e){var i=tb.get(e);return i||(i=new WeakMap,tb.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var ib,rb=-1,nb=()=>rb,sb=t=>{addEventListener("pageshow",(e=>{e.persisted&&(rb=e.timeStamp,t(e))}),!0)},ab=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},ob=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},lb=()=>{var t,e;return null!==(t=null==(e=Jy())?void 0:e.activationStart)&&void 0!==t?t:0},ub=function(t,e){void 0===e&&(e=-1);var i=Jy(),r="navigate";return 0>nb()?i&&(document.prerendering||lb()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},hb=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return r.observe(p({type:t,buffered:!0},i)),r}}catch(t){}},db=t=>{var e=!1;return()=>{e||(t(),e=!0)}},vb=-1,cb=new Set,fb=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,pb=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of cb)e();isFinite(vb)||(vb="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",pb,!0))}},gb=()=>{if(0>vb){var t,e=lb(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;vb=null!=i?i:fb(),addEventListener("visibilitychange",pb,!0),addEventListener("prerenderingchange",pb,!0),sb((()=>{setTimeout((()=>{vb=fb()}))}))}return{get firstHiddenTime(){return vb},onHidden(t){cb.add(t)}}},mb=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},yb=[1800,3e3],bb=function(t,e){void 0===e&&(e={}),mb((()=>{var i,r=gb(),n=ub("FCP"),s=hb("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-lb(),0),n.entries.push(e),i(!0)))}));s&&(i=ab(t,n,yb,e.reportAllChanges),sb((r=>{n=ub("FCP"),i=ab(t,n,yb,e.reportAllChanges),ob((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},_b=[.1,.25],wb=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],kb=0,Sb=1/0,xb=0,Cb=t=>{for(var e of t)e.interactionId&&(Sb=Math.min(Sb,e.interactionId),xb=Math.max(xb,e.interactionId),kb=xb?(xb-Sb)/7+1:0)},Tb=()=>{var t;return ib?kb:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Mb=0;let Eb=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){Mb=Tb(),this.l.length=0,this.h.clear()}M(){var t=Math.min(this.l.length-1,Math.floor((Tb()-Mb)/50));return this.l[t]}u(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.l.at(-1),r=this.h.get(t.interactionId);if(r||10>this.l.length||t.duration>i.T){var n;if(r?t.duration>r.T?(r.entries=[t],r.T=t.duration):t.duration===r.T&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.h.set((r={id:t.interactionId,entries:[t],T:t.duration}).id,r),this.l.push(r)),this.l.sort(((t,e)=>e.T-t.T)),this.l.length>10){var s=this.l.splice(10);for(var a of s)this.h.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}};var Ib=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=db(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},Rb=[200,500];let Pb=class{constructor(){this.m=void 0}u(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],Ab=-1,Fb=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Ab=e.timeStamp,t(e))}),!0)},Ob=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},Lb=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Db=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},$b=()=>{var t,e;return null!==(t=null==(e=Db())?void 0:e.activationStart)&&void 0!==t?t:0},Nb=function(t,e){void 0===e&&(e=-1);var i=Db(),r="navigate";return 0>Ab?i&&(document.prerendering||$b()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},qb=new WeakMap;function jb(t,e){var i=qb.get(e);return i||(i=new WeakMap,qb.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}class Bb{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var Hb,Ub=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return r.observe(p({type:t,buffered:!0},i)),r}}catch(t){}},zb=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Wb=-1,Vb=new Set,Gb=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Zb=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Vb)e();isFinite(Wb)||(Wb="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Zb,!0))}},Qb=()=>{if(0>Wb){var t,e=$b(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Wb=null!=i?i:Gb(),addEventListener("visibilitychange",Zb,!0),addEventListener("prerenderingchange",Zb,!0),Fb((()=>{setTimeout((()=>{Wb=Gb()}))}))}return{get firstHiddenTime(){return Wb},onHidden(t){Vb.add(t)}}},Jb=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Kb=[1800,3e3],Yb=function(t,e){void 0===e&&(e={}),Jb((()=>{var i,r=Qb(),n=Nb("FCP"),s=Ub("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-$b(),0),n.entries.push(e),i(!0)))}));s&&(i=Ob(t,n,Kb,e.reportAllChanges),Fb((r=>{n=Nb("FCP"),i=Ob(t,n,Kb,e.reportAllChanges),Lb((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},Xb=[.1,.25],t_=function(t,e){void 0===e&&(e={});var i=Qb();Yb(zb((()=>{var r,n=Nb("CLS",0),s=jb(e,Bb),a=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,r())},o=Ub("layout-shift",a);o&&(r=Ob(t,n,Xb,e.reportAllChanges),i.onHidden((()=>{a(o.takeRecords()),r(!0)})),Fb((()=>{s.i=0,n=Nb("CLS",0),r=Ob(t,n,Xb,e.reportAllChanges),Lb(r)})),setTimeout(r))})))},e_=0,i_=1/0,r_=0,n_=t=>{for(var e of t)e.interactionId&&(i_=Math.min(i_,e.interactionId),r_=Math.max(r_,e.interactionId),e_=r_?(r_-i_)/7+1:0)},s_=()=>{var t;return Hb?e_:null!==(t=performance.interactionCount)&&void 0!==t?t:0},a_=0;class o_{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){a_=s_(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((s_()-a_)/50));return this.l[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.l.at(-1),r=this.u.get(t.interactionId);if(r||10>this.l.length||t.duration>i.L){var n;if(r?t.duration>r.L?(r.entries=[t],r.L=t.duration):t.duration===r.L&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.u.set((r={id:t.interactionId,entries:[t],L:t.duration}).id,r),this.l.push(r)),this.l.sort(((t,e)=>e.L-t.L)),this.l.length>10){var s=this.l.splice(10);for(var a of s)this.u.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}}var l_=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=zb(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},u_=[200,500],h_=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Qb();Jb((()=>{var r;"interactionCount"in performance||Hb||(Hb=Ub("event",n_,{durationThreshold:0}));var n,s=Nb("INP"),a=jb(e,o_),o=t=>{l_((()=>{for(var e of t)a.h(e);var i=a.T();i&&i.L!==s.value&&(s.value=i.L,s.entries=i.entries,n())}))},l=Ub("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=Ob(t,s,u_,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{o(l.takeRecords()),n(!0)})),Fb((()=>{a.v(),s=Nb("INP"),n=Ob(t,s,u_,e.reportAllChanges)})))}))}};class d_{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var v_=[2500,4e3],c_=function(t,e){void 0===e&&(e={}),Jb((()=>{var i,r=Qb(),n=Nb("LCP"),s=jb(e,d_),a=t=>{for(var a of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(a),r.firstHiddenTime>a.startTime&&(n.value=Math.max(a.startTime-$b(),0),n.entries=[a],i())},o=Ub("largest-contentful-paint",a);if(o){i=Ob(t,n,v_,e.reportAllChanges);var l=zb((()=>{a(o.takeRecords()),o.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(l_(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});Fb((r=>{n=Nb("LCP"),i=Ob(t,n,v_,e.reportAllChanges),Lb((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))},f_={onLCP(t,e){void 0===e&&(e={});var i=eb(e=Object.assign({},e),Pb),r=new WeakMap;i.m=t=>{var i=t.element;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:Xy(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={}),mb((()=>{var i,r=gb(),n=ub("LCP"),s=eb(e,Pb),a=t=>{for(var a of(e.reportAllChanges||(t=t.slice(-1)),t))s.u(a),r.firstHiddenTime>a.startTime&&(n.value=Math.max(a.startTime-lb(),0),n.entries=[a],i())},o=hb("largest-contentful-paint",a);if(o){i=ab(t,n,$,e.reportAllChanges);var l=db((()=>{a(o.takeRecords()),o.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(Ib(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});sb((r=>{n=ub("LCP"),i=ab(t,n,$,e.reportAllChanges),ob((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var i=t.entries.at(-1),n=i.url&&performance.getEntriesByType("resource").find((t=>t.name===i.url));e.target=r.get(i),e.lcpEntry=i,i.url&&(e.url=i.url),n&&(e.lcpResourceEntry=n);var s=Jy();if(s){var a=s.activationStart||0,o=Math.max(0,s.responseStart-a),l=Math.max(o,n?(n.requestStart||n.startTime)-a:0),u=Math.min(t.value,Math.max(l,n?n.responseEnd-a:0));e=p({},e,{timeToFirstByte:o,resourceLoadDelay:l-o,resourceLoadDuration:u-l,elementRenderDelay:t.value-u,navigationEntry:s})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var i=eb(e=Object.assign({},e),Qy),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=wb(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:Xy(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=gb();bb(db((()=>{var r,n=ub("CLS",0),s=eb(e,Qy),a=t=>{for(var e of t)s.u(e);s.o>n.value&&(n.value=s.o,n.entries=s.i,r())},o=hb("layout-shift",a);o&&(r=ab(t,n,_b,e.reportAllChanges),i.onHidden((()=>{a(o.takeRecords()),r(!0)})),sb((()=>{s.o=0,n=ub("CLS",0),r=ab(t,n,_b,e.reportAllChanges),ob(r)})),setTimeout(r))})))}((e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(i=n.sources)&&i.length){var s=wb(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Ky(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={}),bb((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Ky(nb())};if(t.entries.length){var i=Jy(),r=t.entries.at(-1);if(i){var n=Math.max(0,i.responseStart-(i.activationStart||0));e={timeToFirstByte:n,firstByteToFCP:t.value-n,loadState:Ky(t.entries[0].startTime),navigationEntry:i,fcpEntry:r}}}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=eb(e=Object.assign({},e),Eb),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(Ib(h),l=!0)},h=()=>{var t=new Set(i.l.map((t=>a.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var o=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)o.add(v)}r=r.filter((t=>t.startTime>s||o.has(t))),l=!1};i.m=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var o=n.length-1;o>=0;o--){var l=n[o];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),!1!==e.includeProcessedEventEntries&&i.entries.push(t);break}}i||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:!1!==e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&a.set(t,i),u()},i.p=t=>{if(!o.get(t)){var i,r=null==(i=t.entries.find((t=>t.target)))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:Xy(r);o.set(t,s)}else{var a,l=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;l&&o.set(t,l)}}};var d=(t,e)=>{var i=[];for(var n of r)if(n.startTime+n.duration>=t){if(n.startTime>e)break;i.push(n)}return i};hb("long-animation-frame",(t=>{r=r.concat(t),u()})),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=gb();mb((()=>{var r;"interactionCount"in performance||ib||(ib=hb("event",Cb,{durationThreshold:0}));var n,s=ub("INP"),a=eb(e,Eb),o=t=>{Ib((()=>{for(var e of t)a.u(e);var i=a.M();i&&i.T!==s.value&&(s.value=i.T,s.entries=i.entries,n())}))},l=hb("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=ab(t,s,Rb,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{o(l.takeRecords()),n(!0)})),sb((()=>{a.v(),s=ub("INP"),n=ab(t,s,Rb,e.reportAllChanges)})))}))}}((e=>{t((t=>{var e=t.entries[0],r=a.get(e),n=e.processingStart,s=Math.max(e.startTime+e.duration,n),l=Math.min(r.processingEnd,s),u=r.entries.sort(((t,e)=>t.processingStart-e.processingStart)),h=d(e.startTime,l),v=i.h.get(e.interactionId),c={interactionTarget:o.get(v),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:s,processedEventEntries:u,longAnimationFrameEntries:h,inputDelay:n-e.startTime,processingDuration:l-n,presentationDelay:s-l,loadState:Ky(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{if(null!=(e=t.longAnimationFrameEntries)&&e.length){var i,r,n=t.interactionTime,s=t.inputDelay,a=t.processingDuration,o=0,l=0,u=0,h=0;for(var d of t.longAnimationFrameEntries)for(var v of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var c=v.startTime+v.duration;if(c>=n){var f=c-Math.max(n,v.startTime),p=v.duration?f/v.duration*v.forcedStyleAndLayoutDuration:0;o+=f-p,l+=p,f>h&&(r=n+s>v.startTime?"input-delay":n+s+a>v.startTime?"processing-duration":"presentation-delay",i=v,h=f)}}var g=t.longAnimationFrameEntries.at(-1),m=g?g.startTime+g.duration:0;m>=n+s+a&&(u=t.nextPaintTime-m),i&&r&&(t.longestScript={entry:i,subpart:r,intersectingDuration:h}),t.totalScriptDuration=o,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=u,t.totalUnattributedDuration=t.nextPaintTime-n-o-l-u}})(c),Object.assign(t,{attribution:c})})(e))}),e)},withoutAttribution:{onLCP:c_,onCLS:t_,onFCP:Yb,onINP:h_}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=f_,v.__PosthogExtensions__.postHogWebVitalsCallbacks=f_,v.postHogWebVitalsCallbacks=f_;var p_={onLCP:c_,onCLS:t_,onFCP:Yb,onINP:h_};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=p_,v.__PosthogExtensions__.postHogWebVitalsCallbacks=p_,v.postHogWebVitalsCallbacks=p_,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>p_;class g_{constructor(t){this.disabled=!1===t;var e=st(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:i}];return!1}}var m_="$copy_autocapture",y_=Bi("[AutoCapture]");function b_(t,e){return e.length>t?e.slice(0,t)+"...":e}function __(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!pr(e));return e}function w_(e,i){var r,n,s=i.e,a=i.maskAllElementAttributes,o=i.maskAllText,l=i.elementAttributeIgnoreList,u=i.elementsChainAsString,h=i.disableCaptureUrlHashes;if(!pr(e))return{props:{}};for(var d=[e],v=new Set([e]),c=e;c.parentNode&&!gr(c,"body")&&br>d.length;)if(yr(c.parentNode)){var f=c.parentNode.host;if(v.has(f))break;v.add(f),d.push(f),c=f}else{if(!pr(c.parentNode))break;if(v.has(c.parentNode))break;v.add(c.parentNode),d.push(c.parentNode),c=c.parentNode}var g,m,y=[],b={},_=!1,w=!1;if(Ui(d,(t=>{var e=qr(t);if(gr(t,"a")){var i=t.getAttribute("href");_=!!(e&&i&&Zr(i))&&(h?Le(i):i)}J(kr(t),"ph-no-capture")&&(w=!0),y.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),a={tag_name:s};Tr.indexOf(s)>-1&&!i&&(a.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?b_(1024,Qr(t)):b_(1024,xr(t)));var o=kr(t);o.length>0&&(a.classes=o.filter((function(t){return""!==t}))),Ui(t.attributes,(function(i){var s;if((!jr(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Zr(i.value)&&(!lt(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=_r(o).join(" ")),a["attr__"+i.name]=b_(1024,"href"===i.name&&n?Le(o):o)}}));for(var l=1,u=1,h=t;h=__(h);)l++,h.tagName===t.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(t,a,o,l,h));var r=function(t){if(!qr(t))return{};var e={};return Ui(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var i=t.name.replace("data-ph-capture-attribute-",""),r=t.value;i&&r&&Zr(r)&&(e[i]=r)}})),e}(t);zi(b,r)})),w)return{props:{},explicitNoCapture:w};if(o||(y[0].$el_text=gr(e,"a")||gr(e,"button")?Qr(e):xr(e)),_){var k,S;y[0].attr__href=_;var x=null==(k=er(_))?void 0:k.host,C=null==t||null==(S=t.location)?void 0:S.host;x&&C&&x!==C&&(g=_)}return{props:zi({$event_type:s.type,$ce_version:1},u?{}:{$elements:y},{$elements_chain:(m=y,function(t){return t.map((t=>{var e,i,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var n of(t.attr_class.sort(),t.attr_class))r+="."+n.replace(/"/g,"");var s=p({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return Wi(s).sort(((t,e)=>t[0].localeCompare(e[0]))).forEach((t=>{var e=t[1];return a[Kr(t[0].toString())]=Kr(e.toString())})),(r+=":")+Wi(a).map((t=>t[0]+'="'+t[1]+'"')).join("")})).join(";")}(function(t){return t.map((t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:Yr(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Wi(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>r.attributes[t[0]]=t[1])),r}))}(m)))},null!=(r=y[0])&&r.$el_text?{$el_text:null==(n=y[0])?void 0:n.$el_text}:{},g&&"click"===s.type?{$external_click_url:g}:{},b)}}class k_{constructor(t){this.name="autocapture",this.es=!1,this.rs=null,this.ns=!1,this.ss=!1,this.Wi={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.os=!1,this.ls=t,this.ls.refresh(this.Wi),this.rageclicks=new g_(this.Wi.rageclick),this.us=null}setup(t){this.hs(),this.ds=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.os?e.dispose():(this.vs=e,this.startIfEnabled())}dispose(){var t;this.os||(this.os=!0,this.ds=void 0,null==(t=this.vs)||t.dispose(),this.vs=void 0,this.cs())}fs(){return this.ls.refresh(this.Wi),this.Wi}hs(){var t,e;return this.fs(),this.Wi.url_allowlist=null==(t=this.Wi.url_allowlist)?void 0:t.map((t=>new RegExp(t))),this.Wi.url_ignorelist=null==(e=this.Wi.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),this.Wi}ps(){if(this.isBrowserSupported()){if(t&&r){var e=this.gs=e=>{e=e||(null==t?void 0:t.event);try{this.ys(e)}catch(t){y_.error("Failed to capture event",t)}};if(Ki(r,"submit",e,{capture:!0}),Ki(r,"change",e,{capture:!0}),Ki(r,"click",e,{capture:!0}),this.fs().capture_copied_text){var i=this.bs=e=>{e=e||(null==t?void 0:t.event);try{this.ys(e,m_)}catch(t){y_.error("Failed to capture clipboard event",t)}};Ki(r,"copy",i,{capture:!0}),Ki(r,"cut",i,{capture:!0}),Ki(r,"paste",i,{capture:!0})}}}else y_.info("Disabling Automatic Event Collection because this browser is not supported")}cs(){this.gs&&(null==r||r.removeEventListener("submit",this.gs,!0),null==r||r.removeEventListener("change",this.gs,!0),null==r||r.removeEventListener("click",this.gs,!0),this.gs=void 0),this.bs&&(null==r||r.removeEventListener("copy",this.bs,!0),null==r||r.removeEventListener("cut",this.bs,!0),null==r||r.removeEventListener("paste",this.bs,!0),this.bs=void 0),this.es=!1}startIfEnabled(){!this.os&&this.ds&&this.isEnabled&&!this.es&&(this.ps(),this.es=!0)}onRemoteConfig(t){if(!this.os)if(this.ns=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.ss=e.elementsChainAsString);var i,r=e.autocapture_opt_out;ft(r)&&(null==(i=this.ds)||i.kv.set(bn,r),this.rs=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.us=t}getElementSelectors(t){var e,i=[];return null==(e=this.us)||e.forEach((e=>{var n=null==r?void 0:r.querySelectorAll(e);null==n||n.forEach((r=>{t===r&&i.push(e)}))})),i}get isEnabled(){var t,e;if(this.os)return!1;var i=null==(t=this.ds)?void 0:t.kv.get(bn),r=this.rs,n=this.fs(),s=n.remoteRequestsDisabled&&!this.ns;if(ht(r)&&!ft(i)&&!s)return!1;var a=null!==(e=this.rs)&&void 0!==e?e:!!i;return!!n.enabled&&!a}ys(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var r=Cr(e);mr(r)&&(r=r.parentNode||null);var n,s=this.hs();"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&s.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&Dr(r,s.rageclick)&&this.ys(e,"$rageclick");var a=i===m_,o=a?p({},s,{dom_event_allowlist:void 0}):s;if(r&&function(e,i,r,n,s,a){var o;if(!t||$r(e))return!1;if(null!=r&&r.url_allowlist&&!wr(r.url_allowlist,a))return!1;if(null!=r&&r.url_ignorelist&&wr(r.url_ignorelist,a))return!1;if(null!=r&&r.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>i.type===t)))return!1}var u=Nr(e,n),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(ot(i))return!0;var r,n=function(t){if(i.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(d,r))return!1;if(!Mr(d,null==r?void 0:r.css_selector_allowlist))return!1;if(Mr(d,null!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:Ir))return!1;try{var v=t.getComputedStyle(e);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===i.type)return!0}catch(t){}var c=e.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(s||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(i.type)>=0;default:return h?(s||["click"]).indexOf(i.type)>=0:(s||["click"]).indexOf(i.type)>=0&&(Tr.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,o,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var l,u=w_(r,{e:e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.ss,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),h=u.props;if(u.explicitNoCapture)return!1;var d=this.getElementSelectors(r);if(d&&d.length>0&&(h.$element_selectors=d),i===m_){var v=e.type||"clipboard";if("paste"!==v){var c,f,g=null==t||null==(c=t.getSelection())?void 0:c.toString(),m=Sr(g);if(!m)return!1;h.$selected_content=m,h.$clipboard_text_length=null!==(f=null==g?void 0:g.length)&&void 0!==f?f:0}h.$copy_type=v}return null==(l=this.ds)||l.capture(i,h).catch((t=>y_.error("Failed to capture event",t))),!0}}}isBrowserSupported(){return nt(null==r?void 0:r.querySelectorAll)}}var S_={};function x_(e,i){var r=S_[e];if(r)return r;var n=i[e];if((t=>nt(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==t||!t.Zone))return S_[e]=n.bind(i);var s=i.document;if(s&&nt(s.createElement)){var a,o=!1;try{(a=s.createElement("iframe")).hidden=!0,s.head.appendChild(a);var l,u,h=a.contentWindow;h&&h[e]&&(n=h[e],"MutationObserver"===e&&function(t){return J(t,"AppleWebKit")&&!J(t,"Chrome")}(null!==(l=null==(u=i.navigator)?void 0:u.userAgent)&&void 0!==l?l:"")&&(a.classList.add("rr-block","ph-no-capture"),o=!0))}catch(t){ji.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}finally{var d;!o&&null!=(d=a)&&d.parentNode&&a.parentNode.removeChild(a)}}return n&&nt(n)?S_[e]=n.bind(i):n}function C_(t,e){var i=Cr(t);return i?p({node:i,originalEvent:t,timestamp:Date.now()},e):null}function T_(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function M_(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var E_="canvas,video,audio,embed,object",I_=1e3;function R_(t,e){return vt(t)&&t>=e}function P_(t){return t>=0&&I_>t?t:void 0}function A_(t,e){return e?P_(t-e):void 0}class F_{Si(t){var e,i,r,n,s,a,o,l,u=this.xi((null==t?void 0:t.__onCapture)||this.Ci.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(a=null==t?void 0:t.capture_dead_swipes)&&void 0!==a?a:u.capture_dead_swipes,swipe_threshold_px:null!==(o=null==t?void 0:t.swipe_threshold_px)&&void 0!==o?o:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.Mi=[],this.Ti=0,this.xi=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.Ii=t=>{var e=C_(t,{type:"click"});ht(e)||this.Ei(e)||this.Ri(e),this.Ai()},this.Li=()=>{var t=Date.now();this.Oi=t,t%50==0&&this.Mi.forEach((e=>{ot(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Pi=()=>{this.Di=Date.now()},this.Et=()=>{var t=Date.now();this.Fi=t,this.Ni("visibilityChangedDelayMs",t)},this.qi=()=>{var t=Date.now();this.ji=t,this.Ni("focusChangedDelayMs",t)},this.Bi=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.Hi=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.Ui=()=>{this.Hi=void 0},this.$i=t=>{var e,i=this.Hi;if(this.Hi=void 0,!ot(i)&&this.Wi.max_dead_swipes_per_page_load>this.Ti){var n=t,s=null==(e=n.changedTouches)?void 0:e[0];if(s){var a=s.clientX-i.x,o=s.clientY-i.y,l=a*a+o*o,u=this.Wi.swipe_threshold_px;if(l>=u*u&&![this.Oi,this.zi,this.Di].some((t=>vt(t)&&t>=i.timestamp))){var h;if(this.Vi()&&(null!==(h=null==r||null==r.elementsFromPoint?void 0:r.elementsFromPoint(i.x,i.y))&&void 0!==h?h:[]).some((t=>null==t.matches?void 0:t.matches(E_))))return;var d=C_(n,{type:"swipe",swipeDirection:T_(a,o),swipeDistancePx:Math.round(Math.sqrt(l))});ht(d)||this.Ei(d)||this.Ri(d),this.Ai()}}}},this.instance=t,this.Wi=this.Si(e),this._onCapture=this.Wi.__onCapture}start(t){this.Zi(),this.Gi(),this.Qi(),this.Ji(),this.Yi(),this.Ki(t),this.Wi.capture_dead_swipes&&this.Xi()}Ki(t){if(!this.en){var e=function(t){return x_("MutationObserver",t)}(v);this.en=new e((t=>{this.tn(t)})),this.en.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.en)||t.disconnect(),this.en=void 0,v.removeEventListener("click",this.Ii),v.removeEventListener("scroll",this.Li,{capture:!0}),v.removeEventListener("selectionchange",this.Pi),v.removeEventListener("touchstart",this.Bi,{capture:!0}),v.removeEventListener("touchend",this.$i,{capture:!0}),v.removeEventListener("touchcancel",this.Ui,{capture:!0}),null==r||r.removeEventListener("visibilitychange",this.Et),v.removeEventListener("blur",this.qi),v.removeEventListener("focus",this.qi),this.Hi=void 0}tn(t){this.zi=Date.now()}Zi(){Ki(v,"click",this.Ii)}Ri(t){t.visibilityChangedDelayMs=A_(t.timestamp,this.Fi),t.focusChangedDelayMs=A_(t.timestamp,this.ji),this.Mi.push(t)}Ai(){this.Mi.length&&ot(this.rn)&&(this.rn=v.setTimeout((()=>{this.nn()}),1e3))}Gi(){Ki(v,"scroll",this.Li,{capture:!0})}Qi(){Ki(v,"selectionchange",this.Pi)}Ji(){Ki(r,"visibilitychange",this.Et)}Yi(){Ki(v,"blur",this.qi),Ki(v,"focus",this.qi)}Ni(t,e){this.Mi.forEach((i=>{var r=P_(e-i.timestamp);vt(r)&&(ot(i[t])||i[t]>r)&&(i[t]=r)}))}Xi(){Ki(v,"touchstart",this.Bi,{capture:!0,passive:!0}),Ki(v,"touchend",this.$i,{capture:!0,passive:!0}),Ki(v,"touchcancel",this.Ui,{capture:!0,passive:!0})}Vi(){var t=ot(this.an)||vt(this.zi)&&this.zi>this.an;return(ot(this.sn)||t)&&(this.an=Date.now(),this.sn=!(null==r||!r.querySelector(E_))),!!this.sn}Ei(t){return!t||("swipe"===t.type?this.un(t):this.ln(t))}un(e){if(fr(e.node))return!0;var i=this.Mi.some((t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!i&&!gr(e.node,"html")&&pr(e.node)&&function(e,i){var r;if(!t||$r(e))return!1;var n=ft(i)?Fr:null!==(r=null==i?void 0:i.css_selector_ignorelist)&&void 0!==r?r:Fr;return!Mr(Nr(e,!1).targetElementList,n)}(e.node,{css_selector_ignorelist:this.Wi.css_selector_ignorelist}))}ln(e){return!(this.Wi.capture_clicks_with_modifier_keys||(i=e.originalEvent,!(i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)))||!!this.un(e)||(r=e.node,!(!t||$r(r))&&Nr(r,!1).targetElementList.some((t=>gr(t,"a"))));var i,r}nn(){if(this.Mi.length){clearTimeout(this.rn),this.rn=void 0;var t=this.Mi;for(var e of(this.Mi=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.zi&&this.zi>=e.timestamp?this.zi-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Di&&this.Di>=e.timestamp?this.Di-e.timestamp:void 0;var r=R_(e.scrollDelayMs,this.Wi.scroll_threshold_ms),n=R_(e.selectionChangedDelayMs,this.Wi.selection_change_threshold_ms),s=R_(e.mutationDelayMs,this.Wi.mutation_threshold_ms),a=R_(e.absoluteDelayMs,1.1*this.Wi.mutation_threshold_ms),o=vt(e.scrollDelayMs)&&this.Wi.scroll_threshold_ms>e.scrollDelayMs,l=vt(e.mutationDelayMs)&&this.Wi.mutation_threshold_ms>e.mutationDelayMs,u=vt(e.selectionChangedDelayMs)&&this.Wi.selection_change_threshold_ms>e.selectionChangedDelayMs,h=vt(e.visibilityChangedDelayMs),d=vt(e.focusChangedDelayMs);if(!(o||l||u||h||d))if(r||s||a||n){var v=M_(e);if("$dead_swipe"===v){if(this.Ti>=this.Wi.max_dead_swipes_per_page_load)continue;this.Ti++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.zi,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:a,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this.Wi.mutation_threshold_ms>e.absoluteDelayMs&&this.Mi.push(e)}this.Ai()}}Ci(t,e){var i=M_(t);this.instance.capture(i,p({},e,w_(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Wi.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,[i+"_focus_changed_delay_ms"]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new F_(t,e);var O_=Bi("[ExternalScriptsLoader]"),L_=t=>{var e=null==r?void 0:r.querySelectorAll("script");if(e)for(var i=0;e.length>i;i++)if(e[i].src===t||e[i].getAttribute("src")===t)return e[i]},D_=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return O_.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var n=L_(e);if(n){if(n.__posthog_loading_callback_fired)return i();var s=n.__posthog_loading_error;return s?i(s):(n.addEventListener("load",(t=>{n.__posthog_loading_callback_fired=!0,i(void 0,t)})),void n.addEventListener("error",(t=>{n.__posthog_loading_error=t,i(t)})))}var a=()=>{if(!r)return i("document not found");if(L_(e))return D_(t,e,i);var n=r.createElement("script");if(n.type="text/javascript",n.crossOrigin="anonymous",n.src=e,n.onload=t=>{n.__posthog_loading_callback_fired=!0,i(void 0,t)},n.onerror=t=>{n.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(n=t.config.prepare_external_dependency_script(n)),!n)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)r.head.appendChild(n);else{var s,a=r.querySelectorAll("body > script");a.length>0?null==(s=a[0].parentNode)||s.insertBefore(n,a[0]):r.body.appendChild(n)}};null!=r&&r.body?a():null==r||r.addEventListener("DOMContentLoaded",a)},$_={},N_=(t,e)=>{var i="/static/"+e+".js?v="+t.version;if("toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",i)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r=t.config.strict_script_versioning;if(r){var n=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),s=$_[n];if("fallback"===r&&s){if(L_(s))return void D_(t,s,i);delete $_[n]}D_(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var a,o=N_(t,e);$_[n]=o;var l=L_(n);null==l||null==(a=l.parentNode)||a.removeChild(l),D_(t,o,i)}else i(void 0,s)}:i)}else D_(t,N_(t,e),i)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");D_(t,a,i)}},v.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);D_(t,r,i)};class q_{constructor(t){this._instance=t}get Wi(){return this._instance.config}get consent(){return this._s()?0:this.ws}isOptedOut(){return this.Wi.cookieless_mode===Os||this.isRejected()||-1===this.consent&&this.Wi.cookieless_mode===Fs}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Wi.opt_out_capturing_by_default}optInOut(t){this.ks.Hr(this.Ss,t?1:0,this.Wi.cookie_expiration,this.Wi.cross_subdomain_cookie,this.Wi.secure_cookie)}reset(){this.ks.$r(this.Ss,this.Wi.cross_subdomain_cookie)}get Ss(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get ws(){var t=this.ks.Ur(this.Ss);return xt(t)?1:J(Ct,t)?0:-1}get ks(){var t=this.Wi.opt_out_capturing_persistence_type,e="localStorage"===t?op:sp;if(!this.xs||this.xs!==e){this.xs=e;var i="localStorage"===t?sp:op;i.Ur(this.Ss)&&(this.xs.Ur(this.Ss)||this.optInOut(xt(i.Ur(this.Ss))),i.$r(this.Ss,this.Wi.cross_subdomain_cookie))}return this.xs}_s(){return!!this.Wi.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,v.doNotTrack].some((t=>xt(t)))}}var j_=Bi("[Dead Clicks]"),B_=()=>!0,H_=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Cn)),r=t.instance.config.capture_dead_clicks;return ft(r)?r:!!st(r)||i};class U_{get lazyLoadedDeadClicksAutocapture(){return this.Cs}constructor(t,e,i){this.instance=t,this.isEnabled=e,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Cn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Ts((()=>{this.Ms()})):this.stop()}Ts(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?j_.error("failed to load script",e):t()}))}Ms(){var t;if(r){if(!this.Cs&&null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=st(this.instance.config.capture_dead_clicks)?p({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Cs=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Cs.start(r),j_.info("starting...")}}else j_.error("`document` not found. Cannot start.")}stop(){this.Cs&&(this.Cs.stop(),this.Cs=void 0,j_.info("stopping..."))}}var z_=Bi("[SegmentIntegration]");var W_="posthog-js";function V_(t,e){var i=void 0===e?{}:e,r=i.organization,n=i.projectId,s=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,u=void 0===l||l;return e=>{var i,a,l,h,d;if("*"!==o&&!o.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var c,f=(null==(i=e.exception)?void 0:i.values)||[],g=f.map((t=>p({},t,{stacktrace:t.stacktrace?p({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>p({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(a=f[0])?void 0:a.value)||e.message,$exception_type:null==(l=f[0])?void 0:l.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(h=f[0])?void 0:h.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return r&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),u&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}class G_{constructor(t,e,i,r,n,s){this.name=W_,this.setupOnce=function(a){a(V_(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Z_{constructor(t){this.Es=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ji.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Is=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Rs()}Rs(){var t;this.Ps=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Es)}destroy(){var t;null==(t=this.Ps)||t.call(this),this.Ps=void 0}doPageView(e,i){var r,n=this.As(e,i);return this.Is={pathname:null!==(r=null==t?void 0:t.location.pathname)&&void 0!==r?r:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(t){var e;return this.As(t,null==(e=this.Is)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Is)?void 0:t.pageViewId}}As(t,e){var i=this.Is;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,a=n.lastScrollY,o=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(ot(s)||ot(a)||ot(o)||ot(l)||ot(u)||ot(h))){s=Math.ceil(s),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Tt(a/s,0,1,ji):1,v=s>1?Tt(o/s,0,1,ji):1,c=l>1?Tt(u/l,0,1,ji):1,f=l>1?Tt(h/l,0,1,ji):1;r=zi(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var Q_=["flags","surveys"],J_={[cn]:{exposure:"hidden"},[mn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[yn]:{exposure:"hidden"},[bn]:{exposure:"event"},[_n]:{exposure:"hidden"},[wn]:{exposure:"event"},[kn]:{exposure:"hidden"},[Sn]:{exposure:"event"},[xn]:{exposure:"event"},[Cn]:{exposure:"event"},[Tn]:{exposure:"hidden"},[Mn]:{exposure:"event"},[En]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[On]:{exposure:"hidden"},[Ln]:{exposure:"event"},[In]:{exposure:"event",shouldSkipFromEventProperties:t=>ht(t)},[Dn]:{exposure:"event"},[$n]:{exposure:"event"},[Nn]:{exposure:"event"},[Hn]:{exposure:"event"},[Un]:{exposure:"hidden"},[zn]:{exposure:"hidden",storageGroup:"flags"},[Wn]:{exposure:"hidden",storageGroup:"flags"},[Vn]:{exposure:"hidden"},[Gn]:{exposure:"hidden",storageGroup:"flags"},[Zn]:{exposure:"hidden",storageGroup:"flags"},[Qn]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Jn]:{exposure:"hidden",storageGroup:"flags"},[Kn]:{exposure:"hidden"},[Yn]:{exposure:"hidden"},[Xn]:{exposure:"hidden"},[ts]:{exposure:"hidden"},[is]:{exposure:"hidden",storageGroup:"surveys"},[rs]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ns]:{exposure:"event"},[ss]:{exposure:"hidden"},[as]:{exposure:"hidden"},[os]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ls]:{exposure:"hidden"},[us]:{exposure:"hidden"},[es]:{exposure:"event"},[hs]:{exposure:"hidden"},[ds]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[vs]:{exposure:"hidden"},[cs]:{exposure:"hidden"},[fs]:{exposure:"hidden"},[ps]:{exposure:"hidden"},[gs]:{exposure:"hidden"},[ms]:{exposure:"hidden"},[ys]:{exposure:"hidden"},[Rn]:{exposure:"event"},[Pn]:{exposure:"event"},[An]:{exposure:"event"},[Fn]:{exposure:"event"},[ws]:{exposure:"event"},[ks]:{exposure:"event"},[Ss]:{exposure:"event"},[xs]:{exposure:"event"},[Cs]:{exposure:"event"},[Ts]:{exposure:"event"},[Ms]:{exposure:"event"},[Es]:{exposure:"event"},[Is]:{exposure:"event"},[Rs]:{exposure:"event"},[Ps]:{exposure:"event"}},K_=[[qn,{exposure:"hidden"}],[jn,{exposure:"hidden"}],[Bn,{exposure:"hidden"}]],Y_=t=>{var e=J_[t];if(e)return e;for(var i of K_){var r=i[1];if(0===t.indexOf(i[0]))return r}},X_={flags:ds,surveys:rs},tw=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],ew=t=>t+"_cookie_identity_change_pending",iw="main",rw=(t,e)=>{Ui(t,((i,r)=>{var n=Y_(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class nw{constructor(e,i,r){if(void 0===r&&(r=!0),this.Fs={},this.Os=!1,this.Ls=!1,this.Ds=!1,this.$s=!1,this.Wi=e,this.Ns=r,this.props={},this.qs=void 0,this.js=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(e),this.ks=this.Bs(e),this.Ls=this.Hs(e),this.load(),e.debug&&ji.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var n=()=>this.flush();Ki(t,"beforeunload",n,{capture:!1}),Ki(t,"pagehide",n,{capture:!1})}}Us(){var t,e=null==(t=this.Wi)?void 0:t.persistence_save_debounce_ms;return vt(e)&&e>0?e:0}zs(t){if(this.Wi.cookieWinsOnConflict&&"localstorage+cookie"===this.Wi.persistence.toLowerCase())if(t)try{var e=cp(t,this.Wi.cookie_persisted_properties||[]),i=pp(e,this.Wi.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=sp.Ur(this.js)||void 0;n&&mp(this.js,n)===r&&(this.Ws=r,this.Vs=n)}catch(t){}else try{var s=sp.Ur(this.js)||void 0;this.Ws=s?mp(this.js,s):void 0,this.Vs=s}catch(t){}}syncCookieProperties(){return this.Gs(this.Wi)}Gs(t,e){if(void 0===e&&(e=!1),this.Zs&&!e||this.$s||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=sp.Ur(this.js)||void 0}catch(t){}if(!i||i===this.Vs)return!1;var r,n=mp(this.js,i);try{r=vp(JSON.parse(i))}catch(t){return!1}if((sp.Ur(this.js)||void 0)!==i)return!1;this.Ws=n,this.Vs=i;var s=gp(this.js,i),a=[...up,...s.properties],o={};if(Object.keys(r).forEach((t=>{var e=r[t];(ot(e)||ht(e)||""===e||t===vs&&e!==Ls&&e!==Ds)&&(o[t]=!0,delete r[t])})),at(r))return!1;var l=fn in r||r[vs]===Ls||r[vs]===Ds,u=this.props[fn],h=this.props[vs],d=zi({},this.props);[...up,...t.cookie_persisted_properties||[]].forEach((t=>{if(-1!==a.indexOf(t)&&!(t in r)&&!o[t]&&(l||t!==fn&&t!==vs)){var e=d[t];!s.isValid&&-1!==up.indexOf(t)&&(!1===e||0===e)||delete d[t]}})),this.props=zi(d,r),!l||vs in r||vs in this.props||this.Qs(vs,Ls);var v=this.props[fn],c=this.props[vs];return!l||v===u&&c===h||(this.Ds=!0,wp.Hr(ew(this.js),!0),this.Js(Xn),this.Js(Wn),this.Js(zn),this.Js(Gn),this.Js(Zn),this.Js(Qn),this.Js(ds),this.Js(hs),this.Js(ls),c===Ls&&(h===Ds||r[vs]===Ls||!ot(u)&&v!==u)&&(rw(this.props,r),this.Js(ts)),c===Ds?this.props.$user_id=v:delete this.props.$user_id,this.Js(mn)),!0}consumeCookieIdentityChange(){var t=ew(this.js),e=this.Ds||!!wp.Ur(t);return this.Ds=!1,e&&wp.$r(t),e}Ks(t){return void 0===t&&(t=!1),!(this.$s||this.Zs&&!t||!this.Wi.cookieWinsOnConflict||"localstorage+cookie"!==this.Wi.persistence.toLowerCase()||(this.$s=!0,0))}Ys(){this.$s&&(ot(this.Xs)||(clearTimeout(this.Xs),this.Xs=void 0),delete this.Fs[iw],this.ta(!0))}ea(t){if(void 0===t&&(t=!0),this.$s)try{t?this.Ys():ot(this.Xs)||(clearTimeout(this.Xs),this.Xs=void 0)}finally{this.$s=!1}}isDisabled(){return!!this.Zs}Bs(e){-1===tw.indexOf(e.persistence.toLowerCase())&&(ji.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i,r=function(e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var r=[...up,...e];return p({},op,{zr(t){try{var e,n={};try{e=sp.Ur(t)||void 0,n=e?vp(JSON.parse(e)):{}}catch(t){}var s,a=JSON.parse(op.Ur(t)||"{}");if(i){var o=gp(t,e),l=[...up,...o.properties],u={};Object.keys(n).forEach((t=>{var e=n[t];ht(e)||""===e||t===vs&&e!==Ls&&e!==Ds||(u[t]=e)}));var h=fn in u||u[vs]===Ls||u[vs]===Ds;if(Object.keys(u).length>0){var d,v=a[fn],c=null!==(d=a[vs])&&void 0!==d?d:Ls;r.forEach((t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||t!==fn&&t!==vs)){var e=a[t];!o.isValid&&-1!==up.indexOf(t)&&(!1===e||0===e)||delete a[t]}})),!h||vs in n||vs in a||(a[vs]=Ls),!h||(fn in u?u[fn]:a[fn])===v&&(vs in u?u[vs]:a[vs])===c||(lp.forEach((t=>delete a[t])),u[vs]===Ds&&fn in u?a.$user_id=u[fn]:delete a.$user_id,u[vs]!==Ds&&(delete a[es],delete a[ts]),delete a.__alias)}s=zi(a,u)}else s=zi(n,a);return op.Hr(t,s),s}catch(t){}return null},Hr(t,r,n,s,a,o){var l=op.Hr(t,r,void 0,void 0,o);try{var u=cp(r,e);if(Object.keys(u).length){if(i){var h=hp(t),d=pp(u,e);if(sp.Hr(h,d,n,s,a,o),sp.Ur(h)!==JSON.stringify(d)){sp.$r(h,s);var v=cp(r);return sp.Hr(t,v,n,s,a,o),l}}sp.Hr(t,u,n,s,a,o)}}catch(t){op.Wr(t)}return l},$r(e,i){try{null==t||t.localStorage.removeItem(e),sp.$r(e,i),sp.$r(hp(e),i)}catch(t){op.Wr(t)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),n=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&op.Br()?(i=op,n=!0):"localstorage+cookie"===s&&r.Br()?(i=r,n=!0):"sessionstorage"===s&&wp.Br()?i=wp:"memory"===s?i=bp:"cookie"===s?i=sp:r.Br()?(i=r,n=!0):i=sp,this.Os=n,i}ia(t){return this.js+"__"+t}Hs(t){return this.Os&&!!t.split_storage}properties(){var t={};return Ui(this.props,((e,i)=>{var r=Y_(i);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e))return;t[i]=e}})),t}load(t){if(void 0===t&&(t=!1),!this.Zs||t){var e=this.Wi.cookieWinsOnConflict&&"localstorage+cookie"===this.Wi.persistence.toLowerCase(),i=e?op.zr(this.js):null,r={};if(e)try{Ui(r=vp(sp.zr(this.js)),((t,e)=>{(ot(t)||ht(t)||""===t)&&delete r[e]}))}catch(t){}var n=this.ks.zr(this.js);if(n&&(this.props=zi({},n)),this.Ls&&this.ra(),e&&n){var s,a,o=null==i?void 0:i[fn],l=null!==(s=null==i?void 0:i[vs])&&void 0!==s?s:Ls,u=n[fn],h=null!==(a=n[vs])&&void 0!==a?a:Ls;if(u!==o||h!==l){this.Ds=!0,wp.Hr(ew(this.js),!0);var d=zi({},this.props);lp.forEach((t=>delete d[t])),h===Ls&&(l===Ds||r[vs]===Ls||!ot(o)&&u!==o)&&(rw(d,r),delete d[ts]),this.props=d;var v=new Set;lp.forEach((t=>{var e,i=null==(e=Y_(t))?void 0:e.storageGroup;i&&v.add(i)})),v.forEach((t=>{var e={};Ui(this.props,((i,r)=>{var n;(null==(n=Y_(r))?void 0:n.storageGroup)===t&&(e[r]=i)})),at(e)?(op.$r(this.ia(t)),this.Fs[t]={}):op.Hr(this.ia(t),e)&&(this.Fs[t]={persisted:!0,fingerprint:this.na(e,t)})}))}}wp.Ur(ew(this.js))&&(this.Ds=!0)}}ra(){for(var t of Q_){var e=op.zr(this.ia(t));if(e&&!at(e)){var i=this.sa(t);i.persisted=!0,this.aa(t)||(i.fingerprint=this.na(e,t)),this.oa(t,e)||zi(this.props,e)}}}aa(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Y_(e))?void 0:i.storageGroup)===t}))}oa(t,e){var i=X_[t];if(!i)return!1;var r=e[i],n=this.props[i];return vt(r)&&vt(n)&&n>r}refreshKey(t){var e;if(!this.Zs){var i=this.Ls?null==(e=Y_(t))?void 0:e.storageGroup:void 0,r=i?op.zr(this.ia(i)):this.ks.zr(this.js);if(r&&t in r)this.Qs(t,r[t]);else{if(i){var n=this.ks.zr(this.js);if(n&&t in n)return void this.Qs(t,n[t])}this.Js(t)}}}save(){if(!this.Zs){var t=this.Us();t>0?ot(this.Xs)&&(this.Xs=setTimeout((()=>{this.Xs=void 0,this.ta()}),t)):this.ta()}}flush(){ot(this.Xs)||(clearTimeout(this.Xs),this.Xs=void 0,this.ta())}ta(t){void 0===t&&(t=!1),this.Zs||this.$s&&!t||(t||this.syncCookieProperties(),this.Ls?this.la():this.ua(this.ks,this.js,this.props,iw)&&this.zs(this.props))}la(){var t=this.ha(),e=t.main,i=t.groups;for(var r of(this.ua(this.ks,this.js,e,iw)&&this.zs(e),Q_)){var n,s=i[r];(!at(s)||null!=(n=this.Fs[r])&&n.persisted)&&this.ua(op,this.ia(r),s,r)}}ha(){var t={},e={flags:{},surveys:{}};return Ui(this.props,((i,r)=>{var n,s=null==(n=Y_(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i})),{main:t,groups:e}}na(t,e){if(e===iw)return JSON.stringify(t)+"|"+this.da+"|"+this.va+"|"+this.ca;var i={};return Ui(t,((t,e)=>{var r;i[e]=null!=(r=Y_(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}ua(t,e,i,r){var n,s=this.sa(r);if(r!==iw&&!s.dirty&&!ot(s.fingerprint))return!1;try{if((n=this.na(i,r))===s.fingerprint)return s.dirty=!1,!1}catch(t){n=void 0}return t.Hr(e,i,this.da,this.va,this.ca,this.Wi.debug)?(s.dirty=!1,r!==iw&&(s.persisted=!0),ot(n)||(s.fingerprint=n),!0):(this.Wi.debug&&ji.warn('failed to persist storage entry "'+e+'"; will retry on next save'),!1)}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(ot(this.Xs)||(clearTimeout(this.Xs),this.Xs=void 0),this.ks.$r(this.js,!1),this.ks.$r(this.js,!0),!i&&this.Ns)for(var r of Q_)op.$r(this.ia(r));i?delete this.Fs[iw]:this.Fs={},this.Ws=void 0,this.Vs=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(st(t)){this.syncCookieProperties(),ot(e)&&(e="None"),this.da=ot(i)?this.fa:i;var r=!1;if(Ui(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Qs(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(st(t)){this.syncCookieProperties(),this.da=ot(e)?this.fa:e;var i=!1;if(Ui(t,((e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||st(e)||rt(e))&&(this.Qs(r,e),i=!0)})),i)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();var e="string"==typeof t?[t]:t,i=!1;for(var r of e)r in this.props&&(this.Js(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==r?void 0:r.URL;if(t!==this.qs){var e=No(this.Wi.custom_campaign_params,this.Wi.mask_personal_data_properties,this.Wi.custom_personal_data_properties);at(Zi(e))||this.register(e),this.qs=t}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?jo(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Uo(),$referring_domain:null!=r&&r.referrer&&(null==(t=er(r.referrer))?void 0:t.host)||Ho},void 0)}set_initial_person_info(){this.props[ps]||this.props[gs]||this.register_once({[ms]:zo(this.Wi.mask_personal_data_properties,this.Wi.custom_personal_data_properties,this.Wi.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};Ui([gs,ps],(e=>{var i=this.props[e];i&&Ui(i,(function(e,i){t["$initial_"+Y(i)]=e}))}));var e=this.props[ms];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=Wo(t,e),r={};return Ui(i,(function(t,e){r["$initial_"+Y(e)]=t})),r}(e,this.Wi.disable_capture_url_hashes);zi(t,i)}return t}safe_merge(t){return Ui(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){var r=t.persistence!==e.persistence,n=!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every(((t,e)=>t===r[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),s=r||n,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,o=t.disable_persistence||!!i,l=!!this.Zs&&!o;o||this.Gs(e,l),this.Wi=t,!o&&(r||n||a)&&(this.Ws=void 0,this.Vs=void 0,this.Gs(p({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),l));var u=s||a?this.Bs(t):this.ks,h=this.Hs(t),d=s||h!==this.Ls,v=!o&&(d||t.cross_subdomain_cookie!==this.va||t.secure_cookie!==this.ca)&&this.Ks(l);try{if(this.fa=this.da=t.cookie_expiration,this.set_disabled(o),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),d){var c=this.props;this.clear(),this.ks=u,this.Ls=h,this.props=c,this.save()}else a&&(this.ks=u,o||(delete this.Fs[iw],this.ta()))}finally{v&&this.ea()}}set_disabled(t){this.Zs=t,this.Zs?this.remove():this.save()}set_cross_subdomain(t){t!==this.va&&(this.va=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.ca&&(this.ca=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[yn]||{};i[t]=e,this.Qs(yn,i),this.save()}remove_event_timer(t){var e=this.props[yn]||{},i=e[t];return ot(i)||(delete e[t],this.Qs(yn,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Qs(t,e),this.save()}Qs(t,e){var i;this.props[t]=e,null!=(i=Y_(t))&&i.volatile||this.pa(t)}Js(t){delete this.props[t],this.pa(t)}pa(t){var e,i=null==(e=Y_(t))?void 0:e.storageGroup;i&&(this.sa(i).dirty=!0)}sa(t){return this.Fs[t]||(this.Fs[t]={})}}var sw=Bi("[RateLimiter]");class aw{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{sw.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void sw.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,a=(new Date).getTime(),o=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(fs))&&void 0!==e?e:{tokens:n,last:a};o.tokens+=(a-o.last)/1e3*s,o.last=a,o.tokens>n&&(o.tokens=n);var l=1>o.tokens;if(l||t||(o.tokens=Math.max(0,o.tokens-1)),l&&!t){var u=(vt(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.ga(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(fs,o),{isRateLimited:l,remainingTokens:o.tokens}}ma(t){var e=this.instance.config.property_denylist;return!rt(e)||!e.includes(t)}ya(){var t;if(this.ma("$current_url")&&this.ma("$pathname")&&null!=n&&n.pathname)return""+(null!==(t=n.origin)&&void 0!==t?t:"")+n.pathname}ga(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.ya(),a=this.ma("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,o=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var ow=Bi("[RemoteConfig]");class lw{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}ba(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}_a(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return ow.info("Using preloaded remote config",this.remoteConfig),void this.wa(this.remoteConfig);if(this._instance.ka())return void ow.warn("Remote config is disabled. Falling back to local config.");this.ba((t=>{if(!t)return ow.info("No config found after loading remote JS config. Falling back to JSON."),void this._a((t=>{this.wa(t.json,t)}));this.wa(t)}))}catch(t){ow.error("Error loading remote config",t),this.wa()}}wa(t,e){!t&&e&&(0===e.statusCode?e.error||ow.warn("Failed to fetch remote config from PostHog."):ow.error("Failed to fetch remote config from PostHog."));try{this._instance.wa(t?{ok:!0,config:t}:{ok:!1})}catch(t){ow.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(t){ow.error("Error loading feature flags",t)}}}var uw=!!a||!!s,hw="text/plain",dw=!1,vw=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],a=n[1];if(!a)return t;var o=a.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},cw=function(t,e,i){var r;void 0===i&&(i=!0);var n=t.split("?"),s=n[0],a=n[1],o=p({},e),l=null!==(r=null==a?void 0:a.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=o[n])&&void 0!==e?e:r[1];return delete o[n],n+"="+s})))&&void 0!==r?r:[],u=ir(o);return u&&l.push(u),l.length>0?s+"?"+l.join("&"):s},fw=t=>{if(t.Sa)return t.Sa;var e=t.data,i=t.compression;if(e){if(i===xf){var r=io(ro(tr(e)),{mtime:0});return{contentType:hw,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Cf){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(tr(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:tr(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=tr(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},pw=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:cw(t.url,{compression:Cf}),encodedBody:fw(p({},t,{compression:Cf,Sa:void 0}))}:{url:vw(t.url,"compression"),encodedBody:fw(p({},t,{compression:void 0,Sa:void 0}))};try{e=fw(t)}catch(e){if(A(t.compression,rr(t.url,"compression")))return ji.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&A(t.compression,rr(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?P(new Uint8Array(i)):ArrayBuffer.isView(i)&&P(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(dw=!0,r()):{url:t.url,encodedBody:e}},gw=t=>{try{return pw(t)}catch(e){return ji.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},mw=function(){var t=f((function*(t){var e=tr(t.data),i=yield N(e,Ni.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{Sa:{contentType:hw,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),yw=/Failed to fetch|NetworkError|Load failed/i,bw=t=>"TypeError"===(null==t?void 0:t.name)&&yw.test((null==t?void 0:t.message)||""),_w=t=>{var e=gw(t);if(e){var i=e.url,r=e.encodedBody,n=null!=r?r:{},a=n.contentType,l=n.body,u=n.estimatedSize,h=new Headers;Ui(t.headers,(function(t,e){h.append(e,t)})),a&&h.append("Content-Type",a);var d=null,v=!1;if(o){var c=new o;d={signal:c.signal,timeout:setTimeout((()=>{var e,i;v=!0,c.abort((e=t.timeout,(i=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",i))}),t.timeout)}}var f=e=>{v&&"AbortError"===(null==e?void 0:e.name)||bw(e)?ji.warn(e):ji.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;s(i,p({method:(null==t?void 0:t.method)||"GET",headers:h,keepalive:"POST"===t.method&&!t.xa&&52428.8>(u||0),body:l,signal:null==(g=d)?void 0:g.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){ji.error(t)}null==t.callback||t.callback(r)})))).catch(f).finally((()=>d?clearTimeout(d.timeout):null))}catch(t){d&&clearTimeout(d.timeout),f(t)}}},ww=t=>{try{var e,r=pw(t),n=r.url,s=r.encodedBody,a=null!=s?s:{},o=a.body,l=a.estimatedSize;if(!o)return;var u=o instanceof Blob?o:new Blob([o],{type:a.contentType});if(i.sendBeacon(n,u))return;var h=rt(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(rt(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),v=e=>rt(t.data)?e:p({},t.data,{batch:e});return ww(p({},t,{data:v(h.slice(0,d))})),void ww(p({},t,{data:v(h.slice(d))}))}ji.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),_w(p({},t,{xa:!0}))}catch(t){ji.warn("Beacon send failed",t)}},kw=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return cw(i===xf?vw(t,"compression"):t,p({},n?{[n]:Date.now().toString()}:{},i===xf?{}:{compression:i}))},Sw=[];s&&Sw.push({transport:"fetch",method:_w}),a&&Sw.push({transport:"XHR",method(t){var e=gw(t);if(e){var i=new a,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,o=n.body;Ui(t.headers,(function(t,e){i.setRequestHeader(e,t)})),s&&i.setRequestHeader("Content-Type",s),t.timeout&&(i.timeout=t.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(o)}}}),null!=i&&i.sendBeacon&&Sw.push({transport:"sendBeacon",method:ww});var xw=3e3;class Cw{constructor(t,e){this.Ca=!0,this.Ta=[],this.Ma=Tt((null==e?void 0:e.flush_interval_ms)||xw,250,5e3,ji.createLogger("flush interval"),xw),this.Ea=t}enqueue(t){this.Ta.push(t),this.Ia||this.Ra()}unload(){this.Pa();var t=this.Ta.length>0?this.Aa():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.Fa(p({},t,{transport:"sendBeacon"}))}))}enable(){this.Ca=!1,this.Ra()}Ra(){var t=this;this.Ca||(this.Ia=setTimeout((()=>{if(this.Pa(),this.Ta.length>0){var e=this.Aa(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&rt(i.data)&&Ui(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.Fa(i)};for(var r in e)i()}}),this.Ma))}Fa(t){try{this.Ea(t)}catch(t){ji.error(t)}}Pa(){clearTimeout(this.Ia),this.Ia=void 0}Aa(){var t={};return Ui(this.Ta,(e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;ot(t[n])&&(t[n]=p({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)})),this.Ta=[],t}}var Tw=["retriesPerformedSoFar"];class Mw{constructor(e){this.Oa=!1,this.La=3e3,this.Ta=[],this._instance=e,this.Ta=[],this.Da=!0,!ot(t)&&"onLine"in t.navigator&&(this.Da=t.navigator.onLine,this.$a=()=>{this.Da=!0,this.Na()},this.qa=()=>{this.Da=!1},Ki(t,"online",this.$a),Ki(t,"offline",this.qa))}get length(){return this.Ta.length}retriableRequest(t){var e=t.retriesPerformedSoFar,i=g(t,Tw);ct(e)&&(i.url=cw(i.url,{retry_count:e})),this._instance._send_request(p({},i,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.Rn(p({retriesPerformedSoFar:e},i));0===t.statusCode&&ji.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=e?e:0)+" retries.")}null==i.callback||i.callback(t)}}))}Rn(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(r+n*(r-i))}(e),r=Date.now()+i;this.Ta.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),ji.warn(n),this.Oa||(this.Oa=!0,this.ja())}ja(){if(this.Ba&&clearTimeout(this.Ba),0===this.Ta.length)return this.Oa=!1,void(this.Ba=void 0);this.Ba=setTimeout((()=>{this.Da&&this.Ta.length>0&&this.Na(),this.ja()}),this.La)}Na(){var t=Date.now(),e=[],i=this.Ta.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.Ta=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.Ba&&(clearTimeout(this.Ba),this.Ba=void 0),this.Oa=!1,ot(t)||(this.$a&&(t.removeEventListener("online",this.$a),this.$a=void 0),this.qa&&(t.removeEventListener("offline",this.qa),this.qa=void 0)),this.Ta)){var i=e.requestOptions;try{this._instance._send_request(p({},i,{transport:"sendBeacon"}))}catch(t){ji.error(t)}}this.Ta=[]}}class Ew{constructor(t){this.Ha=()=>{var t,e,i,r;this.Ua||(this.Ua={});var n=this.scrollElement(),s=this.scrollY(),a=n?Math.max(0,n.scrollHeight-n.clientHeight):0,o=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.Ua.lastScrollY=Math.ceil(s),this.Ua.maxScrollY=Math.max(s,null!==(t=this.Ua.maxScrollY)&&void 0!==t?t:0),this.Ua.maxScrollHeight=Math.max(a,null!==(e=this.Ua.maxScrollHeight)&&void 0!==e?e:0),this.Ua.lastContentY=o,this.Ua.maxContentY=Math.max(o,null!==(i=this.Ua.maxContentY)&&void 0!==i?i:0),this.Ua.maxContentHeight=Math.max(l,null!==(r=this.Ua.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get za(){return this._instance.config.scroll_root_selector}getContext(){return this.Ua}resetContext(){var t=this.Ua;return setTimeout(this.Ha,0),t}startMeasuringScrollPosition(){Ki(t,"scroll",this.Ha,{capture:!0}),Ki(t,"scrollend",this.Ha,{capture:!0}),Ki(t,"resize",this.Ha)}scrollElement(){if(!this.za)return null==t?void 0:t.document.documentElement;var e=rt(this.za)?this.za:[this.za];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}Wa(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.za){var r=this.scrollElement();return r&&r[i]||0}return t?"y"===e?t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop||0:t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft||0:0}scrollY(){return this.Wa("y")}scrollX(){return this.Wa("x")}}var Iw=t=>zo(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class Rw{constructor(t,e,i,r){this.st=t=>{var e=this.Va();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Ga(this._instance)};this.Za.register({[cs]:i})}},this._instance=t,this.Qa=e,this.Za=i,this.Ga=r||Iw,this.Qa.onSessionId(this.st)}Va(){return this.Za.props[cs]}getSetOnceProps(){var t,e=null==(t=this.Va())?void 0:t.props;return e?"r"in e?Wo(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return Ui(Zi(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+Y(i)]=e})),t}}class Pw{on(t,e){return this.Ja[t]||(this.Ja[t]=[]),this.Ja[t].push(e),()=>{this.Ja[t]=this.Ja[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Ja[t]||[])i(e);for(var r of this.Ja["*"]||[])r(t,e)}constructor(){this.Ja={}}}var Aw=Bi("[SessionId]"),Fw=864e5;class Ow{on(t,e){return this.Ka.on(t,e)}constructor(t,e,i){var r;if(this.Ya=null,this.Xa=null,this.eo=[],this.io=void 0,this.ro=!1,this.Ka=new Pw,this.no=(t,e)=>!(!ct(t)||!ct(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Os)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Wi=t.config,this.Za=t.persistence,this.ut=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.so=void 0,this._sessionActivityTimestamp=null,this.ao=e||ep,this.oo=i||ep;var n=this.Wi.persistence_name||this.Wi.token;if(this._sessionTimeoutMs=1e3*Tt(this.Wi.session_idle_timeout_seconds||1800,60,36e3,Aw.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.lo(),this.uo="ph_"+n+"_window_id",this.ho="ph_"+n+"_primary_window_exists",this.do()){var s=wp.zr(this.uo),a=wp.zr(this.ho);s&&!a?this.ut=s:wp.$r(this.uo),wp.Hr(this.ho,!0)}null!=(r=this.Wi.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.Wi.bootstrap.sessionID),this.vo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ot(this.eo)&&(this.eo=[]),this.eo.push(t),this._e&&t(this._e,this.ut),()=>{this.eo=this.eo.filter((e=>e!==t))}}do(){return"memory"!==this.Wi.persistence&&!this.Za.Zs&&wp.Br()}co(t){t!==this.ut&&(this.ut=t,this.do()&&wp.Hr(this.uo,t))}fo(){return this.ut?this.ut:this.do()?wp.zr(this.uo):null}po(t){var e=this.Ya;return!ht(e)&&!ht(t)&&5e3>Math.abs(t-e)}mo(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this._e||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this._e=t,n&&!r||n&&this.po(e)||(this.Ya=e,this.Za.register({[On]:[e,t,i]}))}yo(){var t,e=null==(t=this.Wi)?void 0:t.persistence_save_debounce_ms;return ct(e)&&e>0}bo(){this.yo()?this.Za.refreshKey(On):(this.Za.flush(),this.Za.load())}_o(){var t;if(!ht(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Ya){this.bo();var e=this.wo();e[1]===this._e&&e[2]===this._sessionStartTimestamp&&(this.Ya=this._sessionActivityTimestamp,this.Za.register({[On]:[this._sessionActivityTimestamp,null!==(t=this._e)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Za.flush())}}ko(){var t=this.wo()[0],e=ct(t)?t:0,i=ct(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}So(t){return this.bo(),this.no(t,this.ko())}wo(){var t=this.Za.props[On];return rt(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Ya=null,this.so=void 0,clearTimeout(this.xo),this.xo=void 0,this.mo(null,null,null)}setBootstrapSessionId(t,e){void 0===e&&(e=!1);var i=function(t,e){void 0===e&&(e=(new Date).getTime());try{var i=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(t);return i>e+6e4?void Aw.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void Aw.error("Invalid sessionID in bootstrap",t)}}(t);return!ot(i)&&(e?this.so={sessionId:t,sessionStartTimestamp:i}:this.mo(t,(new Date).getTime(),i),!0)}destroy(){this.ro=!0,this._o(),clearTimeout(this.xo),this.xo=void 0,this.io&&t&&(t.removeEventListener(qs,this.io,{capture:!1}),this.io=void 0),this.eo=[]}vo(){this.io=()=>{this._o(),this.do()&&wp.$r(this.ho)},Ki(t,qs,this.io,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),this.Wi.cookieless_mode===Os)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this._e;if(i)this.Xa=r;else if(ht(this.Xa)||this.Xa>r||r-this.Xa>=1e3){var s,a;null==(s=(a=this.Za).syncCookieProperties)||s.call(a),this.Xa=r}var o=this.wo(),l=o[1],u=o[2],h=!ot(n)&&l!==n,d=this.ko(),v=this.fo(),c=this.so,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>Fw),p=c?f:ct(u)&&Math.abs(r-u)>Fw,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.no(r,d);if(_){(_=this.So(r))||Aw.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.wo();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.ao(),v=this.oo(),Aw.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.so=void 0,g=!0}else v||(v=this.oo(),g=!0),(m=m||l!==b)&&(Aw.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=ct(d)&&t&&!p?d:r,x=ct(u)?u:(new Date).getTime();this.co(v),this.mo(l,S,x),t||this.lo();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.eo.forEach((t=>t(l,v,C))),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}lo(){this.ro||(clearTimeout(this.xo),this.xo=setTimeout((()=>{if(!this.ro)if(this.So((new Date).getTime())){var t=this._e;this.resetSessionId(),this.Ka.emit("forcedIdleReset",{idleSessionId:t})}else this.lo()}),1.1*this.sessionTimeoutMs))}}var Lw=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&Q(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>Q(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function Dw(){return Dw=f((function*(){var t=null==i?void 0:i.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return lt(r)&&r.length>0?r:void 0}catch(t){return void ji.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),Dw.apply(this,arguments)}var $w="custom",Nw="i.posthog.com",qw=/^\/static\//,jw=["/s/","/e/","/i/"];class Bw{constructor(t){this.Co={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+Nw,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Co[this.apiHost]||(this.Co[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":$w),this.Co[this.apiHost]}To(t){if(qw.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Mo(t){var e=er(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Eo(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,a=(null==(s=er(i))?void 0:s.href)||i;r=n(new URL(a)).toString()}if(n&&"api"===t&&jw.some((t=>0===e.indexOf(t)))){var o=this.Mo(r);if(o){var l,u=this.apiHost,h=this.Io;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(h={apiHost:u,rewriteRequestPath:n,urls:new Set},this.Io=h),h.urls.add(o)}}return r}isIngestionEndpoint(t){var e=this.Io,i=this.Mo(t);return(null==e?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&e.urls.has(i)}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.Eo(t,e,this.uiHost+e);if("flags"===t)return this.Eo(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.To(e);if(i)return this.Eo(t,e,""+i+e)}if(this.region===$w)return this.Eo(t,e,this.apiHost+e);var r=Nw+e;switch(t){case"assets":return this.Eo(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Eo(t,e,"https://"+this.region+"."+r)}}}var Hw=Bi("[PostHog ExternalIntegrations]"),Uw={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class zw{constructor(t){this._instance=t}Ts(t,e){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return Hw.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],a=i[1];!a||null!=(e=v.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.Ts(Uw[s],(()=>{var e;null==(e=v.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!a&&null!=(r=v.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=v.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;e()}}}class Ww{constructor(t,e){this.I=t,this.ds=e,this.Ro=new Map,this.os=!1}add(t){var e=this;return f((function*(){if(e.os)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.Ro.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.Ro.set(t.name,t);try{var i=t.setup(e.ds);i&&(yield i)}catch(i){var r=e.Ro.get(t.name)===t;r&&e.Ro.delete(t.name),e.I.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.Po(t)}}))()}getExtension(t){return this.Ro.get(t)}dispose(){if(!this.os){this.os=!0;var t=Array.from(this.Ro.values()).reverse();for(var e of(this.Ro.clear(),t))this.Po(e)}}Po(t){try{var e=null==t.dispose?void 0:t.dispose();e&&nt(e.then)&&e.then(void 0,(e=>{this.I.error('Failed to dispose browser extension "'+t.name+'"',e)}))}catch(e){this.I.error('Failed to dispose browser extension "'+t.name+'"',e)}}}class Vw{constructor(t){this._instance=t}initialize(){}get(t){var e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);var i={};for(var r of t){var n=null==e?void 0:e.get_property(r);ot(n)||(i[r]=n)}return i}set(t,e){var i;null==(i=this._instance.persistence)||i.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}}var Gw="extensionsRemoteConfig";class Zw{constructor(t){this.os=!1,this.instance=t,this.I=ji,this.Ao=t.Fo,this.kv=new Vw(t),this.onEvent=t=>Sf(this.instance.on("eventCaptured",(e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.I.error("Browser extension event listener failed",t)}}))),this.onRemoteConfig=t=>{if(this.os)return Sf((()=>{}));var e=e=>{try{t(e)}catch(t){this.I.error("Browser extension remote config listener failed",t)}},i=this.instance.Oo.on(Gw,e);return this.Ao&&e(this.Ao),Sf(i)},this.Lo=new Ww(ji.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property(pn))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(pn);return"string"==typeof t?t:void 0}get library(){return{name:Ni.LIB_NAME,version:Ni.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null==(e=this.instance.persistence)?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,i,r,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(i=null==n?void 0:n.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(r=null==n?void 0:n.sessionStartTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(t){return this.Lo.add(t)}getExtension(t){return this.Lo.getExtension(t)}capture(t,e,i){var r=this;return f((function*(){i?r.instance.capture(t,e,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):r.instance.capture(t,e)}))()}registerDynamicEventProperties(t){return Sf(this.instance.Do(t))}handleRemoteConfig(t){this.os||(this.Ao=t,this.instance.Oo.emit(Gw,t))}sendRequest(t,e){var i=this;return f((function*(){var r;void 0===e&&(e={});var n=i.instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",t),s={method:e.method,url:e.query?cw(n,e.query):n,data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,compressionFallback:"flags"===e.target&&"best-available"===e.compression?C.Base64:void 0,timestampMode:e.sentAt};return"sendBeacon"===e.transport?(i.instance._send_request(s),{statusCode:202}):new Promise((t=>{s.callback=t,i.instance._send_request(s)}))}))()}dispose(){this.os||(this.os=!0,this.Lo.dispose())}}var Qw={},Jw=0,Kw=()=>{},Yw='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Xw="Surveys module not available",tk="sanitize_properties is deprecated. Use before_send instead",ek="Invalid value for property_denylist config: ",ik=["token","distinct_id",_s],rk="posthog",nk=!uw&&-1===(null==u?void 0:u.indexOf("MSIE"))&&-1===(null==u?void 0:u.indexOf("Mozilla")),sk=t=>{var e={};return t&&"unset"!==t?("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0),e):e},ak=e=>{var i;return p({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ji(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Kw,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:n&&lt(null==n?void 0:n.search)&&-1!==n.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,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==t||null==(i=t.location)?void 0:i.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",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(t){ji.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:$s,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:xw},error_tracking:{},_onCapture:Kw},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Pr,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:sk(t),external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t),cookieWinsOnConflict:!(!t||"unset"===t||"2026-08-29">t)}))(e))},ok=[["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"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],lk=t=>{var e={};for(var i of ok){var r=i[0],n=i[1];ot(t[r])||(e[n]=t[r])}var s=zi({},e,t),a=t.__preview_external_dependency_versioned_paths;return ot(a)||(ot(t.strict_script_versioning)&&(s.strict_script_versioning=!!a),lt(a)&&ot(t.asset_host)&&(s.asset_host=a)),rt(t.property_blacklist)&&(ot(t.property_denylist)?s.property_denylist=t.property_blacklist:rt(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:ji.error(ek+t.property_denylist)),s};class uk{constructor(){this.__forceAllowLocalhost=!1}get $o(){return this.__forceAllowLocalhost}set $o(t){ji.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class hk{No(t,e){if(t){var i=this.Ro.indexOf(t);-1!==i&&this.Ro.splice(i,1)}return this.Ro.push(e),null==e.initialize||e.initialize(),e}qo(){return this.config.cookieless_mode===Os||this.config.cookieless_mode===Fs&&this.consent.isRejected()}jo(){if(!this.qo()&&this.get_distinct_id()===bs){var t=this.persistence;if(t){this.Bo()||t.load(!0);var e=this.get_distinct_id();if(!e||e===bs){var i=this.config.get_device_id(ep());this.register({distinct_id:i,$device_id:i}),t.set_property(vs,Ls)}this.Ho()}}}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var t;this.webPerformance=new uk,this.Uo=!1,this.version=Ni.LIB_VERSION,this.zo=new Set,this.Wo="",this.Oo=new Pw,this.Ro=[],this.Vo=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ak(),this.SentryIntegration=G_,this.sentryIntegration=t=>function(t,e){var i=V_(t,e);return{name:W_,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Go=!1,this.Zo=null,this.Qo=null,this.Jo=null,this.scrollManager=new Ew(this),this.pageViewManager=new Z_(this),this.rateLimiter=new aw(this),this.requestRouter=new Bw(this),this.consent=new q_(this),this.externalIntegrations=new zw(this);var e=null!==(t=hk.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=lt(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=lt(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>ji.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==rk){var r,n=null!==(r=Qw[i])&&void 0!==r?r:new hk;return n._init(t,e,i),Qw[i]=n,Qw[rk][i]=n,n}return this._init(t,e,i)}_init(e,i,r){var n,s;void 0===i&&(i={});var a,o=lt(e)?e.trim():"";if(!o)return ji.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 o!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+o+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=ak(i.defaults),i.debug=this.Ko(i.debug),this.Yo=i,this.Xo=[],i.person_profiles?this.Qo=i.person_profiles:i.process_person&&(this.Qo=i.process_person);var l=ak(i.defaults),u=lk(i),h=zi({},l,u,{name:r,token:o});st(l.rageclick)&&st(u.rageclick)&&(h.rageclick=zi({},l.rageclick,u.rageclick)),st(l.session_recording)&&st(u.session_recording)&&(h.session_recording=zi({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&ji.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:xf;var d=this.Bo();if(this.persistence=new nw(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new nw(p({},this.config,{persistence:"sessionStorage"}),d,!1),this.Wo="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!d&&wp.Br()){var v=wp.zr(this.Wo);rt(v)&&v.forEach((t=>{lt(t)&&this.zo.add(t)}))}else wp.$r(this.Wo);var c=p({},this.persistence.props),f=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.tl=new Cw((t=>this.el(t)),this.config.request_queue_config),this.il=new Mw(this),this.__request_queue=[];var g=this.qo();if(g||(this.sessionManager=new Ow(this),this.sessionPropsManager=new Rw(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.rl()}))),this.nl(),this.config.__preview_deferred_init_extensions?(ji.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.sl(g)}),0)):(ji.info("Initializing extensions synchronously"),this.sl(g)),Ni.DEBUG=Ni.DEBUG||this.config.debug,Ni.DEBUG&&ji.info("Starting in debug mode",{this:this,config:i,thisC:p({},this.config),p:c,s:f}),!this.config.identity_distinct_id||null!=(n=i.bootstrap)&&n.distinctID||(i.bootstrap=p({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=i.bootstrap)?void 0:s.distinctID)){var m=i.bootstrap.distinctID,y=this.get_distinct_id(),b=this.persistence.get_property(vs);if(i.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===Ls)this.identify(m);else if(i.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===Ds)ji.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 _=this.config.get_device_id(ep()),w=i.bootstrap.isIdentifiedID?_:m;this.persistence.set_property(vs,i.bootstrap.isIdentifiedID?Ds:Ls),this.register({distinct_id:m,$device_id:w})}}if(g)this.register_once({distinct_id:bs,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(ep());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(vs,Ls)}return Ki(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||ep();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(vs,Ds)),e()},n=i.user();"then"in n&&nt(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||z_.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(z_.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(z_.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,js),identify:t=>e(t,Hs),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.al())):this.al(),nt(this.config._onCapture)&&this.config._onCapture!==Kw&&(ji.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&ji.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return Dw.apply(this,arguments)}().then((t=>{t&&this.register({[gn]:t})})).catch(Kw),this}ol(t){var e=t;return lt(e.name)&&nt(e.setup)}ll(t,e){this.ol(t)?e.push((()=>{this.ul().add(t).catch((()=>null==t.dispose?void 0:t.dispose())).catch((e=>{ji.error('Failed to dispose browser extension "'+t.name+'"',e)}))})):this.Ro.push(t)}nl(){var t,e,i,r,n,s,a=null!==(t=null==(e=this.config.__extensionClasses)?void 0:e.featureFlags)&&void 0!==t?t:null==(i=hk.__defaultExtensionClasses)?void 0:i.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(r=this.hl)||r.call(this),this.hl=void 0,this.featureFlags=new a(this)),nt(this.featureFlags.onReloading)&&nt(this.featureFlags.setup)?this.hl||(this.hl=this.featureFlags.onReloading((()=>{this.Oo.emit("featureFlagsReloading",!0)})),this.ul().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}sl(t){var e,i,r,n,s,a,o,l=performance.now(),u=p({},hk.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.Ro.push(this.exceptions=null!==(e=this.exceptions)&&void 0!==e?e:new u.exceptions(this)),u.historyAutocapture&&this.Ro.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Ro.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.Ro.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!t&&this.Ro.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.ll(this.autocapture=new u.autocapture(this),h),u.surveys&&this.ll(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this),h),u.logs&&this.ll(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this),h),u.metrics&&this.Ro.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new u.metrics(this)),u.conversations&&this.Ro.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new u.conversations(this)),u.productTours&&this.Ro.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Ro.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Ro.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Ro.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Ro.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,H_)),u.toolbar&&this.Ro.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new u.toolbar(this)),u.experiments&&this.Ro.push(this.experiments=null!==(o=this.experiments)&&void 0!==o?o:new u.experiments(this)),this.Ro.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.dl){var t=this.dl;this.dl=void 0,this.Ro.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.vl(h,l)}vl(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.vl(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){ji.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[ws]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[ks]:r}),this.config.__preview_deferred_init_extensions&&ji.info("PostHog extensions initialized ("+r+"ms)")}wa(t){var e;if(!r||!r.body)return ji.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.wa(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.dl=t),this.Fo=t,this.compression=void 0,t.ok){var i,n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=J(n.supportedCompression,xf)?xf:J(n.supportedCompression,Cf)?Cf:void 0),null!=(i=n.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.Qo?this.Qo:$s}),null==(e=this.cl)||e.handleRemoteConfig(t),this.Ro.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}al(){try{this.config.loaded(this)}catch(t){ji.critical("`loaded` function failed",t)}if(this.fl(),this.config.internal_or_test_user_hostname&&null!=n&&n.hostname){var t=n.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.qo())&&this.pl()}),1),this.gl=new lw(this),this.gl.load()}fl(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.tl)||t.enable())}_dom_loaded(){this.is_capturing()&&Hi(this.__request_queue,(t=>this.el(t))),this.__request_queue=[],this.fl()}_handle_unload(){var t,e,i,r,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.ml()&&this.capture(Bs),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.tl)||r.unload(),null==(n=this.il)||n.unload()):this.ml()&&this.capture(Bs,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?nk?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=p({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(ot(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,r,n=p({},t);n.timeout=n.timeout||6e4;var s,a,o,u,h,d=null!==(e=n.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&ot(n.compression)&&n.data&&(n.compression=Cf),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(h=(u=(rt(s=n.data)?s:[s]).map((t=>p({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{}))))[0])||null==(o=h.properties)?void 0:o.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===n.timestampMode&&(n.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),rt(t)?t.map((t=>p({},t,{sent_at:e}))):p({},t,{sent_at:e})}(n.data))),n.url=kw(n.url,n.method,n.compression,n.timestampMode);var v=Sw.filter((t=>!n.disableTransport||!t.transport||!n.disableTransport.includes(t.transport))),c=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(v,(t=>t.transport===d)))?void 0:r.method)&&void 0!==i?i:v[0].method;if(!c)throw new Error("No available transport method");var f=t=>{try{c(t)}catch(t){bw(t)?ji.warn(t):ji.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===xf&&l&&"undefined"!=typeof Promise&&!dw?mw(n).then((t=>{f(t)})).catch((e=>{if(F(e))return dw=!0,void f(p({},n,{compression:void 0,url:kw(t.url,t.method,void 0,t.timestampMode)}));O(e)&&(dw=!0),f(n)})):c(n)})(p({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}el(t){this.il?this.il.retriableRequest(t):this._send_request(t)}_execute_array(t){Jw++;try{var e,i=[],r=[],n=[];Hi(t,(t=>{if(t)if(rt(e=t[0]))n.push(t);else if(nt(t))try{t.call(this)}catch(e){ji.error("Error executing queued PostHog call",t,e)}else rt(t)&&"alias"===e?i.push(t):rt(t)&&-1!==e.indexOf("capture")&&nt(this[e])?n.push(t):r.push(t)}));var s=function(t,e){Hi(t,(function(t){try{if(rt(t[0])){var i=e;Ui(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){ji.error("Error executing queued PostHog call",t,e)}}))};s(i,this),s(r,this),s(n,this)}finally{Jw--}}push(t){if(Jw>0&&rt(t)&&lt(t[0])){var e=hk.prototype[t[0]];nt(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var r,n,s,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.tl){if(this.is_capturing())if(!ot(t)&&lt(t)){this.jo();var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=e&&e.$current_url&&!lt(null==e?void 0:e.$current_url)&&(ji.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=i&&i.yl||ji.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==i?void 0:i.timestamp)||h,v=Oe(null==i?void 0:i.uuid,ep),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===js&&this.config.__preview_capture_bot_pageviews&&l&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),u&&(c.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var f="$feature_flag_called"===t&&!1===c.properties.$feature_flag_has_experiment&&!0===this.get_property(Jn);(null==i?void 0:i.$set)&&!f&&(c.$set=null==i?void 0:i.$set);var g=null==i?void 0:i.$unset;g&&(c.$unset=g);var m=f?void 0:this.bl(null==i?void 0:i.$set_once,t!==Us,t===Hs);if(m&&(c.$set_once=m),null!=i&&i._noTruncate||(n=this.config.properties_string_max_length,s=c,a=t=>lt(t)?t.slice(0,n):t,o=new Set,c=function t(e,i){if(e!==Object(e))return a?a(e):e;if(!o.has(e)){var r;if(o.add(e),rt(e))r=[],Hi(e,(e=>{r.push(t(e))}));else{var n={};Ui(e,((e,i)=>{o.has(e)||(n[i]=t(e,i))})),r=n}return r}}(s)),c.timestamp=d,ot(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=h),f&&(c.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return S.forEach(r),e.forEach(r),i}(c.properties,ik)),t===Lf.DISMISSED||t===Lf.SENT){var y=null==e?void 0:e[Df.SURVEY_ID],b=null==e?void 0:e[Df.SURVEY_ITERATION];Wf({id:y,current_iteration:b}),c.$set=p({},c.$set,{[vo({id:y,current_iteration:b},t===Lf.SENT?"responded":"dismissed")]:!0})}else t===Lf.SHOWN&&(c.$set=p({},c.$set,{[Df.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var _=null==e?void 0:e.$product_tour_type;_&&(c.$set=p({},c.$set,{["$product_tour_last_seen_date/"+_]:(new Date).toISOString()}))}var w=p({},c.properties.$set,c.$set);if(at(w)||this.setPersonPropertiesForFlags(w),!dt(this.config.before_send)){var k=this.En(c);if(!k)return;(c=k).uuid=Oe(c.uuid,ep)}this.Oo.emit("eventCaptured",c);var x=null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),C={method:"POST",url:x,data:c,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(x)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.el(C):this.tl.enqueue(C),c}ji.critical("This capture call is ignored due to client rate limiting.")}}else ji.error("No event name provided to posthog.capture")}else ji.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}getExtension(t){var e;return null==(e=this.cl)?void 0:e.getExtension(t)}ul(){var t;return null!==(t=this.cl)&&void 0!==t?t:this.cl=new Zw(this)}Do(t){this.Vo.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.Vo.indexOf(t);-1!==i&&this.Vo.splice(i,1)}}}_l(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.Jo=null,this.persistence.get_property(vs)===Ls&&(null==(r=this.sessionPersistence)||r.clear(),this.zo.clear(),this.wl()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,i,s,a,o){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;this.persistence.syncCookieProperties(),this._l();var l=o?void 0:this.persistence.remove_event_timer(e),h=p({},i);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.qo()&&(h[_s]=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!lt(h.distinct_id)&&!vt(h.distinct_id)||ut(h.distinct_id))&&ji.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var v,c=function(e,i,r,s){var a,o,l,h;if(void 0===s&&(s=!1),!u)return{};var d,v=e?[...Oo,...i||[]]:[],c=function(t){for(var e=0;Re.length>e;e++){var i=Re[e],r=i[1],n=i[0].exec(t),s=n&&(nt(r)?r(n,t):r);if(s)return s}return["",""]}(u),f=c[0],p=c[1],g=null!=(d="undefined"!=typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},m={};ot(r)||(m.detectGoogleSearchApp=r);var y={},b=null==(a=navigator)||null==(a=a.userAgentData)?void 0:a.platform,_=null==(o=navigator)?void 0:o.maxTouchPoints,w=null==t||null==(l=t.screen)?void 0:l.width,k=null==t||null==(h=t.screen)?void 0:h.height,S=null==t?void 0:t.devicePixelRatio;ot(b)||(y.userAgentDataPlatform=b),ot(_)||(y.maxTouchPoints=_),ot(w)||(y.screenWidth=w),ot(k)||(y.screenHeight=k),ot(S)||(y.devicePixelRatio=S);var x,C=zi(Zi({$os:f,$os_version:p,$browser:Me(u,navigator.vendor,g,m),$device:Pe(u),$device_type:Ae(u,y),$timezone:Vo(),$timezone_offset:Go()}),{$current_url:nr(s?Le(null==n?void 0:n.href):null==n?void 0:n.href,v,Do),$host:null==n?void 0:n.host,$pathname:null==n?void 0:n.pathname,$raw_user_agent:u.length>1e3?u.substring(0,997)+"...":u,$browser_version:Ie(u,navigator.vendor,g,m),$browser_language:Bo(),$browser_language_prefix:(x=Bo(),"string"==typeof x?x.split("-")[0]:void 0),$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:Ni.LIB_NAME,$lib_version:Ni.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ni.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=Ni.SDK_DIST_CHANNEL),C}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var f=this.sessionManager.checkAndGetSessionAndWindowId(o,s.getTime(),!0),g=f.windowId;h.$session_id=f.sessionId,h.$window_id=g}this.sessionPropsManager&&zi(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&zi(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.il)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===$w&&(h.$lib_custom_api_host=this.config.api_host),v=e!==js||o?e!==Bs||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,a),h=zi(h,v),e===js&&r&&(h.title=r.title),!ot(l)){var y=s.getTime()-l;h.$duration=parseFloat((y/1e3).toFixed(3))}u&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),_=this.sessionPersistence.properties();Ui(["$referrer","$referring_domain"],(t=>{t in b&&delete _[t]}));var w={};if(this.Vo.length>0)for(var k of this.Vo.slice())try{zi(w,k())}catch(t){ji.error("Failed to produce browser extension event properties",t)}(h=zi({},c,b,_,p({},w,h))).$is_identified=this._isIdentified(),rt(this.config.property_denylist)?Ui(this.config.property_denylist,(function(t){delete h[t]})):ji.error(ek+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(ji.error(tk),h=S(h,e));var x=this.kl();return h.$process_person_profile=x,x&&!o&&this.Sl("_calculate_event_properties"),h}bl(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.kl())return t;if(this.Uo&&!i)return t;var n=this.persistence.get_initial_props(),s=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),a=zi({},n,s||{},t||{}),o=this.config.sanitize_properties;return o&&(ji.error(tk),a=o(a,"$set_once")),e&&(this.Uo=!0),at(a)?void 0:a}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e,i;null==(e=this.persistence)||e.syncCookieProperties(),this._l(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach((t=>this.zo.add(t))),this.wl()}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t),this.zo.delete(t),this.wl()}xl(t,e){this.register({[t]:e})}rl(){this.zo.forEach((t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)})),this.zo.clear(),this.wl()}wl(){var t;if(this.Wo)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.Zs||!wp.Br())wp.$r(this.Wo);else{var e=[];this.zo.forEach((t=>e.push(t))),e.length>0?wp.Hr(this.Wo,e):wp.$r(this.Wo)}}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e))&&void 0!==i?i:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.Oo.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Xw}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:Xw})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Xw})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Gf),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:Xw}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:Xw})}Cl(t){return!t||ut(t)?(ji.critical("Unique user id has not been set in posthog.identify"),!1):t===bs?(ji.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(ji.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,i){if(!this.__loaded||!this.persistence)return ji.uninitializedWarning("posthog.identify");if(vt(t)&&(t=t.toString(),ji.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Cl(t)&&this.Sl("posthog.identify")){this.jo();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this._l(!1),a=this.persistence.Ks(),o=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property(pn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property(mn)&&(this.unregister(mn),this.register({distinct_id:t}));var u,h=(this.persistence.get_property(vs)||Ls)===Ls,d=t!==l,v=!d&&h;if(d&&h)this.persistence.set_property(vs,Ds),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Ys(),this.capture(Hs,{distinct_id:t,$anon_distinct_id:l},{$set:e||{},$set_once:i||{}}),this.Jo=xo(t,e,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(v){this.persistence.set_property(vs,Ds);var c=e||{},f=i||{};this.setPersonPropertiesForFlags({$set:c,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence.Ys(),this.capture("$set",{$set:c,$set_once:f}),this.Jo=xo(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);d||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ls)):v&&(e||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.ea(o)}}}setPersonProperties(t,e){if((t||e)&&this.Sl("posthog.setPersonProperties")){var i=xo(this.get_distinct_id(),t,e);this.Jo!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Jo=i):ji.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(rt(t)?t:[t]).filter((t=>lt(t)&&t.length>0));0!==i.length&&this.Sl("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Jo=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this._l();var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},n,{[t]:e})}),s||i){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(Us,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else ji.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.Sl("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e=ft(t)?t:null==t?void 0:t.resetDeviceID,i=ft(t)||null==t?void 0:t.bootstrap;this.Tl(e,!1,i)}Tl(t,e,i){var r,n,s;if(void 0===e&&(e=!1),ji.info("reset"),!this.__loaded)return ji.uninitializedWarning("posthog.reset");var a=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.Yo)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.ka());var o=this.get_property(pn),l=this.get_property(gn),u=this.get_property(En),h=this.is_capturing();this.consent.reset(),e||!h||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var d=null==(s=this.persistence)||null==s.Ks?void 0:s.Ks(),v=!1;try{var c,f,g,m,y,b,_,w,k,S,x,C,T;if(null==(c=this.persistence)||c.clear(),null==(f=this.sessionPersistence)||f.clear(),this.zo.clear(),this.wl(),ot(u)||null==(S=this.persistence)||S.register({[En]:u}),null==(g=this.surveys)||g.reset(),null==(m=this.featureFlags)||m.reset(),null==(y=this.conversations)||y.reset(),null==(b=this.logs)||b.reset(),null==(_=this.metrics)||_.reset(),null==(w=this.persistence)||w.set_property(vs,Ls),null==(k=this.sessionManager)||k.resetSessionId(),this.Jo=null,this.config.cookieless_mode===Os)this.register_once({distinct_id:bs,$device_id:null},"");else{var M=this.config.get_device_id(ep());this.register_once({distinct_id:M,$device_id:t?M:o},""),t||ot(l)||this.register({[gn]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.qo()||(null==(T=this.persistence)||T.set_property(vs,i.isIdentifiedID?Ds:Ls),this.register({distinct_id:i.distinctID})),null==(x=this.featureFlags)||x.initialize(),!(ot(a)||null!=(C=this.sessionManager)&&C.setBootstrapSessionId(a,!0))){var E=p({},i);delete E.sessionID,this.config.bootstrap=E}delete this.config.identity_distinct_id,delete this.config.identity_hash,v=!0}finally{var I;d&&(null==(I=this.persistence)||null==I.ea||I.ea(v))}this.reloadFeatureFlags()}shutdown(t){var e=this;return f((function*(){var t,i,r,n,s;if(e.__loaded){e.ul().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.tl)||n.unload(),null==(s=e.il)||s.unload();try{var a;null==(a=e.featureFlags)||a.destroy()}catch(t){ji.error("Error while destroying feature flags",t)}}else ji.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Ml()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.El()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=e.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&i){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0)}return r}alias(t,e){return t===this.get_property(cn)?(ji.critical("Attempting to create alias for existing People user - aborting."),-2):this.Sl("posthog.alias")?(ot(e)&&(e=this.get_distinct_id()),t!==e?(this.xl(mn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ji.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(st(t)){var i,r,n,s,a,o,l,u,h,d,v,c;zi(this.config,lk(t));var f=this.Bo();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new nw(p({},this.config,{persistence:"sessionStorage"}),f,!1);var g,m=this.Ko(this.config.debug);ft(m)&&(this.config.debug=m),ft(this.config.debug)&&(this.config.debug?(Ni.DEBUG=!0,op.Br()&&op.Hr("ph_debug",!0),ji.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(Ni.DEBUG=!1,op.Br()&&op.$r("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.ka()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(g=this.historyAutocapture)||g.startIfEnabledOrStop()),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(v=this.surveys)||v.loadIfEnabled(),this.Ho(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){Ni.LIB_NAME=t,Ni.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,a=!0===t,o={sampling:a||!(null==t||!t.sampling),linked_flag:a||!(null==t||!t.linked_flag),url_trigger:a||!(null==t||!t.url_trigger),event_trigger:a||!(null==t||!t.event_trigger)};Object.values(o).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),o.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(p({},r,e))}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:hk.Il}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:rk;return e!==rk&&(e=rk+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(vs))===Ds||(null==(e=this.sessionPersistence)?void 0:e.get_property(vs))===Ds}kl(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===$s&&!this._isIdentified()&&at(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[mn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[ys]))}ml(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.kl()||this.Sl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Sl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Sl(t){return"never"===this.config.person_profiles?(ji.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.xl(ys,!0),!0)}Bo(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Fs)}Ho(){var t,e,i,r,n=this.Bo();return(null==(t=this.persistence)?void 0:t.Zs)!==n&&(null==(i=this.persistence)||i.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.Zs)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n&&(this.zo.clear(),this.wl()),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Os){if(this.qo()){var i,r,n,s,a;this.Tl(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new Ow(this),this.pageViewManager=new Z_(this),this.persistence&&(this.sessionPropsManager=new Rw(this,this.sessionManager,this.persistence));var o,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(a=hk.__defaultExtensionClasses)?void 0:a.sessionRecording;l&&(this.sessionRecording=this.No(this.sessionRecording,new l(this)),this.Fo&&(null==(o=this.sessionRecording)||null==o.onRemoteConfig||o.onRemoteConfig(this.Fo)))}var u,h;this.consent.optInOut(!0),this.Ho(),this.fl(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Fs&&(null==(u=this.surveys)||u.loadIfEnabled()),(ot(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.pl()}else ji.warn(Yw)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==Os?(this.config.cookieless_mode===Fs&&this.consent.isOptedIn()&&this.Tl(!0,!0),this.consent.optInOut(!1),this.Ho(),this.config.cookieless_mode===Fs&&(this.register({distinct_id:bs,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.pl(),this.fl())):ji.warn(Yw)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Os||(this.config.cookieless_mode===Fs?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Ho()}_is_bot(){return i?Lw(i,this.config.custom_blocked_useragents):void 0}pl(){r&&("visible"===r.visibilityState?this.Go||(this.Go=!0,this.capture(js,{title:r.title},{send_instantly:!0}),this.Zo&&(r.removeEventListener(Ns,this.Zo),this.Zo=null)):this.Zo||(this.Zo=this.pl.bind(this),Ki(r,Ns,this.Zo)))}debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==t||t.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}ka(){var t=this.Yo||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ji.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):function(t,e,i,r,n){var s=e in t&&!dt(t[e]),a=i in t&&!dt(t[i]);return s?t[e]:!!a&&(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,ji)}En(t){var e;if(dt(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(mt),r=rt(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),dt(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return gt(t.event)?ji.warn(a+". This can cause unexpected behavior."):ji.info(a),null}n.properties&&!at(n.properties)||ji.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return ji.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var o of i)if(n.properties&&dt(n.properties[o]))return ji.warn("Event '"+t.event+"' had its '"+o+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.Is)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Ko(t){var e=ft(t)&&!t,i=op.Br()&&"true"===op.Ur("ph_debug");return!e&&(!!i||t)}}hk.__defaultExtensionClasses={},hk.Il=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Gi(t.prototype[e[i]])}(hk,["identify"]);class dk{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=st(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.ka(),t.url_allowlist=null==i?void 0:i.url_allowlist,t.url_ignorelist=null==i?void 0:i.url_ignorelist,t.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,t.element_allowlist=null==i?void 0:i.element_allowlist,t.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,t.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,t.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,t.capture_copied_text=null==i?void 0:i.capture_copied_text}}var vk=Bi("[ExceptionAutocapture]"),ck=Bi("[TracingHeaders]"),fk=Bi("[Web Vitals]"),pk=9e5,gk=["CLS","FCP","INP","LCP"],mk=["INP","LCP"],yk=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],bk="[SessionRecording]",_k=Bi(bk),wk=Bi("[Heatmaps]");function kk(t){return st(t)&&"clientX"in t&&"clientY"in t&&vt(t.clientX)&&vt(t.clientY)}var Sk=Bi("[Product Tours]"),xk=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(Tn))},Ck=["$set_once","$set"],Tk=Bi("[SiteApps]"),Mk="Error while initializing PostHog app with config id ",Ek=(t,e)=>null!=t&&t.then?t.then(e):e(t),Ik="SDK is not enabled or survey functionality is not yet loaded",Rk="Disabled. Not loading surveys.";class Pk{constructor(t,e){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Rl=!1,this.Pl=[],this.Al=null,this.Fl=null,this.os=!1,this.Ol=new Set,this.onRemoteConfig=t=>{if(!this.os&&!this.Wi.disableSurveys){if(!t.ok)return Nf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(dt(e))return Nf.warn("Flags not loaded yet. Not loading surveys.");this.Ll=ft(e)?e:e.length>0,Nf.info("flags response received, isSurveysEnabled: "+this.Ll),this.loadIfEnabled()}},this.ls=t,this.Dl=e}setup(t){if(!this.os)return this.$l=t,Ek(t.kv.initialize(),(()=>{if(this.$l===t&&!this.os){this.$l=void 0,this.ds=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.os?e.dispose():(this.vs=e,this.loadIfEnabled())}}))}dispose(){var t,e,i;this.os||(this.os=!0,this.$l=void 0,this.ds=void 0,null==(t=this.vs)||t.dispose(),this.vs=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Pl=[],this.Al=null,this.Ol.forEach((t=>clearTimeout(t))),this.Ol.clear())}get Wi(){return this.ls.get()}initialize(){this.loadIfEnabled()}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],i=0;i<localStorage.length;i++){var r=localStorage.key(i);(null!=r&&r.startsWith(Bf)||null!=r&&r.startsWith(Hf))&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this.os&&this.ds){var t=this.Wi;if(!this._surveyManager)if(this.Rl)Nf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Nf.info(Rk);else if(t.cookielessMode&&this.ls.isOptedOut())Nf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.ls.getExtensions();if(e){if(!ot(this.Ll)||t.advancedEnableSurveys){var i=this.Ll||t.advancedEnableSurveys;this.Rl=!0;try{var r=e.generateSurveys;if(r)return this.Nl(r,i),void(this.Rl=!1);var n=e.loadExternalDependency;if(!n)return this.ql(As),void(this.Rl=!1);n((t=>{try{if(this.os)return;var e=this.ls.getExtensions();t||null==e||!e.generateSurveys?this.ql("Could not load surveys script",t):this.Nl(e.generateSurveys,i)}finally{this.Rl=!1}}))}catch(t){throw this.Rl=!1,this.ql("Error initializing surveys",t),t}}}else Nf.error("PostHog Extensions not found.")}}}Nl(t,e){this.os||(this._surveyManager=t(e),this._surveyEventReceiver=this.ls.createEventReceiver(),Nf.info("Surveys loaded successfully"),this.jl({isLoaded:!0}))}ql(t,e){Nf.error(t,e),this.jl({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Pl.push(t),this._surveyManager&&this.jl({isLoaded:!0}),()=>{this.Pl=this.Pl.filter((e=>e!==t))}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.ds)&&void 0!==i?i:this.Dl;if(r&&!this.os){if(this.Wi.disableSurveys)return Nf.info(Rk),t([]);var n=r.kv.get(is);if(n&&!e)return t(n,{isLoaded:!0}),void(this.Bl()&&this.getSurveys((()=>{}),!0));if(this.Al)this.Al.then((e=>{this.os||t(e.surveys,e.context)})).catch((t=>Nf.error("Error in survey callback",t)));else{var s=this.Hl("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.Wi.requestTimeoutMs}).then((t=>{try{return this.Ul(r,t)}catch(t){return Nf.error("Error processing surveys response",t),this.Ul(r,{statusCode:0,error:t})}}),(t=>this.Ul(r,{statusCode:0,error:t})));this.Al=s;var a=()=>{this.Al===s&&(this.Al=null)};s.then((e=>{a(),this.os||t(e.surveys,e.context)}),a).catch((t=>Nf.error("Error in survey callback",t)))}}}Hl(t,e){var i=this.ds;return i?i.sendRequest(t,e):new Promise((t=>t({statusCode:0,error:new Error(Ik)})))}Ul(t,e){if(this.os)return{surveys:[],context:{isLoaded:!1,error:Ik}};var i=e.statusCode;if(200!==i||!e.json){var r="Surveys API could not be loaded, status: "+i;return 0!==i?Nf.error(r):e.error||Nf.warn(r),this.Fl=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Fl=null;var n,s=e.json.surveys||[],a=s.filter((t=>qf(t)&&(yo(t)||jf(t))));return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),t.kv.set({[is]:s,[rs]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}Bl(){return this.zl()&&!this.Al&&!this.Wl()}zl(){var t,e,i=null==(t=null!==(e=this.ds)&&void 0!==e?e:this.Dl)?void 0:t.kv.get(rs);return vt(i)&&Date.now()-i>3e5}Wl(){return vt(this.Fl)&&3e5>Date.now()-this.Fl}markSurveyAsSeen(t,e){var i,r={id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null};Wf(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}jl(t){for(var e of this.Pl)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Nf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!dt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Nf.warn("init was not called")}Vl(t){var e=null;return this.getSurveys((i=>{var r;e=null!==(r=i.find((e=>e.id===t)))&&void 0!==r?r:null})),e}Gl(t){if(dt(this._surveyManager))return{eligible:!1,reason:Ik};var e="string"==typeof t?this.Vl(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Zl(t){if(dt(this._surveyManager))return{eligible:!1,reason:Ik};var e="string"==typeof t?this.Vl(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(dt(this._surveyManager))return Nf.warn("init was not called"),{visible:!1,disabledReason:Ik};var e=this.Zl(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return dt(this._surveyManager)?(Nf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Ik})):new Promise((i=>{this.getSurveys((e=>{var r,n=null!==(r=e.find((e=>e.id===t)))&&void 0!==r?r:null;if(n){var s=this.Zl(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var n;if(dt(this._surveyManager))Nf.warn("init was not called");else{var s="string"==typeof t?this.Vl(t):t;if(null!=s&&s.id)if(Vf.includes(s.type)){var a=null==r?void 0:r.querySelector(e);if(a)if(null!=(n=s.appearance)&&n.surveyPopupDelaySeconds){Nf.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout((()=>{var t,e;this.Ol.delete(o),this.os||(Nf.info("Rendering survey "+s.id+" with delay of "+(null==(t=s.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(s,a,i),Nf.info("Survey "+s.id+" rendered"))}),1e3*s.appearance.surveyPopupDelaySeconds);this.Ol.add(o)}else this._surveyManager.renderSurvey(s,a,i);else Nf.warn("Survey element not found")}else Nf.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Nf.warn("Survey not found")}}displaySurvey(t,e){var i;if(dt(this._surveyManager))Nf.warn("init was not called");else{var r=this.Vl(t);if(r){var n=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(n=p({},r,{appearance:p({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==$f&&e.initialResponses&&Nf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var s=this.Gl(r);if(!s.eligible)return void Nf.warn("Survey is not eligible to be displayed: ",s.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(n,e):this.renderSurvey(n,e.selector,e.properties)}else Nf.warn("Survey not found")}}cancelPendingSurvey(t){dt(this._surveyManager)?Nf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}function Ak(t,e,i){if(dt(t))return!1;switch(i){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Fk{constructor(t){this.Ql=new Set,this.Jl=new Set,this.Kl=new Pw,this.Yl=(t,e)=>this.Xl(t,e)&&this.tu(t,e)&&this.eu(t,e)&&this.iu(t,e),this.Xl=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t}init(){var t,e;ot(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.ru=null==(e=this._instance)?void 0:e._addCaptureHook(((t,e)=>{this.on(t,e)})))}dispose(){var t;null==(t=this.ru)||t.call(this),this.ru=void 0,this.Kl=new Pw}register(t){var e,i;if(!ot(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e;this.Ql.add(t),null==(e=t.steps)||e.forEach((t=>{this.Jl.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.Ql.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&r.add(t.selector)}))})),this._instance.autocapture.setElementSelectors(r)}}replace(t){this.Ql.clear(),this.Jl.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.Jl.has(t)||this.Jl.has(e.event))&&this.Ql.forEach((t=>{this.nu(e,t)&&this.Kl.emit("actionCaptured",t.name)}))}su(t){this.onAction("actionCaptured",(e=>t(e)))}nu(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.Yl(t,i))return!0;return!1}onAction(t,e){return this.Kl.on(t,e)}tu(t,e){if(null!=e&&e.url){var i,r=null==t||null==(i=t.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!Ak(r,e.url,e.url_matching||"contains"))return!1}return!0}eu(t,e){return!!this.au(t,e)&&!!this.ou(t,e)&&!!this.lu(t,e)}au(t,e){var i;if(null==e||!e.href)return!0;var r=this.uu(t);if(r.length>0)return r.some((t=>Ak(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Ak((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}ou(t,e){var i;if(null==e||!e.text)return!0;var r=this.uu(t);if(r.length>0)return r.some((t=>Ak(t.text,e.text,e.text_matching||"exact")||Ak(t.$el_text,e.text,e.text_matching||"exact")));var n,s,a,o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!o&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!dt(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(o),s=e.text,a=e.text_matching||"exact",n.some((t=>Ak(t,s,a))))}lu(t,e){var i,r;if(null==e||!e.selector)return!0;var n=null==t||null==(i=t.properties)?void 0:i.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}uu(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}iu(t,e){return null==e||!e.properties||0===e.properties.length||So(e.properties.reduce(((t,e)=>{var i=rt(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:i,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Ok{constructor(t){var e;this.hu=[],this._instance=t,this.du=new Map,this.vu=new Map,this.cu=new Map,this.fu=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId((t=>this.pu(t)))}gu(t){return!1}mu(){return null}yu(t){}bu(){}_u(t,e){return!!t&&So(t.propertyFilters,null==e?void 0:e.properties)}wu(t,e){var i=new Map;return t.forEach((t=>{var r;null==(r=t.conditions)||null==(r=r[e])||null==(r=r.values)||r.forEach((e=>{if(null!=e&&e.name){var r=i.get(e.name)||[];r.push(t.id),i.set(e.name,r)}}))})),i}ku(t,e,i){var r=(i===Tf?this.du:this.vu).get(t),n=[];return this.Su((t=>{n=t.filter((t=>null==r?void 0:r.includes(t.id)))})),n.filter((r=>{var n,s=null==(n=r.conditions)||null==(n=n[i])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this._u(s,e)}))}register(t){this.xu(t,!1)}replace(t){this.xu(t,!0)}xu(t,e){var i;ot(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Cu(t,e),this.Tu(t,e))}Tu(t,e){var i=t.filter((t=>{var e;return null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)?void 0:e.length}));if(e&&this.cu.clear(),0!==i.length){this.Mu||(this.Mu=new Fk(this._instance),this.Mu.init(),this.Mu.su((t=>this.onAction(t))));var r=[];i.forEach((t=>{var e;null==(e=t.conditions)||null==(e=e.actions)||e.values.forEach((e=>{if(r.push(e),e.name){var i,n=null!==(i=this.cu.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.cu.set(e.name,n)}}))})),e?this.Mu.replace(r):this.Mu.register(r)}else{var n;e&&(null==(n=this.Mu)||n.replace([]))}}Eu(t,e){e.forEach(((e,i)=>{var r,n=null!==(r=t.get(i))&&void 0!==r?r:[];e.forEach((t=>{n.includes(t)||n.push(t)})),t.set(i,n)}))}Cu(t,e){var i,r,n=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})),s=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0})),a=this.wu(t,Tf),o=this.wu(t,Mf);e?(this.du=a,this.vu=o):(this.Eu(this.du,a),this.Eu(this.vu,o)),(0!==n.length||0!==s.length)&&(null!==(i=this.ru)&&void 0!==i||(this.ru=null==(r=this._instance)?void 0:r._addCaptureHook(((t,e)=>{this.onEvent(t,e)}))))}onEvent(t,e){var i,r,n=this.Iu(),s=(null==e||null==(i=e.properties)?void 0:i.$survey_id)||(null==e||null==(r=e.properties)?void 0:r.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var a=this.Ru(t,s);if("consume"===a)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Pu([s]);if("persist"===a)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Au(s),void this.Fu([s])}if(this.vu.has(t)){var o=this.ku(t,e,Mf);o.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:o.map((t=>t.id))}),this.Pu(o.map((t=>t.id))),o.forEach((t=>this.Ou(t.id))))}if(this.du.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.du.get(t)});var l=this.ku(t,e,Tf);this.Lu(l.map((t=>t.id)))}}onAction(t){this.cu.has(t)&&this.Lu(this.cu.get(t)||[])}Lu(t){var e;if(0!==t.length){var i=!(null==(e=this._instance)||null==e.get_session_id||!e.get_session_id()),r=[];for(var n of t)i&&this.gu(n)?this.Au(n)&&this.Du(n):r.push(n);r.length>0&&(this.hu=[...new Set([...this.hu,...r])]),this.Iu().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Au(t){this.hu=this.hu.filter((e=>e!==t));var e=this.$u();return!e.includes(t)&&(this.Nu([...e,t]),this.qu(),!0)}Pu(t){var e=new Set(t);this.hu=this.hu.filter((t=>!e.has(t)));var i=this.ju(),r=i.filter((t=>!e.has(t)));r.length!==i.length&&(this.Nu(r),0===r.length&&this.Bu()),this.Fu(t)}Hu(){var t,e=this.mu();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}Du(t){if(this.mu()){var e=this.Hu();this.yu(p({},e,{[t]:Date.now()}))}}Fu(t){if(this.mu()){var e=this.Hu(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],a=n[1];t.includes(s)?r=!0:i[s]=a}r&&(at(i)?this.bu():this.yu(i))}}Uu(){this.mu()&&this.bu()}getActivationTimestamp(t){if(this.$u().includes(t)){var e=this.Hu()[t];return vt(e)?e:void 0}}ju(){var t,e=this.zu();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}$u(){var t,e,i=this.ju();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Wu()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}qu(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Vu(e)}Bu(){this.Gu()}pu(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Wu()];if(i&&i!==t){var r=this.ju(),n=this.Hu();r.length>0&&(this.Nu([]),r.filter((t=>vt(n[t]))).forEach((t=>this.Ou(t)))),this.Bu(),this.Uu()}}getActivatedIds(){return[...new Set([...this.$u(),...this.hu])].filter((t=>!this.Zu(t)))}dispose(){var t,e,i;null==(t=this.fu)||t.call(this),this.fu=void 0,null==(e=this.ru)||e.call(this),this.ru=void 0,null==(i=this.Mu)||i.dispose(),this.Mu=void 0}reset(){this.hu=[],this.ju().length>0&&this.Nu([]),this.Bu(),this.Uu()}getEventToItemsMap(){return this.du}Qu(){return this.Mu}}class Lk extends Ok{constructor(t){super(t)}zu(){return ns}Wu(){return ss}mu(){return as}yu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[as]:t})}bu(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(as)}gu(t){var e,i;this.Su((e=>{i=e.find((e=>e.id===t))}));var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return vt(r)&&r>0}Ju(){return Lf.SHOWN}Su(t){var e;null==(e=this._instance)||e.getSurveys(t)}Ou(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Iu(){return Nf}Nu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ns]:t})}Vu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ss]:t})}Gu(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ss)}Zu(){return!1}Ru(t,e){var i;return this.Su((t=>{i=t.find((t=>t.id===e))})),!i||bo(i)?t===Lf.SHOWN?"consume":"ignore":t===Lf.SHOWN?"persist":t===Lf.DISMISSED||t===Lf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Dk{constructor(t){this._instance=t}initialize(){}get(t){if("string"==typeof t)return this._instance.get_property(t);var e={};for(var i of t){var r=this._instance.get_property(i);ot(r)||(e[i]=r)}return e}set(t,e){this._instance.register("string"==typeof t?{[t]:e}:t)}remove(t){"string"!=typeof t?t.forEach((t=>this._instance.unregister(t))):this._instance.unregister(t)}}class $k{constructor(t){this._instance=t}get(){var t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}getExtensions(){var t=null==v?void 0:v.__PosthogExtensions__;if(t){var e=t.generateSurveys,i=t.loadExternalDependency;return{generateSurveys:e?t=>e(this._instance,t):void 0,loadExternalDependency:i?t=>i(this._instance,"surveys",t):void 0}}}createEventReceiver(){return new Lk(this._instance)}}var Nk=null!=t&&t.location?sr(t.location.hash,"__posthog")||sr(location.hash,"state"):null,qk="_postHogToolbarParams",jk=Bi("[Toolbar]"),Bk=Bi("[FeatureFlags]");class Hk{constructor(t,e){void 0===e&&(e=!1),this.Ku=!1,this.update(t,e)}update(t,e){this.Yu=((t,e)=>{var i,r,n,s,a;return{bootstrap:{featureFlags:null==(i=t.bootstrap)?void 0:i.featureFlags,featureFlagPayloads:null==(r=t.bootstrap)?void 0:r.featureFlagPayloads},remoteRequestsDisabled:e,featureFlagsDisabled:!!t.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!t.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!t.advanced_feature_flags_dedup_per_session,cacheTtlMs:t.feature_flag_cache_ttl_ms,refreshIntervalMs:null!==(n=t.remote_config_refresh_interval_ms)&&void 0!==n?n:3e5,requestTimeoutMs:t.feature_flag_request_timeout_ms,compression:t.disable_compression?void 0:"best-available",evaluationContexts:null!==(s=null!==(a=t.evaluation_contexts)&&void 0!==a?a:t.evaluation_environments)&&void 0!==s?s:[],flagKeys:rt(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Ku||(Bk.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Ku=!0),ot(t.flag_keys)||rt(t.flag_keys)||Bk.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Yu}}var Uk=Bi("[FeatureFlags]"),zk=Bi("[FeatureFlags]",{debugEnabled:!0}),Wk="\" failed. Feature flags didn't load in time.",Vk="connection_error",Gk=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},Zk=t=>{var e={};for(var i of Wi(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},Qk="Refusing to render web experiment since the viewer is a likely bot",Jk={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>_o(e,t),not_regex:(t,e)=>!_o(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Kk{get Wi(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Kk.Xu("retrieved web experiments from the server"),e.th=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.th&&(Kk.Xu("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.th)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);lt(r)&&t.variants[r]&&e.eh(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Kk.ih(s,e._instance)&&e.eh(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Kk.Xu(Qk);else if(!this.Wi.disable_web_experiments){if(dt(this.th))return this.th=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Kk.Xu("applying feature flags",t),t.forEach((t=>{var e;if(this.th&&null!=(e=this.th)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.th)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.eh(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=Kk.getWindowLocation();if(null!=t&&t.search){var e=rr(null==t?void 0:t.search,"__experiment_id"),i=rr(null==t?void 0:t.search,"__experiment_variant");e&&i&&(Kk.Xu("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.rh(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.Wi.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.Wi.disable_web_experiments&&!i)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Wi.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}rh(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(Kk.Xu("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.eh(r[0].name,e,r[0].variants[e].transforms))}static ih(t,e){return!dt(t.conditions)&&Kk.nh(t,e)&&Kk.sh(t)}static nh(t,e){var i;if(dt(t.conditions)||dt(null==(i=t.conditions)?void 0:i.url))return!0;var r=Kk.getWindowLocation();if(r){var n,s,a,o=lr(e,r.href);return null==(n=t.conditions)||!n.url||Jk[null!==(s=null==(a=t.conditions)?void 0:a.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,o)}return!1}static getWindowLocation(){return null==t?void 0:t.location}static sh(t){var e;if(dt(t.conditions)||dt(null==(e=t.conditions)?void 0:e.utm))return!0;var i=No();if(i.utm_source){var r,n,s,a,o,l,u,h,d=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,v=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(a=t.conditions)||null==(a=a.utm)?void 0:a.utm_source)==i.utm_source,c=null==(o=t.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return d&&c&&f&&v}return!1}static Xu(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];ji.info("[WebExperiments] "+t,i)}eh(t,e,i){this._is_bot()?Kk.Xu(Qk):"control"!==e?i.forEach((i=>{if(i.selector){var r;Kk.Xu("applying transform of variant "+e+" for experiment "+t+" ",i);var n=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==n||n.forEach((t=>{var e=t;i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}))}})):Kk.Xu("Control variants leave the page unmodified.")}_is_bot(){return i&&this._instance?Lw(i,this.Wi.custom_blocked_useragents):void 0}}var Yk=Bi("[Conversations]"),Xk="Conversations not available yet.",tS="console",eS="__posthogHandledLogsRequestError",iS=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[eS]=!0,i},rS=t=>!!t&&"object"==typeof t&&!0===t[eS],nS={featureFlags:class{constructor(t){this.name=Zf,this.ah=!1,this.featureFlagEventHandlers=[],this.I=Uk,this.oh={},this.lh={},this.uh=[],this.hh=!1,this.dh=!1,this.fh=0,this.ph=!1,this.gh=!1,this.mh=!1,this.yh=!1,this.bh=0,this.It=()=>{var t=this._h();this.bh=0,t&&this.reloadFeatureFlags()},this.wh=()=>{var t,e=this.kh;ot(e)||this.Wi.remoteRequestsDisabled||!r||"hidden"===r.visibilityState||Date.now()-(null!==(t=this.Sh)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.xh())},this.Et=()=>{"visible"===(null==r?void 0:r.visibilityState)&&this.wh()},"get"in t?this.ls=t:(this.Ch=new Hk(t.config,t.ka()),this.ls=this.Ch)}updateConfig(t,e){var i;null==(i=this.Ch)||i.update(t,e),this.ds&&this.Th()}setup(t){return this.$l=t,this.I=t.logger.createLogger("[FeatureFlags]"),Ek(t.kv.initialize(),(()=>{this.$l===t&&(this.$l=void 0,this.ds=t,this.Mh(t))}))}Mh(e){if(this.ds===e)return t&&Ki(t,"online",this.It),this.Th(),this.Eh=e.registerDynamicEventProperties((()=>this.Ih()?this.oh:this.lh)),this.Rh(),this.initialize()}Th(){var t=this.Wi.refreshIntervalMs,e=!this.Wi.remoteRequestsDisabled&&r&&!ot(t)&&t>0?t:void 0;e!==this.kh&&(this.Ph(),ot(e)||(this.kh=e,this.xh(),null!=r&&r.addEventListener&&Ki(r,Ns,this.Et)))}xh(){ot(this.kh)||(ot(this.Ah)||clearInterval(this.Ah),this.Sh=Date.now(),this.Ah=setInterval(this.wh,this.kh))}Ph(){ot(this.Ah)||(clearInterval(this.Ah),this.Ah=void 0,null==r||null==r.removeEventListener||r.removeEventListener(Ns,this.Et)),this.kh=void 0,this.Sh=void 0}destroy(){this.Fh()}dispose(){this.Fh()}Fh(){var e;this.Ph(),this.fh++,this.gh=!1,this.$l=void 0,this.ds&&(this.Oh(),null==(e=this.Eh)||e.dispose(),this.Eh=void 0,this.uh=[],null==t||t.removeEventListener("online",this.It),this.ds=void 0)}get Wi(){return this.ls.get()}Lh(t){var e;return null==(e=this.ds)?void 0:e.kv.get(t)}Hr(t){this.Dh((()=>{var e;return null==(e=this.ds)?void 0:e.kv.set(t)}))}$r(t){this.Dh((()=>{var e;return null==(e=this.ds)?void 0:e.kv.remove(t)}))}Dh(t){try{t()}catch(t){this.I.error("Failed to update feature flag persistence",t)}}Rh(){var t={};for(var e of[Wn,Zn,Qn,Kn]){var i=this.Lh(e);ot(i)||(t[e]=i)}this.oh=t;var r=p({},t),n=this.Lh(zn);if(n)for(var s of Object.entries(n))r["$feature/"+s[0]]=s[1];this.lh=r}Ih(){var t=this.Wi.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Lh(ds);return"number"!=typeof e||Date.now()-e>t}$h(){return!!this.Ih()&&(this.yh||this.dh||(this.yh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Nh(){var t=this.Wi.evaluationContexts;return null!=t&&t.length?t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.I.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}qh(){var t=this.Wi.flagKeys;if(!ot(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.I.error("Invalid flag key found:",t,"Expected non-empty string"),e}))}initialize(){var t,e,i=this.Wi,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,a=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},o=Object.keys(r).filter((t=>!!r[t])).reduce(((t,e)=>(t[e]=r[e]||!1,t)),{}),l=Object.keys(a).filter((t=>o[t])).reduce(((t,e)=>(t[e]=a[e],t)),{});return this.jh({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,i){var r,n,s=null!=i&&i.merge&&null!==(r=this.Lh(zn))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(n=this.Lh(Zn))&&void 0!==n?n:{},o=p({},s,t),l=p({},a,e),u={};for(var h of Object.entries(o)){var d=h[0],v=h[1];u[d]={key:d,enabled:_(v),variant:w(v),reason:void 0,metadata:ot(null==l?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.jh({flags:u})}get hasLoadedFlags(){return this.hh}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Lh(Gn),e=this.Lh(Kn),i=this.Lh(Yn);if(!i&&!e)return t||{};var r=zi({},t||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of n){var a,o,l=r[s],u=null==e?void 0:e[s],h=ot(u)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!u,d=ot(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,v=null==i?void 0:i[s],c=p({},l,{enabled:h,variant:h?null!=d?d:null==l?void 0:l.variant:void 0});h!==(null==l?void 0:l.enabled)&&(c.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(c.original_variant=null==l?void 0:l.variant),v&&(c.metadata=p({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(o=l.metadata)?void 0:o.payload})),r[s]=c}return this.ah||(this.I.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.ah=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((i=>{var r=t[i];return{key:i,enabled:_(r),variant:w(r),payload:b(e[i])}}))}getFlagVariants(){var t=this.Lh(zn),e=this.Lh(Kn);if(!e)return t||{};for(var i=zi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.ah||(this.I.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.ah=!0),i}getFlagPayloads(){var t=this.Lh(Zn),e=this.Lh(Yn);if(!e)return t||{};for(var i=zi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.ah||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.ah=!0),i}reloadFeatureFlags(){this.ph||this.Wi.featureFlagsDisabled||this._h()||this.Bh||(this.uh.slice().forEach((t=>{try{t()}catch(t){this.I.error("Error while running feature flags reloading callback",t)}})),this.Bh=setTimeout((()=>{this.Hh()}),5))}Oh(){clearTimeout(this.Bh),this.Bh=void 0}onReloading(t){return this.uh.push(t),()=>{this.uh=this.uh.filter((e=>e!==t))}}ensureFlagsLoaded(){this.hh||this.dh||this.Bh||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ph=t}resetFlagCallReported(){this.$r(ls)}Hh(t){this.Oh();var e=this.ds;if(e&&!this.Wi.remoteRequestsDisabled&&!this._h())if(this.dh)this.gh=!0;else{var i={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:p({},e.initialPersonProperties,this.Lh(Xn)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Lh(ts),timezone:Vo()};ot(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.Wi.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.Nh();r.length&&(i.evaluation_contexts=r);var n=this.qh();ot(n)||(i.flag_keys=n);var s=this.Wi.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),o=this.fh;this.dh=!0;var l=()=>{this.gh&&(this.gh=!1,this.Hh())},u=t=>{this.dh=!1,o===this.fh?(this.Hr({[hs]:[Vk]}),this.I.error("Feature flag request failed",t),l()):l()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.Wi.compression,sentAt:"body",timeoutMs:this.Wi.requestTimeoutMs}).then((t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},a=200!==t.statusCode;if(this.dh=!1,o===this.fh){if(this.Uh(t.statusCode),a||this.gh||(this.$anon_distinct_id=void 0),!i.disable_flags||this.gh){this.mh=!a;var u=[];t.error?u.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Vk:"unknown_error"):200!==t.statusCode&&u.push("api_error_"+t.statusCode),n.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(r=n.quotaLimited)||!r.includes("feature_flags"));h&&u.push("quota_limited"),this.Hr({[hs]:u}),h?this.I.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||this.jh(n,a,{partialResponse:s}),l()}}else l()})).catch(u)}catch(t){u(t)}}}_h(){return ar(this.bh,3)}Uh(t){this.bh=or(t,this.bh,3,(()=>this.I.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var i;if(void 0===e&&(e={}),!e.fresh||this.mh)if(this.hh||this.getFlags()&&this.getFlags().length>0){if(!this.$h()){var r=this.getFeatureFlagResult(t,e);return null!==(i=null==r?void 0:r.variant)&&void 0!==i?i:null==r?void 0:r.enabled}}else this.I.warn('getFeatureFlag for key "'+t+Wk)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.mh)if(this.hh||this.getFlags()&&this.getFlags().length>0){if(!this.$h()){var i,r=this.getFlagVariants(),n=t in r,s=r[t],a=this.getFlagPayloads()[t],o=String(s),l=this.Lh(Qn)||void 0,u=this.Lh(ds)||void 0,h=this.Lh(ls)||{};if(this.Wi.deduplicateCallsPerSession){var d,v=null==(d=this.ds)?void 0:d.session.sessionId,c=this.Lh(us);v&&v!==c&&(h={},i=v)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(o))i&&this.Hr({[ls]:h,[us]:i});else{var f,g,m,y,_,w,k,S,x,C,T,M;rt(h[t])?h[t].push(o):h[t]=[o],this.Hr(p({[ls]:h},i?{[us]:i}:{}));var E=this.getFeatureFlagDetails(t),I=[...null!==(f=this.Lh(hs))&&void 0!==f?f:[]];ot(s)&&I.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!==(g=null==(m=this.Wi.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(_=this.Wi.bootstrap)||null==(_=_.featureFlagPayloads)?void 0:_[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.mh};ot(null==E||null==(w=E.metadata)?void 0:w.has_experiment)||(R.$feature_flag_has_experiment=E.metadata.has_experiment),ot(null==E||null==(k=E.metadata)?void 0:k.version)||(R.$feature_flag_version=E.metadata.version);var P,A=null!==(S=null==E||null==(x=E.reason)?void 0:x.description)&&void 0!==S?S:null==E||null==(C=E.reason)?void 0:C.code;A&&(R.$feature_flag_reason=A),null!=E&&null!=(T=E.metadata)&&T.id&&(R.$feature_flag_id=E.metadata.id),ot(null==E?void 0:E.original_variant)&&ot(null==E?void 0:E.original_enabled)||(R.$feature_flag_original_response=ot(E.original_variant)?E.original_enabled:E.original_variant),null!=E&&null!=(M=E.metadata)&&M.original_payload&&(R.$feature_flag_original_payload=null==E||null==(P=E.metadata)?void 0:P.original_payload),I.length&&(R.$feature_flag_error=I.join(",")),this.zh(R)}else i&&this.Hr({[ls]:h,[us]:i});if(n)return{key:t,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:b(a)}}}else this.I.warn('getFeatureFlagResult for key "'+t+Wk)}zh(t){try{var e;null==(e=this.ds)||e.capture("$feature_flag_called",t).catch((t=>{this.I.error("Failed to capture feature flag call",t)}))}catch(t){this.I.error("Failed to capture feature flag call",t)}}getRemoteConfigPayload(t,e){this.Wh(t,e)}Wh(t,e){var i=this;return f((function*(){var r=i.ds;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.Nh();s.length&&(n.evaluation_contexts=s);var a,o=i.qh();ot(o)||(n.flag_keys=o);try{var l,u=null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.Wi.compression,sentAt:"body",timeoutMs:i.Wi.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;a=(null==u?void 0:u[t])||void 0}catch(t){return void i.I.error("Remote config feature flag request failed",t)}try{e(a)}catch(t){i.I.error("Remote config feature flag callback failed",t)}}}))()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.mh)return e.defaultValue;if(!(this.hh||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+t+Wk),e.defaultValue;var i=this.getFeatureFlag(t,e);return ot(i)?e.defaultValue:!!i}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){this.jh(t,e,i)}jh(t,e,i){if(this.ds){this.hh=!0;var r=function(t,e,i,r,n,s){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s=Uk);var a=((t,e)=>{var i=t.flags;return i?p({},t,{featureFlags:Object.fromEntries(Object.keys(i).map((t=>{var e;return[t,null!==(e=i[t].variant)&&void 0!==e?e:i[t].enabled]}))),featureFlagPayloads:Object.fromEntries(Object.keys(i).filter((t=>i[t].enabled)).filter((t=>{var e;return null==(e=i[t].metadata)?void 0:e.payload})).map((t=>{var e;return[t,null==(e=i[t].metadata)?void 0:e.payload]})))}):(t.featureFlags&&e.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t)})(t,s),o=a.flags,l=a.featureFlags,u=a.featureFlagPayloads;if(l){var h=t.requestId,d=t.evaluatedAt;if(rt(l)){s.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(l)for(var c=0;l.length>c;c++)v[l[c]]=!0;return{[Wn]:l,[zn]:v,[Jn]:!1}}var f=l,g=u,m=o;if(null!=n&&n.partialResponse)f=p({},e,f),g=p({},i,g),m=p({},r,m);else if(t.errorsWhileComputingFlags)if(o){var y=new Set(Object.keys(o).filter((t=>{var e;return!(null!=(e=o[t])&&e.failed)})));f=p({},e,Object.fromEntries(Object.entries(f).filter((t=>y.has(t[0]))))),g=p({},i,Object.fromEntries(Object.entries(g||{}).filter((t=>y.has(t[0]))))),m=p({},r,Object.fromEntries(Object.entries(m||{}).filter((t=>y.has(t[0])))))}else f=p({},e,f),g=p({},i,g),m=p({},r,m);return p({[Wn]:Object.keys(Zk(f)),[zn]:f||{},[Zn]:g||{},[Gn]:m||{},[Jn]:!0===t.minimalFlagCalledEvents},h?{[Qn]:h}:{},d?{[ds]:d}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.I);r&&this.Hr(r),e||(this.yh=!1),this.Vh(e)}}override(t,e){void 0===e&&(e=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Gh(t)}Gh(t){if(this.ds){if(!1===t)return this.$r([Kn,Yn]),this.Vh(),void zk.info("All overrides cleared");if(rt(t))return this.Hr({[Kn]:Gk(t)}),this.Vh(),void zk.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.ah=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[Kn]=rt(n)?Gk(n):n),s&&(r[Yn]=s),Object.keys(r).length&&this.Hr(r),!1===n&&!1===s?this.$r([Kn,Yn]):!1===n?this.$r(Kn):!1===s&&this.$r(Yn),this.Vh(),!1===n?zk.info("Flag overrides cleared"):n&&zk.info("Flag overrides set",{flags:n}),void(!1===s?zk.info("Payload overrides cleared"):s&&zk.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.Hr({[Kn]:t}),this.Vh(),void zk.info("Flag overrides set",{flags:t});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.hh){var e=this.Zh(),i=e.flags,r=e.flagVariants;try{t(i,r)}catch(t){this.I.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var r=(this.Lh(Vn)||[]).find((e=>e.flagKey===t)),n={["$feature_enrollment/"+t]:e},s={$feature_flag:t,$feature_enrollment:e,$set:n};r&&(s.$early_access_feature_name=r.name),i&&(s.$feature_enrollment_stage=i);var a=p({},this.getFlagVariants(),{[t]:e});this.Hr({[Wn]:Object.keys(Zk(a)),[zn]:a,[Xn]:p({},this.Lh(Xn)||{},n)}),this.Vh();try{var o;null==(o=this.ds)||o.capture("$feature_enrollment_update",s).catch((t=>{this.I.error("Failed to capture early access feature enrollment",t)}))}catch(t){this.I.error("Failed to capture early access feature enrollment",t)}}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.Lh(Vn);!r||e?this.Qh(t,i):t(r)}Qh(t,e){var i=this;return f((function*(){var r=i.ds;if(r){var n,s=e?"&"+e.map((t=>"stage="+t)).join("&"):"";try{var a=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;i.Hr({[Vn]:n=a.json.earlyAccessFeatures})}catch(t){return void i.I.error("Early access feature request failed",t)}try{t(n)}catch(t){i.I.error("Early access feature callback failed",t)}}}))()}Zh(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,i)=>(t[i]=e[i],t)),{})}}Vh(t){this.Rh();var e=this.Zh(),i=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((e=>{try{e(i,r,{errorsLoading:t})}catch(t){this.I.error("Error while running feature flags callback",t)}}))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.Jh(t,e)}Jh(t,e){void 0===e&&(e=!0);var i=this.Lh(Xn)||{},r=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),n=null==t?void 0:t.$set_once,s={};if(n)for(var a in n)({}).hasOwnProperty.call(n,a)&&(a in i||(s[a]=n[a]));this.Hr({[Xn]:p({},i,s,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=p({},this.Lh(Xn)||{});t.forEach((t=>{delete i[t]})),this.Hr({[Xn]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.$r(Xn),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Lh(ts)||{},r=p({},i);for(var n of Object.keys(t))r[n]=p({},i[n],t[n]);this.Hr({[ts]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Lh(ts)||{};this.Hr({[ts]:p({},e,{[t]:{}})})}else this.$r(ts)}reset(){this.fh++,this.gh=!1,this.oh={},this.lh={},this.hh=!1,this.ph=!1,this.mh=!1,this.$anon_distinct_id=void 0,this.Oh(),this.ah=!1,this.bh=0}}},sS={sessionRecording:class{get Wi(){return this._instance.config}get Za(){return this._instance.persistence}get started(){var t;return!(null==(t=this.Kh)||!t.isStarted)}get status(){var t,e;return this.Yh===Js||this.Yh===Ks?this.Yh:null!==(t=null==(e=this.Kh)?void 0:e.status)&&void 0!==t?t:this.Yh}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Yh=zs,this.Xh=void 0,this.td=!1,this._t=(()=>{var e;if(null==r||!r.visibilityState||"visible"===r.visibilityState)return!0;var i=null==t||null==(e=t.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=i&&i.length)||i.some((t=>"visible"===t.name))})(),this.Et=()=>{var t;"visible"===(null==r?void 0:r.visibilityState)&&(this._t=!0,null==(t=this.Kh)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw _k.error("started without valid sessionManager"),new Error(bk+" started without valid sessionManager. This is a bug.");if(this.Wi.cookieless_mode===Os)throw new Error(bk+' cannot be used with cookieless_mode="always"');null!=r&&r.addEventListener&&Ki(r,"visibilitychange",this.Et)}initialize(){this.startIfEnabledOrStop()}dispose(){this.td=!0,null==r||null==r.removeEventListener||r.removeEventListener("visibilitychange",this.Et),this.stopRecording()}get ed(){var e,i=!(null==(e=this._instance.get_property(En))||!e.enabled),r=!this.Wi.disable_session_recording,n=this.Wi.disable_session_recording||this._instance.consent.isOptedOut();return t&&i&&r&&!n}startIfEnabledOrStop(t){var e;if(!(this.td||this.ed&&null!=(e=this.Kh)&&e.isStarted)){var i=!ot(Object.assign)&&!ot(Array.from);this.ed&&i?(this.rd(t),_k.info("starting")):(this.Yh=zs,this.stopRecording())}}rd(t){var e,i,r;this.ed&&(this.Yh!==Js&&this.Yh!==Ks&&(this.Yh=Qs),null!=v&&null!=(e=v.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording?this.nd(t):null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.sd,(e=>{if(e)return this._instance.register_for_session({[Ss]:!0}),_k.error("could not load recorder",e);this.nd(t)})))}stopRecording(){var t,e;null==(t=this.Xh)||t.call(this),this.Xh=void 0,null==(e=this.Kh)||e.stop()}ad(){var t,e;null==(t=this.Xh)||t.call(this),this.Xh=void 0,null==(e=this.Kh)||e.discard()}od(){var t,e;null==(t=this.Za)||t.unregister(Ln),null==(e=this.Za)||e.unregister(In)}ld(t,e){if(dt(t))return null;var i,r=vt(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(_k.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}ud(t){if(this.Za){var e,i,r=this.Za,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=this.ld(null==(e=this.Wi.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),s=this.ld(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=n?n:s;dt(a)&&this.od();var o=null==i?void 0:i.minimumDurationMilliseconds;r.register({[En]:p({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:p({capturePerformance:t.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:ot(o)?null:o,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})})};n(),null==(e=this.Xh)||e.call(this),this.Xh=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(n)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.ud(e),void this.ad()):(this.ud(e),void this.startIfEnabledOrStop()):(this.Yh===Js&&(this.Yh=Ks,_k.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var i;void 0===e&&(e="log"),null!=(i=this.Kh)&&i.log?this.Kh.log(t,e):_k.warn("log called before recorder was ready")}get sd(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(En);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}hd(){var t,e=this._instance.get_property(En);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return _k.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!dt(t.cache_timestamp)&&Date.now()-t.cache_timestamp<=yl}nd(t){var e,i,r;if(!this.td){if(null==(e=v.__PosthogExtensions__)||!e.initSessionRecording)return _k.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ss]:!0});var n;if(this.Kh||(this.Kh=null==(n=v.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this._t),this.Kh._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.hd()){if(this.Yh===Ks||this.Yh===Js)return;return this.Yh=Js,_k.info("persisted remote config is stale, requesting fresh config before starting"),void new lw(this._instance).load()}this.Yh=Qs,null==(i=(r=this.Kh).setDocumentWasEverVisible)||i.call(r,this._t),this.Kh.start(t)}}onRRwebEmit(t){var e;null==(e=this.Kh)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Kh||null==(e=this.Za)||e.register({[Pn]:!0}),null==(t=this.Kh)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Kh||null==(e=this.Za)||e.register({[Rn]:!0}),null==(t=this.Kh)||t.overrideSampling()}overrideTrigger(t){var e,i;this.Kh||null==(i=this.Za)||i.register({["url"===t?An:Fn]:!0}),null==(e=this.Kh)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Kh)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.Kh)||!i.tryAddCustomEvent(t,e))}}},aS={autocapture:class extends k_{constructor(t){super(new dk(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.dd=this.vd()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.fd();return!!(t.path||t.search||this.pd(t))}startIfEnabled(){this.isEnabled&&(ji.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.dd=this.vd(),this.startIfEnabled()}stop(){this.gd&&this.gd(),this.gd=void 0,this.md&&this.md(),this.md=void 0,ji.info("History API monitoring stopped")}monitorHistoryChanges(){t&&t.history&&(this.yd("pushState"),this.yd("replaceState"),this.bd(),this.pd()&&this._d())}yd(e){var i;if(t&&(null==(i=t.history[e])||!i.__posthog_wrapped__)){var r=this;Fv(t.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.wd(e)}))}}vd(){var e=null==t?void 0:t.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}fd(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:st(t)?t:{}}pd(t){return void 0===t&&(t=this.fd()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}kd(t){var e=this.fd(),i=this.dd;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.pd(e)&&t.hash!==i.hash))}wd(t){try{var e=this.vd();if(!e)return;this.kd(e)&&this._instance.capture(js,{navigation_type:t}),this.dd=e}catch(e){ji.error("Error capturing "+t+" pageview",e)}}bd(){if(!this.gd){var e=()=>{this.wd("popstate")};Ki(t,"popstate",e),this.gd=()=>{t&&t.removeEventListener("popstate",e)}}}_d(){if(!this.md){var e=()=>{this.wd("hashchange")};Ki(t,"hashchange",e),this.md=()=>{t&&t.removeEventListener("hashchange",e)}}}},heatmaps:class{get Wi(){return this.instance.config}constructor(t){var e;this.Sd=!1,this.es=!1,this.xd=null,this.instance=t,this.Sd=!(null==(e=this.instance.persistence)||!e.props[_n]),this.rageclicks=new g_(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return st(this.Wi.capture_heatmaps)&&this.Wi.capture_heatmaps.flush_interval_milliseconds&&(t=this.Wi.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return dt(this.Wi.capture_heatmaps)?dt(this.Wi.enable_heatmaps)?this.Sd:this.Wi.enable_heatmaps:!1!==this.Wi.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.es)return;wk.info("starting..."),this.Cd(),this.Et()}else{var t;clearInterval(null!==(t=this.xd)&&void 0!==t?t:void 0),this.Td(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var i=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[_n]:i}),this.Sd=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.yt;return this.yt=void 0,t}Md(t){kk(t.originalEvent)&&this.Ii(t.originalEvent,"deadclick")}Et(){this.xd&&clearInterval(this.xd),this.xd=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(r)?setInterval(this.Na.bind(this),this.flushIntervalMilliseconds):null}Cd(){t&&r&&(this.Ed=this.Na.bind(this),Ki(t,qs,this.Ed),this.Id=e=>this.Ii(e||(null==t?void 0:t.event)),Ki(r,"click",this.Id,{capture:!0}),this.Rd=e=>this.Pd(e||(null==t?void 0:t.event)),Ki(r,"mousemove",this.Rd,{capture:!0}),this.Ad=new U_(this.instance,B_,this.Md.bind(this)),this.Ad.startIfEnabledOrStop(),this.Fd=this.Et.bind(this),Ki(r,Ns,this.Fd),this.es=!0)}Td(){var e;t&&r&&(this.Ed&&t.removeEventListener(qs,this.Ed),this.Id&&r.removeEventListener("click",this.Id,{capture:!0}),this.Rd&&r.removeEventListener("mousemove",this.Rd,{capture:!0}),this.Fd&&r.removeEventListener(Ns,this.Fd),clearTimeout(this.Od),null==(e=this.Ad)||e.stop(),this.es=!1)}Ld(e,i){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),a=function(e,i,r){for(var n=e;n&&pr(n)&&!gr(n,"body");){if(n===r)return!1;var s=void 0;try{var a,o,l;s=null==(a=null!==(o=null==(l=n.ownerDocument)?void 0:l.defaultView)&&void 0!==o?o:t)?void 0:a.getComputedStyle(n).position}catch(t){return!1}if(J(i,s))return!0;n=Er(n)}return!1}(Cr(e),["fixed","sticky"],s);return{x:e.clientX+(a?0:n),y:e.clientY+(a?0:r),target_fixed:a,type:i}}Ii(t,e){var i;if(void 0===e&&(e="click"),!fr(t.target)&&kk(t)){var r=this.Ld(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&Dr(Cr(t),this.instance.config.rageclick)&&this.zn(p({},r,{type:"rageclick"})),this.zn(r)}}Pd(t){!fr(t.target)&&kk(t)&&(clearTimeout(this.Od),this.Od=setTimeout((()=>{this.zn(this.Ld(t,"mousemove"))}),500))}zn(e){if(t){var i=this.Wi.disable_capture_url_hashes?Le(t.location.href):t.location.href,r=this.Wi.custom_personal_data_properties,n=this.Wi.mask_personal_data_properties?[...Oo,...r||[]]:[],s=nr(i,n,Do);this.yt=this.yt||{},this.yt[s]||(this.yt[s]=[]),this.yt[s].push(e)}}Na(){this.yt&&!at(this.yt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:U_,webVitalsAutocapture:class{constructor(t){var e;this.Sd=!1,this.es=!1,this.yt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Dd=()=>{clearTimeout(this.$d),this.$d=void 0,0!==this.yt.metrics.length&&(this._instance.capture("$web_vitals",p({$current_url:this.yt.url},this.yt.metrics.reduce(((t,e)=>p({},t,{["$web_vitals_"+e.name+"_event"]:p({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.yt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Nd=t=>{var e;if(this.yt=this.yt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},dt(null==t?void 0:t.name)||dt(null==t?void 0:t.value))fk.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.qd(i);if(!ot(r)){var n=vt(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.jd||this.jd>t.value){this.yt.navigationKey!==n&&(this.Dd(),this.$d=setTimeout(this.Dd,this.flushToCaptureTimeoutMs)),ot(this.yt.navigationKey)&&(this.yt.navigationKey=n,this.yt.url=r),this.yt.firstMetricTimestamp=ot(this.yt.firstMetricTimestamp)?Date.now():this.yt.firstMetricTimestamp;var s=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=p({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,st(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var o={};for(var l of yk){var u="url"===l&&"string"==typeof t.attribution[l]?this.qd(t.attribution[l]):t.attribution[l];ot(u)||(o[l]=u)}a.attribution=o}else delete a.attribution;ot(s)||(a.$session_id=s.sessionId,a.$window_id=s.windowId),this.yt.metrics.push(a),this.yt.metrics.length===this.allowedMetrics.length&&this.Dd()}else fk.error("Ignoring metric with value >= "+this.jd,t)}}},this.Bd=()=>{if(!this.es){var t,e,i,r,n=!1,s=v.__PosthogExtensions__,a=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.Hd])||("web-vitals"===this.Hd&&ot(a)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!ot(o)){var l=o.withoutAttribution,u=this.attributionMetrics;n=!ot(l),t=u.indexOf("LCP")>-1?o.onLCP:(null==l?void 0:l.onLCP)||o.onLCP,e=u.indexOf("CLS")>-1?o.onCLS:(null==l?void 0:l.onCLS)||o.onCLS,i=u.indexOf("FCP")>-1?o.onFCP:(null==l?void 0:l.onFCP)||o.onFCP,r=u.indexOf("INP")>-1?o.onINP:(null==l?void 0:l.onINP)||o.onINP}if(t&&e&&i&&r){var h={reportSoftNavs:this.useSoftNavs},d=n&&this.attributionMetrics.indexOf("INP")>-1?p({},h,{includeProcessedEventEntries:!1}):h;this.allowedMetrics.indexOf("LCP")>-1&&t(this.Nd.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Nd.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Nd.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&r(this.Nd.bind(this),d),this.es=!0}else fk.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Sd=!(null==(e=this._instance.persistence)||!e.props[xn]),this.startIfEnabled()}get Ud(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=st(this.Ud)?null==(t=this.Ud)?void 0:t.web_vitals_allowed_metrics:void 0;return dt(i)?(null==(e=this._instance.persistence)?void 0:e.props[Mn])||gk:i}get flushToCaptureTimeoutMs(){return(st(this.Ud)?this.Ud.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=st(this.Ud)?this.Ud.web_vitals_attribution:void 0;return ft(t)?t?gk:[]:rt(t)?t:mk}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t=st(this.Ud)?this.Ud.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get jd(){var t=st(this.Ud)&&vt(this.Ud.__web_vitals_max_value)?this.Ud.__web_vitals_max_value:pk;return t>0&&6e4>=t?pk:t}get isEnabled(){var t=null==n?void 0:n.protocol;if("http:"!==t&&"https:"!==t)return fk.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=st(this.Ud)?this.Ud.web_vitals:ft(this.Ud)?this.Ud:void 0;return ft(e)?e:this.Sd}startIfEnabled(){this.isEnabled&&!this.es&&(fk.info("enabled, starting..."),this.Ts(this.Bd))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=st(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=st(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[xn]:i}),this._instance.persistence.register({[Mn]:r})),this.Sd=i,this.startIfEnabled()}}}get Hd(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ts(t){var e=v.__PosthogExtensions__,i=this.Hd,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&ot(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,(e=>{e?fk.error("failed to load script",e):t()}))}qd(e){var i=e||(null==t?void 0:t.location.href);if(i){var r=this._instance.config.disable_capture_url_hashes?Le(i):i,n=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Oo,...n||[]]:[];return nr(r,s,Do)}fk.error("Could not determine current URL")}}},oS={exceptionObserver:class{constructor(e){var i;this.Bd=()=>{var e;if(t&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var i=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,n=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.zd&&this.Wi.capture_unhandled_errors&&(this.zd=i(this.captureException.bind(this))),!this.Wd&&this.Wi.capture_unhandled_rejections&&(this.Wd=r(this.captureException.bind(this))),!this.Vd&&this.Wi.capture_console_errors&&(this.Vd=n(this.captureException.bind(this)))}catch(t){vk.error("failed to start",t),this.Gd()}}},this._instance=e,this.Zd=!(null==(i=this._instance.persistence)||!i.props[wn]),this.oe=new Mt(p({},function(t){var e,i,r,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(i=t.exceptionRateLimiterRefillRate)&&void 0!==i?i:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(r=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,I:vk})),this.Wi=this.Qd(),this.startIfEnabledOrStop()}Qd(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return st(t)?e=p({},e,t):(ot(t)?this.Zd:t)&&(e=p({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Wi.capture_console_errors||this.Wi.capture_unhandled_errors||this.Wi.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(vk.info("enabled"),this.Gd(),this.Ts(this.Bd)):this.Gd()}Ts(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return vk.error("failed to load script",e);t()}))}Gd(){var t,e,i;null==(t=this.zd)||t.call(this),this.zd=void 0,null==(e=this.Wd)||e.call(this),this.Wd=void 0,null==(i=this.Vd)||i.call(this),this.Vd=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Zd=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[wn]:this.Zd}),this.Wi=this.Qd(),this.startIfEnabledOrStop())}}onConfigChange(){this.Wi=this.Qd()}captureException(t){var e,i,r,n=null!==(e=null==t||null==(i=t.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==e?e:"Exception";this.oe.consumeRateLimit(n)?vk.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,i;this.Jd=[],this.Kd=im(),this._instance=t,this.Jd=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(kn))&&void 0!==e?e:[],this.Yd=Li(this.Xd()),this.tv=new Di(this.Yd)}onConfigChange(){this.Yd=Li(this.Xd()),this.tv.setConfig(this.Yd)}onRemoteConfig(t){var e,i,r;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(i=n.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],a=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.Jd=s,this._instance.persistence&&this._instance.persistence.register({[kn]:this.Jd,[Sn]:a})}}}get ev(){var t,e=!!this._instance.get_property(Sn),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.Kd.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.Yd.enabled)try{if(!lt(t)||0===t.trim().length)return void Xg.warn("Ignoring exception step because message must be a non-empty string");var i=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((i,r)=>Fi.has(r)?(e.push(r),i):(i[r]=t[r],i)),{}),droppedKeys:e}}(this.iv(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&Xg.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.tv.add(p({[Pi]:t,[Ai]:(new Date).toISOString()},r))}catch(t){Xg.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.rv(e)){if(this.nv(e))return this.sv("Exception dropped: matched a suppression rule"),void Xg.info("Skipping exception capture because a suppression rule matched");if(!this.ev&&this.av(e))return this.sv("Exception dropped: thrown by a browser extension"),void Xg.info("Skipping exception capture because it was thrown by an extension");if(!this.ev&&this.ov(e))return this.sv("Exception dropped: thrown by an injected browser script"),void Xg.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.lv(e))return this.sv("Exception dropped: thrown by the PostHog SDK"),void Xg.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.Yd.enabled&&dt(t.$exception_steps)?this.uv(t):t,r="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;r&&(i.$release_id=r);try{var n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",yl:!0});return n&&this.tv.clear(),n}catch(t){return Xg.error("Failed to capture exception event. Dropping this exception.",t),void this.tv.clear()}}catch(t){return void Xg.error("Failed to process exception event. Ignoring this exception.",t)}var s}uv(t){try{var e=this.tv.getAttachable();return 0===e.length?t:p({},t,{$exception_steps:e})}catch(e){return Xg.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}sv(t){this.Yd.enabled&&this.tv.add({[Pi]:t,[Ai]:(new Date).toISOString()})}iv(t){return st(t)?p({},t):{}}Xd(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}nv(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var i=e.type,r=e.value;return lt(i)&&i.length>0&&t.$exception_types.push(i),lt(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.Jd.some((t=>{var i=t.values.map((t=>{var i=ko[t.operator],r=e[t.key];if(!i||!r)return!1;var n=rt(t.value)?t.value:[t.value];return n.length>0&&i(n,r)}));return"OR"===t.type?i.some(Boolean):i.every(Boolean)}))}catch(t){return Xg.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}av(t){var e=t.flatMap((t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}));return e.some((t=>{var e=t.filename;return!!e&&tm.some((t=>e.startsWith(t)))}))}ov(t){return t.some((t=>{var e=t.value;return lt(e)&&em.some((t=>e.includes(t)))}))}lv(t){if(t.length>0){var e,i,r,n,s=null!==(e=null==(i=t[0].stacktrace)?void 0:i.frames)&&void 0!==e?e:[],a=s[s.length-1];return null!==(r=null==a||null==(n=a.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}rv(t){return!dt(t)&&rt(t)}}},lS=p({productTours:class{get Za(){return this._instance.persistence}constructor(t){this.hv=null,this.dv=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var i,r;if(this.Za&&this.Za.register({[Tn]:!!e.productTours}),!xk(this._instance))return!this.hv&&dt(null==(i=this.Za)?void 0:i.props[os])||Sk.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.hv)||r.stop(),this.hv=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.hv&&xk(this._instance)&&this.Ts((()=>this.vv()))}Ts(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",(e=>{e?Sk.error("Could not load product tours script",e):t()}))}vv(){var t;!this.hv&&null!=(t=v.__PosthogExtensions__)&&t.generateProductTours&&(this.hv=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!rt(this.dv)||e){var i=this.Za;if(i){var r=i.props[os];if(rt(r)&&!e)return this.dv=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:e=>{if(xk(this._instance)){var r=e.statusCode;if(200!==r||!e.json){var n="Product Tours API could not be loaded, status: "+r;return 0===r?e.error||Sk.warn(n):Sk.error(n),void t([],{isLoaded:!1,error:n})}var s=rt(e.json.product_tours)?e.json.product_tours:[];this.dv=s,i&&i.register({[os]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.dv,{isLoaded:!0})}getActiveProductTours(t){dt(this.hv)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.hv.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.hv)||e.showTourById(t)}previewTour(t){this.hv?this.hv.previewTour(t):this.Ts((()=>{var e;this.vv(),null==(e=this.hv)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.hv)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.hv)||t.nextStep()}previousStep(){var t;null==(t=this.hv)||t.previousStep()}clearCache(){var t;this.dv=null,null==(t=this.Za)||t.unregister(os)}resetTour(t){var e;null==(e=this.hv)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.hv)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.hv)||e.cancelPendingTour(t)}}},nS),uS={siteApps:class{constructor(t){this.fv=0,this._instance=t,this.pv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}gv(t,e){if(e){var i=this.globalsForEvent(e);this.pv.push(i),this.pv.length>1e3&&(this.pv=this.pv.slice(10))}}get siteAppLoaders(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.gv.bind(this));this.mv=()=>{t(),this.pv=[],this.mv=void 0}}}globalsForEvent(t){var e,i,r,n,s,a,o;if(!t)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var d of Object.entries(h)){var v=d[0];l[v]={id:u[v],type:v,properties:d[1]}}var c=t.$set_once,f=t.$set;return{event:p({},g(t,Ck),{properties:p({},t.properties,f?{$set:p({},null!==(e=null==(i=t.properties)?void 0:i.$set)&&void 0!==e?e:{},f)}:{},c?{$set_once:p({},null!==(r=null==(n=t.properties)?void 0:n.$set_once)&&void 0!==r?r:{},c)}:{}),elements_chain:null!==(s=null==(a=t.properties)?void 0:a.$elements_chain)&&void 0!==s?s:"",distinct_id:null==(o=t.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}yv(t){var e,i=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Tk.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Tk.error("prepare_external_dependency_script returned null"),null):t}bv(){var t,e,i,n,s,a,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var u=null==r?void 0:r.defaultView,h=null==u||null==(t=u.Node)?void 0:t.prototype;if(!u||!h)return()=>{};if(this.fv++,this._v)return this.wv();var d=[],v=this,c=new WeakSet,f=(t,e,i)=>{if(null!=t&&t[e]){var r=t[e];t[e]=i(r),d.push((()=>{t[e]=r}))}},p=t=>{if(c.has(t))return t;var e=v.yv(t);return e&&c.add(e),e},g=t=>t.map((t=>"string"==typeof t?t:p(t))).filter((t=>!ht(t)));return f(h,"appendChild",(t=>function(e){var i=p(e);return i?t.call(this,i):e})),f(h,"insertBefore",(t=>function(e,i){var r=p(e);return r?t.call(this,r,i):e})),f(h,"replaceChild",(t=>function(e,i){var r=p(e);return r?t.call(this,r,i):i})),[null==(e=u.Element)?void 0:e.prototype,null==(i=u.Document)?void 0:i.prototype,null==(n=u.DocumentFragment)?void 0:n.prototype].forEach((t=>{f(t,"append",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})),f(t,"prepend",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))}))})),[null==(s=u.Element)?void 0:s.prototype,null==(a=u.CharacterData)?void 0:a.prototype,null==(o=u.DocumentType)?void 0:o.prototype].forEach((t=>{f(t,"before",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})),f(t,"after",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})),f(t,"replaceWith",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];var n=g(i);return i.length&&!n.length?void 0:t.apply(this,n)}))})),f(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",(t=>function(e,i){var r=p(i);return r?t.call(this,e,r):null})),this._v=()=>{d.forEach((t=>t())),this._v=void 0},this.wv()}wv(){var t=!1;return()=>{var e;t||(t=!0,this.fv--,0===this.fv&&(null==(e=this._v)||e.call(this)))}}Sv(t,e){void 0===e&&(e=!0);var i=this.bv();try{var r=t(i);return e&&i(),r}catch(t){throw i(),t}}setupSiteApp(t){var e=this.apps[t.id],i=()=>{var i;!e.errored&&this.pv.length&&(Tk.info("Processing "+this.pv.length+" events for site app with id "+t.id),this.pv.forEach((t=>this.Sv((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this.mv)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,Tk.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.Sv((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){Tk.error(Mk+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){Tk.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}xv(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of t)this.setupSiteApp(i)}Cv(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.Sv((()=>null==r.processEvent?void 0:r.processEvent(i)))}catch(e){Tk.error("Error while processing event "+t.event+" for site app "+r.id,e)}};for(var n of Object.values(this.apps))r(n)}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.xv(),void this._instance.on("eventCaptured",(t=>this.Cv(t)))):void Tk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.mv)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var a=function(){var t,e=o.id,i=o.url;v["__$$ph_site_app_"+e]=n._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,(t=>{if(t)return Tk.error(Mk+e,t)}))};for(var o of s.siteApps)a()}else Tk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},hS={tracingHeaders:class{constructor(t){this.Tv=void 0,this.Mv=void 0,this.Ev=void 0,this.Bd=()=>{var t,e,i=this.Iv();i?(ot(this.Tv)&&(this.Tv=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),ot(this.Mv)&&(this.Mv=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Gd()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Ts(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return ck.error("failed to load script",e);t()}))}Rv(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}Iv(){var t=this.Rv();return rt(t)?(rt(this.Ev)?this.Ev.splice(0,this.Ev.length,...t):this.Ev=[...t],t.length>0?this.Ev:void 0):(rt(this.Ev)&&this.Ev.splice(0),this.Ev=t||void 0,this.Ev)}Gd(){var t,e;null==(t=this.Tv)||t.call(this),null==(e=this.Mv)||e.call(this),this.Tv=void 0,this.Mv=void 0}startIfEnabledOrStop(){this.Iv()?this.Ts(this.Bd):this.Gd()}}},dS=p({surveys:class extends Pk{constructor(t){var e;super(new $k(t),{get projectToken(){return e.config.token},kv:new Dk(e=t)}),this._instance=t}Hl(t,e){var i=e.query?cw(t,e.query):t;return new Promise((t=>{var r;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",i),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:t})}))}}},nS),vS={toolbar:class{constructor(t){this.instance=t}Pv(t){v.ph_toolbar_state=t}Av(){var t;return null!==(t=v.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,i,n){if(void 0===e&&(e=void 0),void 0===i&&(i=void 0),void 0===n&&(n=void 0),Yi(this.instance.config))return!1;if(!t||!r)return!1;e=null!=e?e:t.location,n=null!=n?n:t.history;try{if(!i){try{t.localStorage.setItem("test","test"),t.localStorage.removeItem("test")}catch(t){return!1}i=null==t?void 0:t.localStorage}var s,a=Nk||sr(e.hash,"__posthog")||sr(e.hash,"state"),o=a?Vi((()=>JSON.parse(atob(decodeURIComponent(a)))))||Vi((()=>JSON.parse(decodeURIComponent(a)))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(i.getItem(qk)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(t){return!1}}Fv(t){var e=v.ph_load_toolbar||v.ph_load_editor;!dt(e)&&nt(e)?e(t,this.instance):jk.warn("No toolbar load function found")}loadToolbar(e){var i=!(null==r||!r.getElementById(hr));if(!t||i)return!1;var n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=p({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(t.localStorage.setItem(qk,JSON.stringify(p({},s,{source:void 0}))),2===this.Av())this.Fv(s);else if(0===this.Av()){var a;this.Pv(1),null==(a=v.__PosthogExtensions__)||null==a.loadExternalDependency||a.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return jk.error("[Toolbar] Failed to load",t),void this.Pv(0);this.Pv(2),this.Fv(s)})),Ki(t,"turbolinks:load",(()=>{this.Pv(0),this.loadToolbar(s)}))}return!0}Ov(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,i){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(t,e,i)}}},cS=p({experiments:Kk},nS),fS={conversations:class{constructor(t){this.Lv=void 0,this._conversationsManager=null,this.Dv=!1,this.Me=null,this.$v=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Nv=t.ok,t.ok)){var e=t.config.conversations;dt(e)||(ft(e)?this.Lv=e:(this.Lv=e.enabled,this.Me=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Lv=void 0,this.Me=null,this.Nv=void 0,this.$v=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Dv||this._instance.config.disable_conversations||Yi(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==v?void 0:v.__PosthogExtensions__;if(t&&!ot(this.Lv)&&this.Lv)if(this.Me&&this.Me.token){this.Dv=!0;try{var e=t.initConversations;if(e)return this.qv(e),void(this.Dv=!1);var i=t.loadExternalDependency;if(!i)return void this.jv(As);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.jv("Could not load conversations script",e):this.qv(t.initConversations),this.Dv=!1}))}catch(t){this.jv("Error initializing conversations",t),this.Dv=!1}}else Yk.error("Conversations enabled but missing token in remote config.")}}qv(t){if(this.Me)try{this._conversationsManager=t(this.Me,this._instance),this.$v=!1,Yk.info("Conversations loaded successfully")}catch(t){this.jv("Error completing conversations initialization",t)}else Yk.error("Cannot complete initialization: remote config is null")}jv(t,e){Yk.error(t,e),this._conversationsManager=null,this.Dv=!1,this.$v=!0}show(){this._conversationsManager?this._conversationsManager.show():Yk.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Lv&&!ht(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Yi(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Nv?"remote_config_failed":ot(this.Lv)?this.Nv?"disabled_in_project":"remote_config_pending":this.Lv?dt(this.Me)||!this.Me.token?"missing_token":null!=v&&v.__PosthogExtensions__?this.Dv?"initializing":this.$v?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,e,i){var r=this;return f((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(Yk.warn(Xk),null)}))()}getMessages(t,e){var i=this;return f((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(Yk.warn(Xk),null)}))()}markAsRead(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Yk.warn(Xk),null)}))()}getTickets(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Yk.warn(Xk),null)}))()}requestRestoreLink(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Yk.warn(Xk),null)}))()}restoreFromToken(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Yk.warn(Xk),null)}))()}restoreFromUrlToken(){var t=this;return f((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Yk.warn(Xk),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}Ml(){var t;null==(t=this._conversationsManager)||t.setIdentity()}El(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},pS={logs:class{constructor(e){var i,r=this;this.name=Qf,this.Bv=!1,this.Hv=!1,this.Uv=!1,this.I=Bi("[logs]"),this.zv=p({},this.I,{error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];e.some(rS)||r.I.error(...e)}}),this.Ta=[],this.Wv=[],this.bh=0,this.os=!1,this.Vv=()=>{var t,e;this.os||(this.bh=0,null==(t=this.Gv)||t.onReconnect(),null==(e=this.Zv)||e.onReconnect())},this._instance=e,this._instance&&null!=(i=this._instance.config.logs)&&i.captureConsoleLogs&&(this.Bv=!0),t&&Ki(t,"online",this.Vv)}Qv(t,e,i,r){var n,s=function(t,e){var i,r,n,s,a,o,l,u=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,h=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,v=ot(d)?Math.max(h,2048):Math.max(h,d),c=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(a=null==c?void 0:c["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(o=null==c?void 0:c["service.version"])&&void 0!==o?o:null==t?void 0:t.serviceVersion,environment:null!==(l=null==c?void 0:c["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:c,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new Ke(this.Jv(t,e),s,this.zv,(()=>this.Kv()),(t=>t()),void 0,r),s]}Yv(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Gv||this.Xv!==e){var i;null==(i=this.Gv)||i.reset(),this.Xv=e;var r=this.Qv((()=>this.Ta),(t=>{this.Ta=t}));this.Gv=r[0],this.tc=r[1]}return this.Gv}ec(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Zv||this.ic!==e){var i;null==(i=this.Zv)||i.reset(),this.ic=e;var r=this.Qv((()=>this.Wv),(t=>{this.Wv=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},tS);this.Zv=r[0],this.rc=r[1]}return this.Zv}setup(t){if(!this.os){this.ds=t;var e=!1,i=t.onRemoteConfig((t=>{var i;e=t.ok&&!0===(null==(i=t.config.logs)?void 0:i.captureConsoleLogs),this.onRemoteConfig(t)}));this.os?i.dispose():(this.vs=i,e||this.loadIfEnabled())}}dispose(){var e,i,r,n;this.os||(this.os=!0,null==(e=this.vs)||e.dispose(),this.vs=void 0,this.ds=void 0,this.Uv=!1,null==t||t.removeEventListener("online",this.Vv),null==(i=this.nc)||i.call(this),this.nc=void 0,null==(r=this.Gv)||r.reset(),null==(n=this.Zv)||n.reset())}onRemoteConfig(t){var e;if(!this.os&&t.ok){var i=null==(e=t.config.logs)?void 0:e.captureConsoleLogs;!dt(i)&&i&&(this.Bv=!0,this.loadIfEnabled())}}reset(){var t,e;this.Ta=[],null==(t=this.Gv)||t.reset(),this.Wv=[],null==(e=this.Zv)||e.reset(),this.bh=0}captureLog(t){this.os||this.Yv().captureLog(t)}captureConsoleLog(t){this.os||this.ec().captureLog(t)}get logger(){return this.sc||(this.sc={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.sc}flushLogs(t){t?this.ac(t):(this.Gv&&this.Gv.flush().catch((t=>this.oc(t))),this.Zv&&this.Zv.flush().catch((t=>this.oc(t))))}oc(t){rS(t)||this.I.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.os&&this.Bv&&!this.Hv&&!this.Uv){var t=null==v?void 0:v.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;if(e){this.Uv=!0;try{e(this._instance,"logs",(e=>{if(this.Uv=!1,!this.os){var i,r=t.logs;e||null==r||!r.initializeLogs?this.I.error("Could not load logs script",e):(this.nc=r.initializeLogs(null!==(i=this.ds)&&void 0!==i?i:this._instance),this.Hv=!0)}}))}catch(t){throw this.Uv=!1,t}}else this.I.error(As)}else this.I.error("PostHog Extensions not found.")}}Jv(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===x.LogsQueue?t():void 0,setPersistedProperty(t,i){var r;t===x.LogsQueue&&e(null!==(r=i)&&void 0!==r?r:[])},Fn:t=>this.Fn(t),getLibraryId:()=>Ni.LIB_NAME,getLibraryVersion:()=>Ni.LIB_VERSION}}Fn(t){return new Promise((e=>{if(ar(this.bh,3))e({kind:"fatal",error:iS(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=t=>{i||(i=!0,clearTimeout(n),e(t))},n=setTimeout((()=>{this.I.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:iS(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.lc(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.uc(e),e>=200&&300>e)r({kind:"ok"});else if(413===e)r({kind:"too-large"});else if(0!==e&&408!==e&&429!==e&&500>e)r({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var i;0===e?(t.error||this.I.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:iS(t.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("logs request failed with status "+e)})}}})}}))}uc(t){(0!==t||this._instance.__loaded)&&(this.bh=or(t,this.bh,3,(()=>this.I.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}ac(t){this.Ta.length>0&&this.hc(t,this.Ta,this.tc,Ni.LIB_NAME,(t=>{this.Ta=t})),this.Wv.length>0&&this.hc(t,this.Wv,this.rc,tS,(t=>{this.Wv=t}))}hc(t,e,i,r,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var a=Je(s,Qe(i,Ni.LIB_NAME,Ni.LIB_VERSION),r,Ni.LIB_VERSION);this._instance._send_request({method:"POST",url:this.lc(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}lc(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Kv(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=i.windowId,n=i.sessionStartTimestamp,s=i.lastActivityTimestamp;e.sessionId=i.sessionId,e.windowId=r,dt(n)||(e.sessionStartTimestamp=n),dt(s)||(e.lastActivityTimestamp=s)}if(null!=v&&null!=(t=v.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Le(v.location.href):v.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},gS={metrics:class{constructor(t){this.I=Bi("[metrics]"),this._instance=t}initialize(){}Yv(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Gv&&this.Xv===i||(null==(e=this.Gv)||e.reset(),this.Xv=i,this.Gv=new ei(this.Jv(),function(t){var e,i,r,n,s,a=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==a?void 0:a["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==a?void 0:a["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==a?void 0:a["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:a,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(i),this.I)),this.Gv}count(t,e,i){void 0===e&&(e=1),this.Yv().count(t,e,i)}gauge(t,e,i){this.Yv().gauge(t,e,i)}histogram(t,e,i){this.Yv().histogram(t,e,i)}flush(t){if(!this.Gv)return Promise.resolve();if(t){var e=this.Gv.drainWindow();return e&&this.Qn(e,t),Promise.resolve()}return this.Gv.flush().catch((t=>this.I.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.Gv)||t.reset()}Jv(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Qn:t=>e.Qn(t),getLibraryId:()=>Ni.LIB_NAME,getLibraryVersion:()=>Ni.LIB_VERSION}}Qn(t,e){return new Promise((i=>{var r=!1,n=t=>{r||(r=!0,clearTimeout(s),i(t))},s=setTimeout((()=>n({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(p({method:"POST",url:this.dc(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)n({kind:"ok"});else if(413===e)n({kind:"too-large"});else if(0!==e&&408!==e&&429!==e&&500>e)n({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var i;n({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("metrics request failed with status "+e)})}}}))}))}dc(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},mS=p({},nS,sS,aS,oS,lS,uS,dS,hS,vS,cS,fS,pS,gS);hk.__defaultExtensionClasses=p({},mS),function(){Ni.SDK_DIST_CHANNEL="cdn";var e=v.posthog;if(!e||rt(e._i)){var i=Qw[rk]=new hk;if(e){var n=[];Ui(e._i,(function(t){if(t&&rt(t)){var r=i.init(t[0],t[1],t[2]),s=e[t[2]]||e;r.__loaded&&-1===n.indexOf(s)&&(n.push(s),r._execute_array.call(r.people,s.people),r._execute_array(s))}}))}i.__SV=1,v.posthog=i,function(){function e(){e.done||(e.done=!0,nk=!1,Ui(Qw,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():Ki(r,"DOMContentLoaded",e,{capture:!1}):t&&ji.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}();
1
+ !function(){"use strict";var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t,i=null==e?void 0:e.navigator,r=null==e?void 0:e.document,n=null==e?void 0:e.location,s=null==e?void 0:e.fetch,a=null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest?e.XMLHttpRequest:void 0,o=null==e?void 0:e.AbortController,l=null==e?void 0:e.CompressionStream,u=null==i?void 0:i.userAgent;function h(){return!(!t||!1===t.navigator.onLine)}var d="undefined"!=typeof globalThis?globalThis:t;d&&"undefined"==typeof self&&(d.self=d),d&&"undefined"==typeof File&&(d.File=function(){});var v=null!=t?t:{};function c(t,e,i,r,n,s,a){try{var o=t[s](a),l=o.value}catch(t){return void i(t)}o.done?e(l):Promise.resolve(l).then(r,n)}function f(t){return function(){var e=this,i=arguments;return new Promise((function(r,n){var s=t.apply(e,i);function a(t){c(s,r,n,a,o,"next",t)}function o(t){c(s,r,n,a,o,"throw",t)}a(void 0)}))}}function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},p.apply(null,arguments)}function g(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}var m={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},y={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},b=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function _(t){return"string"==typeof t||t}function w(t){return"string"==typeof t?t:void 0}var k=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],S=function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),x=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),C="min_length",T="max_length",M=["$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"],E=["token"],I=20,R=1e3,P=1e4,A="[Circular]",F="[Truncated]",O="[Unserializable]",L="[Function]";function D(t){for(var e="",i=0;t.length>i;i++){var r=t.charCodeAt(i);if(55296>r||r>56319)e+=56320>r||r>57343?t[i]:"�";else{var n=t.charCodeAt(i+1);56320>n||n>57343?e+="�":(e+=t[i]+t[i+1],i++)}}return e}var N=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","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"],q=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return N.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function j(t,e){return-1!==t.indexOf(e)}var B=function(t){return t.trim()},H=function(t){return t.replace(/^\$/,"")};function U(t){var e,i=[];return null!==(e=JSON.stringify(t,(function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(e))return"[Circular]";i.push(e)}return e}})))&&void 0!==e?e:"null"}var z=Object.prototype,W=z.hasOwnProperty,V=z.toString,G=Array.isArray||function(t){return"[object Array]"===V.call(t)},Z=t=>"function"==typeof t,Q=t=>t===Object(t)&&!G(t),J=t=>{if(Q(t)){for(var e in t)if(W.call(t,e))return!1;return!0}return!1},K=t=>void 0===t,Y=t=>"[object String]"==V.call(t),X=t=>Y(t)&&0===t.trim().length,tt=t=>null===t,et=t=>K(t)||tt(t),it=t=>"[object Number]"==V.call(t)&&t==t,rt=t=>it(t)&&t>0,nt=t=>"[object Boolean]"===V.call(t),st=t=>t instanceof FormData,at=t=>j(M,t),ot=t=>j(E,t);function lt(t){return null===t||"object"!=typeof t}function ut(t,e){return{}.toString.call(t)==="[object "+e+"]"}function ht(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return vt(t,Error)}}function dt(t){return"undefined"!=typeof Event&&vt(t,Event)}function vt(t,e){try{return t instanceof e}catch(t){return!1}}var ct=[!0,"true",1,"1","yes"],ft=t=>j(ct,t),pt=[!1,"false",0,"0","no"];function gt(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),it(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),gt(n||i,e,i,r))}class mt{constructor(t){this.k={},this.S=t.S,this.C=gt(t.bucketSize,0,100,t.I),this.A=gt(t.refillRate,0,this.C,t.I),this.R=gt(t.refillInterval,0,864e5,t.I)}O(t,e){var i=Math.floor((e-t.lastAccess)/this.R);i>0&&(t.tokens=Math.min(t.tokens+i*this.A,this.C),t.lastAccess=t.lastAccess+i*this.R)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.k[r];return n?this.O(n,i):this.k[r]=n={tokens:this.C,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.S)||e.call(this,t)),0===n.tokens)}stop(){this.k={}}}var yt="Mobile",bt="iOS",_t="Android",wt="Tablet",kt=_t+" "+wt,St="iPad",xt="Apple",Ct=xt+" Watch",Tt="Safari",Mt="BlackBerry",Et="Samsung",It=Et+"Browser",Rt=Et+" Internet",Pt="Chrome",At=Pt+" OS",Ft=Pt+" "+bt,Ot="Internet Explorer",Lt=Ot+" "+yt,Dt="Opera",$t=Dt+" Mini",Nt="Edge",qt="Microsoft "+Nt,jt="Firefox",Bt=jt+" "+bt,Ht="Nintendo",Ut="PlayStation",zt="Xbox",Wt=_t+" "+yt,Vt=yt+" "+Tt,Gt="Windows",Zt=Gt+" Phone",Qt="Nokia",Jt="Ouya",Kt="Generic",Yt=Kt+" "+yt.toLowerCase(),Xt=Kt+" "+wt.toLowerCase(),te="Konqueror",ee="Oculus Browser",ie="Vivaldi",re="Yandex",ne="Whale",se="DuckDuckGo",ae="Pale Moon",oe="Waterfox",le="Brave",ue="Google Search App",he="(\\d+(\\.\\d+)?)",de=new RegExp("Version/"+he),ve=new RegExp(zt,"i"),ce=new RegExp(Ut+" \\w+","i"),fe=new RegExp(Ht+" \\w+","i"),pe=new RegExp(Mt+"|PlayBook|BB10","i"),ge={"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"},me=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?le:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&j(t,"GSA/")?ue:j(t," OPR/")&&j(t,"Mini")?$t:j(t," OPR/")?Dt:pe.test(t)?Mt:j(t,"IE"+yt)||j(t,"WPDesktop")?Lt:j(t,"OculusBrowser")?ee:j(t,It)?Rt:j(t,Nt)||j(t,"Edg/")?qt:j(t,ie+"/")?ie:j(t,"YaBrowser/")?re:j(t,ne+"/")?ne:j(t,se+"/")||j(t,"Ddg/")?se:j(t,"FBIOS")?"Facebook "+yt:j(t,"UCWEB")||j(t,"UCBrowser")?"UC Browser":j(t,"CriOS")?Ft:j(t,"CrMo")||j(t,Pt)?Pt:j(t,_t)&&j(t,Tt)?Wt:j(t,"FxiOS")?Bt:j(t.toLowerCase(),te.toLowerCase())?te:j(t,le+"/")?le:((t,e)=>e&&j(e,xt)||function(t){return j(t,Tt)&&!j(t,Pt)&&!j(t,_t)}(t))(t,e)?j(t,yt)?Vt:Tt:j(t,"PaleMoon/")?ae:j(t,oe+"/")?oe:j(t,jt)?jt:j(t,"MSIE")||j(t,"Trident/")?Ot:j(t,"Gecko")?jt:"")},ye={[Lt]:[new RegExp("rv:"+he)],[qt]:[new RegExp(Nt+"?\\/"+he)],[Pt]:[new RegExp("("+Pt+"|CrMo)\\/"+he)],[Ft]:[new RegExp("CriOS\\/"+he)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+he)],[Tt]:[de],[Vt]:[de],[Dt]:[new RegExp("(Opera|OPR)\\/"+he)],[jt]:[new RegExp(jt+"\\/"+he)],[Bt]:[new RegExp("FxiOS\\/"+he)],[te]:[new RegExp("Konqueror[:/]?"+he,"i")],[Mt]:[new RegExp(Mt+" "+he),de],[Wt]:[new RegExp("android\\s"+he,"i")],[Rt]:[new RegExp(It+"\\/"+he)],[ee]:[new RegExp("OculusBrowser\\/"+he)],[ie]:[new RegExp(ie+"\\/"+he)],[re]:[new RegExp("YaBrowser\\/"+he)],[ne]:[new RegExp(ne+"\\/"+he)],[le]:[new RegExp(le+"\\/"+he)],[se]:[new RegExp("(DuckDuckGo|Ddg)\\/"+he)],[ae]:[new RegExp("PaleMoon\\/"+he)],[oe]:[new RegExp(oe+"\\/"+he)],[ue]:[new RegExp("GSA\\/"+he)],[Ot]:[new RegExp("(rv:|MSIE )"+he)],Mozilla:[new RegExp("rv:"+he)]},be=function(t,e,i,r){var n=me(t,e,i,r),s=ye[n];if(K(s))return null;for(var a=0;s.length>a;a++){var o=t.match(s[a]);if(o)return parseFloat(o[o.length-2])}return null},_e=[[new RegExp(zt+"; "+zt+" (.*?)[);]","i"),t=>[zt,t&&t[1]||""]],[new RegExp(Ht,"i"),[Ht,""]],[new RegExp(Ut,"i"),[Ut,""]],[pe,[Mt,""]],[new RegExp(Gt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Zt,""];if(new RegExp(yt).test(e)&&!/IEMobile\b/.test(e))return[Gt+" "+yt,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=ge[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[Gt,r]}return[Gt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[bt,[t[3],t[4],t[5]||"0"].join(".")]:[bt,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=K(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+_t+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_t+")","i"),t=>t&&t[2]?[_t,[t[2],t[3],t[4]||"0"].join(".")]:[_t,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[At,""]],[/Linux|debian/i,["Linux",""]]],we=function(t){return fe.test(t)?Ht:ce.test(t)?Ut:ve.test(t)?zt:new RegExp(Jt,"i").test(t)?Jt:new RegExp("("+Zt+"|WPDesktop)","i").test(t)?Zt:/iPad/.test(t)?St:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ct:pe.test(t)?Mt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Qt,"i").test(t)?Qt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(yt).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?_t:kt:new RegExp("(pda|"+yt+")","i").test(t)?Yt:new RegExp(wt,"i").test(t)&&!new RegExp(wt+" pc","i").test(t)?Xt:""},ke=function(t,e){var i,r,n,s,a=we(t);return a===St||a===kt||"Kobo"===a||"Kindle Fire"===a||a===Xt?wt:a===Ht||a===zt||a===Ut||a===Jt?"Console":a===Ct?"Wearable":a?yt:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(i=null==e?void 0:e.maxTouchPoints)&&void 0!==i?i:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?yt:wt:"Desktop"},Se=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xe(t,e){return"string"==typeof(i=t)&&Se.test(i)?t:e();var i}function Ce(t,e){var i=new Error(e);try{Object.defineProperty(i,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return i}function Te(t){return t?t.split("#")[0]:t}function Me(t,e){var i=setTimeout(t,e);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function Ee(t,e,i){return Ie.apply(this,arguments)}function Ie(){return(Ie=f((function*(t,e,i){var r;try{return yield Promise.race([t,new Promise(((t,n)=>{r=Me((()=>{try{null==i||i(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var Re,Pe="NativeGzipValidationError",Ae=t=>t.length>=2&&31===t[0]&&139===t[1],Fe=(t,e)=>t===x.GZipJS||e===x.GZipJS||"gzip"===e,Oe=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Le=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Oe(t)||e===Pe},De=t=>{throw Ce(Pe,"Native gzip produced invalid output: "+t)},$e=function(){var t=f((function*(t,e){18>t.size&&De("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());Ae(i)&&8===i[2]||De("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Re)return Re;Re=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Re[t]=e>>>0}return Re})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&De("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&De("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function Ne(t,e,i){return qe.apply(this,arguments)}function qe(){return qe=f((function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),s=n.writable.getWriter(),a=s.write(r).then((()=>s.close())).catch(function(){var t=f((function*(t){try{yield s.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),o=new Response(n.readable).blob(),l=(yield Promise.all([o,a]))[0];return yield $e(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),qe.apply(this,arguments)}var je={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}},Be=je.info,He=0x8000000000000000,Ue={}.propertyIsEnumerable;function ze(t,e){try{return Ge(t,e,{ancestors:new WeakSet,remainingNodes:P},0)}catch(t){return[]}}function We(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:F};if(i.remainingNodes--,nt(t))return{boolValue:t};if("number"==typeof t){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if("undefined"==typeof BigInt)return{stringValue:String(t)};var n=BigInt(t).toString();return t>=He||-He>t?(null==e||e.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:D(t)};if("function"==typeof t)return{stringValue:L};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:A};if(r>=I)return{stringValue:F};if(t instanceof Date){var s=t.getTime(),a=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof a?D(a):String(a)}}i.ancestors.add(t);try{try{var o=t.toJSON;if("function"==typeof o)return We(o.call(t),e,i,r+1)}catch(t){}return G(t)?{arrayValue:{values:Ve(t,e,i,r+1)}}:{kvlistValue:{values:Ge(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:D(String(t))}}function Ve(t,e,i,r){for(var n=[],s=Math.min(t.length,R),a=0;s>a&&i.remainingNodes>0;a++)try{var o=a in t?t[a]:void 0;if(et(o))continue;n.push(We(o,e,i,r))}catch(t){n.push({stringValue:O})}return t.length>a&&n.push({stringValue:F}),n}function Ge(t,e,i,r){var n=[];for(var s in t)if(Ue.call(t,s)){if(n.length>=R||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=t[s];if(tt(a)||K(a))continue;n.push({key:D(s),value:We(a,e,i,r)})}catch(t){n.push({key:D(s),value:{stringValue:O}})}}return n}function Ze(t){try{return D(String(t))}catch(t){return O}}function Qe(t,e,i,r){var n,s=je[t.level||"info"]||Be,a=s.text,o=s.number,l=(void 0===(n=it(r)?r:void 0)&&(n=Date.now()),String(n)+"000000"),u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),et(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),et(e.lastActivityTimestamp)||(u.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(u["url.full"]=e.currentUrl),e.screenName&&(u["screen.name"]=e.screenName),e.appState&&(u["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(u.feature_flags=e.activeFeatureFlags);var h=p({},u),d=t.attributes;if(d){var v=[];try{v=Object.keys(d)}catch(t){v=[]}for(var c of v){var f=void 0;try{f=d[c]}catch(t){f=O}Object.defineProperty(h,c,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:a,body:{stringValue:Ze(t.body)},attributes:ze(h,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),K(t.trace_flags)||(g.flags=t.trace_flags),g}function Je(t,e,i){return p({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}function Ke(t,e,i,r){return{resourceLogs:[{resource:{attributes:ze(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}let Ye=class{constructor(t,e,i,r,n,s,a){var o;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.zi=e,this.I=i,this.hn=r,this.dn=n,this.vn=s,this.fn=a,this.pn=null,this.gn=0,this.mn=0,this.yn=0,this.bn=0,this._n=0,this.wn=!1,this.kn=e.maxBufferSize,this.Sn=Math.max(null!==(o=e.maxQueueSize)&&void 0!==o?o:e.maxBufferSize,e.maxBufferSize),this.xn=e.flushIntervalMs,this.Cn=e.maxBatchRecordsPerPost,this.Tn=e.rateCapWindowMs,this.Mn=e.maxLogsPerInterval}clearQueue(){this.mn++,this._instance.setPersistedProperty(S.LogsQueue,[])}reset(){this.En(),this.bn=0,this._n=0,this.wn=!1,this.yn=0,this.Cn=this.zi.maxBatchRecordsPerPost}onReconnect(){this.yn=0,this.In()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.Rn(t);if(null!==r)if(r.body){if(this.Pn()){var n={record:Qe(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.hn(),this.I,null==e?void 0:e.occurredAtMs)};this.dn((()=>this.An(n)))}}else this.I.info("Log was rejected in beforeSend function")}}Rn(t){var e=this.zi.beforeSend;if(!e)return t;var i=G(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.I.info("Log was rejected in beforeSend function"),null;r=s}catch(t){return this.I.error("Error in beforeSend function for log:",t),null}return r}Pn(){if(void 0===this.Mn)return!0;var t=Date.now(),e=t-this.bn;return this.Tn>e&&e>=0||(this.bn=t,this._n=0,this.wn=!1),this.Mn>this._n?(this._n++,!0):(this.wn||(this.I.warn("captureLog dropping logs: exceeded "+this.Mn+" logs per "+this.Tn+"ms"),this.wn=!0),!1)}flush(){var t=this;return f((function*(){if(!t._instance.isDisabled)return t.pn||(t.pn=t.Fn().finally((()=>{t.pn=null}))),t.pn}))()}Fn(){var t=this;return f((function*(){var e;t.En();var i=null!==(e=t._instance.getPersistedProperty(S.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,a,o=t.mn;t.gn=0;var l=Math.min(i.length,t.Cn),u=i.slice(0,l),h=u.map((t=>t.record)),d=Ke(h,t.On(),null!==(s=t.fn)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),v=yield t._instance.Ln(d);if(t.mn!==o)return;if("too-large"===v.kind&&u.length>1)t.Cn=Math.max(1,Math.floor(u.length/2)),t.I.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.Cn);else{if("retry-later"===v.kind)throw v.error;if("too-large"===v.kind?t.I.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===v.kind&&t.zi.maxBatchRecordsPerPost>t.Cn&&(t.Cn=Math.min(t.zi.maxBatchRecordsPerPost,t.Cn+1)),yield t.Dn(u.length),i=null!==(a=t._instance.getPersistedProperty(S.LogsQueue))&&void 0!==a?a:[],n+=u.length,"fatal"===v.kind)throw v.error}}}))()}Dn(t){var e=this;return f((function*(){var i,r=Math.max(0,t-e.gn),n=null!==(i=e._instance.getPersistedProperty(S.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(S.LogsQueue,n.slice(r)),yield e.vn()}))()}On(){return Je(this.zi,this._instance.getLibraryId(),this._instance.getLibraryVersion())}An(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(S.LogsQueue))&&void 0!==e?e:[];this.Sn>i.length||(i.shift(),this.gn++,this.I.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(S.LogsQueue,i),this.kn>i.length?this.$n():this.In()}}$n(t){void 0===t&&(t=this.xn),this.Nn||(this.Nn=Me((()=>{this.Nn=void 0,this.In()}),t))}qn(){var t=Math.min(Math.max(0,this.yn-1),6);return this.xn*Math.pow(2,t)}jn(){var t=this._instance.getPersistedProperty(S.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return f((function*(){e.En();var i=e.flush().catch((()=>{}));void 0!==t?yield Ee(i,t):yield i}))()}flushWithTimeout(t){var e=this;return f((function*(){var i=e.flush();yield Ee(i,t,(()=>{i.catch((()=>{}))}))}))()}In(){this.flush().then((()=>{this.yn=0}),(t=>{this.yn++,this.I.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.jn()&&this.$n(this.qn())}))}En(){this.Nn&&(clearTimeout(this.Nn),this.Nn=void 0)}};var Xe=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function ti(t){return String(t)+"000000"}function ei(t,e,i,r){var n="";return r&&(n=Object.keys(r).sort().map((t=>JSON.stringify(t)+":"+JSON.stringify(r[t]))).join(",")),t+"\0"+e+"\0"+(null!=i?i:"")+"\0"+n}let ii=class{constructor(t,e,i){this._instance=t,this.zi=e,this.I=i,this.Bn=new Map,this.pn=null,this.Hn=!1,this.Un=new Map,this.zn=new Set,this.Wn=0}count(t,e,i){void 0===e&&(e=1),this.Vn({name:t,type:"count",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(t,e,i){this.Vn({name:t,type:"gauge",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(t,e,i){this.Vn({name:t,type:"histogram",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var t=this,e=this.pn,i=function(){var i=f((function*(){e&&(yield e.catch((()=>{}))),yield t.Gn()}));return function(){return i.apply(this,arguments)}}(),r=i().finally((()=>{this.pn===r&&(this.pn=null)}));return this.pn=r,r}drainWindow(){if(0===this.Bn.size)return null;var t=this.Bn;return this.Bn=new Map,this.Hn=!1,this.Un=new Map,this.zn=new Set,this.Zn(t)}reset(){this.Wn++,this.En(),this.Bn=new Map,this.pn=null,this.Hn=!1,this.Un=new Map,this.zn=new Set}Vn(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Rn(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.I.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,r;try{i=e.attributes?p({},e.attributes):void 0,r=ei(e.type,e.name,e.unit,i)}catch(t){return void this.I.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var n=this.Bn.get(r);if(!n){if(!this.Qn())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Bn.set(r,n)}var s=this.Un.get(e.name);void 0===s?this.Un.set(e.name,e.type):s===e.type||this.zn.has(e.name)||(this.zn.add(e.name),this.I.warn("Metric name '"+e.name+"' is already used as a "+s+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Jn(n,e.value),this.$n()}else this.I.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}Qn(){return this.zi.maxSeriesPerFlush>this.Bn.size||(this.Hn||(this.Hn=!0,this.I.warn("Metric series cap reached ("+this.zi.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jn(t,e){var i;switch(t.type){case"count":t.total=(null!==(i=t.total)&&void 0!==i?i:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Xe.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[function(t,e){for(var i=0;e.length>i;i++)if(e[i]>=t)return i;return e.length}(e,Xe)]+=1}}Rn(t){var e=this.zi.beforeSend;if(!e)return t;var i=G(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.I.info("Metric was rejected in beforeSend function"),null;r=s}catch(t){return this.I.error("Error in beforeSend function for metric:",t),null}return r}$n(){this.Nn||(this.Nn=Me((()=>{this.Nn=void 0,this.flush().catch((t=>{this.I.error("Metrics flush failed:",t)}))}),this.zi.flushIntervalMs))}En(){this.Nn&&(clearTimeout(this.Nn),this.Nn=void 0)}Gn(){var t=this;return f((function*(){if(0!==t.Bn.size){var e=t.Bn;t.Bn=new Map,t.Hn=!1,t.Un=new Map,t.zn=new Set;var i=t.Wn,r=yield t._instance.Kn(t.Zn(e));if(i===t.Wn)switch(r.kind){case"ok":return;case"retry-later":return t.Yn(e),void t.$n();case"too-large":return void t.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.I.error("Failed to send metrics batch:",r.error)}}}))()}Zn(t){return e=this.Xn(t),i=function(t,e,i){return p({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}(this.zi,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:ze(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Xn(t){var e=ti(Date.now()),i=new Map;for(var r of t.values()){var n,s=ei(r.type,r.name,r.unit,void 0),a=i.get(s);a||(a=p({name:r.name},r.unit&&{unit:r.unit}),"count"===r.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===r.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(s,a));var o=ze(null!==(n=r.attributes)&&void 0!==n?n:{},this.I),l=ti(r.windowStartMs);if("count"===r.type){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:e,asDouble:null!==(u=r.total)&&void 0!==u?u:0};a.sum.dataPoints.push(h)}else if("gauge"===r.type){var d,v={attributes:o,timeUnixNano:e,asDouble:null!==(d=r.last)&&void 0!==d?d:0};a.gauge.dataPoints.push(v)}else r.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:Xe})}return Array.from(i.values())}Yn(t){var e,i;for(var r of t){var n=r[0],s=r[1],a=this.Bn.get(n);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,s.windowStartMs),a.type){case"count":a.total=(null!==(e=a.total)&&void 0!==e?e:0)+(null!==(i=s.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(s.hist)if(a.hist){a.hist.count+=s.hist.count,a.hist.sum+=s.hist.sum,a.hist.min=Math.min(a.hist.min,s.hist.min),a.hist.max=Math.max(a.hist.max,s.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=s.hist.bucketCounts[o]}else a.hist=s.hist}else this.Qn()&&this.Bn.set(n,s)}}};function ri(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var ni,si,ai;function oi(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return ai&&i.length===si||(si=i.length,ai=i.reduce(((i,r)=>{ni||(ni={});var n=ni[r];if(n)i[n[0]]=n[1];else for(var s=t(r),a=s.length-1;a>=0;a--){var o=s[a],l=null==o?void 0:o.filename,u=e[r];if(l&&u){i[l]=u,ni[r]=[l,u];break}}return i}),{})),ai}}class li{constructor(t,e,i){void 0===i&&(i=[]),this.coercers=t,this.stackParser=e,this.modifiers=i}buildFromUnknown(t,e){void 0===e&&(e={});var i=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(t){var e=this;return f((function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&G(i.stacktrace.frames)&&(i.stacktrace.frames=yield e.applyModifiers(i.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,r;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(r=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),p({},t,{cause:i,stack:r})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var i of this.coercers)if(i.match(t))return i.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return f((function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i}))()}convertToExceptionList(t,e){var i,r,n,s={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(r=e.handled)||void 0===r||r,synthetic:null!==(n=t.synthetic)&&void 0!==n&&n}};t.stack&&(s.stacktrace={type:"raw",frames:t.stack});var a=[s];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,p({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:oi(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var r=(i,r)=>{if(4>=r){var n=this.buildCoercingContext(t,e,r);return this.applyCoercers(i,n)}};return p({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}}var ui="?";function hi(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?ui:i,in_app:!(null!=e&&e.startsWith("webkit-masked-url://"))&&"<anonymous>"!==e};return K(r)||(s.lineno=r),K(n)||(s.colno=n),s}var di=(t,e)=>{var i=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return i||r?[-1!==t.indexOf("@")?t.split("@")[0]:ui,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},vi=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ci=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,fi=/\((\S*)(?::(\d+))(?::(\d+))\)/,pi=(t,e)=>{var i=vi.exec(t);if(i)return hi(e,i[1],ui,+i[2],+i[3]);var r=ci.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=fi.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=di(r[1]||ui,r[2]);return hi(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},gi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,mi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,yi=(t,e)=>{var i=gi.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=mi.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var n=i[3],s=i[1]||ui,a=di(s,n);return hi(e,n=a[1],s=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},bi=/\(error: (.*)\)/,_i=50;class wi{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Y(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return ut(t,"DOMException")}isDOMError(t){return ut(t,"DOMError")}}class ki{match(t){return ht(t)}coerce(t,e){var i,r=this.getStack(t),n=void 0===r;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=r?r:null==(i=e.syntheticException)?void 0:i.stack,cause:t.cause?e.next(t.cause):void 0,synthetic:n}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var i=t.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(t){return t.stacktrace||t.stack||void 0}}class Si{constructor(){}match(t){return!!ut(t,"ErrorEvent")&&(null!=t.error||this.ki(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var r=e.apply(t.message);return p({},r,{stack:null!==(i=this.Si(t))&&void 0!==i?i:r.stack,synthetic:!0})}ki(t){return Y(t.message)&&t.message.length>0}Si(t){var e,i,r=t,n=null!==(e=r.lineno)&&void 0!==e?e:0,s=null!==(i=r.colno)&&void 0!==i?i:0;if(Y(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}}var xi=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Ci{match(t){return"string"==typeof t}coerce(t,e){var i,r=this.getInfos(t),n=r[0],s=r[1];return{type:null!=n?n:"Error",value:null!=s?s:t,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(t){var e="Error",i=t,r=t.match(xi);return r&&(e=r[1],i=r[2]),[e,i]}}var Ti=["fatal","error","warning","log","info","debug"];function Mi(t,e){void 0===e&&(e=40);var i=Object.keys(t);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var n=i.slice(0,r).join(", ");if(e>=n.length)return r===i.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class Ei{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var i,r,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(i=this.getStack(t))&&void 0!==i?i:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(dt(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Y(e)&&!X(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var i=this.getObjectClassName(t);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+Mi(t)}isSeverityLevel(t){return Y(t)&&!X(t)&&Ti.indexOf(t)>=0}getStack(t){try{return Y(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Y(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var i=t[e];if(ht(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Ii{match(t){return dt(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Mi(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Ri{match(t){return lt(t)}coerce(t,e){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Pi{match(t){return ut(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!dt(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var i,r=this.getUnhandledRejectionReason(t);return lt(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Ai="$message",Fi="$timestamp",Oi=new Set([Ai,Fi]),Li={enabled:!0,max_bytes:32768};function Di(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Li.enabled,max_bytes:Ni(t.max_bytes,Li.max_bytes)}:p({},Li)}class $i{constructor(t){this.ts=[],this.es=0,this.zi=Di(t)}setConfig(t){this.zi=Di(t),this.rs()}add(t){var e=function(t){var e;try{e=U(t)}catch(t){return}try{var i=JSON.parse(e);if(!Q(i))return;var r=i,n=r[Ai],s=r[Fi];if(!Y(n)||0===n.trim().length)return;if(!Y(s)&&!it(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),i=0,r=0;e.length>r;r++)"%"===e[r]?(i+=1,r+=2):i+=1;return i}(e.json);i>this.zi.max_bytes||(this.ts.push({step:e.step,bytes:i}),this.es+=i,this.rs())}}getAttachable(){return this.ts.map((t=>t.step))}clear(){this.ts=[],this.es=0}size(){return this.ts.length}rs(){for(;this.es>this.zi.max_bytes&&this.ts.length>0;){var t=this.ts.shift();t&&(this.es-=t.bytes)}}}function Ni(t,e){if(!it(t)||t===1/0||t===-1/0)return e;var i=Math.floor(t);return 0>i?e:i}var qi={DEBUG:!1,LIB_VERSION:"0.6.0",LIB_NAME:"browser-common"},ji=function(e,i){var r=(void 0===i?{}:i).debugEnabled,n={P(i){if(t&&(qi.DEBUG||t.POSTHOG_DEBUG||r)&&!K(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i]),s=arguments.length,a=new Array(s>1?s-1:0),o=1;s>o;o++)a[o-1]=arguments[o];n(e,...a)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];n.P("error",...e)},critical(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(t,i)=>ji(e+" "+t,i)};return n},Bi=ji("[PostHog.js]"),Hi=Bi.createLogger;function Ui(t,e){G(t)&&t.forEach(e)}function zi(t,e){if(!et(t))if(G(t))t.forEach(e);else if(st(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)W.call(t,i)&&e(t[i],i)}var Wi=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var n of i)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function Vi(t){for(var e=Object.keys(t),i=e.length,r=new Array(i);i--;)r[i]=[e[i],t[e[i]]];return r}var Gi=function(t){try{return t()}catch(t){return}},Zi=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){Bi.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Bi.critical(t)}}},Qi=function(t){var e={};return zi(t,(function(t,i){(Y(t)&&t.length>0||it(t))&&(e[i]=t)})),e};var Ji=["herokuapp.com","vercel.app","netlify.app"];function Ki(t){var e=null==t?void 0:t.hostname;if(!Y(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Ji)if(i===r)return!1;return!0}function Yi(t,e,i,r){var n=null!=r?r:{},s=n.capture,a=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===a||a})}function Xi(t){return"ph_toolbar_internal"===t.name}var tr=["localhost","127.0.0.1"],er=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return U(t)}},ir=t=>{var e=null==r?void 0:r.createElement("a");return K(e)?null:(e.href=t,e)},rr=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return zi(t,(function(t,e){K(t)||K(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),n[n.length]=r+"="+i)})),n.join(e)},nr=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;r.length>n;n++){var s=r[n].split("=");if(s[0]===e){i=s;break}}if(!G(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(t){Bi.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},sr=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),a=s[1],o=s[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");G(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=o;return null!=a&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},ar=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},or=(t,e)=>t>=e&&h(),lr=(t,e,i,r)=>{if(0===t){if(h()){var n=e+1;return n===i&&r(),n}return e}return 0};function ur(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Z(r))return e;try{var n=r(e);return Y(n)&&n?n:e}catch(t){return Bi.error("Error in get_current_url, falling back to window.location.href",t),e}}function hr(e){var i,r=null==t||null==(i=t.location)?void 0:i.href;return K(r)?void 0:ur(e,r)}var dr="__POSTHOG_TOOLBAR__",vr=1,cr=3,fr=11;function pr(t){return t instanceof Element&&(t.id===dr||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function gr(t){return!!t&&t.nodeType===vr}function mr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function yr(t){return!!t&&t.nodeType===cr}function br(t){return!!t&&t.nodeType===fr&&gr(t.host)}var _r=1e3;function wr(t){return t?B(t).split(/\s+/):[]}function kr(t,e){var i=hr(e);return!!(i&&t&&t.some((t=>i.match(t))))}function Sr(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return wr(e)}function xr(t){return et(t)?null:B(t).split(/(\s+)/).filter((t=>Qr(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Cr(t){var e="";return jr(t)&&!Br(t)&&t.childNodes&&t.childNodes.length&&zi(t.childNodes,(function(t){var i;yr(t)&&t.textContent&&(e+=null!==(i=xr(t.textContent))&&void 0!==i?i:"")})),B(e)}function Tr(t){var e;return K(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Mr=["a","button","form","input","select","textarea","label"];function Er(t,e){if(K(e))return!0;var i,r=function(t){if(e.some((e=>function(t,e){var i=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!i&&i.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function Ir(t){var e=t.parentNode;return!(!e||!gr(e))&&e}var Rr=[".ph-no-autocapture","[data-ph-no-autocapture]"],Pr=["next","previous","prev",">","<"],Ar=[...Pr,"+","-","−","–"],Fr=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Or=[".ph-no-deadclick",".ph-no-capture"],Lr=[".ph-no-rageclick",".ph-no-capture"],Dr=["","text","search","email","password","url","tel","number"];function $r(e,i){if(!t||Nr(e))return!1;var r,n,s,a,o;if(nt(i)?(r=!!i&&Lr,n=void 0,s=!1):(r=null!==(a=null==i?void 0:i.css_selector_ignorelist)&&void 0!==a?a:Lr,n=null==i?void 0:i.content_ignorelist,s=null!==(o=null==i?void 0:i.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(s&&function(t){return!(!t||!gr(t))&&(!!mr(t,"textarea")||(mr(t,"input")?j(Dr,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}(e))return!1;var l=qr(e,!1).targetElementList;return!function(t,e){if(!1===t||K(t))return!1;var i;if(!0===t)i=Pr;else{if(!G(t))return!1;if(t.length>10)return Bi.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=t.map((t=>t.toLowerCase()))}return e.some((t=>{var e=t.safeText,r=t.ariaLabel;return i.some((t=>Fr(e,t)||Fr(r,t)))}))}(n,l.map((t=>{var e;return{safeText:Cr(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Er(l,r)}var Nr=t=>!t||mr(t,"html")||!gr(t),qr=(e,i)=>{if(!t||Nr(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],s=e;s.parentNode&&!mr(s,"body");)if(br(s.parentNode))n.push(s.parentNode.host),s=s.parentNode.host;else{var a=Ir(s);if(!a)break;if(i||Mr.indexOf(a.tagName.toLowerCase())>-1)r=!0;else try{var o=t.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(t){}n.push(a),s=a}return{parentIsUsefulElement:r,targetElementList:n}};function jr(t){for(var e=new Set,i=0,r=t;r.parentNode&&!mr(r,"body");r=r.parentNode){if(i++>=_r||e.has(r))return!1;e.add(r);var n=Sr(r);if(j(n,"ph-sensitive")||j(n,"ph-no-capture"))return!1}if(j(Sr(t),"ph-include"))return!0;var s=t.type||"";if(Y(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!Y(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function Br(t){return!!(mr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||mr(t,"select")||mr(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Hr=new RegExp("^(?:(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}))$"),Ur=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,zr=[16,15,14,13],Wr=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Vr=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Gr=/[0-9A-Za-z_]/;function Zr(t){for(var e=0,i=!1,r=t.length-1;r>=0;r--){var n=t.charCodeAt(r)-48;i&&(n*=2)>9&&(n-=9),e+=n,i=!i}return e%10==0}function Qr(t,e){if(void 0===e&&(e=!0),et(t))return!1;if(Y(t)){t=B(t);var i=e?Hr.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Ur.lastIndex=0;e=Ur.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of zr){var a=n+s;if(r.length>=a){var o=r.slice(n,a);if(Hr.test(o)&&Zr(o))return!0}}}return!1}(t);if(i)return!1;var r=e?Wr.test(t):function(t){var e;for(Vr.lastIndex=0;e=Vr.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&Gr.test(i)&&Gr.test(r)))return!0}return!1}(t);if(r)return!1}return!0}function Jr(t){var e=Cr(t);return Qr(e=(e+" "+Kr(t)).trim())?e:""}function Kr(t){var e="";return t&&t.childNodes&&t.childNodes.length&&zi(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=Cr(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Kr(t)).trim())}catch(t){Bi.error("[AutoCapture]",t)}})),e}function Yr(t){return t.replace(/"|\\"/g,'\\"')}function Xr(t){var e=t.attr__class;if(e)return G(e)?e:wr(e)}var tn="[SessionRecording]",en="redacted",rn=1e6;function nn(t){var e;return Math.min(rn,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:rn)}var sn={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:rn,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},an=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],on=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],ln=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],un=t=>{et(t)||zi(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return an.includes(e)||ln.some((t=>e.includes(t)))})(e)&&(t[e]=en)}))},hn=["/s/","/e/","/i/"];function dn(t,e,i,r){if(et(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Y(n)&&(n=parseInt(n)),n>i?tn+" "+r+" body too large to record ("+n+" bytes)":t}function vn(t,e){if(et(t))return t;var i=t;return Qr(i,!1)||(i=tn+" "+e+" body "+en),zi(on,(t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i=tn+" "+e+" body "+en+" as might contain: "+t)})),i}var cn=new WeakSet,fn="$people_distinct_id",pn="distinct_id",gn="$device_id",mn="$device_model",yn="__alias",bn="__timers",_n="$autocapture_disabled_server_side",wn="$heatmaps_enabled_server_side",kn="$exception_capture_enabled_server_side",Sn="$error_tracking_suppression_rules",xn="$error_tracking_capture_extension_exceptions",Cn="$web_vitals_enabled_server_side",Tn="$dead_clicks_enabled_server_side",Mn="$product_tours_enabled_server_side",En="$logs_capture_enabled_server_side",In="$web_vitals_allowed_metrics",Rn="$session_recording_remote_config",Pn="$replay_sample_rate",An="$replay_override_sampling",Fn="$replay_override_linked_flag",On="$replay_override_url_trigger",Ln="$replay_override_event_trigger",Dn="$sesid",$n="$session_is_sampled",Nn="$session_past_minimum_duration",qn="$session_recording_url_trigger_activated_session",jn="$session_recording_event_trigger_activated_session",Bn="$posthog_sr_group_event_trigger_",Hn="$posthog_sr_group_url_trigger_",Un="$posthog_sr_group_sampling_",zn="$debug_first_full_snapshot_timestamp",Wn="$sess_rec_flush_size",Vn="$enabled_feature_flags",Gn="$active_feature_flags",Zn="$early_access_features",Qn="$feature_flag_details",Jn="$feature_flag_payloads",Kn="$feature_flag_request_id",Yn="$minimal_flag_called_events",Xn="$override_feature_flags",ts="$override_feature_flag_payloads",es="$stored_person_properties",is="$stored_group_properties",rs="$groups",ns="$surveys",ss="$surveys_loaded_at",as="$surveys_activated",os="$surveys_activated_session",ls="$surveys_activated_timestamps",us="ph_product_tours",hs="$flag_call_reported",ds="$flag_call_reported_session_id",vs="$feature_flag_errors",cs="$feature_flag_evaluated_at",fs="$user_state",ps="$client_session_props",gs="$capture_rate_limit",ms="$initial_campaign_params",ys="$initial_referrer_info",bs="$initial_person_info",_s="$epp",ws="$posthog_cookieless",ks="$cookieless_mode",Ss="$sdk_debug_extensions_init_method",xs="$sdk_debug_extensions_init_time_ms",Cs="$sdk_debug_recording_script_not_loaded",Ts="$sdk_debug_replay_event_trigger_status",Ms="$sdk_debug_replay_linked_flag_trigger_status",Es="$sdk_debug_replay_matched_recording_trigger_groups",Is="$sdk_debug_replay_pending_trigger_conditions",Rs="$sdk_debug_replay_remote_trigger_matching_config",Ps="$sdk_debug_replay_trigger_groups_count",As="$sdk_debug_replay_url_trigger_status",Fs="$session_recording_start_reason",Os="PostHog loadExternalDependency extension not found.",Ls="on_reject",Ds="always",$s="anonymous",Ns="identified",qs="identified_only",js="visibilitychange",Bs="beforeunload",Hs="$pageview",Us="$pageleave",zs="$identify",Ws="$groupidentify",Vs="disabled",Gs="sampled",Zs="active",Qs="buffering",Js="paused",Ks="lazy_loading",Ys="awaiting_config",Xs="missing_config",ta="rrweb_error",ea="trigger",ia=ea+"_activated",ra=ea+"_pending",na=ea+"_"+Vs;function sa(t,e,i,r,n,s){return 0===e?na:(null==t?void 0:t.get_property(i?r+i:n))===s?ia:ra}function aa(t,e,i){return e.some((e=>{var r;return"regex"===e.matching&&(null!==(r=null==i?void 0:i.get(e.url))&&void 0!==r?r:new RegExp(e.url)).test(t)}))}function oa(t){return t.includes(ia)?ia:t.includes(ra)?ra:na}function la(t){var e=new Set(t);switch(e.delete(na),e.size){case 0:return na;case 1:return Array.from(e)[0];default:return ra}}class ua{constructor(t){this.F=t}triggerStatus(t){return oa(this.F.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return oa(this.F.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.F.forEach((t=>t.stop()))}}class ha{constructor(t){this.F=t}triggerStatus(t){return la(this.F.map((e=>e.triggerStatus(t))))}triggerStatusNoSideEffects(t){return la(this.F.map((e=>e.triggerStatusNoSideEffects(t))))}stop(){this.F.forEach((t=>t.stop()))}}class da{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return ia}stop(){}}var va=t=>"sessionRecording"in t;class ca{constructor(t,e){this.N=[],this.q=[],this.j=new Map,this.B=new Map,this.H="",this.urlBlocked=!1,this._instance=t,this.U=e}onConfig(t){var e,i;this.N=(va(t)?Q(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.q=(va(t)?Q(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.$()}$(){for(var t of(this.j.clear(),this.B.clear(),this.N))if("regex"===t.matching&&!this.j.has(t.url))try{this.j.set(t.url,new RegExp(t.url))}catch(e){Bi.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.q)if("regex"===e.matching&&!this.B.has(e.url))try{this.B.set(e.url,new RegExp(e.url))}catch(t){Bi.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}W(t){return sa(this._instance,this.N.length,this.U,Hn,qn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[As]:e}),e}triggerStatusNoSideEffects(t){return this.W(t)}isCurrentUrlBlocked(){var t=hr(this._instance);if(!t)return!1;try{return aa(t,this.q,this.B)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=hr(this._instance);if(i&&i!==this.H){this.H=i;var r=this.urlBlocked,n=aa(i,this.q,this.B);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=hr(this._instance);if(n&&n!==this.H){this.H=n;var s=this.urlBlocked,a=aa(n,this.q,this.B);a&&!s?t():!a&&s&&e();var o=this.W(r)===ia,l=aa(n,this.N,this.j);!o&&l&&i("url",n)}}stop(){this.H=""}}class fa{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.V=()=>{},this._instance=t}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Ms]:t}),t}triggerStatusNoSideEffects(){var t=ra;return et(this.linkedFlag)&&(t=na),this.linkedFlagSeen&&(t=ia),t}onConfig(t,e){var i;if(this.linkedFlag=(va(t)?Q(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!et(this.linkedFlag)&&!this.linkedFlagSeen){var r=Y(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Y(this.linkedFlag)?null:this.linkedFlag.variant;this.V=this._instance.onFeatureFlags(((t,i)=>{var s=!1;if(Q(i)&&r in i){var a=i[r];s=nt(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(r,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.V()}}class pa{constructor(t,e){this.Z=[],this._instance=t,this.U=e}onConfig(t){var e;this.Z=(va(t)?Q(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}G(t){return sa(this._instance,this.Z.length,this.U,Bn,jn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Ts]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}checkEventTriggerConditions(t,e,i){if(0!==this.Z.length){var r=this.G(i)===ia,n=this.Z.includes(t);!r&&n&&e("event",t)}}stop(){}}class ga{constructor(t,e,i){if(this._instance=t,this.group=e,this.J=new ca(t,e.id),this.Y=new pa(t,e.id),this.K=new fa(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var r=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:r,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.J.onConfig(n),this.Y.onConfig(n),this.K.onConfig(n,i);var s=[this.Y,this.J,this.K];this.X="any"===e.conditions.matchType?new ua(s):new ha(s)}else this.X=new da}triggerStatus(t){return this.X.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.X.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return this.triggerStatusNoSideEffects(t)!==ra?[]:[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===ra)).map((t=>t.label))}checkEventTriggerConditions(t,e,i){this.Y.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.J.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i;null==(i=this._instance.persistence)||i.register({["url"===t?Hn+this.group.id:Bn+this.group.id]:e})}stop(){this.J.stop(),this.Y.stop(),this.K.stop()}}function ma(t){if(t.rrwebError)return ta;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=!0===t.isSampled,i=new ua([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Gs:i===ia?Zs:i===ra?Qs:!1===t.isSampled?Vs:Zs}function ya(t){if(t.rrwebError)return ta;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=new ha([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==na,r=nt(t.isSampled);return i&&e===ra?Qs:i&&e===na||r&&!t.isSampled?Vs:!0===t.isSampled?Gs:Zs}function ba(){var t=[];return function(e,i){if(Q(i)||G(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function _a(t){var e=JSON.stringify(t,ba());return e?new Blob([e]).size:0}function wa(t){if(tt(t))return 4;if(K(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(G(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=K(r)||tt(r)?4:wa(r)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var l=n[o];K(l)||(a||(s+=1),a=!1,s+=o.length+3+wa(l))}return s;default:return 0}}function ka(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var i=Math.floor(t.data.length/2),r=t.sizes.slice(0,i),n=t.sizes.slice(i);return[ka({size:r.reduce(((t,e)=>t+e),0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),ka({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(i),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}var Sa=Uint8Array,xa=Uint16Array,Ca=Uint32Array,Ta=new Sa([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]),Ma=new Sa([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]),Ea=new Sa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ia=function(t,e){for(var i=new xa(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new Ca(i[30]);for(r=1;30>r;++r)for(var s=i[r];i[r+1]>s;++s)n[s]=s-i[r]<<5|r;return[i,n]},Ra=Ia(Ta,2),Pa=Ra[1];Ra[0][28]=258,Pa[258]=28;for(var Aa=Ia(Ma,0)[1],Fa=new xa(32768),Oa=0;32768>Oa;++Oa){var La=(43690&Oa)>>>1|(21845&Oa)<<1;Fa[Oa]=((65280&(La=(61680&(La=(52428&La)>>>2|(13107&La)<<2))>>>4|(3855&La)<<4))>>>8|(255&La)<<8)>>>1}var Da=function(t,e,i){for(var r=t.length,n=0,s=new xa(e);r>n;++n)++s[t[n]-1];var a,o=new xa(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(i){a=new xa(1<<e);var l=15-e;for(n=0;r>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=o[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)a[Fa[d]>>>l]=u}else for(a=new xa(r),n=0;r>n;++n)a[n]=Fa[o[t[n]-1]++]>>>15-t[n];return a},$a=new Sa(288);for(Oa=0;144>Oa;++Oa)$a[Oa]=8;for(Oa=144;256>Oa;++Oa)$a[Oa]=9;for(Oa=256;280>Oa;++Oa)$a[Oa]=7;for(Oa=280;288>Oa;++Oa)$a[Oa]=8;var Na=new Sa(32);for(Oa=0;32>Oa;++Oa)Na[Oa]=5;var qa=Da($a,9,0),ja=Da(Na,5,0),Ba=function(t){return(t/8>>0)+(7&t&&1)},Ha=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof xa?xa:t instanceof Ca?Ca:Sa)(i-e);return r.set(t.subarray(e,i)),r},Ua=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},za=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Wa=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var n=i.length,s=i.slice();if(!n)return[new Sa(0),0];if(1==n){var a=new Sa(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=n-1;)o=i[i[d].f>i[u].f?u++:d++],l=i[u!=h&&i[d].f>i[u].f?u++:d++],i[h++]={s:-1,f:o.f+l.f,l:o,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new xa(v+1),f=Va(i[h-1],c,0);if(f>e){r=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return c[e.s]-c[t.s]||t.f-e.f}));n>r;++r){var y=s[r].s;if(e>=c[y])break;p+=m-(1<<f-c[y]),c[y]=e}for(p>>>=g;p>0;){var b=s[r].s;e>c[b]?p-=1<<e-c[b]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;c[_]==e&&(--c[_],++p)}f=e}return[new Sa(c),f]},Va=function(t,e,i){return-1==t.s?Math.max(Va(t.l,e,i+1),Va(t.r,e,i+1)):e[t.s]=i},Ga=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new xa(++e),r=0,n=t[0],s=1,a=function(t){i[r++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[i.subarray(0,r),e]},Za=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Qa=function(t,e,i){var r=i.length,n=Ba(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;r>s;++s)t[n+s+4]=i[s];return 8*(n+4+r)},Ja=function(t,e,i,r,n,s,a,o,l,u,h){Ua(e,h++,i),++n[256];for(var d=Wa(n,15),v=d[0],c=d[1],f=Wa(s,15),p=f[0],g=f[1],m=Ga(v),y=m[0],b=m[1],_=Ga(p),w=_[0],k=_[1],S=new xa(19),x=0;y.length>x;++x)S[31&y[x]]++;for(x=0;w.length>x;++x)S[31&w[x]]++;for(var C=Wa(S,7),T=C[0],M=C[1],E=19;E>4&&!T[Ea[E-1]];--E);var I,R,P,A,F=u+5<<3,O=Za(n,$a)+Za(s,Na)+a,L=Za(n,v)+Za(s,p)+a+14+3*E+Za(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(O>=F&&L>=F)return Qa(e,h,t.subarray(l,l+u));if(Ua(e,h,1+(O>L)),h+=2,O>L){I=Da(v,c,0),R=v,P=Da(p,g,0),A=p;var D=Da(T,M,0);for(Ua(e,h,b-257),Ua(e,h+5,k-1),Ua(e,h+10,E-4),h+=14,x=0;E>x;++x)Ua(e,h+3*x,T[Ea[x]]);h+=3*E;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Ua(e,h,D[B=31&j[x]]),h+=T[B],B>15&&(Ua(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else I=qa,R=$a,P=ja,A=Na;for(x=0;o>x;++x)if(r[x]>255){var B;za(e,h,I[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Ua(e,h,r[x]>>>23&31),h+=Ta[B]);var H=31&r[x];za(e,h,P[H]),h+=A[H],H>3&&(za(e,h,r[x]>>>5&8191),h+=Ma[H])}else za(e,h,I[r[x]]),h+=R[r[x]];return za(e,h,I[256]),h+R[256]},Ka=new Ca([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ya=function(){for(var t=new Ca(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Xa=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Ya[255&i^e[r]]^i>>>8;t=i},d:()=>4294967295^t}},to=function(t,e,i,r,n){return function(t,e,i,r,n,s){var a=t.length,o=new Sa(r+a+5*(1+Math.floor(a/7e3))+n),l=o.subarray(r,o.length-n),u=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?u=Qa(l,u,t.subarray(h,d)):(l[h]=true,u=Qa(l,u,t.subarray(h,a)))}else{for(var v=Ka[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new xa(32768),m=new xa(p+1),y=Math.ceil(i/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new Ca(25e3),k=new xa(288),S=new xa(32),x=0,C=0,T=(h=0,0),M=0,E=0;a>h;++h){var I=_(h),R=32767&h,P=m[I];if(g[R]=P,m[I]=R,h>=M){var A=a-h;if((x>7e3||T>24576)&&A>423){u=Ja(t,l,0,w,k,S,C,T,E,h-E,u),T=x=C=0,E=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var O=2,L=0,D=f,N=R-P&32767;if(A>2&&I==_(h-N))for(var q=Math.min(c,A)-1,j=Math.min(32767,h),B=Math.min(258,A);j>=N&&--D&&R!=P;){if(t[h+O]==t[h+O-N]){for(var H=0;B>H&&t[h+H]==t[h+H-N];++H);if(H>O){if(O=H,L=N,H>q)break;var U=Math.min(N,H-2),z=0;for(F=0;U>F;++F){var W=h-N+F+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,P=W)}}}N+=(R=P)-(P=g[R])+32768&32767}if(L){w[T++]=268435456|Pa[O]<<18|Aa[L];var G=31&Pa[O],Z=31&Aa[L];C+=Ta[G]+Ma[Z],++k[257+G],++S[Z],M=h+O,++x}else w[T++]=t[h],++k[t[h]]}}u=Ja(t,l,true,w,k,S,C,T,E,h-E,u)}return Ha(o,0,r+Ba(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,i,r)},eo=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},io=function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&eo(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}},ro=function(t){return 10+(t.filename&&t.filename.length+1||0)};function no(t,e){void 0===e&&(e={});var i=Xa(),r=t.length;i.p(t);var n=to(t,e,ro(e),8),s=n.length;return io(n,e),eo(n,s-8,i.d()),eo(n,s-4,r),n}function so(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Sa(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},a=0;i>a;++a){if(n+5>r.length){var o=new Sa(n+8+(i-a<<1));o.set(r),r=o}var l=t.charCodeAt(a);128>l||e?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++a))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Ha(r,0,n)}function ao(t,e){for(var i="",r=0;t.length>r;){var n=t[r++];i+=String.fromCharCode(n)}return i}class oo{constructor(t,e){var i,r;void 0===e&&(e={}),this.ee={},this.te=t=>{if(!this.ee[t]){var e,i;this.ee[t]=!0;var r=this.re(t);null==(e=(i=this.ie).onBlockedNode)||e.call(i,t,r)}},this.ne=t=>{var e=this.re(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var i=e.closest("svg");if(i)return[this._rrweb.mirror.getId(i),i]}return[t,e]},this.re=t=>this._rrweb.mirror.getNode(t),this.ae=t=>{var e,i,r,n,s,a,o,l;return(null!==(e=null==(i=t.removes)?void 0:i.length)&&void 0!==e?e:0)+(null!==(r=null==(n=t.attributes)?void 0:n.length)&&void 0!==r?r:0)+(null!==(s=null==(a=t.texts)?void 0:a.length)&&void 0!==s?s:0)+(null!==(o=null==(l=t.adds)?void 0:l.length)&&void 0!==o?o:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.ae(e);if(e.attributes){var r=e.attributes.length;e.attributes=e.attributes.filter((t=>{var e=this.ne(t.id);return!this.oe.consumeRateLimit(e[0])&&t}));var n,s,a=r-e.attributes.length;a>0&&(null==(n=(s=this.ie).onDroppedAttributeMutations)||n.call(s,a))}var o=this.ae(e);return 0!==o||i===o?t:void 0},this._rrweb=t,this.ie=e,this.oe=new mt({bucketSize:null!==(i=this.ie.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.ie.refillRate)&&void 0!==r?r:10,refillInterval:1e3,S:this.te,I:Bi})}reset(){this.ee={}}stop(){this.oe.stop(),this.reset()}}qi.DEBUG=!1,qi.LIB_VERSION="1.422.0",qi.LIB_NAME="web";class lo{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.se=t.get_property.bind(t),this.ue=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.ue(Wn,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.se(Wn);return Q(e=i)&&Y(e.sessionId)&&it(e.size)&&i.sessionId===t?i.size:0}}function uo(t,e){return function(t){for(var e=0,i=0;t.length>i;i++)e=(e<<5)-e+t.charCodeAt(i),e|=0;return Math.abs(e)}(t)%100<gt(100*e,0,100,Bi)}function ho(t){return"$survey_response_"+t}function vo(t,e){if(!e)return null;var i=t[ho(e)];return G(i)?[...i]:i}function co(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!K(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=vo(t,e.id);K(s)||(i[n]=s)}})),p({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:vo(t,e.id)})))},t,i)}function fo(t,e){var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i}function po(t){return"string"==typeof t&&t.trim()?t.trim():null}function go(t){return t.toLowerCase()}function mo(t,e,i){if(!t||!e)return null;var r=go(e),n=Object.keys(t).find((t=>go(t)===r));if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],a=Object.keys(t).find((t=>go(t)===s));if(a)return null==i||i.debug("Found base language translation match: "+a+" (from "+e+")"),a}return null}var yo=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function bo(t,e,i){var r,n=mo(t.translations,e,i),s=p({},t),a=!1;if(n){var o,l=null==(o=t.translations)?void 0:o[n];if(l)if(null==i||i.info("Applying survey-level translation for language: "+n),K(l.name)||(s.name=l.name,a=!0),s.appearance){var u=p({},s.appearance);for(var h of yo){var d=l[h];K(d)||(u[h]=d,a=!0)}s.appearance=u}else(function(t){return yo.some((e=>!K(t[e])))})(l)&&(a=!0)}var v=t.questions.map((t=>function(t,e,i){var r,n=mo(t.translations,e,i);if(!n)return{question:t,matchedKey:null,hasChanges:!1};var s=null==(r=t.translations)?void 0:r[n];if(!s)return{question:t,matchedKey:null,hasChanges:!1};var a=p({},t),o=!1;return K(s.question)||(a.question=s.question,o=!0),K(s.description)||(a.description=s.description,o=!0),K(s.buttonText)||(a.buttonText=s.buttonText,o=!0),"link"in a&&!K(s.link)&&(a.link=s.link,o=!0),"lowerBoundLabel"in a&&!K(s.lowerBoundLabel)&&(a.lowerBoundLabel=s.lowerBoundLabel,o=!0),"upperBoundLabel"in a&&!K(s.upperBoundLabel)&&(a.upperBoundLabel=s.upperBoundLabel,o=!0),"choices"in a&&function(t){return G(t.choices)}(s)&&(a.choices=s.choices,o=!0),{question:o?a:t,matchedKey:o?n:null,hasChanges:o}}(t,e,i))),c=v.map((t=>t.question)),f=v.some((t=>t.hasChanges)),g=null;return n||(g=(null==(r=v.find((t=>t.matchedKey)))?void 0:r.matchedKey)||null),f&&(s.questions=c,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:s,matchedKey:a?n||g:null}}function _o(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function wo(t){var e;return _o(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var ko=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},So=t=>t.toLowerCase(),xo={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>ko(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!ko(e,t))))),icontains:(t,e)=>e.map(So).some((e=>t.map(So).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(So).every((e=>t.map(So).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i<parseFloat(t)))}))};function Co(t,e){return!t||Object.entries(t).every((t=>{var i=t[1],r=null==e?void 0:e[t[0]];if(null==r)return!1;var n=xo[i.operator];return!!n&&n(i.values,[String(r)])}))}function To(t,e,i){return er({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Mo=new Set(["is_not","not_icontains","not_regex"]);function Eo(t,e,i){return!t||0===t.length||t.every((t=>{var r="person"===t.type?i:e,n=null==r?void 0:r[t.key],s=t.operator||"exact";if(K(n)||tt(n))return Mo.has(s);var a=xo[s];return!!a&&!K(t.value)&&!tt(t.value)&&a(G(t.value)?t.value.map(String):[String(t.value)],G(n)?n.map(String):[String(n)])}))}var Io=Hi("[SessionRecording]");function Ro(t,e){return e?t:"!"+t}function Po(t,e){return t===e||t!=="!"+e&&null}class Ao{constructor(t,e,i,r,n,s,a){this.le=null,this.ce=ya,this._instance=t,this.J=e,this.Y=i,this.K=r,this.he=n,this.de=s,this.ve=a}onRemoteConfig(t){this.le=it(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.fe=new ua([this.Y,this.J]),this.ce=ma):(this.fe=new ha([this.Y,this.J]),this.ce=ya),this._instance.register_for_session({[Rs]:t.triggerMatchType}),this.J.onConfig(t),this.Y.onConfig(t),this.K.onConfig(t,((t,e)=>{this.he("linked_flag_matched",{flag:t,variant:e}),this.ve()}))}getStatus(t){return this.ce({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),i=null==e?void 0:e.minimumDurationMilliseconds;return it(i)?i:null}checkUrlTriggers(t,e,i,r){this.J.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.Y.Z.length&&et(this.pe))return this.pe=t((t=>{try{this.Y.checkEventTriggerConditions(t.event,i,e)}catch(t){Io.error("Could not activate event trigger",t)}})),this.pe}makeSamplingDecisions(t){var e,i,r,n=this.le;if(!it(n))return null==(i=this._instance.persistence)||i.unregister($n),void(null==(r=this._instance.persistence)||r.unregister(Pn));var s=this._instance.get_property($n),a=this._instance.get_property(Pn),o=Po(s,t),l=it(a)&&a!==n,u=K(a)&&s===t,h=l||u||!nt(o),d=h?uo(t,n):o;h&&(d?this.he("sampled"):Io.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[$n]:Ro(t,d),[Pn]:tt(a)&&s===t?null:n})}ensureSamplingDecision(t){if(it(this.le)){var e=this._instance.get_property($n);nt(Po(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(jn),null==(e=this._instance.persistence)||e.unregister(qn),null==(i=this._instance.persistence)||i.unregister($n),null==(r=this._instance.persistence)||r.unregister(Pn),null==(n=this._instance.persistence)||n.unregister(Nn)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.fe)?void 0:e.triggerStatus(t))===ra}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.J.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.K.triggerStatusNoSideEffects()}].filter((t=>t.status===ra)).map((t=>t.label))}stop(){var t;null==(t=this.pe)||t.call(this),this.pe=void 0,this.Y.stop(),this.J.stop(),this.K.stop()}}class Fo{constructor(t,e,i,r,n){this.ge=[],this.me=new Map,this.ye=!1,this._instance=t,this.J=e,this.he=i,this.be=r,this.ve=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.we(t.triggerGroups),this._instance.register_for_session({[Rs]:"v2_trigger_groups",[Ps]:t.triggerGroups.length}),this.J.onConfig(t)):Io.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return ta;if(t.urlTriggerMatching.urlBlocked)return Js;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Vs;var r=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===ia){var o=s.group.id,l=i.get(o);K(l)?Bi.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===l&&(n=!0)}else a===ra&&(r=!0)}return n?Gs:r?Qs:Vs}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.ge,triggerGroupSamplingResults:this.me,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var i of this.ge)if("trigger_activated"===i.triggerStatus(t)){var r=i.group.minDurationMs;it(r)&&(tt(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.J.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,(e=>{n.ke(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.ve(e))}),t)};for(var a of this.ge)s(a)}setupEventTriggerListeners(t,e,i){var r=this;return this.pe=t((t=>{var i;if(this.ye)return Io.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.pe)||i.call(this),void(this.pe=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,(n=>{if(r.ke(i,t.properties)){var s=(i.group.conditions.events||[]).filter((e=>e.name===t.event)),a=r._instance.get_property(es),o=s.some((e=>!e.properties||0===e.properties.length||Eo(e.properties,t.properties,a)));o&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.ve(n))}}),e)};for(var s of this.ge)n(s)}catch(t){Io.error("Could not activate event trigger for trigger groups",t)}})),this.pe}makeSamplingDecisions(t){for(var e of this.ge){var i,r=e.group,n=r.id,s=r.sampleRate,a=Un+n,o=this._instance.get_property(a),l=null,u=!1,h=!1,d=!1;if(Q(o)){var v=o.sessionId,c=o.sampleRate,f=o.sampled;u="string"==typeof v&&v!==t,h=it(c)&&c!==s,l=v===t&&it(c)&&c===s&&nt(f)?f:null}else l=o===t||null,u="string"==typeof o&&o!==t,d=o===t;var p=u||h||d||!nt(l),g=p?uo(t+n,s):l;p&&this.be("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.me.set(n,g),null==(i=this._instance.persistence)||i.register({[a]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.ye=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister($n),null==(e=this._instance.persistence)||e.unregister(Pn),null==(i=this._instance.persistence)||i.unregister(Nn),this.ge)){var n,s,a,o=r.group.id;null==(n=this._instance.persistence)||n.unregister(Bn+o),null==(s=this._instance.persistence)||s.unregister(Hn+o),null==(a=this._instance.persistence)||a.unregister(Un+o)}}updateActiveTriggers(t){var e=[];for(var i of this.ge){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),a=!0===this.me.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:a})}this._instance.register_for_session({[Es]:e})}hasPendingTriggers(t){for(var e of this.ge)if(e.triggerStatus(t)===ra)return!0;return!1}getPendingTriggerConditions(t){return this.ge.flatMap((e=>e.triggerStatusNoSideEffects(t)!==ra?[]:e.getPendingTriggerConditions(t).map((t=>'trigger group "'+e.group.name+'": '+t))))}stop(){var t;null==(t=this.pe)||t.call(this),this.pe=void 0,this.ge.forEach((t=>t.stop())),this.ge=[],this.me.clear(),this.J.stop()}ke(t,e){var i=t.group.conditions.properties;return!i||0===i.length||Eo(i,e,this._instance.get_property(es))}we(t){var e=this;this.ge.forEach((t=>t.stop())),this.ge=[],this.me.clear();var i=function(t){var i=new ga(e._instance,t,((i,r)=>{e.he("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.ve()}));e.ge.push(i)};for(var r of t)i(r)}}var Oo=t=>{if(r){try{for(var e=t+"=",i=r.cookie.split(";").filter((t=>t.length)),n=0;i.length>n;n++){for(var s=i[n];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(e))return decodeURIComponent(s.substring(e.length,s.length))}}catch(t){}return null}},Lo="https?://(.*)",Do=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],$o=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Do],No="<masked>",qo=["li_fat_id"];function jo(t,e,i){if(!r)return{};var n,s=e?[...Do,...i||[]]:[],a=Bo(sr(r.URL,s,No),t),o=(n={},zi(qo,(function(t){var e=Oo(t);n[t]=e||null})),n);return Wi(o,a)}function Bo(t,e){var i=$o.concat(e||[]),r={};return zi(i,(function(e){var i=nr(t,e);r[e]=i||null})),r}function Ho(t){var e=function(t){return t?0===t.search(Lo+"google.([^/?]*)")?"google":0===t.search(Lo+"bing.com")?"bing":0===t.search(Lo+"yahoo.com")?"yahoo":0===t.search(Lo+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",n={};if(!tt(e)){n.$search_engine=e;var s=r?nr(r.referrer,i):"";s.length&&(n.ph_keyword=s)}return n}function Uo(){return navigator.language||navigator.userLanguage}var zo="$direct";function Wo(){return(null==r?void 0:r.referrer)||zo}function Vo(t,e,i){void 0===i&&(i=!1);var r=t?[...Do,...e||[]]:[],s=i?Te(null==n?void 0:n.href):null==n?void 0:n.href,a=null==s?void 0:s.substring(0,1e3);return{r:Wo().substring(0,1e3),u:a?sr(a,r,No):void 0}}function Go(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?Te(n):n,a={$referrer:r,$referring_domain:null==r?void 0:r==zo?zo:null==(i=ir(r))?void 0:i.host};if(s){a.$current_url=s;var o=ir(s);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname;var l=Bo(s);Wi(a,l)}if(r){var u=Ho(r);Wi(a,u)}return a}function Zo(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Qo(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Jo=1e5,Ko="https://schema.org",Yo=[],Xo="actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),tl="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),el="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),il="Accommodation AdministrativeArea Country Place State".split(" "),rl={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:tl,publisher:el},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Yo},Offer:{seller:el},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Person:{},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:el,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:el,areaServed:il,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Yo}},nl={},sl=[[tl,nl],["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),rl.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),rl.Event],[el,rl.Organization],[il,rl.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),rl.Product],["AggregateRating EmployerAggregateRating Rating".split(" "),nl]],al="AlignmentObject BedDetails Certification ContactPoint CreditCard DefinedRegion EducationalOccupationalCredential EntryPoint GeoCoordinates GeoShape InteractionCounter JobPosting LocationFeatureSpecification MathSolver MemberProgram MemberProgramTier MerchantReturnPolicy MerchantReturnPolicySeasonalOverride MonetaryAmount NutritionInformation OccupationalExperienceRequirements OfferShippingDetails OpeningHoursSpecification PeopleAudience PostalAddress PriceSpecification PropertyValue QuantitativeValue ServicePeriod ShippingConditions ShippingDeliveryTime ShippingRateSettings ShippingService SpeakableSpecification Thing UnitPriceSpecification".split(" ");function ol(t,e){return W.call(t,e)?t[e]:void 0}function ll(t){var e=typeof t;return tt(t)||"string"===e||"number"===e||"boolean"===e}function ul(t){return ll(t)||G(t)&&t.every(ll)?t:void 0}function hl(t){if(W.call(rl,t))return rl[t];for(var e of sl){var i=e[1];if(e[0].includes(t))return i}return al.includes(t)?nl:void 0}function dl(t,e){if(!Q(t))return null;var i=ol(t,"@type"),r=function(t){return("string"==typeof t?[t]:G(t)?t:[]).filter((t=>"string"==typeof t)).map((t=>t.replace(/^https?:\/\/schema\.org\//,""))).filter((t=>!!hl(t)))}(i).filter((t=>!e||!e.length||e.includes(t)));if(!r.length)return null;var n={"@type":"string"==typeof i?r[0]:r},s=ul(ol(t,"@id"));for(var a of(K(s)||(n["@id"]=s),Xo)){var o=ul(ol(t,a));K(o)||(n[a]=o)}for(var l of r){var u=hl(l),h=function(){var e=ol(t,d),i=u[d];if(!0===i){var r=ul(e);K(r)||(n[d]=r)}else if(G(e)){var s=e.map((t=>dl(t,i))).filter(Q);s.length&&(n[d]=s)}else{var a=dl(e,i);a&&(n[d]=a)}};for(var d of Object.keys(u))h()}return n}function vl(t){if(!Q(t))return null;var e=ol(t,"@context");if("string"!=typeof e||!/^https?:\/\/schema\.org\/?$/.test(e))return null;var i=dl(t);if(i)return p({"@context":Ko},i);var r=ol(t,"@graph");if(!G(r))return null;var n=r.map((t=>dl(t))).filter(Q);return n.length?{"@context":Ko,"@graph":n}:null}function cl(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function fl(t,e,i){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some((t=>(e.lastIndex=0,e.test(t)))))return!0;try{return!!i&&t.matches(i)}catch(t){return!1}}function pl(t){return cl(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(cl)}function gl(t){return K(t)?void 0:Math.round(t)}function ml(t){return Q(t)?t.network_timing:t}var yl,bl,_l=36e5,wl=943718.4,kl="[SessionRecording]",Sl=Hi(kl),xl=[y.MouseMove,y.MouseInteraction,y.Scroll,y.ViewportResize,y.Input,y.TouchMove,y.MediaInteraction,y.Drag],Cl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Tl(){var t;return null==v||null==(t=v.__PosthogExtensions__)?void 0:t.rrweb}function Ml(){var t;return null==(t=Tl())?void 0:t.record}function El(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,ba())}}function Il(t){return ao(no(so(El(t))))}function Rl(t){return Pl.apply(this,arguments)}function Pl(){return(Pl=f((function*(t){var e=El(t),i=yield Ne(e,qi.DEBUG,{rethrow:!0});return ao(new Uint8Array(yield i.arrayBuffer()))}))).apply(this,arguments)}var Al="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Fl=!1;function Ol(t){return G(t)&&0===t.length?yl=null!=yl?yl:Il([]):Il(t)}function Ll(t){return Dl.apply(this,arguments)}function Dl(){return(Dl=f((function*(t){return G(t)&&0===t.length?yl||(bl=null!=bl?bl:Rl([]).then((t=>(yl=t,t))).catch((t=>{throw yl=void 0,bl=void 0,t}))):Rl(t)}))).apply(this,arguments)}function $l(t){return Al&&!Fl&&function(t){return t.type===m.FullSnapshot||t.type===m.IncrementalSnapshot&&(t.data.source===y.Mutation||t.data.source===y.StyleSheetRule)}(t)}function Nl(t){return{event:t,size:wa(t)}}function ql(t,e){return p({},t,{data:e,cv:"2024-10"})}function jl(t,e){return p({},t,{cv:"2024-10",data:p({},t.data,e)})}function Bl(t){try{if(t.type===m.FullSnapshot)return Nl(ql(t,Il(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation)return Nl(jl(t,{texts:Ol(t.data.texts),attributes:Ol(t.data.attributes),removes:Ol(t.data.removes),adds:Ol(t.data.adds)}));if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule)return Nl(jl(t,{adds:t.data.adds?Il(t.data.adds):void 0,removes:t.data.removes?Il(t.data.removes):void 0}))}catch(t){Sl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:_a(t)}}function Hl(){return Hl=f((function*(t){try{if(t.type===m.FullSnapshot)return Nl(ql(t,yield Rl(t.data)));if(t.type===m.IncrementalSnapshot&&t.data.source===y.Mutation){var e=yield Promise.all([Ll(t.data.texts),Ll(t.data.attributes),Ll(t.data.removes),Ll(t.data.adds)]);return Nl(jl(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===m.IncrementalSnapshot&&t.data.source===y.StyleSheetRule){var i=yield Promise.all([t.data.adds?Rl(t.data.adds):void 0,t.data.removes?Rl(t.data.removes):void 0]);return Nl(jl(t,{adds:i[0],removes:i[1]}))}}catch(e){return Le(e)&&(Fl=!0),Sl.error("could not compress event asynchronously - trying synchronous compression",e),Bl(t)}return{event:t,size:_a(t)}})),Hl.apply(this,arguments)}function Ul(t,e){return t.type===m.Custom&&t.data.tag===e}function zl(t){return Ul(t,"sessionIdle")}function Wl(t){return Ul(t,"$session_ending")}function Vl(t){return Ul(t,"$session_starting")}class Gl{get sessionId(){return this._e}get Se(){if(!this._instance.sessionManager)throw new Error(kl+" must be started with a valid sessionManager.");return this._instance.sessionManager}get xe(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Ce(){return Po(this._instance.get_property($n),this.sessionId)}get le(){var t,e=null==(t=this.Me)?void 0:t.sampleRate;return it(e)?e:null}get Te(){var t,e;return null!==(t=null==(e=this.Ie)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this.Ee="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Ae=void 0,this.Re=!1,this.Le=Date.now(),this.Oe=!1,this.Pe=[],this.De="unknown",this.Fe=0,this.Ne=0,this.qe=!1,this.je=!1,this.Be=!1,this.He=!1,this.Ue=!1,this.$e=!1,this.We=!1,this.ze=!1,this.Ve=!1,this.Ze=!1,this.Ge=!1,this.Qe=!1,this.Je=[],this.Ye=void 0,this.Ke=void 0,this.Xe=[],this.et=0,this.tt=0,this.rt=!1,this.it=void 0,this.pe=void 0,this.nt=void 0,this.ot=void 0,this.st=void 0,this.ut=(t,e,i)=>{var r,n,s;if(i&&(t!==this._e||e!==this.ct)){var a,o=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this._e,u=this.ct;if(o&&this.be("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.Le,flushed_size:null==(a=this.ht)?void 0:a.currentTrackedSize(l)}),null==(r=this._instance.persistence)||r.unregister(zn),this.We=!1,null==(n=Tl())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.be("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.dt(),!(!1===this.De&&this.isStarted||this._e===t&&this.ct===e)){var h=this._e!==t&&!1!==this.De;this.De="unknown",this.vt(h)}o&&this.be("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.Le}),null==(s=this.Ie)||s.makeSamplingDecisions(t)}},this.ft=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[Nn])===this._e},this.yt=()=>{var t,e;if(0===this.bt.data.length)return null;var i=null==(t=this.bt.data[0])?void 0:t.timestamp,r=null==(e=this.bt.data[this.bt.data.length-1])?void 0:e.timestamp;return it(i)&&it(r)?r-i:null},this.wt=()=>{var t,e,i=this.Te;if(!it(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.kt;return it(r)&&r>=0&&i>r}if(this.ft())return!1;var n,s=this.yt();return!!tt(s)||i>s||(null==(n=this._instance.persistence)||n.register({[Nn]:this._e}),!1)},this._t=()=>{this.status!==Qs?(this.qe&&this.je&&this.St&&!this.Be&&(this.qe=!1),this.xt(),this.Ct()):this.Mt()},this.Tt=()=>{this._t()},this.It=()=>{this.be("browser offline",{})},this.Et=()=>{this.be("browser online",{})},this.At=()=>{null!=r&&r.visibilityState&&("visible"===r.visibilityState&&(this.St=!0),this.be("window "+r.visibilityState,{}))},this._instance=t,this.St=null==e||e;var i=this.Se.checkAndGetSessionAndWindowId(),n=i.windowId;this._e=i.sessionId,this.ct=n,this.K=new fa(this._instance),this.J=new ca(this._instance),this.Y=new pa(this._instance),this.bt=this.Mt(),this.Se.sessionTimeoutMs>this.xe||Sl.warn("session_idle_threshold_ms ("+this.xe+") is greater than the session timeout ("+this.Se.sessionTimeoutMs+"). Session will never be detected as idle"),this.ht=new lo(this._instance)}setDocumentWasEverVisible(t){t&&(this.St=!0)}get Rt(){var t,e,i,r,n,s,a,o,l,u=null==(t=this.Me)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(i=this._instance.config.session_recording)?void 0:i.maskTextSelector,blockSelector:null==(r=this._instance.config.session_recording)?void 0:r.blockSelector,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==u?void 0:u.maskAllInputs,v=null!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a:null==u?void 0:u.maskTextSelector,c=null!==(o=null==h?void 0:h.blockSelector)&&void 0!==o?o:null==u?void 0:u.blockSelector,f=null!==(l=null==h?void 0:h.maskAllElementAttributes)&&void 0!==l?l:null==u?void 0:u.maskAllElementAttributes;return K(d)&&K(v)&&K(c)&&K(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}Lt(){var t;if(!this.Ve){var e=null==(t=this.Me)?void 0:t.masking;if(!et(e)){var i=this._instance.config.session_recording,r=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter((t=>{var r=null==i?void 0:i[t],n=e[t];return!K(r)&&r!==n}));0!==r.length&&(this.Ve=!0,Sl.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+r.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==i?void 0:i.maskAllInputs,maskTextSelector:null==i?void 0:i.maskTextSelector,blockSelector:null==i?void 0:i.blockSelector,maskAllElementAttributes:null==i?void 0:i.maskAllElementAttributes},project:e}))}}}get Ot(){var t;return gt(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Hi("canvas recording resolution scale"),1)}get Pt(){var t,e,i,r,n,s,a,o=this._instance.config.session_recording.captureCanvas,l=null==(t=this.Me)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==o?void 0:o.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==o?void 0:o.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(a=null==o?void 0:o.canvasQuality)&&void 0!==a?a:null==l?void 0:l.quality)&&void 0!==s?s:.4;if("string"==typeof d){var v=parseFloat(d);d=isNaN(v)?.4:v}return{enabled:u,fps:gt(h,0,12,Hi("canvas recording fps"),4),quality:gt(d,0,1,Hi("canvas recording quality"),.4)}}get Dt(){var t,e=!(null==(t=this.Me)||!t.consoleLogRecordingEnabled),i=this._instance.config.enable_recording_console_log;return null!=i?i:e}get Ft(){var t,e,i,r=null==(t=this.Me)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(i=this._instance.config.session_recording)?void 0:i.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==r?void 0:r.recordHeaders),a=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),o=ml(this._instance.config.capture_performance),l=ml(null==r?void 0:r.capturePerformance),u=!!(nt(o)?o:l);return s||a||u?{recordHeaders:s,recordBody:a,recordPerformance:u}:void 0}Nt(){var t,e,i=[],r=null==(t=v.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.Dt&&i.push(r());var s=null==(e=v.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Ft&&Z(s))if(!tr.includes(n.hostname)||this._forceAllowLocalhostNetworkCapture){var a=Z(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(s(((t,e,i)=>{var r,n={payloadSizeLimitBytes:sn.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...sn.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...sn.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,o=!1!==t.capture_performance&&e.recordPerformance,l=(r=nn(n),t=>(null!=t&&t.requestBody&&(t.requestBody=dn(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=dn(t.responseBody,t.responseHeaders,r,"Response")),t)),u=e=>{return l(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=ir(t.name),s=0===e.indexOf("http")?null==(r=ir(e))?void 0:r.pathname:e;"/"===s&&(s="");var a=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&a&&hn.some((t=>0===a.indexOf(t)))))return t}})((un((r=e).requestHeaders),un(r.responseHeaders),r),t.api_host,i));var r},h=Z(t.session_recording.maskNetworkRequestFn);return h&&Z(t.session_recording.maskCapturedNetworkRequestFn)&&Bi.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:p({},e,{name:null==i?void 0:i.url})}),n.maskRequestFn=Z(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var i=u(e);if(i){var r=i.isInitial?{name:"",entryType:i.entryType,startTime:i.startTime,duration:i.duration,endTime:i.endTime,timeOrigin:i.timeOrigin,timestamp:i.timestamp,isInitial:!0}:void 0,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(i);return et(n)&&r?(cn.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!K(t))return t.requestBody=vn(t.requestBody,"Request"),t.responseBody=vn(t.responseBody,"Response"),t}(u(t)),p({},sn,n,{recordHeaders:s,recordBody:a,recordPerformance:o,recordInitialRequests:o,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ft,a)))}else Sl.info("NetworkCapture not started because we are on localhost.");return i}qt(t){return this._instance.config.disable_capture_url_hashes?Te(t):t}jt(t,e){void 0===e&&(e=!1);var i=e?Te(t):this.qt(t),r=this._instance.config.mask_personal_data_properties?[...Do,...this._instance.config.custom_personal_data_properties||[]]:[];return this.Bt(sr(i,r,No))}Bt(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var i,r=e.maskCapturedNetworkRequestFn({name:t});return null!==(i=null==r?void 0:r.name)&&void 0!==i?i:null==r?void 0:r.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}Ht(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Pe.length?this.Pe.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Sl.warn("could not emit queued rrweb event.",e,t),!1}}be(t,e){return this.Ht(Cl((()=>Ml().addCustomEvent(t,e))))}Ut(){var t;return this.Re&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.J.urlBlocked&&!0!==this.De}$t(t){if(!this.Ut())return!1;try{var e=Ml();return!!e&&(e.addCustomEvent("$json_ld",t),this.Ut())}catch(t){return!1}}Wt(t){void 0===t&&(t=!1),Promise.resolve().then((()=>{var e;return null==(e=this.zt)?void 0:e.scan(t)}))}Vt(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),i=this.jt(e.origin+e.pathname+e.search);this.Zt!==i&&(this.Zt=i,this.be("$url_changed",{href:i}))}catch(t){}}Gt(){if(this.Pe.length){var t=[...this.Pe];this.Pe=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.Ht(t)}))}}de(){return this.Ht(Cl((()=>Ml().takeFullSnapshot())))}get Qt(){var t,e,i;if(null!=(t=this.Ie)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var r,n=null==(r=this._instance.config.session_recording)?void 0:r.trigger_pending_buffer_interval_millis;return it(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(i=this._instance.config.session_recording)?void 0:i.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Jt(){if(this.Yt&&clearInterval(this.Yt),!0!==this.De){var t=this.Qt;t&&(this.Yt=setInterval((()=>{this.de()}),t))}}ve(t){"event"===t&&this.Kt(),!this.J.urlBlocked&&["sampled","active"].includes(this.status)&&this.Jt()}Xt(){var t;this.J.urlBlocked||(this.J.urlBlocked=!0,null==(t=this.zt)||t.scan(),clearInterval(this.Yt),Sl.info("recording paused due to URL blocker"),this.be("recording paused",{reason:"url blocker"}))}er(){var t;this.J.urlBlocked&&(null==(t=this.zt)||t.scan(),this.J.urlBlocked=!1,this.de(),this.Wt(),this.Jt(),this.be("recording resumed",{reason:"left blocked url"}),Sl.info("recording resumed"))}tr(t,e){var i;if("event"===t&&this.Kt(),!this.Oe&&null!=(i=this.Ie)&&i.hasPendingTriggers(this.sessionId)){this.Oe=!0;try{var r,n;null==(r=this._instance.persistence)||r.register({["url"===t?qn:jn]:this.sessionId}),null==(n=this.Ie)||n.updateActiveTriggers(this.sessionId),this.ve(),this.Ct(),this.he(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Oe=!1}}}get isStarted(){return!!this.Ae}get Me(){var t=this._instance.get_property(Rn);if(t){var e;try{e=Q(t)?t:JSON.parse(t)}catch(t){return void Sl.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>_l)return Sl.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(r=this._instance.persistence)||r.unregister(Rn))}return e}}rr(t,e,i){this._instance.get_property(t)&&(e(),i())}start(e){var i,n,s=this.Me;if(s){this.isStarted||(this.qe=!1!==this.De&&!this.He,this.He=!1,this.je=this.qe,this.Be=!1),this.rt&&(this.ir(),this.Mt());var a=this.Se.checkAndGetSessionAndWindowId(),o=a.windowId;this._e=a.sessionId,this.ct=o,null==(i=this._instance.persistence)||i.unregister(zn),null!=s&&s.endpoint&&(this.Ee=null==s?void 0:s.endpoint),this.Ie=2===(null==s?void 0:s.version)&&(null==s?void 0:s.triggerGroups)&&s.triggerGroups.length>0?new Fo(this._instance,this.J,this.he.bind(this),this.be.bind(this),this.ve.bind(this)):new Ao(this._instance,this.J,this.Y,this.K,this.he.bind(this),this.de.bind(this),this.ve.bind(this)),this.Ie.onRemoteConfig(s),null==(n=this.pe)||n.call(this),this.pe=this.Ie.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.tr(t,e))),this.rr(An,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(An)})),this.rr(Fn,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Fn)})),this.rr(Ln,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Ln)})),this.rr(On,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(On)})),this.Ie.makeSamplingDecisions(this.sessionId),this.nr(),this.Ue||(Yi(t,"beforeunload",this._t),Yi(t,"pagehide",this.Tt),Yi(t,"offline",this.It),Yi(t,"online",this.Et),Yi(r,"visibilitychange",this.At),!this.nt&&Z(this.Se.onSessionId)&&(this.nt=this.Se.onSessionId(this.ut)),!this.ot&&Z(this.Se.on)?this.ot=this.Se.on("forcedIdleReset",(()=>{this.dt(),this.De="unknown",this.stop(),this.st=this.Se.onSessionId(((t,e,i)=>{var r;null==(r=this.st)||r.call(this),this.st=void 0,this.ut(t,e,i)}))})):Z(this.Se.on)||Sl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),et(this.it)&&(this.it=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.jt(t.properties.$current_url):"";if(!e)return;this.be("$pageview",{href:e})}}catch(t){Sl.error("Could not add $pageview to rrweb session",t)}}))),this.status===Zs&&this.he(e||"recording_initialized"))}else Sl.info("remote config must be stored in persistence before recording can start")}ar(){var e,i,n,s,a,o;null==t||t.removeEventListener("beforeunload",this._t),null==t||t.removeEventListener("pagehide",this.Tt),null==t||t.removeEventListener("offline",this.It),null==t||t.removeEventListener("online",this.Et),null==r||r.removeEventListener("visibilitychange",this.At),clearInterval(this.Yt),this.sr(),null==(e=this.it)||e.call(this),this.it=void 0,null==(i=this.pe)||i.call(this),this.pe=void 0,null==(n=this.nt)||n.call(this),this.nt=void 0,null==(s=this.ot)||s.call(this),this.ot=void 0,null==(a=this.st)||a.call(this),this.st=void 0,null==(o=this.Ie)||o.stop(),this.ur(),this.ir()}ir(){this.tt+=1,this.Xe=[],this.et=0,this.lr=void 0,this.rt=!1}ur(){var t,e,i;null==(t=this.cr)||t.stop(),this.Pe=[],null==(e=this.zt)||e.stop(),this.zt=void 0,this.Re=!1,null==(i=this.Ae)||i.call(this),this.Ae=void 0}hr(){if(!this.lr||0===this.et)return!1;if(this.rt)return!0;this.rt=!0;var t=this.tt;return this.sr(),this.ur(),this.lr.catch((()=>{})).then((()=>{t===this.tt&&(this.rt=!1,this.Ct(),this.Mt(),this.ar(),Sl.info("stopped"))})).catch((()=>{this.rt=!1,this.ar(),Sl.info("stopped")})),!0}stop(){this.ur(),this.hr()||(this.Ct(),this.Mt(),this.ar(),Sl.info("stopped"))}vt(t){var e;this.stop(),this.dr=void 0,this.vr=void 0,this.Ne=0,null==(e=Tl())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed"),this.qe=t,this.je=!1}Kt(){this.isStarted||(this.He=!0),this.qe&&(this.qe=!1,this.je=!1,this.Be&&(this.Be=!1,this.de()),this.pr())}discard(){this.Mt(),this.ar(),Sl.info("discarded")}gr(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};this.status!==Vs?(this.mr(t,r),this.yr(s)):this.Mt()}br(){try{this.wr()}catch(t){this.ze||(this.ze=!0,Sl.error("could not track full snapshot cost",t))}}wr(){var t,e=null==(t=Tl())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.vr&&(this.vr=e,this.dr&&this.dr.durationMs>=e.durationMs||(this.dr=e),500>e.durationMs||Sl.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}mr(t,e){t.type!==m.FullSnapshot?t.type===m.IncrementalSnapshot&&(K(this.Ye)||this.Ye===e||this.Ke===e||(this.Ke=e,Sl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.de())):this.Ye=e}kr(t){t.counted&&t.generation===this.tt&&(this.et=Math.max(0,this.et-1)),t.counted=!1,this.Xe=this.Xe.filter((e=>e!==t))}_r(t,e,i){t.processed||t.generation!==this.tt||(t.processed=!0,this.gr(t.event,e,i,t.targetSessionId,t.targetWindowId))}Sr(t){try{var e=t.compressionEnabled?Bl(t.event):{event:t.event,size:_a(t.event)};this._r(t,e.event,e.size)}finally{this.kr(t)}}xt(){[...this.Xe].forEach((t=>{this.Sr(t)}))}Cr(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.tt,processed:!1,counted:!0};this.Xe.push(s),this.et+=1;var a=function(){var i=f((function*(){try{if(s.processed)return;var i,r;try{var a=e?$l(t)?yield function(t){return Hl.apply(this,arguments)}(t):Bl(t):{event:t,size:_a(t)};i=a.event,r=a.size}catch(e){Sl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=_a(t)}n._r(s,i,r)}finally{n.kr(s)}}));return function(){return i.apply(this,arguments)}}();this.lr=this.lr?this.lr.catch((()=>{})).then(a):a()}onRRwebEmit(t){var e,i,r,n,s,a,o,l,u;if(this._instance.sessionManager&&(this.Gt(),t&&Q(t))){if(t.type===m.Meta){var h=this.jt(t.data.href);if(this.Zt=h,!h)return;t.data.href=h}else this.Vt();if(null==(e=this.Ie)||e.checkUrlTriggers(this.sessionId,(()=>this.Xt()),(()=>this.er()),((t,e)=>this.tr(t,e))),!this.J.urlBlocked||function(t){return t.type===m.Custom&&"recording paused"===t.data.tag}(t)){var d,v,c;t.type===m.FullSnapshot&&(null!=(d=Tl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this.We=!0),this.br(),Promise.resolve().then((()=>this.br())),this.Jt(),null==(v=this.cr)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[zn]:t.timestamp},void 0));var f=t.type===m.FullSnapshot&&(null==(i=this.Ie)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.Mr();var p=this.cr?this.cr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&Q(e)&&6===e.type&&Q(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var i=[],r=0;e.data.payload.payload.length>r;r++)i.push(e.data.payload.payload[r]&&e.data.payload.payload[r].length>2e3?e.data.payload.payload[r].slice(0,2e3)+"...[truncated]":e.data.payload.payload[r]);return e.data.payload.payload=i,t}return t}(p),b=function(t){return Wl(t)?t.data.payload:null}(g),_=function(t){return Vl(t)?t.data.payload:null}(g),w=function(t){return zl(t)?t.data.payload:null}(g);b||_?null!=b&&b.lastActivityTimestamp&&(g.timestamp=b.lastActivityTimestamp):null!=w&&w.sessionId||this.Tr(g),t.type===m.FullSnapshot&&(this.Je.push([this._e,t.timestamp]),this.Je.length>6&&(this.Je=this.Je.slice(-6)));var k=null!==(r=null!==(n=null!==(s=null==b?void 0:b.currentSessionId)&&void 0!==s?s:null==_?void 0:_.nextSessionId)&&void 0!==n?n:null==w?void 0:w.sessionId)&&void 0!==r?r:this._e,S=null!==(a=null!==(o=null!==(l=null==b?void 0:b.currentWindowId)&&void 0!==l?l:null==_?void 0:_.nextWindowId)&&void 0!==o?o:null==w?void 0:w.windowId)&&void 0!==a?a:this.ct;if(!0!==this.De||function(t){return zl(t)||Wl(t)||Vl(t)}(g)){g.type===m.FullSnapshot&&(this.Fe=0),w&&(g.timestamp=w.lastActivityTimestamp+w.threshold);var x=this.Re;this.Re=!0,f?this.Wt(!0):x||this.Wt();var C=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.et>0||C&&$l(g))this.Cr(g,C,k,S);else{var T=C?Bl(g):{event:g,size:_a(g)};this.gr(g,T.event,T.size,k,S)}}else(function(t){return t.type===m.FullSnapshot||t.type===m.Meta||t.type===m.IncrementalSnapshot&&t.data.source!==y.CanvasMutation})(g)&&this.Fe++}else!0===this.De&&this.Fe++}}}get status(){return this.Ie?this.Ie.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Ce,rrwebError:this.Ue,urlTriggerMatching:this.J,eventTriggerMatching:this.Y,linkedFlagMatching:this.K,remoteConfig:this.Me}):Vs}log(t,e){var i;void 0===e&&(e="log"),null==(i=this._instance.sessionRecording)||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.K.linkedFlagSeen=!0,this.de(),this.Kt(),this.he("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[$n]:this.sessionId,[Pn]:null}),this.de(),this.Kt(),this.he("sampling_overridden")}overrideTrigger(t){this.tr(t),this.Kt()}Ir(){try{var e,i=null==t||null==(e=t.location)?void 0:e.href;if(!i)return;var r=this.jt(i);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}sr(){this.Er&&(clearTimeout(this.Er),this.Er=void 0)}pr(){this.Er||(this.Er=setTimeout((()=>{this.Ct()}),2e3))}Ar(){return this.Ye!==this.bt.sessionId&&0!==this.bt.data.length&&this.bt.data.every((t=>(null==t?void 0:t.type)===m.Custom&&!Wl(t)&&!Vl(t)))}Rr(){var t,e;return null!==(t=null==(e=this.Ie)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Lr(t){if(t!==Qs)return K(this.Or)||this._instance.register_for_session({[Is]:[]}),void(this.Or=void 0);var e=this.Rr();if(0===e.length)return K(this.Or)||this._instance.register_for_session({[Is]:[]}),void(this.Or=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.Or&&(this.Or=r,this._instance.register_for_session({[Is]:e}),Sl.info("buffering: "+i))}Ct(){var t;if(this.sr(),this.qe)return this.bt;if(this.Ar())return this.bt.size>wl?this.Mt():this.bt;var e=this.bt;null==(t=this.Ie)||t.ensureSamplingDecision(this.sessionId);var i=this.wt(),r=this.status;if(this.Lr(r),r===Qs||r===Js||r===Vs||i)return this.pr(),this.bt;if(this.bt!==e)return this.bt;if(e.data.length>0){var n,s=this.Ir();ka(e).forEach((t=>{var e;null==(e=this.ht)||e.trackSize(t.sessionId,t.size),this.Pr({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:qi.LIB_NAME,$lib_version:qi.LIB_VERSION,$snapshot_host:s})})),null==(n=this.Ie)||n.onFlushComplete()}return this.Mt()}yr(t){var e,i=2+((null==(e=this.bt)?void 0:e.data.length)||0),r=t.$session_id,n=this.bt.sessionId!==r;if(n||!0!==this.De&&!this.qe&&this.bt.size+t.$snapshot_bytes+i>wl){var s=this._e;if(this.bt=this.Ct(),this._e!==s)return;n&&this.bt.data.length>0&&(this.bt=this.Mt()),this.bt.sessionId=r,this.bt.windowId=t.$window_id}this.qe&&(this.Be||this.bt.size+t.$snapshot_bytes+i>wl)?this.Be||(this.Be=!0,this.bt=this.Mt()):(this.bt.size+=t.$snapshot_bytes,this.bt.data.push(t.$snapshot_data),this.bt.sizes.push(t.$snapshot_bytes),!0===this.De||this.qe||this.pr())}Pr(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Ee),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get kt(){var t,e,i=null==(t=this.bt)?void 0:t.data[(null==(e=this.bt)?void 0:e.data.length)-1],r=this.Se.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-r.sessionStartTimestamp:null}Mr(){if(!this.bt||0===this.bt.data.length)return this.Mt();for(var t=-1,e=this.bt.data.length-1;e>=0;e--)if(this.bt.data[e].type===m.Meta){t=e;break}return 0>t?this.Mt():(this.bt.data=this.bt.data.slice(t),this.bt.sizes=this.bt.sizes.slice(t),this.bt.size=this.bt.sizes.reduce(((t,e)=>t+e),0),this.bt)}Mt(){return this.bt={size:0,data:[],sizes:[],sessionId:this._e,windowId:this.ct},this.bt}he(t,e){this._instance.register_for_session({[Fs]:t}),Sl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.be("$recording_started",p({reason:t},e))}Dr(t){var e;return 3===t.type&&-1!==xl.indexOf(null==(e=t.data)?void 0:e.source)}Tr(t){var e=this.Dr(t);e||!0===this.De||t.timestamp-this.Le>this.xe&&(this.De=!0,clearInterval(this.Yt),this.be("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Le,threshold:this.xe,bufferLength:this.bt.data.length,bufferSize:this.bt.size,sessionId:this._e,windowId:this.ct}),this.Ct());var i=!1;if(e&&(this.Le=t.timestamp,this.De)){var r="unknown"===this.De;this.De=!1,r||(this.be("sessionNoLongerIdle",{reason:"user activity",type:t.type}),i=!0)}var n=this.Se.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,a=n.sessionId,o=this._e!==a,l=this.ct!==s;if(this.ct=s,this._e=a,o||l){var u=o&&!1!==this.De;u&&(this.De="unknown"),this.vt(u)}else if(e&&this.Kt(),i){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.Ie)?void 0:h.hasPendingTriggers(this.sessionId));this.Fe>0&&d&&this.de(),this.Wt(),this.Jt()}}dt(){var t;null==(t=this.Ie)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,a,o,l,u=this.Se.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=Tl())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.bt.data.length,$sdk_debug_replay_internal_buffer_size:this.bt.size,$sdk_debug_current_session_duration:this.kt,$sdk_debug_session_start:u,$sdk_debug_replay_flushed_size:null==(e=this.ht)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Je,$snapshot_max_depth_exceeded:this.We,$sdk_debug_replay_slowest_full_snapshot_ms:gl(null==(i=this.dr)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:gl(null==(r=this.dr)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.dr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.dr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.dr)?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==h?void 0:h.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==h?void 0:h.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==h?void 0:h.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:gl(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:gl(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:gl(null==(o=Tl())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=Tl())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.Ne,$sdk_debug_replay_rrweb_error:this.Ue,$sdk_debug_rrweb_attached:!!this.Ae,$sdk_debug_rrweb_start_attempted:this.$e}}nr(){var e;if(!this.Ae){this.$e=!0;var i,n,s,a,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},l=this._instance.config.session_recording;for(var u of Object.entries(l||{})){var h=u[0],d=u[1];if(h in o)if("maskInputOptions"===h)o.maskInputOptions=p({password:!0},d);else if("sampling"===h){var v=null!=d?d:{},c={};K(v.mousemove)||(c.mousemove=v.mousemove),K(v.mouseInteraction)||(c.mouseInteraction=v.mouseInteraction),o.sampling=c}else o[h]=d}!0===(null==l?void 0:l.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=p({},o.slimDOMOptions,{script:!0})),this.Pt&&this.Pt.enabled&&(o.recordCanvas=!0,o.sampling=p({},o.sampling,{canvas:this.Pt.fps}),o.dataURLOptions={type:"image/webp",quality:this.Pt.quality},o.canvasResolutionScale=this.Ot,o.canvasMasking={configured:()=>{var t;return Z(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,i=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(Z(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.Ge||(this.Ge=!0,Sl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Rt&&(o.maskAllInputs=null===(i=this.Rt.maskAllInputs)||void 0===i||i,o.maskTextSelector=null!==(n=this.Rt.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(s=this.Rt.blockSelector)&&void 0!==s?s:void 0,o.maskAllElementAttributes=null!==(a=this.Rt.maskAllElementAttributes)&&void 0!==a&&a),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.Ze||(this.Ze=!0,Sl.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.Lt();var f=Ml();if(f){this.cr=null!==(e=this.cr)&&void 0!==e?e:new oo(f,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var i="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";Sl.info(i,{node:e}),this.log(kl+" "+i,"warn")},onDroppedAttributeMutations:t=>this.Ne+=t});var g=this.Nt();if(this.Ae=f(p({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.Qe||(this.Qe=!0,Sl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Ae)return this.Ue=!0,void Sl.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.Ue=!1,!0===(null==l?void 0:l.captureJsonLd)&&r&&null!=t&&t.MutationObserver&&!this.zt&&(this.zt=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=Jo,a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){for(var i=t;i;){if(fl(i,e.blockClass,e.blockSelector)||fl(i,e.maskTextClass,e.maskTextSelector))return!0;var r=i.parentNode;i=i.parentElement||(r&&r.nodeType===r.DOCUMENT_FRAGMENT_NODE?r.host:null)}return!1}(e,i))return;var o=function(t){if(!t||t.length>Jo)return null;try{var e=JSON.parse(t),i=G(e)?e.map(vl):vl(e);if(tt(i)||G(i)&&(!i.length||i.some(tt)))return null;var r=JSON.stringify(i);return r.length>2e4?null:[i,r]}catch(t){return null}}(e.text);if(!o)return void r.delete(e);var l=o[0],u=o[1];if(tt(a))return void r.set(e,u);if(r.get(e)!==u){if(u.length>s)return void(s=0);i.emit(l)&&(r.set(e,u),s-=u.length)}}catch(t){return}};try{var o=new e((t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of pl(t))a(e)};for(var i of t)if("childList"===i.type)cl(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&cl(r)&&a(r)}else"attributes"===i.type&&cl(i.target)&&a(i.target)}catch(t){return}}));return o.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&pl(t.documentElement).forEach((t=>{e&&r.delete(t),a(t)}))},stop(){return o.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(r,t.MutationObserver,{blockClass:o.blockClass,blockSelector:o.blockSelector,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.J.urlBlocked||this.J.isCurrentUrlBlocked()?null:this.Ut()},emit:t=>this.$t(t)}),this.J.isCurrentUrlBlocked()&&this.zt.scan()),this.Le=Date.now(),this.De=nt(this.De)?this.De:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Me),this.be("$session_options",{sessionRecordingOptions:o,activePlugins:g.map((t=>null==t?void 0:t.name))}),this.be("$posthog_config",{config:this._instance.config})}else Sl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.be(t,e)}}var Zl,Ql=["type"],Jl=Object.defineProperty,Kl=(t,e,i)=>((t,e,i)=>e in t?Jl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Yl=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Yl||{}),Xl=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Xl||{}),tu=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(tu||{}),eu=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(eu||{}),iu=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(iu||{}),ru=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(ru||{}),nu=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(nu||{});function su(t,e){return-1!==t.indexOf(e)}var au={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},ou={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},lu={};function uu(t){if(lu[t])return lu[t];var e=function(t){var e,i,r=null==(i=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in au?au[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in ou?ou[t]:void 0,a=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&a)return lu[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var l=!1;try{document.body.appendChild(o);var u=o.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return su(t,"AppleWebKit")&&!su(t,"Chrome")}(navigator.userAgent)&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),lu[t]=h):i}catch(t){return i}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var hu={};function du(t,e,i){var r,n=t+"."+String(i);if(hu[n])return hu[n].call(e);var s=uu(t),a=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return a?(hu[n]=a,a.call(e)):e[i]}var vu={};function cu(t,e,i){var r=t+"."+String(i);if(vu[r])return vu[r].bind(e);var n=uu(t)[i];return"function"!=typeof n?e[i]:(vu[r]=n,n.bind(e))}function fu(){return uu("MutationObserver").constructor}function pu(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n={next:r},s=i((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var i=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=t[e],a=i(r);a;){if(a.next===s)return void(a.next=n.next);a=i(r=a.next)}else t[e]=n.next}}catch(t){return()=>{}}}var gu={childNodes:t=>du("Node",t,"childNodes"),parentNode:t=>du("Node",t,"parentNode"),parentElement:t=>du("Node",t,"parentElement"),textContent:t=>du("Node",t,"textContent"),contains:(t,e)=>cu("Node",t,"contains")(e),getRootNode:t=>cu("Node",t,"getRootNode")(),host:t=>t&&"host"in t?du("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?du("Element",t,"shadowRoot"):null,querySelector:(t,e)=>cu("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>cu("Element",t,"querySelectorAll")(e),mutationObserver:fu,patch:pu},mu=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0});function yu(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var bu=0,_u=6e4;function wu(){bu+=1}function ku(){return bu}function Su(t,e){return e!==bu||t>_u}var xu=0,Cu=0,Tu=0,Mu=mu(),Eu=null,Iu=null,Ru=[],Pu=0,Au=0,Fu={slowestBatchMs:0},Ou={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0},Lu=t=>t&&t>0?t:null;function Du(t){(xu+=1)>1||(Mu=mu(),Ru=[],Pu=0,Iu=Lu(t),Cu=yu(),Tu=bu)}function $u(){return 0===xu?Eu||mu():(xu-=1)>0?Mu:(Mu.durationMs=yu()-Cu,Mu.deferredStylesheetCount=Pu,Ou.deferredCount+=Pu,Iu=null,Su(Mu.durationMs,Tu)?Mu:Eu=Mu)}var Nu=32;function qu(t,e,i){var r=t.length;if(i>=Nu)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)r+=qu(a,e,i+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var l=o.rules||o.cssRules;l&&(r+=qu(l,e,i+1))}}}catch(t){}}return r}function ju(t){if(0!==xu){var e=qu(t,null,0);Mu.cssRuleCount+=e,Au>0&&(Mu.nonDeferrableCssRuleCount+=e)}}function Bu(t){Au+=1;try{return t()}finally{Au-=1}}function Hu(t){xu>0&&(Mu.stylesheetMs+=t)}function Uu(t){if(0===xu||null===Iu)return!1;var e=Mu.cssRuleCount-Mu.nonDeferrableCssRuleCount;return e>=Iu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),qu(e,i,0)}catch(t){return 0}}(t)>Iu}function zu(){Ou.failedCount+=1}function Wu(t){t>0&&(Ou.abandonedCount+=t)}function Vu(t){return t.nodeType===t.ELEMENT_NODE}function Gu(t){var e=t&&"host"in t&&"mode"in t&&gu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&gu.shadowRoot(e)===t)}function Zu(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Qu(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function Ju(t){var e=t.cssText;if(3>e.split('"').length)return e;var i=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?i.push("layer"):t.layerName&&i.push("layer("+t.layerName+")"),t.supportsText&&i.push("supports("+t.supportsText+")"),t.media.length&&i.push(t.media.mediaText),i.join(" ")+";"}var Ku=0;function Yu(t){var e=0===Ku,i=e?yu():0;Ku+=1;try{var r=t.rules||t.cssRules;if(!r)return null;ju(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Qu(Array.from(r,(t=>Xu(t,n))).join(""))}catch(t){return null}finally{Ku-=1,e&&Hu(yu()-i)}}function Xu(t,e){var i;if(eh(t)){var r;try{r=Yu(t.styleSheet)||Ju(t)}catch(e){r=t.cssText}try{if(r&&(null==(i=t.styleSheet)?void 0:i.href))return mh(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return ih(t)&&t.selectorText.includes(":")&&(n=th(n)),e?mh(n,e):n}function th(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function eh(t){return"styleSheet"in t}function ih(t){return"selectorText"in t}var rh=/^-?[A-Za-z_][\w-]*$/,nh=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function sh(t){var e=[],i=!1,r=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var o=e[e.length-1];return o.parts.push(t),void(o.index+=1)}if(!n.importRule)return i=!0,void(r=t);a(e[e.length-1],n.importRule,t)}function a(t,e,i){var r;try{var n;try{n=i||Ju(e)}catch(t){n=e.cssText}try{n&&(null==(r=e.styleSheet)?void 0:r.href)&&(n=mh(n,e.styleSheet.href))}catch(t){}n&&t.parts.push(n),t.index+=1}catch(t){s(null)}}function o(t){var i=t.rules[t.index];if("sheet"===t.kind&&eh(i)){var r=n.get(i);return null===r?(t.parts.push(i.cssText),void(t.index+=1)):r?void e.push({kind:"sheet",sheet:r.sheet,rules:r.rules,sheetHref:r.sheetHref,index:0,parts:[],importRule:i}):void a(t,i,null)}if(!function(t,i){try{var r=function(t){var e,i=t;if(!i.cssRules||0===i.cssRules.length)return null;if(i.media&&"string"==typeof i.media.mediaText)return"@media "+i.media.mediaText+" {";if(ih(t)){if("number"==typeof i.type&&1!==i.type)return null;var r=i.style?i.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in i)return"string"!=typeof i.containerQuery||i.containerName&&!rh.test(i.containerName)?null:"@container "+(i.containerName?i.containerName+" ":"")+i.containerQuery+" {";if("string"==typeof i.conditionText){var n="";try{n=(null==(e=t.constructor)?void 0:e.name)||""}catch(t){return null}return""===n||"Object"===n||"CSSSupportsRule"===n?"@supports "+i.conditionText+" {":null}return"string"==typeof i.name?"keyText"in i.cssRules[0]?rh.test(i.name)?"@keyframes "+i.name+" {":null:""===i.name?"@layer {":nh.test(i.name)?"@layer "+i.name+" {":null:null}(t);if(null===r)return!1;var n=i.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?mh(r,n):r,fixColons:"sheet"===i.kind&&ih(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&ih(i)&&i.selectorText.includes(":")&&(s=th(s)),t.parts.push(t.sheetHref?mh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;ju(i);var r=t.href;!r&&t.ownerNode&&(r=t.ownerNode.baseURI);var s=Array.from(i);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:r,index:0,parts:[],importRule:null}),function(t,e){for(var i=[{sheet:e,rules:t,index:0}],r=function(){var t=i[i.length-1];if(t.index>=t.rules.length)return i.pop(),0;var e=t.rules[t.index];if(t.index+=1,!eh(e)||n.has(e))return 0;var r=null;try{r=e.styleSheet}catch(t){return n.set(e,null),0}if(!r||i.some((t=>t.sheet===r)))return 0;try{var s=r.rules||r.cssRules;if(!s)return 0;ju(s);var a=r.href;!a&&r.ownerNode&&(a=r.ownerNode.baseURI);var o=Array.from(s);n.set(e,{sheet:r,rules:o,sheetHref:a}),i.push({sheet:r,rules:o,index:0})}catch(t){}};i.length>0;)r()}(s,t),!0}catch(t){return!1}}(t)||(i=!0),{advance(t){if(i)return!0;var n=yu(),a=t>0?t:1;try{for(;!i&&a>0;){var l=e[e.length-1];if(l.rules.length>l.index){a-=1;try{o(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?th(h):h}else u=Qu(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{Hu(yu()-n)}return i},text:()=>i?r:null,remainingRules(){if(i)return 0;var t=0;for(var r of e)t+=r.rules.length-r.index;return t}}}class ah{constructor(){Kl(this,"idNodeMap",new Map),Kl(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),Vu(t)){var i=gu.shadowRoot(t);i&&this.removeNodeFromMap(i),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function oh(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&lh(n);return(i[r.toLowerCase()]||o&&i[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function lh(t){return t.toLowerCase()}var uh=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function hh(t){var e=t.element,i=t.name,r=t.value,n=t.maskAttributeFn,s=t.isGenerated;return r?t.maskAllElementAttributes?void 0!==s&&s&&uh.has(lh(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var dh="__rrweb_original__";function vh(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?lh(e):null}catch(t){return null}}var ch=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,fh=/^(?:[a-z+]+:)?\/\//i,ph=/^www\..*/i,gh=/^(data:)([^,]*),(.*)/i;function mh(t,e){return(t||"").replace(ch,((t,i,r,n,s,a)=>{var o,l=r||s||a,u=i||n||"";if(!l)return t;if(fh.test(l)||ph.test(l))return"url("+u+l+u+")";if(gh.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var v of(h.pop(),d))"."!==v&&(".."===v?h.pop():h.push(v));return"url("+u+h.join("/")+u+")"}))}var yh,bh,_h="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",wh=4096,kh=1e5,Sh=10,xh=new Map,Ch=1,Th=new RegExp("[^a-z0-9-_:]"),Mh=-2;function Eh(){return Ch++}var Ih=/^[^ \t\n\r\u000c]+/,Rh=/^[, \t\n\r\u000c]+/,Ph=new WeakMap;function Ah(t,e){return e&&""!==e.trim()?Fh(t,e):e}function Fh(t,e){var i=Ph.get(t);if(i||(i=t.createElement("a"),Ph.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Oh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?_h:t}(t,e.maxBase64ImageLength):t}function Lh(t,e,i,r,n,s){var a;if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o=null==(a=n.sheet)?void 0:a.href;if(o)return o}var l=Ah(t,r);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,i,r){if(kh>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>wh||t.naturalHeight>wh)return e;var n=xh.get(e);if(n&&n.type===i&&n.quality===r)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>o.length?o:e;if(xh.size>=Sh){var u=xh.keys().next().value;void 0!==u&&xh.delete(u)}return xh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Oh(u,s)}if("image"===e)return Oh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=Ah(t,r);return"image"===e&&h.startsWith("data:")?Oh(h,s):h}return"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(i+=(r=n[0]).length,r):""}for(var n=[];r(Rh),e.length>i;){var s=r(Ih);if(","===s.slice(-1))s=Ah(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Ah(t,s);for(var o=!1;;){var l=e.charAt(i);if(""===l){n.push((s+a).trim());break}if(o)")"===l&&(o=!1);else{if(","===l){i+=1,n.push((s+a).trim());break}"("===l&&(o=!0)}a+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?mh(r,Fh(t)):"object"===e&&"data"===i?Ah(t,r):r:Ah(t,r)}function Dh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function $h(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&$h(gu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&$h(gu.parentNode(t),e,i)}function Nh(t,e,i,r){var n;if(Vu(t)){if(!gu.childNodes(n=t).length)return!1}else{if(null===gu.parentElement(t))return!1;n=gu.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if($h(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function qh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var jh=new Map;function Bh(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Hh(t){return null==t?"":t.toLowerCase()}var Uh=50,zh=!1,Wh=!1;function Vh(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,v=e.maskInputOptions,c=void 0===v?{}:v,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,b=e.slimDOMOptions,_=e.dataURLOptions,w=void 0===_?{}:_,k=e.inlineImages,S=void 0!==k&&k,x=e.recordCanvas,C=void 0!==x&&x,T=e.canvasMaskingConfigured,M=e.onSerialize,E=e.onIframeLoad,I=e.iframeLoadTimeout,R=void 0===I?5e3:I,P=e.onIframeListenerRegistered,A=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,O=void 0===F?5e3:F,L=e.keepIframeSrcFn,D=void 0===L?()=>!1:L,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,H=e.maxDepth,U=void 0===H?Uh:H,z=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=U)return Wh=!0,zh||(zh=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+U+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;z||(z=Nh(t,a,o,void 0===z)),xu>0&&(Mu.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,u=e.maskTextFn,h=e.maskInputFn,d=e.maskAllElementAttributes,v=void 0!==d&&d,c=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,b=e.keepIframeSrcFn,_=e.newlyAddedElement,w=void 0!==_&&_,k=function(t,e){if(e.hasNode(t)){var i=e.getId(t);return 1===i?void 0:i}}(i,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:nu.Document,childNodes:[],compatMode:t.compatMode}:{type:nu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:nu.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e){for(var i,r,n,s=e.doc,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,u=e.maskInputFn,h=e.maskAllElementAttributes,d=void 0!==h&&h,v=e.maskAttributeFn,c=e.dataURLOptions,f=void 0===c?{}:c,p=e.inlineImages,g=e.recordCanvas,m=e.canvasMaskingConfigured,y=e.keepIframeSrcFn,b=e.newlyAddedElement,_=void 0!==b&&b,w=e.rootId,k=function(t,e,i){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;if(i)return t.matches(i)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),S=function(t){if(t instanceof HTMLFormElement)return"form";var e=lh(t.tagName);return Th.test(e)?"div":e}(t),x=new Set,C={},T=t.attributes.length,M=0;T>M;M++){var E=t.attributes[M];Dh(S,E.name)||(C[E.name]=Lh(s,S,lh(E.name),E.value,t,f))}if("link"===S&&a&&!k){var I=t.sheet;if(!I){var R=function(t){return t.href}(t);R&&!(I=Bh(s,R))&&R.includes(".css")&&(I=Bh(s,window.location.origin+"/"+R.replace(window.location.href,"")))}var P=null;I&&(Uu(I)?xu>0&&(Ru.push(t),Pu+=1):P=Yu(I)),P&&(delete C.rel,delete C.href,C._cssText=P)}if("style"===S&&t.sheet&&!(t.innerText||gu.textContent(t)||"").trim().length){var A=Bu((()=>Yu(t.sheet)));A&&(C._cssText=A)}if("input"===S||"textarea"===S||"select"===S){var F=t.value,O=t.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&F?C.value=oh({element:t,type:vh(t),tagName:S,value:F,maskInputOptions:l,maskInputFn:u}):O&&(C.checked=O)}if("option"===S&&(t.selected&&!l.select?C.selected=!0:delete C.selected),"dialog"===S&&t.open){try{C.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){C.rr_open_mode="modal",C.ph_rr_could_not_detect_modal=!0}x.add("rr_open_mode")}if("canvas"===S&&g&&!(null==m?void 0:m()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var i=0;t.width>i;i+=50)for(var r=0;t.height>r;r+=50){var n=e.getImageData;if(new Uint32Array((dh in n?n[dh]:n).call(e,i,r,Math.min(50,t.width-i),Math.min(50,t.height-r)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(C.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){var L=t.toDataURL(f.type,f.quality),D=s.createElement("canvas");D.width=t.width,D.height=t.height,L!==D.toDataURL(f.type,f.quality)&&(C.rr_dataURL=L)}var N,q,j=!1;if("img"===S&&p){yh||(yh=s.createElement("canvas"),bh=yh.getContext("2d"));var B=t,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",U=B.crossOrigin,z=(e,i)=>j?hh({element:t,name:e,value:i,maskAllElementAttributes:d,maskAttributeFn:v}):i,W=()=>{qh(B,"load",W);try{yh.width=B.naturalWidth,yh.height=B.naturalHeight,bh.drawImage(B,0,0);var t=yh.toDataURL(f.type,f.quality);C.rr_dataURL=z("rr_dataURL",t)}catch(t){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?W():B.addEventListener("load",W));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===B.crossOrigin&&(U?C.crossOrigin=z("crossOrigin",U):B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?W():B.addEventListener("load",W)}if("audio"===S||"video"===S){var V=C;V.rr_mediaState=t.paused?"paused":"played",x.add("rr_mediaState"),V.rr_mediaCurrentTime=t.currentTime,V.rr_mediaPlaybackRate=t.playbackRate,V.rr_mediaMuted=t.muted,V.rr_mediaLoop=t.loop,V.rr_mediaVolume=t.volume}if(_||(t.scrollLeft&&(C.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(C.rr_scrollTop=t.scrollTop)),k){var G=t.getBoundingClientRect(),Z=G.width,Q=G.height,J=G.left,K=G.top,Y=null==(i=s.defaultView)?void 0:i.getComputedStyle(t);C={class:C.class,rr_width:Z+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null==(r=s.defaultView)?void 0:r.scrollX)||0))+"px",rr_top:Math.floor(K+((null==(n=s.defaultView)?void 0:n.scrollY)||0))+"px"},x.add("rr_width"),x.add("rr_height"),x.add("rr_left"),x.add("rr_top"),Y&&(C.rr_position=Y.position||"static",x.add("rr_position"),Y.transform&&"none"!==Y.transform&&(C.rr_transform=Y.transform,x.add("rr_transform")),Y.display&&Y.display.startsWith("inline")&&(C.rr_display=Y.display,x.add("rr_display")))}if("iframe"!==S||y(C.src)||(t.contentDocument||(C.rr_src=C.src),delete C.src),d||v)for(var X of Object.entries(C)){var tt=X[0],et=X[1];"string"!=typeof et&&null!==et||(C[tt]=hh({element:t,name:tt,value:et,maskAllElementAttributes:d,maskAttributeFn:v,isGenerated:x.has(tt)}))}j=!0;try{customElements.get(S)&&(N=!0)}catch(t){}return{type:nu.Element,tagName:S,attributes:C,childNodes:[],isSVG:(q=t,Boolean("svg"===q.tagName||q.ownerSVGElement)||void 0),needBlock:k,rootId:w,isCustom:N}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i,r=e.needsMask,n=e.maskTextFn,s=e.rootId,a=gu.parentNode(t),o=a&&a.tagName,l=gu.textContent(t),u="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(Uu(a.sheet));else if(null==(i=a.sheet)?void 0:i.cssRules){var d=Yu(a.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=mh(l,Fh(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&r&&(l=n?n(l,gu.parentElement(t)):l.replace(/[\S]/g,"*")),{type:nu.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:nu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:nu.Comment,textContent:gu.textContent(t)||"",rootId:k};default:return!1}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,keepIframeSrcFn:D,newlyAddedElement:q});if(!Z)return console.warn(t,"not serialized"),null;G=r.hasNode(t)?r.getId(t):function(t,e){if(e.comment&&t.type===nu.Comment)return!0;if(t.type===nu.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var i,r;try{r=new URL(t,window.location.href)}catch(t){return null}var n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(i=null==n?void 0:n[1])&&void 0!==i?i:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Hh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Hh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Hh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Hh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Hh(t.attributes.property).match(/^(og|twitter|fb):/)||Hh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Hh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Hh(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Hh(t.attributes.name))||Hh(t.attributes.property).match(/^article:/)||Hh(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Hh(t.attributes.name)))return!0}}return!1}(Z,b)||!V&&Z.type===nu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?Mh:Eh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),G===Mh)return null;M&&M(t);var J=!u;if(Q.type===nu.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=gu.shadowRoot(t);K&&Zu(K)&&(Q.isShadowHost=!0)}if((Q.type===nu.Document||Q.type===nu.Element)&&J){b.headWhitespace&&Q.type===nu.Element&&"head"===Q.tagName&&(V=!1);var Y={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:a,maskTextSelector:o,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:U};if(Q.type===nu.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(gu.childNodes(t))){var tt=Vh(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(Vu(t)&&(et=gu.shadowRoot(t)))for(var it of Array.from(gu.childNodes(et))){var rt=Vh(it,Y);rt&&(Zu(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=gu.parentNode(t);if(nt&&Gu(nt)&&Zu(nt)&&(Q.isShadow=!0),Q.type===nu.Element&&"iframe"===Q.tagName){var st=function(t,e,i){var r,n=()=>{},s=t.contentWindow;if(!s)return n;try{r=s.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==r){var o=!1,l=null,u=()=>{o||(o=!0,null!==l&&(clearTimeout(l),l=null),qh(t,"load",h),t.addEventListener("load",a),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),o?qh(t,"load",a):(o=!0,qh(t,"load",h))}}var d,v="about:blank";try{d=s.location.href}catch(t){return n}if(d!==v||t.src===v||""===t.src){var c=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(c),qh(t,"load",a)}}return t.addEventListener("load",a),()=>{qh(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&E){var i=Vh(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onIframeListenerRegistered:P,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B+1,maxDepth:U});i&&E(t,i)}}),R);null==P||P(t,st)}return Q.type===nu.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!jh.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,g=!1,_=()=>{if(!g){g=!0;try{(()=>{if(A){var e=Vh(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:b,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:D,depth:B,maxDepth:U});e&&A(t,e)}})()}finally{jh.delete(e),v.abort()}}},k=setTimeout(_,u);v.signal.addEventListener("abort",(()=>clearTimeout(k)),{once:!0}),e.addEventListener("load",_,{signal:v.signal,once:!0}),jh.set(e,v)}}}(t,0,O),Q}function Gh(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class Zh{constructor(){Kl(this,"parentElement",null),Kl(this,"parentNode",null),Kl(this,"ownerDocument"),Kl(this,"firstChild",null),Kl(this,"lastChild",null),Kl(this,"previousSibling",null),Kl(this,"nextSibling",null),Kl(this,"ELEMENT_NODE",1),Kl(this,"TEXT_NODE",3),Kl(this,"nodeType"),Kl(this,"nodeName"),Kl(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Zh))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Qh(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>Jh(i,t,e,r)}function Jh(t,e,i,r){Kh((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))}))}function Kh(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Yh="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",Xh={map:{},getId(){return console.error(Yh),-1},getNode(){return console.error(Yh),null},removeNodeFromMap(){console.error(Yh)},has(){return console.error(Yh),!1},reset(){console.error(Yh)}};function td(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,a)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,a)}),u))}}function ed(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){if(setTimeout((()=>{try{i.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>ed(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Xh=new Proxy(Xh,{get(t,e,i){return"map"===e&&console.error(Yh),Reflect.get(t,e,i)}}));var id=Date.now;function rd(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=gu.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=gu.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function nd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function sd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ad(t){return t?t.nodeType===t.ELEMENT_NODE?t:gu.parentElement(t):null}function od(t,e,i,r){if(!t)return!1;var n=ad(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if($h(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function ld(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===Mh}function ud(t,e){if(Gu(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=gu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||ud(r,e))}function hd(t){return Boolean(t.changedTouches)}function dd(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function vd(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function cd(t){return!!t&&(t instanceof Zh&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(gu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(id=()=>(new Date).getTime());class fd{constructor(){Kl(this,"id",1),Kl(this,"styleIDMap",new WeakMap),Kl(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function pd(t){var e,i=null;return"getRootNode"in t&&(null==(e=gu.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&gu.host(gu.getRootNode(t))&&(i=gu.host(gu.getRootNode(t))),i}function gd(t){var e=t.ownerDocument;return!!e&&(gu.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=pd(i);)i=e;return i}(t);return gu.contains(e,i)}(t))}function md(t){return"__ln"in t}class yd{constructor(){Kl(this,"length",0),Kl(this,"head",null),Kl(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,i=0;t>i;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&md(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&md(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var bd,_d=(t,e)=>t+"@"+e;class wd{constructor(){Kl(this,"frozen",!1),Kl(this,"locked",!1),Kl(this,"texts",[]),Kl(this,"attributes",[]),Kl(this,"attributeMap",new WeakMap),Kl(this,"generatedAttributes",new WeakMap),Kl(this,"removes",[]),Kl(this,"mapRemoves",[]),Kl(this,"movedMap",{}),Kl(this,"addedSet",new Set),Kl(this,"movedSet",new Set),Kl(this,"droppedSet",new Set),Kl(this,"removesSubTreeCache",new Set),Kl(this,"mutationCb"),Kl(this,"blockClass"),Kl(this,"blockSelector"),Kl(this,"maskTextClass"),Kl(this,"maskTextSelector"),Kl(this,"inlineStylesheet"),Kl(this,"maskInputOptions"),Kl(this,"maskTextFn"),Kl(this,"maskInputFn"),Kl(this,"maskAllElementAttributes"),Kl(this,"maskAttributeFn"),Kl(this,"keepIframeSrcFn"),Kl(this,"recordCanvas"),Kl(this,"canvasMaskingConfigured"),Kl(this,"inlineImages"),Kl(this,"slimDOMOptions"),Kl(this,"dataURLOptions"),Kl(this,"doc"),Kl(this,"mirror"),Kl(this,"iframeManager"),Kl(this,"stylesheetManager"),Kl(this,"shadowDomManager"),Kl(this,"canvasManager"),Kl(this,"processedNodeManager"),Kl(this,"unattachedDoc"),Kl(this,"canvasManagerReleased",!1),Kl(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Kl(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e,i=yu(),r=ku();try{this.processBufferedMutations()}finally{t=yu()-i,e=r,xu>0||Su(t,null!=e?e:bu)||t>Fu.slowestBatchMs&&(Fu.slowestBatchMs=t)}}})),Kl(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,i=new yd,r=t=>{for(var e=t,i=Mh;i===Mh;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=gu.parentNode(n);if(s&&gd(n)&&"TEXTAREA"!==s.tagName){var a=Gu(s)?this.mirror.getId(pd(n)):this.mirror.getId(s),o=r(n);if(-1===a||-1===o)return i.addNode(n);var l=Vh(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{dd(t,this.mirror)&&this.iframeManager.addIframe(t),vd(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),cd(t)&&!od(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(gu.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:a,nextId:o,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Sd(this.removesSubTreeCache,s)&&!this.movedSet.has(gu.parentNode(s))||n(s);for(var a of this.addedSet)xd(this.droppedSet,a)||Sd(this.removesSubTreeCache,a)?xd(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;i.length;){var l=null;if(o){var u=this.mirror.getId(gu.parentNode(o.value)),h=r(o.value);-1!==u&&-1!==h&&(l=o)}if(!l)for(var d=i.tail;d;){var v=d;if(d=d.previous,v){var c=this.mirror.getId(gu.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=gu.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=gu.host(f);if(-1!==this.mirror.getId(p)){l=v;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}o=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,i=gu.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e,i=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof i.style){var r=JSON.stringify(t.styleDiff),n=JSON.stringify(t._unchangedStyles);i.style.length>r.length&&(r+n).split("var(").length===i.style.split("var(").length&&(i.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var s of Object.entries(i)){var a=s[0],o=s[1];"string"!=typeof o&&null!==o||(i[a]=hh({element:t.node,name:a,value:o,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null==(e=this.generatedAttributes.get(t.node))?void 0:e.has(a)}))}return{id:this.mirror.getId(t.node),attributes:i}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))})),Kl(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),Kl(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var i=Array.from(gu.childNodes(t),(t=>gu.textContent(t)||"")).join("");e.attributes.value=oh({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:vh(t),value:i,maskInputFn:this.maskInputFn})})),Kl(this,"processMutation",(t=>{var e;if(!ld(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var i=gu.textContent(t.target);od(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue||this.texts.push({value:Nh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,ad(t.target)):i.replace(/[\S]/g,"*"):i,node:t.target});break;case"attributes":var r,n=t.target,s=t.attributeName,a=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,o=function(t,e,i){if(!i)return e;var r=t.getAttributeNodeNS(i,e);if(r)return r.name;if("http://www.w3.org/1999/xlink"===i)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===i)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===i)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(i);return n?n+":"+e:e}(n,s,a),l=a?n.getAttributeNS(a,s):t.target.getAttribute(s);if("value"===o){var u=n,h=vh(u);l=oh({element:u,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:h,value:l,maskInputFn:this.maskInputFn})}if(od(t.target,this.blockClass,this.blockSelector,!1)||l===t.oldValue)return;var d=this.attributeMap.get(t.target),v="IFRAME"===n.tagName&&"src"===o;if(v&&!this.keepIframeSrcFn(l)&&n.contentDocument)return;if(d||(this.attributes.push(d={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,d)),"type"===o&&"INPUT"===n.tagName&&"password"===(t.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Dh(n.tagName,o)){var c=Lh(this.doc,lh(n.tagName),lh(o),l,n,this.dataURLOptions);if(v&&!this.keepIframeSrcFn(l)&&(o="rr_src"),d.attributes[o]=c,null==(e=this.generatedAttributes.get(t.target))||e.delete(o),"style"===o){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=n.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?d.styleDiff[g]=""===y?m:[m,y]:d._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(d.styleDiff[b]=!1)}else if("open"===o&&"DIALOG"===n.tagName){d.attributes.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal";var _=this.generatedAttributes.get(t.target);_||this.generatedAttributes.set(t.target,_=new Set),_.add("rr_open_mode")}}break;case"childList":if(od(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var i=this.mirror.getId(e),r=Gu(t.target)?this.mirror.getId(gu.host(t.target)):this.mirror.getId(t.target);od(t.target,this.blockClass,this.blockSelector,!1)||ld(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(kd(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||ud(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[_d(i,r)]?kd(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!Gu(t.target)||!Zu(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),gu.childNodes(r).forEach((t=>i.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),Kl(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(ld(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[_d(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);od(t,this.blockClass,this.blockSelector,!1)||(gu.childNodes(t).forEach((t=>this.genAdds(t))),cd(t)&&gu.childNodes(gu.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function kd(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),gu.childNodes(r).forEach((t=>i.push(t)))}}function Sd(t,e,i){return 0!==t.size&&function(t,e,i){var r=gu.parentNode(e);return!!r&&t.has(r)}(t,e)}function xd(t,e){if(0===t.size)return!1;for(var i=gu.parentNode(e);i;){if(t.has(i))return!0;i=gu.parentNode(i)}return!1}var Cd=function(t,e){return void 0===e&&(e="rrweb"),bd?function(){try{return t(...arguments)}catch(t){if(bd&&!0===bd(t,e))return;throw t}}:t},Td=[];function Md(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function Ed(t,e){var i,r=new wd;r.init(t);try{i=new(fu())(Cd(r.processMutations.bind(r)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),Td.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function Id(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,l=t=>{var a=Md(t);if(a&&!od(a,n,s,!0)){var l,u,h=r.getId(a);if(a===i&&i.defaultView){var d=rd(i.defaultView);l=d.left,u=d.top}else l=a.scrollLeft,u=a.scrollTop;var v=l+","+u;o.get(h)!==v&&(o.set(h,v),e({id:h,x:l,y:u}))}},u=[Qh("scroll",Cd(td(Cd((t=>l(t))),a.scroll||100)),i)];return"onscrollend"in i&&u.push(Qh("scrollend",Cd(l),i)),()=>u.forEach((t=>t()))}function Rd(t,e){for(var i=Td.length-1;i>=0;i--){var r=Td[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),Td.splice(i,1))}}}var Pd=["INPUT","TEXTAREA","SELECT"],Ad=new WeakMap;function Fd(t){return function t(e,i){if(Nd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Nd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Nd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Nd("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);return i.unshift(r),t(e.parentRule,i)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);i.unshift(n)}return i}(t,[])}function Od(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}var Ld=5e3;function Dd(t,e){var i,r,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:gu.host(e));var o="#document"===e.nodeName?null==(i=e.defaultView)?void 0:i.Document:null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.ShadowRoot,l=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,i;try{i=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return i}}),Cd((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function $d(t,e){void 0===e&&(e={});var i,r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,v=t.fontCb,c=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),v(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),c(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var s,a,o,l,u,h,d,v,c=[],f=Cd((()=>{if(r){r.destroy(),r.reset();var e=Td.indexOf(r);-1!==e&&Td.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),c.forEach((t=>t()))}));try{if(t.recordDOM){var g=Ed(t,t.doc);i=g.observer,r=g.buffer}if(c.push(function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,a="number"==typeof i.mousemove?i.mousemove:50,o="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=td(Cd((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),o),h=Cd(td(Cd((t=>{var e=Md(t),i=hd(t)?t.changedTouches[0]:t,r=i.clientX,a=i.clientY;s||(s=id()),l.push({x:r,y:a,id:n.getId(e),timeOffset:id()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Xl.Drag:t instanceof MouseEvent?Xl.MouseMove:Xl.TouchMove)})),a,{trailing:!1})),d=[Qh("mousemove",h,r),Qh("touchmove",h,r),Qh("drag",h,r)];return Cd((()=>{d.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var o=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],u=null;return Object.keys(tu).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t])).forEach((t=>{var a=lh(t),o=(t=>i=>{var a=Md(i);if(!od(a,n,s,!0)){var o=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":o=eu.Mouse;break;case"touch":o=eu.Touch;break;case"pen":o=eu.Pen}o===eu.Touch&&(tu[t]===tu.MouseDown?l="TouchStart":tu[t]===tu.MouseUp&&(l="TouchEnd"))}else hd(i)&&(o=eu.Touch);null!==o?(u=o,(l.startsWith("Touch")&&o===eu.Touch||l.startsWith("Mouse")&&o===eu.Mouse)&&(o=null)):tu[t]===tu.Click&&(o=u,u=null);var h=hd(i)?i.changedTouches[0]:i;if(h){var d=r.getId(a),v=h.clientX,c=h.clientY;Cd(e)(p({type:tu[l],id:d,x:v,y:c},null!==o&&{pointerType:o}))}}})(t);if(window.PointerEvent)switch(tu[t]){case tu.MouseDown:case tu.MouseUp:a=a.replace("mouse","pointer");break;case tu.TouchStart:case tu.TouchEnd:return}l.push(Qh(a,o,i))})),Cd((()=>{l.forEach((t=>t()))}))}(t)),c.push(Id(t)),c.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return Qh("resize",Cd(td(Cd((()=>{var t=nd(),e=sd();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),r)}(t,{win:n})),c.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.ignoreClass,o=t.ignoreSelector,l=t.maskInputOptions,u=t.maskInputFn,h=t.userTriggeredOnInput;function d(t){var e=Md(t),r=t.isTrusted,d=i.defaultView;if(!e||!d||e instanceof d.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=gu.parentElement(e)),e&&c&&Pd.indexOf(c)>=0&&!od(e,n,s,!0)&&!(e.classList.contains(a)||o&&e.matches(o))){var f=e.value,p=!1,g=vh(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=oh({element:e,maskInputOptions:l,tagName:c,type:g,value:f,maskInputFn:u})),v(e,h?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var i=t.value;v(t,h?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}}))}}}function v(t,i){var n=Ad.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){Ad.set(t,i);var s=r.getId(t);Cd(e)(p({},i,{id:s}))}}var c=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>Qh(t,Cd(d),i))),f=i.defaultView;if(!f)return()=>{c.forEach((t=>t()))};var g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value");return g&&g.set&&c.push(...[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]].map((t=>ed(t[0],t[1],{set(){Cd(d)({target:this,isTrusted:!1})}},!1,f)))),Cd((()=>{c.forEach((t=>t()))}))}(t)),c.push(function(t){var e=t.mediaInteractionCb,i=t.blockClass,r=t.blockSelector,n=t.mirror,s=t.sampling,a=t.doc,o=Cd((t=>td(Cd((s=>{var a=Md(s);if(a&&!od(a,i,r,!0)){var o=a.currentTime,l=a.volume,u=a.muted,h=a.playbackRate,d=a.loop;e({type:t,id:n.getId(a),currentTime:o,volume:l,muted:u,playbackRate:h,loop:d})}})),s.media||500))),l=[Qh("play",o(ru.Play),a),Qh("pause",o(ru.Pause),a),Qh("seeked",o(ru.Seeked),a),Qh("volumechange",o(ru.VolumeChange),a),Qh("ratechange",o(ru.RateChange),a)];return Cd((()=>{l.forEach((t=>t()))}))}(t)),t.recordDOM){var m=function(t){var e=new Map,i=new Set,r=!0,n=t=>{if(r)try{t()}catch(t){}},s=t=>{var i,r=e.get(t);if(r){for(;null==(i=r[0])?void 0:i.ready;){var s=r.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===r.length&&e.delete(t)}};return{queueMutation(t,i){if(t){var r=e.get(t);r?(r.push({emit:i,ready:!0}),s(t)):n(i)}else n(i)},queuePendingMutation(a,o,l){if(!r)return()=>{};var u=e.get(a);u||e.set(a,u=[]);var h={emit:o,ready:!1};u.push(h);var d,v=!1,c=!1,f=()=>{v||c||(v=!0,void 0!==d&&i.delete(d),h.ready=!0,h.emit=void 0,s(a))};try{d=t.setTimeout(f,Ld),v||c?t.clearTimeout(d):i.add(d)}catch(t){f()}return e=>{!c&&r&&(c=!0,void 0!==d&&(t.clearTimeout(d),i.delete(d)),v?e&&n(l):(h.ready=!0,e||(h.emit=void 0),s(a)))}},reset(){r=!1,i.forEach((e=>t.clearTimeout(e))),i.clear(),e.clear()}}}(n);c.push(m.reset),c.push(function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win,a=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Od(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,adds:[{rule:o,index:l}]}))),l}),"host")}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){return void 0===i&&(i=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",i])};var l,u,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Od(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,removes:[{index:o}]}))),l}),"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(l=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);try{var u=null==l?void 0:l.then;if(e.ownerNode||!l||"function"!=typeof u)return l;n.onCssomSheetMutation(e);var h=Od(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=a.queuePendingMutation(e,(()=>i({id:d,styleId:v,replace:o})),(()=>{var t=Yu(e);null!==t&&i({id:d,styleId:v,replace:t})}));try{u.call(l,(()=>c(!0)),(()=>c(!1)))}catch(t){c(!1)}}catch(t){}return l}),"host")})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Od(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,(()=>i({id:h,styleId:d,replaceSync:o}))),l}),"host")}));var d={};qd("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(qd("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),qd("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),qd("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));var v={};return Object.entries(d).forEach((t=>{var e=t[0],s=t[1];v[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(v[e].insertRule,{apply:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Od(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Fd(e),l];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,adds:[{rule:o,index:v}]})))}return l}),"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:Cd(((t,e,s)=>{var o=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Od(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Fd(e),o];a.queueMutation(e.parentStyleSheet,(()=>i({id:h,styleId:d,removes:[{index:v}]})))}return l}),"host")})})),Cd((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=h,l&&(s.CSSStyleSheet.prototype.replace=l),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach((t=>{var e=t[0],i=t[1];i.prototype.insertRule=v[e].insertRule,i.prototype.deleteRule=v[e].deleteRule}))}))}(t,{win:n,mutationQueue:m})),c.push(Dd(t,t.doc)),c.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=e.mutationQueue,l=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:Cd(((t,e,a)=>{var l,u=a[0],h=a[1],d=a[2],v=t.apply(e,a);if(n.has(u))return v;var c=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=Od(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Fd(e.parentRule);o.queueMutation(c,(()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m})))}return v}),"host")});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Cd(((t,e,a)=>{var l,u=a[0],h=t.apply(e,a);if(n.has(u))return h;var d=null==(l=e.parentRule)?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=Od(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=Fd(e.parentRule);o.queueMutation(d,(()=>i({id:c,styleId:f,remove:{property:u},index:p})))}return h}),"host")}),Cd((()=>{a.CSSStyleDeclaration.prototype.setProperty=l,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n,mutationQueue:m})),t.collectFonts&&c.push(function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,a=r.FontFace;r.FontFace=function(t,e,i){var r=new a(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var o=pu(i.fonts,"add",(function(t){return function(i){return setTimeout(Cd((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=a})),n.push(o),Cd((()=>{n.forEach((t=>t()))}))}(t))}for(var y of(c.push((a=(s=t).doc,o=s.mirror,l=s.blockClass,u=s.blockSelector,h=s.selectionCb,d=!0,(v=Cd((()=>{var t=a.getSelection();if(!(!t||d&&(null==t?void 0:t.isCollapsed))){d=t.isCollapsed||!1;for(var e=[],i=t.rangeCount||0,r=0;i>r;r++){var n=t.getRangeAt(r),s=n.startContainer,v=n.startOffset,c=n.endContainer,f=n.endOffset;od(s,l,u,!0)||od(c,l,u,!0)||e.push({start:o.getId(s),startOffset:v,end:o.getId(c),endOffset:f})}h({ranges:e})}})))(),Qh("selectionchange",v))),c.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?pu(i.customElements,"define",(function(t){return function(i,r,n){try{e({define:{name:i}})}catch(t){console.warn("Custom element callback failed for "+i)}return t.apply(this,[i,r,n])}})):()=>{}}(t)),t.plugins))c.push(y.observer(y.callback,n,y.options))}catch(t){try{f()}catch(t){}throw t}return f}function Nd(t){return void 0!==window[t]}function qd(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class jd{constructor(t){Kl(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Kl(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){if(0>e)return e;var n=i||this.getRemoteIdToLocalIdMap(t),s=r||this.getLocalIdToRemoteIdMap(t),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}getIds(t,e){var i=this.getRemoteIdToLocalIdMap(t),r=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getId(t,e,i,r)))}getRemoteId(t,e,i){var r;return"number"!=typeof e||0>e?e:null!==(r=(i||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==r?r:-1}getRemoteIds(t,e){var i=this.getLocalIdToRemoteIdMap(t);return e.map((e=>this.getRemoteId(t,e,i)))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}}class Bd{constructor(t){Kl(this,"iframes",new WeakMap),Kl(this,"crossOriginIframeMap",new WeakMap),Kl(this,"crossOriginIframeMirror",new jd(Eh)),Kl(this,"crossOriginIframeStyleMirror"),Kl(this,"crossOriginIframeRootIdMap",new WeakMap),Kl(this,"mirror"),Kl(this,"mutationCb"),Kl(this,"wrappedEmit"),Kl(this,"loadListener"),Kl(this,"pageHideListener"),Kl(this,"stylesheetManager"),Kl(this,"recordCrossOriginIframes"),Kl(this,"messageHandler"),Kl(this,"nestedIframeListeners",new Map),Kl(this,"attachedWindows",new WeakMap),Kl(this,"attachedDocuments",new WeakMap),Kl(this,"attachedIframes",new Map),Kl(this,"loadListenerDisposers",new WeakMap),Kl(this,"iframeElementsById",new Map),Kl(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new jd(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var i=this.loadListenerDisposers.get(t);i||this.loadListenerDisposers.set(t,i=new Set),i.add(e);var r=this.mirror.getId(t);-1!==r&&this.iframeElementsById.set(r,t)}getIframeElementById(t){var e,i,r;return null!==(e=null!==(i=null==(r=this.attachedIframes.get(t))?void 0:r.element)&&void 0!==i?i:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>Kh(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Jh(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var i=this.mirror.getId(t);return this.attachedIframes.set(i,{element:t,content:e}),i}attachIframe(t,e){var i,r=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:r,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var a=this.handleMessage.bind(this);Kh((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}Kh((()=>{var e=t.contentWindow;if(e){var i=this.pageHideHandlers.get(t);if(i)for(var r of i)if(r.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}})),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var i=this.crossOriginIframeMap.get(t.source);if(i){var r=this.transformCrossOriginEvent(i,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var i;switch(e.type){case Yl.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:Yl.IncrementalSnapshot,data:{source:Xl.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Yl.Meta:case Yl.Load:case Yl.DomContentLoaded:return!1;case Yl.Plugin:return e;case Yl.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Yl.IncrementalSnapshot:switch(e.data.source){case Xl.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(e.node,i)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Xl.Drag:case Xl.TouchMove:case Xl.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Xl.ViewportResize:return!1;case Xl.MediaInteraction:case Xl.MouseInteraction:case Xl.Scroll:case Xl.CanvasMutation:case Xl.Input:return this.replaceIds(e.data,t,["id"]),e;case Xl.StyleSheetRule:case Xl.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Xl.Font:return e;case Xl.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Xl.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(i=e.data.styles)||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,i,r){for(var n of r)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(i,e[n]):t.getId(i,e[n]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===nu.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),i=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),i){var r=i.contentWindow,n=this.attachedWindows.get(i);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(Jh(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(Jh(r,"message",this.nestedIframeListeners.get(r)),this.nestedIframeListeners.delete(r)),r&&this.crossOriginIframeMap.delete(r),this.iframes.delete(i),this.disposeLoadListeners(i),this.removePageHideListener(i);var s=this.attachedDocuments.get(i);s&&(s.forEach((t=>{Kh((()=>this.mirror.removeNodeFromMap(t)))})),Kh((()=>Rd(i,s))),this.attachedDocuments.delete(i))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,i)=>{this.mirror.has(i)||t.push(i)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var i=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&Jh(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Jh(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class Hd{constructor(t){Kl(this,"shadowDoms",new WeakSet),Kl(this,"mutationCb"),Kl(this,"scrollCb"),Kl(this,"bypassOptions"),Kl(this,"mirror"),Kl(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var i,r;if(Zu(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null==(r=gu.host(t))?void 0:r.ownerDocument)&&void 0!==i?i:e,s=Ed(p({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=s.observer,o=s.buffer;this.restoreHandlers.push({doc:n,handler(){a.disconnect(),o.destroy(),o.releaseCanvasManager();var t=Td.indexOf(o);-1!==t&&Td.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:Id(p({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(gu.host(t))),this.restoreHandlers.push({doc:n,handler:Dd({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var i=this;this.restoreHandlers.push({doc:e,handler:pu(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=gu.shadowRoot(this);return s&&gd(this)&&i.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var i of this.restoreHandlers)if(i.doc===t)try{i.handler()}catch(t){}else e.push(i);this.restoreHandlers=e}}var Ud="skip-frame";function zd(t){if("object"!=typeof t||null===t)return!1;var e=t.y,i=t.width,r=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var Wd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Gd=0;64>Gd;Gd++)Vd[Wd.charCodeAt(Gd)]=Gd;var Zd=new Map,Qd=(t,e,i)=>{if(t&&(Yd(t,e)||"object"==typeof t)){var r=function(t,e){var i=Zd.get(t);return i||Zd.set(t,i=new Map),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function Jd(t,e,i,r){if(t instanceof Array)return t.map((t=>Jd(t,e,i,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=Wd[i[e]>>2],n+=Wd[(3&i[e])<<4|i[e+1]>>4],n+=Wd[(15&i[e+1])<<2|i[e+2]>>6],n+=Wd[63&i[e+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[Jd(t.buffer,e,i,r),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(r.type,r.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Jd(t.data,e,i,r),t.width,t.height]}:Yd(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Qd(t,e,i)}:t}var Kd=(t,e,i,r)=>t.map((t=>Jd(t,e,i,r))),Yd=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(i.find((i=>t instanceof e[i])))},Xd=["webgl","webgl2"];function tv(t){return"nodeType"in t}function ev(t,e,i,r){var n=[];try{if(r){var s=function(t,e,i){var r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return pu(r.prototype,"configure",(function(r){return function(n){var s=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!s||tv(s)&&od(s,e,i,!0))return r.call(this,n);tv(s)&&!("__context"in s)&&(s.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return r.call(this,null!==a&&n?p({},n,{usage:"number"==typeof n.usage?n.usage|a:a}):n)}}))}(t,e,i);s&&n.push(s)}var a=pu(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];if(!od(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&Xd.includes(s)))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...o])}}));n.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function iv(t,e,i,r,n,s,a){var o=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=pu(t,l,(function(t){return function(){for(var o=arguments.length,u=new Array(o),h=0;o>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(Qd(d,s,this),this.canvas&&"tagName"in this.canvas&&!od(this.canvas,r,n,!0)){var v=Kd(u,s,this,a);i(this.canvas,{type:e,property:l,args:v})}return d}}));o.push(u)}catch(s){var h=ed(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!od(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});o.push(h)}};for(var h of l)u(h);return o}var rv,nv,sv,av='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',ov="undefined"!=typeof self&&self.Blob&&new Blob([av],{type:"text/javascript;charset=utf-8"});function lv(t){var e;try{if(!(e=ov&&(self.URL||self.webkitURL).createObjectURL(ov)))throw"";var i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),i}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(av),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class uv{constructor(t){Kl(this,"pendingCanvasMutations",new Map),Kl(this,"rafStamps",{latestId:0,invokeId:null}),Kl(this,"mirror"),Kl(this,"mutationCb"),Kl(this,"resetObservers"),Kl(this,"frozen",!1),Kl(this,"locked",!1),Kl(this,"rafIdTimestamp",null),Kl(this,"rafIdFlush",null),Kl(this,"refCount",0),Kl(this,"torndown",!1),Kl(this,"resetFrameDedup",null),Kl(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var e=t.sampling,i=void 0===e?"all":e,r=t.win,n=t.blockClass,s=t.blockSelector,a=t.recordCanvas,o=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===i&&this.initCanvasMutationObserver(r,n,s,o),a&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:o,resolutionScale:l,canvasMasking:u})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,e,i,r,n){var s=this;if("OffscreenCanvas"in e){var a,o="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,l=ev(e,i,r,!0),u=new Map;try{a=new lv}catch(t){return}var h=!1;a.onerror=()=>{var t;h=!0,cancelAnimationFrame(d),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(u.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:iu["2D"],commands:[{property:"clearRect",args:[0,0,r,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i.base64}],type:i.type}]},0,0,r,n]}],displayWidth:r,displayHeight:n})}};var d,v=1e3/t,c=0,p=t=>{var l,g;h||(c&&v>t-c||(c=t,(l=[],g=t=>{try{t.querySelectorAll("canvas").forEach((t=>{od(t,i,r,!0)||l.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&g(t.shadowRoot)}))}catch(t){}},g(e.document),l).forEach(function(){var t=f((function*(t){var e,i,r=s.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){u.set(r,!0);try{if(["webgl","webgl2"].includes(t.__context)){var l=t.getContext(t.__context);if(null==(e=null==l?void 0:l.isContextLost)?void 0:e.call(l))return void u.set(r,!1);!1===(null==(i=null==l?void 0:l.getContextAttributes())?void 0:i.preserveDrawingBuffer)&&l.clear(l.COLOR_BUFFER_BIT)}var h=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(h*o)),c=Math.max(1,Math.round(d*o)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Ud}if(void 0!==a){if(!Array.isArray(a)||!a.every(zd))return Ud;var o=i/n,l=r/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*l)-i}}))}}}(n.canvasMasking,t,v,c,h,d);if(f===Ud)return void u.set(r,!1);var p=yield createImageBitmap(t,1>o?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});a.postMessage({id:r,bitmap:p,width:v,height:c,displayWidth:h,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){u.set(r,!1)}}}));return function(e){return t.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(d),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ev(t,e,i,!1),s=function(t,e,i,r,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=pu(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];return od(this.canvas,i,r,!0)||setTimeout((()=>{var i=Kd(l,e,this,n);t(this.canvas,{type:iu["2D"],property:a,args:i})}),0),s.apply(this,l)}}));s.push(o)}catch(n){var l=ed(e.CanvasRenderingContext2D.prototype,a,{set(e){od(this.canvas,i,r,!0)||t(this.canvas,{type:iu["2D"],property:a,args:[e],setter:!0})}});s.push(l)}};for(var l of a)o(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r),a=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...iv(e.WebGLRenderingContext.prototype,iu.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...iv(e.WebGL2RenderingContext.prototype,iu.WebGL2,t,i,r,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),a()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(t);if(i&&-1!==e){var r=i.map((t=>g(t,Ql)));this.mutationCb({id:e,type:i[0].type,commands:r}),this.pendingCanvasMutations.delete(t)}}}}class hv{constructor(t){var e;Kl(this,"trackedLinkElements",new WeakSet),Kl(this,"pendingDeferredSheets",new Set),Kl(this,"mutationCb"),Kl(this,"adoptedStyleSheetCb"),Kl(this,"maskAllElementAttributes"),Kl(this,"maskAttributeFn"),Kl(this,"styleMirror",new fd),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var i=null,r=null;try{(r=t.sheet)&&(i=sh(r))}catch(t){}if(!i||!r)return zu(),null;var n=i,s=!1,a={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(a);var o=!1;return{advance:i=>{if(o)return!0;var l,u,h=yu(),d=ku(),v=!0;try{if(s)return o=!0,zu(),!0;if(!n.advance(i))return v=!1,!1;o=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(zu(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(zu(),!0)}finally{v&&this.pendingDeferredSheets.delete(a),Su(l=yu()-h,null!=(u=d)?u:bu)||(Ou.totalMs+=l,l>Ou.slowestSliceMs&&(Ou.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var i;null==(i=this.beginDeferredLinkInlining(t,e))||i.advance(1/0)}emitCssTextMutation(t,e,i){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:hh({element:t,name:"_cssText",value:i,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;if(i.styleMirror.has(t))e=i.styleMirror.getId(t);else{var s=i.styleMirror.add(t);e=s;var a=yu();try{Bu((()=>{try{var e=t.rules||t.cssRules;e&&ju(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:Xu(e,t.href),index:i})))})}))}finally{Hu(yu()-a)}}r.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),jh.forEach((t=>t.abort())),jh.clear()}trackStylesheetInLinkElement(t){}}class dv{constructor(){Kl(this,"nodeMap",new WeakMap),Kl(this,"active",!1)}inOtherBuffer(t,e){var i=this.nodeMap.get(t);return i&&Array.from(i).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var vv=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var cv=document.createElement("iframe");document.body.appendChild(cv),Array.from=(null==(Zl=cv.contentWindow)?void 0:Zl.Array.from)||Array.from,document.body.removeChild(cv)}}catch(t){console.debug("Unable to override Array.from",t)}var fv=new ah,pv=new Set([Xl.Mutation,Xl.MediaInteraction,Xl.StyleSheetRule,Xl.CanvasMutation,Xl.Font,Xl.Log,Xl.StyleDeclaration,Xl.AdoptedStyleSheet]);function gv(t){var e=window;if("function"==typeof e.requestIdleCallback){var i=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null==(t=e.cancelIdleCallback)?void 0:t.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function mv(t){var e;void 0===t&&(t={});var i=t,r=i.emit,n=i.checkoutEveryNms,s=i.checkoutEveryNth,a=i.blockClass,o=void 0===a?"rr-block":a,l=i.blockSelector,u=void 0===l?null:l,h=i.ignoreClass,d=void 0===h?"rr-ignore":h,v=i.ignoreSelector,c=void 0===v?null:v,f=i.maskTextClass,g=void 0===f?"rr-mask":f,m=i.maskTextSelector,y=void 0===m?null:m,b=i.inlineStylesheet,_=void 0===b||b,w=i.inlineStylesheetBudgetRules,k=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,T=i.maskTextFn,M=i.maskAllElementAttributes,E=void 0!==M&&M,I=i.maskAttributeFn,R=i.hooks,P=i.packFn,A=i.sampling,F=void 0===A?{}:A,O=i.dataURLOptions,L=void 0===O?{}:O,D=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,j=i.recordDOM,B=void 0===j||j,H=i.recordCanvas,U=void 0!==H&&H,z=i.recordCrossOriginIframes,W=void 0!==z&&z,V=i.recordAfter,G=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,Z=i.userTriggeredOnInput,Q=void 0!==Z&&Z,J=i.collectFonts,K=void 0!==J&&J,Y=i.inlineImages,X=void 0!==Y&&Y,tt=i.plugins,et=i.keepIframeSrcFn,it=void 0===et?()=>!1:et,rt=i.ignoreCSSAttributes,nt=void 0===rt?new Set([]):rt,st=i.attributeFilter;bd=i.errorHandler;var at=p({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},L),ot=!W||window.parent===window,lt=!1;if(!ot)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(ot&&!r)throw new Error("emit function is required");if(!ot&&!lt)return()=>{};void 0!==q&&void 0===F.mousemove&&(F.mousemove=q),fv.reset();var ut,ht=!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==S?S:{password:!0},dt=Gh(void 0!==x&&x);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var vt,ct,ft=0,pt=new Map,gt=t=>{for(var e of tt||[])e.eventProcessor&&(t=e.eventProcessor(t));return P&&!lt&&(t=P(t)),t};rv=(t,e)=>{var i,a=t;if(a.timestamp=id(),!(null==(i=Td[0])?void 0:i.isFrozen())||a.type===Yl.FullSnapshot||a.type===Yl.IncrementalSnapshot&&pv.has(a.data.source)||Td.forEach((t=>t.unfreeze())),ot)null==r||r(gt(a),e);else if(lt){var o={type:"rrweb",event:gt(a),origin:window.location.origin,isCheckout:e};window.parent.postMessage(o,"*")}if(a.type===Yl.FullSnapshot)ut=a,ft=0;else if(a.type===Yl.IncrementalSnapshot){if(a.data.source===Xl.Mutation&&a.data.isAttachIframe)return;ft++,(s&&ft>=s||n&&a.timestamp-ut.timestamp>n)&&nv(!0)}};var mt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var r of t.adds){var n=fv.getNode(r.node.id);n&&"IFRAME"===n.nodeName&&i.add(n)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=wt.getIframeElementById(r);n&&i.has(n)?wt.forgetIframeId(r):(null==vt||vt(r),wt.removeIframeById(r))}})),null==ct||ct(),wt.cleanupDetachedIframes()}rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Mutation},t)})},yt=t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Scroll},t)}),bt=t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.CanvasMutation},t)}),_t=new hv({mutationCb:mt,adoptedStyleSheetCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.AdoptedStyleSheet},t)}),maskAllElementAttributes:E,maskAttributeFn:I}),wt=new Bd({mirror:fv,mutationCb:mt,stylesheetManager:_t,recordCrossOriginIframes:W,wrappedEmit:rv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:fv,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new dv,xt=null==N?void 0:N.configured;sv=new uv({recordCanvas:U,mutationCb:bt,win:window,blockClass:o,blockSelector:u,mirror:fv,sampling:F.canvas,dataURLOptions:at,resolutionScale:D,canvasMasking:N});var Ct=new Hd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskInputOptions:ht,dataURLOptions:at,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:E,maskAttributeFn:I,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:X,sampling:F,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:_t,canvasManager:sv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:fv});nv=function(t){if(void 0===t&&(t=!1),B){Du(w);try{rv({type:Yl.Meta,data:{href:window.location.href,width:sd(),height:nd()}},t),null==e||e.cancel(),e=void 0,_t.reset(),Ct.init(),Td.forEach((t=>t.lock()));var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new ah:r,s=i.blockClass,a=void 0===s?"rr-block":s,o=i.blockSelector,l=void 0===o?null:o,u=i.maskTextClass,h=void 0===u?"rr-mask":u,d=i.maskTextSelector,v=void 0===d?null:d,c=i.inlineStylesheet,f=void 0===c||c,p=i.inlineImages,g=void 0!==p&&p,m=i.recordCanvas,y=void 0!==m&&m,b=i.canvasMaskingConfigured,_=i.maskAllInputs,w=void 0!==_&&_,k=i.maskTextFn,S=i.maskInputFn,x=i.maskAllElementAttributes,C=void 0!==x&&x,T=i.maskAttributeFn,M=i.slimDOM,E=i.dataURLOptions,I=i.preserveWhiteSpace,R=i.onSerialize,P=i.onIframeLoad,A=i.iframeLoadTimeout,F=i.onIframeListenerRegistered,O=i.onStylesheetLoad,L=i.stylesheetLoadTimeout,D=i.keepIframeSrcFn,N=void 0===D?()=>!1:D,q=i.maxDepth,j=i.inlineStylesheetBudgetRules,B=!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===w?{password:!0}:w,H=Gh(void 0!==M&&M);Du(j);try{return Vh(t,{doc:t,mirror:n,blockClass:a,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:H,dataURLOptions:E,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:I,onSerialize:R,onIframeLoad:P,iframeLoadTimeout:A,onIframeListenerRegistered:F,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{$u()}}(document,{mirror:fv,blockClass:o,blockSelector:u,maskTextClass:g,maskTextSelector:y,inlineStylesheet:_,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:E,maskAttributeFn:I,slimDOM:dt,dataURLOptions:at,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){dd(t,fv)&&wt.addIframe(t),vd(t,fv)&&_t.trackLinkElement(t),cd(t)&&Ct.addShadowRoot(gu.shadowRoot(t),document)},onIframeLoad(t,e){wt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){wt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){_t.attachLinkElement(t,e)},keepIframeSrcFn:it})}finally{s=Ru,Ru=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(rv({type:Yl.FullSnapshot,data:{node:r,initialOffset:rd(window)}},t),Td.forEach((t=>t.unlock())),sv.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,a=null,o=()=>null!==a||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&Kh((()=>{a=e.beginDeferredLinkInlining(i,fv.getId(i))}))},u=()=>{if(a){var t=a,e=!0;Kh((()=>{e=t.advance(200)})),e&&(a=null)}},h=t=>{if(n=null,!r){var e=0;do{try{a||l(),u()}catch(t){null==a||a.discard(),a=null,Wu(1)}e+=1}while(!r&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(o()?n=gv(h):i())}};return n=gv(h),{cancel(){r=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;o()&&50>e;){a||l();var d=a;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),a=null,h+=1;else{try{u()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(o()||h>0){for(var v=h+(null!==a?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);Wu(v),null==a||a.discard(),a=null}i()}}}}(i,_t,(()=>{e===n&&(e=void 0)}));e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&_t.adoptStyleSheets(document.adoptedStyleSheets,fv.getId(document))}finally{$u()}var s}};try{var Tt=[];for(var Mt of(Tt.push(Qh("pagehide",(()=>{try{null==e||e.flush()}catch(t){}e=void 0}),window)),["visibilitychange","freeze","resume"]))Tt.push(Qh(Mt,wu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach((t=>{Kh(t);var e=Tt.indexOf(t);-1!==e&&Tt.splice(e,1)})),pt.delete(t))},ct=()=>{for(var t of pt){var e=t[0],i=fv.getNode(e);if(i)try{i.contentDocument&&i.contentDocument.defaultView||null==vt||vt(e)}catch(t){null==vt||vt(e)}else null==vt||vt(e)}};var Et=t=>{var e;return Cd($d)({mutationCb:mt,mousemoveCb:(t,e)=>rv({type:Yl.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.ViewportResize},t)}),inputCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Input},t)}),mediaInteractionCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.MediaInteraction},t)}),styleSheetRuleCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.StyleSheetRule},t)}),styleDeclarationCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Font},t)}),selectionCb(t){rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.Selection},t)})},customElementCb(t){rv({type:Yl.IncrementalSnapshot,data:p({source:Xl.CustomElement},t)})},blockClass:o,ignoreClass:d,ignoreSelector:c,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:_,sampling:F,recordDOM:B,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:E,maskAttributeFn:I,keepIframeSrcFn:it,blockSelector:u,slimDOMOptions:dt,dataURLOptions:at,mirror:fv,iframeManager:wt,stylesheetManager:_t,shadowDomManager:Ct,processedNodeManager:St,canvasManager:sv,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==(e=null==tt?void 0:tt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>rv({type:Yl.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},R)};wt.addLoadListener((t=>{try{var e=fv.getId(t),i=Et(t.contentDocument);if("function"==typeof i&&(Tt.push(i),-1!==e)){var r=pt.get(e);r||pt.set(e,r=new Set),r.add(i)}}catch(t){console.warn(t)}})),wt.addPageHideListener((t=>{var e=fv.getId(t);null==vt||vt(e),Rd(t)}));var It=-1,Rt=t=>rv({type:Yl.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Pt=()=>{var t,e,i,r,n=document,s=null!==(t=null!==(e=null!==(i=null!==(r=n.fullscreenElement)&&void 0!==r?r:n.webkitFullscreenElement)&&void 0!==i?i:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=s?fv.getId(s):-1;a!==It&&(-1!==It&&Rt({id:It,enter:!1}),It=a,-1!==a&&Rt({id:a,enter:!0}))},At=()=>{nv();var t=Et(document);"function"==typeof t&&Tt.push(t),Tt.push(Qh("fullscreenchange",Pt)),Tt.push(Qh("webkitfullscreenchange",Pt)),Tt.push(Qh("mozfullscreenchange",Pt)),Tt.push(Qh("MSFullscreenChange",Pt)),vv=!0};return["interactive","complete"].includes(document.readyState)?At():(Tt.push(Qh("DOMContentLoaded",(()=>{rv({type:Yl.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&At()}))),Tt.push(Qh("load",(()=>{rv({type:Yl.Load,data:{}}),"load"===G&&At()}),window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach((t=>Kh(t))),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),fv.reset(),vv=!1,bd=void 0}}catch(t){console.warn(t)}}mv.addCustomEvent=(t,e)=>{if(!vv)throw new Error("please add custom event after start recording");rv({type:Yl.Custom,data:{tag:t,payload:e}})},mv.freezePage=()=>{Td.forEach((t=>t.freeze()))},mv.takeFullSnapshot=t=>{if(!vv)throw new Error("please take full snapshot after start recording");nv(t)},mv.mirror=fv;var yv=Object.defineProperty,bv=(t,e,i)=>((t,e,i)=>e in t?yv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class _v{constructor(t){bv(this,"fileName"),bv(this,"functionName"),bv(this,"lineNumber"),bv(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var wv=/(^|@)\S+:\d+/,kv=/^\s*at .*(\S+:\d+|\(native\))/m,Sv=/^(eval@)?(\[native code])?$/,xv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(kv)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(kv)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),i=e.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(e=i?e.replace(i[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(i?i[1]:r.pop()),s=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new _v({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Sv)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new _v({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new _v({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),r=[],n=2,s=i.length;s>n;n+=2){var a=e.exec(i[n]);a&&r.push(new _v({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;s>n;n+=2){var a=e.exec(i[n]);a&&r.push(new _v({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(wv)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),i=this.extractLocation(e.pop()),r=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new _v({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function Cv(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var a=r.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===i&&n.push(a)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function Tv(t){return Array.isArray(t)}function Mv(t){return"object"==typeof t&&null!==t&&!Tv(t)}function Ev(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(Mv(t[r])&&Ev(t[r],e-1))return!0;return!1}function Iv(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,(function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(Mv(a=e)&&Object.keys(a).length>i.numOfKeysLimit||"function"==typeof a||Mv(a)&&Ev(a,i.depthOfLimit))return function(t){var e=t.toString();return i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"..."),e}(e);var a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var l in e){var u=e[l];o[l]=Tv(u)?Cv(u.length?u[0]:null):u}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Rv={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Pv(t,e,i){var r,n=i?Object.assign({},Rv,i):Rv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var a=0,o=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=xv.parse(e.error).map((t=>t.toString())),s=[Iv(i,n.stringifyOptions)];t({level:"error",trace:r,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var i,r;e.reason instanceof Error?r=[Iv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Iv("Uncaught (in promise)",n.stringifyOptions),Iv(e.reason,n.stringifyOptions)]);var s=xv.parse(i).map((t=>t.toString()));t({level:"error",trace:s,payload:r})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(v(r,d));return()=>{l.forEach((t=>t()))};function v(e,i){var r=this;return e[i]?function(e,s,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||o)){o=!0;try{var h=xv.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===i?l.slice(1):l).map((t=>Iv(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:i,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Iv("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{o=!1}}})((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=e[s],r=t(i);r;){if(r.next===d)return void(r.next=h.next);r=t(i=r.next)}else e[s]=h.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var Av=t=>({name:"rrweb/console@1",observer:Pv,options:t}),Fv=t=>"undefined"!=typeof Document&&t instanceof Document,Ov=()=>{},Lv=t=>{var e;if(Z(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Dv(t,e,i){try{if(!(e in t))return Ov;var r={next:t[e]},n=i((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return r.next.apply(this,e)}));return Z(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=n,()=>{if(t[e]!==n)for(var i=t[e],s=Lv(i);s;){if(s.next===n)return void(s.next=r.next);s=Lv(i=s.next)}else t[e]=r.next}}catch(t){return Ov}}function $v(t,e){var i,r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}var Nv=Hi("[Recorder]"),qv=t=>"navigation"===t.entryType,jv=t=>"resource"===t.entryType;function Bv(t,e){return!!e&&(nt(e)||e[t])}function Hv(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var Uv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function zv(t){var e=t.type,i=t.recordBody,r=t.headers;function n(t){var e=Object.keys(r).find((t=>"content-type"===t.toLowerCase())),i=e&&r[e];return t.some((t=>null==i?void 0:i.toLowerCase().includes(t)))}if(!i)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Hv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Uv))return!1;if(nt(i))return!0;if(G(i))return n(i);var s=i[e];return nt(s)?s:n(s)}function Wv(t,e,i,r,n,s){return Vv.apply(this,arguments)}function Vv(){return Vv=f((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return Nv.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var a=function(t,i){for(var s=t.length-1;s>=0;s-=1)if(jv(a=t[s])&&a.initiatorType===e&&(K(r)||a.startTime>=r)&&(K(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(i));return a||(yield new Promise((t=>setTimeout(t,50*s))),Wv(t,e,i,r,n,s+1))})),Vv.apply(this,arguments)}function Gv(t){var e=t.body,i=t.options,r=t.url;if(et(e))return null;var n=$v(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Y(e))return e;if(Fv(e))return e.textContent;if(st(e))return rr(e);if(Q(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Zv=t=>!tt(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Qv(t){var e=t.entry,i=t.method,r=t.status,n=t.networkRequest,s=t.isInitial,a=t.start,o=t.end,l=t.url,u=t.initiatorType;a=e?e.startTime:a,o=e?e.responseEnd:o;var h=Math.floor(Date.now()-performance.now()),d=Math.floor(h+(a||0)),v=[p({},e?e.toJSON():{name:l},{startTime:K(a)?void 0:Math.round(a),endTime:K(o)?void 0:Math.round(o),timeOrigin:h,timestamp:d,method:i,initiatorType:u||(e?e.initiatorType:void 0),status:r,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:s})];if(Zv(e))for(var c of e.serverTiming||[])v.push({timeOrigin:h,timestamp:d,startTime:Math.round(e.startTime),name:c.name,duration:c.duration,entryType:"serverTiming"});return v}var Jv=["video/","audio/"];function Kv(t){return Q(t)&&Z(t.getReader)&&Z(t.tee)}var Yv=500,Xv="[SessionReplay] Timeout while trying to read body",tc="[SessionReplay] Failed to read body";function ec(t){return tc+": "+t}function ic(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function rc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var i=setTimeout((()=>e(Xv)),Yv);try{t.clone().text().then((t=>e(t)),(t=>e(ec(t)))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e(tc)}}))}(t);var i=nn(e);return function(t,e){try{var i,r=null==(i=t.headers)||null==i.get?void 0:i.get("content-length");if(!r)return!1;var n=parseInt(r,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,i)?Promise.resolve(ic(i)):function(t,e){return new Promise((i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel()}catch(t){}}function a(t){n||(n=!0,clearTimeout(l),s(),i(t))}var o,l=setTimeout((()=>a(Xv)),Yv);try{o=t.clone()}catch(t){return void a(tc)}var u=o.body;if(Kv(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void a(tc)}var h=[],d=0;!function t(){r.read().then((i=>{var r=i.done,o=i.value;if(n)s();else if(r)a((new TextDecoder).decode(function(t,e){var i=new Uint8Array(e),r=0;for(var n of t)i.set(n,r),r+=n.byteLength;return i}(h,d)));else{if(o){if(d+o.byteLength>e)return void a(ic(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(ec(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(ec(t))))}catch(t){a(tc)}}))}(t,i)}function nc(){return nc=f((function*(t){var e=t.r,i=t.options,r=$v(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):rc(e,i)})),nc.apply(this,arguments)}function sc(){return sc=f((function*(t){var e=t.r,i=t.options,r=function(t){var e,i=t.r,r=t.options,n=t.url;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=Jv.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=$v(n,r);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return tt(r)?rc(e,i):Promise.resolve(r)})),sc.apply(this,arguments)}var ac=null;function oc(t,e,i){if(!("performance"in e))return()=>{};if(ac)return Nv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},sn,i):sn,n=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var s=r.maskRequestFn(t);e||(n=!s||(t=>!!t&&cn.has(t))(s)),s&&i.push(s)}})),i.length>0&&t(p({},e,{requests:i}))},s=function(t,e,i){if(i.recordInitialRequests){var r=e.performance.getEntries().filter((t=>qv(t)||jv(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>Qv({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var r=e.getEntries().filter((t=>qv(t)||jv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>Qv({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>i.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(n,e,r),a=()=>{},o=()=>{};return(r.recordHeaders||r.recordBody)&&(a=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=Bv("request",i.recordHeaders),n=Bv("response",i.recordHeaders),s=Dv(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(o),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),r&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(zv({type:"request",headers:g,url:o,recordBody:i.recordBody})&&(p.requestBody=Gv({body:t,options:i,url:o})),v=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),c=e.performance.now();var r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)})),n&&(p.responseHeaders=r),zv({type:"response",headers:r,url:o,recordBody:i.recordBody})&&(p.responseBody=Gv({body:d.response,options:i,url:o})),Wv(e,"xmlhttprequest",f.url,v,c).then((e=>{var i=Qv({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){Nv.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),l,u,h)}));return()=>{s()}}(n,e,r),o=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=Bv("request",i.recordHeaders),n=Bv("response",i.recordHeaders),s=Dv(e,"fetch",(s=>function(){var a=f((function*(a,o){var l,u;try{l=new Request(a,o)}catch(t){return Nv.error("Failed to instrument fetch for network capture",t),s(a,o)}var h,d,v={};try{try{var c={};l.headers.forEach(((t,e)=>{c[e]=t})),r&&(v.requestHeaders=c),!Kv(null==o?void 0:o.body)&&zv({type:"request",headers:c,url:a,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return nc.apply(this,arguments)}({r:l,options:i,url:a}))}catch(t){Nv.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=Hv(a)?yield s(l):yield s(a,o),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),n&&(v.responseHeaders=f),zv({type:"response",headers:f,url:a,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return sc.apply(this,arguments)}({r:u,options:i,url:a})),u}finally{Wv(e,"fetch",l.url,h,d).then((e=>{var i,r=Qv({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:r})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{s()}}(n,e,r)),ac=()=>{s(),a(),o(),ac=null}}var lc=t=>({name:"rrweb/network@1",observer:oc,options:t});v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Av,getRecordNetworkPlugin:lc},v.__PosthogExtensions__.rrweb={record:mv,version:"v2",wasMaxDepthReached:()=>Wh,resetMaxDepthState(){Wh=!1,zh=!1},getLastSnapshotCost:()=>Eu,getMutationCost:()=>p({},Fu),resetSnapshotCostState(){xu=0,Cu=0,Tu=0,bu=0,Mu=mu(),Eu=null,Iu=null,Ru=[],Pu=0,Au=0,Fu={slowestBatchMs:0},Ou={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},v.rrweb={record:mv,version:"v2"},v.rrwebConsoleRecord={getRecordConsolePlugin:Av},v.getRecordNetworkPlugin=lc,v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initSessionRecording=(t,e)=>new Gl(t,e);var uc,hc,dc,vc,cc,fc,pc,gc,mc,yc,bc,_c,wc,kc,Sc,xc={},Cc=[],Tc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Mc=Array.isArray;function Ec(t,e){for(var i in e)t[i]=e[i];return t}function Ic(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Rc(t,e,i){var r,n,s,a={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?uc.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return Pc(t,a,r,n,null)}function Pc(t,e,i,r,n){var s={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++dc:n,__i:-1,__u:0};return null==n&&null!=hc.vnode&&hc.vnode(s),s}function Ac(t){return t.children}function Fc(t,e){this.props=t,this.context=e}function Oc(t,e){if(null==e)return t.__?Oc(t.__,t.__i+1):null;for(var i;t.__k.length>e;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?Oc(t):null}function Lc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Ec({},e);s.__v=e.__v+1,hc.vnode&&hc.vnode(s),Wc(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?Oc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,Gc(r,s,n),e.__e=e.__=null,s.__e!=i&&Dc(s)}}function Dc(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some((function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e})),Dc(t)}function $c(t){(!t.__d&&(t.__d=!0)&&vc.push(t)&&!Nc.__r++||cc!=hc.debounceRendering)&&((cc=hc.debounceRendering)||fc)(Nc)}function Nc(){try{for(var t,e=1;vc.length;)vc.length>e&&vc.sort(pc),t=vc.shift(),e=vc.length,Lc(t)}finally{vc.length=Nc.__r=0}}function qc(t,e,i,r,n,s,a,o,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Cc,b=e.length;for(l=function(t,e,i,r,n){var s,a,o,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(a=e[s])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=t.__k[s]=Pc(null,a,null,null,null):Mc(a)?a=t.__k[s]=Pc(Ac,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=t.__k[s]=Pc(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[s]=a,l=s+v,a.__=t,a.__b=t.__b+1,o=null,-1!=(u=a.__i=Bc(a,i,l,d))&&(d--,(o=i[u])&&(o.__u|=2)),null==o||null==o.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,a.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(o=i[s])&&0==(2&o.__u)&&(o.__e==r&&(r=Oc(o)),Jc(o,o));return r}(i,e,y,l,b),d=0;b>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||xc,c.__i=d,g=Wc(t,c,v,n,s,a,o,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&Qc(v.ref,null,c),h.push(c.ref,c.__c||f,c)),null==p&&null!=f&&(p=f),(m=!!(4&c.__u))||v.__k===c.__k?(l=jc(c,l,t,m),m&&v.__e&&(v.__e=null)):"function"==typeof c.type&&void 0!==g?l=g:f&&(l=f.nextSibling),c.__u&=-7);return i.__e=p,l}function jc(t,e,i,r){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=jc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Oc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Bc(t,e,i,r){var n,s,a,o=t.key,l=t.type,u=e[i],h=null!=u&&0==(2&u.__u);if(null===u&&null==o||h&&o==u.key&&l==u.type)return i;if(r>(h?1:0))for(n=i-1,s=i+1;n>=0||e.length>s;)if(null!=(u=e[a=0>n?s++:n--])&&0==(2&u.__u)&&o==u.key&&l==u.type)return a;return-1}function Hc(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Tc.test(e)?i:i+"px"}function Uc(t,e,i,r,n){var s,a;t:if("style"==e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||Hc(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||Hc(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(bc,"$1")),a=e.toLowerCase(),e=a in t||"onFocusOut"==e||"onFocusIn"==e?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[yc]=r[yc]:(i[yc]=_c,t.addEventListener(e,s?kc:wc,s)):t.removeEventListener(e,s?kc:wc,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==i?"":i))}}function zc(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[mc])e[mc]=_c++;else if(i[yc]>e[mc])return;return i(hc.event?hc.event(e):e)}}}function Wc(t,e,i,r,n,s,a,o,l,u){var h,d,v,c,f,p,g,m,y,b,$,_,w,k,S,x,C=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[o=e.__e=i.__e]),(h=hc.__b)&&h(e);t:if("function"==typeof C){d=a.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],_=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(b?e.__c=v=new C(y,_):(e.__c=v=new Fc(y,_),v.constructor=C,v.render=Kc),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),b&&null==v.__s&&(v.__s=v.state),b&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=Ec({},v.__s)),Ec(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)b&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),b&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,_),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,_)){e.__v!=i.__v&&(v.props=y,v.state=v.__s,v.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some((function(t){t&&(t.__=e)})),Cc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&a.push(v);break t}null!=v.componentWillUpdate&&v.componentWillUpdate(y,v.__s,_),b&&null!=v.componentDidUpdate&&v.__h.push((function(){v.componentDidUpdate(f,p,g)}))}if(v.context=_,v.props=y,v.__P=t,v.__e=!1,w=hc.__r,k=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Cc.push.apply(v.__h,v._sb),v._sb=[];else do{v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),v.state=v.__s}while(v.__d&&25>++k);v.state=v.__s,null!=v.getChildContext&&(r=Ec(Ec({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Ac&&null==h.key?Zc(h.props.children):h,o=qc(t,Mc(S)?S:[S],e,i,r,n,s,a,o,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&a.push(v),m&&(v.__E=v.__=null)}catch(t){if(a.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;null!=s&&(s[s.indexOf(o)]=null),e.__e=o}else{if(null!=s)for(x=s.length;x--;)Ic(s[x]);Vc(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||Vc(e);hc.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):o=e.__e=function(t,e,i,r,n,s,a,o,l){var u,h,d,v,c,f,p,g=i.props||xc,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((c=s[u])&&"setAttribute"in c==!!y&&(y?c.localName==y:3==c.nodeType)){t=c,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),o&&(hc.__m&&hc.__m(e,s),o=!1),s=null}if(null==y)g===m||o&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&uc.call(t.childNodes),!o&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(c=t.attributes[u]).name]=c.value;for(u in g)c=g[u],"dangerouslySetInnerHTML"==u?d=c:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||Uc(t,u,null,c,n);for(u in m)c=m[u],"children"==u?v=c:"dangerouslySetInnerHTML"==u?h=c:"value"==u?f=c:"checked"==u?p=c:o&&"function"!=typeof c||g[u]===c||Uc(t,u,c,g[u],n);if(h)o||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),qc("template"==e.type?t.content:t,Mc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,a,s?s[0]:i.__k&&Oc(i,0),o,l),null!=s)for(u=s.length;u--;)Ic(s[u]);o&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&Uc(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&Uc(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,a,l,u);return(h=hc.diffed)&&h(e),128&e.__u?void 0:o}function Vc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Vc))}function Gc(t,e,i){for(var r=0;i.length>r;r++)Qc(i[r],i[++r],i[++r]);hc.__c&&hc.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){hc.__e(t,e.__v)}}))}function Zc(t){return"object"!=typeof t||null==t||t.__b>0?t:Mc(t)?t.map(Zc):void 0!==t.constructor?null:Ec({},t)}function Qc(t,e,i){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){hc.__e(t,i)}}function Jc(t,e,i){var r,n;if(hc.unmount&&hc.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Qc(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){hc.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&Jc(r[n],e,i||"function"!=typeof t.type);i||Ic(t.__e),t.__c=t.__=t.__e=void 0}function Kc(t,e,i){return this.constructor(t,i)}function Yc(t,e,i){var r,n,s;e==document&&(e=document.documentElement),hc.__&&hc.__(t,e),r=e.__k,n=[],s=[],Wc(e,t=e.__k=Rc(Ac,null,[t]),r||xc,xc,e.namespaceURI,r?null:e.firstChild?uc.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),Gc(n,t,s),t.props.children=null}uc=Cc.slice,hc={__e(t,e,i,r){for(var n,s,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),a=n.__d),a)return n.__E=n}catch(e){t=e}throw t}},dc=0,Fc.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Ec({},this.state),"function"==typeof t&&(t=t(Ec({},i),this.props)),t&&Ec(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),$c(this))},Fc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),$c(this))},Fc.prototype.render=Ac,vc=[],fc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pc=function(t,e){return t.__v.__b-e.__v.__b},Nc.__r=0,gc=Math.random().toString(8),mc="__d"+gc,yc="__a"+gc,bc=/(PointerCapture)$|Capture$/i,_c=0,wc=zc(!1),kc=zc(!0),Sc=0;var Xc,tf,ef,rf,nf=0,sf=[],af=hc,of=af.__b,lf=af.__r,uf=af.diffed,hf=af.__c,df=af.unmount,vf=af.__;function cf(t,e){af.__h&&af.__h(tf,t,nf||e),nf=0;var i=tf.__H||(tf.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function ff(t){return nf=1,function(t,e,i){var r=cf(Xc++,2);if(r.t=t,!r.__c&&(r.__=[Cf(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=tf,!tf.__f)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=!1,a=r.__c.props!==t;if(r.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),s){var o=s.call(this,t,e,i);return n?o||a:o}return!n||a};tf.__f=!0;var s=tf.shouldComponentUpdate,a=tf.componentWillUpdate;tf.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}a&&a.call(this,t,e,i)},tf.shouldComponentUpdate=n}return r.__N||r.__}(Cf,t)}function pf(t,e){var i=cf(Xc++,3);!af.__s&&xf(i.__H,e)&&(i.__=t,i.u=e,tf.__H.__h.push(i))}function gf(t){return nf=5,mf((function(){return{current:t}}),[])}function mf(t,e){var i=cf(Xc++,7);return xf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function yf(t){var e=tf.context[t.__c],i=cf(Xc++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(tf)),e.props.value):t.__}function bf(){for(var t;t=sf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(kf),e.__h.some(Sf),e.__h=[]}catch(i){e.__h=[],af.__e(i,t.__v)}}}af.__b=function(t){tf=null,of&&of(t)},af.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),vf&&vf(t,e)},af.__r=function(t){lf&&lf(t),Xc=0;var e=(tf=t.__c).__H;e&&(ef===tf?(e.__h=[],tf.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&bf(),Xc=0)),ef=tf},af.diffed=function(t){uf&&uf(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==sf.push(e)&&rf===af.requestAnimationFrame||((rf=af.requestAnimationFrame)||wf)(bf)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),ef=tf=null},af.__c=function(t,e){e.some((function(t){try{t.__h.some(kf),t.__h=t.__h.filter((function(t){return!t.__||Sf(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],af.__e(i,t.__v)}})),hf&&hf(t,e)},af.unmount=function(t){df&&df(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some((function(t){try{kf(t)}catch(t){e=t}})),i.__H=void 0,e&&af.__e(e,i.__v))};var _f="function"==typeof requestAnimationFrame;function wf(t){var e,i=function(){clearTimeout(r),_f&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);_f&&(e=requestAnimationFrame(i))}function kf(t){var e=tf,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),tf=e}function Sf(t){var e=tf;t.__c=t.__(),tf=e}function xf(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function Cf(t,e){return"function"==typeof e?e(t):e}function Tf(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Z(i.then)&&i.then(void 0,(()=>{}))}}}}var Mf="gzip-js",Ef="base64",If="events",Rf="cancelEvents",Pf={Tab:"tab",Selector:"selector"},Af={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Ff={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Of={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Lf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Df={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},$f="always",Nf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},qf={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},jf="popover",Bf=Hi("[Surveys]");function Hf(t){return!(!t.start_date||t.end_date)}function Uf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var zf="seenSurvey_",Wf="inProgressSurvey_",Vf=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),Gf=t=>Vf(zf,t),Zf=t=>{try{var e=Gf(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Bf.error("Failed to persist survey seen state",t)}},Qf=[Of.Popover,Of.Widget,Of.API],Jf={ignoreConditions:!1,ignoreDelay:!1,displayType:jf},Kf="featureFlags",Yf="logs";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return it(t)&&isFinite(t)&&Math.floor(t)===t});class Xf{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new Xf(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Xf(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}}class tp{generate(){var t=this.generateOrAbort();if(!K(t))return t;this.Fr=0;var e=this.generateOrAbort();if(K(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.Fr)this.Fr=t,this.Nr();else{if(this.Fr>=t+1e4)return;this.qr++,this.qr>4398046511103&&(this.Fr++,this.Nr())}return Xf.fromFieldsV7(this.Fr,Math.trunc(this.qr/Math.pow(2,30)),this.qr&Math.pow(2,30)-1,this.jr.nextUint32())}Nr(){this.qr=1024*this.jr.nextUint32()+(1023&this.jr.nextUint32())}constructor(){this.Fr=0,this.qr=0,this.jr=new rp}}var ep,ip=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!K(t.crypto)&&crypto.getRandomValues&&(ip=t=>crypto.getRandomValues(t));class rp{nextUint32(){return this.bt.length>this.Br||(ip(this.bt),this.Br=0),this.bt[this.Br++]}constructor(){this.bt=new Uint32Array(8),this.Br=1/0}}var np=()=>sp().toString(),sp=()=>(ep||(ep=new tp)).generate(),ap="",op=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var lp={Hr:()=>!!r,zr(t){Bi.error("cookieStore error: "+t)},$r:Oo,Vr(t){var e;try{e=JSON.parse(lp.$r(t))||{}}catch(t){}return e},Ur(t,e,i,n,s){if(!r)return!1;try{var a="",o="",l=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),ap)return ap;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),n=Math.min(i.length,8),s="dmn_chk_"+np();!ap&&n--;){var a=i.slice(n).join("."),o=s+"=1;domain=."+a+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(s)&&(e.cookie=o+";max-age=0",ap=a)}return ap}(t);if(!i){var n=(t=>{var e=t.match(op);return e?e[0]:""})(t);n!==i&&Bi.info("Warning: cookie subdomain discovery mismatch",n,i),i=n}return i?"; domain=."+i:""}return""}(r.location.hostname,n);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),a="; expires="+u.toUTCString()}s&&(o="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+a+"; SameSite=Lax; path=/"+l+o;return h.length>3686.4&&Bi.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},Wr(t,e){if(null!=r&&r.cookie)try{lp.Ur(t,"",-1,e)}catch(t){return}}},up=null,hp={Hr(){if(!tt(up))return up;var e=!0;if(K(t))e=!1;else try{var i="__mplssupport__";hp.Ur(i,"xyz"),'"xyz"'!==hp.$r(i)&&(e=!1),hp.Wr(i)}catch(t){e=!1}return e||Bi.error("localStorage unsupported; falling back to cookie store"),up=e,e},zr(t){Bi.error("localStorage error: "+t)},$r(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){hp.zr(t)}return null},Vr(t){try{return JSON.parse(hp.$r(t))||{}}catch(t){}return null},Ur(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){hp.zr(t)}return!1},Wr(e){try{null==t||t.localStorage.removeItem(e)}catch(t){hp.zr(t)}}},dp=[es,Gn,Vn,Qn,Jn,Kn,cs,vs,hs],vp=[gn,pn,Dn,$n,_s,bs,fs],cp=t=>t+"_cpm",fp=["__proto__","constructor","prototype"],pp=t=>{if(!Q(t))return{};var e={};return Object.keys(t).forEach((i=>{-1===fp.indexOf(i)&&(e[i]=t[i])})),e},gp=function(t,e){void 0===e&&(e=[]);var i={};return[...vp,...e].forEach((e=>{var r=t[e];K(r)||tt(r)||""===r||(i[e]=r)})),i},mp=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var n=t.charCodeAt(r);e=33*e^n,i=Math.imul(i^n,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},yp=(t,e)=>({p:e,f:mp(JSON.stringify(t))}),bp=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=lp.Vr(cp(t)),r=(null==i?void 0:i.f)===mp(e)&&G(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},_p=(t,e)=>e+"|"+(lp.$r(cp(t))||""),wp={},kp={Hr:()=>!0,zr(t){Bi.error("memoryStorage error: "+t)},$r:t=>wp[t]||null,Vr:t=>wp[t]||null,Ur:(t,e)=>(wp[t]=e,!0),Wr(t){delete wp[t]}},Sp=null,xp={Hr(){if(!tt(Sp))return Sp;if(Sp=!0,K(t))Sp=!1;else try{var e="__support__";xp.Ur(e,"xyz"),'"xyz"'!==xp.$r(e)&&(Sp=!1),xp.Wr(e)}catch(t){Sp=!1}return Sp},zr(t){Bi.error("sessionStorage error: ",t)},$r(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){xp.zr(t)}return null},Vr(t){try{return JSON.parse(xp.$r(t))||null}catch(t){}return null},Ur(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){xp.zr(t)}return!1},Wr(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){xp.zr(t)}}},Cp=Hi("[Stylesheet Loader]"),Tp=t,Mp=r,Ep="#020617",Ip={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Af.Right,widgetType:Pf.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:Ep,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Rp=[Af.Center,Af.Left,Af.Right];function Pp(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Ap(t){var e;void 0===t&&(t=Ip.backgroundColor),"#"===t[0]&&(e=Pp(t)),t.startsWith("rgb")&&(e=t);var i={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(i&&(e=Pp(i)),!e)return Ep;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),a=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+a*a*.114)>127.5?Ep:"white"}return Ep}var Fp=(t,e,i)=>{var r=Yp(t),n=Mp.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var s=Mp.createElement("div");((t,e,i)=>{var r=p({},Ip,i),n=t.style,s=!Rp.includes(r.position)||e===Of.Widget&&(null==i?void 0:i.widgetType)===Pf.Tab;n.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(r.fontFamily)),n.setProperty("--ph-survey-box-padding",r.boxPadding),n.setProperty("--ph-survey-max-width",r.maxWidth),n.setProperty("--ph-survey-z-index",r.zIndex),n.setProperty("--ph-survey-border-color",r.borderColor),s?(n.setProperty("--ph-survey-border-radius",r.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",r.backgroundColor),n.setProperty("--ph-survey-box-shadow",r.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Ap(r.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",Ap(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Ap(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",Ap(r.widgetColor)),n.setProperty("--ph-widget-z-index",r.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),o=a||r.inputBackground;a||"white"!==r.backgroundColor||(o="#f8f8f8"),n.setProperty("--ph-survey-input-background",o);var l=(null==i?void 0:i.inputTextColor)||Ap(o);n.setProperty("--ph-survey-input-text-color",l),n.setProperty("--ph-survey-rating-text-color",l),n.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",r.outlineColor)})(s,t.type,t.appearance),s.className=r;var a=s.attachShadow({mode:"open"}),o=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Z(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(Cp.error("prepare_external_dependency_stylesheet returned null"),null)})(Mp,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.intro-screen-header~.bottom-section,.thank-you-message-header~.bottom-section{padding-top:16px}.intro-screen,.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.intro-screen-body,.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.intro-screen,.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.intro-screen{animation:ph-survey-fade-in .3s ease-out forwards;text-align:center}.intro-screen-header{margin:10px 0 0}.intro-screen-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(o){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(o)}return Mp.body.appendChild(s),{shadow:a,isNewlyCreated:!0}},Op=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,n=t.posthog,s=t.isSurveyCompleted,a=t.properties,o=t.surveyLanguage;n?(Zf(i),n.capture(Nf.SENT,p({[qf.SURVEY_NAME]:i.name,[qf.SURVEY_ID]:i.id,[qf.SURVEY_ITERATION]:i.current_iteration,[qf.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[qf.SURVEY_SUBMISSION_ID]:r,[qf.SURVEY_COMPLETED]:s},o&&{[qf.SURVEY_LANGUAGE]:o},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},co(e,i),a,{$set:{[fo(i,"responded")]:!0}})),s&&(Tp.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Kp(i),n.reloadFeatureFlags())):Bf.error("[survey sent] event not captured, PostHog instance not found.")},Lp=(t,e,i)=>{return p({[qf.SURVEY_NAME]:t.name,[qf.SURVEY_ID]:t.id,[qf.SURVEY_ITERATION]:t.current_iteration,[qf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[qf.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some((t=>!et(t))))},(null==e?void 0:e.surveyLanguage)&&{[qf.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[qf.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},co(null==e?void 0:e.responses,t));var r},Dp=(t,e,i,r)=>{if(e){if(!i){var n=Qp(t);e.capture(Nf.DISMISSED,p({},Lp(t,n,e),r&&{[qf.SURVEY_LANGUAGE]:r},{$set:{[fo(t,"dismissed")]:!0}})),Kp(t),Zf(t),Tp.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Bf.error("[survey dismissed] event not captured, PostHog instance not found.")},$p=(t,e)=>{if(e){var i=(t=>Vf("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=Qp(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(Nf.ABANDONED,Lp(t,r,e),{transport:"sendBeacon"})}}else Bf.error("[survey abandoned] event not captured, PostHog instance not found.")},Np=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),qp=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,jp=t=>{var e=t.map((t=>t.id));return e.every((t=>!!t))?e:void 0},Bp=(t,e)=>{return(t=>t.questions.some((t=>{var e;return!(null==(e=t.branching)||!e.type)})))(t)?t.questions:e?null!==(i=((t,e)=>{if(!e||e.length!==t.questions.length)return null;var i=new Map(t.questions.map((t=>[t.id,t]))),r=[];for(var n of e){var s=i.get(n);if(!s)return null;r.push(s)}return r})(t,e.questionOrder))&&void 0!==i?i:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?qp(t.questions,Np(t.questions)):t.questions;var i},Hp=t=>wo(t)||Jp(t),Up=function(t){function e(t){var i,r;return this.getChildContext||(i=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&i.forEach((function(t){t.__e=!0,$c(t)}))},this.sub=function(t){i.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i&&i.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+Sc++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),zp=()=>yf(Up),Wp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,a,o=Ec({},t.props);for(s in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=void 0===e[s]&&null!=a?a[s]:e[s];return arguments.length>2&&(o.children=arguments.length>3?uc.call(arguments,2):i),Pc(t.type,o,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Vp(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n=hr(e);if(!n)return!1;var s=[t.conditions.url],a=function(t){return null!=t?t:"icontains"}(null==(r=t.conditions)?void 0:r.urlMatchType);return xo[a](s,[n])}var Gp=t=>Vf(Wf,t),Zp=(t,e)=>{try{localStorage.setItem(Gp(t),JSON.stringify(e))}catch(t){Bf.error("Error setting in-progress survey state in localStorage",t)}},Qp=t=>{try{var e=localStorage.getItem(Gp(t));if(e)return JSON.parse(e)}catch(t){Bf.error("Error getting in-progress survey state from localStorage",t)}return null},Jp=t=>{var e=Qp(t);return!et(null==e?void 0:e.surveySubmissionId)},Kp=t=>{try{localStorage.removeItem(Gp(t))}catch(t){Bf.error("Error clearing in-progress survey state from localStorage",t)}};function Yp(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Xp(t,e,i){if(void 0===e&&(e=Af.Right),t===Of.ExternalSurvey)return{};switch(e){case Af.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Af.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Af.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Af.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Af.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Af.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Af.Left:return{left:"30px"};case Af.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Of.Widget&&i===Pf.Tab?"60px":"30px"}}}var tg=0;function eg(t,e,i,r,n,s){e||(e={});var a,o,l=e;if("ref"in l)for(o in l={},e)"ref"==o?a=e[o]:l[o]=e[o];var u={type:t,props:l,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--tg,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(a=t.defaultProps))for(o in a)void 0===l[o]&&(l[o]=a[o]);return hc.vnode&&hc.vnode(u),u}var ig=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),rg=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),ng=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),sg=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),ag=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:eg("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),og=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:eg("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),lg=eg("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:eg("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),ug=function(t){var e=(void 0===t?{}:t).fill,i=void 0===e?"currentColor":e;return eg("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[eg("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),eg("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:i})]})},hg=eg("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[eg("g",{"clip-path":"url(#clip0_2415_6911)",children:[eg("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:eg("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),eg("g",{mask:"url(#mask0_2415_6911)",children:[eg("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),eg("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),eg("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),eg("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),eg("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),eg("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),eg("defs",{children:eg("clipPath",{id:"clip0_2415_6911",children:eg("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function dg(t){var e=t.urlParams,i=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return eg("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",hg]})}function vg(e){var i=e.text,r=e.submitDisabled,n=e.appearance,s=e.onSubmit,a=e.link,o=e.onPreviewSubmit,l=e.skipSubmitButton,u=e.canGoBack,h=e.onBack,d=yf(Up).isPreviewMode,v=!!u&&!!h,c=!l&&eg("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){a&&(null==t||t.open(a)),d?null==o||o():s()},children:i});return eg("div",{className:"bottom-section",children:[v?eg("div",{className:"form-buttons form-buttons-with-back",children:[eg("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),c]}):c,!n.whiteLabel&&eg(dg,{urlParams:{utm_source:"survey-footer"}})]})}function cg(t){var e=t.question,i=t.forceDisableHtml;return eg("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[eg(e.type===Lf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Wp({component:Rc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function fg(t){return eg("button",{className:"form-cancel",onClick:t.onClick,disabled:yf(Up).isPreviewMode,"aria-label":"Close survey",type:"button",children:ug({fill:"black"})})}eg("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:eg("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var pg=t;function gg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onClose,o=yf(Up).isPopup;return pf((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),a())};return Yi(pg,"keydown",t),()=>{pg.removeEventListener("keydown",t)}}),[a]),eg("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[o&&!0!==s.hideCancelButton&&eg(fg,{onClick:()=>a()}),eg("h3",{className:"thank-you-message-header",children:e}),i&&Wp({component:Rc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),o&&eg(vg,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})}function mg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onStart,o=yf(Up),l=o.onPreviewSubmit,u=o.onPopupSurveyDismissed;return eg("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[o.isPopup&&!0!==s.hideCancelButton&&eg(fg,{onClick:()=>u()}),e&&eg("h3",{className:"intro-screen-header",children:e}),i&&Wp({component:Rc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),eg(vg,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:a,onPreviewSubmit:()=>l(null)})]})}var yg=t=>G(t)&&t.every((t=>Y(t)));function bg(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,a=t.displayQuestionIndex,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=zp().isPreviewMode,d=gf(null),v=ff((()=>Y(o)?o:"")),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;pf((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+a,m=mf((()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var a of e)switch(a.type){case C:if(void 0!==a.value&&a.value>s.length)return null!==(r=a.errorMessage)&&void 0!==r?r:"Please enter at least "+a.value+" characters";break;case T:if(void 0!==a.value&&s.length>a.value)return null!==(n=a.errorMessage)&&void 0!==n?n:"Please enter no more than "+a.value+" characters"}return!1}(c,e.validation,e.optional)),[c,e.validation,e.optional]),y=ri(e.validation,C),b=ri(e.validation,T),_=mf((()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return eg(Ac,{children:[eg("div",{className:"question-container",children:[eg(cg,{question:e,forceDisableHtml:i,htmlFor:g}),eg("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?k():w())},value:c}),_&&eg("div",{className:"validation-hint",children:_})]}),eg(vg,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function _g(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,a=t.onBack;return eg(Ac,{children:[eg("div",{className:"question-container",children:eg(cg,{question:e,forceDisableHtml:t.forceDisableHtml})}),eg(vg,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:a})]})}function wg(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,a=t.onSubmit,o=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=ff((()=>it(l)?l:G(l)&&l.length>0&&it(parseInt(l[0]))?parseInt(l[0]):Y(l)&&it(parseInt(l))?parseInt(l):null)),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=zp().isPreviewMode,y=t=>m?o(t):a(t);return eg(Ac,{children:[eg("div",{className:"question-container",children:[eg(cg,{question:i,forceDisableHtml:r}),eg("div",{className:"rating-section",children:[eg("div",{className:"rating-options",children:["emoji"===i.display&&eg("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=Mg[i.scale])?void 0:e.map(((t,e)=>eg("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),i.skipSubmitButton&&y(t)},children:t},e)))}),"number"===i.display&&eg("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:Eg(i.scale).map(((t,e)=>eg(kg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e)))})]}),!g&&eg("div",{className:"rating-text",children:[eg("div",{children:i.lowerBoundLabel}),eg("div",{children:i.upperBoundLabel})]})]})]}),eg(vg,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:tt(f)&&!i.optional,appearance:s,onSubmit:()=>a(f),onPreviewSubmit:()=>o(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function kg(t){var e=t.num,i=t.setActiveNumber;return eg("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){i(e)},children:e})}function Sg(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,n=t.appearance,s=t.onSubmit,a=t.onPreviewSubmit,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=gf(null),d=mf((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=qp(e,Np(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),v=ff((()=>((t,e)=>Y(t)||yg(t)?t:e===Lf.SingleChoice?null:[])(o,e.type))),c=v[0],f=v[1],g=ff((()=>((t,e)=>{if(Y(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(yg(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(o,d))),m=g[0],y=g[1],b=zp().isPreviewMode,_=e.type===Lf.SingleChoice,w=e.type===Lf.MultipleChoice,k=e.skipSubmitButton&&_&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>p({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),_&&f(""),void(i&&setTimeout((()=>{var t;return null==(t=h.current)?void 0:t.focus()}),75))}if(_)return f(t),y((t=>p({},t,{isSelected:!1,inputValue:""}))),void(k&&(s(t),b&&a(t)));w&&G(c)&&(c.includes(t)?f(c.filter((e=>e!==t))):f([...c,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>p({},t,{inputValue:e}))),_&&f(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),M()),"Escape"===t.key&&(t.preventDefault(),y((t=>p({},t,{isSelected:!1,inputValue:""}))),_&&f(null))},T=()=>!(e.optional||!tt(c)&&(!G(c)||m.isSelected||0!==c.length)&&(!m.isSelected||""!==m.inputValue.trim())),M=()=>{m.isSelected&&w?G(c)&&(b?a([...c,m.inputValue]):s([...c,m.inputValue])):b?a(c):s(c)};return eg(Ac,{children:[eg("div",{className:"question-container",children:[eg(cg,{question:e,forceDisableHtml:i}),eg("fieldset",{className:"multiple-choice-options limit-height",children:[eg("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),d.map(((t,i)=>{var n=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+r+"Choice"+i,a=s+"Open",o=n?m.isSelected:_?c===t:G(c)&&c.includes(t);return eg("label",{className:n?"choice-option-open":"",children:[eg("div",{className:"response-choice",children:[eg("input",{type:_?"radio":"checkbox",name:s,checked:o,onChange:()=>S(t,n),id:s,"aria-controls":a}),eg("span",{children:n?t+":":t})]}),n&&eg("input",{type:"text",ref:h,id:a,name:"question"+r+"Open",value:m.inputValue,onKeyDown:C,onInput:x,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)}))]})]}),eg(vg,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:M,onPreviewSubmit:M,skipSubmitButton:k,canGoBack:l,onBack:u})]})}var xg=[1,2,3,4,5],Cg=[1,2,3,4,5,6,7],Tg=[0,1,2,3,4,5,6,7,8,9,10],Mg={2:[og,lg],3:[ng,rg,ig],5:[sg,ng,rg,ig,ag]};function Eg(t){switch(t){case 5:default:return xg;case 7:return Cg;case 10:return Tg}}var Ig=Hi("[Surveys]");function Rg(t,e,i){var r,n=t.questions[e],s=e+1;if(null==(r=n.branching)||!r.type)return e===t.questions.length-1?Df.End:s;if(n.branching.type===Df.End)return Df.End;if(n.branching.type===Df.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Df.ResponseBased){if(n.type===Lf.SingleChoice){var a,o=n.choices.indexOf(""+i);if(-1===o&&n.hasOpenChoice&&(o=n.choices.length-1),null!=(a=n.branching)&&null!=(a=a.responseValues)&&a.hasOwnProperty(o)){var l=n.branching.responseValues[o];return Number.isInteger(l)?l:l===Df.End?Df.End:s}}else if(n.type===Lf.Rating){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(i,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===Df.End?Df.End:s}}return s}return Ig.warn("Falling back to next question index due to unexpected branching type"),s}var Pg=Hi("[SurveyTranslations]");function Ag(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=po(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?po(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var a=po(r);return a?(null==e||e.info("Using detected locale: "+a),a):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Z(t.get_property)?t.get_property(es):void 0,locale:Uo()},Pg)}(e);if(!i)return Pg.info("No user language detected"),{survey:t,language:null};var r=bo(t,i,Pg);return{survey:r.survey,language:r.matchedKey}}var Fg=-1,Og=t,Lg=r,Dg="ph:show_survey_widget",$g="PHWidgetSurveyClickListener";function Ng(t,e){try{var i=t.getBoundingClientRect(),r=Og.innerHeight,n=Og.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var a=r-i.bottom,o=250>a&&i.top>a;return{position:"fixed",top:o?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:o?r-i.top+12+"px":"auto",zIndex:Ip.zIndex}}catch(t){return Bf.warn("Failed to calculate trigger position:",t),null}}class qg{constructor(t){var e=this;this.Zr=new Map,this.Gr=new Map,this.Qr=new Map,this.Jr=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(ns);if(t)for(var e of t)Jp(e)&&$p(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var n,s,a,o,l,u=(void 0===r?{}:r).resumeDelayFromActivation,h=void 0!==u&&u,d=e.Yr(t),v=d.survey,c=d.language,f=null!=i&&i.position||null!=i&&i.selector?p({},v,{appearance:p({},v.appearance,i.position&&{position:i.position},i.selector&&{widgetSelector:i.selector})}):v;e.Kr(f.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.Xr(f,y,m,c);if(!b||null!=(n=f.appearance)&&n.displayThankYouMessage){e.ei(f);var _={};if((null==(s=f.appearance)?void 0:s.position)===Af.NextToTrigger&&null!=(a=f.appearance)&&a.widgetSelector){var w,k=Lg.querySelector(f.appearance.widgetSelector);k&&(_=Ng(k,parseInt((null==(w=f.appearance)?void 0:w.maxWidth)||Ip.maxWidth))||{})}var S=(null==(o=f.appearance)?void 0:o.surveyPopupDelaySeconds)||0,x=Fp(f,e._posthog).shadow;e.Qr.set(x,x.host);var C={posthog:e._posthog,survey:f,removeSurveyFromFocus:e.ti,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:c};if(0>=S)return Yc(eg(zg,p({},C)),x);var T=()=>{if(!e.ri(f))return Bf.info("Survey "+f.id+" no longer eligible when its display delay elapsed; not displaying"),e.ti(f);Yc(eg(zg,p({},C,{survey:p({},f,{appearance:p({},f.appearance,{surveyPopupDelaySeconds:0})})})),x)},M=h?null==(l=e._posthog.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(f.id):void 0,E=it(M)?Math.max(0,Date.now()-M):0,I=Math.max(0,1e3*S-E);if(0>=I)return T();var R=Og.setTimeout((()=>{e.Zr.delete(f.id),T()}),I);e.Zr.set(f.id,R)}},this.ii=t=>{var e=this.Yr(t),i=e.survey,r=e.language,n=Fp(i,this._posthog),s=n.shadow,a=n.isNewlyCreated;this.Qr.set(s,s.host),a&&Yc(eg(Vg,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.ni=t=>{var e=this.Gr.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute($g),this.Gr.delete(t),Bf.info("Removed click listener for survey "+t))},this.ai=t=>{this.oi(t)||(this.si(t),this.ni(t.id))},this.oi=t=>{try{var e,i=Lg.querySelector(Yp(t,!0));return!(null==i||null==(e=i.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.ui=(t,e)=>{var i=Lg.querySelector(e),r=this.Gr.get(t.id);if(i){if(this.ii(t),r){if(i===r.element)return;Bf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.ni(t.id)}if(!i.hasAttribute($g)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Af.NextToTrigger?Ng(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||Ip.maxWidth)):{};Og.dispatchEvent(new CustomEvent(Dg,{detail:{surveyId:t.id,position:n}}))};Yi(i,"click",n),i.setAttribute($g,"true"),this.Gr.set(t.id,{element:i,listener:n,survey:t}),Bf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.ai(t)},this.renderPopover=t=>{var e=this.Yr(t),i=e.survey,r=e.language,n=Fp(i,this._posthog).shadow;this.Qr.set(n,n.host),Yc(eg(zg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.ti,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.Yr(t),s=n.survey,a=n.language,o=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(o=this.li(s,a,i)),Yc(eg(zg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.ti,isPopup:!1,properties:i,isSurveyCompleted:o,surveyLanguage:a}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys((i=>{var r=i.filter((t=>e.ri(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===Of.Popover||t.type===Of.Widget)),r=new Set(i.map((t=>t.id)));for(var n of Array.from(e.Zr.keys()))r.has(n)||e.cancelSurvey(n);var s=e.ci(i),a=new Set;s.forEach((t=>{if(t.type===Of.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===Pf.Tab)return void e.ii(t);(null==(r=t.appearance)?void 0:r.widgetType)===Pf.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),e.ui(t,null==(s=t.appearance)?void 0:s.widgetSelector))}tt(e.hi)&&t.type===Of.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.Gr.forEach((t=>{var i=t.survey;a.has(i.id)||e.ai(i)}))}),t)},this.ei=t=>{tt(this.hi)||Bf.error("Survey "+this.hi+" already in focus. Cannot add survey "+t.id+"."),this.hi=t.id},this.ti=t=>{this.hi!==t.id&&Bf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Kr(t.id),this.hi=null,this.si(t)},this._posthog=t,this.hi=null}get di(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,Kf))&&void 0!==t?t:this._posthog.featureFlags}Kr(t){var e=this.Zr.get(t);e&&(clearTimeout(e),this.Zr.delete(t))}cancelSurvey(t){this.Zr.has(t)&&(Bf.info("Cancelled pending survey "+t),this.Kr(t),this.hi===t&&(this.hi=null))}setAutomaticDisplayDispose(t){this.vi=t}dispose(){var t;null==(t=this.vi)||t.call(this),this.vi=void 0,this.Zr.forEach(((t,e)=>this.Kr(e))),this.Gr.forEach(((t,e)=>this.ni(e))),this.Qr.forEach(((t,e)=>{Yc(null,e),null==t||t.remove()})),this.Qr.clear(),this.hi=null}ci(t){return t.sort(((t,e)=>{var i,r,n=Jp(t),s=Jp(e);if(n&&!s)return-1;if(!n&&s)return 1;var a=t.schedule===$f,o=e.schedule===$f;return a&&!o?1:!a&&o?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}Yr(t){return Ag(t,this._posthog)}li(t,e,i){if(this.Jr.has(t.id))return!1;var r=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};var n=r.split("&");for(var s of n){var a=s.split("="),o=a[0],l=a[1];if(o&&!K(l)){var u=decodeURIComponent(o),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var v=parseInt(d[1],10);e[v]||(e[v]=[]),e[v].push(h)}}else i=!0}}return{params:e,autoSubmit:i}}(Og.location.search),n=r.params;if(0===Object.keys(n).length)return!1;Bf.info("[Survey Prefill] Detected URL prefill parameters");var s=this.fi(t,n,e);return!!s&&(this.pi(t,s,i,e),this.Jr.add(t.id),s.isSurveyCompleted)}pi(t,e,i,r){var n=e.responses,s=e.submissionId,a=e.isSurveyCompleted,o=e.skippedResponses;(Object.keys(o).length>0&&t.enable_partial_responses||a)&&Op({responses:a?n:o,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:a,properties:i,surveyLanguage:r})}Xr(t,e,i,r){var n={};for(var s of Object.entries(e)){var a=s[1];n[parseInt(s[0])]=G(a)?a.map(String):[String(a)]}Bf.info("[Survey] Processing initial responses");var o=this.fi(t,n,r);return!!o&&(this.pi(t,o,i,r),o.isSurveyCompleted)}fi(t,e,i){try{var r=function(t,e){var i={};return t.questions.forEach(((t,r)=>{if(e[r]&&t.id){var n=e[r],s=ho(t.id);try{switch(t.type){case Lf.SingleChoice:if(!t.choices||0===t.choices.length)return void Bi.warn("[Survey Prefill] Question "+r+" has no choices");var a=parseInt(n[0],10);if(isNaN(a)||0>a||a>=t.choices.length)return void Bi.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[a];break;case Lf.MultipleChoice:if(!t.choices||0===t.choices.length)return void Bi.warn("[Survey Prefill] Question "+r+" has no choices");var o=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===o.length)return void Bi.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(o.map((e=>t.choices[e])))];o.length>l.length&&Bi.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case Lf.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Bi.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:Bi.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Bi.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(r).length)return Bf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=np(),s=Object.keys(e).map((t=>parseInt(t,10))),a=function(t,e,i){for(var r=0,n={},s=[],a=t.questions.length+1,o=0;t.questions.length>r&&a>o&&(o++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=ho(l.id);K(i[u])||(n[u]=i[u])}s.push(r);var h=Rg(t,r,l.id?i[ho(l.id)]:null);if(h===Df.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,s,r),o=a.startQuestionIndex,l=a.skippedResponses,u=a.skippedIndices,h=o>=t.questions.length;return Zp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:jp(t.questions),visitedIndices:u,surveyLanguage:i}),Bf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:h,skippedResponses:l}}catch(t){return Bf.error("[Survey Prefill] Error handling prefill:",t),null}}gi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.di,r=!(null==i||!i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),n=!0;return e&&(n=(null==i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),r&&n}mi(e){return!e.conditions||Vp(e,this._posthog)&&function(e){var r,n;return function(e,r){var n,s,a;if(!e||0===e.length)return!0;if(!u)return!1;var o=ke(u,{userAgentDataPlatform:null==i||null==(n=i.userAgentData)?void 0:n.platform,maxTouchPoints:null==i?void 0:i.maxTouchPoints,screenWidth:null==t||null==(s=t.screen)?void 0:s.width,screenHeight:null==t||null==(a=t.screen)?void 0:a.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio});return xo[null!=r?r:"icontains"](e,[o])}(null==(r=e.conditions)?void 0:r.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}(e)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==Mp||!Mp.querySelector(t.conditions.selector))}(e)}yi(t){var e;return Hp(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this.di)&&e.hasLoadedFlags?{satisfied:this.gi(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,i,r={eligible:!0,reason:void 0};if(!Hf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Qf.includes(t.type))return r.eligible=!1,r.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",r;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.gi(t.linked_flag_key,n))return r.eligible=!1,r.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",r;if(!this.gi(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,a=this.yi(t);return a.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=new Date,n=Math.abs(r.getTime()-i.getTime());return Math.ceil(n/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,hp.$r("lastSeenSurveyDate"))?(t=>!!hp.$r(Gf(t))&&!Hp(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(s=a.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.bi(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}bi(t){var e;if(!_o(t)&&!Uf(t))return!0;var i=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==i||!i.includes(t.id))}wi(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.gi(e)}))}ri(t){return this.checkSurveyEligibility(t).eligible&&this.mi(t)&&this.bi(t)&&this.wi(t)}si(t){try{var e=Lg.querySelector(Yp(t,!0));null!=e&&e.shadowRoot&&(Yc(null,e.shadowRoot),this.Qr.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Bf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.ei,removeSurveyFromFocus:this.ti,surveyInFocus:this.hi,surveyTimeouts:this.Zr,handleWidget:this.ii,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.ui,sortSurveysByAppearanceDelay:this.ci,checkFlags:this.wi.bind(this),isSurveyFeatureFlagEnabled:this.gi.bind(this)}}}function jg(t,e){if(Lg&&Og){var i,r=new qg(t);if(t.config.disable_surveys_automatic_display)return Bf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Bf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{K(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))},s=()=>{K(i)||(clearInterval(i),i=void 0)};n();var a=()=>{Lg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return Yi(Lg,"visibilitychange",a),r.setAutomaticDisplayDispose((()=>{s(),Lg.removeEventListener("visibilitychange",a)})),r}}function Bg(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,a=void 0!==s&&s,o=t.posthog;pf((()=>{var t;if(!a&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===Of.Widget,s=Vp(e,o),a=(null==(t=e.appearance)?void 0:t.widgetType)===Pf.Tab&&i;if(!s)return Bf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);a&&(Bf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Yi(Og,"popstate",i),Yi(Og,"hashchange",i);var s=Og.history.pushState,l=Og.history.replaceState;return Og.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.apply(this,e),i()},Og.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];l.apply(this,e),i()},()=>{Og.removeEventListener("popstate",i),Og.removeEventListener("hashchange",i),Og.history.pushState=s,Og.history.replaceState=l}}}),[a,e,r,n,o])}var Hg=200;function Ug(t){switch(void 0===t&&(t=Ff.Right),t){case Ff.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Ff.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Ff.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function zg(t){var e,i,r,n,s,a,o,l,u,h,d,v,c=t.survey,f=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,b=t.previewPageIndex,_=t.removeSurveyFromFocus,w=void 0===_?()=>{}:_,k=t.isPopup,S=void 0===k||k,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,T=t.onPreviewBack,M=void 0===T?()=>{}:T,E=t.onPopupSurveyDismissed,I=void 0===E?()=>{}:E,R=t.onCloseConfirmationMessage,P=void 0===R?()=>{}:R,A=t.properties,F=t.isSurveyCompleted,O=t.skipShownEvent,L=t.surveyLanguage,D=gf(null),N=Number.isInteger(b),q=null!=(e=c.appearance)&&e.surveyPopupDelaySeconds?1e3*c.appearance.surveyPopupDelaySeconds:0,j=function(t,e,i,r,n,s,a,o,l){var u=ff(r||0===i||t.type===Of.ExternalSurvey),h=u[0],d=u[1],v=ff(!1),c=v[0],f=v[1],g=gf(!1),m=()=>{var e=()=>{s&&n(t),d(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+Hg+"ms ease-out",i.style.opacity="0",setTimeout((()=>{g.current=!1,e()}),Hg+50)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return pf((()=>{if(e){if(!r){var n,s=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return m();f(!0),null!=(r=t.appearance)&&r.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},a=()=>{if(Vp(t,e)){d(!0),Og.dispatchEvent(new Event("PHSurveyShown")),o||e.capture(Nf.SHOWN,p({[qf.SURVEY_NAME]:t.name,[qf.SURVEY_ID]:t.id,[qf.SURVEY_ITERATION]:t.current_iteration,[qf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[qf.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};Yi(Og,"PHSurveyClosed",y),Yi(Og,"PHSurveySent",s);var u=i>0?setTimeout(a,i):void 0;return K(u)&&a(),()=>{K(u)||clearTimeout(u),K(n)||clearTimeout(n),Og.removeEventListener("PHSurveyClosed",y),Og.removeEventListener("PHSurveySent",s)}}}else Bf.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Bg({survey:t,removeSurveyFromFocus:n,setSurveyVisible:d,isPreviewMode:r,posthog:e}),{isPopupVisible:h,isSurveySent:c,setIsPopupVisible:d,hidePopupWithAnimation:m}}(c,g,q,N,w,S,D,O,L),B=j.isPopupVisible,H=j.hidePopupWithAnimation,U=j.isSurveySent||b===c.questions.length||!0===F,z=ff(!1),W=z[0],V=z[1],G=mf((()=>!!Qp(c)),[c]),Z=!!(null!=(i=c.appearance)&&i.introScreenHeader||null!=(r=c.appearance)&&r.introScreenDescription),Q=N?b===Fg:!(null==(n=c.appearance)||!n.displayIntroScreen)&&Z&&!W&&!G,J=mf((()=>{var t=Qp(c),e=(null==t?void 0:t.surveySubmissionId)||np();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){L?Dp(c,g,N,L):Dp(c,g,N),I()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:M,posthog:g,properties:A,surveyLanguage:L}}),[N,b,S,g,c,I,C,M,A,L]);return B?eg(Up.Provider,{value:J,children:eg("div",{className:"ph-survey",style:p({},Xp(c.type,null==(s=c.appearance)?void 0:s.position,null==(a=c.appearance)?void 0:a.widgetType),y),ref:D,children:U?eg(gg,{header:(null==(o=c.appearance)?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null==(l=c.appearance)?void 0:l.thankYouMessageDescription)||"",forceDisableHtml:!!f,contentType:null==(u=c.appearance)?void 0:u.thankYouMessageDescriptionContentType,appearance:c.appearance||Ip,onClose(){H(),P()}}):Q?eg(mg,{header:(null==(h=c.appearance)?void 0:h.introScreenHeader)||"",description:(null==(d=c.appearance)?void 0:d.introScreenDescription)||"",forceDisableHtml:!!f,contentType:null==(v=c.appearance)?void 0:v.introScreenDescriptionContentType,appearance:c.appearance||Ip,onStart:()=>V(!0)}):eg(Wg,{survey:c,forceDisableHtml:!!f,posthog:g})})}):null}function Wg(t){var e,i,r=t.survey,n=t.forceDisableHtml,s=t.posthog,a=mf((()=>{var t=Qp(r);if(!t)return null;var e=it(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Kp(r),null)}),[r]),o=ff((()=>(null!=a&&a.responses&&Bf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{}))),l=o[0],u=o[1],h=yf(Up),d=h.previewPageIndex,v=h.onPopupSurveyDismissed,c=h.isPopup,f=h.onPreviewSubmit,g=h.onPreviewBack,m=h.surveySubmissionId,y=h.isPreviewMode,b=h.properties,_=h.surveyLanguage,w=ff((()=>{var t=null==a?void 0:a.lastQuestionIndex,e=it(t)&&t>=0&&r.questions.length>t?t:0;return it(d)&&d>=0?d:e})),k=w[0],S=w[1],x=ff((()=>{var t;return(null!==(t=null==a?void 0:a.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&r.questions.length>t))})),C=x[0],T=x[1],M=mf((()=>Bp(r,a)),[r,a]);pf((()=>{!y||K(d)||0>d||S(d)}),[d,y]);var E=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=d?d:0)>0:C.length>0),I=M.at(k);return I?eg("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&eg(fg,{onClick(){v()}}),eg("div",{className:"survey-box","data-question-index":k,children:Gg({question:I,forceDisableHtml:n,displayQuestionIndex:k,appearance:r.appearance||Ip,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,n=t.questionId;if(s)if(n){var a=ho(n),o=p({},l,{[a]:e});u(o);var h=Rg(r,i,e),d=h===Df.End,v=[...C,i];if(d||(T(v),S(h),Zp(r,{surveySubmissionId:m,responses:o,lastQuestionIndex:h,questionOrder:jp(M),visitedIndices:v,surveyLanguage:_})),r.enable_partial_responses||d){var c=new Set(v.map((t=>{var e;return null==(e=M[t])?void 0:e.id})).filter((t=>!!t)).map((t=>ho(t)))),f=Object.fromEntries(Object.entries(o).filter((t=>c.has(t[0]))));Op({responses:f,survey:r,surveySubmissionId:m,isSurveyCompleted:d,posthog:s,properties:b,surveyLanguage:_})}}else Bf.error("onNextButtonClick called without a questionId.");else Bf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:I.id}),onPreviewSubmit:f,initialValue:I.id?l[ho(I.id)]:void 0,canGoBack:E,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),Zp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:t,questionOrder:jp(M),visitedIndices:e,surveyLanguage:_})}}})})]}):null}function Vg(t){var e,i,r,n,s,a,o,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=ff(!0),f=c[0],p=c[1],g=ff(!1),m=g[0],y=g[1],b=ff({}),_=b[0],w=b[1],k=gf(void 0),S=()=>{y(!m)};if(pf((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(Bf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return Yi(Og,Dg,e),()=>{K(k.current)||(clearTimeout(k.current),k.current=void 0),Og.removeEventListener(Dg,e)}}}else Bf.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),Bg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==$f&&p(!1),K(k.current)||clearTimeout(k.current),k.current=setTimeout((()=>{k.current=void 0,y(!1)}),200)};return eg(Ac,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&eg("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Ff.Top?"widget-tab-top":""),onClick:S,disabled:d,style:Ug(null==(a=l.appearance)?void 0:a.tabPosition),children:(null==(o=l.appearance)?void 0:o.widgetLabel)||""}),m&&eg(zg,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var Gg=t=>{var e=t.question,i=t.onSubmit,r=t.onPreviewSubmit,n={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){r(t)},onSubmit(t){i(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case Lf.Open:return Rc(bg,p({},n,{question:e,key:e.id}));case Lf.Link:return Rc(_g,p({},n,{question:e,key:e.id}));case Lf.Rating:return Rc(wg,p({},n,{question:e,key:e.id}));case Lf.SingleChoice:case Lf.MultipleChoice:return Rc(Sg,p({},n,{question:e,key:e.id}));default:return Bf.error("Unsupported question type: "+e.type),null}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.generateSurveys=jg,v.extendPostHogWithSurveys=jg;var Zg=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},Qg=1e4,Jg=(t,e,i)=>i.remaining>0?e.length>i.remaining?(t.push(e.slice(0,i.remaining)),i.remaining=0,i.truncated=!0,!1):(t.push(e),i.remaining-=e.length,!0):(i.truncated=!0,!1),Kg=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return Jg(e,r,i);if(i.truncated=!0,2>i.remaining)return!1;for(var n=0,s=Math.min(t.length,i.remaining-2);s>n;){var a=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,a)).length>i.remaining?s=a-1:n=a}return Jg(e,JSON.stringify(t.slice(0,n)),i)},Yg=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Xg=(t,e,i)=>{if(!i.truncated){if(i.keysRemaining-=1,i.sizeRemaining-=String(e).length+t.length,0>=i.keysRemaining||0>=i.sizeRemaining)return i.truncated=!0,void(i.result.attributes_truncated=!0);i.result[t]=e}},tm=(t,e,i)=>{if(!i.truncated)if(Q(t)){if(i.seen.has(t))return void Xg(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(tm(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Xg(e,t,i)},em=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Yg(t))return!n||Jg(e,"null",i);if(tt(t)||(t=>{try{return it(t)||nt(t)}catch(t){return!1}})(t))return Jg(e,JSON.stringify(t),i);if("string"==typeof t)return Kg(t,e,i);if(!Q(t)&&!G(t))return Jg(e,JSON.stringify(t),i);if(r.has(t))return Kg("[Circular]",e,i);r.add(t);try{var a=t.toJSON;if(Z(a))return em(a.call(t),e,i,r,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return Kg(String(t.valueOf()),e,i);if("[object Number]"===o||"[object Boolean]"===o)return Jg(e,JSON.stringify(t.valueOf()),i)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return em(l,e,i,r,n,s)}if(G(t)){if(!Jg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Jg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!em(d,e,i,r,!0))return!1}return Jg(e,"]",i)}if(!Jg(e,"{",i))return!1;var v=!0;try{for(var c in t)if({}.hasOwnProperty.call(t,c)){if(0>=i.remaining)return i.truncated=!0,!1;var f=void 0;try{f=t[c]}catch(t){continue}if(s)try{tm(f,c,s)}catch(t){}if(Yg(f)){var p=(v?"":",")+JSON.stringify(c)+":";if(p.length>=i.remaining)return i.truncated=!0,!1;var g=e.length,m=i.remaining,y=i.truncated;if(!Jg(e,p,i))return!1;var b=e.length,_=em(f,e,i,r,!1),w=i.truncated;if(e.length!==b){if(v=!1,!_)return!1}else if(e.length=g,i.remaining=m,i.truncated=_?y:w,!_)return!1}}}catch(t){}return Jg(e,"}",i)},im=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Q(t[0])?{result:{},keysRemaining:50,sizeRemaining:Qg,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||Jg(i," ",r))&&em(t[s],i,r,new WeakSet,!1,0===s?n:void 0);s++);return{body:i.join("")+(r.truncated?"...":""),truncated:r.truncated,attributes:(null==n?void 0:n.result)||{}}},rm={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},nm=t=>"canCapture"in t,sm=t=>nm(t)?t.canCapture?t.getExtension(Yf):void 0:t.is_capturing()?t.logs:void 0;v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.logs={initializeLogs(t){var e=t,i=[],r={host:v.location.host},n=!1,s=function(t){var s=v.console[t];i.push(Dv(v.console,t,(i=>{var a=(i=>function(){for(var s=!1,a=arguments.length,o=new Array(a),l=0;a>l;l++)o[l]=arguments[l];try{var u=e;if(o.length>0&&!n&&u){var h=sm(u);if(h){n=!0,s=!0;var d=im(o,Qg),c=d.body,f=d.attributes,g=p({},r,d.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(nm(t))e.captureConsoleLog(i);else{var r=(t=>{var e=/^1\.(\d+)\.(\d+)$/.exec(t);if(e){var i=Number(e[1]),r=Number(e[2]);if(i>=392&&419>=i)return 410===i?r>4?r>10?void 0:"de":"le":418===i?r>3?r>10?r>14?r>17?void 0:"vi":"ci":"ui":"he":419===i?r>2?void 0:"vi":410>i?"le":"he"}})(t.version),n=r?e[r]:void 0;Z(n)&&n.call(e,i)}})(u,h,{level:rm[t],body:c,attributes:p({"log.source":"console."+t},g,f)})}}}catch(t){}finally{s&&(n=!1),i.apply(v.console,o)}})(i);return a.__rrweb_original__=Zg(s),a})))};for(var a of Object.keys(rm))s(a);return()=>{e=void 0,i.forEach((t=>t()))}},replayConsoleBuffer(t,e){var i=sm(t);if(i)for(var r of e)try{var n=im(r.args,Qg);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:rm[r.level],body:n.body,attributes:p({"log.source":"console."+r.level,host:v.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var am=Hi("[Error tracking]"),om=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],lm=["__firefox__","__gCrWeb"];function um(){return new li([new wi,new Pi,new Si,new ki,new Ii,new Ei,new Ci,new Ri],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];return function(e,r){void 0===r&&(r=0);for(var n=[],s=e.split("\n"),a=r;s.length>a;a++){var o=s[a];if(1024>=o.length){var l=bi.test(o)?o.replace(bi,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,t);if(h){n.push(h);break}}if(n.length>=_i)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,_i).map((t=>{return p({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||ui});var i}))}(n)}}("web:javascript",pi,yi))}var hm=Hi("[ExceptionAutocapture]"),dm=um(),vm=e=>{var i=t;i||hm.info("window not available, cannot wrap onerror");var r=i.onerror;return i.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var a=dm.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Y(e)&&Y(i)&&i.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:i,lineno:r,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}});return e(a),!!Z(r)&&null!==(t=r(...n))&&void 0!==t&&t},i.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=i.onerror)||delete t.__POSTHOG_INSTRUMENTED__,i.onerror=r}},cm=function(e,i){void 0===i&&(i=!1);var r=t;r||hm.info("window not available, cannot wrap onUnhandledRejection");var n=r.onunhandledrejection;return r.onunhandledrejection=function(t){var r,s=dm.buildFromUnknown(t,{mechanism:{handled:!1}});return e(s),Z(n)?null!==(r=n(t))&&void 0!==r&&r:i},r.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=r.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,r.onunhandledrejection=n}},fm={wrapOnError:vm,wrapUnhandledRejection:cm,wrapConsoleError(t){var e=console;e||hm.info("console not available, cannot wrap console.error");var i=e.error;return e.error=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var a=n.find((t=>t instanceof Error)),o=dm.buildFromUnknown(a||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(o),Z(i)&&i(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=i}}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.errorWrappingFunctions=fm,v.posthogErrorWrappingFunctions=fm;var pm=(t,e)=>{if(Z(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!tt(i)&&"object"==typeof i&&G(i.errors_to_ignore)?i.errors_to_ignore.reduce(((t,e)=>{try{t.push(new RegExp(e))}catch(t){hm.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t}),[]):[],n=e=>{try{null==t.capture||t.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){hm.error("Failed to capture exception for a legacy client",t)}};vm((t=>{r.some((e=>t.$exception_list.some((t=>e.test(t.value||"")))))||n(t)})),cm(n,!0)}};v.extendPostHogWithExceptionAutoCapture=pm,v.extendPostHogWithExceptionAutocapture=pm;var gm="X-POSTHOG-SESSION-ID",mm="X-POSTHOG-WINDOW-ID",ym="X-POSTHOG-DISTINCT-ID",bm=[gm,mm,ym],_m=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],wm=(t,e)=>({}.hasOwnProperty.call(t,e)),km=t=>"object"==typeof t&&!tt(t)||Z(t),Sm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),xm=e=>{try{var i;return Sm(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==t||null==(i=t.location)?void 0:i.href).toString()}catch(t){return}},Cm=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(G(t)&&!t.includes(s))return!1;var a=!1;if(i){var o=i.checkAndGetSessionAndWindowId(!0),l=o.windowId;n.set(gm,o.sessionId),n.set(mm,l),a=!0}var u=(t=>Z(t)?t():t)(e);return u&&u!==ws&&(n.set(ym,u),a=!0),a};v.__PosthogExtensions__=v.__PosthogExtensions__||{};var Tm={_patchFetch:(e,i,r)=>Dv(t,"fetch",(t=>function(n,s){var a=arguments.length>1?[n,s]:[n],o=a;try{var l=xm(n);if(l)if(Sm(n)){var u=new Request(n,s);Cm(e,i,r,u.url,u.headers),o=[u]}else{var h=new Headers(km(s)?s.headers:void 0);if(Cm(e,i,r,l,h)){var d=((t,e)=>{if(K(t)||tt(t))return{headers:e};if(km(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var r=Object.create(i);return Object.defineProperty(r,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),r}return new Proxy({headers:e},{get:(t,e)=>wm(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>wm(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),_m.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var r=Reflect.getOwnPropertyDescriptor(t,e);if(r)return r;if("string"==typeof e&&_m.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var n=Reflect.getOwnPropertyDescriptor(i,e);return n?p({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(s,h);d&&(o=[n,d])}}}catch(t){o=a}return t.apply(this,o)})),_patchXHR:(e,i,r)=>Dv(t.XMLHttpRequest.prototype,"open",(t=>function(n,s,a,o,l){void 0===a&&(a=!0);var u=this,h=new Headers,d=xm(s);d&&Cm(e,i,r,d,h);var v=t.call(u,n,s,a,o,l);return bm.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),v}))};v.__PosthogExtensions__.tracingHeadersPatchFns=Tm,v.postHogTracingHeadersPatchFns=Tm,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,i=Math.trunc(t)||0;return 0>i&&(i+=e),0>i||i>=e?void 0:this[i]},writable:!0,enumerable:!1,configurable:!0});let Mm=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var Em=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Im=t=>{if("loading"===document.readyState)return"loading";var e=Em();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Rm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Pm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[Rm(n),...Array.from(null!==(r=n.classList)&&void 0!==r?r:[]).sort()].join(".");if(e.length+s.length>99)return e||s;if(e=e?s+">"+e:s,n.id)break;t=n.parentNode}}catch(t){}return e},Am=new WeakMap;function Fm(t,e){var i=Am.get(e);return i||(i=new WeakMap,Am.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var Om=-1,Lm=()=>Om,Dm=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Om=e.timeStamp,t(e))}),!0)},$m=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},Nm=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},qm=()=>{var t,e;return null!==(t=null==(e=Em())?void 0:e.activationStart)&&void 0!==t?t:0},jm=-1,Bm=new Set,Hm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Um=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Bm)e();isFinite(jm)||(jm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Um,!0))}},zm=function(t){if(void 0===t&&(t=!1),t&&(jm=1/0),0>jm){var e,i=qm(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;jm=null!=r?r:Hm(),addEventListener("visibilitychange",Um,!0),addEventListener("prerenderingchange",Um,!0),Dm((()=>{setTimeout((()=>{jm=Hm()}))}))}return{get firstHiddenTime(){return jm},onHidden(t){Bm.add(t)}}},Wm=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=Em(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Lm()?o&&(document.prerendering||qm()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==o?void 0:o.name),navigationStartTime:a||0}},Vm=function(t,e,i){void 0===i&&(i={});try{var r=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(r.length>0){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{var i=t.getEntries();r.length>1&&i.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(i)}))}));for(var s of r)n.observe(p({type:s,buffered:!0},i));return n}}catch(t){}},Gm=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Zm=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Qm=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let Jm=class{constructor(){this.u=void 0}};var Km,Ym=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Xm=[1800,3e3],ty=function(t,e){void 0===e&&(e={});var i=Gm(e);Ym((()=>{var r,n=Fm(e,Jm),s=zm(),a=Wm("FCP"),o=Vm(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-qm(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=$m(t,a,Xm,e.reportAllChanges),Dm((i=>{a=Wm("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Lm()),r=$m(t,a,Xm,e.reportAllChanges),Nm((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Vm(["soft-navigation"],(i=>{i.forEach((i=>{n.u&&i.navigationId&&Zm(n.u,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=Wm("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=$m(t,a,Xm,e.reportAllChanges))(!0)}))}),e)}))},ey=[.1,.25],iy=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],ry=0,ny=1/0,sy=0,ay=t=>{for(var e of t)e.interactionId&&(ny=Math.min(ny,e.interactionId),sy=Math.max(sy,e.interactionId),ry=sy?(sy-ny)/7+1:0)},oy=()=>{var t;return Km?ry:null!==(t=performance.interactionCount)&&void 0!==t?t:0},ly=0;let uy=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){ly=oy(),this.h.length=0,this.v.clear()}T(t){var e=oy()-ly,i=Math.min(this.h.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.h[i]:{D:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.h.at(-1),r=this.v.get(t.interactionId);if(r||10>this.h.length||t.duration>i.D){var n;if(r?t.duration>r.D?(r.entries=[t],r.D=t.duration):t.duration===r.D&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.v.set((r={id:t.interactionId,entries:[t],D:t.duration}).id,r),this.h.push(r)),this.h.sort(((t,e)=>e.D-t.D)),this.h.length>10){var s=this.h.splice(10);for(var a of s)this.v.delete(a.id)}null==(n=this.m)||n.call(this,r)}}}};var hy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Qm(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},dy=[200,500];let vy=class{constructor(){this.p=void 0,this.u=void 0}l(t){var e;null==(e=this.p)||e.call(this,t)}};var cy=[2500,4e3],fy=-1,py=()=>fy,gy=t=>{addEventListener("pageshow",(e=>{e.persisted&&(fy=e.timeStamp,t(e))}),!0)},my=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},yy=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},by=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},_y=()=>{var t,e;return null!==(t=null==(e=by())?void 0:e.activationStart)&&void 0!==t?t:0},wy=-1,ky=new Set,Sy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,xy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of ky)e();isFinite(wy)||(wy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",xy,!0))}},Cy=function(t){if(void 0===t&&(t=!1),t&&(wy=1/0),0>wy){var e,i=_y(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;wy=null!=r?r:Sy(),addEventListener("visibilitychange",xy,!0),addEventListener("prerenderingchange",xy,!0),gy((()=>{setTimeout((()=>{wy=Sy()}))}))}return{get firstHiddenTime(){return wy},onHidden(t){ky.add(t)}}},Ty=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=by(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>py()?o&&(document.prerendering||_y()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==o?void 0:o.name),navigationStartTime:a||0}},My=new WeakMap;function Ey(t,e){var i=My.get(e);return i||(i=new WeakMap,My.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}let Iy=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}};var Ry=function(t,e,i){void 0===i&&(i={});try{var r=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(r.length>0){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{var i=t.getEntries();r.length>1&&i.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(i)}))}));for(var s of r)n.observe(p({type:s,buffered:!0},i));return n}}catch(t){}},Py=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Ay=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Fy=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let Oy=class{constructor(){this.l=void 0}};var Ly,Dy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},$y=[1800,3e3],Ny=function(t,e){void 0===e&&(e={});var i=Py(e);Dy((()=>{var r,n=Ey(e,Oy),s=Cy(),a=Ty("FCP"),o=Ry(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-_y(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=my(t,a,$y,e.reportAllChanges),gy((i=>{a=Ty("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,py()),r=my(t,a,$y,e.reportAllChanges),yy((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Ry(["soft-navigation"],(i=>{i.forEach((i=>{n.l&&i.navigationId&&Ay(n.l,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=Ty("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=my(t,a,$y,e.reportAllChanges))(!0)}))}),e)}))},qy=[.1,.25],jy=function(t,e){void 0===e&&(e={});var i=Cy();Ny(Fy((()=>{var r,n=Ty("CLS",0),s=Ey(e,Iy),a=(i,a,o,l,u)=>{n=Ty("CLS",0,i,a,o,l,u),s.i=0,r=my(t,n,qy,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{o(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.h(e):l(e);o()},h=["layout-shift"];Py(e)&&h.push("soft-navigation");var d=Ry(h,u);d&&(r=my(t,n,qy,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),gy((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,py()),yy(r)})),setTimeout(r))})))},By=0,Hy=1/0,Uy=0,zy=t=>{for(var e of t)e.interactionId&&(Hy=Math.min(Hy,e.interactionId),Uy=Math.max(Uy,e.interactionId),By=Uy?(Uy-Hy)/7+1:0)},Wy=()=>{var t;return Ly?By:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Vy=0;let Gy=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){Vy=Wy(),this.u.length=0,this.v.clear()}M(t){var e=Wy()-Vy,i=Math.min(this.u.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.u[i]:{_:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.u.at(-1),r=this.v.get(t.interactionId);if(r||10>this.u.length||t.duration>i._){var n;if(r?t.duration>r._?(r.entries=[t],r._=t.duration):t.duration===r._&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.v.set((r={id:t.interactionId,entries:[t],_:t.duration}).id,r),this.u.push(r)),this.u.sort(((t,e)=>e._-t._)),this.u.length>10){var s=this.u.splice(10);for(var a of s)this.v.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}};var Zy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Fy(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},Qy=[200,500],Jy=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Cy();Dy((()=>{var r;"interactionCount"in performance||Ly||(Ly=Ry(["event"],zy,{durationThreshold:0}));var n,s=Ty("INP"),a=Ey(e,Gy),o=(i,r,o,l,u)=>{a.T(),s=Ty("INP",-1,i,r,o,l,u),n=my(t,s,Qy,e.reportAllChanges)},l=()=>{var t=a.M(s.navigationType);t&&t._!==s.value&&(s.value=t._,s.entries=t.entries,n())},u=t=>{l(),n(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),Zy((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];Py(e)&&d.push("soft-navigation");var v=Ry(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=my(t,s,Qy,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),gy((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,py())})))}))}};let Ky=class{constructor(){this.m=void 0,this.l=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}};var Yy=[2500,4e3],Xy=function(t,e){void 0===e&&(e={});var i=!1,r=Py(e);Dy((()=>{var n,s=Cy(),a=Ty("LCP"),o=Ey(e,Ky),l=(r,o,l,u,h)=>{a=Ty("LCP",-1,r,o,l,u,h),n=my(t,a,Yy,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Cy(!0))},u=t=>{o.l&&t.navigationId&&Ay(o.l,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-_y(),0),o.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Ry(d,h);if(v){n=my(t,a,Yy,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;Zy((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});gy((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,py()),n=my(t,a,Yy,e.reportAllChanges),yy((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))},tb={onLCP(t,e){void 0===e&&(e={});var i=Fm(e=Object.assign({},e),vy),r=new WeakMap;Gm(e)&&(i.u=new Map),i.p=t=>{var i=t.element;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:Pm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=Gm(e);Ym((()=>{var n,s=zm(),a=Wm("LCP"),o=Fm(e,vy),l=(r,o,l,u,h)=>{a=Wm("LCP",-1,r,o,l,u,h),n=$m(t,a,cy,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=zm(!0))},u=t=>{o.u&&t.navigationId&&Zm(o.u,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-qm(),0),o.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Vm(d,h);if(v){n=$m(t,a,cy,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;hy((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});Dm((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Lm()),n=$m(t,a,cy,e.reportAllChanges),Nm((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var n,s,a,o,l,u,h=t.entries.at(-1),d=h.url&&performance.getEntriesByType("resource").find((t=>t.name===h.url));e.target=r.get(h),e.lcpEntry=h,h.url&&(e.url=h.url),d&&(e.lcpResourceEntry=d);var v=0,c=0;if("soft-navigation"!==t.navigationType?(v=null!==(n=null==(s=u=Em())?void 0:s.activationStart)&&void 0!==n?n:0,c=null!==(a=null==(o=u)?void 0:o.responseStart)&&void 0!==a?a:0):(v=t.navigationStartTime||0,u=null==(l=i.u)?void 0:l.get(t.navigationId)),u){var f=Math.max(0,c-v),g=Math.max(f,d?(d.requestStart||d.startTime)-v:0),m=Math.min(t.value,Math.max(g,d?d.responseEnd-v:0));e=p({},e,{timeToFirstByte:f,resourceLoadDelay:g-f,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:u})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var i=Fm(e=Object.assign({},e),Mm),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=iy(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:Pm(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=zm();ty(Qm((()=>{var r,n=Wm("CLS",0),s=Fm(e,Mm),a=(i,a,o,l,u)=>{n=Wm("CLS",0,i,a,o,l,u),s.o=0,r=$m(t,n,ey,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{o(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.l(e):l(e);o()},h=["layout-shift"];Gm(e)&&h.push("soft-navigation");var d=Vm(h,u);d&&(r=$m(t,n,ey,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Dm((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Lm()),Nm(r)})),setTimeout(r))})))}((e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(i=n.sources)&&i.length){var s=iy(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Im(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={});var i=Fm(e=Object.assign({},e),Jm);Gm(e)&&(i.u=new Map),ty((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Im(Lm())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=Em(),n=t.entries.at(-1);if(r){var s=Math.max(0,r.responseStart-(r.activationStart||0));e={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:Im(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var a,o=null==(a=i.u)?void 0:a.get(t.navigationId);o&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:o})}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=Fm(e=Object.assign({},e),uy),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(hy(h),l=!0)},h=()=>{var t=new Set(i.h.map((t=>a.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var o=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)o.add(v)}r=r.filter((t=>t.startTime>s||o.has(t))),l=!1};i.p=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var o=n.length-1;o>=0;o--){var l=n[o];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&a.set(t,i),u()},i.m=t=>{if(!o.get(t)){var i,r=null==(i=t.entries.find((t=>t.target)))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:Pm(r);o.set(t,s)}else{var a,l=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;l&&o.set(t,l)}}};var d=(t,e)=>{var i=[];for(var n of r)if(n.startTime+n.duration>=t){if(n.startTime>e)break;i.push(n)}return i};Vm(["long-animation-frame"],(t=>{r=r.concat(t),u()}),e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=zm();Ym((()=>{var r;"interactionCount"in performance||Km||(Km=Vm(["event"],ay,{durationThreshold:0}));var n,s=Wm("INP"),a=Fm(e,uy),o=(i,r,o,l,u)=>{a.M(),s=Wm("INP",-1,i,r,o,l,u),n=$m(t,s,dy,e.reportAllChanges)},l=()=>{var t=a.T(s.navigationType);t&&t.D!==s.value&&(s.value=t.D,s.entries=t.entries,n())},u=t=>{l(),n(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},h=function(t,e){void 0===e&&(e=!1),hy((()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):u(i);l(),e&&n(!0)}))},d=["event","first-input"];Gm(e)&&d.push("soft-navigation");var v=Vm(d,h,p({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=$m(t,s,dy,e.reportAllChanges),v&&(i.onHidden((()=>{h(v.takeRecords(),!0)})),Dm((()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,Lm())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Im(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=a.get(r),s=n.processingStart,l=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,l),h=n.entries.sort(((t,e)=>t.processingStart-e.processingStart)),v=d(r.startTime,u),c=i.v.get(r.interactionId),f={interactionTarget:o.get(c),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:l,processedEventEntries:h,longAnimationFrameEntries:v,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:l-u,loadState:Im(r.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var i=t.interactionTime,r=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&i&&r){var n,s,a=t.inputDelay,o=t.processingDuration,l=0,u=0,h=0,d=0;for(var v of t.longAnimationFrameEntries)for(var c of(u=u+v.startTime+v.duration-v.styleAndLayoutStart,v.scripts)){var f=c.startTime+c.duration;if(f>=i){var p=f-Math.max(i,c.startTime),g=c.duration?p/c.duration*c.forcedStyleAndLayoutDuration:0;l+=p-g,u+=g,p>d&&(s=i+a>c.startTime?"input-delay":i+a+o>c.startTime?"processing-duration":"presentation-delay",n=c,d=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=i+a+o&&(h=r-y),n&&s&&(t.longestScript={entry:n,subpart:s,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=h,t.totalUnattributedDuration=r-i-l-u-h}})(f),Object.assign(t,{attribution:f})})(e))}),e)},withoutAttribution:{onLCP:Xy,onCLS:jy,onFCP:Ny,onINP:Jy}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=tb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=tb,v.postHogWebVitalsCallbacks=tb;var eb={onLCP:Xy,onCLS:jy,onFCP:Ny,onINP:Jy};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=eb,v.__PosthogExtensions__.postHogWebVitalsCallbacks=eb,v.postHogWebVitalsCallbacks=eb,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>eb;let ib=class{constructor(){this.t=void 0,this.o=0,this.i=[]}u(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var rb=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},nb=t=>{if("loading"===document.readyState)return"loading";var e=rb();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},sb=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},ab=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r=t,n=r.id?"#"+r.id:[sb(r),...Array.from(r.classList).sort()].join(".");if(e.length+n.length>99)return e||n;if(e=e?n+">"+e:n,r.id)break;t=r.parentNode}}catch(t){}return e},ob=new WeakMap;function lb(t,e){var i=ob.get(e);return i||(i=new WeakMap,ob.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var ub,hb=-1,db=()=>hb,vb=t=>{addEventListener("pageshow",(e=>{e.persisted&&(hb=e.timeStamp,t(e))}),!0)},cb=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},fb=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},pb=()=>{var t,e;return null!==(t=null==(e=rb())?void 0:e.activationStart)&&void 0!==t?t:0},gb=function(t,e){void 0===e&&(e=-1);var i=rb(),r="navigate";return 0>db()?i&&(document.prerendering||pb()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},mb=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return r.observe(p({type:t,buffered:!0},i)),r}}catch(t){}},yb=t=>{var e=!1;return()=>{e||(t(),e=!0)}},bb=-1,_b=new Set,wb=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,kb=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of _b)e();isFinite(bb)||(bb="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",kb,!0))}},Sb=()=>{if(0>bb){var t,e=pb(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;bb=null!=i?i:wb(),addEventListener("visibilitychange",kb,!0),addEventListener("prerenderingchange",kb,!0),vb((()=>{setTimeout((()=>{bb=wb()}))}))}return{get firstHiddenTime(){return bb},onHidden(t){_b.add(t)}}},xb=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Cb=[1800,3e3],Tb=function(t,e){void 0===e&&(e={}),xb((()=>{var i,r=Sb(),n=gb("FCP"),s=mb("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-pb(),0),n.entries.push(e),i(!0)))}));s&&(i=cb(t,n,Cb,e.reportAllChanges),vb((r=>{n=gb("FCP"),i=cb(t,n,Cb,e.reportAllChanges),fb((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},Mb=[.1,.25],Eb=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],Ib=0,Rb=1/0,Pb=0,Ab=t=>{for(var e of t)e.interactionId&&(Rb=Math.min(Rb,e.interactionId),Pb=Math.max(Pb,e.interactionId),Ib=Pb?(Pb-Rb)/7+1:0)},Fb=()=>{var t;return ub?Ib:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Ob=0;let Lb=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){Ob=Fb(),this.l.length=0,this.h.clear()}M(){var t=Math.min(this.l.length-1,Math.floor((Fb()-Ob)/50));return this.l[t]}u(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.l.at(-1),r=this.h.get(t.interactionId);if(r||10>this.l.length||t.duration>i.T){var n;if(r?t.duration>r.T?(r.entries=[t],r.T=t.duration):t.duration===r.T&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.h.set((r={id:t.interactionId,entries:[t],T:t.duration}).id,r),this.l.push(r)),this.l.sort(((t,e)=>e.T-t.T)),this.l.length>10){var s=this.l.splice(10);for(var a of s)this.h.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}};var Db=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=yb(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},$b=[200,500];let Nb=class{constructor(){this.m=void 0}u(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],qb=-1,jb=t=>{addEventListener("pageshow",(e=>{e.persisted&&(qb=e.timeStamp,t(e))}),!0)},Bb=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,i),t(e))}},Hb=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Ub=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},zb=()=>{var t,e;return null!==(t=null==(e=Ub())?void 0:e.activationStart)&&void 0!==t?t:0},Wb=function(t,e){void 0===e&&(e=-1);var i=Ub(),r="navigate";return 0>qb?i&&(document.prerendering||zb()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Vb=new WeakMap;function Gb(t,e){var i=Vb.get(e);return i||(i=new WeakMap,Vb.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}class Zb{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var Qb,Jb=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return r.observe(p({type:t,buffered:!0},i)),r}}catch(t){}},Kb=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Yb=-1,Xb=new Set,t_=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,e_=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Xb)e();isFinite(Yb)||(Yb="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",e_,!0))}},i_=()=>{if(0>Yb){var t,e=zb(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Yb=null!=i?i:t_(),addEventListener("visibilitychange",e_,!0),addEventListener("prerenderingchange",e_,!0),jb((()=>{setTimeout((()=>{Yb=t_()}))}))}return{get firstHiddenTime(){return Yb},onHidden(t){Xb.add(t)}}},r_=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},n_=[1800,3e3],s_=function(t,e){void 0===e&&(e={}),r_((()=>{var i,r=i_(),n=Wb("FCP"),s=Jb("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-zb(),0),n.entries.push(e),i(!0)))}));s&&(i=Bb(t,n,n_,e.reportAllChanges),jb((r=>{n=Wb("FCP"),i=Bb(t,n,n_,e.reportAllChanges),Hb((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},a_=[.1,.25],o_=function(t,e){void 0===e&&(e={});var i=i_();s_(Kb((()=>{var r,n=Wb("CLS",0),s=Gb(e,Zb),a=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,r())},o=Jb("layout-shift",a);o&&(r=Bb(t,n,a_,e.reportAllChanges),i.onHidden((()=>{a(o.takeRecords()),r(!0)})),jb((()=>{s.i=0,n=Wb("CLS",0),r=Bb(t,n,a_,e.reportAllChanges),Hb(r)})),setTimeout(r))})))},l_=0,u_=1/0,h_=0,d_=t=>{for(var e of t)e.interactionId&&(u_=Math.min(u_,e.interactionId),h_=Math.max(h_,e.interactionId),l_=h_?(h_-u_)/7+1:0)},v_=()=>{var t;return Qb?l_:null!==(t=performance.interactionCount)&&void 0!==t?t:0},c_=0;class f_{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){c_=v_(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((v_()-c_)/50));return this.l[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.l.at(-1),r=this.u.get(t.interactionId);if(r||10>this.l.length||t.duration>i.L){var n;if(r?t.duration>r.L?(r.entries=[t],r.L=t.duration):t.duration===r.L&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.u.set((r={id:t.interactionId,entries:[t],L:t.duration}).id,r),this.l.push(r)),this.l.sort(((t,e)=>e.L-t.L)),this.l.length>10){var s=this.l.splice(10);for(var a of s)this.u.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}}var p_=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=Kb(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},g_=[200,500],m_=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=i_();r_((()=>{var r;"interactionCount"in performance||Qb||(Qb=Jb("event",d_,{durationThreshold:0}));var n,s=Wb("INP"),a=Gb(e,f_),o=t=>{p_((()=>{for(var e of t)a.h(e);var i=a.T();i&&i.L!==s.value&&(s.value=i.L,s.entries=i.entries,n())}))},l=Jb("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=Bb(t,s,g_,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{o(l.takeRecords()),n(!0)})),jb((()=>{a.v(),s=Wb("INP"),n=Bb(t,s,g_,e.reportAllChanges)})))}))}};class y_{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var b_=[2500,4e3],__=function(t,e){void 0===e&&(e={}),r_((()=>{var i,r=i_(),n=Wb("LCP"),s=Gb(e,y_),a=t=>{for(var a of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(a),r.firstHiddenTime>a.startTime&&(n.value=Math.max(a.startTime-zb(),0),n.entries=[a],i())},o=Jb("largest-contentful-paint",a);if(o){i=Bb(t,n,b_,e.reportAllChanges);var l=Kb((()=>{a(o.takeRecords()),o.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(p_(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});jb((r=>{n=Wb("LCP"),i=Bb(t,n,b_,e.reportAllChanges),Hb((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))},w_={onLCP(t,e){void 0===e&&(e={});var i=lb(e=Object.assign({},e),Nb),r=new WeakMap;i.m=t=>{var i=t.element;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:ab(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={}),xb((()=>{var i,r=Sb(),n=gb("LCP"),s=lb(e,Nb),a=t=>{for(var a of(e.reportAllChanges||(t=t.slice(-1)),t))s.u(a),r.firstHiddenTime>a.startTime&&(n.value=Math.max(a.startTime-pb(),0),n.entries=[a],i())},o=mb("largest-contentful-paint",a);if(o){i=cb(t,n,$,e.reportAllChanges);var l=yb((()=>{a(o.takeRecords()),o.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(Db(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});vb((r=>{n=gb("LCP"),i=cb(t,n,$,e.reportAllChanges),fb((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var i=t.entries.at(-1),n=i.url&&performance.getEntriesByType("resource").find((t=>t.name===i.url));e.target=r.get(i),e.lcpEntry=i,i.url&&(e.url=i.url),n&&(e.lcpResourceEntry=n);var s=rb();if(s){var a=s.activationStart||0,o=Math.max(0,s.responseStart-a),l=Math.max(o,n?(n.requestStart||n.startTime)-a:0),u=Math.min(t.value,Math.max(l,n?n.responseEnd-a:0));e=p({},e,{timeToFirstByte:o,resourceLoadDelay:l-o,resourceLoadDuration:u-l,elementRenderDelay:t.value-u,navigationEntry:s})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var i=lb(e=Object.assign({},e),ib),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Eb(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:ab(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=Sb();Tb(yb((()=>{var r,n=gb("CLS",0),s=lb(e,ib),a=t=>{for(var e of t)s.u(e);s.o>n.value&&(n.value=s.o,n.entries=s.i,r())},o=mb("layout-shift",a);o&&(r=cb(t,n,Mb,e.reportAllChanges),i.onHidden((()=>{a(o.takeRecords()),r(!0)})),vb((()=>{s.o=0,n=gb("CLS",0),r=cb(t,n,Mb,e.reportAllChanges),fb(r)})),setTimeout(r))})))}((e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(i=n.sources)&&i.length){var s=Eb(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:nb(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={}),Tb((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:nb(db())};if(t.entries.length){var i=rb(),r=t.entries.at(-1);if(i){var n=Math.max(0,i.responseStart-(i.activationStart||0));e={timeToFirstByte:n,firstByteToFCP:t.value-n,loadState:nb(t.entries[0].startTime),navigationEntry:i,fcpEntry:r}}}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=lb(e=Object.assign({},e),Lb),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(Db(h),l=!0)},h=()=>{var t=new Set(i.l.map((t=>a.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var o=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)o.add(v)}r=r.filter((t=>t.startTime>s||o.has(t))),l=!1};i.m=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var o=n.length-1;o>=0;o--){var l=n[o];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),!1!==e.includeProcessedEventEntries&&i.entries.push(t);break}}i||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:!1!==e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&a.set(t,i),u()},i.p=t=>{if(!o.get(t)){var i,r=null==(i=t.entries.find((t=>t.target)))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:ab(r);o.set(t,s)}else{var a,l=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;l&&o.set(t,l)}}};var d=(t,e)=>{var i=[];for(var n of r)if(n.startTime+n.duration>=t){if(n.startTime>e)break;i.push(n)}return i};mb("long-animation-frame",(t=>{r=r.concat(t),u()})),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Sb();xb((()=>{var r;"interactionCount"in performance||ub||(ub=mb("event",Ab,{durationThreshold:0}));var n,s=gb("INP"),a=lb(e,Lb),o=t=>{Db((()=>{for(var e of t)a.u(e);var i=a.M();i&&i.T!==s.value&&(s.value=i.T,s.entries=i.entries,n())}))},l=mb("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=cb(t,s,$b,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{o(l.takeRecords()),n(!0)})),vb((()=>{a.v(),s=gb("INP"),n=cb(t,s,$b,e.reportAllChanges)})))}))}}((e=>{t((t=>{var e=t.entries[0],r=a.get(e),n=e.processingStart,s=Math.max(e.startTime+e.duration,n),l=Math.min(r.processingEnd,s),u=r.entries.sort(((t,e)=>t.processingStart-e.processingStart)),h=d(e.startTime,l),v=i.h.get(e.interactionId),c={interactionTarget:o.get(v),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:s,processedEventEntries:u,longAnimationFrameEntries:h,inputDelay:n-e.startTime,processingDuration:l-n,presentationDelay:s-l,loadState:nb(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{if(null!=(e=t.longAnimationFrameEntries)&&e.length){var i,r,n=t.interactionTime,s=t.inputDelay,a=t.processingDuration,o=0,l=0,u=0,h=0;for(var d of t.longAnimationFrameEntries)for(var v of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var c=v.startTime+v.duration;if(c>=n){var f=c-Math.max(n,v.startTime),p=v.duration?f/v.duration*v.forcedStyleAndLayoutDuration:0;o+=f-p,l+=p,f>h&&(r=n+s>v.startTime?"input-delay":n+s+a>v.startTime?"processing-duration":"presentation-delay",i=v,h=f)}}var g=t.longAnimationFrameEntries.at(-1),m=g?g.startTime+g.duration:0;m>=n+s+a&&(u=t.nextPaintTime-m),i&&r&&(t.longestScript={entry:i,subpart:r,intersectingDuration:h}),t.totalScriptDuration=o,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=u,t.totalUnattributedDuration=t.nextPaintTime-n-o-l-u}})(c),Object.assign(t,{attribution:c})})(e))}),e)},withoutAttribution:{onLCP:__,onCLS:o_,onFCP:s_,onINP:m_}};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=w_,v.__PosthogExtensions__.postHogWebVitalsCallbacks=w_,v.postHogWebVitalsCallbacks=w_;var k_={onLCP:__,onCLS:o_,onFCP:s_,onINP:m_};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},v.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=k_,v.__PosthogExtensions__.postHogWebVitalsCallbacks=k_,v.postHogWebVitalsCallbacks=k_,v.__PosthogExtensions__.loadWebVitalsCallbacks=()=>k_;class S_{constructor(t){this.disabled=!1===t;var e=Q(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:i}];return!1}}var x_="$copy_autocapture",C_=Hi("[AutoCapture]");function T_(t,e){return e.length>t?e.slice(0,t)+"...":e}function M_(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!gr(e));return e}function E_(e,i){var r,n,s=i.e,a=i.maskAllElementAttributes,o=i.maskAllText,l=i.elementAttributeIgnoreList,u=i.elementsChainAsString,h=i.disableCaptureUrlHashes;if(!gr(e))return{props:{}};for(var d=[e],v=new Set([e]),c=e;c.parentNode&&!mr(c,"body")&&_r>d.length;)if(br(c.parentNode)){var f=c.parentNode.host;if(v.has(f))break;v.add(f),d.push(f),c=f}else{if(!gr(c.parentNode))break;if(v.has(c.parentNode))break;v.add(c.parentNode),d.push(c.parentNode),c=c.parentNode}var g,m,y=[],b={},_=!1,w=!1;if(zi(d,(t=>{var e=jr(t);if(mr(t,"a")){var i=t.getAttribute("href");_=!!(e&&i&&Qr(i))&&(h?Te(i):i)}j(Sr(t),"ph-no-capture")&&(w=!0),y.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),a={tag_name:s};Mr.indexOf(s)>-1&&!i&&(a.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?T_(1024,Jr(t)):T_(1024,Cr(t)));var o=Sr(t);o.length>0&&(a.classes=o.filter((function(t){return""!==t}))),zi(t.attributes,(function(i){var s;if((!Br(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Qr(i.value)&&(!Y(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=wr(o).join(" ")),a["attr__"+i.name]=T_(1024,"href"===i.name&&n?Te(o):o)}}));for(var l=1,u=1,h=t;h=M_(h);)l++,h.tagName===t.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(t,a,o,l,h));var r=function(t){if(!jr(t))return{};var e={};return zi(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var i=t.name.replace("data-ph-capture-attribute-",""),r=t.value;i&&r&&Qr(r)&&(e[i]=r)}})),e}(t);Wi(b,r)})),w)return{props:{},explicitNoCapture:w};if(o||(y[0].$el_text=mr(e,"a")||mr(e,"button")?Jr(e):Cr(e)),_){var k,S;y[0].attr__href=_;var x=null==(k=ir(_))?void 0:k.host,C=null==t||null==(S=t.location)?void 0:S.host;x&&C&&x!==C&&(g=_)}return{props:Wi({$event_type:s.type,$ce_version:1},u?{}:{$elements:y},{$elements_chain:(m=y,function(t){return t.map((t=>{var e,i,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var n of(t.attr_class.sort(),t.attr_class))r+="."+n.replace(/"/g,"");var s=p({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return Vi(s).sort(((t,e)=>t[0].localeCompare(e[0]))).forEach((t=>{var e=t[1];return a[Yr(t[0].toString())]=Yr(e.toString())})),(r+=":")+Vi(a).map((t=>t[0]+'="'+t[1]+'"')).join("")})).join(";")}(function(t){return t.map((t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:Xr(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Vi(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>r.attributes[t[0]]=t[1])),r}))}(m)))},null!=(r=y[0])&&r.$el_text?{$el_text:null==(n=y[0])?void 0:n.$el_text}:{},g&&"click"===s.type?{$external_click_url:g}:{},b)}}class I_{constructor(t){this.name="autocapture",this.ns=!1,this.ss=null,this.os=!1,this.ls=!1,this.zi={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.us=!1,this.hs=t,this.hs.refresh(this.zi),this.rageclicks=new S_(this.zi.rageclick),this.ds=null}setup(t){this.vs(),this.cs=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.us?e.dispose():(this.fs=e,this.startIfEnabled())}dispose(){var t;this.us||(this.us=!0,this.cs=void 0,null==(t=this.fs)||t.dispose(),this.fs=void 0,this.ps())}gs(){return this.hs.refresh(this.zi),this.zi}vs(){var t,e;return this.gs(),this.zi.url_allowlist=null==(t=this.zi.url_allowlist)?void 0:t.map((t=>new RegExp(t))),this.zi.url_ignorelist=null==(e=this.zi.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),this.zi}ys(){if(this.isBrowserSupported()){if(t&&r){var e=this.bs=e=>{e=e||(null==t?void 0:t.event);try{this._s(e)}catch(t){C_.error("Failed to capture event",t)}};if(Yi(r,"submit",e,{capture:!0}),Yi(r,"change",e,{capture:!0}),Yi(r,"click",e,{capture:!0}),this.gs().capture_copied_text){var i=this.ws=e=>{e=e||(null==t?void 0:t.event);try{this._s(e,x_)}catch(t){C_.error("Failed to capture clipboard event",t)}};Yi(r,"copy",i,{capture:!0}),Yi(r,"cut",i,{capture:!0}),Yi(r,"paste",i,{capture:!0})}}}else C_.info("Disabling Automatic Event Collection because this browser is not supported")}ps(){this.bs&&(null==r||r.removeEventListener("submit",this.bs,!0),null==r||r.removeEventListener("change",this.bs,!0),null==r||r.removeEventListener("click",this.bs,!0),this.bs=void 0),this.ws&&(null==r||r.removeEventListener("copy",this.ws,!0),null==r||r.removeEventListener("cut",this.ws,!0),null==r||r.removeEventListener("paste",this.ws,!0),this.ws=void 0),this.ns=!1}startIfEnabled(){!this.us&&this.cs&&this.isEnabled&&!this.ns&&(this.ys(),this.ns=!0)}onRemoteConfig(t){if(!this.us)if(this.os=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.ls=e.elementsChainAsString);var i,r=e.autocapture_opt_out;nt(r)&&(null==(i=this.cs)||i.kv.set(_n,r),this.ss=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.ds=t}getElementSelectors(t){var e,i=[];return null==(e=this.ds)||e.forEach((e=>{var n=null==r?void 0:r.querySelectorAll(e);null==n||n.forEach((r=>{t===r&&i.push(e)}))})),i}get isEnabled(){var t,e;if(this.us)return!1;var i=null==(t=this.cs)?void 0:t.kv.get(_n),r=this.ss,n=this.gs(),s=n.remoteRequestsDisabled&&!this.os;if(tt(r)&&!nt(i)&&!s)return!1;var a=null!==(e=this.ss)&&void 0!==e?e:!!i;return!!n.enabled&&!a}_s(e,i){if(void 0===i&&(i="$autocapture"),this.isEnabled){var r=Tr(e);yr(r)&&(r=r.parentNode||null);var n,s=this.vs();"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&s.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&$r(r,s.rageclick)&&this._s(e,"$rageclick");var a=i===x_,o=a?p({},s,{dom_event_allowlist:void 0}):s;if(r&&function(e,i,r,n,s,a){var o;if(!t||Nr(e))return!1;if(null!=r&&r.url_allowlist&&!kr(r.url_allowlist,a))return!1;if(null!=r&&r.url_ignorelist&&kr(r.url_ignorelist,a))return!1;if(null!=r&&r.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>i.type===t)))return!1}var u=qr(e,n),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(K(i))return!0;var r,n=function(t){if(i.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(d,r))return!1;if(!Er(d,null==r?void 0:r.css_selector_allowlist))return!1;if(Er(d,null!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:Rr))return!1;try{var v=t.getComputedStyle(e);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===i.type)return!0}catch(t){}var c=e.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(s||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(i.type)>=0;default:return h?(s||["click"]).indexOf(i.type)>=0:(s||["click"]).indexOf(i.type)>=0&&(Mr.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,o,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var l,u=E_(r,{e:e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.ls,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),h=u.props;if(u.explicitNoCapture)return!1;var d=this.getElementSelectors(r);if(d&&d.length>0&&(h.$element_selectors=d),i===x_){var v=e.type||"clipboard";if("paste"!==v){var c,f,g=null==t||null==(c=t.getSelection())?void 0:c.toString(),m=xr(g);if(!m)return!1;h.$selected_content=m,h.$clipboard_text_length=null!==(f=null==g?void 0:g.length)&&void 0!==f?f:0}h.$copy_type=v}return null==(l=this.cs)||l.capture(i,h).catch((t=>C_.error("Failed to capture event",t))),!0}}}isBrowserSupported(){return Z(null==r?void 0:r.querySelectorAll)}}var R_={};function P_(e,i){var r=R_[e];if(r)return r;var n=i[e];if((t=>Z(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==t||!t.Zone))return R_[e]=n.bind(i);var s=i.document;if(s&&Z(s.createElement)){var a,o=!1;try{(a=s.createElement("iframe")).hidden=!0,s.head.appendChild(a);var l,u,h=a.contentWindow;h&&h[e]&&(n=h[e],"MutationObserver"===e&&function(t){return j(t,"AppleWebKit")&&!j(t,"Chrome")}(null!==(l=null==(u=i.navigator)?void 0:u.userAgent)&&void 0!==l?l:"")&&(a.classList.add("rr-block","ph-no-capture"),o=!0))}catch(t){Bi.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}finally{var d;!o&&null!=(d=a)&&d.parentNode&&a.parentNode.removeChild(a)}}return n&&Z(n)?R_[e]=n.bind(i):n}function A_(t,e){var i=Tr(t);return i?p({node:i,originalEvent:t,timestamp:Date.now()},e):null}function F_(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function O_(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var L_="canvas,video,audio,embed,object",D_=1e3;function $_(t,e){return it(t)&&t>=e}function N_(t){return t>=0&&D_>t?t:void 0}function q_(t,e){return e?N_(t-e):void 0}class j_{xi(t){var e,i,r,n,s,a,o,l,u=this.Ci((null==t?void 0:t.__onCapture)||this.Mi.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(a=null==t?void 0:t.capture_dead_swipes)&&void 0!==a?a:u.capture_dead_swipes,swipe_threshold_px:null!==(o=null==t?void 0:t.swipe_threshold_px)&&void 0!==o?o:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.Ti=[],this.Ii=0,this.Ci=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.Ei=t=>{var e=A_(t,{type:"click"});tt(e)||this.Ai(e)||this.Ri(e),this.Li()},this.Oi=()=>{var t=Date.now();this.Pi=t,t%50==0&&this.Ti.forEach((e=>{K(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Di=()=>{this.Fi=Date.now()},this.At=()=>{var t=Date.now();this.Ni=t,this.qi("visibilityChangedDelayMs",t)},this.ji=()=>{var t=Date.now();this.Bi=t,this.qi("focusChangedDelayMs",t)},this.Hi=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.Ui=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.$i=()=>{this.Ui=void 0},this.Wi=t=>{var e,i=this.Ui;if(this.Ui=void 0,!K(i)&&this.zi.max_dead_swipes_per_page_load>this.Ii){var n=t,s=null==(e=n.changedTouches)?void 0:e[0];if(s){var a=s.clientX-i.x,o=s.clientY-i.y,l=a*a+o*o,u=this.zi.swipe_threshold_px;if(l>=u*u&&![this.Pi,this.Vi,this.Fi].some((t=>it(t)&&t>=i.timestamp))){var h;if(this.Zi()&&(null!==(h=null==r||null==r.elementsFromPoint?void 0:r.elementsFromPoint(i.x,i.y))&&void 0!==h?h:[]).some((t=>null==t.matches?void 0:t.matches(L_))))return;var d=A_(n,{type:"swipe",swipeDirection:F_(a,o),swipeDistancePx:Math.round(Math.sqrt(l))});tt(d)||this.Ai(d)||this.Ri(d),this.Li()}}}},this.instance=t,this.zi=this.xi(e),this._onCapture=this.zi.__onCapture}start(t){this.Gi(),this.Qi(),this.Ji(),this.Yi(),this.Ki(),this.Xi(t),this.zi.capture_dead_swipes&&this.en()}Xi(t){if(!this.tn){var e=function(t){return P_("MutationObserver",t)}(v);this.tn=new e((t=>{this.rn(t)})),this.tn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.tn)||t.disconnect(),this.tn=void 0,v.removeEventListener("click",this.Ei),v.removeEventListener("scroll",this.Oi,{capture:!0}),v.removeEventListener("selectionchange",this.Di),v.removeEventListener("touchstart",this.Hi,{capture:!0}),v.removeEventListener("touchend",this.Wi,{capture:!0}),v.removeEventListener("touchcancel",this.$i,{capture:!0}),null==r||r.removeEventListener("visibilitychange",this.At),v.removeEventListener("blur",this.ji),v.removeEventListener("focus",this.ji),this.Ui=void 0}rn(t){this.Vi=Date.now()}Gi(){Yi(v,"click",this.Ei)}Ri(t){t.visibilityChangedDelayMs=q_(t.timestamp,this.Ni),t.focusChangedDelayMs=q_(t.timestamp,this.Bi),this.Ti.push(t)}Li(){this.Ti.length&&K(this.nn)&&(this.nn=v.setTimeout((()=>{this.an()}),1e3))}Qi(){Yi(v,"scroll",this.Oi,{capture:!0})}Ji(){Yi(v,"selectionchange",this.Di)}Yi(){Yi(r,"visibilitychange",this.At)}Ki(){Yi(v,"blur",this.ji),Yi(v,"focus",this.ji)}qi(t,e){this.Ti.forEach((i=>{var r=N_(e-i.timestamp);it(r)&&(K(i[t])||i[t]>r)&&(i[t]=r)}))}en(){Yi(v,"touchstart",this.Hi,{capture:!0,passive:!0}),Yi(v,"touchend",this.Wi,{capture:!0,passive:!0}),Yi(v,"touchcancel",this.$i,{capture:!0,passive:!0})}Zi(){var t=K(this.sn)||it(this.Vi)&&this.Vi>this.sn;return(K(this.un)||t)&&(this.sn=Date.now(),this.un=!(null==r||!r.querySelector(L_))),!!this.un}Ai(t){return!t||("swipe"===t.type?this.ln(t):this.cn(t))}ln(e){if(pr(e.node))return!0;var i=this.Ti.some((t=>t.type===e.type&&t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!(!i&&!mr(e.node,"html")&&gr(e.node)&&function(e,i){var r;if(!t||Nr(e))return!1;var n=nt(i)?Or:null!==(r=null==i?void 0:i.css_selector_ignorelist)&&void 0!==r?r:Or;return!Er(qr(e,!1).targetElementList,n)}(e.node,{css_selector_ignorelist:this.zi.css_selector_ignorelist}))}cn(e){return!(this.zi.capture_clicks_with_modifier_keys||(i=e.originalEvent,!(i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)))||!!this.ln(e)||(r=e.node,!(!t||Nr(r))&&qr(r,!1).targetElementList.some((t=>mr(t,"a"))));var i,r}an(){if(this.Ti.length){clearTimeout(this.nn),this.nn=void 0;var t=this.Ti;for(var e of(this.Ti=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.Vi&&this.Vi>=e.timestamp?this.Vi-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Fi&&this.Fi>=e.timestamp?this.Fi-e.timestamp:void 0;var r=$_(e.scrollDelayMs,this.zi.scroll_threshold_ms),n=$_(e.selectionChangedDelayMs,this.zi.selection_change_threshold_ms),s=$_(e.mutationDelayMs,this.zi.mutation_threshold_ms),a=$_(e.absoluteDelayMs,1.1*this.zi.mutation_threshold_ms),o=it(e.scrollDelayMs)&&this.zi.scroll_threshold_ms>e.scrollDelayMs,l=it(e.mutationDelayMs)&&this.zi.mutation_threshold_ms>e.mutationDelayMs,u=it(e.selectionChangedDelayMs)&&this.zi.selection_change_threshold_ms>e.selectionChangedDelayMs,h=it(e.visibilityChangedDelayMs),d=it(e.focusChangedDelayMs);if(!(o||l||u||h||d))if(r||s||a||n){var v=O_(e);if("$dead_swipe"===v){if(this.Ii>=this.zi.max_dead_swipes_per_page_load)continue;this.Ii++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.Vi,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:a,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this.zi.mutation_threshold_ms>e.absoluteDelayMs&&this.Ti.push(e)}this.Li()}}Mi(t,e){var i=O_(t);this.instance.capture(i,p({},e,E_(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.zi.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,[i+"_focus_changed_delay_ms"]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new j_(t,e);var B_=Hi("[ExternalScriptsLoader]"),H_=t=>{var e=null==r?void 0:r.querySelectorAll("script");if(e)for(var i=0;e.length>i;i++)if(e[i].src===t||e[i].getAttribute("src")===t)return e[i]},U_=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return B_.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var n=H_(e);if(n){if(n.__posthog_loading_callback_fired)return i();var s=n.__posthog_loading_error;return s?i(s):(n.addEventListener("load",(t=>{n.__posthog_loading_callback_fired=!0,i(void 0,t)})),void n.addEventListener("error",(t=>{n.__posthog_loading_error=t,i(t)})))}var a=()=>{if(!r)return i("document not found");if(H_(e))return U_(t,e,i);var n=r.createElement("script");if(n.type="text/javascript",n.crossOrigin="anonymous",n.src=e,n.onload=t=>{n.__posthog_loading_callback_fired=!0,i(void 0,t)},n.onerror=t=>{n.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(n=t.config.prepare_external_dependency_script(n)),!n)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)r.head.appendChild(n);else{var s,a=r.querySelectorAll("body > script");a.length>0?null==(s=a[0].parentNode)||s.insertBefore(n,a[0]):r.body.appendChild(n)}};null!=r&&r.body?a():null==r||r.addEventListener("DOMContentLoaded",a)},z_={},W_=(t,e)=>{var i="/static/"+e+".js?v="+t.version;if("toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",i)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r=t.config.strict_script_versioning;if(r){var n=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),s=z_[n];if("fallback"===r&&s){if(H_(s))return void U_(t,s,i);delete z_[n]}U_(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var a,o=W_(t,e);z_[n]=o;var l=H_(n);null==l||null==(a=l.parentNode)||a.removeChild(l),U_(t,o,i)}else i(void 0,s)}:i)}else U_(t,W_(t,e),i)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");U_(t,a,i)}},v.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);U_(t,r,i)};class V_{constructor(t){this._instance=t}get zi(){return this._instance.config}get consent(){return this.ks()?0:this.Ss}isOptedOut(){return this.zi.cookieless_mode===Ds||this.isRejected()||-1===this.consent&&this.zi.cookieless_mode===Ls}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.zi.opt_out_capturing_by_default}optInOut(t){this.xs.Ur(this.Cs,t?1:0,this.zi.cookie_expiration,this.zi.cross_subdomain_cookie,this.zi.secure_cookie)}reset(){this.xs.Wr(this.Cs,this.zi.cross_subdomain_cookie)}get Cs(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get Ss(){var t=this.xs.$r(this.Cs);return ft(t)?1:j(pt,t)?0:-1}get xs(){var t=this.zi.opt_out_capturing_persistence_type,e="localStorage"===t?hp:lp;if(!this.Ts||this.Ts!==e){this.Ts=e;var i="localStorage"===t?lp:hp;i.$r(this.Cs)&&(this.Ts.$r(this.Cs)||this.optInOut(ft(i.$r(this.Cs))),i.Wr(this.Cs,this.zi.cross_subdomain_cookie))}return this.Ts}ks(){return!!this.zi.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,v.doNotTrack].some((t=>ft(t)))}}var G_=Hi("[Dead Clicks]"),Z_=()=>!0,Q_=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Tn)),r=t.instance.config.capture_dead_clicks;return nt(r)?r:!!Q(r)||i};class J_{get lazyLoadedDeadClicksAutocapture(){return this.Ms}constructor(t,e,i){this.instance=t,this.isEnabled=e,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Tn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Es((()=>{this.Is()})):this.stop()}Es(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?G_.error("failed to load script",e):t()}))}Is(){var t;if(r){if(!this.Ms&&null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Q(this.instance.config.capture_dead_clicks)?p({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Ms=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Ms.start(r),G_.info("starting...")}}else G_.error("`document` not found. Cannot start.")}stop(){this.Ms&&(this.Ms.stop(),this.Ms=void 0,G_.info("stopping..."))}}var K_=Hi("[SegmentIntegration]");var Y_="posthog-js";function X_(t,e){var i=void 0===e?{}:e,r=i.organization,n=i.projectId,s=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,u=void 0===l||l;return e=>{var i,a,l,h,d;if("*"!==o&&!o.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var c,f=(null==(i=e.exception)?void 0:i.values)||[],g=f.map((t=>p({},t,{stacktrace:t.stacktrace?p({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>p({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(a=f[0])?void 0:a.value)||e.message,$exception_type:null==(l=f[0])?void 0:l.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(h=f[0])?void 0:h.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return r&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),u&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}class tw{constructor(t,e,i,r,n,s){this.name=Y_,this.setupOnce=function(a){a(X_(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class ew{constructor(t){this.Rs=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Bi.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Ps=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.As()}As(){var t;this.Fs=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Rs)}destroy(){var t;null==(t=this.Fs)||t.call(this),this.Fs=void 0}doPageView(e,i){var r,n=this.Os(e,i);return this.Ps={pathname:null!==(r=null==t?void 0:t.location.pathname)&&void 0!==r?r:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(t){var e;return this.Os(t,null==(e=this.Ps)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ps)?void 0:t.pageViewId}}Os(t,e){var i=this.Ps;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,a=n.lastScrollY,o=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(K(s)||K(a)||K(o)||K(l)||K(u)||K(h))){s=Math.ceil(s),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?gt(a/s,0,1,Bi):1,v=s>1?gt(o/s,0,1,Bi):1,c=l>1?gt(u/l,0,1,Bi):1,f=l>1?gt(h/l,0,1,Bi):1;r=Wi(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var iw=["flags","surveys"],rw={[fn]:{exposure:"hidden"},[yn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[bn]:{exposure:"hidden"},[_n]:{exposure:"event"},[wn]:{exposure:"hidden"},[En]:{exposure:"hidden"},[kn]:{exposure:"event"},[Sn]:{exposure:"hidden"},[xn]:{exposure:"event"},[Cn]:{exposure:"event"},[Tn]:{exposure:"event"},[Mn]:{exposure:"hidden"},[In]:{exposure:"event"},[Rn]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Dn]:{exposure:"hidden"},[$n]:{exposure:"event"},[Pn]:{exposure:"event",shouldSkipFromEventProperties:t=>tt(t)},[Nn]:{exposure:"event"},[qn]:{exposure:"event"},[jn]:{exposure:"event"},[zn]:{exposure:"event"},[Wn]:{exposure:"hidden"},[Vn]:{exposure:"hidden",storageGroup:"flags"},[Gn]:{exposure:"hidden",storageGroup:"flags"},[Zn]:{exposure:"hidden"},[Qn]:{exposure:"hidden",storageGroup:"flags"},[Jn]:{exposure:"hidden",storageGroup:"flags"},[Kn]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Yn]:{exposure:"hidden",storageGroup:"flags"},[Xn]:{exposure:"hidden"},[ts]:{exposure:"hidden"},[es]:{exposure:"hidden"},[is]:{exposure:"hidden"},[ns]:{exposure:"hidden",storageGroup:"surveys"},[ss]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[as]:{exposure:"event"},[os]:{exposure:"hidden"},[ls]:{exposure:"hidden"},[us]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[hs]:{exposure:"hidden"},[ds]:{exposure:"hidden"},[rs]:{exposure:"event"},[vs]:{exposure:"hidden"},[cs]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[fs]:{exposure:"hidden"},[ps]:{exposure:"hidden"},[gs]:{exposure:"hidden"},[ms]:{exposure:"hidden"},[ys]:{exposure:"hidden"},[bs]:{exposure:"hidden"},[_s]:{exposure:"hidden"},[An]:{exposure:"event"},[Fn]:{exposure:"event"},[On]:{exposure:"event"},[Ln]:{exposure:"event"},[Ss]:{exposure:"event"},[xs]:{exposure:"event"},[Cs]:{exposure:"event"},[Ts]:{exposure:"event"},[Ms]:{exposure:"event"},[Es]:{exposure:"event"},[Is]:{exposure:"event"},[Rs]:{exposure:"event"},[Ps]:{exposure:"event"},[As]:{exposure:"event"},[Fs]:{exposure:"event"}},nw=[[Bn,{exposure:"hidden"}],[Hn,{exposure:"hidden"}],[Un,{exposure:"hidden"}]],sw=t=>{var e=rw[t];if(e)return e;for(var i of nw){var r=i[1];if(0===t.indexOf(i[0]))return r}},aw={flags:cs,surveys:ss},ow=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],lw=t=>t+"_cookie_identity_change_pending",uw="main",hw=(t,e)=>{zi(t,((i,r)=>{var n=sw(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class dw{constructor(e,i,r){if(void 0===r&&(r=!0),this.Ls={},this.Ds=!1,this.$s=!1,this.Ns=!1,this.qs=!1,this.zi=e,this.js=r,this.props={},this.Bs=void 0,this.Hs=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(e),this.xs=this.Us(e),this.$s=this.zs(e),this.load(),e.debug&&Bi.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var n=()=>this.flush();Yi(t,"beforeunload",n,{capture:!1}),Yi(t,"pagehide",n,{capture:!1})}}Ws(){var t,e=null==(t=this.zi)?void 0:t.persistence_save_debounce_ms;return it(e)&&e>0?e:0}Vs(t){if(this.zi.cookieWinsOnConflict&&"localstorage+cookie"===this.zi.persistence.toLowerCase())if(t)try{var e=gp(t,this.zi.cookie_persisted_properties||[]),i=yp(e,this.zi.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=lp.$r(this.Hs)||void 0;n&&_p(this.Hs,n)===r&&(this.Gs=r,this.Zs=n)}catch(t){}else try{var s=lp.$r(this.Hs)||void 0;this.Gs=s?_p(this.Hs,s):void 0,this.Zs=s}catch(t){}}syncCookieProperties(){return this.Qs(this.zi)}Qs(t,e){if(void 0===e&&(e=!1),this.Js&&!e||this.qs||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=lp.$r(this.Hs)||void 0}catch(t){}if(!i||i===this.Zs)return!1;var r,n=_p(this.Hs,i);try{r=pp(JSON.parse(i))}catch(t){return!1}if((lp.$r(this.Hs)||void 0)!==i)return!1;this.Gs=n,this.Zs=i;var s=bp(this.Hs,i),a=[...vp,...s.properties],o={};if(Object.keys(r).forEach((t=>{var e=r[t];(K(e)||tt(e)||""===e||t===fs&&e!==$s&&e!==Ns)&&(o[t]=!0,delete r[t])})),J(r))return!1;var l=pn in r||r[fs]===$s||r[fs]===Ns,u=this.props[pn],h=this.props[fs],d=Wi({},this.props);[...vp,...t.cookie_persisted_properties||[]].forEach((t=>{if(-1!==a.indexOf(t)&&!(t in r)&&!o[t]&&(l||t!==pn&&t!==fs)){var e=d[t];!s.isValid&&-1!==vp.indexOf(t)&&(!1===e||0===e)||delete d[t]}})),this.props=Wi(d,r),!l||fs in r||fs in this.props||this.Ks(fs,$s);var v=this.props[pn],c=this.props[fs];return!l||v===u&&c===h||(this.Ns=!0,xp.Ur(lw(this.Hs),!0),this.Ys(es),this.Ys(Gn),this.Ys(Vn),this.Ys(Qn),this.Ys(Jn),this.Ys(Kn),this.Ys(cs),this.Ys(vs),this.Ys(hs),c===$s&&(h===Ns||r[fs]===$s||!K(u)&&v!==u)&&(hw(this.props,r),this.Ys(is)),c===Ns?this.props.$user_id=v:delete this.props.$user_id,this.Ys(yn)),!0}consumeCookieIdentityChange(){var t=lw(this.Hs),e=this.Ns||!!xp.$r(t);return this.Ns=!1,e&&xp.Wr(t),e}Xs(t){return void 0===t&&(t=!1),!(this.qs||this.Js&&!t||!this.zi.cookieWinsOnConflict||"localstorage+cookie"!==this.zi.persistence.toLowerCase()||(this.qs=!0,0))}ta(){this.qs&&(K(this.ea)||(clearTimeout(this.ea),this.ea=void 0),delete this.Ls[uw],this.ia(!0))}ra(t){if(void 0===t&&(t=!0),this.qs)try{t?this.ta():K(this.ea)||(clearTimeout(this.ea),this.ea=void 0)}finally{this.qs=!1}}isDisabled(){return!!this.Js}Us(e){-1===ow.indexOf(e.persistence.toLowerCase())&&(Bi.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i,r=function(e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var r=[...vp,...e];return p({},hp,{Vr(t){try{var e,n={};try{e=lp.$r(t)||void 0,n=e?pp(JSON.parse(e)):{}}catch(t){}var s,a=JSON.parse(hp.$r(t)||"{}");if(i){var o=bp(t,e),l=[...vp,...o.properties],u={};Object.keys(n).forEach((t=>{var e=n[t];tt(e)||""===e||t===fs&&e!==$s&&e!==Ns||(u[t]=e)}));var h=pn in u||u[fs]===$s||u[fs]===Ns;if(Object.keys(u).length>0){var d,v=a[pn],c=null!==(d=a[fs])&&void 0!==d?d:$s;r.forEach((t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||t!==pn&&t!==fs)){var e=a[t];!o.isValid&&-1!==vp.indexOf(t)&&(!1===e||0===e)||delete a[t]}})),!h||fs in n||fs in a||(a[fs]=$s),!h||(pn in u?u[pn]:a[pn])===v&&(fs in u?u[fs]:a[fs])===c||(dp.forEach((t=>delete a[t])),u[fs]===Ns&&pn in u?a.$user_id=u[pn]:delete a.$user_id,u[fs]!==Ns&&(delete a[rs],delete a[is]),delete a.__alias)}s=Wi(a,u)}else s=Wi(n,a);return hp.Ur(t,s),s}catch(t){}return null},Ur(t,r,n,s,a,o){var l=hp.Ur(t,r,void 0,void 0,o);try{var u=gp(r,e);if(Object.keys(u).length){if(i){var h=cp(t),d=yp(u,e);if(lp.Ur(h,d,n,s,a,o),lp.$r(h)!==JSON.stringify(d)){lp.Wr(h,s);var v=gp(r);return lp.Ur(t,v,n,s,a,o),l}}lp.Ur(t,u,n,s,a,o)}}catch(t){hp.zr(t)}return l},Wr(e,i){try{null==t||t.localStorage.removeItem(e),lp.Wr(e,i),lp.Wr(cp(e),i)}catch(t){hp.zr(t)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),n=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&hp.Hr()?(i=hp,n=!0):"localstorage+cookie"===s&&r.Hr()?(i=r,n=!0):"sessionstorage"===s&&xp.Hr()?i=xp:"memory"===s?i=kp:"cookie"===s?i=lp:r.Hr()?(i=r,n=!0):i=lp,this.Ds=n,i}na(t){return this.Hs+"__"+t}zs(t){return this.Ds&&!!t.split_storage}properties(){var t={};return zi(this.props,((e,i)=>{var r=sw(i);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e))return;t[i]=e}})),t}load(t){if(void 0===t&&(t=!1),!this.Js||t){var e=this.zi.cookieWinsOnConflict&&"localstorage+cookie"===this.zi.persistence.toLowerCase(),i=e?hp.Vr(this.Hs):null,r={};if(e)try{zi(r=pp(lp.Vr(this.Hs)),((t,e)=>{(K(t)||tt(t)||""===t)&&delete r[e]}))}catch(t){}var n=this.xs.Vr(this.Hs);if(n&&(this.props=Wi({},n)),this.$s&&this.sa(),e&&n){var s,a,o=null==i?void 0:i[pn],l=null!==(s=null==i?void 0:i[fs])&&void 0!==s?s:$s,u=n[pn],h=null!==(a=n[fs])&&void 0!==a?a:$s;if(u!==o||h!==l){this.Ns=!0,xp.Ur(lw(this.Hs),!0);var d=Wi({},this.props);dp.forEach((t=>delete d[t])),h===$s&&(l===Ns||r[fs]===$s||!K(o)&&u!==o)&&(hw(d,r),delete d[is]),this.props=d;var v=new Set;dp.forEach((t=>{var e,i=null==(e=sw(t))?void 0:e.storageGroup;i&&v.add(i)})),v.forEach((t=>{var e={};zi(this.props,((i,r)=>{var n;(null==(n=sw(r))?void 0:n.storageGroup)===t&&(e[r]=i)})),J(e)?(hp.Wr(this.na(t)),this.Ls[t]={}):hp.Ur(this.na(t),e)&&(this.Ls[t]={persisted:!0,fingerprint:this.aa(e,t)})}))}}xp.$r(lw(this.Hs))&&(this.Ns=!0)}}sa(){for(var t of iw){var e=hp.Vr(this.na(t));if(e&&!J(e)){var i=this.oa(t);i.persisted=!0,this.la(t)||(i.fingerprint=this.aa(e,t)),this.ua(t,e)||Wi(this.props,e)}}}la(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=sw(e))?void 0:i.storageGroup)===t}))}ua(t,e){var i=aw[t];if(!i)return!1;var r=e[i],n=this.props[i];return it(r)&&it(n)&&n>r}refreshKey(t){var e;if(!this.Js){var i=this.$s?null==(e=sw(t))?void 0:e.storageGroup:void 0,r=i?hp.Vr(this.na(i)):this.xs.Vr(this.Hs);if(r&&t in r)this.Ks(t,r[t]);else{if(i){var n=this.xs.Vr(this.Hs);if(n&&t in n)return void this.Ks(t,n[t])}this.Ys(t)}}}save(){if(!this.Js){var t=this.Ws();t>0?K(this.ea)&&(this.ea=setTimeout((()=>{this.ea=void 0,this.ia()}),t)):this.ia()}}flush(){K(this.ea)||(clearTimeout(this.ea),this.ea=void 0,this.ia())}ia(t){void 0===t&&(t=!1),this.Js||this.qs&&!t||(t||this.syncCookieProperties(),this.$s?this.ha():this.da(this.xs,this.Hs,this.props,uw)&&this.Vs(this.props))}ha(){var t=this.va(),e=t.main,i=t.groups;for(var r of(this.da(this.xs,this.Hs,e,uw)&&this.Vs(e),iw)){var n,s=i[r];(!J(s)||null!=(n=this.Ls[r])&&n.persisted)&&this.da(hp,this.na(r),s,r)}}va(){var t={},e={flags:{},surveys:{}};return zi(this.props,((i,r)=>{var n,s=null==(n=sw(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i})),{main:t,groups:e}}aa(t,e){if(e===uw)return JSON.stringify(t)+"|"+this.ca+"|"+this.fa+"|"+this.pa;var i={};return zi(t,((t,e)=>{var r;i[e]=null!=(r=sw(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}da(t,e,i,r){var n,s=this.oa(r);if(r!==uw&&!s.dirty&&!K(s.fingerprint))return!1;try{if((n=this.aa(i,r))===s.fingerprint)return s.dirty=!1,!1}catch(t){n=void 0}return t.Ur(e,i,this.ca,this.fa,this.pa,this.zi.debug)?(s.dirty=!1,r!==uw&&(s.persisted=!0),K(n)||(s.fingerprint=n),!0):(this.zi.debug&&Bi.warn('failed to persist storage entry "'+e+'"; will retry on next save'),!1)}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(K(this.ea)||(clearTimeout(this.ea),this.ea=void 0),this.xs.Wr(this.Hs,!1),this.xs.Wr(this.Hs,!0),!i&&this.js)for(var r of iw)hp.Wr(this.na(r));i?delete this.Ls[uw]:this.Ls={},this.Gs=void 0,this.Zs=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Q(t)){this.syncCookieProperties(),K(e)&&(e="None"),this.ca=K(i)?this.ga:i;var r=!1;if(zi(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Ks(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(Q(t)){this.syncCookieProperties(),this.ca=K(e)?this.ga:e;var i=!1;if(zi(t,((e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||Q(e)||G(e))&&(this.Ks(r,e),i=!0)})),i)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();var e="string"==typeof t?[t]:t,i=!1;for(var r of e)r in this.props&&(this.Ys(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==r?void 0:r.URL;if(t!==this.Bs){var e=jo(this.zi.custom_campaign_params,this.zi.mask_personal_data_properties,this.zi.custom_personal_data_properties);J(Qi(e))||this.register(e),this.Bs=t}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Ho(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Wo(),$referring_domain:null!=r&&r.referrer&&(null==(t=ir(r.referrer))?void 0:t.host)||zo},void 0)}set_initial_person_info(){this.props[ms]||this.props[ys]||this.register_once({[bs]:Vo(this.zi.mask_personal_data_properties,this.zi.custom_personal_data_properties,this.zi.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};zi([ys,ms],(e=>{var i=this.props[e];i&&zi(i,(function(e,i){t["$initial_"+H(i)]=e}))}));var e=this.props[bs];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=Go(t,e),r={};return zi(i,(function(t,e){r["$initial_"+H(e)]=t})),r}(e,this.zi.disable_capture_url_hashes);Wi(t,i)}return t}safe_merge(t){return zi(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){var r=t.persistence!==e.persistence,n=!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every(((t,e)=>t===r[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),s=r||n,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,o=t.disable_persistence||!!i,l=!!this.Js&&!o;o||this.Qs(e,l),this.zi=t,!o&&(r||n||a)&&(this.Gs=void 0,this.Zs=void 0,this.Qs(p({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),l));var u=s||a?this.Us(t):this.xs,h=this.zs(t),d=s||h!==this.$s,v=!o&&(d||t.cross_subdomain_cookie!==this.fa||t.secure_cookie!==this.pa)&&this.Xs(l);try{if(this.ga=this.ca=t.cookie_expiration,this.set_disabled(o),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),d){var c=this.props;this.clear(),this.xs=u,this.$s=h,this.props=c,this.save()}else a&&(this.xs=u,o||(delete this.Ls[uw],this.ia()))}finally{v&&this.ra()}}set_disabled(t){this.Js=t,this.Js?this.remove():this.save()}set_cross_subdomain(t){t!==this.fa&&(this.fa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.pa&&(this.pa=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[bn]||{};i[t]=e,this.Ks(bn,i),this.save()}remove_event_timer(t){var e=this.props[bn]||{},i=e[t];return K(i)||(delete e[t],this.Ks(bn,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Ks(t,e),this.save()}Ks(t,e){var i;this.props[t]=e,null!=(i=sw(t))&&i.volatile||this.ma(t)}Ys(t){delete this.props[t],this.ma(t)}ma(t){var e,i=null==(e=sw(t))?void 0:e.storageGroup;i&&(this.oa(i).dirty=!0)}oa(t){return this.Ls[t]||(this.Ls[t]={})}}var vw=Hi("[RateLimiter]");class cw{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{vw.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void vw.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,a=(new Date).getTime(),o=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(gs))&&void 0!==e?e:{tokens:n,last:a};o.tokens+=(a-o.last)/1e3*s,o.last=a,o.tokens>n&&(o.tokens=n);var l=1>o.tokens;if(l||t||(o.tokens=Math.max(0,o.tokens-1)),l&&!t){var u=(it(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.ya(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(gs,o),{isRateLimited:l,remainingTokens:o.tokens}}ba(t){var e=this.instance.config.property_denylist;return!G(e)||!e.includes(t)}_a(){var t;if(this.ba("$current_url")&&this.ba("$pathname")&&null!=n&&n.pathname)return""+(null!==(t=n.origin)&&void 0!==t?t:"")+n.pathname}ya(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this._a(),a=this.ba("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,o=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var fw=Hi("[RemoteConfig]");class pw{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}wa(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}ka(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return fw.info("Using preloaded remote config",this.remoteConfig),void this.Sa(this.remoteConfig);if(this._instance.xa())return void fw.warn("Remote config is disabled. Falling back to local config.");this.wa((t=>{if(!t)return fw.info("No config found after loading remote JS config. Falling back to JSON."),void this.ka((t=>{this.Sa(t.json,t)}));this.Sa(t)}))}catch(t){fw.error("Error loading remote config",t),this.Sa()}}Sa(t,e){!t&&e&&(0===e.statusCode?e.error||fw.warn("Failed to fetch remote config from PostHog."):fw.error("Failed to fetch remote config from PostHog."));try{this._instance.Sa(t?{ok:!0,config:t}:{ok:!1})}catch(t){fw.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(t){fw.error("Error loading feature flags",t)}}}var gw=!!a||!!s,mw="text/plain",yw=!1,bw=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],a=n[1];if(!a)return t;var o=a.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},_w=function(t,e,i){var r;void 0===i&&(i=!0);var n=t.split("?"),s=n[0],a=n[1],o=p({},e),l=null!==(r=null==a?void 0:a.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=o[n])&&void 0!==e?e:r[1];return delete o[n],n+"="+s})))&&void 0!==r?r:[],u=rr(o);return u&&l.push(u),l.length>0?s+"?"+l.join("&"):s},ww=t=>{if(t.Ca)return t.Ca;var e=t.data,i=t.compression;if(e){if(i===Mf){var r=no(so(er(e)),{mtime:0});return{contentType:mw,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Ef){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(er(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:er(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=er(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},kw=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:_w(t.url,{compression:Ef}),encodedBody:ww(p({},t,{compression:Ef,Ca:void 0}))}:{url:bw(t.url,"compression"),encodedBody:ww(p({},t,{compression:void 0,Ca:void 0}))};try{e=ww(t)}catch(e){if(Fe(t.compression,nr(t.url,"compression")))return Bi.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&Fe(t.compression,nr(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?Ae(new Uint8Array(i)):ArrayBuffer.isView(i)&&Ae(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(yw=!0,r()):{url:t.url,encodedBody:e}},Sw=t=>{try{return kw(t)}catch(e){return Bi.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},xw=function(){var t=f((function*(t){var e=er(t.data),i=yield Ne(e,qi.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{Ca:{contentType:mw,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Cw=/Failed to fetch|NetworkError|Load failed/i,Tw=t=>"TypeError"===(null==t?void 0:t.name)&&Cw.test((null==t?void 0:t.message)||""),Mw=t=>{var e=Sw(t);if(e){var i=e.url,r=e.encodedBody,n=null!=r?r:{},a=n.contentType,l=n.body,u=n.estimatedSize,h=new Headers;zi(t.headers,(function(t,e){h.append(e,t)})),a&&h.append("Content-Type",a);var d=null,v=!1;if(o){var c=new o;d={signal:c.signal,timeout:setTimeout((()=>{var e;v=!0,c.abort(Ce("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))}),t.timeout)}}var f=e=>{v&&"AbortError"===(null==e?void 0:e.name)||Tw(e)?Bi.warn(e):Bi.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;s(i,p({method:(null==t?void 0:t.method)||"GET",headers:h,keepalive:"POST"===t.method&&!t.Ta&&52428.8>(u||0),body:l,signal:null==(g=d)?void 0:g.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){Bi.error(t)}null==t.callback||t.callback(r)})))).catch(f).finally((()=>d?clearTimeout(d.timeout):null))}catch(t){d&&clearTimeout(d.timeout),f(t)}}},Ew=t=>{try{var e,r=kw(t),n=r.url,s=r.encodedBody,a=null!=s?s:{},o=a.body,l=a.estimatedSize;if(!o)return;var u=o instanceof Blob?o:new Blob([o],{type:a.contentType});if(i.sendBeacon(n,u))return;var h=G(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(G(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),v=e=>G(t.data)?e:p({},t.data,{batch:e});return Ew(p({},t,{data:v(h.slice(0,d))})),void Ew(p({},t,{data:v(h.slice(d))}))}Bi.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Mw(p({},t,{Ta:!0}))}catch(t){Bi.warn("Beacon send failed",t)}},Iw=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return _w(i===Mf?bw(t,"compression"):t,p({},n?{[n]:Date.now().toString()}:{},i===Mf?{}:{compression:i}))},Rw=[];s&&Rw.push({transport:"fetch",method:Mw}),a&&Rw.push({transport:"XHR",method(t){var e=Sw(t);if(e){var i=new a,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,o=n.body;zi(t.headers,(function(t,e){i.setRequestHeader(e,t)})),s&&i.setRequestHeader("Content-Type",s),t.timeout&&(i.timeout=t.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(o)}}}),null!=i&&i.sendBeacon&&Rw.push({transport:"sendBeacon",method:Ew});var Pw=3e3;class Aw{constructor(t,e){this.Ma=!0,this.Ea=[],this.Ia=gt((null==e?void 0:e.flush_interval_ms)||Pw,250,5e3,Bi.createLogger("flush interval"),Pw),this.Ra=t}enqueue(t){this.Ea.push(t),this.Pa||this.Aa()}unload(){this.Fa();var t=this.Ea.length>0?this.Oa():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.La(p({},t,{transport:"sendBeacon"}))}))}enable(){this.Ma=!1,this.Aa()}Aa(){var t=this;this.Ma||(this.Pa=setTimeout((()=>{if(this.Fa(),this.Ea.length>0){var e=this.Oa(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&G(i.data)&&zi(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.La(i)};for(var r in e)i()}}),this.Ia))}La(t){try{this.Ra(t)}catch(t){Bi.error(t)}}Fa(){clearTimeout(this.Pa),this.Pa=void 0}Oa(){var t={};return zi(this.Ea,(e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;K(t[n])&&(t[n]=p({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)})),this.Ea=[],t}}var Fw=["retriesPerformedSoFar"];class Ow{constructor(e){this.Da=!1,this.$a=3e3,this.Ea=[],this._instance=e,this.Ea=[],this.Na=!0,!K(t)&&"onLine"in t.navigator&&(this.Na=t.navigator.onLine,this.qa=()=>{this.Na=!0,this.ja()},this.Ba=()=>{this.Na=!1},Yi(t,"online",this.qa),Yi(t,"offline",this.Ba))}get length(){return this.Ea.length}retriableRequest(t){var e=t.retriesPerformedSoFar,i=g(t,Fw);rt(e)&&(i.url=_w(i.url,{retry_count:e})),this._instance._send_request(p({},i,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.An(p({retriesPerformedSoFar:e},i));0===t.statusCode&&Bi.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=e?e:0)+" retries.")}null==i.callback||i.callback(t)}}))}An(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(r+n*(r-i))}(e),r=Date.now()+i;this.Ea.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),Bi.warn(n),this.Da||(this.Da=!0,this.Ha())}Ha(){if(this.Ua&&clearTimeout(this.Ua),0===this.Ea.length)return this.Da=!1,void(this.Ua=void 0);this.Ua=setTimeout((()=>{this.Na&&this.Ea.length>0&&this.ja(),this.Ha()}),this.$a)}ja(){var t=Date.now(),e=[],i=this.Ea.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.Ea=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.Ua&&(clearTimeout(this.Ua),this.Ua=void 0),this.Da=!1,K(t)||(this.qa&&(t.removeEventListener("online",this.qa),this.qa=void 0),this.Ba&&(t.removeEventListener("offline",this.Ba),this.Ba=void 0)),this.Ea)){var i=e.requestOptions;try{this._instance._send_request(p({},i,{transport:"sendBeacon"}))}catch(t){Bi.error(t)}}this.Ea=[]}}class Lw{constructor(t){this.za=()=>{var t,e,i,r;this.Wa||(this.Wa={});var n=this.scrollElement(),s=this.scrollY(),a=n?Math.max(0,n.scrollHeight-n.clientHeight):0,o=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.Wa.lastScrollY=Math.ceil(s),this.Wa.maxScrollY=Math.max(s,null!==(t=this.Wa.maxScrollY)&&void 0!==t?t:0),this.Wa.maxScrollHeight=Math.max(a,null!==(e=this.Wa.maxScrollHeight)&&void 0!==e?e:0),this.Wa.lastContentY=o,this.Wa.maxContentY=Math.max(o,null!==(i=this.Wa.maxContentY)&&void 0!==i?i:0),this.Wa.maxContentHeight=Math.max(l,null!==(r=this.Wa.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get Va(){return this._instance.config.scroll_root_selector}getContext(){return this.Wa}resetContext(){var t=this.Wa;return setTimeout(this.za,0),t}startMeasuringScrollPosition(){Yi(t,"scroll",this.za,{capture:!0}),Yi(t,"scrollend",this.za,{capture:!0}),Yi(t,"resize",this.za)}scrollElement(){if(!this.Va)return null==t?void 0:t.document.documentElement;var e=G(this.Va)?this.Va:[this.Va];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}Ga(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.Va){var r=this.scrollElement();return r&&r[i]||0}return t?"y"===e?t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop||0:t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft||0:0}scrollY(){return this.Ga("y")}scrollX(){return this.Ga("x")}}var Dw=t=>Vo(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class $w{constructor(t,e,i,r){this.ut=t=>{var e=this.Za();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Qa(this._instance)};this.Ja.register({[ps]:i})}},this._instance=t,this.Ka=e,this.Ja=i,this.Qa=r||Dw,this.Ka.onSessionId(this.ut)}Za(){return this.Ja.props[ps]}getSetOnceProps(){var t,e=null==(t=this.Za())?void 0:t.props;return e?"r"in e?Go(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return zi(Qi(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+H(i)]=e})),t}}class Nw{on(t,e){return this.Ya[t]||(this.Ya[t]=[]),this.Ya[t].push(e),()=>{this.Ya[t]=this.Ya[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Ya[t]||[])i(e);for(var r of this.Ya["*"]||[])r(t,e)}constructor(){this.Ya={}}}var qw=Hi("[SessionId]"),jw=864e5;class Bw{on(t,e){return this.Xa.on(t,e)}constructor(t,e,i){var r;if(this.eo=null,this.io=null,this.ro=[],this.no=void 0,this.so=!1,this.Xa=new Nw,this.ao=(t,e)=>!(!rt(t)||!rt(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Ds)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.zi=t.config,this.Ja=t.persistence,this.ct=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.oo=void 0,this._sessionActivityTimestamp=null,this.lo=e||np,this.uo=i||np;var n=this.zi.persistence_name||this.zi.token;if(this._sessionTimeoutMs=1e3*gt(this.zi.session_idle_timeout_seconds||1800,60,36e3,qw.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ho(),this.do="ph_"+n+"_window_id",this.vo="ph_"+n+"_primary_window_exists",this.co()){var s=xp.Vr(this.do),a=xp.Vr(this.vo);s&&!a?this.ct=s:xp.Wr(this.do),xp.Ur(this.vo,!0)}null!=(r=this.zi.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.zi.bootstrap.sessionID),this.fo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return K(this.ro)&&(this.ro=[]),this.ro.push(t),this._e&&t(this._e,this.ct),()=>{this.ro=this.ro.filter((e=>e!==t))}}co(){return"memory"!==this.zi.persistence&&!this.Ja.Js&&xp.Hr()}po(t){t!==this.ct&&(this.ct=t,this.co()&&xp.Ur(this.do,t))}mo(){return this.ct?this.ct:this.co()?xp.Vr(this.do):null}yo(t){var e=this.eo;return!tt(e)&&!tt(t)&&5e3>Math.abs(t-e)}bo(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this._e||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this._e=t,n&&!r||n&&this.yo(e)||(this.eo=e,this.Ja.register({[Dn]:[e,t,i]}))}_o(){var t,e=null==(t=this.zi)?void 0:t.persistence_save_debounce_ms;return rt(e)&&e>0}wo(){this._o()?this.Ja.refreshKey(Dn):(this.Ja.flush(),this.Ja.load())}ko(){var t;if(!tt(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.eo){this.wo();var e=this.So();e[1]===this._e&&e[2]===this._sessionStartTimestamp&&(this.eo=this._sessionActivityTimestamp,this.Ja.register({[Dn]:[this._sessionActivityTimestamp,null!==(t=this._e)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Ja.flush())}}xo(){var t=this.So()[0],e=rt(t)?t:0,i=rt(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}Co(t){return this.wo(),this.ao(t,this.xo())}So(){var t=this.Ja.props[Dn];return G(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.eo=null,this.oo=void 0,clearTimeout(this.To),this.To=void 0,this.bo(null,null,null)}setBootstrapSessionId(t,e){void 0===e&&(e=!1);var i=function(t,e){void 0===e&&(e=(new Date).getTime());try{var i=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(t);return i>e+6e4?void qw.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void qw.error("Invalid sessionID in bootstrap",t)}}(t);return!K(i)&&(e?this.oo={sessionId:t,sessionStartTimestamp:i}:this.bo(t,(new Date).getTime(),i),!0)}destroy(){this.so=!0,this.ko(),clearTimeout(this.To),this.To=void 0,this.no&&t&&(t.removeEventListener(Bs,this.no,{capture:!1}),this.no=void 0),this.ro=[]}fo(){this.no=()=>{this.ko(),this.co()&&xp.Wr(this.vo)},Yi(t,Bs,this.no,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),this.zi.cookieless_mode===Ds)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this._e;if(i)this.io=r;else if(tt(this.io)||this.io>r||r-this.io>=1e3){var s,a;null==(s=(a=this.Ja).syncCookieProperties)||s.call(a),this.io=r}var o=this.So(),l=o[1],u=o[2],h=!K(n)&&l!==n,d=this.xo(),v=this.mo(),c=this.oo,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>jw),p=c?f:rt(u)&&Math.abs(r-u)>jw,g=!1,m=h,y=!l||!!c,b=l,_=!y&&!t&&this.ao(r,d);if(_){(_=this.Co(r))||qw.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.So();l=w[1],u=w[2]}if(y||_||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.lo(),v=this.uo(),qw.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.oo=void 0,g=!0}else v||(v=this.uo(),g=!0),(m=m||l!==b)&&(qw.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=rt(d)&&t&&!p?d:r,x=rt(u)?u:(new Date).getTime();this.po(v),this.bo(l,S,x),t||this.ho();var C={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.ro.forEach((t=>t(l,v,C))),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}ho(){this.so||(clearTimeout(this.To),this.To=setTimeout((()=>{if(!this.so)if(this.Co((new Date).getTime())){var t=this._e;this.resetSessionId(),this.Xa.emit("forcedIdleReset",{idleSessionId:t})}else this.ho()}),1.1*this.sessionTimeoutMs))}}var Hw=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&q(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>q(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function Uw(){return Uw=f((function*(){var t=null==i?void 0:i.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return Y(r)&&r.length>0?r:void 0}catch(t){return void Bi.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),Uw.apply(this,arguments)}var zw="custom",Ww="i.posthog.com",Vw=/^\/static\//,Gw=["/s/","/e/","/i/"];class Zw{constructor(t){this.Mo={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+Ww,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Mo[this.apiHost]||(this.Mo[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":zw),this.Mo[this.apiHost]}Eo(t){if(Vw.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Io(t){var e=ir(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Ro(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,a=(null==(s=ir(i))?void 0:s.href)||i;r=n(new URL(a)).toString()}if(n&&"api"===t&&Gw.some((t=>0===e.indexOf(t)))){var o=this.Io(r);if(o){var l,u=this.apiHost,h=this.Po;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(h={apiHost:u,rewriteRequestPath:n,urls:new Set},this.Po=h),h.urls.add(o)}}return r}isIngestionEndpoint(t){var e=this.Po,i=this.Io(t);return(null==e?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&e.urls.has(i)}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.Ro(t,e,this.uiHost+e);if("flags"===t)return this.Ro(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.Eo(e);if(i)return this.Ro(t,e,""+i+e)}if(this.region===zw)return this.Ro(t,e,this.apiHost+e);var r=Ww+e;switch(t){case"assets":return this.Ro(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Ro(t,e,"https://"+this.region+"."+r)}}}var Qw=Hi("[PostHog ExternalIntegrations]"),Jw={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Kw{constructor(t){this._instance=t}Es(t,e){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return Qw.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],a=i[1];!a||null!=(e=v.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.Es(Jw[s],(()=>{var e;null==(e=v.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!a&&null!=(r=v.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=v.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;e()}}}class Yw{constructor(t,e){this.I=t,this.cs=e,this.Ao=new Map,this.us=!1}add(t){var e=this;return f((function*(){if(e.us)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.Ao.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.Ao.set(t.name,t);try{var i=t.setup(e.cs);i&&(yield i)}catch(i){var r=e.Ao.get(t.name)===t;r&&e.Ao.delete(t.name),e.I.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.Fo(t)}}))()}getExtension(t){return this.Ao.get(t)}dispose(){if(!this.us){this.us=!0;var t=Array.from(this.Ao.values()).reverse();for(var e of(this.Ao.clear(),t))this.Fo(e)}}Fo(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Z(e.then)&&e.then(void 0,(e=>{this.I.error('Failed to dispose browser extension "'+t.name+'"',e)}))}catch(e){this.I.error('Failed to dispose browser extension "'+t.name+'"',e)}}}class Xw{constructor(t){this._instance=t}initialize(){}get(t){var e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);var i={};for(var r of t){var n=null==e?void 0:e.get_property(r);K(n)||(i[r]=n)}return i}set(t,e){var i;null==(i=this._instance.persistence)||i.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}}var tk="extensionsRemoteConfig";class ek{constructor(t){this.us=!1,this.instance=t,this.I=Bi,this.Oo=t.Lo,this.kv=new Xw(t),this.onEvent=t=>Tf(this.instance.on("eventCaptured",(e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.I.error("Browser extension event listener failed",t)}}))),this.onRemoteConfig=t=>{if(this.us)return Tf((()=>{}));var e=e=>{try{t(e)}catch(t){this.I.error("Browser extension remote config listener failed",t)}},i=this.instance.Do.on(tk,e);return this.Oo&&e(this.Oo),Tf(i)},this.$o=new Yw(Bi.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property(gn))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(gn);return"string"==typeof t?t:void 0}get library(){return{name:qi.LIB_NAME,version:qi.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null==(e=this.instance.persistence)?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,i,r,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(i=null==n?void 0:n.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(r=null==n?void 0:n.sessionStartTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(t){return this.$o.add(t)}getExtension(t){return this.$o.getExtension(t)}capture(t,e,i){var r=this;return f((function*(){i?r.instance.capture(t,e,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):r.instance.capture(t,e)}))()}registerDynamicEventProperties(t){return Tf(this.instance.No(t))}handleRemoteConfig(t){this.us||(this.Oo=t,this.instance.Do.emit(tk,t))}sendRequest(t,e){var i=this;return f((function*(){var r;void 0===e&&(e={});var n=i.instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",t),s={method:e.method,url:e.query?_w(n,e.query):n,data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,compressionFallback:"flags"===e.target&&"best-available"===e.compression?x.Base64:void 0,timestampMode:e.sentAt};return"sendBeacon"===e.transport?(i.instance._send_request(s),{statusCode:202}):new Promise((t=>{s.callback=t,i.instance._send_request(s)}))}))()}dispose(){this.us||(this.us=!0,this.$o.dispose())}}var ik={},rk=0,nk=()=>{},sk='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ak="Surveys module not available",ok="sanitize_properties is deprecated. Use before_send instead",lk="Invalid value for property_denylist config: ",uk=["token","distinct_id",ks],hk="posthog",dk=!gw&&-1===(null==u?void 0:u.indexOf("MSIE"))&&-1===(null==u?void 0:u.indexOf("Mozilla")),vk=t=>{var e={};return t&&"unset"!==t?("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0),e):e},ck=e=>{var i;return p({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ki(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nk,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:n&&Y(null==n?void 0:n.search)&&-1!==n.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,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==t||null==(i=t.location)?void 0:i.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",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(t){Bi.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:qs,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Pw},error_tracking:{},_onCapture:nk},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Ar,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:vk(t),external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t),cookieWinsOnConflict:!(!t||"unset"===t||"2026-08-29">t)}))(e))},fk=[["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"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],pk=t=>{var e={};for(var i of fk){var r=i[0],n=i[1];K(t[r])||(e[n]=t[r])}var s=Wi({},e,t),a=t.__preview_external_dependency_versioned_paths;return K(a)||(K(t.strict_script_versioning)&&(s.strict_script_versioning=!!a),Y(a)&&K(t.asset_host)&&(s.asset_host=a)),G(t.property_blacklist)&&(K(t.property_denylist)?s.property_denylist=t.property_blacklist:G(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Bi.error(lk+t.property_denylist)),s};class gk{constructor(){this.__forceAllowLocalhost=!1}get qo(){return this.__forceAllowLocalhost}set qo(t){Bi.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class mk{jo(t,e){if(t){var i=this.Ao.indexOf(t);-1!==i&&this.Ao.splice(i,1)}return this.Ao.push(e),null==e.initialize||e.initialize(),e}Bo(){return this.config.cookieless_mode===Ds||this.config.cookieless_mode===Ls&&this.consent.isRejected()}Ho(){if(!this.Bo()&&this.get_distinct_id()===ws){var t=this.persistence;if(t){this.Uo()||t.load(!0);var e=this.get_distinct_id();if(!e||e===ws){var i=this.config.get_device_id(np());this.register({distinct_id:i,$device_id:i}),t.set_property(fs,$s)}this.zo()}}}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var t;this.webPerformance=new gk,this.Wo=!1,this.version=qi.LIB_VERSION,this.Vo=new Set,this.Go="",this.Do=new Nw,this.Ao=[],this.Zo=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ck(),this.SentryIntegration=tw,this.sentryIntegration=t=>function(t,e){var i=X_(t,e);return{name:Y_,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Qo=!1,this.Jo=null,this.Ko=null,this.Yo=null,this.scrollManager=new Lw(this),this.pageViewManager=new ew(this),this.rateLimiter=new cw(this),this.requestRouter=new Zw(this),this.consent=new V_(this),this.externalIntegrations=new Kw(this);var e=null!==(t=mk.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=Y(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Y(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>Bi.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==hk){var r,n=null!==(r=ik[i])&&void 0!==r?r:new mk;return n._init(t,e,i),ik[i]=n,ik[hk][i]=n,n}return this._init(t,e,i)}_init(e,i,r){var n,s;void 0===i&&(i={});var a,o=Y(e)?e.trim():"";if(!o)return Bi.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 o!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+o+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=ck(i.defaults),i.debug=this.Xo(i.debug),this.tl=i,this.el=[],i.person_profiles?this.Ko=i.person_profiles:i.process_person&&(this.Ko=i.process_person);var l=ck(i.defaults),u=pk(i),h=Wi({},l,u,{name:r,token:o});Q(l.rageclick)&&Q(u.rageclick)&&(h.rageclick=Wi({},l.rageclick,u.rageclick)),Q(l.session_recording)&&Q(u.session_recording)&&(h.session_recording=Wi({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&Bi.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:Mf;var d=this.Uo();if(this.persistence=new dw(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dw(p({},this.config,{persistence:"sessionStorage"}),d,!1),this.Go="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!d&&xp.Hr()){var v=xp.Vr(this.Go);G(v)&&v.forEach((t=>{Y(t)&&this.Vo.add(t)}))}else xp.Wr(this.Go);var c=p({},this.persistence.props),f=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.il=new Aw((t=>this.rl(t)),this.config.request_queue_config),this.nl=new Ow(this),this.__request_queue=[];var g=this.Bo();if(g||(this.sessionManager=new Bw(this),this.sessionPropsManager=new $w(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.sl()}))),this.al(),this.config.__preview_deferred_init_extensions?(Bi.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.ol(g)}),0)):(Bi.info("Initializing extensions synchronously"),this.ol(g)),qi.DEBUG=qi.DEBUG||this.config.debug,qi.DEBUG&&Bi.info("Starting in debug mode",{this:this,config:i,thisC:p({},this.config),p:c,s:f}),!this.config.identity_distinct_id||null!=(n=i.bootstrap)&&n.distinctID||(i.bootstrap=p({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=i.bootstrap)?void 0:s.distinctID)){var m=i.bootstrap.distinctID,y=this.get_distinct_id(),b=this.persistence.get_property(fs);if(i.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===$s)this.identify(m);else if(i.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===Ns)Bi.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 _=this.config.get_device_id(np()),w=i.bootstrap.isIdentifiedID?_:m;this.persistence.set_property(fs,i.bootstrap.isIdentifiedID?Ns:$s),this.register({distinct_id:m,$device_id:w})}}if(g)this.register_once({distinct_id:ws,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(np());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(fs,$s)}return Yi(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||np();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(fs,Ns)),e()},n=i.user();"then"in n&&Z(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||K_.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(K_.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(K_.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,Hs),identify:t=>e(t,zs),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.ll())):this.ll(),Z(this.config._onCapture)&&this.config._onCapture!==nk&&(Bi.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Bi.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return Uw.apply(this,arguments)}().then((t=>{t&&this.register({[mn]:t})})).catch(nk),this}ul(t){var e=t;return Y(e.name)&&Z(e.setup)}hl(t,e){this.ul(t)?e.push((()=>{this.dl().add(t).catch((()=>null==t.dispose?void 0:t.dispose())).catch((e=>{Bi.error('Failed to dispose browser extension "'+t.name+'"',e)}))})):this.Ao.push(t)}al(){var t,e,i,r,n,s,a=null!==(t=null==(e=this.config.__extensionClasses)?void 0:e.featureFlags)&&void 0!==t?t:null==(i=mk.__defaultExtensionClasses)?void 0:i.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(r=this.vl)||r.call(this),this.vl=void 0,this.featureFlags=new a(this)),Z(this.featureFlags.onReloading)&&Z(this.featureFlags.setup)?this.vl||(this.vl=this.featureFlags.onReloading((()=>{this.Do.emit("featureFlagsReloading",!0)})),this.dl().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}ol(t){var e,i,r,n,s,a,o,l=performance.now(),u=p({},mk.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.Ao.push(this.exceptions=null!==(e=this.exceptions)&&void 0!==e?e:new u.exceptions(this)),u.historyAutocapture&&this.Ao.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Ao.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.Ao.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!t&&this.Ao.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.hl(this.autocapture=new u.autocapture(this),h),u.surveys&&this.hl(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new u.surveys(this),h),u.logs&&this.hl(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this),h),u.metrics&&this.Ao.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new u.metrics(this)),u.conversations&&this.Ao.push(this.conversations=null!==(s=this.conversations)&&void 0!==s?s:new u.conversations(this)),u.productTours&&this.Ao.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Ao.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Ao.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Ao.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Ao.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,Q_)),u.toolbar&&this.Ao.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new u.toolbar(this)),u.experiments&&this.Ao.push(this.experiments=null!==(o=this.experiments)&&void 0!==o?o:new u.experiments(this)),this.Ao.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.cl){var t=this.cl;this.cl=void 0,this.Ao.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.fl(h,l)}fl(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.fl(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){Bi.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Ss]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[xs]:r}),this.config.__preview_deferred_init_extensions&&Bi.info("PostHog extensions initialized ("+r+"ms)")}Sa(t){var e;if(!r||!r.body)return Bi.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Sa(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.cl=t),this.Lo=t,this.compression=void 0,t.ok){var i,n=t.config;n.supportedCompression&&!this.config.disable_compression&&(this.compression=j(n.supportedCompression,Mf)?Mf:j(n.supportedCompression,Ef)?Ef:void 0),null!=(i=n.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint)}this.set_config({person_profiles:this.Ko?this.Ko:qs}),null==(e=this.pl)||e.handleRemoteConfig(t),this.Ao.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}ll(){try{this.config.loaded(this)}catch(t){Bi.critical("`loaded` function failed",t)}if(this.gl(),this.config.internal_or_test_user_hostname&&null!=n&&n.hostname){var t=n.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Bo())&&this.ml()}),1),this.yl=new pw(this),this.yl.load()}gl(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.il)||t.enable())}_dom_loaded(){this.is_capturing()&&Ui(this.__request_queue,(t=>this.rl(t))),this.__request_queue=[],this.gl()}_handle_unload(){var t,e,i,r,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.bl()&&this.capture(Us),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.il)||r.unload(),null==(n=this.nl)||n.unload()):this.bl()&&this.capture(Us,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?dk?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=p({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(K(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,r,n=p({},t);n.timeout=n.timeout||6e4;var s,a,o,u,h,d=null!==(e=n.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&K(n.compression)&&n.data&&(n.compression=Ef),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(h=(u=(G(s=n.data)?s:[s]).map((t=>p({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{}))))[0])||null==(o=h.properties)?void 0:o.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===n.timestampMode&&(n.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),G(t)?t.map((t=>p({},t,{sent_at:e}))):p({},t,{sent_at:e})}(n.data))),n.url=Iw(n.url,n.method,n.compression,n.timestampMode);var v=Rw.filter((t=>!n.disableTransport||!t.transport||!n.disableTransport.includes(t.transport))),c=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(v,(t=>t.transport===d)))?void 0:r.method)&&void 0!==i?i:v[0].method;if(!c)throw new Error("No available transport method");var f=t=>{try{c(t)}catch(t){Tw(t)?Bi.warn(t):Bi.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===Mf&&l&&"undefined"!=typeof Promise&&!yw?xw(n).then((t=>{f(t)})).catch((e=>{if(Oe(e))return yw=!0,void f(p({},n,{compression:void 0,url:Iw(t.url,t.method,void 0,t.timestampMode)}));Le(e)&&(yw=!0),f(n)})):c(n)})(p({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}rl(t){this.nl?this.nl.retriableRequest(t):this._send_request(t)}_execute_array(t){rk++;try{var e,i=[],r=[],n=[];Ui(t,(t=>{if(t)if(G(e=t[0]))n.push(t);else if(Z(t))try{t.call(this)}catch(e){Bi.error("Error executing queued PostHog call",t,e)}else G(t)&&"alias"===e?i.push(t):G(t)&&-1!==e.indexOf("capture")&&Z(this[e])?n.push(t):r.push(t)}));var s=function(t,e){Ui(t,(function(t){try{if(G(t[0])){var i=e;zi(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){Bi.error("Error executing queued PostHog call",t,e)}}))};s(i,this),s(r,this),s(n,this)}finally{rk--}}push(t){if(rk>0&&G(t)&&Y(t[0])){var e=mk.prototype[t[0]];Z(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var r,n,s,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.il){if(this.is_capturing())if(!K(t)&&Y(t)){this.Ho();var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=e&&e.$current_url&&!Y(null==e?void 0:e.$current_url)&&(Bi.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=i&&i._l||Bi.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==i?void 0:i.timestamp)||h,v=xe(null==i?void 0:i.uuid,np),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Hs&&this.config.__preview_capture_bot_pageviews&&l&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),u&&(c.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var f="$feature_flag_called"===t&&!1===c.properties.$feature_flag_has_experiment&&!0===this.get_property(Yn);(null==i?void 0:i.$set)&&!f&&(c.$set=null==i?void 0:i.$set);var g=null==i?void 0:i.$unset;g&&(c.$unset=g);var m=f?void 0:this.wl(null==i?void 0:i.$set_once,t!==Ws,t===zs);if(m&&(c.$set_once=m),null!=i&&i._noTruncate||(n=this.config.properties_string_max_length,s=c,a=t=>Y(t)?t.slice(0,n):t,o=new Set,c=function t(e,i){if(e!==Object(e))return a?a(e):e;if(!o.has(e)){var r;if(o.add(e),G(e))r=[],Ui(e,(e=>{r.push(t(e))}));else{var n={};zi(e,((e,i)=>{o.has(e)||(n[i]=t(e,i))})),r=n}return r}}(s)),c.timestamp=d,K(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=h),f&&(c.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return k.forEach(r),e.forEach(r),i}(c.properties,uk)),t===Nf.DISMISSED||t===Nf.SENT){var y=null==e?void 0:e[qf.SURVEY_ID],b=null==e?void 0:e[qf.SURVEY_ITERATION];Zf({id:y,current_iteration:b}),c.$set=p({},c.$set,{[fo({id:y,current_iteration:b},t===Nf.SENT?"responded":"dismissed")]:!0})}else t===Nf.SHOWN&&(c.$set=p({},c.$set,{[qf.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var _=null==e?void 0:e.$product_tour_type;_&&(c.$set=p({},c.$set,{["$product_tour_last_seen_date/"+_]:(new Date).toISOString()}))}var w=p({},c.properties.$set,c.$set);if(J(w)||this.setPersonPropertiesForFlags(w),!et(this.config.before_send)){var S=this.Rn(c);if(!S)return;(c=S).uuid=xe(c.uuid,np)}this.Do.emit("eventCaptured",c);var x=null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),C={method:"POST",url:x,data:c,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(x)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.rl(C):this.il.enqueue(C),c}Bi.critical("This capture call is ignored due to client rate limiting.")}}else Bi.error("No event name provided to posthog.capture")}else Bi.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}getExtension(t){var e;return null==(e=this.pl)?void 0:e.getExtension(t)}dl(){var t;return null!==(t=this.pl)&&void 0!==t?t:this.pl=new ek(this)}No(t){this.Zo.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.Zo.indexOf(t);-1!==i&&this.Zo.splice(i,1)}}}kl(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.Yo=null,this.persistence.get_property(fs)===$s&&(null==(r=this.sessionPersistence)||r.clear(),this.Vo.clear(),this.Sl()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,i,s,a,o){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return i;this.persistence.syncCookieProperties(),this.kl();var l=o?void 0:this.persistence.remove_event_timer(e),h=p({},i);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Bo()&&(h[ks]=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!Y(h.distinct_id)&&!it(h.distinct_id)||X(h.distinct_id))&&Bi.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var v,c=function(e,i,r,s){var a,o,l,h;if(void 0===s&&(s=!1),!u)return{};var d,v=e?[...Do,...i||[]]:[],c=function(t){for(var e=0;_e.length>e;e++){var i=_e[e],r=i[1],n=i[0].exec(t),s=n&&(Z(r)?r(n,t):r);if(s)return s}return["",""]}(u),f=c[0],p=c[1],g=null!=(d="undefined"!=typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},m={};K(r)||(m.detectGoogleSearchApp=r);var y={},b=null==(a=navigator)||null==(a=a.userAgentData)?void 0:a.platform,_=null==(o=navigator)?void 0:o.maxTouchPoints,w=null==t||null==(l=t.screen)?void 0:l.width,k=null==t||null==(h=t.screen)?void 0:h.height,S=null==t?void 0:t.devicePixelRatio;K(b)||(y.userAgentDataPlatform=b),K(_)||(y.maxTouchPoints=_),K(w)||(y.screenWidth=w),K(k)||(y.screenHeight=k),K(S)||(y.devicePixelRatio=S);var x,C=Wi(Qi({$os:f,$os_version:p,$browser:me(u,navigator.vendor,g,m),$device:we(u),$device_type:ke(u,y),$timezone:Zo(),$timezone_offset:Qo()}),{$current_url:sr(s?Te(null==n?void 0:n.href):null==n?void 0:n.href,v,No),$host:null==n?void 0:n.host,$pathname:null==n?void 0:n.pathname,$raw_user_agent:u.length>1e3?u.substring(0,997)+"...":u,$browser_version:be(u,navigator.vendor,g,m),$browser_language:Uo(),$browser_language_prefix:(x=Uo(),"string"==typeof x?x.split("-")[0]:void 0),$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:qi.LIB_NAME,$lib_version:qi.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return qi.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=qi.SDK_DIST_CHANNEL),C}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var f=this.sessionManager.checkAndGetSessionAndWindowId(o,s.getTime(),!0),g=f.windowId;h.$session_id=f.sessionId,h.$window_id=g}this.sessionPropsManager&&Wi(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Wi(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.nl)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===zw&&(h.$lib_custom_api_host=this.config.api_host),v=e!==Hs||o?e!==Us||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,a),h=Wi(h,v),e===Hs&&r&&(h.title=r.title),!K(l)){var y=s.getTime()-l;h.$duration=parseFloat((y/1e3).toFixed(3))}u&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),_=this.sessionPersistence.properties();zi(["$referrer","$referring_domain"],(t=>{t in b&&delete _[t]}));var w={};if(this.Zo.length>0)for(var k of this.Zo.slice())try{Wi(w,k())}catch(t){Bi.error("Failed to produce browser extension event properties",t)}(h=Wi({},c,b,_,p({},w,h))).$is_identified=this._isIdentified(),G(this.config.property_denylist)?zi(this.config.property_denylist,(function(t){delete h[t]})):Bi.error(lk+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(Bi.error(ok),h=S(h,e));var x=this.xl();return h.$process_person_profile=x,x&&!o&&this.Cl("_calculate_event_properties"),h}wl(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.xl())return t;if(this.Wo&&!i)return t;var n=this.persistence.get_initial_props(),s=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),a=Wi({},n,s||{},t||{}),o=this.config.sanitize_properties;return o&&(Bi.error(ok),a=o(a,"$set_once")),e&&(this.Wo=!0),J(a)?void 0:a}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e,i;null==(e=this.persistence)||e.syncCookieProperties(),this.kl(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach((t=>this.Vo.add(t))),this.Sl()}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t),this.Vo.delete(t),this.Sl()}Tl(t,e){this.register({[t]:e})}sl(){this.Vo.forEach((t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)})),this.Vo.clear(),this.Sl()}Sl(){var t;if(this.Go)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.Js||!xp.Hr())xp.Wr(this.Go);else{var e=[];this.Vo.forEach((t=>e.push(t))),e.length>0?xp.Ur(this.Go,e):xp.Wr(this.Go)}}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e))&&void 0!==i?i:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.Do.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:ak}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:ak})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:ak})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Jf),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:ak}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:ak})}Ml(t){return!t||X(t)?(Bi.critical("Unique user id has not been set in posthog.identify"),!1):t===ws?(Bi.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(Bi.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,i){if(!this.__loaded||!this.persistence)return Bi.uninitializedWarning("posthog.identify");if(it(t)&&(t=t.toString(),Bi.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Ml(t)&&this.Cl("posthog.identify")){this.Ho();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.kl(!1),a=this.persistence.Xs(),o=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property(gn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property(yn)&&(this.unregister(yn),this.register({distinct_id:t}));var u,h=(this.persistence.get_property(fs)||$s)===$s,d=t!==l,v=!d&&h;if(d&&h)this.persistence.set_property(fs,Ns),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.ta(),this.capture(zs,{distinct_id:t,$anon_distinct_id:l},{$set:e||{},$set_once:i||{}}),this.Yo=To(t,e,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(v){this.persistence.set_property(fs,Ns);var c=e||{},f=i||{};this.setPersonPropertiesForFlags({$set:c,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence.ta(),this.capture("$set",{$set:c,$set_once:f}),this.Yo=To(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);d||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(hs)):v&&(e||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.ra(o)}}}setPersonProperties(t,e){if((t||e)&&this.Cl("posthog.setPersonProperties")){var i=To(this.get_distinct_id(),t,e);this.Yo!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Yo=i):Bi.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(G(t)?t:[t]).filter((t=>Y(t)&&t.length>0));0!==i.length&&this.Cl("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Yo=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.kl();var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},n,{[t]:e})}),s||i){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(Ws,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else Bi.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.Cl("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e=nt(t)?t:null==t?void 0:t.resetDeviceID,i=nt(t)||null==t?void 0:t.bootstrap;this.El(e,!1,i)}El(t,e,i){var r,n,s;if(void 0===e&&(e=!1),Bi.info("reset"),!this.__loaded)return Bi.uninitializedWarning("posthog.reset");var a=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.tl)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.xa());var o=this.get_property(gn),l=this.get_property(mn),u=this.get_property(Rn),h=this.is_capturing();this.consent.reset(),e||!h||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var d=null==(s=this.persistence)||null==s.Xs?void 0:s.Xs(),v=!1;try{var c,f,g,m,y,b,_,w,k,S,x,C,T;if(null==(c=this.persistence)||c.clear(),null==(f=this.sessionPersistence)||f.clear(),this.Vo.clear(),this.Sl(),K(u)||null==(S=this.persistence)||S.register({[Rn]:u}),null==(g=this.surveys)||g.reset(),null==(m=this.featureFlags)||m.reset(),null==(y=this.conversations)||y.reset(),null==(b=this.logs)||b.reset(),null==(_=this.metrics)||_.reset(),null==(w=this.persistence)||w.set_property(fs,$s),null==(k=this.sessionManager)||k.resetSessionId(),this.Yo=null,this.config.cookieless_mode===Ds)this.register_once({distinct_id:ws,$device_id:null},"");else{var M=this.config.get_device_id(np());this.register_once({distinct_id:M,$device_id:t?M:o},""),t||K(l)||this.register({[mn]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.Bo()||(null==(T=this.persistence)||T.set_property(fs,i.isIdentifiedID?Ns:$s),this.register({distinct_id:i.distinctID})),null==(x=this.featureFlags)||x.initialize(),!(K(a)||null!=(C=this.sessionManager)&&C.setBootstrapSessionId(a,!0))){var E=p({},i);delete E.sessionID,this.config.bootstrap=E}delete this.config.identity_distinct_id,delete this.config.identity_hash,v=!0}finally{var I;d&&(null==(I=this.persistence)||null==I.ra||I.ra(v))}this.reloadFeatureFlags()}shutdown(t){var e=this;return f((function*(){var t,i,r,n,s;if(e.__loaded){e.dl().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.il)||n.unload(),null==(s=e.nl)||s.unload();try{var a;null==(a=e.featureFlags)||a.destroy()}catch(t){Bi.error("Error while destroying feature flags",t)}}else Bi.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Il()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.Rl()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=e.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&i){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0)}return r}alias(t,e){return t===this.get_property(fn)?(Bi.critical("Attempting to create alias for existing People user - aborting."),-2):this.Cl("posthog.alias")?(K(e)&&(e=this.get_distinct_id()),t!==e?(this.Tl(yn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Bi.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(Q(t)){var i,r,n,s,a,o,l,u,h,d,v,c;Wi(this.config,pk(t));var f=this.Uo();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dw(p({},this.config,{persistence:"sessionStorage"}),f,!1);var g,m=this.Xo(this.config.debug);nt(m)&&(this.config.debug=m),nt(this.config.debug)&&(this.config.debug?(qi.DEBUG=!0,hp.Hr()&&hp.Ur("ph_debug",!0),Bi.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(qi.DEBUG=!1,hp.Hr()&&hp.Wr("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.xa()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(g=this.historyAutocapture)||g.startIfEnabledOrStop()),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(v=this.surveys)||v.loadIfEnabled(),this.zo(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){qi.LIB_NAME=t,qi.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,a=!0===t,o={sampling:a||!(null==t||!t.sampling),linked_flag:a||!(null==t||!t.linked_flag),url_trigger:a||!(null==t||!t.url_trigger),event_trigger:a||!(null==t||!t.event_trigger)};Object.values(o).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),o.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(p({},r,e))}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:mk.Pl}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:hk;return e!==hk&&(e=hk+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(fs))===Ns||(null==(e=this.sessionPersistence)?void 0:e.get_property(fs))===Ns}xl(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===qs&&!this._isIdentified()&&J(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[yn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[_s]))}bl(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.xl()||this.Cl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Cl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Cl(t){return"never"===this.config.person_profiles?(Bi.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Tl(_s,!0),!0)}Uo(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Ls)}zo(){var t,e,i,r,n,s=this.Uo();return this.is_capturing()||null==(i=this.logs)||i.Al(),(null==(t=this.persistence)?void 0:t.Js)!==s&&(null==(r=this.persistence)||r.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.Js)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.Vo.clear(),this.Sl()),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Ds){if(this.Bo()){var i,r,n,s,a;this.El(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new Bw(this),this.pageViewManager=new ew(this),this.persistence&&(this.sessionPropsManager=new $w(this,this.sessionManager,this.persistence));var o,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(a=mk.__defaultExtensionClasses)?void 0:a.sessionRecording;l&&(this.sessionRecording=this.jo(this.sessionRecording,new l(this)),this.Lo&&(null==(o=this.sessionRecording)||null==o.onRemoteConfig||o.onRemoteConfig(this.Lo)))}var u,h;this.consent.optInOut(!0),this.zo(),this.gl(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ls&&(null==(u=this.surveys)||u.loadIfEnabled()),(K(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.ml()}else Bi.warn(sk)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==Ds?(this.config.cookieless_mode===Ls&&this.consent.isOptedIn()&&this.El(!0,!0),this.consent.optInOut(!1),this.zo(),this.config.cookieless_mode===Ls&&(this.register({distinct_id:ws,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.ml(),this.gl())):Bi.warn(sk)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Ds||(this.config.cookieless_mode===Ls?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.zo()}_is_bot(){return i?Hw(i,this.config.custom_blocked_useragents):void 0}ml(){r&&("visible"===r.visibilityState?this.Qo||(this.Qo=!0,this.capture(Hs,{title:r.title},{send_instantly:!0}),this.Jo&&(r.removeEventListener(js,this.Jo),this.Jo=null)):this.Jo||(this.Jo=this.ml.bind(this),Yi(r,js,this.Jo)))}debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==t||t.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}xa(){var t=this.tl||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Bi.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):function(t,e,i,r,n){var s=e in t&&!et(t[e]),a=i in t&&!et(t[i]);return s?t[e]:!!a&&(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,Bi)}Rn(t){var e;if(et(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(ot),r=G(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),et(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return at(t.event)?Bi.warn(a+". This can cause unexpected behavior."):Bi.info(a),null}n.properties&&!J(n.properties)||Bi.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return Bi.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var o of i)if(n.properties&&et(n.properties[o]))return Bi.warn("Event '"+t.event+"' had its '"+o+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.Ps)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Xo(t){var e=nt(t)&&!t,i=hp.Hr()&&"true"===hp.$r("ph_debug");return!e&&(!!i||t)}}mk.__defaultExtensionClasses={},mk.Pl=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Zi(t.prototype[e[i]])}(mk,["identify"]);class yk{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Q(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.xa(),t.url_allowlist=null==i?void 0:i.url_allowlist,t.url_ignorelist=null==i?void 0:i.url_ignorelist,t.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,t.element_allowlist=null==i?void 0:i.element_allowlist,t.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,t.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,t.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,t.capture_copied_text=null==i?void 0:i.capture_copied_text}}var bk=Hi("[ExceptionAutocapture]"),_k=Hi("[TracingHeaders]"),wk=Hi("[Web Vitals]"),kk=9e5,Sk=["CLS","FCP","INP","LCP"],xk=["INP","LCP"],Ck=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Tk="[SessionRecording]",Mk=Hi(Tk),Ek=Hi("[Heatmaps]");function Ik(t){return Q(t)&&"clientX"in t&&"clientY"in t&&it(t.clientX)&&it(t.clientY)}var Rk=Hi("[Product Tours]"),Pk=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(Mn))},Ak=["$set_once","$set"],Fk=Hi("[SiteApps]"),Ok="Error while initializing PostHog app with config id ",Lk=(t,e)=>null!=t&&t.then?t.then(e):e(t),Dk="SDK is not enabled or survey functionality is not yet loaded",$k="Disabled. Not loading surveys.";class Nk{constructor(t,e){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Fl=!1,this.Ol=[],this.Ll=null,this.Dl=null,this.us=!1,this.$l=new Set,this.onRemoteConfig=t=>{if(!this.us&&!this.zi.disableSurveys){if(!t.ok)return Bf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(et(e))return Bf.warn("Flags not loaded yet. Not loading surveys.");this.Nl=nt(e)?e:e.length>0,Bf.info("flags response received, isSurveysEnabled: "+this.Nl),this.loadIfEnabled()}},this.hs=t,this.ql=e}setup(t){if(!this.us)return this.jl=t,Lk(t.kv.initialize(),(()=>{if(this.jl===t&&!this.us){this.jl=void 0,this.cs=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.us?e.dispose():(this.fs=e,this.loadIfEnabled())}}))}dispose(){var t,e,i;this.us||(this.us=!0,this.jl=void 0,this.cs=void 0,null==(t=this.fs)||t.dispose(),this.fs=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Ol=[],this.Ll=null,this.$l.forEach((t=>clearTimeout(t))),this.$l.clear())}get zi(){return this.hs.get()}initialize(){this.loadIfEnabled()}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],i=0;i<localStorage.length;i++){var r=localStorage.key(i);(null!=r&&r.startsWith(zf)||null!=r&&r.startsWith(Wf))&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this.us&&this.cs){var t=this.zi;if(!this._surveyManager)if(this.Fl)Bf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Bf.info($k);else if(t.cookielessMode&&this.hs.isOptedOut())Bf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.hs.getExtensions();if(e){if(!K(this.Nl)||t.advancedEnableSurveys){var i=this.Nl||t.advancedEnableSurveys;this.Fl=!0;try{var r=e.generateSurveys;if(r)return this.Bl(r,i),void(this.Fl=!1);var n=e.loadExternalDependency;if(!n)return this.Hl(Os),void(this.Fl=!1);n((t=>{try{if(this.us)return;var e=this.hs.getExtensions();t||null==e||!e.generateSurveys?this.Hl("Could not load surveys script",t):this.Bl(e.generateSurveys,i)}finally{this.Fl=!1}}))}catch(t){throw this.Fl=!1,this.Hl("Error initializing surveys",t),t}}}else Bf.error("PostHog Extensions not found.")}}}Bl(t,e){this.us||(this._surveyManager=t(e),this._surveyEventReceiver=this.hs.createEventReceiver(),Bf.info("Surveys loaded successfully"),this.Ul({isLoaded:!0}))}Hl(t,e){Bf.error(t,e),this.Ul({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ol.push(t),this._surveyManager&&this.Ul({isLoaded:!0}),()=>{this.Ol=this.Ol.filter((e=>e!==t))}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.cs)&&void 0!==i?i:this.ql;if(r&&!this.us){if(this.zi.disableSurveys)return Bf.info($k),t([]);var n=r.kv.get(ns);if(n&&!e)return t(n,{isLoaded:!0}),void(this.zl()&&this.getSurveys((()=>{}),!0));if(this.Ll)this.Ll.then((e=>{this.us||t(e.surveys,e.context)})).catch((t=>Bf.error("Error in survey callback",t)));else{var s=this.Wl("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.zi.requestTimeoutMs}).then((t=>{try{return this.Vl(r,t)}catch(t){return Bf.error("Error processing surveys response",t),this.Vl(r,{statusCode:0,error:t})}}),(t=>this.Vl(r,{statusCode:0,error:t})));this.Ll=s;var a=()=>{this.Ll===s&&(this.Ll=null)};s.then((e=>{a(),this.us||t(e.surveys,e.context)}),a).catch((t=>Bf.error("Error in survey callback",t)))}}}Wl(t,e){var i=this.cs;return i?i.sendRequest(t,e):new Promise((t=>t({statusCode:0,error:new Error(Dk)})))}Vl(t,e){if(this.us)return{surveys:[],context:{isLoaded:!1,error:Dk}};var i=e.statusCode;if(200!==i||!e.json){var r="Surveys API could not be loaded, status: "+i;return 0!==i?Bf.error(r):e.error||Bf.warn(r),this.Dl=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Dl=null;var n,s=e.json.surveys||[],a=s.filter((t=>Hf(t)&&(_o(t)||Uf(t))));return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),t.kv.set({[ns]:s,[ss]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}zl(){return this.Gl()&&!this.Ll&&!this.Zl()}Gl(){var t,e,i=null==(t=null!==(e=this.cs)&&void 0!==e?e:this.ql)?void 0:t.kv.get(ss);return it(i)&&Date.now()-i>3e5}Zl(){return it(this.Dl)&&3e5>Date.now()-this.Dl}markSurveyAsSeen(t,e){var i,r={id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null};Zf(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}Ul(t){for(var e of this.Ol)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Bf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!et(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Bf.warn("init was not called")}Ql(t){var e=null;return this.getSurveys((i=>{var r;e=null!==(r=i.find((e=>e.id===t)))&&void 0!==r?r:null})),e}Jl(t){if(et(this._surveyManager))return{eligible:!1,reason:Dk};var e="string"==typeof t?this.Ql(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Kl(t){if(et(this._surveyManager))return{eligible:!1,reason:Dk};var e="string"==typeof t?this.Ql(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(et(this._surveyManager))return Bf.warn("init was not called"),{visible:!1,disabledReason:Dk};var e=this.Kl(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return et(this._surveyManager)?(Bf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Dk})):new Promise((i=>{this.getSurveys((e=>{var r,n=null!==(r=e.find((e=>e.id===t)))&&void 0!==r?r:null;if(n){var s=this.Kl(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var n;if(et(this._surveyManager))Bf.warn("init was not called");else{var s="string"==typeof t?this.Ql(t):t;if(null!=s&&s.id)if(Qf.includes(s.type)){var a=null==r?void 0:r.querySelector(e);if(a)if(null!=(n=s.appearance)&&n.surveyPopupDelaySeconds){Bf.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout((()=>{var t,e;this.$l.delete(o),this.us||(Bf.info("Rendering survey "+s.id+" with delay of "+(null==(t=s.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(s,a,i),Bf.info("Survey "+s.id+" rendered"))}),1e3*s.appearance.surveyPopupDelaySeconds);this.$l.add(o)}else this._surveyManager.renderSurvey(s,a,i);else Bf.warn("Survey element not found")}else Bf.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Bf.warn("Survey not found")}}displaySurvey(t,e){var i;if(et(this._surveyManager))Bf.warn("init was not called");else{var r=this.Ql(t);if(r){var n=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(n=p({},r,{appearance:p({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==jf&&e.initialResponses&&Bf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var s=this.Jl(r);if(!s.eligible)return void Bf.warn("Survey is not eligible to be displayed: ",s.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(n,e):this.renderSurvey(n,e.selector,e.properties)}else Bf.warn("Survey not found")}}cancelPendingSurvey(t){et(this._surveyManager)?Bf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}function qk(t,e,i){if(et(t))return!1;switch(i){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class jk{constructor(t){this.Yl=new Set,this.Xl=new Set,this.tu=new Nw,this.eu=(t,e)=>this.iu(t,e)&&this.ru(t,e)&&this.nu(t,e)&&this.su(t,e),this.iu=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t}init(){var t,e;K(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.au=null==(e=this._instance)?void 0:e._addCaptureHook(((t,e)=>{this.on(t,e)})))}dispose(){var t;null==(t=this.au)||t.call(this),this.au=void 0,this.tu=new Nw}register(t){var e,i;if(!K(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e;this.Yl.add(t),null==(e=t.steps)||e.forEach((t=>{this.Xl.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.Yl.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&r.add(t.selector)}))})),this._instance.autocapture.setElementSelectors(r)}}replace(t){this.Yl.clear(),this.Xl.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.Xl.has(t)||this.Xl.has(e.event))&&this.Yl.forEach((t=>{this.ou(e,t)&&this.tu.emit("actionCaptured",t.name)}))}lu(t){this.onAction("actionCaptured",(e=>t(e)))}ou(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.eu(t,i))return!0;return!1}onAction(t,e){return this.tu.on(t,e)}ru(t,e){if(null!=e&&e.url){var i,r=null==t||null==(i=t.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!qk(r,e.url,e.url_matching||"contains"))return!1}return!0}nu(t,e){return!!this.uu(t,e)&&!!this.hu(t,e)&&!!this.du(t,e)}uu(t,e){var i;if(null==e||!e.href)return!0;var r=this.vu(t);if(r.length>0)return r.some((t=>qk(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&qk((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}hu(t,e){var i;if(null==e||!e.text)return!0;var r=this.vu(t);if(r.length>0)return r.some((t=>qk(t.text,e.text,e.text_matching||"exact")||qk(t.$el_text,e.text,e.text_matching||"exact")));var n,s,a,o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!o&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!et(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(o),s=e.text,a=e.text_matching||"exact",n.some((t=>qk(t,s,a))))}du(t,e){var i,r;if(null==e||!e.selector)return!0;var n=null==t||null==(i=t.properties)?void 0:i.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}vu(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}su(t,e){return null==e||!e.properties||0===e.properties.length||Co(e.properties.reduce(((t,e)=>{var i=G(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:i,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Bk{constructor(t){var e;this.cu=[],this._instance=t,this.fu=new Map,this.pu=new Map,this.gu=new Map,this.mu=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId((t=>this.yu(t)))}bu(t){return!1}_u(){return null}wu(t){}ku(){}Su(t,e){return!!t&&Co(t.propertyFilters,null==e?void 0:e.properties)}xu(t,e){var i=new Map;return t.forEach((t=>{var r;null==(r=t.conditions)||null==(r=r[e])||null==(r=r.values)||r.forEach((e=>{if(null!=e&&e.name){var r=i.get(e.name)||[];r.push(t.id),i.set(e.name,r)}}))})),i}Cu(t,e,i){var r=(i===If?this.fu:this.pu).get(t),n=[];return this.Tu((t=>{n=t.filter((t=>null==r?void 0:r.includes(t.id)))})),n.filter((r=>{var n,s=null==(n=r.conditions)||null==(n=n[i])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Su(s,e)}))}register(t){this.Mu(t,!1)}replace(t){this.Mu(t,!0)}Mu(t,e){var i;K(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Eu(t,e),this.Iu(t,e))}Iu(t,e){var i=t.filter((t=>{var e;return null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)?void 0:e.length}));if(e&&this.gu.clear(),0!==i.length){this.Ru||(this.Ru=new jk(this._instance),this.Ru.init(),this.Ru.lu((t=>this.onAction(t))));var r=[];i.forEach((t=>{var e;null==(e=t.conditions)||null==(e=e.actions)||e.values.forEach((e=>{if(r.push(e),e.name){var i,n=null!==(i=this.gu.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.gu.set(e.name,n)}}))})),e?this.Ru.replace(r):this.Ru.register(r)}else{var n;e&&(null==(n=this.Ru)||n.replace([]))}}Pu(t,e){e.forEach(((e,i)=>{var r,n=null!==(r=t.get(i))&&void 0!==r?r:[];e.forEach((t=>{n.includes(t)||n.push(t)})),t.set(i,n)}))}Eu(t,e){var i,r,n=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})),s=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0})),a=this.xu(t,If),o=this.xu(t,Rf);e?(this.fu=a,this.pu=o):(this.Pu(this.fu,a),this.Pu(this.pu,o)),(0!==n.length||0!==s.length)&&(null!==(i=this.au)&&void 0!==i||(this.au=null==(r=this._instance)?void 0:r._addCaptureHook(((t,e)=>{this.onEvent(t,e)}))))}onEvent(t,e){var i,r,n=this.Au(),s=(null==e||null==(i=e.properties)?void 0:i.$survey_id)||(null==e||null==(r=e.properties)?void 0:r.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var a=this.Fu(t,s);if("consume"===a)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Ou([s]);if("persist"===a)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Lu(s),void this.Du([s])}if(this.pu.has(t)){var o=this.Cu(t,e,Rf);o.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:o.map((t=>t.id))}),this.Ou(o.map((t=>t.id))),o.forEach((t=>this.$u(t.id))))}if(this.fu.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.fu.get(t)});var l=this.Cu(t,e,If);this.Nu(l.map((t=>t.id)))}}onAction(t){this.gu.has(t)&&this.Nu(this.gu.get(t)||[])}Nu(t){var e;if(0!==t.length){var i=!(null==(e=this._instance)||null==e.get_session_id||!e.get_session_id()),r=[];for(var n of t)i&&this.bu(n)?this.Lu(n)&&this.qu(n):r.push(n);r.length>0&&(this.cu=[...new Set([...this.cu,...r])]),this.Au().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Lu(t){this.cu=this.cu.filter((e=>e!==t));var e=this.ju();return!e.includes(t)&&(this.Bu([...e,t]),this.Hu(),!0)}Ou(t){var e=new Set(t);this.cu=this.cu.filter((t=>!e.has(t)));var i=this.Uu(),r=i.filter((t=>!e.has(t)));r.length!==i.length&&(this.Bu(r),0===r.length&&this.zu()),this.Du(t)}Wu(){var t,e=this._u();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}qu(t){if(this._u()){var e=this.Wu();this.wu(p({},e,{[t]:Date.now()}))}}Du(t){if(this._u()){var e=this.Wu(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],a=n[1];t.includes(s)?r=!0:i[s]=a}r&&(J(i)?this.ku():this.wu(i))}}Vu(){this._u()&&this.ku()}getActivationTimestamp(t){if(this.ju().includes(t)){var e=this.Wu()[t];return it(e)?e:void 0}}Uu(){var t,e=this.Gu();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}ju(){var t,e,i=this.Uu();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Zu()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}Hu(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Qu(e)}zu(){this.Ju()}yu(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Zu()];if(i&&i!==t){var r=this.Uu(),n=this.Wu();r.length>0&&(this.Bu([]),r.filter((t=>it(n[t]))).forEach((t=>this.$u(t)))),this.zu(),this.Vu()}}getActivatedIds(){return[...new Set([...this.ju(),...this.cu])].filter((t=>!this.Ku(t)))}dispose(){var t,e,i;null==(t=this.mu)||t.call(this),this.mu=void 0,null==(e=this.au)||e.call(this),this.au=void 0,null==(i=this.Ru)||i.dispose(),this.Ru=void 0}reset(){this.cu=[],this.Uu().length>0&&this.Bu([]),this.zu(),this.Vu()}getEventToItemsMap(){return this.fu}Yu(){return this.Ru}}class Hk extends Bk{constructor(t){super(t)}Gu(){return as}Zu(){return os}_u(){return ls}wu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ls]:t})}ku(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ls)}bu(t){var e,i;this.Tu((e=>{i=e.find((e=>e.id===t))}));var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return it(r)&&r>0}Xu(){return Nf.SHOWN}Tu(t){var e;null==(e=this._instance)||e.getSurveys(t)}$u(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Au(){return Bf}Bu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[as]:t})}Qu(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[os]:t})}Ju(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(os)}Ku(){return!1}Fu(t,e){var i;return this.Tu((t=>{i=t.find((t=>t.id===e))})),!i||wo(i)?t===Nf.SHOWN?"consume":"ignore":t===Nf.SHOWN?"persist":t===Nf.DISMISSED||t===Nf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Uk{constructor(t){this._instance=t}initialize(){}get(t){if("string"==typeof t)return this._instance.get_property(t);var e={};for(var i of t){var r=this._instance.get_property(i);K(r)||(e[i]=r)}return e}set(t,e){this._instance.register("string"==typeof t?{[t]:e}:t)}remove(t){"string"!=typeof t?t.forEach((t=>this._instance.unregister(t))):this._instance.unregister(t)}}class zk{constructor(t){this._instance=t}get(){var t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}getExtensions(){var t=null==v?void 0:v.__PosthogExtensions__;if(t){var e=t.generateSurveys,i=t.loadExternalDependency;return{generateSurveys:e?t=>e(this._instance,t):void 0,loadExternalDependency:i?t=>i(this._instance,"surveys",t):void 0}}}createEventReceiver(){return new Hk(this._instance)}}var Wk=null!=t&&t.location?ar(t.location.hash,"__posthog")||ar(location.hash,"state"):null,Vk="_postHogToolbarParams",Gk=Hi("[Toolbar]"),Zk=Hi("[FeatureFlags]");class Qk{constructor(t,e){void 0===e&&(e=!1),this.th=!1,this.update(t,e)}update(t,e){this.eh=((t,e)=>{var i,r,n,s,a;return{bootstrap:{featureFlags:null==(i=t.bootstrap)?void 0:i.featureFlags,featureFlagPayloads:null==(r=t.bootstrap)?void 0:r.featureFlagPayloads},remoteRequestsDisabled:e,featureFlagsDisabled:!!t.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!t.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!t.advanced_feature_flags_dedup_per_session,cacheTtlMs:t.feature_flag_cache_ttl_ms,refreshIntervalMs:null!==(n=t.remote_config_refresh_interval_ms)&&void 0!==n?n:3e5,requestTimeoutMs:t.feature_flag_request_timeout_ms,compression:t.disable_compression?void 0:"best-available",evaluationContexts:null!==(s=null!==(a=t.evaluation_contexts)&&void 0!==a?a:t.evaluation_environments)&&void 0!==s?s:[],flagKeys:G(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.th||(Zk.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.th=!0),K(t.flag_keys)||G(t.flag_keys)||Zk.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.eh}}var Jk=Hi("[FeatureFlags]"),Kk=Hi("[FeatureFlags]",{debugEnabled:!0}),Yk="\" failed. Feature flags didn't load in time.",Xk="connection_error",tS=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},eS=t=>{var e={};for(var i of Vi(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},iS="Refusing to render web experiment since the viewer is a likely bot",rS={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>ko(e,t),not_regex:(t,e)=>!ko(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class nS{get zi(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{nS.ih("retrieved web experiments from the server"),e.rh=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.rh&&(nS.ih("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.rh)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);Y(r)&&t.variants[r]&&e.nh(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];nS.sh(s,e._instance)&&e.nh(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())nS.ih(iS);else if(!this.zi.disable_web_experiments){if(et(this.rh))return this.rh=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nS.ih("applying feature flags",t),t.forEach((t=>{var e;if(this.rh&&null!=(e=this.rh)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.rh)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.nh(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=nS.getWindowLocation();if(null!=t&&t.search){var e=nr(null==t?void 0:t.search,"__experiment_id"),i=nr(null==t?void 0:t.search,"__experiment_variant");e&&i&&(nS.ih("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.ah(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.zi.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.zi.disable_web_experiments&&!i)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.zi.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}ah(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(nS.ih("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.nh(r[0].name,e,r[0].variants[e].transforms))}static sh(t,e){return!et(t.conditions)&&nS.oh(t,e)&&nS.lh(t)}static oh(t,e){var i;if(et(t.conditions)||et(null==(i=t.conditions)?void 0:i.url))return!0;var r=nS.getWindowLocation();if(r){var n,s,a,o=ur(e,r.href);return null==(n=t.conditions)||!n.url||rS[null!==(s=null==(a=t.conditions)?void 0:a.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,o)}return!1}static getWindowLocation(){return null==t?void 0:t.location}static lh(t){var e;if(et(t.conditions)||et(null==(e=t.conditions)?void 0:e.utm))return!0;var i=jo();if(i.utm_source){var r,n,s,a,o,l,u,h,d=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,v=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(a=t.conditions)||null==(a=a.utm)?void 0:a.utm_source)==i.utm_source,c=null==(o=t.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return d&&c&&f&&v}return!1}static ih(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];Bi.info("[WebExperiments] "+t,i)}nh(t,e,i){this._is_bot()?nS.ih(iS):"control"!==e?i.forEach((i=>{if(i.selector){var r;nS.ih("applying transform of variant "+e+" for experiment "+t+" ",i);var n=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==n||n.forEach((t=>{var e=t;i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}))}})):nS.ih("Control variants leave the page unmodified.")}_is_bot(){return i&&this._instance?Hw(i,this.zi.custom_blocked_useragents):void 0}}var sS=Hi("[Conversations]"),aS="Conversations not available yet.";function oS(t,e){var i,r,n,s,a,o,l,u=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,h=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,v=K(d)?Math.max(h,2048):Math.max(h,d),c=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(a=null==c?void 0:c["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(o=null==c?void 0:c["service.version"])&&void 0!==o?o:null==t?void 0:t.serviceVersion,environment:null!==(l=null==c?void 0:c["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:c,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var lS=["debug","log","warn","error","info"],uS="console",hS="__posthogHandledLogsRequestError",dS=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[hS]=!0,i},vS=t=>!!t&&"object"==typeof t&&!0===t[hS],cS={featureFlags:class{constructor(t){this.name=Kf,this.uh=!1,this.featureFlagEventHandlers=[],this.I=Jk,this.hh={},this.dh={},this.fh=[],this.ph=!1,this.gh=!1,this.mh=0,this.yh=!1,this.bh=!1,this._h=!1,this.wh=!1,this.kh=0,this.Et=()=>{var t=this.Sh();this.kh=0,t&&this.reloadFeatureFlags()},this.xh=()=>{var t,e=this.Ch;K(e)||this.zi.remoteRequestsDisabled||!r||"hidden"===r.visibilityState||Date.now()-(null!==(t=this.Th)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.Mh())},this.At=()=>{"visible"===(null==r?void 0:r.visibilityState)&&this.xh()},"get"in t?this.hs=t:(this.Eh=new Qk(t.config,t.xa()),this.hs=this.Eh)}updateConfig(t,e){var i;null==(i=this.Eh)||i.update(t,e),this.cs&&this.Ih()}setup(t){return this.jl=t,this.I=t.logger.createLogger("[FeatureFlags]"),Lk(t.kv.initialize(),(()=>{this.jl===t&&(this.jl=void 0,this.cs=t,this.Rh(t))}))}Rh(e){if(this.cs===e)return t&&Yi(t,"online",this.Et),this.Ih(),this.Ph=e.registerDynamicEventProperties((()=>this.Ah()?this.hh:this.dh)),this.Fh(),this.initialize()}Ih(){var t=this.zi.refreshIntervalMs,e=!this.zi.remoteRequestsDisabled&&r&&!K(t)&&t>0?t:void 0;e!==this.Ch&&(this.Oh(),K(e)||(this.Ch=e,this.Mh(),null!=r&&r.addEventListener&&Yi(r,js,this.At)))}Mh(){K(this.Ch)||(K(this.Lh)||clearInterval(this.Lh),this.Th=Date.now(),this.Lh=setInterval(this.xh,this.Ch))}Oh(){K(this.Lh)||(clearInterval(this.Lh),this.Lh=void 0,null==r||null==r.removeEventListener||r.removeEventListener(js,this.At)),this.Ch=void 0,this.Th=void 0}destroy(){this.Dh()}dispose(){this.Dh()}Dh(){var e;this.Oh(),this.mh++,this.bh=!1,this.jl=void 0,this.cs&&(this.$h(),null==(e=this.Ph)||e.dispose(),this.Ph=void 0,this.fh=[],null==t||t.removeEventListener("online",this.Et),this.cs=void 0)}get zi(){return this.hs.get()}Nh(t){var e;return null==(e=this.cs)?void 0:e.kv.get(t)}Ur(t){this.qh((()=>{var e;return null==(e=this.cs)?void 0:e.kv.set(t)}))}Wr(t){this.qh((()=>{var e;return null==(e=this.cs)?void 0:e.kv.remove(t)}))}qh(t){try{t()}catch(t){this.I.error("Failed to update feature flag persistence",t)}}Fh(){var t={};for(var e of[Gn,Jn,Kn,Xn]){var i=this.Nh(e);K(i)||(t[e]=i)}this.hh=t;var r=p({},t),n=this.Nh(Vn);if(n)for(var s of Object.entries(n))r["$feature/"+s[0]]=s[1];this.dh=r}Ah(){var t=this.zi.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Nh(cs);return"number"!=typeof e||Date.now()-e>t}jh(){return!!this.Ah()&&(this.wh||this.gh||(this.wh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Bh(){var t=this.zi.evaluationContexts;return null!=t&&t.length?t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.I.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}Hh(){var t=this.zi.flagKeys;if(!K(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.I.error("Invalid flag key found:",t,"Expected non-empty string"),e}))}initialize(){var t,e,i=this.zi,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,a=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},o=Object.keys(r).filter((t=>!!r[t])).reduce(((t,e)=>(t[e]=r[e]||!1,t)),{}),l=Object.keys(a).filter((t=>o[t])).reduce(((t,e)=>(t[e]=a[e],t)),{});return this.Uh({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,i){var r,n,s=null!=i&&i.merge&&null!==(r=this.Nh(Vn))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(n=this.Nh(Jn))&&void 0!==n?n:{},o=p({},s,t),l=p({},a,e),u={};for(var h of Object.entries(o)){var d=h[0],v=h[1];u[d]={key:d,enabled:_(v),variant:w(v),reason:void 0,metadata:K(null==l?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.Uh({flags:u})}get hasLoadedFlags(){return this.ph}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Nh(Qn),e=this.Nh(Xn),i=this.Nh(ts);if(!i&&!e)return t||{};var r=Wi({},t||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var s of n){var a,o,l=r[s],u=null==e?void 0:e[s],h=K(u)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!u,d=K(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,v=null==i?void 0:i[s],c=p({},l,{enabled:h,variant:h?null!=d?d:null==l?void 0:l.variant:void 0});h!==(null==l?void 0:l.enabled)&&(c.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(c.original_variant=null==l?void 0:l.variant),v&&(c.metadata=p({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(o=l.metadata)?void 0:o.payload})),r[s]=c}return this.uh||(this.I.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.uh=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((i=>{var r=t[i];return{key:i,enabled:_(r),variant:w(r),payload:b(e[i])}}))}getFlagVariants(){var t=this.Nh(Vn),e=this.Nh(Xn);if(!e)return t||{};for(var i=Wi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.uh||(this.I.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.uh=!0),i}getFlagPayloads(){var t=this.Nh(Jn),e=this.Nh(ts);if(!e)return t||{};for(var i=Wi({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.uh||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.uh=!0),i}reloadFeatureFlags(){this.yh||this.zi.featureFlagsDisabled||this.Sh()||this.zh||(this.fh.slice().forEach((t=>{try{t()}catch(t){this.I.error("Error while running feature flags reloading callback",t)}})),this.zh=setTimeout((()=>{this.Wh()}),5))}$h(){clearTimeout(this.zh),this.zh=void 0}onReloading(t){return this.fh.push(t),()=>{this.fh=this.fh.filter((e=>e!==t))}}ensureFlagsLoaded(){this.ph||this.gh||this.zh||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.yh=t}resetFlagCallReported(){this.Wr(hs)}Wh(t){this.$h();var e=this.cs;if(e&&!this.zi.remoteRequestsDisabled&&!this.Sh())if(this.gh)this.bh=!0;else{var i={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:p({},e.initialPersonProperties,this.Nh(es)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Nh(is),timezone:Zo()};K(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.zi.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.Bh();r.length&&(i.evaluation_contexts=r);var n=this.Hh();K(n)||(i.flag_keys=n);var s=this.zi.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),o=this.mh;this.gh=!0;var l=()=>{this.bh&&(this.bh=!1,this.Wh())},u=t=>{this.gh=!1,o===this.mh?(this.Ur({[vs]:[Xk]}),this.I.error("Feature flag request failed",t),l()):l()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.zi.compression,sentAt:"body",timeoutMs:this.zi.requestTimeoutMs}).then((t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},a=200!==t.statusCode;if(this.gh=!1,o===this.mh){if(this.Vh(t.statusCode),a||this.bh||(this.$anon_distinct_id=void 0),!i.disable_flags||this.bh){this._h=!a;var u=[];t.error?u.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Xk:"unknown_error"):200!==t.statusCode&&u.push("api_error_"+t.statusCode),n.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(r=n.quotaLimited)||!r.includes("feature_flags"));h&&u.push("quota_limited"),this.Ur({[vs]:u}),h?this.I.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||this.Uh(n,a,{partialResponse:s}),l()}}else l()})).catch(u)}catch(t){u(t)}}}Sh(){return or(this.kh,3)}Vh(t){this.kh=lr(t,this.kh,3,(()=>this.I.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var i;if(void 0===e&&(e={}),!e.fresh||this._h)if(this.ph||this.getFlags()&&this.getFlags().length>0){if(!this.jh()){var r=this.getFeatureFlagResult(t,e);return null!==(i=null==r?void 0:r.variant)&&void 0!==i?i:null==r?void 0:r.enabled}}else this.I.warn('getFeatureFlag for key "'+t+Yk)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this._h)if(this.ph||this.getFlags()&&this.getFlags().length>0){if(!this.jh()){var i,r=this.getFlagVariants(),n=t in r,s=r[t],a=this.getFlagPayloads()[t],o=String(s),l=this.Nh(Kn)||void 0,u=this.Nh(cs)||void 0,h=this.Nh(hs)||{};if(this.zi.deduplicateCallsPerSession){var d,v=null==(d=this.cs)?void 0:d.session.sessionId,c=this.Nh(ds);v&&v!==c&&(h={},i=v)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(o))i&&this.Ur({[hs]:h,[ds]:i});else{var f,g,m,y,_,w,k,S,x,C,T,M;G(h[t])?h[t].push(o):h[t]=[o],this.Ur(p({[hs]:h},i?{[ds]:i}:{}));var E=this.getFeatureFlagDetails(t),I=[...null!==(f=this.Nh(vs))&&void 0!==f?f:[]];K(s)&&I.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!==(g=null==(m=this.zi.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(_=this.zi.bootstrap)||null==(_=_.featureFlagPayloads)?void 0:_[t])&&void 0!==y?y:null,$used_bootstrap_value:!this._h};K(null==E||null==(w=E.metadata)?void 0:w.has_experiment)||(R.$feature_flag_has_experiment=E.metadata.has_experiment),K(null==E||null==(k=E.metadata)?void 0:k.version)||(R.$feature_flag_version=E.metadata.version);var P,A=null!==(S=null==E||null==(x=E.reason)?void 0:x.description)&&void 0!==S?S:null==E||null==(C=E.reason)?void 0:C.code;A&&(R.$feature_flag_reason=A),null!=E&&null!=(T=E.metadata)&&T.id&&(R.$feature_flag_id=E.metadata.id),K(null==E?void 0:E.original_variant)&&K(null==E?void 0:E.original_enabled)||(R.$feature_flag_original_response=K(E.original_variant)?E.original_enabled:E.original_variant),null!=E&&null!=(M=E.metadata)&&M.original_payload&&(R.$feature_flag_original_payload=null==E||null==(P=E.metadata)?void 0:P.original_payload),I.length&&(R.$feature_flag_error=I.join(",")),this.Gh(R)}else i&&this.Ur({[hs]:h,[ds]:i});if(n)return{key:t,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:b(a)}}}else this.I.warn('getFeatureFlagResult for key "'+t+Yk)}Gh(t){try{var e;null==(e=this.cs)||e.capture("$feature_flag_called",t).catch((t=>{this.I.error("Failed to capture feature flag call",t)}))}catch(t){this.I.error("Failed to capture feature flag call",t)}}getRemoteConfigPayload(t,e){this.Zh(t,e)}Zh(t,e){var i=this;return f((function*(){var r=i.cs;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.Bh();s.length&&(n.evaluation_contexts=s);var a,o=i.Hh();K(o)||(n.flag_keys=o);try{var l,u=null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.zi.compression,sentAt:"body",timeoutMs:i.zi.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;a=(null==u?void 0:u[t])||void 0}catch(t){return void i.I.error("Remote config feature flag request failed",t)}try{e(a)}catch(t){i.I.error("Remote config feature flag callback failed",t)}}}))()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this._h)return e.defaultValue;if(!(this.ph||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+t+Yk),e.defaultValue;var i=this.getFeatureFlag(t,e);return K(i)?e.defaultValue:!!i}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){this.Uh(t,e,i)}Uh(t,e,i){if(this.cs){this.ph=!0;var r=function(t,e,i,r,n,s){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s=Jk);var a=((t,e)=>{var i=t.flags;return i?p({},t,{featureFlags:Object.fromEntries(Object.keys(i).map((t=>{var e;return[t,null!==(e=i[t].variant)&&void 0!==e?e:i[t].enabled]}))),featureFlagPayloads:Object.fromEntries(Object.keys(i).filter((t=>i[t].enabled)).filter((t=>{var e;return null==(e=i[t].metadata)?void 0:e.payload})).map((t=>{var e;return[t,null==(e=i[t].metadata)?void 0:e.payload]})))}):(t.featureFlags&&e.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t)})(t,s),o=a.flags,l=a.featureFlags,u=a.featureFlagPayloads;if(l){var h=t.requestId,d=t.evaluatedAt;if(G(l)){s.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(l)for(var c=0;l.length>c;c++)v[l[c]]=!0;return{[Gn]:l,[Vn]:v,[Yn]:!1}}var f=l,g=u,m=o;if(null!=n&&n.partialResponse)f=p({},e,f),g=p({},i,g),m=p({},r,m);else if(t.errorsWhileComputingFlags)if(o){var y=new Set(Object.keys(o).filter((t=>{var e;return!(null!=(e=o[t])&&e.failed)})));f=p({},e,Object.fromEntries(Object.entries(f).filter((t=>y.has(t[0]))))),g=p({},i,Object.fromEntries(Object.entries(g||{}).filter((t=>y.has(t[0]))))),m=p({},r,Object.fromEntries(Object.entries(m||{}).filter((t=>y.has(t[0])))))}else f=p({},e,f),g=p({},i,g),m=p({},r,m);return p({[Gn]:Object.keys(eS(f)),[Vn]:f||{},[Jn]:g||{},[Qn]:m||{},[Yn]:!0===t.minimalFlagCalledEvents},h?{[Kn]:h}:{},d?{[cs]:d}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.I);r&&this.Ur(r),e||(this.wh=!1),this.Qh(e)}}override(t,e){void 0===e&&(e=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Jh(t)}Jh(t){if(this.cs){if(!1===t)return this.Wr([Xn,ts]),this.Qh(),void Kk.info("All overrides cleared");if(G(t))return this.Ur({[Xn]:tS(t)}),this.Qh(),void Kk.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.uh=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[Xn]=G(n)?tS(n):n),s&&(r[ts]=s),Object.keys(r).length&&this.Ur(r),!1===n&&!1===s?this.Wr([Xn,ts]):!1===n?this.Wr(Xn):!1===s&&this.Wr(ts),this.Qh(),!1===n?Kk.info("Flag overrides cleared"):n&&Kk.info("Flag overrides set",{flags:n}),void(!1===s?Kk.info("Payload overrides cleared"):s&&Kk.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.Ur({[Xn]:t}),this.Qh(),void Kk.info("Flag overrides set",{flags:t});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ph){var e=this.Kh(),i=e.flags,r=e.flagVariants;try{t(i,r)}catch(t){this.I.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var r=(this.Nh(Zn)||[]).find((e=>e.flagKey===t)),n={["$feature_enrollment/"+t]:e},s={$feature_flag:t,$feature_enrollment:e,$set:n};r&&(s.$early_access_feature_name=r.name),i&&(s.$feature_enrollment_stage=i);var a=p({},this.getFlagVariants(),{[t]:e});this.Ur({[Gn]:Object.keys(eS(a)),[Vn]:a,[es]:p({},this.Nh(es)||{},n)}),this.Qh();try{var o;null==(o=this.cs)||o.capture("$feature_enrollment_update",s).catch((t=>{this.I.error("Failed to capture early access feature enrollment",t)}))}catch(t){this.I.error("Failed to capture early access feature enrollment",t)}}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.Nh(Zn);!r||e?this.Yh(t,i):t(r)}Yh(t,e){var i=this;return f((function*(){var r=i.cs;if(r){var n,s=e?"&"+e.map((t=>"stage="+t)).join("&"):"";try{var a=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;i.Ur({[Zn]:n=a.json.earlyAccessFeatures})}catch(t){return void i.I.error("Early access feature request failed",t)}try{t(n)}catch(t){i.I.error("Early access feature callback failed",t)}}}))()}Kh(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,i)=>(t[i]=e[i],t)),{})}}Qh(t){this.Fh();var e=this.Kh(),i=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((e=>{try{e(i,r,{errorsLoading:t})}catch(t){this.I.error("Error while running feature flags callback",t)}}))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.Xh(t,e)}Xh(t,e){void 0===e&&(e=!0);var i=this.Nh(es)||{},r=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),n=null==t?void 0:t.$set_once,s={};if(n)for(var a in n)({}).hasOwnProperty.call(n,a)&&(a in i||(s[a]=n[a]));this.Ur({[es]:p({},i,s,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=p({},this.Nh(es)||{});t.forEach((t=>{delete i[t]})),this.Ur({[es]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.Wr(es),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Nh(is)||{},r=p({},i);for(var n of Object.keys(t))r[n]=p({},i[n],t[n]);this.Ur({[is]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Nh(is)||{};this.Ur({[is]:p({},e,{[t]:{}})})}else this.Wr(is)}reset(){this.mh++,this.bh=!1,this.hh={},this.dh={},this.ph=!1,this.yh=!1,this._h=!1,this.$anon_distinct_id=void 0,this.$h(),this.uh=!1,this.kh=0}}},fS={sessionRecording:class{get zi(){return this._instance.config}get Ja(){return this._instance.persistence}get started(){var t;return!(null==(t=this.td)||!t.isStarted)}get status(){var t,e;return this.ed===Ys||this.ed===Xs?this.ed:null!==(t=null==(e=this.td)?void 0:e.status)&&void 0!==t?t:this.ed}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.ed=Vs,this.rd=void 0,this.nd=!1,this.St=(()=>{var e;if(null==r||!r.visibilityState||"visible"===r.visibilityState)return!0;var i=null==t||null==(e=t.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=i&&i.length)||i.some((t=>"visible"===t.name))})(),this.At=()=>{var t;"visible"===(null==r?void 0:r.visibilityState)&&(this.St=!0,null==(t=this.td)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw Mk.error("started without valid sessionManager"),new Error(Tk+" started without valid sessionManager. This is a bug.");if(this.zi.cookieless_mode===Ds)throw new Error(Tk+' cannot be used with cookieless_mode="always"');null!=r&&r.addEventListener&&Yi(r,"visibilitychange",this.At)}initialize(){this.startIfEnabledOrStop()}dispose(){this.nd=!0,null==r||null==r.removeEventListener||r.removeEventListener("visibilitychange",this.At),this.stopRecording()}get sd(){var e,i=!(null==(e=this._instance.get_property(Rn))||!e.enabled),r=!this.zi.disable_session_recording,n=this.zi.disable_session_recording||this._instance.consent.isOptedOut();return t&&i&&r&&!n}startIfEnabledOrStop(t){var e;if(!(this.nd||this.sd&&null!=(e=this.td)&&e.isStarted)){var i=!K(Object.assign)&&!K(Array.from);this.sd&&i?(this.ad(t),Mk.info("starting")):(this.ed=Vs,this.stopRecording())}}ad(t){var e,i,r;this.sd&&(this.ed!==Ys&&this.ed!==Xs&&(this.ed=Ks),null!=v&&null!=(e=v.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording?this.od(t):null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.ld,(e=>{if(e)return this._instance.register_for_session({[Cs]:!0}),Mk.error("could not load recorder",e);this.od(t)})))}stopRecording(){var t,e;null==(t=this.rd)||t.call(this),this.rd=void 0,null==(e=this.td)||e.stop()}ud(){var t,e;null==(t=this.rd)||t.call(this),this.rd=void 0,null==(e=this.td)||e.discard()}hd(){var t,e;null==(t=this.Ja)||t.unregister($n),null==(e=this.Ja)||e.unregister(Pn)}dd(t,e){if(et(t))return null;var i,r=it(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(Mk.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}vd(t){if(this.Ja){var e,i,r=this.Ja,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=this.dd(null==(e=this.zi.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),s=this.dd(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=n?n:s;et(a)&&this.hd();var o=null==i?void 0:i.minimumDurationMilliseconds;r.register({[Rn]:p({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:p({capturePerformance:t.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:K(o)?null:o,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})})};n(),null==(e=this.rd)||e.call(this),this.rd=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(n)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.vd(e),void this.ud()):(this.vd(e),void this.startIfEnabledOrStop()):(this.ed===Ys&&(this.ed=Xs,Mk.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var i;void 0===e&&(e="log"),null!=(i=this.td)&&i.log?this.td.log(t,e):Mk.warn("log called before recorder was ready")}get ld(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Rn);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}fd(){var t,e=this._instance.get_property(Rn);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return Mk.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!et(t.cache_timestamp)&&Date.now()-t.cache_timestamp<=_l}od(t){var e,i,r;if(!this.nd){if(null==(e=v.__PosthogExtensions__)||!e.initSessionRecording)return Mk.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Cs]:!0});var n;if(this.td||(this.td=null==(n=v.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.St),this.td._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fd()){if(this.ed===Xs||this.ed===Ys)return;return this.ed=Ys,Mk.info("persisted remote config is stale, requesting fresh config before starting"),void new pw(this._instance).load()}this.ed=Ks,null==(i=(r=this.td).setDocumentWasEverVisible)||i.call(r,this.St),this.td.start(t)}}onRRwebEmit(t){var e;null==(e=this.td)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.td||null==(e=this.Ja)||e.register({[Fn]:!0}),null==(t=this.td)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.td||null==(e=this.Ja)||e.register({[An]:!0}),null==(t=this.td)||t.overrideSampling()}overrideTrigger(t){var e,i;this.td||null==(i=this.Ja)||i.register({["url"===t?On:Ln]:!0}),null==(e=this.td)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.td)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.td)||!i.tryAddCustomEvent(t,e))}}},pS={autocapture:class extends I_{constructor(t){super(new yk(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.pd=this.gd()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.md();return!!(t.path||t.search||this.yd(t))}startIfEnabled(){this.isEnabled&&(Bi.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.pd=this.gd(),this.startIfEnabled()}stop(){this.bd&&this.bd(),this.bd=void 0,this._d&&this._d(),this._d=void 0,Bi.info("History API monitoring stopped")}monitorHistoryChanges(){t&&t.history&&(this.wd("pushState"),this.wd("replaceState"),this.kd(),this.yd()&&this.Sd())}wd(e){var i;if(t&&(null==(i=t.history[e])||!i.__posthog_wrapped__)){var r=this;Dv(t.history,e,(t=>function(i,n,s){t.call(this,i,n,s),r.xd(e)}))}}gd(){var e=null==t?void 0:t.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}md(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:Q(t)?t:{}}yd(t){return void 0===t&&(t=this.md()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Cd(t){var e=this.md(),i=this.pd;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.yd(e)&&t.hash!==i.hash))}xd(t){try{var e=this.gd();if(!e)return;this.Cd(e)&&this._instance.capture(Hs,{navigation_type:t}),this.pd=e}catch(e){Bi.error("Error capturing "+t+" pageview",e)}}kd(){if(!this.bd){var e=()=>{this.xd("popstate")};Yi(t,"popstate",e),this.bd=()=>{t&&t.removeEventListener("popstate",e)}}}Sd(){if(!this._d){var e=()=>{this.xd("hashchange")};Yi(t,"hashchange",e),this._d=()=>{t&&t.removeEventListener("hashchange",e)}}}},heatmaps:class{get zi(){return this.instance.config}constructor(t){var e;this.Td=!1,this.ns=!1,this.Md=null,this.instance=t,this.Td=!(null==(e=this.instance.persistence)||!e.props[wn]),this.rageclicks=new S_(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Q(this.zi.capture_heatmaps)&&this.zi.capture_heatmaps.flush_interval_milliseconds&&(t=this.zi.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return et(this.zi.capture_heatmaps)?et(this.zi.enable_heatmaps)?this.Td:this.zi.enable_heatmaps:!1!==this.zi.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ns)return;Ek.info("starting..."),this.Ed(),this.At()}else{var t;clearInterval(null!==(t=this.Md)&&void 0!==t?t:void 0),this.Id(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var i=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[wn]:i}),this.Td=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.bt;return this.bt=void 0,t}Rd(t){Ik(t.originalEvent)&&this.Ei(t.originalEvent,"deadclick")}At(){this.Md&&clearInterval(this.Md),this.Md=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(r)?setInterval(this.ja.bind(this),this.flushIntervalMilliseconds):null}Ed(){t&&r&&(this.Pd=this.ja.bind(this),Yi(t,Bs,this.Pd),this.Ad=e=>this.Ei(e||(null==t?void 0:t.event)),Yi(r,"click",this.Ad,{capture:!0}),this.Fd=e=>this.Od(e||(null==t?void 0:t.event)),Yi(r,"mousemove",this.Fd,{capture:!0}),this.Ld=new J_(this.instance,Z_,this.Rd.bind(this)),this.Ld.startIfEnabledOrStop(),this.Dd=this.At.bind(this),Yi(r,js,this.Dd),this.ns=!0)}Id(){var e;t&&r&&(this.Pd&&t.removeEventListener(Bs,this.Pd),this.Ad&&r.removeEventListener("click",this.Ad,{capture:!0}),this.Fd&&r.removeEventListener("mousemove",this.Fd,{capture:!0}),this.Dd&&r.removeEventListener(js,this.Dd),clearTimeout(this.$d),null==(e=this.Ld)||e.stop(),this.ns=!1)}Nd(e,i){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),a=function(e,i,r){for(var n=e;n&&gr(n)&&!mr(n,"body");){if(n===r)return!1;var s=void 0;try{var a,o,l;s=null==(a=null!==(o=null==(l=n.ownerDocument)?void 0:l.defaultView)&&void 0!==o?o:t)?void 0:a.getComputedStyle(n).position}catch(t){return!1}if(j(i,s))return!0;n=Ir(n)}return!1}(Tr(e),["fixed","sticky"],s);return{x:e.clientX+(a?0:n),y:e.clientY+(a?0:r),target_fixed:a,type:i}}Ei(t,e){var i;if(void 0===e&&(e="click"),!pr(t.target)&&Ik(t)){var r=this.Nd(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&$r(Tr(t),this.instance.config.rageclick)&&this.Vn(p({},r,{type:"rageclick"})),this.Vn(r)}}Od(t){!pr(t.target)&&Ik(t)&&(clearTimeout(this.$d),this.$d=setTimeout((()=>{this.Vn(this.Nd(t,"mousemove"))}),500))}Vn(e){if(t){var i=this.zi.disable_capture_url_hashes?Te(t.location.href):t.location.href,r=this.zi.custom_personal_data_properties,n=this.zi.mask_personal_data_properties?[...Do,...r||[]]:[],s=sr(i,n,No);this.bt=this.bt||{},this.bt[s]||(this.bt[s]=[]),this.bt[s].push(e)}}ja(){this.bt&&!J(this.bt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:J_,webVitalsAutocapture:class{constructor(t){var e;this.Td=!1,this.ns=!1,this.bt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.qd=()=>{clearTimeout(this.jd),this.jd=void 0,0!==this.bt.metrics.length&&(this._instance.capture("$web_vitals",p({$current_url:this.bt.url},this.bt.metrics.reduce(((t,e)=>p({},t,{["$web_vitals_"+e.name+"_event"]:p({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.bt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Bd=t=>{var e;if(this.bt=this.bt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},et(null==t?void 0:t.name)||et(null==t?void 0:t.value))wk.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.Hd(i);if(!K(r)){var n=it(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.Ud||this.Ud>t.value){this.bt.navigationKey!==n&&(this.qd(),this.jd=setTimeout(this.qd,this.flushToCaptureTimeoutMs)),K(this.bt.navigationKey)&&(this.bt.navigationKey=n,this.bt.url=r),this.bt.firstMetricTimestamp=K(this.bt.firstMetricTimestamp)?Date.now():this.bt.firstMetricTimestamp;var s=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=p({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Q(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var o={};for(var l of Ck){var u="url"===l&&"string"==typeof t.attribution[l]?this.Hd(t.attribution[l]):t.attribution[l];K(u)||(o[l]=u)}a.attribution=o}else delete a.attribution;K(s)||(a.$session_id=s.sessionId,a.$window_id=s.windowId),this.bt.metrics.push(a),this.bt.metrics.length===this.allowedMetrics.length&&this.qd()}else wk.error("Ignoring metric with value >= "+this.Ud,t)}}},this.zd=()=>{if(!this.ns){var t,e,i,r,n=!1,s=v.__PosthogExtensions__,a=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.Wd])||("web-vitals"===this.Wd&&K(a)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(!K(o)){var l=o.withoutAttribution,u=this.attributionMetrics;n=!K(l),t=u.indexOf("LCP")>-1?o.onLCP:(null==l?void 0:l.onLCP)||o.onLCP,e=u.indexOf("CLS")>-1?o.onCLS:(null==l?void 0:l.onCLS)||o.onCLS,i=u.indexOf("FCP")>-1?o.onFCP:(null==l?void 0:l.onFCP)||o.onFCP,r=u.indexOf("INP")>-1?o.onINP:(null==l?void 0:l.onINP)||o.onINP}if(t&&e&&i&&r){var h={reportSoftNavs:this.useSoftNavs},d=n&&this.attributionMetrics.indexOf("INP")>-1?p({},h,{includeProcessedEventEntries:!1}):h;this.allowedMetrics.indexOf("LCP")>-1&&t(this.Bd.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&e(this.Bd.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Bd.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&r(this.Bd.bind(this),d),this.ns=!0}else wk.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Td=!(null==(e=this._instance.persistence)||!e.props[Cn]),this.startIfEnabled()}get Vd(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Q(this.Vd)?null==(t=this.Vd)?void 0:t.web_vitals_allowed_metrics:void 0;return et(i)?(null==(e=this._instance.persistence)?void 0:e.props[In])||Sk:i}get flushToCaptureTimeoutMs(){return(Q(this.Vd)?this.Vd.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Q(this.Vd)?this.Vd.web_vitals_attribution:void 0;return nt(t)?t?Sk:[]:G(t)?t:xk}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t=Q(this.Vd)?this.Vd.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get Ud(){var t=Q(this.Vd)&&it(this.Vd.__web_vitals_max_value)?this.Vd.__web_vitals_max_value:kk;return t>0&&6e4>=t?kk:t}get isEnabled(){var t=null==n?void 0:n.protocol;if("http:"!==t&&"https:"!==t)return wk.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Q(this.Vd)?this.Vd.web_vitals:nt(this.Vd)?this.Vd:void 0;return nt(e)?e:this.Td}startIfEnabled(){this.isEnabled&&!this.ns&&(wk.info("enabled, starting..."),this.Es(this.zd))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Q(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Q(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Cn]:i}),this._instance.persistence.register({[In]:r})),this.Td=i,this.startIfEnabled()}}}get Wd(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Es(t){var e=v.__PosthogExtensions__,i=this.Wd,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&K(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,(e=>{e?wk.error("failed to load script",e):t()}))}Hd(e){var i=e||(null==t?void 0:t.location.href);if(i){var r=this._instance.config.disable_capture_url_hashes?Te(i):i,n=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Do,...n||[]]:[];return sr(r,s,No)}wk.error("Could not determine current URL")}}},gS={exceptionObserver:class{constructor(e){var i;this.zd=()=>{var e;if(t&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var i=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,n=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Gd&&this.zi.capture_unhandled_errors&&(this.Gd=i(this.captureException.bind(this))),!this.Zd&&this.zi.capture_unhandled_rejections&&(this.Zd=r(this.captureException.bind(this))),!this.Qd&&this.zi.capture_console_errors&&(this.Qd=n(this.captureException.bind(this)))}catch(t){bk.error("failed to start",t),this.Jd()}}},this._instance=e,this.Kd=!(null==(i=this._instance.persistence)||!i.props[kn]),this.oe=new mt(p({},function(t){var e,i,r,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(i=t.exceptionRateLimiterRefillRate)&&void 0!==i?i:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(r=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,I:bk})),this.zi=this.Yd(),this.startIfEnabledOrStop()}Yd(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Q(t)?e=p({},e,t):(K(t)?this.Kd:t)&&(e=p({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.zi.capture_console_errors||this.zi.capture_unhandled_errors||this.zi.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(bk.info("enabled"),this.Jd(),this.Es(this.zd)):this.Jd()}Es(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return bk.error("failed to load script",e);t()}))}Jd(){var t,e,i;null==(t=this.Gd)||t.call(this),this.Gd=void 0,null==(e=this.Zd)||e.call(this),this.Zd=void 0,null==(i=this.Qd)||i.call(this),this.Qd=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Kd=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[kn]:this.Kd}),this.zi=this.Yd(),this.startIfEnabledOrStop())}}onConfigChange(){this.zi=this.Yd()}captureException(t){var e,i,r,n=null!==(e=null==t||null==(i=t.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==e?e:"Exception";this.oe.consumeRateLimit(n)?bk.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,i;this.Xd=[],this.tv=um(),this._instance=t,this.Xd=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(Sn))&&void 0!==e?e:[],this.ev=Di(this.iv()),this.rv=new $i(this.ev)}onConfigChange(){this.ev=Di(this.iv()),this.rv.setConfig(this.ev)}onRemoteConfig(t){var e,i,r;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(i=n.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],a=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.Xd=s,this._instance.persistence&&this._instance.persistence.register({[Sn]:this.Xd,[xn]:a})}}}get nv(){var t,e=!!this._instance.get_property(xn),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.tv.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.ev.enabled)try{if(!Y(t)||0===t.trim().length)return void am.warn("Ignoring exception step because message must be a non-empty string");var i=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((i,r)=>Oi.has(r)?(e.push(r),i):(i[r]=t[r],i)),{}),droppedKeys:e}}(this.sv(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&am.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.rv.add(p({[Ai]:t,[Fi]:(new Date).toISOString()},r))}catch(t){am.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.av(e)){if(this.ov(e))return this.lv("Exception dropped: matched a suppression rule"),void am.info("Skipping exception capture because a suppression rule matched");if(!this.nv&&this.uv(e))return this.lv("Exception dropped: thrown by a browser extension"),void am.info("Skipping exception capture because it was thrown by an extension");if(!this.nv&&this.hv(e))return this.lv("Exception dropped: thrown by an injected browser script"),void am.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.dv(e))return this.lv("Exception dropped: thrown by the PostHog SDK"),void am.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.ev.enabled&&et(t.$exception_steps)?this.vv(t):t,r="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;r&&(i.$release_id=r);try{var n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",_l:!0});return n&&this.rv.clear(),n}catch(t){return am.error("Failed to capture exception event. Dropping this exception.",t),void this.rv.clear()}}catch(t){return void am.error("Failed to process exception event. Ignoring this exception.",t)}var s}vv(t){try{var e=this.rv.getAttachable();return 0===e.length?t:p({},t,{$exception_steps:e})}catch(e){return am.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}lv(t){this.ev.enabled&&this.rv.add({[Ai]:t,[Fi]:(new Date).toISOString()})}sv(t){return Q(t)?p({},t):{}}iv(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}ov(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var i=e.type,r=e.value;return Y(i)&&i.length>0&&t.$exception_types.push(i),Y(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.Xd.some((t=>{var i=t.values.map((t=>{var i=xo[t.operator],r=e[t.key];if(!i||!r)return!1;var n=G(t.value)?t.value:[t.value];return n.length>0&&i(n,r)}));return"OR"===t.type?i.some(Boolean):i.every(Boolean)}))}catch(t){return am.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}uv(t){var e=t.flatMap((t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}));return e.some((t=>{var e=t.filename;return!!e&&om.some((t=>e.startsWith(t)))}))}hv(t){return t.some((t=>{var e=t.value;return Y(e)&&lm.some((t=>e.includes(t)))}))}dv(t){if(t.length>0){var e,i,r,n,s=null!==(e=null==(i=t[0].stacktrace)?void 0:i.frames)&&void 0!==e?e:[],a=s[s.length-1];return null!==(r=null==a||null==(n=a.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}av(t){return!et(t)&&G(t)}}},mS=p({productTours:class{get Ja(){return this._instance.persistence}constructor(t){this.fv=null,this.pv=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var i,r;if(this.Ja&&this.Ja.register({[Mn]:!!e.productTours}),!Pk(this._instance))return!this.fv&&et(null==(i=this.Ja)?void 0:i.props[us])||Rk.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.fv)||r.stop(),this.fv=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.fv&&Pk(this._instance)&&this.Es((()=>this.gv()))}Es(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",(e=>{e?Rk.error("Could not load product tours script",e):t()}))}gv(){var t;!this.fv&&null!=(t=v.__PosthogExtensions__)&&t.generateProductTours&&(this.fv=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!G(this.pv)||e){var i=this.Ja;if(i){var r=i.props[us];if(G(r)&&!e)return this.pv=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:e=>{if(Pk(this._instance)){var r=e.statusCode;if(200!==r||!e.json){var n="Product Tours API could not be loaded, status: "+r;return 0===r?e.error||Rk.warn(n):Rk.error(n),void t([],{isLoaded:!1,error:n})}var s=G(e.json.product_tours)?e.json.product_tours:[];this.pv=s,i&&i.register({[us]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.pv,{isLoaded:!0})}getActiveProductTours(t){et(this.fv)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.fv.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.fv)||e.showTourById(t)}previewTour(t){this.fv?this.fv.previewTour(t):this.Es((()=>{var e;this.gv(),null==(e=this.fv)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.fv)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.fv)||t.nextStep()}previousStep(){var t;null==(t=this.fv)||t.previousStep()}clearCache(){var t;this.pv=null,null==(t=this.Ja)||t.unregister(us)}resetTour(t){var e;null==(e=this.fv)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.fv)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.fv)||e.cancelPendingTour(t)}}},cS),yS={siteApps:class{constructor(t){this.mv=0,this._instance=t,this.yv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}bv(t,e){if(e){var i=this.globalsForEvent(e);this.yv.push(i),this.yv.length>1e3&&(this.yv=this.yv.slice(10))}}get siteAppLoaders(){var t;return null==(t=v._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.bv.bind(this));this._v=()=>{t(),this.yv=[],this._v=void 0}}}globalsForEvent(t){var e,i,r,n,s,a,o;if(!t)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var d of Object.entries(h)){var v=d[0];l[v]={id:u[v],type:v,properties:d[1]}}var c=t.$set_once,f=t.$set;return{event:p({},g(t,Ak),{properties:p({},t.properties,f?{$set:p({},null!==(e=null==(i=t.properties)?void 0:i.$set)&&void 0!==e?e:{},f)}:{},c?{$set_once:p({},null!==(r=null==(n=t.properties)?void 0:n.$set_once)&&void 0!==r?r:{},c)}:{}),elements_chain:null!==(s=null==(a=t.properties)?void 0:a.$elements_chain)&&void 0!==s?s:"",distinct_id:null==(o=t.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}wv(t){var e,i=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Fk.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Fk.error("prepare_external_dependency_script returned null"),null):t}Sv(){var t,e,i,n,s,a,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var u=null==r?void 0:r.defaultView,h=null==u||null==(t=u.Node)?void 0:t.prototype;if(!u||!h)return()=>{};if(this.mv++,this.xv)return this.Cv();var d=[],v=this,c=new WeakSet,f=(t,e,i)=>{if(null!=t&&t[e]){var r=t[e];t[e]=i(r),d.push((()=>{t[e]=r}))}},p=t=>{if(c.has(t))return t;var e=v.wv(t);return e&&c.add(e),e},g=t=>t.map((t=>"string"==typeof t?t:p(t))).filter((t=>!tt(t)));return f(h,"appendChild",(t=>function(e){var i=p(e);return i?t.call(this,i):e})),f(h,"insertBefore",(t=>function(e,i){var r=p(e);return r?t.call(this,r,i):e})),f(h,"replaceChild",(t=>function(e,i){var r=p(e);return r?t.call(this,r,i):i})),[null==(e=u.Element)?void 0:e.prototype,null==(i=u.Document)?void 0:i.prototype,null==(n=u.DocumentFragment)?void 0:n.prototype].forEach((t=>{f(t,"append",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})),f(t,"prepend",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))}))})),[null==(s=u.Element)?void 0:s.prototype,null==(a=u.CharacterData)?void 0:a.prototype,null==(o=u.DocumentType)?void 0:o.prototype].forEach((t=>{f(t,"before",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})),f(t,"after",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,g(i))})),f(t,"replaceWith",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];var n=g(i);return i.length&&!n.length?void 0:t.apply(this,n)}))})),f(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",(t=>function(e,i){var r=p(i);return r?t.call(this,e,r):null})),this.xv=()=>{d.forEach((t=>t())),this.xv=void 0},this.Cv()}Cv(){var t=!1;return()=>{var e;t||(t=!0,this.mv--,0===this.mv&&(null==(e=this.xv)||e.call(this)))}}Tv(t,e){void 0===e&&(e=!0);var i=this.Sv();try{var r=t(i);return e&&i(),r}catch(t){throw i(),t}}setupSiteApp(t){var e=this.apps[t.id],i=()=>{var i;!e.errored&&this.yv.length&&(Fk.info("Processing "+this.yv.length+" events for site app with id "+t.id),this.yv.forEach((t=>this.Tv((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this._v)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,Fk.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.Tv((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){Fk.error(Ok+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){Fk.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}Mv(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of t)this.setupSiteApp(i)}Ev(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.Tv((()=>null==r.processEvent?void 0:r.processEvent(i)))}catch(e){Fk.error("Error while processing event "+t.event+" for site app "+r.id,e)}};for(var n of Object.values(this.apps))r(n)}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.Mv(),void this._instance.on("eventCaptured",(t=>this.Ev(t)))):void Fk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this._v)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var a=function(){var t,e=o.id,i=o.url;v["__$$ph_site_app_"+e]=n._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,(t=>{if(t)return Fk.error(Ok+e,t)}))};for(var o of s.siteApps)a()}else Fk.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},bS={tracingHeaders:class{constructor(t){this.Iv=void 0,this.Rv=void 0,this.Pv=void 0,this.zd=()=>{var t,e,i=this.Av();i?(K(this.Iv)&&(this.Iv=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),K(this.Rv)&&(this.Rv=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Jd()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Es(t){var e,i;null!=(e=v.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return _k.error("failed to load script",e);t()}))}Fv(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}Av(){var t=this.Fv();return G(t)?(G(this.Pv)?this.Pv.splice(0,this.Pv.length,...t):this.Pv=[...t],t.length>0?this.Pv:void 0):(G(this.Pv)&&this.Pv.splice(0),this.Pv=t||void 0,this.Pv)}Jd(){var t,e;null==(t=this.Iv)||t.call(this),null==(e=this.Rv)||e.call(this),this.Iv=void 0,this.Rv=void 0}startIfEnabledOrStop(){this.Av()?this.Es(this.zd):this.Jd()}}},_S=p({surveys:class extends Nk{constructor(t){var e;super(new zk(t),{get projectToken(){return e.config.token},kv:new Uk(e=t)}),this._instance=t}Wl(t,e){var i=e.query?_w(t,e.query):t;return new Promise((t=>{var r;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",i),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:t})}))}}},cS),wS={toolbar:class{constructor(t){this.instance=t}Ov(t){v.ph_toolbar_state=t}Lv(){var t;return null!==(t=v.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,i,n){if(void 0===e&&(e=void 0),void 0===i&&(i=void 0),void 0===n&&(n=void 0),Xi(this.instance.config))return!1;if(!t||!r)return!1;e=null!=e?e:t.location,n=null!=n?n:t.history;try{if(!i){try{t.localStorage.setItem("test","test"),t.localStorage.removeItem("test")}catch(t){return!1}i=null==t?void 0:t.localStorage}var s,a=Wk||ar(e.hash,"__posthog")||ar(e.hash,"state"),o=a?Gi((()=>JSON.parse(atob(decodeURIComponent(a)))))||Gi((()=>JSON.parse(decodeURIComponent(a)))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(i.getItem(Vk)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(t){return!1}}Dv(t){var e=v.ph_load_toolbar||v.ph_load_editor;!et(e)&&Z(e)?e(t,this.instance):Gk.warn("No toolbar load function found")}loadToolbar(e){var i=!(null==r||!r.getElementById(dr));if(!t||i)return!1;var n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=p({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(t.localStorage.setItem(Vk,JSON.stringify(p({},s,{source:void 0}))),2===this.Lv())this.Dv(s);else if(0===this.Lv()){var a;this.Ov(1),null==(a=v.__PosthogExtensions__)||null==a.loadExternalDependency||a.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Gk.error("[Toolbar] Failed to load",t),void this.Ov(0);this.Ov(2),this.Dv(s)})),Yi(t,"turbolinks:load",(()=>{this.Ov(0),this.loadToolbar(s)}))}return!0}$v(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,i){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(t,e,i)}}},kS=p({experiments:nS},cS),SS={conversations:class{constructor(t){this.Nv=void 0,this._conversationsManager=null,this.qv=!1,this.Me=null,this.jv=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Bv=t.ok,t.ok)){var e=t.config.conversations;et(e)||(nt(e)?this.Nv=e:(this.Nv=e.enabled,this.Me=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Nv=void 0,this.Me=null,this.Bv=void 0,this.jv=!1}loadIfEnabled(){if(!(this._conversationsManager||this.qv||this._instance.config.disable_conversations||Xi(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==v?void 0:v.__PosthogExtensions__;if(t&&!K(this.Nv)&&this.Nv)if(this.Me&&this.Me.token){this.qv=!0;try{var e=t.initConversations;if(e)return this.Hv(e),void(this.qv=!1);var i=t.loadExternalDependency;if(!i)return void this.Uv(Os);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.Uv("Could not load conversations script",e):this.Hv(t.initConversations),this.qv=!1}))}catch(t){this.Uv("Error initializing conversations",t),this.qv=!1}}else sS.error("Conversations enabled but missing token in remote config.")}}Hv(t){if(this.Me)try{this._conversationsManager=t(this.Me,this._instance),this.jv=!1,sS.info("Conversations loaded successfully")}catch(t){this.Uv("Error completing conversations initialization",t)}else sS.error("Cannot complete initialization: remote config is null")}Uv(t,e){sS.error(t,e),this._conversationsManager=null,this.qv=!1,this.jv=!0}show(){this._conversationsManager?this._conversationsManager.show():sS.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Nv&&!tt(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Xi(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Bv?"remote_config_failed":K(this.Nv)?this.Bv?"disabled_in_project":"remote_config_pending":this.Nv?et(this.Me)||!this.Me.token?"missing_token":null!=v&&v.__PosthogExtensions__?this.qv?"initializing":this.jv?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,e,i){var r=this;return f((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(sS.warn(aS),null)}))()}getMessages(t,e){var i=this;return f((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(sS.warn(aS),null)}))()}markAsRead(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(sS.warn(aS),null)}))()}getTickets(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(sS.warn(aS),null)}))()}requestRestoreLink(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(sS.warn(aS),null)}))()}restoreFromToken(t){var e=this;return f((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(sS.warn(aS),null)}))()}restoreFromUrlToken(){var t=this;return f((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(sS.warn(aS),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}Il(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Rl(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},xS={logs:class{constructor(e){var i,r=this;this.name=Yf,this.zv=!1,this.Wv=!1,this.Vv=!1,this.I=Hi("[logs]"),this.Gv=p({},this.I,{error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];e.some(vS)||r.I.error(...e)}}),this.Ea=[],this.Zv=[],this.kh=0,this.us=!1,this.Qv=[],this.Jv=[],this.Kv=!1,this.Yv=!1,this.Xv=()=>{var t,e;this.us||(this.kh=0,null==(t=this.tc)||t.onReconnect(),null==(e=this.ec)||e.onReconnect())},this._instance=e,this._instance&&null!=(i=this._instance.config.logs)&&i.captureConsoleLogs&&(this.zv=!0),t&&Yi(t,"online",this.Xv)}ic(t,e,i,r){var n,s=oS(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new Ye(this.rc(t,e),s,this.Gv,(()=>this.nc()),(t=>t()),void 0,r),s]}sc(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.tc||this.ac!==e){var i;null==(i=this.tc)||i.reset(),this.ac=e;var r=this.ic((()=>this.Ea),(t=>{this.Ea=t}));this.tc=r[0],this.oc=r[1]}return this.tc}lc(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.ec||this.uc!==e){var i;null==(i=this.ec)||i.reset(),this.uc=e;var r=this.ic((()=>this.Zv),(t=>{this.Zv=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},uS);this.ec=r[0],this.hc=r[1]}return this.ec}setup(t){var e;if(!this.us){this.cs=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.zv=!0),(this.zv||this.dc()&&this.vc())&&this.cc();var i=!1,r=t.onRemoteConfig((t=>{var e;i=t.ok&&!0===(null==(e=t.config.logs)?void 0:e.captureConsoleLogs),this.onRemoteConfig(t)}));this.us?r.dispose():(this.fs=r,i||this.loadIfEnabled())}}dispose(){var e,i,r,n;this.us||(this.us=!0,this.fc(),null==(e=this.fs)||e.dispose(),this.fs=void 0,this.cs=void 0,this.Vv=!1,null==t||t.removeEventListener("online",this.Xv),null==(i=this.gc)||i.call(this),this.gc=void 0,null==(r=this.tc)||r.reset(),null==(n=this.ec)||n.reset())}onRemoteConfig(t){var e,i;if(!this.us){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;et(r)?this.mc():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[En]:!!r}),r?(this.zv=!0,this.Wv||this.cc(),this.loadIfEnabled()):this.mc())}}reset(){var t,e,i,r;this.fc(),null==(t=this.tc)||t.clearQueue(),this.Ea=[],null==(e=this.tc)||e.reset(),null==(i=this.ec)||i.clearQueue(),this.Zv=[],null==(r=this.ec)||r.reset(),this.kh=0}captureLog(t){this.us||this.sc().captureLog(t)}captureConsoleLog(t){this.us||this.lc().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.us||this.lc().captureLog(t,{context:e,occurredAtMs:i})}vc(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[En])}dc(){var t,e;return null==(t=this._instance)||null==t.xa||!t.xa()||!(null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}Al(){var t;this.fc(),null==(t=this.ec)||t.clearQueue(),this.Zv=[]}mc(){this.zv||this.fc()}cc(){var t,e=this;if(!this.Kv&&null!=v&&v.console){var i=oS(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=Zg(v.console[t])}catch(t){return 0}if(!r)return 0;e.Jv.push(Dv(v.console,t,(n=>{var s=function(){for(var r=arguments.length,s=new Array(r),a=0;r>a;a++)s[a]=arguments[a];try{e.yc(t,s,i)}catch(t){}return n.apply(v.console,s)};return s.__rrweb_original__=r,s})))};for(var n of lS)r(n);this.Kv=!0,this.bc=setTimeout((()=>{this.fc()}),3e4)}}yc(t,e,i){var r;if(this.Kv&&!this.Yv&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this.Qv.length){this.Yv=!0;try{this.Qv.push({level:t,args:e,occurredAtMs:Date.now(),context:this.nc()})}finally{this.Yv=!1}}}else this.fc()}fc(){if(this.Qv=[],this.Kv){for(var t of(this.Kv=!1,this.bc&&(clearTimeout(this.bc),this.bc=void 0),this.Jv))t();this.Jv=[]}}_c(){var t=this.Qv;return this.fc(),t}get logger(){return this.wc||(this.wc={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.wc}flushLogs(t){t?this.kc(t):(this.tc&&this.tc.flush().catch((t=>this.Sc(t))),this.ec&&this.ec.flush().catch((t=>this.Sc(t))))}Sc(t){vS(t)||this.I.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.us&&this.zv&&!this.Wv&&!this.Vv){var t=null==v?void 0:v.__PosthogExtensions__;if(!t)return this.I.error("PostHog Extensions not found."),void this.fc();var e=t.loadExternalDependency;if(!e)return this.I.error(Os),void this.fc();this.Vv=!0;try{e(this._instance,"logs",(e=>{if(this.Vv=!1,!this.us&&this.zv){var i=t.logs;if(e||null==i||!i.initializeLogs)this.I.error("Could not load logs script",e),this.fc();else{var r,n,s=this._c();this.gc=i.initializeLogs(null!==(r=this.cs)&&void 0!==r?r:this._instance),this.Wv=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.cs)&&void 0!==n?n:this._instance,s))}}}))}catch(t){throw this.Vv=!1,t}}}rc(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===S.LogsQueue?t():void 0,setPersistedProperty(t,i){var r;t===S.LogsQueue&&e(null!==(r=i)&&void 0!==r?r:[])},Ln:t=>this.Ln(t),getLibraryId:()=>qi.LIB_NAME,getLibraryVersion:()=>qi.LIB_VERSION}}Ln(t){return new Promise((e=>{if(or(this.kh,3))e({kind:"fatal",error:dS(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=t=>{i||(i=!0,clearTimeout(n),e(t))},n=setTimeout((()=>{this.I.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:dS(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.xc(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Cc(e),e>=200&&300>e)r({kind:"ok"});else if(413===e)r({kind:"too-large"});else if(0!==e&&408!==e&&429!==e&&500>e)r({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var i;0===e?(t.error||this.I.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:dS(t.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("logs request failed with status "+e)})}}})}}))}Cc(t){(0!==t||this._instance.__loaded)&&(this.kh=lr(t,this.kh,3,(()=>this.I.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}kc(t){this.Ea.length>0&&this.Tc(t,this.Ea,this.oc,qi.LIB_NAME,(t=>{this.Ea=t})),this.Zv.length>0&&this.Tc(t,this.Zv,this.hc,uS,(t=>{this.Zv=t}))}Tc(t,e,i,r,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var a=Ke(s,Je(i,qi.LIB_NAME,qi.LIB_VERSION),r,qi.LIB_VERSION);this._instance._send_request({method:"POST",url:this.xc(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}xc(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}nc(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=i.windowId,n=i.sessionStartTimestamp,s=i.lastActivityTimestamp;e.sessionId=i.sessionId,e.windowId=r,et(n)||(e.sessionStartTimestamp=n),et(s)||(e.lastActivityTimestamp=s)}if(null!=v&&null!=(t=v.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Te(v.location.href):v.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},CS={metrics:class{constructor(t){this.I=Hi("[metrics]"),this._instance=t}initialize(){}sc(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.tc&&this.ac===i||(null==(e=this.tc)||e.reset(),this.ac=i,this.tc=new ii(this.rc(),function(t){var e,i,r,n,s,a=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==a?void 0:a["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==a?void 0:a["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==a?void 0:a["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:a,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(i),this.I)),this.tc}count(t,e,i){void 0===e&&(e=1),this.sc().count(t,e,i)}gauge(t,e,i){this.sc().gauge(t,e,i)}histogram(t,e,i){this.sc().histogram(t,e,i)}flush(t){if(!this.tc)return Promise.resolve();if(t){var e=this.tc.drainWindow();return e&&this.Kn(e,t),Promise.resolve()}return this.tc.flush().catch((t=>this.I.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.tc)||t.reset()}rc(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Kn:t=>e.Kn(t),getLibraryId:()=>qi.LIB_NAME,getLibraryVersion:()=>qi.LIB_VERSION}}Kn(t,e){return new Promise((i=>{var r=!1,n=t=>{r||(r=!0,clearTimeout(s),i(t))},s=setTimeout((()=>n({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(p({method:"POST",url:this.Mc(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)n({kind:"ok"});else if(413===e)n({kind:"too-large"});else if(0!==e&&408!==e&&429!==e&&500>e)n({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var i;n({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("metrics request failed with status "+e)})}}}))}))}Mc(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},TS=p({},cS,fS,pS,gS,mS,yS,_S,bS,wS,kS,SS,xS,CS);mk.__defaultExtensionClasses=p({},TS),function(){qi.SDK_DIST_CHANNEL="cdn";var e=v.posthog;if(!e||G(e._i)){var i=ik[hk]=new mk;if(e){var n=[];zi(e._i,(function(t){if(t&&G(t)){var r=i.init(t[0],t[1],t[2]),s=e[t[2]]||e;r.__loaded&&-1===n.indexOf(s)&&(n.push(s),r._execute_array.call(r.people,s.people),r._execute_array(s))}}))}i.__SV=1,v.posthog=i,function(){function e(){e.done||(e.done=!0,dk=!1,zi(ik,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():Yi(r,"DOMContentLoaded",e,{capture:!1}):t&&Bi.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}();
2
2
  //# sourceMappingURL=array.full.js.map